Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300682
b: refs/heads/master
c: 54bcbc6
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 10, 2012
1 parent 45f80c2 commit 5ce6a3b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 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: a3304b0a17495183a2270d4a25978795226597a4
refs/heads/master: 54bcbc695e2ca88e1c8f05a93d38a04ac6b1aa0e
6 changes: 3 additions & 3 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,9 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
if (!local->ops->conf_tx)
return -EOPNOTSUPP;

if (local->hw.queues < IEEE80211_NUM_ACS)
return -EOPNOTSUPP;

memset(&p, 0, sizeof(p));
p.aifs = params->aifs;
p.cw_max = params->cwmax;
Expand All @@ -1449,9 +1452,6 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
*/
p.uapsd = false;

if (params->ac >= local->hw.queues)
return -EINVAL;

sdata->tx_conf[params->ac] = p;
if (drv_conf_tx(local, sdata, params->ac, &p)) {
wiphy_debug(local->hw.wiphy,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ struct ieee80211_sub_if_data {
__be16 control_port_protocol;
bool control_port_no_encrypt;

struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES];
struct ieee80211_tx_queue_params tx_conf[IEEE80211_NUM_ACS];

struct work_struct work;
struct sk_buff_head skb_queue;
Expand Down
30 changes: 18 additions & 12 deletions trunk/net/mac80211/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,27 +769,30 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_queue_params qparam;
int queue;
int ac;
bool use_11b;
int aCWmin, aCWmax;

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

if (local->hw.queues < IEEE80211_NUM_ACS)
return;

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

use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) &&
!(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);

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

switch (queue) {
switch (ac) {
case IEEE80211_AC_BK:
qparam.cw_max = aCWmax;
qparam.cw_min = aCWmin;
Expand Down Expand Up @@ -825,8 +828,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,

qparam.uapsd = false;

sdata->tx_conf[queue] = qparam;
drv_conf_tx(local, sdata, queue, &qparam);
sdata->tx_conf[ac] = qparam;
drv_conf_tx(local, sdata, ac, &qparam);
}

/* after reinitialize QoS TX queues setting to default,
Expand Down Expand Up @@ -1226,14 +1229,17 @@ int ieee80211_reconfig(struct ieee80211_local *local)
mutex_unlock(&local->sta_mtx);

/* reconfigure tx conf */
list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
sdata->vif.type == NL80211_IFTYPE_MONITOR ||
!ieee80211_sdata_running(sdata))
continue;
if (hw->queues >= IEEE80211_NUM_ACS) {
list_for_each_entry(sdata, &local->interfaces, list) {
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
sdata->vif.type == NL80211_IFTYPE_MONITOR ||
!ieee80211_sdata_running(sdata))
continue;

for (i = 0; i < hw->queues; i++)
drv_conf_tx(local, sdata, i, &sdata->tx_conf[i]);
for (i = 0; i < IEEE80211_NUM_ACS; i++)
drv_conf_tx(local, sdata, i,
&sdata->tx_conf[i]);
}
}

/* reconfigure hardware */
Expand Down

0 comments on commit 5ce6a3b

Please sign in to comment.