Lines Matching refs:ndp

36 	struct ncsi_dev_priv *ndp;  in ndp_from_ifindex()  local
51 ndp = nd ? TO_NCSI_DEV_PRIV(nd) : NULL; in ndp_from_ifindex()
54 return ndp; in ndp_from_ifindex()
58 struct ncsi_dev_priv *ndp, in ncsi_write_channel_info() argument
95 struct ncsi_dev_priv *ndp, unsigned int id) in ncsi_write_package_info() argument
103 if (id > ndp->package_num - 1) { in ncsi_write_package_info()
104 netdev_info(ndp->ndev.dev, "NCSI: No package with id %u\n", id); in ncsi_write_package_info()
109 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_write_package_info()
120 if ((0x1 << np->id) == ndp->package_whitelist) in ncsi_write_package_info()
134 rc = ncsi_write_channel_info(skb, ndp, nc); in ncsi_write_package_info()
156 struct ncsi_dev_priv *ndp; in ncsi_pkg_info_nl() local
172 ndp = ndp_from_ifindex(genl_info_net(info), in ncsi_pkg_info_nl()
174 if (!ndp) in ncsi_pkg_info_nl()
195 rc = ncsi_write_package_info(skb, ndp, package_id); in ncsi_pkg_info_nl()
217 struct ncsi_dev_priv *ndp; in ncsi_pkg_info_all_nl() local
231 ndp = ndp_from_ifindex(get_net(sock_net(skb->sk)), in ncsi_pkg_info_all_nl()
234 if (!ndp) in ncsi_pkg_info_all_nl()
239 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_pkg_info_all_nl()
258 rc = ncsi_write_package_info(skb, ndp, package->id); in ncsi_pkg_info_all_nl()
280 struct ncsi_dev_priv *ndp; in ncsi_set_interface_nl() local
292 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_set_interface_nl()
294 if (!ndp) in ncsi_set_interface_nl()
300 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_set_interface_nl()
317 netdev_info(ndp->ndev.dev, in ncsi_set_interface_nl()
324 spin_lock_irqsave(&ndp->lock, flags); in ncsi_set_interface_nl()
325 ndp->package_whitelist = 0x1 << package->id; in ncsi_set_interface_nl()
326 ndp->multi_package = false; in ncsi_set_interface_nl()
327 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_set_interface_nl()
342 netdev_info(ndp->ndev.dev, in ncsi_set_interface_nl()
346 netdev_info(ndp->ndev.dev, "Set package 0x%x as preferred\n", in ncsi_set_interface_nl()
350 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_set_interface_nl()
351 ncsi_reset_dev(&ndp->ndev); in ncsi_set_interface_nl()
358 struct ncsi_dev_priv *ndp; in ncsi_clear_interface_nl() local
368 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_clear_interface_nl()
370 if (!ndp) in ncsi_clear_interface_nl()
374 spin_lock_irqsave(&ndp->lock, flags); in ncsi_clear_interface_nl()
375 ndp->package_whitelist = UINT_MAX; in ncsi_clear_interface_nl()
376 ndp->multi_package = false; in ncsi_clear_interface_nl()
377 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_clear_interface_nl()
379 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_clear_interface_nl()
386 netdev_info(ndp->ndev.dev, "NCSI: Cleared preferred package/channel\n"); in ncsi_clear_interface_nl()
389 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_clear_interface_nl()
390 ncsi_reset_dev(&ndp->ndev); in ncsi_clear_interface_nl()
397 struct ncsi_dev_priv *ndp; in ncsi_send_cmd_nl() local
430 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_send_cmd_nl()
432 if (!ndp) { in ncsi_send_cmd_nl()
447 netdev_info(ndp->ndev.dev, "NCSI: no command to send %u\n", in ncsi_send_cmd_nl()
457 nca.ndp = ndp; in ncsi_send_cmd_nl()
469 netdev_err(ndp->ndev.dev, in ncsi_send_cmd_nl()
472 ncsi_send_netlink_err(ndp->ndev.dev, in ncsi_send_cmd_nl()
594 struct ncsi_dev_priv *ndp; in ncsi_set_package_mask_nl() local
607 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_set_package_mask_nl()
609 if (!ndp) in ncsi_set_package_mask_nl()
612 spin_lock_irqsave(&ndp->lock, flags); in ncsi_set_package_mask_nl()
614 if (ndp->flags & NCSI_DEV_HWA) { in ncsi_set_package_mask_nl()
615 ndp->multi_package = true; in ncsi_set_package_mask_nl()
618 netdev_err(ndp->ndev.dev, in ncsi_set_package_mask_nl()
623 ndp->multi_package = false; in ncsi_set_package_mask_nl()
628 ndp->package_whitelist = in ncsi_set_package_mask_nl()
630 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_set_package_mask_nl()
634 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_set_package_mask_nl()
635 ncsi_reset_dev(&ndp->ndev); in ncsi_set_package_mask_nl()
647 struct ncsi_dev_priv *ndp; in ncsi_set_channel_mask_nl() local
662 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_set_channel_mask_nl()
664 if (!ndp) in ncsi_set_channel_mask_nl()
669 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_set_channel_mask_nl()
691 netdev_dbg(ndp->ndev.dev, in ncsi_set_channel_mask_nl()
699 netdev_dbg(ndp->ndev.dev, in ncsi_set_channel_mask_nl()
707 netdev_info(ndp->ndev.dev, in ncsi_set_channel_mask_nl()
717 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_set_channel_mask_nl()
718 ncsi_reset_dev(&ndp->ndev); in ncsi_set_channel_mask_nl()