Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150258
b: refs/heads/master
c: aa837e1
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 11, 2009
1 parent f7ec94c commit 21f11b6
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 13 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: 58905ca5b11a0ff3860f55b789cbbf052f7158a7
refs/heads/master: aa837e1d6bd1a71b3c30c7738b6c29d41512fe7d
4 changes: 4 additions & 0 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,

rcu_read_unlock();

ieee80211_set_wmm_default(sdata);

ieee80211_recalc_idle(local);

/* channel(_type) changes are handled by ieee80211_hw_config */
Expand Down Expand Up @@ -1658,6 +1660,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
if (elems.wmm_param)
ieee80211_sta_wmm_params(local, ifmgd, elems.wmm_param,
elems.wmm_param_len);
else
ieee80211_set_wmm_default(sdata);

if (elems.ht_info_elem && elems.wmm_param &&
(ifmgd->flags & IEEE80211_STA_WMM_ENABLED) &&
Expand Down
60 changes: 48 additions & 12 deletions trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,26 +708,62 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_queue_params qparam;
int i;
int queue;
bool use_11b;
int aCWmin, aCWmax;

if (!local->ops->conf_tx)
return;

memset(&qparam, 0, sizeof(qparam));

qparam.aifs = 2;

if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ &&
!(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE))
qparam.cw_min = 31;
else
qparam.cw_min = 15;
use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) &&
!(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);

qparam.cw_max = 1023;
qparam.txop = 0;
for (queue = 0; queue < local_to_hw(local)->queues; queue++) {
/* Set defaults according to 802.11-2007 Table 7-37 */
aCWmax = 1023;
if (use_11b)
aCWmin = 31;
else
aCWmin = 15;

switch (queue) {
case 3: /* AC_BK */
qparam.cw_max = aCWmin;
qparam.cw_min = aCWmax;
qparam.txop = 0;
qparam.aifs = 7;
break;
default: /* never happens but let's not leave undefined */
case 2: /* AC_BE */
qparam.cw_max = aCWmin;
qparam.cw_min = aCWmax;
qparam.txop = 0;
qparam.aifs = 3;
break;
case 1: /* AC_VI */
qparam.cw_max = aCWmin;
qparam.cw_min = (aCWmin + 1) / 2 - 1;
if (use_11b)
qparam.txop = 6016/32;
else
qparam.txop = 3008/32;
qparam.aifs = 2;
break;
case 0: /* AC_VO */
qparam.cw_max = (aCWmin + 1) / 2 - 1;
qparam.cw_min = (aCWmin + 1) / 4 - 1;
if (use_11b)
qparam.txop = 3264/32;
else
qparam.txop = 1504/32;
qparam.aifs = 2;
break;
}

for (i = 0; i < local_to_hw(local)->queues; i++)
drv_conf_tx(local, i, &qparam);
drv_conf_tx(local, queue, &qparam);
}
}

void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
Expand Down

0 comments on commit 21f11b6

Please sign in to comment.