main.c (d98be45b3657fc233f5a098279a4e42ab6f0fa4f) | main.c (60741361c3ca229a1dbb18e05d11e97b7ea75d69) |
---|---|
1/* 2 * Copyright (C) 2007-2012 Siemens AG 3 * 4 * Written by: 5 * Alexander Smirnov <alex.bluesman.smirnov@gmail.com> 6 * 7 * Based on the code from 'linux-zigbee.sourceforge.net' project. 8 * --- 275 unchanged lines hidden (view full) --- 284 mutex_init(&local->iflist_mtx); 285 286 return &local->hw; 287} 288EXPORT_SYMBOL(ieee802154_alloc_hw); 289 290void ieee802154_free_hw(struct ieee802154_hw *hw) 291{ | 1/* 2 * Copyright (C) 2007-2012 Siemens AG 3 * 4 * Written by: 5 * Alexander Smirnov <alex.bluesman.smirnov@gmail.com> 6 * 7 * Based on the code from 'linux-zigbee.sourceforge.net' project. 8 * --- 275 unchanged lines hidden (view full) --- 284 mutex_init(&local->iflist_mtx); 285 286 return &local->hw; 287} 288EXPORT_SYMBOL(ieee802154_alloc_hw); 289 290void ieee802154_free_hw(struct ieee802154_hw *hw) 291{ |
292 struct ieee802154_local *local = mac802154_to_priv(hw); | 292 struct ieee802154_local *local = hw_to_local(hw); |
293 294 BUG_ON(!list_empty(&local->interfaces)); 295 296 mutex_destroy(&local->iflist_mtx); 297 298 wpan_phy_free(local->phy); 299} 300EXPORT_SYMBOL(ieee802154_free_hw); 301 302int ieee802154_register_hw(struct ieee802154_hw *hw) 303{ | 293 294 BUG_ON(!list_empty(&local->interfaces)); 295 296 mutex_destroy(&local->iflist_mtx); 297 298 wpan_phy_free(local->phy); 299} 300EXPORT_SYMBOL(ieee802154_free_hw); 301 302int ieee802154_register_hw(struct ieee802154_hw *hw) 303{ |
304 struct ieee802154_local *local = mac802154_to_priv(hw); | 304 struct ieee802154_local *local = hw_to_local(hw); |
305 int rc = -ENOSYS; 306 307 if (hw->flags & IEEE802154_HW_TXPOWER) { 308 if (!local->ops->set_txpower) 309 goto out; 310 311 local->phy->set_txpower = mac802154_set_txpower; 312 } --- 63 unchanged lines hidden (view full) --- 376 destroy_workqueue(local->dev_workqueue); 377out: 378 return rc; 379} 380EXPORT_SYMBOL(ieee802154_register_hw); 381 382void ieee802154_unregister_hw(struct ieee802154_hw *hw) 383{ | 305 int rc = -ENOSYS; 306 307 if (hw->flags & IEEE802154_HW_TXPOWER) { 308 if (!local->ops->set_txpower) 309 goto out; 310 311 local->phy->set_txpower = mac802154_set_txpower; 312 } --- 63 unchanged lines hidden (view full) --- 376 destroy_workqueue(local->dev_workqueue); 377out: 378 return rc; 379} 380EXPORT_SYMBOL(ieee802154_register_hw); 381 382void ieee802154_unregister_hw(struct ieee802154_hw *hw) 383{ |
384 struct ieee802154_local *local = mac802154_to_priv(hw); | 384 struct ieee802154_local *local = hw_to_local(hw); |
385 struct ieee802154_sub_if_data *sdata, *next; 386 387 flush_workqueue(local->dev_workqueue); 388 destroy_workqueue(local->dev_workqueue); 389 390 rtnl_lock(); 391 392 mutex_lock(&local->iflist_mtx); --- 19 unchanged lines hidden --- | 385 struct ieee802154_sub_if_data *sdata, *next; 386 387 flush_workqueue(local->dev_workqueue); 388 destroy_workqueue(local->dev_workqueue); 389 390 rtnl_lock(); 391 392 mutex_lock(&local->iflist_mtx); --- 19 unchanged lines hidden --- |