aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-06-10 04:21:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-14 15:39:28 -0400
commit85ad181ea78861f69b007599cec9e6ba33fcdf8a (patch)
treeea92b4f7aa6d09ee11ee865a11f6426e809468ba
parentcfcdbde35e2b621cf56bedc38a3a81e8c28addb9 (diff)
mac80211: allow drivers to sleep in ampdu_action
Allow drivers to sleep, and indicate this in the documentation. ath9k has some locking I don't understand, so keep it safe and disable BHs in it, all other drivers look fine with the context change. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c4
-rw-r--r--include/net/mac80211.h2
-rw-r--r--net/mac80211/driver-ops.h3
3 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index b8b76dd2c11e..e1b8456f3d2c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1769,6 +1769,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
1769 struct ath_softc *sc = aphy->sc; 1769 struct ath_softc *sc = aphy->sc;
1770 int ret = 0; 1770 int ret = 0;
1771 1771
1772 local_bh_disable();
1773
1772 switch (action) { 1774 switch (action) {
1773 case IEEE80211_AMPDU_RX_START: 1775 case IEEE80211_AMPDU_RX_START:
1774 if (!(sc->sc_flags & SC_OP_RXAGGR)) 1776 if (!(sc->sc_flags & SC_OP_RXAGGR))
@@ -1798,6 +1800,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
1798 "Unknown AMPDU action\n"); 1800 "Unknown AMPDU action\n");
1799 } 1801 }
1800 1802
1803 local_bh_enable();
1804
1801 return ret; 1805 return ret;
1802} 1806}
1803 1807
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7f9401b3d3c8..bbae3d9b1176 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1640,7 +1640,7 @@ enum ieee80211_ampdu_mlme_action {
1640 * is the first frame we expect to perform the action on. Notice 1640 * is the first frame we expect to perform the action on. Notice
1641 * that TX/RX_STOP can pass NULL for this parameter. 1641 * that TX/RX_STOP can pass NULL for this parameter.
1642 * Returns a negative error code on failure. 1642 * Returns a negative error code on failure.
1643 * The callback must be atomic. 1643 * The callback can sleep.
1644 * 1644 *
1645 * @get_survey: Return per-channel survey information 1645 * @get_survey: Return per-channel survey information
1646 * 1646 *
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 7e86c6f89be9..a4fcbcc4f458 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -352,11 +352,10 @@ static inline int drv_ampdu_action(struct ieee80211_local *local,
352 352
353 might_sleep(); 353 might_sleep();
354 354
355 local_bh_disable();
356 if (local->ops->ampdu_action) 355 if (local->ops->ampdu_action)
357 ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action, 356 ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
358 sta, tid, ssn); 357 sta, tid, ssn);
359 local_bh_enable(); 358
360 trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, ret); 359 trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, ret);
361 return ret; 360 return ret;
362} 361}