Lines Matching refs:rdev
84 struct cfg802154_registered_device *result = NULL, *rdev; in cfg802154_rdev_by_wpan_phy_idx() local
88 list_for_each_entry(rdev, &cfg802154_rdev_list, list) { in cfg802154_rdev_by_wpan_phy_idx()
89 if (rdev->wpan_phy_idx == wpan_phy_idx) { in cfg802154_rdev_by_wpan_phy_idx()
90 result = rdev; in cfg802154_rdev_by_wpan_phy_idx()
100 struct cfg802154_registered_device *rdev; in wpan_phy_idx_to_wpan_phy() local
104 rdev = cfg802154_rdev_by_wpan_phy_idx(wpan_phy_idx); in wpan_phy_idx_to_wpan_phy()
105 if (!rdev) in wpan_phy_idx_to_wpan_phy()
107 return &rdev->wpan_phy; in wpan_phy_idx_to_wpan_phy()
114 struct cfg802154_registered_device *rdev; in wpan_phy_new() local
117 alloc_size = sizeof(*rdev) + priv_size; in wpan_phy_new()
118 rdev = kzalloc(alloc_size, GFP_KERNEL); in wpan_phy_new()
119 if (!rdev) in wpan_phy_new()
122 rdev->ops = ops; in wpan_phy_new()
124 rdev->wpan_phy_idx = atomic_inc_return(&wpan_phy_counter); in wpan_phy_new()
126 if (unlikely(rdev->wpan_phy_idx < 0)) { in wpan_phy_new()
129 kfree(rdev); in wpan_phy_new()
134 rdev->wpan_phy_idx--; in wpan_phy_new()
136 INIT_LIST_HEAD(&rdev->wpan_dev_list); in wpan_phy_new()
137 device_initialize(&rdev->wpan_phy.dev); in wpan_phy_new()
138 dev_set_name(&rdev->wpan_phy.dev, PHY_NAME "%d", rdev->wpan_phy_idx); in wpan_phy_new()
140 rdev->wpan_phy.dev.class = &wpan_phy_class; in wpan_phy_new()
141 rdev->wpan_phy.dev.platform_data = rdev; in wpan_phy_new()
143 init_waitqueue_head(&rdev->dev_wait); in wpan_phy_new()
145 return &rdev->wpan_phy; in wpan_phy_new()
151 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(phy); in wpan_phy_register() local
161 list_add_rcu(&rdev->list, &cfg802154_rdev_list); in wpan_phy_register()
175 struct cfg802154_registered_device *rdev = wpan_phy_to_rdev(phy); in wpan_phy_unregister() local
177 wait_event(rdev->dev_wait, ({ in wpan_phy_unregister()
180 __count = rdev->opencount; in wpan_phy_unregister()
188 WARN_ON(!list_empty(&rdev->wpan_dev_list)); in wpan_phy_unregister()
193 list_del_rcu(&rdev->list); in wpan_phy_unregister()
210 void cfg802154_dev_free(struct cfg802154_registered_device *rdev) in cfg802154_dev_free() argument
212 kfree(rdev); in cfg802154_dev_free()
216 cfg802154_update_iface_num(struct cfg802154_registered_device *rdev, in cfg802154_update_iface_num() argument
221 rdev->num_running_ifaces += num; in cfg802154_update_iface_num()
229 struct cfg802154_registered_device *rdev; in cfg802154_netdev_notifier_call() local
234 rdev = wpan_phy_to_rdev(wpan_dev->wpan_phy); in cfg802154_netdev_notifier_call()
242 wpan_dev->identifier = ++rdev->wpan_dev_id; in cfg802154_netdev_notifier_call()
243 list_add_rcu(&wpan_dev->list, &rdev->wpan_dev_list); in cfg802154_netdev_notifier_call()
244 rdev->devlist_generation++; in cfg802154_netdev_notifier_call()
249 cfg802154_update_iface_num(rdev, wpan_dev->iftype, -1); in cfg802154_netdev_notifier_call()
251 rdev->opencount--; in cfg802154_netdev_notifier_call()
252 wake_up(&rdev->dev_wait); in cfg802154_netdev_notifier_call()
255 cfg802154_update_iface_num(rdev, wpan_dev->iftype, 1); in cfg802154_netdev_notifier_call()
257 rdev->opencount++; in cfg802154_netdev_notifier_call()
268 rdev->devlist_generation++; in cfg802154_netdev_notifier_call()