aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-28 13:21:27 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-10-28 18:19:08 -0400
commit538181a879368f54544b91e414ea56a88008782b (patch)
treecb864b940cf24188538591c6cdf0a24de024eb7c /net/mac802154
parente363eca386d0c28d8c6c4f176e1fa48b09a75315 (diff)
mac802154: add synchronization handling
This patch adds synchronization handling in start and stop driver ops calls. This patch is mostly grab from mac80211 which was introduced by commit ea77f12f2cc0f31168f2e0259e65a22202ac4dc2 ("mac80211: remove tasklet enable/disable"). This is to be sure that we don't run into same issues. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/driver-ops.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac802154/driver-ops.h b/net/mac802154/driver-ops.h
index bb3ee03c1669..4b820cfeb538 100644
--- a/net/mac802154/driver-ops.h
+++ b/net/mac802154/driver-ops.h
@@ -30,6 +30,7 @@ static inline int drv_start(struct ieee802154_local *local)
30 might_sleep(); 30 might_sleep();
31 31
32 local->started = true; 32 local->started = true;
33 smp_mb();
33 34
34 return local->ops->start(&local->hw); 35 return local->ops->start(&local->hw);
35} 36}
@@ -40,6 +41,12 @@ static inline void drv_stop(struct ieee802154_local *local)
40 41
41 local->ops->stop(&local->hw); 42 local->ops->stop(&local->hw);
42 43
44 /* sync away all work on the tasklet before clearing started */
45 tasklet_disable(&local->tasklet);
46 tasklet_enable(&local->tasklet);
47
48 barrier();
49
43 local->started = false; 50 local->started = false;
44} 51}
45 52