• Home
  • Raw
  • Download

Lines Matching refs:rdev

70 	struct cfg802154_registered_device *result = NULL, *rdev;  in cfg802154_rdev_by_wpan_phy_idx()  local
74 list_for_each_entry(rdev, &cfg802154_rdev_list, list) { in cfg802154_rdev_by_wpan_phy_idx()
75 if (rdev->wpan_phy_idx == wpan_phy_idx) { in cfg802154_rdev_by_wpan_phy_idx()
76 result = rdev; in cfg802154_rdev_by_wpan_phy_idx()
86 struct cfg802154_registered_device *rdev; in wpan_phy_idx_to_wpan_phy() local
90 rdev = cfg802154_rdev_by_wpan_phy_idx(wpan_phy_idx); in wpan_phy_idx_to_wpan_phy()
91 if (!rdev) in wpan_phy_idx_to_wpan_phy()
93 return &rdev->wpan_phy; in wpan_phy_idx_to_wpan_phy()
100 struct cfg802154_registered_device *rdev; in wpan_phy_new() local
103 alloc_size = sizeof(*rdev) + priv_size; in wpan_phy_new()
104 rdev = kzalloc(alloc_size, GFP_KERNEL); in wpan_phy_new()
105 if (!rdev) in wpan_phy_new()
108 rdev->ops = ops; in wpan_phy_new()
110 rdev->wpan_phy_idx = atomic_inc_return(&wpan_phy_counter); in wpan_phy_new()
112 if (unlikely(rdev->wpan_phy_idx < 0)) { in wpan_phy_new()
115 kfree(rdev); in wpan_phy_new()
120 rdev->wpan_phy_idx--; in wpan_phy_new()
122 INIT_LIST_HEAD(&rdev->wpan_dev_list); in wpan_phy_new()
123 device_initialize(&rdev->wpan_phy.dev); in wpan_phy_new()
124 dev_set_name(&rdev->wpan_phy.dev, PHY_NAME "%d", rdev->wpan_phy_idx); in wpan_phy_new()
126 rdev->wpan_phy.dev.class = &wpan_phy_class; in wpan_phy_new()
127 rdev->wpan_phy.dev.platform_data = rdev; in wpan_phy_new()
129 wpan_phy_net_set(&rdev->wpan_phy, &init_net); in wpan_phy_new()
131 init_waitqueue_head(&rdev->dev_wait); in wpan_phy_new()
133 return &rdev->wpan_phy; in wpan_phy_new()
139 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(phy); in wpan_phy_register() local
149 list_add_rcu(&rdev->list, &cfg802154_rdev_list); in wpan_phy_register()
163 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(phy); in wpan_phy_unregister() local
165 wait_event(rdev->dev_wait, ({ in wpan_phy_unregister()
168 __count = rdev->opencount; in wpan_phy_unregister()
176 WARN_ON(!list_empty(&rdev->wpan_dev_list)); in wpan_phy_unregister()
181 list_del_rcu(&rdev->list); in wpan_phy_unregister()
198 int cfg802154_switch_netns(struct cfg802154_registered_device *rdev, in cfg802154_switch_netns() argument
204 list_for_each_entry(wpan_dev, &rdev->wpan_dev_list, list) { in cfg802154_switch_netns()
216 net = wpan_phy_net(&rdev->wpan_phy); in cfg802154_switch_netns()
219 &rdev->wpan_dev_list, in cfg802154_switch_netns()
233 wpan_phy_net_set(&rdev->wpan_phy, net); in cfg802154_switch_netns()
235 err = device_rename(&rdev->wpan_phy.dev, dev_name(&rdev->wpan_phy.dev)); in cfg802154_switch_netns()
241 void cfg802154_dev_free(struct cfg802154_registered_device *rdev) in cfg802154_dev_free() argument
243 kfree(rdev); in cfg802154_dev_free()
247 cfg802154_update_iface_num(struct cfg802154_registered_device *rdev, in cfg802154_update_iface_num() argument
252 rdev->num_running_ifaces += num; in cfg802154_update_iface_num()
260 struct cfg802154_registered_device *rdev; in cfg802154_netdev_notifier_call() local
265 rdev = wpan_phy_to_rdev(wpan_dev->wpan_phy); in cfg802154_netdev_notifier_call()
273 wpan_dev->identifier = ++rdev->wpan_dev_id; in cfg802154_netdev_notifier_call()
274 list_add_rcu(&wpan_dev->list, &rdev->wpan_dev_list); in cfg802154_netdev_notifier_call()
275 rdev->devlist_generation++; in cfg802154_netdev_notifier_call()
280 cfg802154_update_iface_num(rdev, wpan_dev->iftype, -1); in cfg802154_netdev_notifier_call()
282 rdev->opencount--; in cfg802154_netdev_notifier_call()
283 wake_up(&rdev->dev_wait); in cfg802154_netdev_notifier_call()
286 cfg802154_update_iface_num(rdev, wpan_dev->iftype, 1); in cfg802154_netdev_notifier_call()
288 rdev->opencount++; in cfg802154_netdev_notifier_call()
299 rdev->devlist_generation++; in cfg802154_netdev_notifier_call()
322 struct cfg802154_registered_device *rdev; in cfg802154_pernet_exit() local
325 list_for_each_entry(rdev, &cfg802154_rdev_list, list) { in cfg802154_pernet_exit()
326 if (net_eq(wpan_phy_net(&rdev->wpan_phy), net)) in cfg802154_pernet_exit()
327 WARN_ON(cfg802154_switch_netns(rdev, &init_net)); in cfg802154_pernet_exit()