iwlagn: move rate scale initialization to init function
authorReinette Chatre <reinette.chatre@intel.com>
Fri, 30 Oct 2009 21:36:14 +0000 (14:36 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 2 Nov 2009 20:39:47 +0000 (15:39 -0500)
This fits better in how the callbacks operate (alloc does allocation and
init does initialization). This also helps if we later want to do our own
initialization without relying on the mac80211 allocation.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn-rs.c

index 27d4ece4d46739b8a6851df97143ccbcc0eea485..43edd8fd440595a86adaffef37b99b69a7c368c7 100644 (file)
@@ -2477,19 +2477,12 @@ static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,
        struct iwl_lq_sta *lq_sta;
        struct iwl_station_priv *sta_priv = (struct iwl_station_priv *) sta->drv_priv;
        struct iwl_priv *priv;
-       int i, j;
 
        priv = (struct iwl_priv *)priv_rate;
        IWL_DEBUG_RATE(priv, "create station rate scale window\n");
 
        lq_sta = &sta_priv->lq_sta;
 
-       lq_sta->lq.sta_id = 0xff;
-
-       for (j = 0; j < LQ_SIZE; j++)
-               for (i = 0; i < IWL_RATE_COUNT; i++)
-                       rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
-
        return lq_sta;
 }
 
@@ -2502,6 +2495,12 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
        struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
        struct iwl_lq_sta *lq_sta = priv_sta;
 
+       lq_sta->lq.sta_id = 0xff;
+
+       for (j = 0; j < LQ_SIZE; j++)
+               for (i = 0; i < IWL_RATE_COUNT; i++)
+                       rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
+
        lq_sta->flush_timer = 0;
        lq_sta->supp_rates = sta->supp_rates[sband->band];
        for (j = 0; j < LQ_SIZE; j++)