diff options
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-3945-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/iwl-3945-rs.c | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c index d97f24bfc45..38f1b825af1 100644 --- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c | |||
@@ -153,7 +153,7 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta) | |||
153 | int unflushed = 0; | 153 | int unflushed = 0; |
154 | int i; | 154 | int i; |
155 | unsigned long flags; | 155 | unsigned long flags; |
156 | struct il_priv *priv __maybe_unused = rs_sta->priv; | 156 | struct il_priv *il __maybe_unused = rs_sta->il; |
157 | 157 | ||
158 | /* | 158 | /* |
159 | * For each rate, if we have collected data on that rate | 159 | * For each rate, if we have collected data on that rate |
@@ -167,7 +167,7 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta) | |||
167 | spin_lock_irqsave(&rs_sta->lock, flags); | 167 | spin_lock_irqsave(&rs_sta->lock, flags); |
168 | if (time_after(jiffies, rs_sta->win[i].stamp + | 168 | if (time_after(jiffies, rs_sta->win[i].stamp + |
169 | IL_RATE_WIN_FLUSH)) { | 169 | IL_RATE_WIN_FLUSH)) { |
170 | IL_DEBUG_RATE(priv, "flushing %d samples of rate " | 170 | IL_DEBUG_RATE(il, "flushing %d samples of rate " |
171 | "index %d\n", | 171 | "index %d\n", |
172 | rs_sta->win[i].counter, i); | 172 | rs_sta->win[i].counter, i); |
173 | il3945_clear_window(&rs_sta->win[i]); | 173 | il3945_clear_window(&rs_sta->win[i]); |
@@ -186,12 +186,12 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta) | |||
186 | static void il3945_bg_rate_scale_flush(unsigned long data) | 186 | static void il3945_bg_rate_scale_flush(unsigned long data) |
187 | { | 187 | { |
188 | struct il3945_rs_sta *rs_sta = (void *)data; | 188 | struct il3945_rs_sta *rs_sta = (void *)data; |
189 | struct il_priv *priv __maybe_unused = rs_sta->priv; | 189 | struct il_priv *il __maybe_unused = rs_sta->il; |
190 | int unflushed = 0; | 190 | int unflushed = 0; |
191 | unsigned long flags; | 191 | unsigned long flags; |
192 | u32 packet_count, duration, pps; | 192 | u32 packet_count, duration, pps; |
193 | 193 | ||
194 | IL_DEBUG_RATE(priv, "enter\n"); | 194 | IL_DEBUG_RATE(il, "enter\n"); |
195 | 195 | ||
196 | unflushed = il3945_rate_scale_flush_windows(rs_sta); | 196 | unflushed = il3945_rate_scale_flush_windows(rs_sta); |
197 | 197 | ||
@@ -206,7 +206,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data) | |||
206 | duration = | 206 | duration = |
207 | jiffies_to_msecs(jiffies - rs_sta->last_partial_flush); | 207 | jiffies_to_msecs(jiffies - rs_sta->last_partial_flush); |
208 | 208 | ||
209 | IL_DEBUG_RATE(priv, "Tx'd %d packets in %dms\n", | 209 | IL_DEBUG_RATE(il, "Tx'd %d packets in %dms\n", |
210 | packet_count, duration); | 210 | packet_count, duration); |
211 | 211 | ||
212 | /* Determine packets per second */ | 212 | /* Determine packets per second */ |
@@ -226,7 +226,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data) | |||
226 | 226 | ||
227 | rs_sta->flush_time = msecs_to_jiffies(duration); | 227 | rs_sta->flush_time = msecs_to_jiffies(duration); |
228 | 228 | ||
229 | IL_DEBUG_RATE(priv, "new flush period: %d msec ave %d\n", | 229 | IL_DEBUG_RATE(il, "new flush period: %d msec ave %d\n", |
230 | duration, packet_count); | 230 | duration, packet_count); |
231 | 231 | ||
232 | mod_timer(&rs_sta->rate_scale_flush, jiffies + | 232 | mod_timer(&rs_sta->rate_scale_flush, jiffies + |
@@ -244,7 +244,7 @@ static void il3945_bg_rate_scale_flush(unsigned long data) | |||
244 | 244 | ||
245 | spin_unlock_irqrestore(&rs_sta->lock, flags); | 245 | spin_unlock_irqrestore(&rs_sta->lock, flags); |
246 | 246 | ||
247 | IL_DEBUG_RATE(priv, "leave\n"); | 247 | IL_DEBUG_RATE(il, "leave\n"); |
248 | } | 248 | } |
249 | 249 | ||
250 | /** | 250 | /** |
@@ -260,10 +260,10 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta, | |||
260 | { | 260 | { |
261 | unsigned long flags; | 261 | unsigned long flags; |
262 | s32 fail_count; | 262 | s32 fail_count; |
263 | struct il_priv *priv __maybe_unused = rs_sta->priv; | 263 | struct il_priv *il __maybe_unused = rs_sta->il; |
264 | 264 | ||
265 | if (!retries) { | 265 | if (!retries) { |
266 | IL_DEBUG_RATE(priv, "leave: retries == 0 -- should be at least 1\n"); | 266 | IL_DEBUG_RATE(il, "leave: retries == 0 -- should be at least 1\n"); |
267 | return; | 267 | return; |
268 | } | 268 | } |
269 | 269 | ||
@@ -332,24 +332,24 @@ static void il3945_collect_tx_data(struct il3945_rs_sta *rs_sta, | |||
332 | /* | 332 | /* |
333 | * Called after adding a new station to initialize rate scaling | 333 | * Called after adding a new station to initialize rate scaling |
334 | */ | 334 | */ |
335 | void il3945_rs_rate_init(struct il_priv *priv, struct ieee80211_sta *sta, u8 sta_id) | 335 | void il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id) |
336 | { | 336 | { |
337 | struct ieee80211_hw *hw = priv->hw; | 337 | struct ieee80211_hw *hw = il->hw; |
338 | struct ieee80211_conf *conf = &priv->hw->conf; | 338 | struct ieee80211_conf *conf = &il->hw->conf; |
339 | struct il3945_sta_priv *psta; | 339 | struct il3945_sta_priv *psta; |
340 | struct il3945_rs_sta *rs_sta; | 340 | struct il3945_rs_sta *rs_sta; |
341 | struct ieee80211_supported_band *sband; | 341 | struct ieee80211_supported_band *sband; |
342 | int i; | 342 | int i; |
343 | 343 | ||
344 | IL_DEBUG_INFO(priv, "enter\n"); | 344 | IL_DEBUG_INFO(il, "enter\n"); |
345 | if (sta_id == priv->contexts[IL_RXON_CTX_BSS].bcast_sta_id) | 345 | if (sta_id == il->contexts[IL_RXON_CTX_BSS].bcast_sta_id) |
346 | goto out; | 346 | goto out; |
347 | 347 | ||
348 | psta = (struct il3945_sta_priv *) sta->drv_priv; | 348 | psta = (struct il3945_sta_priv *) sta->drv_priv; |
349 | rs_sta = &psta->rs_sta; | 349 | rs_sta = &psta->rs_sta; |
350 | sband = hw->wiphy->bands[conf->channel->band]; | 350 | sband = hw->wiphy->bands[conf->channel->band]; |
351 | 351 | ||
352 | rs_sta->priv = priv; | 352 | rs_sta->il = il; |
353 | 353 | ||
354 | rs_sta->start_rate = IL_RATE_INVALID; | 354 | rs_sta->start_rate = IL_RATE_INVALID; |
355 | 355 | ||
@@ -379,18 +379,18 @@ void il3945_rs_rate_init(struct il_priv *priv, struct ieee80211_sta *sta, u8 sta | |||
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | priv->_3945.sta_supp_rates = sta->supp_rates[sband->band]; | 382 | il->_3945.sta_supp_rates = sta->supp_rates[sband->band]; |
383 | /* For 5 GHz band it start at IL_FIRST_OFDM_RATE */ | 383 | /* For 5 GHz band it start at IL_FIRST_OFDM_RATE */ |
384 | if (sband->band == IEEE80211_BAND_5GHZ) { | 384 | if (sband->band == IEEE80211_BAND_5GHZ) { |
385 | rs_sta->last_txrate_idx += IL_FIRST_OFDM_RATE; | 385 | rs_sta->last_txrate_idx += IL_FIRST_OFDM_RATE; |
386 | priv->_3945.sta_supp_rates = priv->_3945.sta_supp_rates << | 386 | il->_3945.sta_supp_rates = il->_3945.sta_supp_rates << |
387 | IL_FIRST_OFDM_RATE; | 387 | IL_FIRST_OFDM_RATE; |
388 | } | 388 | } |
389 | 389 | ||
390 | out: | 390 | out: |
391 | priv->stations[sta_id].used &= ~IL_STA_UCODE_INPROGRESS; | 391 | il->stations[sta_id].used &= ~IL_STA_UCODE_INPROGRESS; |
392 | 392 | ||
393 | IL_DEBUG_INFO(priv, "leave\n"); | 393 | IL_DEBUG_INFO(il, "leave\n"); |
394 | } | 394 | } |
395 | 395 | ||
396 | static void *il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | 396 | static void *il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
@@ -399,7 +399,7 @@ static void *il3945_rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | |||
399 | } | 399 | } |
400 | 400 | ||
401 | /* rate scale requires free function to be implemented */ | 401 | /* rate scale requires free function to be implemented */ |
402 | static void il3945_rs_free(void *priv) | 402 | static void il3945_rs_free(void *il) |
403 | { | 403 | { |
404 | return; | 404 | return; |
405 | } | 405 | } |
@@ -408,24 +408,24 @@ static void *il3945_rs_alloc_sta(void *il_priv, struct ieee80211_sta *sta, gfp_t | |||
408 | { | 408 | { |
409 | struct il3945_rs_sta *rs_sta; | 409 | struct il3945_rs_sta *rs_sta; |
410 | struct il3945_sta_priv *psta = (void *) sta->drv_priv; | 410 | struct il3945_sta_priv *psta = (void *) sta->drv_priv; |
411 | struct il_priv *priv __maybe_unused = il_priv; | 411 | struct il_priv *il __maybe_unused = il_priv; |
412 | 412 | ||
413 | IL_DEBUG_RATE(priv, "enter\n"); | 413 | IL_DEBUG_RATE(il, "enter\n"); |
414 | 414 | ||
415 | rs_sta = &psta->rs_sta; | 415 | rs_sta = &psta->rs_sta; |
416 | 416 | ||
417 | spin_lock_init(&rs_sta->lock); | 417 | spin_lock_init(&rs_sta->lock); |
418 | init_timer(&rs_sta->rate_scale_flush); | 418 | init_timer(&rs_sta->rate_scale_flush); |
419 | 419 | ||
420 | IL_DEBUG_RATE(priv, "leave\n"); | 420 | IL_DEBUG_RATE(il, "leave\n"); |
421 | 421 | ||
422 | return rs_sta; | 422 | return rs_sta; |
423 | } | 423 | } |
424 | 424 | ||
425 | static void il3945_rs_free_sta(void *il_priv, struct ieee80211_sta *sta, | 425 | static void il3945_rs_free_sta(void *il_priv, struct ieee80211_sta *sta, |
426 | void *priv_sta) | 426 | void *il_sta) |
427 | { | 427 | { |
428 | struct il3945_rs_sta *rs_sta = priv_sta; | 428 | struct il3945_rs_sta *rs_sta = il_sta; |
429 | 429 | ||
430 | /* | 430 | /* |
431 | * Be careful not to use any members of il3945_rs_sta (like trying | 431 | * Be careful not to use any members of il3945_rs_sta (like trying |
@@ -442,18 +442,18 @@ static void il3945_rs_free_sta(void *il_priv, struct ieee80211_sta *sta, | |||
442 | * NOTE: Uses il_priv->retry_rate for the # of retries attempted by | 442 | * NOTE: Uses il_priv->retry_rate for the # of retries attempted by |
443 | * the hardware for each rate. | 443 | * the hardware for each rate. |
444 | */ | 444 | */ |
445 | static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band *sband, | 445 | static void il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *sband, |
446 | struct ieee80211_sta *sta, void *priv_sta, | 446 | struct ieee80211_sta *sta, void *il_sta, |
447 | struct sk_buff *skb) | 447 | struct sk_buff *skb) |
448 | { | 448 | { |
449 | s8 retries = 0, current_count; | 449 | s8 retries = 0, current_count; |
450 | int scale_rate_index, first_index, last_index; | 450 | int scale_rate_index, first_index, last_index; |
451 | unsigned long flags; | 451 | unsigned long flags; |
452 | struct il_priv *priv = (struct il_priv *)priv_rate; | 452 | struct il_priv *il = (struct il_priv *)il_rate; |
453 | struct il3945_rs_sta *rs_sta = priv_sta; | 453 | struct il3945_rs_sta *rs_sta = il_sta; |
454 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 454 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
455 | 455 | ||
456 | IL_DEBUG_RATE(priv, "enter\n"); | 456 | IL_DEBUG_RATE(il, "enter\n"); |
457 | 457 | ||
458 | retries = info->status.rates[0].count; | 458 | retries = info->status.rates[0].count; |
459 | /* Sanity Check for retries */ | 459 | /* Sanity Check for retries */ |
@@ -462,18 +462,18 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band | |||
462 | 462 | ||
463 | first_index = sband->bitrates[info->status.rates[0].idx].hw_value; | 463 | first_index = sband->bitrates[info->status.rates[0].idx].hw_value; |
464 | if ((first_index < 0) || (first_index >= IL_RATE_COUNT_3945)) { | 464 | if ((first_index < 0) || (first_index >= IL_RATE_COUNT_3945)) { |
465 | IL_DEBUG_RATE(priv, "leave: Rate out of bounds: %d\n", first_index); | 465 | IL_DEBUG_RATE(il, "leave: Rate out of bounds: %d\n", first_index); |
466 | return; | 466 | return; |
467 | } | 467 | } |
468 | 468 | ||
469 | if (!priv_sta) { | 469 | if (!il_sta) { |
470 | IL_DEBUG_RATE(priv, "leave: No STA priv data to update!\n"); | 470 | IL_DEBUG_RATE(il, "leave: No STA il data to update!\n"); |
471 | return; | 471 | return; |
472 | } | 472 | } |
473 | 473 | ||
474 | /* Treat uninitialized rate scaling data same as non-existing. */ | 474 | /* Treat uninitialized rate scaling data same as non-existing. */ |
475 | if (!rs_sta->priv) { | 475 | if (!rs_sta->il) { |
476 | IL_DEBUG_RATE(priv, "leave: STA priv data uninitialized!\n"); | 476 | IL_DEBUG_RATE(il, "leave: STA il data uninitialized!\n"); |
477 | return; | 477 | return; |
478 | } | 478 | } |
479 | 479 | ||
@@ -487,19 +487,19 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band | |||
487 | * Update the window for each rate. We determine which rates | 487 | * Update the window for each rate. We determine which rates |
488 | * were Tx'd based on the total number of retries vs. the number | 488 | * were Tx'd based on the total number of retries vs. the number |
489 | * of retries configured for each rate -- currently set to the | 489 | * of retries configured for each rate -- currently set to the |
490 | * priv value 'retry_rate' vs. rate specific | 490 | * il value 'retry_rate' vs. rate specific |
491 | * | 491 | * |
492 | * On exit from this while loop last_index indicates the rate | 492 | * On exit from this while loop last_index indicates the rate |
493 | * at which the frame was finally transmitted (or failed if no | 493 | * at which the frame was finally transmitted (or failed if no |
494 | * ACK) | 494 | * ACK) |
495 | */ | 495 | */ |
496 | while (retries > 1) { | 496 | while (retries > 1) { |
497 | if ((retries - 1) < priv->retry_rate) { | 497 | if ((retries - 1) < il->retry_rate) { |
498 | current_count = (retries - 1); | 498 | current_count = (retries - 1); |
499 | last_index = scale_rate_index; | 499 | last_index = scale_rate_index; |
500 | } else { | 500 | } else { |
501 | current_count = priv->retry_rate; | 501 | current_count = il->retry_rate; |
502 | last_index = il3945_rs_next_rate(priv, | 502 | last_index = il3945_rs_next_rate(il, |
503 | scale_rate_index); | 503 | scale_rate_index); |
504 | } | 504 | } |
505 | 505 | ||
@@ -508,7 +508,7 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band | |||
508 | il3945_collect_tx_data(rs_sta, | 508 | il3945_collect_tx_data(rs_sta, |
509 | &rs_sta->win[scale_rate_index], | 509 | &rs_sta->win[scale_rate_index], |
510 | 0, current_count, scale_rate_index); | 510 | 0, current_count, scale_rate_index); |
511 | IL_DEBUG_RATE(priv, "Update rate %d for %d retries.\n", | 511 | IL_DEBUG_RATE(il, "Update rate %d for %d retries.\n", |
512 | scale_rate_index, current_count); | 512 | scale_rate_index, current_count); |
513 | 513 | ||
514 | retries -= current_count; | 514 | retries -= current_count; |
@@ -518,7 +518,7 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band | |||
518 | 518 | ||
519 | 519 | ||
520 | /* Update the last index window with success/failure based on ACK */ | 520 | /* Update the last index window with success/failure based on ACK */ |
521 | IL_DEBUG_RATE(priv, "Update rate %d with %s.\n", | 521 | IL_DEBUG_RATE(il, "Update rate %d with %s.\n", |
522 | last_index, | 522 | last_index, |
523 | (info->flags & IEEE80211_TX_STAT_ACK) ? | 523 | (info->flags & IEEE80211_TX_STAT_ACK) ? |
524 | "success" : "failure"); | 524 | "success" : "failure"); |
@@ -543,7 +543,7 @@ static void il3945_rs_tx_status(void *priv_rate, struct ieee80211_supported_band | |||
543 | 543 | ||
544 | spin_unlock_irqrestore(&rs_sta->lock, flags); | 544 | spin_unlock_irqrestore(&rs_sta->lock, flags); |
545 | 545 | ||
546 | IL_DEBUG_RATE(priv, "leave\n"); | 546 | IL_DEBUG_RATE(il, "leave\n"); |
547 | } | 547 | } |
548 | 548 | ||
549 | static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, | 549 | static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, |
@@ -551,7 +551,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, | |||
551 | { | 551 | { |
552 | u8 high = IL_RATE_INVALID; | 552 | u8 high = IL_RATE_INVALID; |
553 | u8 low = IL_RATE_INVALID; | 553 | u8 low = IL_RATE_INVALID; |
554 | struct il_priv *priv __maybe_unused = rs_sta->priv; | 554 | struct il_priv *il __maybe_unused = rs_sta->il; |
555 | 555 | ||
556 | /* 802.11A walks to the next literal adjacent rate in | 556 | /* 802.11A walks to the next literal adjacent rate in |
557 | * the rate table */ | 557 | * the rate table */ |
@@ -591,7 +591,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, | |||
591 | break; | 591 | break; |
592 | if (rate_mask & (1 << low)) | 592 | if (rate_mask & (1 << low)) |
593 | break; | 593 | break; |
594 | IL_DEBUG_RATE(priv, "Skipping masked lower rate: %d\n", low); | 594 | IL_DEBUG_RATE(il, "Skipping masked lower rate: %d\n", low); |
595 | } | 595 | } |
596 | 596 | ||
597 | high = index; | 597 | high = index; |
@@ -604,7 +604,7 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, | |||
604 | break; | 604 | break; |
605 | if (rate_mask & (1 << high)) | 605 | if (rate_mask & (1 << high)) |
606 | break; | 606 | break; |
607 | IL_DEBUG_RATE(priv, "Skipping masked higher rate: %d\n", high); | 607 | IL_DEBUG_RATE(il, "Skipping masked higher rate: %d\n", high); |
608 | } | 608 | } |
609 | 609 | ||
610 | return (high << 8) | low; | 610 | return (high << 8) | low; |
@@ -626,8 +626,8 @@ static u16 il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, | |||
626 | * rate table and must reference the driver allocated rate table | 626 | * rate table and must reference the driver allocated rate table |
627 | * | 627 | * |
628 | */ | 628 | */ |
629 | static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | 629 | static void il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta, |
630 | void *priv_sta, struct ieee80211_tx_rate_control *txrc) | 630 | void *il_sta, struct ieee80211_tx_rate_control *txrc) |
631 | { | 631 | { |
632 | struct ieee80211_supported_band *sband = txrc->sband; | 632 | struct ieee80211_supported_band *sband = txrc->sband; |
633 | struct sk_buff *skb = txrc->skb; | 633 | struct sk_buff *skb = txrc->skb; |
@@ -635,7 +635,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
635 | u8 high = IL_RATE_INVALID; | 635 | u8 high = IL_RATE_INVALID; |
636 | u16 high_low; | 636 | u16 high_low; |
637 | int index; | 637 | int index; |
638 | struct il3945_rs_sta *rs_sta = priv_sta; | 638 | struct il3945_rs_sta *rs_sta = il_sta; |
639 | struct il3945_rate_scale_data *window = NULL; | 639 | struct il3945_rate_scale_data *window = NULL; |
640 | int current_tpt = IL_INVALID_VALUE; | 640 | int current_tpt = IL_INVALID_VALUE; |
641 | int low_tpt = IL_INVALID_VALUE; | 641 | int low_tpt = IL_INVALID_VALUE; |
@@ -645,18 +645,18 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
645 | unsigned long flags; | 645 | unsigned long flags; |
646 | u16 rate_mask; | 646 | u16 rate_mask; |
647 | s8 max_rate_idx = -1; | 647 | s8 max_rate_idx = -1; |
648 | struct il_priv *priv __maybe_unused = (struct il_priv *)priv_r; | 648 | struct il_priv *il __maybe_unused = (struct il_priv *)il_r; |
649 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 649 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
650 | 650 | ||
651 | IL_DEBUG_RATE(priv, "enter\n"); | 651 | IL_DEBUG_RATE(il, "enter\n"); |
652 | 652 | ||
653 | /* Treat uninitialized rate scaling data same as non-existing. */ | 653 | /* Treat uninitialized rate scaling data same as non-existing. */ |
654 | if (rs_sta && !rs_sta->priv) { | 654 | if (rs_sta && !rs_sta->il) { |
655 | IL_DEBUG_RATE(priv, "Rate scaling information not initialized yet.\n"); | 655 | IL_DEBUG_RATE(il, "Rate scaling information not initialized yet.\n"); |
656 | priv_sta = NULL; | 656 | il_sta = NULL; |
657 | } | 657 | } |
658 | 658 | ||
659 | if (rate_control_send_low(sta, priv_sta, txrc)) | 659 | if (rate_control_send_low(sta, il_sta, txrc)) |
660 | return; | 660 | return; |
661 | 661 | ||
662 | rate_mask = sta->supp_rates[sband->band]; | 662 | rate_mask = sta->supp_rates[sband->band]; |
@@ -699,7 +699,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
699 | (window->success_counter < IL_RATE_MIN_SUCCESS_TH))) { | 699 | (window->success_counter < IL_RATE_MIN_SUCCESS_TH))) { |
700 | spin_unlock_irqrestore(&rs_sta->lock, flags); | 700 | spin_unlock_irqrestore(&rs_sta->lock, flags); |
701 | 701 | ||
702 | IL_DEBUG_RATE(priv, "Invalid average_tpt on rate %d: " | 702 | IL_DEBUG_RATE(il, "Invalid average_tpt on rate %d: " |
703 | "counter: %d, success_counter: %d, " | 703 | "counter: %d, success_counter: %d, " |
704 | "expected_tpt is %sNULL\n", | 704 | "expected_tpt is %sNULL\n", |
705 | index, | 705 | index, |
@@ -737,7 +737,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
737 | 737 | ||
738 | /* Low success ratio , need to drop the rate */ | 738 | /* Low success ratio , need to drop the rate */ |
739 | if ((window->success_ratio < IL_RATE_DECREASE_TH) || !current_tpt) { | 739 | if ((window->success_ratio < IL_RATE_DECREASE_TH) || !current_tpt) { |
740 | IL_DEBUG_RATE(priv, "decrease rate because of low success_ratio\n"); | 740 | IL_DEBUG_RATE(il, "decrease rate because of low success_ratio\n"); |
741 | scale_action = -1; | 741 | scale_action = -1; |
742 | /* No throughput measured yet for adjacent rates, | 742 | /* No throughput measured yet for adjacent rates, |
743 | * try increase */ | 743 | * try increase */ |
@@ -756,7 +756,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
756 | (high_tpt != IL_INVALID_VALUE) && | 756 | (high_tpt != IL_INVALID_VALUE) && |
757 | (low_tpt < current_tpt) && (high_tpt < current_tpt)) { | 757 | (low_tpt < current_tpt) && (high_tpt < current_tpt)) { |
758 | 758 | ||
759 | IL_DEBUG_RATE(priv, "No action -- low [%d] & high [%d] < " | 759 | IL_DEBUG_RATE(il, "No action -- low [%d] & high [%d] < " |
760 | "current_tpt [%d]\n", | 760 | "current_tpt [%d]\n", |
761 | low_tpt, high_tpt, current_tpt); | 761 | low_tpt, high_tpt, current_tpt); |
762 | scale_action = 0; | 762 | scale_action = 0; |
@@ -771,13 +771,13 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
771 | window->success_ratio >= IL_RATE_INCREASE_TH) | 771 | window->success_ratio >= IL_RATE_INCREASE_TH) |
772 | scale_action = 1; | 772 | scale_action = 1; |
773 | else { | 773 | else { |
774 | IL_DEBUG_RATE(priv, | 774 | IL_DEBUG_RATE(il, |
775 | "decrease rate because of high tpt\n"); | 775 | "decrease rate because of high tpt\n"); |
776 | scale_action = 0; | 776 | scale_action = 0; |
777 | } | 777 | } |
778 | } else if (low_tpt != IL_INVALID_VALUE) { | 778 | } else if (low_tpt != IL_INVALID_VALUE) { |
779 | if (low_tpt > current_tpt) { | 779 | if (low_tpt > current_tpt) { |
780 | IL_DEBUG_RATE(priv, | 780 | IL_DEBUG_RATE(il, |
781 | "decrease rate because of low tpt\n"); | 781 | "decrease rate because of low tpt\n"); |
782 | scale_action = -1; | 782 | scale_action = -1; |
783 | } else if (window->success_ratio >= IL_RATE_INCREASE_TH) { | 783 | } else if (window->success_ratio >= IL_RATE_INCREASE_TH) { |
@@ -816,7 +816,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
816 | break; | 816 | break; |
817 | } | 817 | } |
818 | 818 | ||
819 | IL_DEBUG_RATE(priv, "Selected %d (action %d) - low %d high %d\n", | 819 | IL_DEBUG_RATE(il, "Selected %d (action %d) - low %d high %d\n", |
820 | index, scale_action, low, high); | 820 | index, scale_action, low, high); |
821 | 821 | ||
822 | out: | 822 | out: |
@@ -831,7 +831,7 @@ static void il3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
831 | info->control.rates[0].idx = rs_sta->last_txrate_idx; | 831 | info->control.rates[0].idx = rs_sta->last_txrate_idx; |
832 | } | 832 | } |
833 | 833 | ||
834 | IL_DEBUG_RATE(priv, "leave: %d\n", index); | 834 | IL_DEBUG_RATE(il, "leave: %d\n", index); |
835 | } | 835 | } |
836 | 836 | ||
837 | #ifdef CONFIG_MAC80211_DEBUGFS | 837 | #ifdef CONFIG_MAC80211_DEBUGFS |
@@ -878,10 +878,10 @@ static const struct file_operations rs_sta_dbgfs_stats_table_ops = { | |||
878 | .llseek = default_llseek, | 878 | .llseek = default_llseek, |
879 | }; | 879 | }; |
880 | 880 | ||
881 | static void il3945_add_debugfs(void *priv, void *priv_sta, | 881 | static void il3945_add_debugfs(void *il, void *il_sta, |
882 | struct dentry *dir) | 882 | struct dentry *dir) |
883 | { | 883 | { |
884 | struct il3945_rs_sta *lq_sta = priv_sta; | 884 | struct il3945_rs_sta *lq_sta = il_sta; |
885 | 885 | ||
886 | lq_sta->rs_sta_dbgfs_stats_table_file = | 886 | lq_sta->rs_sta_dbgfs_stats_table_file = |
887 | debugfs_create_file("rate_stats_table", 0600, dir, | 887 | debugfs_create_file("rate_stats_table", 0600, dir, |
@@ -889,9 +889,9 @@ static void il3945_add_debugfs(void *priv, void *priv_sta, | |||
889 | 889 | ||
890 | } | 890 | } |
891 | 891 | ||
892 | static void il3945_remove_debugfs(void *priv, void *priv_sta) | 892 | static void il3945_remove_debugfs(void *il, void *il_sta) |
893 | { | 893 | { |
894 | struct il3945_rs_sta *lq_sta = priv_sta; | 894 | struct il3945_rs_sta *lq_sta = il_sta; |
895 | debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); | 895 | debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); |
896 | } | 896 | } |
897 | #endif | 897 | #endif |
@@ -901,9 +901,9 @@ static void il3945_remove_debugfs(void *priv, void *priv_sta) | |||
901 | * the station is added. Since mac80211 calls this function before a | 901 | * the station is added. Since mac80211 calls this function before a |
902 | * station is added we ignore it. | 902 | * station is added we ignore it. |
903 | */ | 903 | */ |
904 | static void il3945_rs_rate_init_stub(void *priv_r, | 904 | static void il3945_rs_rate_init_stub(void *il_r, |
905 | struct ieee80211_supported_band *sband, | 905 | struct ieee80211_supported_band *sband, |
906 | struct ieee80211_sta *sta, void *priv_sta) | 906 | struct ieee80211_sta *sta, void *il_sta) |
907 | { | 907 | { |
908 | } | 908 | } |
909 | 909 | ||
@@ -925,21 +925,21 @@ static struct rate_control_ops rs_ops = { | |||
925 | }; | 925 | }; |
926 | void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | 926 | void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) |
927 | { | 927 | { |
928 | struct il_priv *priv = hw->priv; | 928 | struct il_priv *il = hw->priv; |
929 | s32 rssi = 0; | 929 | s32 rssi = 0; |
930 | unsigned long flags; | 930 | unsigned long flags; |
931 | struct il3945_rs_sta *rs_sta; | 931 | struct il3945_rs_sta *rs_sta; |
932 | struct ieee80211_sta *sta; | 932 | struct ieee80211_sta *sta; |
933 | struct il3945_sta_priv *psta; | 933 | struct il3945_sta_priv *psta; |
934 | 934 | ||
935 | IL_DEBUG_RATE(priv, "enter\n"); | 935 | IL_DEBUG_RATE(il, "enter\n"); |
936 | 936 | ||
937 | rcu_read_lock(); | 937 | rcu_read_lock(); |
938 | 938 | ||
939 | sta = ieee80211_find_sta(priv->contexts[IL_RXON_CTX_BSS].vif, | 939 | sta = ieee80211_find_sta(il->contexts[IL_RXON_CTX_BSS].vif, |
940 | priv->stations[sta_id].sta.sta.addr); | 940 | il->stations[sta_id].sta.sta.addr); |
941 | if (!sta) { | 941 | if (!sta) { |
942 | IL_DEBUG_RATE(priv, "Unable to find station to initialize rate scaling.\n"); | 942 | IL_DEBUG_RATE(il, "Unable to find station to initialize rate scaling.\n"); |
943 | rcu_read_unlock(); | 943 | rcu_read_unlock(); |
944 | return; | 944 | return; |
945 | } | 945 | } |
@@ -950,10 +950,10 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | |||
950 | spin_lock_irqsave(&rs_sta->lock, flags); | 950 | spin_lock_irqsave(&rs_sta->lock, flags); |
951 | 951 | ||
952 | rs_sta->tgg = 0; | 952 | rs_sta->tgg = 0; |
953 | switch (priv->band) { | 953 | switch (il->band) { |
954 | case IEEE80211_BAND_2GHZ: | 954 | case IEEE80211_BAND_2GHZ: |
955 | /* TODO: this always does G, not a regression */ | 955 | /* TODO: this always does G, not a regression */ |
956 | if (priv->contexts[IL_RXON_CTX_BSS].active.flags & | 956 | if (il->contexts[IL_RXON_CTX_BSS].active.flags & |
957 | RXON_FLG_TGG_PROTECT_MSK) { | 957 | RXON_FLG_TGG_PROTECT_MSK) { |
958 | rs_sta->tgg = 1; | 958 | rs_sta->tgg = 1; |
959 | rs_sta->expected_tpt = il3945_expected_tpt_g_prot; | 959 | rs_sta->expected_tpt = il3945_expected_tpt_g_prot; |
@@ -971,15 +971,15 @@ void il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | |||
971 | 971 | ||
972 | spin_unlock_irqrestore(&rs_sta->lock, flags); | 972 | spin_unlock_irqrestore(&rs_sta->lock, flags); |
973 | 973 | ||
974 | rssi = priv->_3945.last_rx_rssi; | 974 | rssi = il->_3945.last_rx_rssi; |
975 | if (rssi == 0) | 975 | if (rssi == 0) |
976 | rssi = IL_MIN_RSSI_VAL; | 976 | rssi = IL_MIN_RSSI_VAL; |
977 | 977 | ||
978 | IL_DEBUG_RATE(priv, "Network RSSI: %d\n", rssi); | 978 | IL_DEBUG_RATE(il, "Network RSSI: %d\n", rssi); |
979 | 979 | ||
980 | rs_sta->start_rate = il3945_get_rate_index_by_rssi(rssi, priv->band); | 980 | rs_sta->start_rate = il3945_get_rate_index_by_rssi(rssi, il->band); |
981 | 981 | ||
982 | IL_DEBUG_RATE(priv, "leave: rssi %d assign rate index: " | 982 | IL_DEBUG_RATE(il, "leave: rssi %d assign rate index: " |
983 | "%d (plcp 0x%x)\n", rssi, rs_sta->start_rate, | 983 | "%d (plcp 0x%x)\n", rssi, rs_sta->start_rate, |
984 | il3945_rates[rs_sta->start_rate].plcp); | 984 | il3945_rates[rs_sta->start_rate].plcp); |
985 | rcu_read_unlock(); | 985 | rcu_read_unlock(); |