Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369586
b: refs/heads/master
c: 991fec0
h: refs/heads/master
v: v3
  • Loading branch information
Felix Fietkau authored and Johannes Berg committed Apr 16, 2013
1 parent 1b401e4 commit ce2edc4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ffbe6d333664a089f17b13aa79eefe38f794bb7
refs/heads/master: 991fec091061b901e4fdcc8af4fd25d24a5a7bab
4 changes: 3 additions & 1 deletion trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,9 @@ struct ieee80211_tx_info {
struct ieee80211_tx_rate rates[
IEEE80211_TX_MAX_RATES];
s8 rts_cts_rate_idx;
/* 3 bytes free */
u8 use_rts:1;
u8 use_cts_prot:1;
/* 2 bytes free */
};
/* only needed before rate control */
unsigned long jiffies;
Expand Down
6 changes: 4 additions & 2 deletions trunk/net/mac80211/rc80211_minstrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ minstrel_get_retry_count(struct minstrel_rate *mr,
{
unsigned int retry = mr->adjusted_retry_count;

if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
if (info->control.use_rts)
retry = max(2U, min(mr->retry_count_rtscts, retry));
else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
else if (info->control.use_cts_prot)
retry = max(2U, min(mr->retry_count_cts, retry));
return retry;
}
Expand Down Expand Up @@ -460,6 +460,8 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
} while ((tx_time < mp->segment_size) &&
(++mr->retry_count < mp->max_retry));
mr->adjusted_retry_count = mr->retry_count;
if (!(sband->bitrates[i].flags & IEEE80211_RATE_ERP_G))
mr->retry_count_cts = mr->retry_count;
}

for (i = n; i < sband->n_bitrates; i++) {
Expand Down
8 changes: 8 additions & 0 deletions trunk/net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
txrc.rts = rts = true;
}

info->control.use_rts = rts;
info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot;

/*
* Use short preamble if the BSS can handle it, but not for
* management frames unless we know the receiver can handle
Expand Down Expand Up @@ -766,6 +769,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
*/
if (rc_rate->flags & IEEE80211_TX_RC_MCS) {
WARN_ON(rc_rate->idx > 76);

if (!(rc_rate->flags & IEEE80211_TX_RC_USE_RTS_CTS) &&
tx->sdata->vif.bss_conf.use_cts_prot)
rc_rate->flags |=
IEEE80211_TX_RC_USE_CTS_PROTECT;
continue;
}

Expand Down

0 comments on commit ce2edc4

Please sign in to comment.