aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2008-12-18 21:37:08 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:58:55 -0500
commit40b8ec0bfa2d96c9feae2bc1596e9b427c77b8da (patch)
tree9c1bf8e43c1ace421cfe1c6e15c5db5cd573f987 /drivers/net/wireless/iwlwifi/iwl-3945-rs.c
parent3d24a9f790c0e39cfdef1446c7100e89c542805c (diff)
iwl3945: Getting rid of iwl-3945-debug.h
At the cost of adding a debug_level field to iwl3945_priv, we are now able to get rid of iwl-3945-debug.h, and use iwl-debug.h instead. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 9d63cdb5ea0f..42b8bc495d8f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -52,6 +52,7 @@ struct iwl3945_rate_scale_data {
52 52
53struct iwl3945_rs_sta { 53struct iwl3945_rs_sta {
54 spinlock_t lock; 54 spinlock_t lock;
55 struct iwl3945_priv *priv;
55 s32 *expected_tpt; 56 s32 *expected_tpt;
56 unsigned long last_partial_flush; 57 unsigned long last_partial_flush;
57 unsigned long last_flush; 58 unsigned long last_flush;
@@ -182,6 +183,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
182 int unflushed = 0; 183 int unflushed = 0;
183 int i; 184 int i;
184 unsigned long flags; 185 unsigned long flags;
186 struct iwl3945_priv *priv = rs_sta->priv;
185 187
186 /* 188 /*
187 * For each rate, if we have collected data on that rate 189 * For each rate, if we have collected data on that rate
@@ -214,6 +216,7 @@ static int iwl3945_rate_scale_flush_windows(struct iwl3945_rs_sta *rs_sta)
214static void iwl3945_bg_rate_scale_flush(unsigned long data) 216static void iwl3945_bg_rate_scale_flush(unsigned long data)
215{ 217{
216 struct iwl3945_rs_sta *rs_sta = (void *)data; 218 struct iwl3945_rs_sta *rs_sta = (void *)data;
219 struct iwl3945_priv *priv = rs_sta->priv;
217 int unflushed = 0; 220 int unflushed = 0;
218 unsigned long flags; 221 unsigned long flags;
219 u32 packet_count, duration, pps; 222 u32 packet_count, duration, pps;
@@ -287,6 +290,7 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
287{ 290{
288 unsigned long flags; 291 unsigned long flags;
289 s32 fail_count; 292 s32 fail_count;
293 struct iwl3945_priv *priv = rs_sta->priv;
290 294
291 if (!retries) { 295 if (!retries) {
292 IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n"); 296 IWL_DEBUG_RATE("leave: retries == 0 -- should be at least 1\n");
@@ -380,10 +384,11 @@ static void rs_free(void *priv)
380 return; 384 return;
381} 385}
382 386
383static void *rs_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp) 387static void *rs_alloc_sta(void *iwl_priv, struct ieee80211_sta *sta, gfp_t gfp)
384{ 388{
385 struct iwl3945_rs_sta *rs_sta; 389 struct iwl3945_rs_sta *rs_sta;
386 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv; 390 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv;
391 struct iwl3945_priv *priv = iwl_priv;
387 int i; 392 int i;
388 393
389 /* 394 /*
@@ -403,6 +408,8 @@ static void *rs_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
403 408
404 spin_lock_init(&rs_sta->lock); 409 spin_lock_init(&rs_sta->lock);
405 410
411 rs_sta->priv = priv;
412
406 rs_sta->start_rate = IWL_RATE_INVALID; 413 rs_sta->start_rate = IWL_RATE_INVALID;
407 414
408 /* default to just 802.11b */ 415 /* default to just 802.11b */
@@ -426,11 +433,12 @@ static void *rs_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
426 return rs_sta; 433 return rs_sta;
427} 434}
428 435
429static void rs_free_sta(void *priv, struct ieee80211_sta *sta, 436static void rs_free_sta(void *iwl_priv, struct ieee80211_sta *sta,
430 void *priv_sta) 437 void *priv_sta)
431{ 438{
432 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv; 439 struct iwl3945_sta_priv *psta = (void *) sta->drv_priv;
433 struct iwl3945_rs_sta *rs_sta = priv_sta; 440 struct iwl3945_rs_sta *rs_sta = priv_sta;
441 struct iwl3945_priv *priv = rs_sta->priv;
434 442
435 psta->rs_sta = NULL; 443 psta->rs_sta = NULL;
436 444
@@ -548,6 +556,7 @@ static u16 iwl3945_get_adjacent_rate(struct iwl3945_rs_sta *rs_sta,
548{ 556{
549 u8 high = IWL_RATE_INVALID; 557 u8 high = IWL_RATE_INVALID;
550 u8 low = IWL_RATE_INVALID; 558 u8 low = IWL_RATE_INVALID;
559 struct iwl3945_priv *priv = rs_sta->priv;
551 560
552 /* 802.11A walks to the next literal adjacent rate in 561 /* 802.11A walks to the next literal adjacent rate in
553 * the rate table */ 562 * the rate table */