Lines Matching refs:drv
42 struct cfg80211_registered_device *result = NULL, *drv; in cfg80211_drv_by_wiphy() local
44 list_for_each_entry(drv, &cfg80211_drv_list, list) { in cfg80211_drv_by_wiphy()
45 if (drv->idx == wiphy) { in cfg80211_drv_by_wiphy()
46 result = drv; in cfg80211_drv_by_wiphy()
99 struct cfg80211_registered_device *drv; in cfg80211_get_dev_from_info() local
102 drv = __cfg80211_drv_from_info(info); in cfg80211_get_dev_from_info()
107 if (!IS_ERR(drv)) in cfg80211_get_dev_from_info()
108 mutex_lock(&drv->mtx); in cfg80211_get_dev_from_info()
112 return drv; in cfg80211_get_dev_from_info()
118 struct cfg80211_registered_device *drv = ERR_PTR(-ENODEV); in cfg80211_get_dev_from_ifindex() local
126 drv = wiphy_to_dev(dev->ieee80211_ptr->wiphy); in cfg80211_get_dev_from_ifindex()
127 mutex_lock(&drv->mtx); in cfg80211_get_dev_from_ifindex()
129 drv = ERR_PTR(-ENODEV); in cfg80211_get_dev_from_ifindex()
133 return drv; in cfg80211_get_dev_from_ifindex()
136 void cfg80211_put_dev(struct cfg80211_registered_device *drv) in cfg80211_put_dev() argument
138 BUG_ON(IS_ERR(drv)); in cfg80211_put_dev()
139 mutex_unlock(&drv->mtx); in cfg80211_put_dev()
145 struct cfg80211_registered_device *drv; in cfg80211_dev_rename() local
173 list_for_each_entry(drv, &cfg80211_drv_list, list) { in cfg80211_dev_rename()
175 if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0) in cfg80211_dev_rename()
209 struct cfg80211_registered_device *drv; in wiphy_new() local
215 alloc_size = sizeof(*drv) + sizeof_priv; in wiphy_new()
217 drv = kzalloc(alloc_size, GFP_KERNEL); in wiphy_new()
218 if (!drv) in wiphy_new()
221 drv->ops = ops; in wiphy_new()
225 drv->idx = wiphy_counter++; in wiphy_new()
227 if (unlikely(drv->idx < 0)) { in wiphy_new()
231 kfree(drv); in wiphy_new()
238 dev_set_name(&drv->wiphy.dev, PHY_NAME "%d", drv->idx); in wiphy_new()
240 mutex_init(&drv->mtx); in wiphy_new()
241 mutex_init(&drv->devlist_mtx); in wiphy_new()
242 INIT_LIST_HEAD(&drv->netdev_list); in wiphy_new()
244 device_initialize(&drv->wiphy.dev); in wiphy_new()
245 drv->wiphy.dev.class = &ieee80211_class; in wiphy_new()
246 drv->wiphy.dev.platform_data = drv; in wiphy_new()
248 return &drv->wiphy; in wiphy_new()
254 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); in wiphy_register() local
307 res = device_add(&drv->wiphy.dev); in wiphy_register()
311 list_add(&drv->list, &cfg80211_drv_list); in wiphy_register()
314 drv->wiphy.debugfsdir = in wiphy_register()
315 debugfs_create_dir(wiphy_name(&drv->wiphy), in wiphy_register()
317 if (IS_ERR(drv->wiphy.debugfsdir)) in wiphy_register()
318 drv->wiphy.debugfsdir = NULL; in wiphy_register()
329 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); in wiphy_unregister() local
334 BUG_ON(!list_empty(&drv->netdev_list)); in wiphy_unregister()
346 mutex_lock(&drv->mtx); in wiphy_unregister()
348 mutex_unlock(&drv->mtx); in wiphy_unregister()
354 list_del(&drv->list); in wiphy_unregister()
355 device_del(&drv->wiphy.dev); in wiphy_unregister()
356 debugfs_remove(drv->wiphy.debugfsdir); in wiphy_unregister()
362 void cfg80211_dev_free(struct cfg80211_registered_device *drv) in cfg80211_dev_free() argument
364 mutex_destroy(&drv->mtx); in cfg80211_dev_free()
365 mutex_destroy(&drv->devlist_mtx); in cfg80211_dev_free()
366 kfree(drv); in cfg80211_dev_free()