diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-11-03 20:07:04 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-11 17:09:04 -0500 |
commit | 3d536acf45ba65acb15fc65bf46f8d6c7ad6c463 (patch) | |
tree | bd07619f8a4c9f1a926abcbc203fadc5962c13fa /drivers/net/wireless/ath/ath9k/main.c | |
parent | 30cbd42265546a3efa146d4eb3456165325c83a7 (diff) |
ath9k: move struct ath_ani to common area
This can be shared between ath9k and ath9k_htc. It will also
help with sharing routine helpers on the RX path.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 11aaa7d69a1f..01ac8974eb07 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -405,34 +405,34 @@ static void ath_ani_calibrate(unsigned long data) | |||
405 | ath9k_ps_wakeup(sc); | 405 | ath9k_ps_wakeup(sc); |
406 | 406 | ||
407 | /* Long calibration runs independently of short calibration. */ | 407 | /* Long calibration runs independently of short calibration. */ |
408 | if ((timestamp - sc->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) { | 408 | if ((timestamp - common->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) { |
409 | longcal = true; | 409 | longcal = true; |
410 | ath_print(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies); | 410 | ath_print(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies); |
411 | sc->ani.longcal_timer = timestamp; | 411 | common->ani.longcal_timer = timestamp; |
412 | } | 412 | } |
413 | 413 | ||
414 | /* Short calibration applies only while caldone is false */ | 414 | /* Short calibration applies only while caldone is false */ |
415 | if (!sc->ani.caldone) { | 415 | if (!common->ani.caldone) { |
416 | if ((timestamp - sc->ani.shortcal_timer) >= short_cal_interval) { | 416 | if ((timestamp - common->ani.shortcal_timer) >= short_cal_interval) { |
417 | shortcal = true; | 417 | shortcal = true; |
418 | ath_print(common, ATH_DBG_ANI, | 418 | ath_print(common, ATH_DBG_ANI, |
419 | "shortcal @%lu\n", jiffies); | 419 | "shortcal @%lu\n", jiffies); |
420 | sc->ani.shortcal_timer = timestamp; | 420 | common->ani.shortcal_timer = timestamp; |
421 | sc->ani.resetcal_timer = timestamp; | 421 | common->ani.resetcal_timer = timestamp; |
422 | } | 422 | } |
423 | } else { | 423 | } else { |
424 | if ((timestamp - sc->ani.resetcal_timer) >= | 424 | if ((timestamp - common->ani.resetcal_timer) >= |
425 | ATH_RESTART_CALINTERVAL) { | 425 | ATH_RESTART_CALINTERVAL) { |
426 | sc->ani.caldone = ath9k_hw_reset_calvalid(ah); | 426 | common->ani.caldone = ath9k_hw_reset_calvalid(ah); |
427 | if (sc->ani.caldone) | 427 | if (common->ani.caldone) |
428 | sc->ani.resetcal_timer = timestamp; | 428 | common->ani.resetcal_timer = timestamp; |
429 | } | 429 | } |
430 | } | 430 | } |
431 | 431 | ||
432 | /* Verify whether we must check ANI */ | 432 | /* Verify whether we must check ANI */ |
433 | if ((timestamp - sc->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) { | 433 | if ((timestamp - common->ani.checkani_timer) >= ATH_ANI_POLLINTERVAL) { |
434 | aniflag = true; | 434 | aniflag = true; |
435 | sc->ani.checkani_timer = timestamp; | 435 | common->ani.checkani_timer = timestamp; |
436 | } | 436 | } |
437 | 437 | ||
438 | /* Skip all processing if there's nothing to do. */ | 438 | /* Skip all processing if there's nothing to do. */ |
@@ -443,21 +443,21 @@ static void ath_ani_calibrate(unsigned long data) | |||
443 | 443 | ||
444 | /* Perform calibration if necessary */ | 444 | /* Perform calibration if necessary */ |
445 | if (longcal || shortcal) { | 445 | if (longcal || shortcal) { |
446 | sc->ani.caldone = | 446 | common->ani.caldone = |
447 | ath9k_hw_calibrate(ah, | 447 | ath9k_hw_calibrate(ah, |
448 | ah->curchan, | 448 | ah->curchan, |
449 | common->rx_chainmask, | 449 | common->rx_chainmask, |
450 | longcal); | 450 | longcal); |
451 | 451 | ||
452 | if (longcal) | 452 | if (longcal) |
453 | sc->ani.noise_floor = ath9k_hw_getchan_noise(ah, | 453 | common->ani.noise_floor = ath9k_hw_getchan_noise(ah, |
454 | ah->curchan); | 454 | ah->curchan); |
455 | 455 | ||
456 | ath_print(common, ATH_DBG_ANI, | 456 | ath_print(common, ATH_DBG_ANI, |
457 | " calibrate chan %u/%x nf: %d\n", | 457 | " calibrate chan %u/%x nf: %d\n", |
458 | ah->curchan->channel, | 458 | ah->curchan->channel, |
459 | ah->curchan->channelFlags, | 459 | ah->curchan->channelFlags, |
460 | sc->ani.noise_floor); | 460 | common->ani.noise_floor); |
461 | } | 461 | } |
462 | } | 462 | } |
463 | 463 | ||
@@ -473,21 +473,21 @@ set_timer: | |||
473 | cal_interval = ATH_LONG_CALINTERVAL; | 473 | cal_interval = ATH_LONG_CALINTERVAL; |
474 | if (sc->sc_ah->config.enable_ani) | 474 | if (sc->sc_ah->config.enable_ani) |
475 | cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL); | 475 | cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL); |
476 | if (!sc->ani.caldone) | 476 | if (!common->ani.caldone) |
477 | cal_interval = min(cal_interval, (u32)short_cal_interval); | 477 | cal_interval = min(cal_interval, (u32)short_cal_interval); |
478 | 478 | ||
479 | mod_timer(&sc->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); | 479 | mod_timer(&common->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); |
480 | } | 480 | } |
481 | 481 | ||
482 | static void ath_start_ani(struct ath_softc *sc) | 482 | static void ath_start_ani(struct ath_common *common) |
483 | { | 483 | { |
484 | unsigned long timestamp = jiffies_to_msecs(jiffies); | 484 | unsigned long timestamp = jiffies_to_msecs(jiffies); |
485 | 485 | ||
486 | sc->ani.longcal_timer = timestamp; | 486 | common->ani.longcal_timer = timestamp; |
487 | sc->ani.shortcal_timer = timestamp; | 487 | common->ani.shortcal_timer = timestamp; |
488 | sc->ani.checkani_timer = timestamp; | 488 | common->ani.checkani_timer = timestamp; |
489 | 489 | ||
490 | mod_timer(&sc->ani.timer, | 490 | mod_timer(&common->ani.timer, |
491 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); | 491 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); |
492 | } | 492 | } |
493 | 493 | ||
@@ -1023,12 +1023,12 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
1023 | /* Reset rssi stats */ | 1023 | /* Reset rssi stats */ |
1024 | sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; | 1024 | sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; |
1025 | 1025 | ||
1026 | ath_start_ani(sc); | 1026 | ath_start_ani(common); |
1027 | } else { | 1027 | } else { |
1028 | ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); | 1028 | ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); |
1029 | common->curaid = 0; | 1029 | common->curaid = 0; |
1030 | /* Stop ANI */ | 1030 | /* Stop ANI */ |
1031 | del_timer_sync(&sc->ani.timer); | 1031 | del_timer_sync(&common->ani.timer); |
1032 | } | 1032 | } |
1033 | } | 1033 | } |
1034 | 1034 | ||
@@ -1761,8 +1761,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
1761 | /* Initializes the noise floor to a reasonable default value. | 1761 | /* Initializes the noise floor to a reasonable default value. |
1762 | * Later on this will be updated during ANI processing. */ | 1762 | * Later on this will be updated during ANI processing. */ |
1763 | 1763 | ||
1764 | sc->ani.noise_floor = ATH_DEFAULT_NOISE_FLOOR; | 1764 | common->ani.noise_floor = ATH_DEFAULT_NOISE_FLOOR; |
1765 | setup_timer(&sc->ani.timer, ath_ani_calibrate, (unsigned long)sc); | 1765 | setup_timer(&common->ani.timer, ath_ani_calibrate, (unsigned long)sc); |
1766 | 1766 | ||
1767 | if (ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, | 1767 | if (ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, |
1768 | ATH9K_CIPHER_TKIP, NULL)) { | 1768 | ATH9K_CIPHER_TKIP, NULL)) { |
@@ -2634,7 +2634,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2634 | if (conf->type == NL80211_IFTYPE_AP || | 2634 | if (conf->type == NL80211_IFTYPE_AP || |
2635 | conf->type == NL80211_IFTYPE_ADHOC || | 2635 | conf->type == NL80211_IFTYPE_ADHOC || |
2636 | conf->type == NL80211_IFTYPE_MONITOR) | 2636 | conf->type == NL80211_IFTYPE_MONITOR) |
2637 | ath_start_ani(sc); | 2637 | ath_start_ani(common); |
2638 | 2638 | ||
2639 | out: | 2639 | out: |
2640 | mutex_unlock(&sc->mutex); | 2640 | mutex_unlock(&sc->mutex); |
@@ -2655,7 +2655,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
2655 | mutex_lock(&sc->mutex); | 2655 | mutex_lock(&sc->mutex); |
2656 | 2656 | ||
2657 | /* Stop ANI */ | 2657 | /* Stop ANI */ |
2658 | del_timer_sync(&sc->ani.timer); | 2658 | del_timer_sync(&common->ani.timer); |
2659 | 2659 | ||
2660 | /* Reclaim beacon resources */ | 2660 | /* Reclaim beacon resources */ |
2661 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || | 2661 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || |