Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Aring and committed by
Marcel Holtmann
c4227c8a 927e031c

+11 -5
+1
net/mac802154/ieee802154_i.h
··· 176 176 unsigned char name_assign_type, enum nl802154_iftype type, 177 177 __le64 extended_addr); 178 178 void ieee802154_remove_interfaces(struct ieee802154_local *local); 179 + void ieee802154_stop_device(struct ieee802154_local *local); 179 180 180 181 #endif /* __IEEE802154_I_H */
+2 -5
net/mac802154/iface.c
··· 314 314 315 315 clear_bit(SDATA_STATE_RUNNING, &sdata->state); 316 316 317 - if (!local->open_count) { 318 - flush_workqueue(local->workqueue); 319 - hrtimer_cancel(&local->ifs_timer); 320 - drv_stop(local); 321 - } 317 + if (!local->open_count) 318 + ieee802154_stop_device(local); 322 319 323 320 return 0; 324 321 }
+8
net/mac802154/util.c
··· 14 14 */ 15 15 16 16 #include "ieee802154_i.h" 17 + #include "driver-ops.h" 17 18 18 19 /* privid for wpan_phys to determine whether they belong to us or not */ 19 20 const void *const mac802154_wpan_phy_privid = &mac802154_wpan_phy_privid; ··· 93 92 dev_consume_skb_any(skb); 94 93 } 95 94 EXPORT_SYMBOL(ieee802154_xmit_complete); 95 + 96 + void ieee802154_stop_device(struct ieee802154_local *local) 97 + { 98 + flush_workqueue(local->workqueue); 99 + hrtimer_cancel(&local->ifs_timer); 100 + drv_stop(local); 101 + }