summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-06-24 05:36:34 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-07-23 11:10:49 -0400
commitc4227c8a6246b30793bd7360113ddc7b66d526dc (patch)
tree734eb9edbe8c83e2f81c46420b7e2ce31f963950
parent927e031c7cb266e5f7fd600899f1603813ee7439 (diff)
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>
-rw-r--r--net/mac802154/ieee802154_i.h1
-rw-r--r--net/mac802154/iface.c7
-rw-r--r--net/mac802154/util.c8
3 files changed, 11 insertions, 5 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h
index ed8746334bef..04077830e88c 100644
--- a/net/mac802154/ieee802154_i.h
+++ b/net/mac802154/ieee802154_i.h
@@ -176,5 +176,6 @@ ieee802154_if_add(struct ieee802154_local *local, const char *name,
176 unsigned char name_assign_type, enum nl802154_iftype type, 176 unsigned char name_assign_type, enum nl802154_iftype type,
177 __le64 extended_addr); 177 __le64 extended_addr);
178void ieee802154_remove_interfaces(struct ieee802154_local *local); 178void ieee802154_remove_interfaces(struct ieee802154_local *local);
179void ieee802154_stop_device(struct ieee802154_local *local);
179 180
180#endif /* __IEEE802154_I_H */ 181#endif /* __IEEE802154_I_H */
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 4760368a3493..416de903e467 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -314,11 +314,8 @@ static int mac802154_slave_close(struct net_device *dev)
314 314
315 clear_bit(SDATA_STATE_RUNNING, &sdata->state); 315 clear_bit(SDATA_STATE_RUNNING, &sdata->state);
316 316
317 if (!local->open_count) { 317 if (!local->open_count)
318 flush_workqueue(local->workqueue); 318 ieee802154_stop_device(local);
319 hrtimer_cancel(&local->ifs_timer);
320 drv_stop(local);
321 }
322 319
323 return 0; 320 return 0;
324} 321}
diff --git a/net/mac802154/util.c b/net/mac802154/util.c
index 583435f38930..f9fd0957ab67 100644
--- a/net/mac802154/util.c
+++ b/net/mac802154/util.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include "ieee802154_i.h" 16#include "ieee802154_i.h"
17#include "driver-ops.h"
17 18
18/* privid for wpan_phys to determine whether they belong to us or not */ 19/* privid for wpan_phys to determine whether they belong to us or not */
19const void *const mac802154_wpan_phy_privid = &mac802154_wpan_phy_privid; 20const 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,
92 dev_consume_skb_any(skb); 93 dev_consume_skb_any(skb);
93} 94}
94EXPORT_SYMBOL(ieee802154_xmit_complete); 95EXPORT_SYMBOL(ieee802154_xmit_complete);
96
97void ieee802154_stop_device(struct ieee802154_local *local)
98{
99 flush_workqueue(local->workqueue);
100 hrtimer_cancel(&local->ifs_timer);
101 drv_stop(local);
102}