aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-09 06:54:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:38 -0400
commit3d35f7c6874d83063d19de0cdb4e503ff4471098 (patch)
tree6319f70f837cfd1606fa24c704073091d3f742a3 /net/mac80211/mlme.c
parentef422bc0ae934e6a46dfa63f0e27cad83b94234f (diff)
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: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 62357a208851..f754ad273f92 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -539,13 +539,38 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da
539} 539}
540 540
541/* MLME */ 541/* MLME */
542static void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
543{
544 struct ieee80211_local *local = sdata->local;
545 struct ieee80211_tx_queue_params qparam;
546 int i;
547
548 if (!local->ops->conf_tx)
549 return;
550
551 memset(&qparam, 0, sizeof(qparam));
552
553 qparam.aifs = 2;
554
555 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ &&
556 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE))
557 qparam.cw_min = 31;
558 else
559 qparam.cw_min = 15;
560
561 qparam.cw_max = 1023;
562 qparam.txop = 0;
563
564 for (i = 0; i < local_to_hw(local)->queues; i++)
565 local->ops->conf_tx(local_to_hw(local), i, &qparam);
566}
567
542static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 568static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
543 struct ieee80211_sta_bss *bss) 569 struct ieee80211_sta_bss *bss)
544{ 570{
545 struct ieee80211_local *local = sdata->local; 571 struct ieee80211_local *local = sdata->local;
546 int i, have_higher_than_11mbit = 0; 572 int i, have_higher_than_11mbit = 0;
547 573
548
549 /* cf. IEEE 802.11 9.2.12 */ 574 /* cf. IEEE 802.11 9.2.12 */
550 for (i = 0; i < bss->supp_rates_len; i++) 575 for (i = 0; i < bss->supp_rates_len; i++)
551 if ((bss->supp_rates[i] & 0x7f) * 5 > 110) 576 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 else 582 else
558 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; 583 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
559 584
560 585 ieee80211_set_wmm_default(sdata);
561 if (local->ops->conf_tx) {
562 struct ieee80211_tx_queue_params qparam;
563
564 memset(&qparam, 0, sizeof(qparam));
565
566 qparam.aifs = 2;
567
568 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ &&
569 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE))
570 qparam.cw_min = 31;
571 else
572 qparam.cw_min = 15;
573
574 qparam.cw_max = 1023;
575 qparam.txop = 0;
576
577 for (i = 0; i < local_to_hw(local)->queues; i++)
578 local->ops->conf_tx(local_to_hw(local), i, &qparam);
579 }
580} 586}
581 587
582static void ieee80211_sta_wmm_params(struct ieee80211_local *local, 588static void ieee80211_sta_wmm_params(struct ieee80211_local *local,