Skip to content

Commit

Permalink
mac80211: allow drivers to sleep in ampdu_action
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 14, 2010
1 parent cfcdbde commit 85ad181
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
struct ath_softc *sc = aphy->sc;
int ret = 0;

local_bh_disable();

switch (action) {
case IEEE80211_AMPDU_RX_START:
if (!(sc->sc_flags & SC_OP_RXAGGR))
Expand Down Expand Up @@ -1798,6 +1800,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
"Unknown AMPDU action\n");
}

local_bh_enable();

return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ enum ieee80211_ampdu_mlme_action {
* is the first frame we expect to perform the action on. Notice
* that TX/RX_STOP can pass NULL for this parameter.
* Returns a negative error code on failure.
* The callback must be atomic.
* The callback can sleep.
*
* @get_survey: Return per-channel survey information
*
Expand Down
3 changes: 1 addition & 2 deletions net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,10 @@ static inline int drv_ampdu_action(struct ieee80211_local *local,

might_sleep();

local_bh_disable();
if (local->ops->ampdu_action)
ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
sta, tid, ssn);
local_bh_enable();

trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, ret);
return ret;
}
Expand Down

0 comments on commit 85ad181

Please sign in to comment.