aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_i.h1
-rw-r--r--net/mac80211/main.c9
-rw-r--r--net/mac80211/mlme.c26
-rw-r--r--net/mac80211/util.c26
4 files changed, 35 insertions, 27 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 792c09ca08e3..b10e70715db0 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -987,6 +987,7 @@ int ieee80211_frame_duration(struct ieee80211_local *local, size_t len,
987 int rate, int erp, int short_preamble); 987 int rate, int erp, int short_preamble);
988void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, 988void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
989 struct ieee80211_hdr *hdr); 989 struct ieee80211_hdr *hdr);
990void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata);
990 991
991#ifdef CONFIG_MAC80211_NOINLINE 992#ifdef CONFIG_MAC80211_NOINLINE
992#define debug_noinline noinline 993#define debug_noinline noinline
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index f90254a5948e..6a7f4fae18c2 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -399,8 +399,15 @@ static int ieee80211_open(struct net_device *dev)
399 atomic_inc(&local->iff_promiscs); 399 atomic_inc(&local->iff_promiscs);
400 400
401 local->open_count++; 401 local->open_count++;
402 if (need_hw_reconfig) 402 if (need_hw_reconfig) {
403 ieee80211_hw_config(local); 403 ieee80211_hw_config(local);
404 /*
405 * set default queue parameters so drivers don't
406 * need to initialise the hardware if the hardware
407 * doesn't start up with sane defaults
408 */
409 ieee80211_set_wmm_default(sdata);
410 }
404 411
405 /* 412 /*
406 * ieee80211_sta_work is disabled while network interface 413 * ieee80211_sta_work is disabled while network interface
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f754ad273f92..c22dcd605e48 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -539,32 +539,6 @@ 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
568static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 542static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
569 struct ieee80211_sta_bss *bss) 543 struct ieee80211_sta_bss *bss)
570{ 544{
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e19c74cada39..55be3ef5c755 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -572,3 +572,29 @@ void ieee802_11_parse_elems(u8 *start, size_t len,
572 pos += elen; 572 pos += elen;
573 } 573 }
574} 574}
575
576void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
577{
578 struct ieee80211_local *local = sdata->local;
579 struct ieee80211_tx_queue_params qparam;
580 int i;
581
582 if (!local->ops->conf_tx)
583 return;
584
585 memset(&qparam, 0, sizeof(qparam));
586
587 qparam.aifs = 2;
588
589 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ &&
590 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE))
591 qparam.cw_min = 31;
592 else
593 qparam.cw_min = 15;
594
595 qparam.cw_max = 1023;
596 qparam.txop = 0;
597
598 for (i = 0; i < local_to_hw(local)->queues; i++)
599 local->ops->conf_tx(local_to_hw(local), i, &qparam);
600}