mac80211: initialise queue QoS parameters at hw start
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 9 Sep 2008 10:56:01 +0000 (12:56 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 11 Sep 2008 19:53:39 +0000 (15:53 -0400)
When hardware is started it might be in a confused state with
respect to queue QoS parameters. This patch changes mac80211
to set sane defaults right after the hardware is brought up.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211_i.h
net/mac80211/main.c
net/mac80211/mlme.c
net/mac80211/util.c

index 792c09ca08e384131e75a78207c5c9df05f75cd0..b10e70715db05220a92d5a4c3cc1fc0d8d6948ff 100644 (file)
@@ -987,6 +987,7 @@ int ieee80211_frame_duration(struct ieee80211_local *local, size_t len,
                             int rate, int erp, int short_preamble);
 void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx,
                                     struct ieee80211_hdr *hdr);
+void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata);
 
 #ifdef CONFIG_MAC80211_NOINLINE
 #define debug_noinline noinline
index f90254a5948e5240d0b2604faefdef74dd332a64..6a7f4fae18c2841291d368be769e9ba0cb2c422a 100644 (file)
@@ -399,8 +399,15 @@ static int ieee80211_open(struct net_device *dev)
                atomic_inc(&local->iff_promiscs);
 
        local->open_count++;
-       if (need_hw_reconfig)
+       if (need_hw_reconfig) {
                ieee80211_hw_config(local);
+               /*
+                * set default queue parameters so drivers don't
+                * need to initialise the hardware if the hardware
+                * doesn't start up with sane defaults
+                */
+               ieee80211_set_wmm_default(sdata);
+       }
 
        /*
         * ieee80211_sta_work is disabled while network interface
index f754ad273f92d89c4c96d98b52bf8455712de332..c22dcd605e48186bdbabc1e3132bb973943b4fd9 100644 (file)
@@ -539,32 +539,6 @@ static void ieee80211_send_refuse_measurement_request(struct ieee80211_sub_if_da
 }
 
 /* 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,
                                         struct ieee80211_sta_bss *bss)
 {
index e19c74cada399e83d3d7e10821f31ecb4ce3af4a..55be3ef5c7556d2e8e02035fed19bcbf42618198 100644 (file)
@@ -572,3 +572,29 @@ void ieee802_11_parse_elems(u8 *start, size_t len,
                pos += elen;
        }
 }
+
+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);
+}