mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mac802154: util: add stop_device utility function
This patch adds ieee802154_stop_device for preparing a utility function to stop the ieee802154 device. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
927e031c7c
commit
c4227c8a62
3 changed files with 11 additions and 5 deletions
|
@ -176,5 +176,6 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
|
||||||
unsigned char name_assign_type, enum nl802154_iftype type,
|
unsigned char name_assign_type, enum nl802154_iftype type,
|
||||||
__le64 extended_addr);
|
__le64 extended_addr);
|
||||||
void ieee802154_remove_interfaces(struct ieee802154_local *local);
|
void ieee802154_remove_interfaces(struct ieee802154_local *local);
|
||||||
|
void ieee802154_stop_device(struct ieee802154_local *local);
|
||||||
|
|
||||||
#endif /* __IEEE802154_I_H */
|
#endif /* __IEEE802154_I_H */
|
||||||
|
|
|
@ -314,11 +314,8 @@ static int mac802154_slave_close(struct net_device *dev)
|
||||||
|
|
||||||
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
|
clear_bit(SDATA_STATE_RUNNING, &sdata->state);
|
||||||
|
|
||||||
if (!local->open_count) {
|
if (!local->open_count)
|
||||||
flush_workqueue(local->workqueue);
|
ieee802154_stop_device(local);
|
||||||
hrtimer_cancel(&local->ifs_timer);
|
|
||||||
drv_stop(local);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ieee802154_i.h"
|
#include "ieee802154_i.h"
|
||||||
|
#include "driver-ops.h"
|
||||||
|
|
||||||
/* privid for wpan_phys to determine whether they belong to us or not */
|
/* privid for wpan_phys to determine whether they belong to us or not */
|
||||||
const void *const mac802154_wpan_phy_privid = &mac802154_wpan_phy_privid;
|
const void *const mac802154_wpan_phy_privid = &mac802154_wpan_phy_privid;
|
||||||
|
@ -92,3 +93,10 @@ void ieee802154_xmit_complete(struct ieee802154_hw *hw, struct sk_buff *skb,
|
||||||
dev_consume_skb_any(skb);
|
dev_consume_skb_any(skb);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(ieee802154_xmit_complete);
|
EXPORT_SYMBOL(ieee802154_xmit_complete);
|
||||||
|
|
||||||
|
void ieee802154_stop_device(struct ieee802154_local *local)
|
||||||
|
{
|
||||||
|
flush_workqueue(local->workqueue);
|
||||||
|
hrtimer_cancel(&local->ifs_timer);
|
||||||
|
drv_stop(local);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue