aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2009-10-16 17:25:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:33 -0400
commit8d9698b3e6ce3c50f9ec5a0aaea4da82d5af7779 (patch)
tree652b1fecb395e4f41397bfa68d11144dfe918ccf /drivers/net/wireless
parentcc1282f63b53d0967bd96ed56aa3d2463dc4b4b6 (diff)
iwlagn: store station rate scale information in mac80211 station structure
Currently mac80211 initializes the rate scaling before notifying the driver of the station's existence. The driver dealt with this by not relying on mac80211's station notifications and instead mixing this functionality with the rate scaling code and other places. To clean this up the driver needs to do rate scaling initialization after being notified of the station, this can be done if the rate scaling information forms part of the station information passed from mac80211 to driver. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h13
3 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 2d4ec1a65957..27d4ece4d467 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2475,19 +2475,17 @@ static void *rs_alloc_sta(void *priv_rate, struct ieee80211_sta *sta,
2475 gfp_t gfp) 2475 gfp_t gfp)
2476{ 2476{
2477 struct iwl_lq_sta *lq_sta; 2477 struct iwl_lq_sta *lq_sta;
2478 struct iwl_station_priv *sta_priv = (struct iwl_station_priv *) sta->drv_priv;
2478 struct iwl_priv *priv; 2479 struct iwl_priv *priv;
2479 int i, j; 2480 int i, j;
2480 2481
2481 priv = (struct iwl_priv *)priv_rate; 2482 priv = (struct iwl_priv *)priv_rate;
2482 IWL_DEBUG_RATE(priv, "create station rate scale window\n"); 2483 IWL_DEBUG_RATE(priv, "create station rate scale window\n");
2483 2484
2484 lq_sta = kzalloc(sizeof(struct iwl_lq_sta), gfp); 2485 lq_sta = &sta_priv->lq_sta;
2485 2486
2486 if (lq_sta == NULL)
2487 return NULL;
2488 lq_sta->lq.sta_id = 0xff; 2487 lq_sta->lq.sta_id = 0xff;
2489 2488
2490
2491 for (j = 0; j < LQ_SIZE; j++) 2489 for (j = 0; j < LQ_SIZE; j++)
2492 for (i = 0; i < IWL_RATE_COUNT; i++) 2490 for (i = 0; i < IWL_RATE_COUNT; i++)
2493 rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]); 2491 rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
@@ -2719,11 +2717,9 @@ static void rs_free(void *priv_rate)
2719static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta, 2717static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta,
2720 void *priv_sta) 2718 void *priv_sta)
2721{ 2719{
2722 struct iwl_lq_sta *lq_sta = priv_sta;
2723 struct iwl_priv *priv __maybe_unused = priv_r; 2720 struct iwl_priv *priv __maybe_unused = priv_r;
2724 2721
2725 IWL_DEBUG_RATE(priv, "enter\n"); 2722 IWL_DEBUG_RATE(priv, "enter\n");
2726 kfree(lq_sta);
2727 IWL_DEBUG_RATE(priv, "leave\n"); 2723 IWL_DEBUG_RATE(priv, "leave\n");
2728} 2724}
2729 2725
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 6c4fa011a924..64d918787e88 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2304,6 +2304,7 @@ static int iwl_setup_mac(struct iwl_priv *priv)
2304 hw->flags |= IEEE80211_HW_SUPPORTS_PS | 2304 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
2305 IEEE80211_HW_SUPPORTS_DYNAMIC_PS; 2305 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
2306 2306
2307 hw->sta_data_size = sizeof(struct iwl_station_priv);
2307 hw->wiphy->interface_modes = 2308 hw->wiphy->interface_modes =
2308 BIT(NL80211_IFTYPE_STATION) | 2309 BIT(NL80211_IFTYPE_STATION) |
2309 BIT(NL80211_IFTYPE_ADHOC); 2310 BIT(NL80211_IFTYPE_ADHOC);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 35d579455c3c..6ba082d6ab16 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -576,6 +576,19 @@ struct iwl_station_entry {
576 struct iwl_hw_key keyinfo; 576 struct iwl_hw_key keyinfo;
577}; 577};
578 578
579/*
580 * iwl_station_priv: Driver's private station information
581 *
582 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
583 * in the structure for use by driver. This structure is places in that
584 * space.
585 *
586 * At the moment use it for the station's rate scaling information.
587 */
588struct iwl_station_priv {
589 struct iwl_lq_sta lq_sta;
590};
591
579/* one for each uCode image (inst/data, boot/init/runtime) */ 592/* one for each uCode image (inst/data, boot/init/runtime) */
580struct fw_desc { 593struct fw_desc {
581 void *v_addr; /* access by driver */ 594 void *v_addr; /* access by driver */