Commit 3d35f7c6 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: split ieee80211_sta_def_wmm_params

Cleans up the code a bit and prepares for the next patch
that will use the function elsewhere.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ef422bc0
...@@ -539,13 +539,38 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da ...@@ -539,13 +539,38 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da
} }
/* MLME */ /* MLME */
static 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;
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;
qparam.cw_max = 1023;
qparam.txop = 0;
for (i = 0; i < local_to_hw(local)->queues; i++)
local->ops->conf_tx(local_to_hw(local), i, &qparam);
}
static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta_bss *bss) struct ieee80211_sta_bss *bss)
{ {
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
int i, have_higher_than_11mbit = 0; int i, have_higher_than_11mbit = 0;
/* cf. IEEE 802.11 9.2.12 */ /* cf. IEEE 802.11 9.2.12 */
for (i = 0; i < bss->supp_rates_len; i++) for (i = 0; i < bss->supp_rates_len; i++)
if ((bss->supp_rates[i] & 0x7f) * 5 > 110) if ((bss->supp_rates[i] & 0x7f) * 5 > 110)
...@@ -557,26 +582,7 @@ static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, ...@@ -557,26 +582,7 @@ static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
else else
sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
ieee80211_set_wmm_default(sdata);
if (local->ops->conf_tx) {
struct ieee80211_tx_queue_params qparam;
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;
qparam.cw_max = 1023;
qparam.txop = 0;
for (i = 0; i < local_to_hw(local)->queues; i++)
local->ops->conf_tx(local_to_hw(local), i, &qparam);
}
} }
static void ieee80211_sta_wmm_params(struct ieee80211_local *local, static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment