Skip to content

Commit

Permalink
mac80211: reject aggregation sessions with non-HT peers
Browse files Browse the repository at this point in the history
If a peer or some local agent (rate control, ...) decides to start
an aggregation session but doesn't support HT (which also implies
QoS), reject it.

This is mostly a corner case as such peers normally won't try to
use block-ack sessions and rate control wouldn't start them, but
technically QoS stations could request it according to the spec.

However, since drivers don't really support such non-HT sessions
it's better to reject them.

Also, while at it, move the tracing for TX sessions earlier so it
captures the error cases as well.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Mar 30, 2015
1 parent a38700d commit 8f9c77f
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions net/mac80211/agg-rx.c
Original file line number Diff line number Diff line change
@@ -234,6 +234,14 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
int i, ret = -EOPNOTSUPP;
u16 status = WLAN_STATUS_REQUEST_DECLINED;

if (!sta->sta.ht_cap.ht_supported) {
ht_dbg(sta->sdata,
"STA %pM erroneously requests BA session on tid %d w/o QoS\n",
sta->sta.addr, tid);
/* send a response anyway, it's an error case if we get here */
goto end_no_lock;
}

if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) {
ht_dbg(sta->sdata,
"Suspend in progress - Denying ADDBA request (%pM tid %d)\n",
5 changes: 4 additions & 1 deletion net/mac80211/agg-tx.c
Original file line number Diff line number Diff line change
@@ -509,11 +509,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
struct tid_ampdu_tx *tid_tx;
int ret = 0;

trace_api_start_tx_ba_session(pubsta, tid);

if (WARN(sta->reserved_tid == tid,
"Requested to start BA session on reserved tid=%d", tid))
return -EINVAL;

trace_api_start_tx_ba_session(pubsta, tid);
if (!pubsta->ht_cap.ht_supported)
return -EINVAL;

if (WARN_ON_ONCE(!local->ops->ampdu_action))
return -EINVAL;

0 comments on commit 8f9c77f

Please sign in to comment.