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()
116 if ((0x1 << np->id) == ndp->package_whitelist) in ncsi_write_package_info()
130 rc = ncsi_write_channel_info(skb, ndp, nc); in ncsi_write_package_info()
152 struct ncsi_dev_priv *ndp; in ncsi_pkg_info_nl() local
168 ndp = ndp_from_ifindex(genl_info_net(info), in ncsi_pkg_info_nl()
170 if (!ndp) in ncsi_pkg_info_nl()
191 rc = ncsi_write_package_info(skb, ndp, package_id); in ncsi_pkg_info_nl()
213 struct ncsi_dev_priv *ndp; in ncsi_pkg_info_all_nl() local
227 ndp = ndp_from_ifindex(get_net(sock_net(skb->sk)), in ncsi_pkg_info_all_nl()
230 if (!ndp) in ncsi_pkg_info_all_nl()
235 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_pkg_info_all_nl()
254 rc = ncsi_write_package_info(skb, ndp, package->id); in ncsi_pkg_info_all_nl()
276 struct ncsi_dev_priv *ndp; in ncsi_set_interface_nl() local
288 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_set_interface_nl()
290 if (!ndp) in ncsi_set_interface_nl()
296 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_set_interface_nl()
313 netdev_info(ndp->ndev.dev, in ncsi_set_interface_nl()
320 spin_lock_irqsave(&ndp->lock, flags); in ncsi_set_interface_nl()
321 ndp->package_whitelist = 0x1 << package->id; in ncsi_set_interface_nl()
322 ndp->multi_package = false; in ncsi_set_interface_nl()
323 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_set_interface_nl()
338 netdev_info(ndp->ndev.dev, in ncsi_set_interface_nl()
342 netdev_info(ndp->ndev.dev, "Set package 0x%x as preferred\n", in ncsi_set_interface_nl()
346 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_set_interface_nl()
347 ncsi_reset_dev(&ndp->ndev); in ncsi_set_interface_nl()
354 struct ncsi_dev_priv *ndp; in ncsi_clear_interface_nl() local
364 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_clear_interface_nl()
366 if (!ndp) in ncsi_clear_interface_nl()
370 spin_lock_irqsave(&ndp->lock, flags); in ncsi_clear_interface_nl()
371 ndp->package_whitelist = UINT_MAX; in ncsi_clear_interface_nl()
372 ndp->multi_package = false; in ncsi_clear_interface_nl()
373 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_clear_interface_nl()
375 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_clear_interface_nl()
382 netdev_info(ndp->ndev.dev, "NCSI: Cleared preferred package/channel\n"); in ncsi_clear_interface_nl()
385 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_clear_interface_nl()
386 ncsi_reset_dev(&ndp->ndev); in ncsi_clear_interface_nl()
393 struct ncsi_dev_priv *ndp; in ncsi_send_cmd_nl() local
426 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_send_cmd_nl()
428 if (!ndp) { in ncsi_send_cmd_nl()
443 netdev_info(ndp->ndev.dev, "NCSI: no command to send %u\n", in ncsi_send_cmd_nl()
453 nca.ndp = ndp; in ncsi_send_cmd_nl()
465 netdev_err(ndp->ndev.dev, in ncsi_send_cmd_nl()
468 ncsi_send_netlink_err(ndp->ndev.dev, in ncsi_send_cmd_nl()
590 struct ncsi_dev_priv *ndp; in ncsi_set_package_mask_nl() local
603 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_set_package_mask_nl()
605 if (!ndp) in ncsi_set_package_mask_nl()
608 spin_lock_irqsave(&ndp->lock, flags); in ncsi_set_package_mask_nl()
610 if (ndp->flags & NCSI_DEV_HWA) { in ncsi_set_package_mask_nl()
611 ndp->multi_package = true; in ncsi_set_package_mask_nl()
614 netdev_err(ndp->ndev.dev, in ncsi_set_package_mask_nl()
619 ndp->multi_package = false; in ncsi_set_package_mask_nl()
624 ndp->package_whitelist = in ncsi_set_package_mask_nl()
626 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_set_package_mask_nl()
630 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_set_package_mask_nl()
631 ncsi_reset_dev(&ndp->ndev); in ncsi_set_package_mask_nl()
643 struct ncsi_dev_priv *ndp; in ncsi_set_channel_mask_nl() local
658 ndp = ndp_from_ifindex(get_net(sock_net(msg->sk)), in ncsi_set_channel_mask_nl()
660 if (!ndp) in ncsi_set_channel_mask_nl()
665 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_set_channel_mask_nl()
687 netdev_dbg(ndp->ndev.dev, in ncsi_set_channel_mask_nl()
695 netdev_dbg(ndp->ndev.dev, in ncsi_set_channel_mask_nl()
703 netdev_info(ndp->ndev.dev, in ncsi_set_channel_mask_nl()
713 if (!(ndp->flags & NCSI_DEV_RESET)) in ncsi_set_channel_mask_nl()
714 ncsi_reset_dev(&ndp->ndev); in ncsi_set_channel_mask_nl()