diff options
author | Pavel Roskin <proski@gnu.org> | 2010-03-31 18:05:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-06 16:55:08 -0400 |
commit | 3069168c82d65f88e4ac76eda09baff02adfd743 (patch) | |
tree | 7f9baf122262459eed84f8742bfa7526ac6ae6d1 /drivers | |
parent | c81494d548d0735f13c04dd2c336cde470d1a5ae (diff) |
ath9k: move imask from sc to ah
Add ah variable in the functions that didn't have it and used sc->imask.
Replace sc->sc_ah with ah in those functions.
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/gpio.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 60 |
5 files changed, 56 insertions, 56 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index a581c365da6f..bdcd257ca7a4 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -480,7 +480,6 @@ struct ath_softc { | |||
480 | bool ps_enabled; | 480 | bool ps_enabled; |
481 | bool ps_idle; | 481 | bool ps_idle; |
482 | unsigned long ps_usecount; | 482 | unsigned long ps_usecount; |
483 | enum ath9k_int imask; | ||
484 | 483 | ||
485 | struct ath_config config; | 484 | struct ath_config config; |
486 | struct ath_rx rx; | 485 | struct ath_rx rx; |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index b4a31a43a62c..22375a754718 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -524,6 +524,7 @@ static void ath9k_beacon_init(struct ath_softc *sc, | |||
524 | static void ath_beacon_config_ap(struct ath_softc *sc, | 524 | static void ath_beacon_config_ap(struct ath_softc *sc, |
525 | struct ath_beacon_config *conf) | 525 | struct ath_beacon_config *conf) |
526 | { | 526 | { |
527 | struct ath_hw *ah = sc->sc_ah; | ||
527 | u32 nexttbtt, intval; | 528 | u32 nexttbtt, intval; |
528 | 529 | ||
529 | /* NB: the beacon interval is kept internally in TU's */ | 530 | /* NB: the beacon interval is kept internally in TU's */ |
@@ -539,15 +540,15 @@ static void ath_beacon_config_ap(struct ath_softc *sc, | |||
539 | * prepare beacon frames. | 540 | * prepare beacon frames. |
540 | */ | 541 | */ |
541 | intval |= ATH9K_BEACON_ENA; | 542 | intval |= ATH9K_BEACON_ENA; |
542 | sc->imask |= ATH9K_INT_SWBA; | 543 | ah->imask |= ATH9K_INT_SWBA; |
543 | ath_beaconq_config(sc); | 544 | ath_beaconq_config(sc); |
544 | 545 | ||
545 | /* Set the computed AP beacon timers */ | 546 | /* Set the computed AP beacon timers */ |
546 | 547 | ||
547 | ath9k_hw_set_interrupts(sc->sc_ah, 0); | 548 | ath9k_hw_set_interrupts(ah, 0); |
548 | ath9k_beacon_init(sc, nexttbtt, intval); | 549 | ath9k_beacon_init(sc, nexttbtt, intval); |
549 | sc->beacon.bmisscnt = 0; | 550 | sc->beacon.bmisscnt = 0; |
550 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); | 551 | ath9k_hw_set_interrupts(ah, ah->imask); |
551 | 552 | ||
552 | /* Clear the reset TSF flag, so that subsequent beacon updation | 553 | /* Clear the reset TSF flag, so that subsequent beacon updation |
553 | will not reset the HW TSF. */ | 554 | will not reset the HW TSF. */ |
@@ -566,7 +567,8 @@ static void ath_beacon_config_ap(struct ath_softc *sc, | |||
566 | static void ath_beacon_config_sta(struct ath_softc *sc, | 567 | static void ath_beacon_config_sta(struct ath_softc *sc, |
567 | struct ath_beacon_config *conf) | 568 | struct ath_beacon_config *conf) |
568 | { | 569 | { |
569 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 570 | struct ath_hw *ah = sc->sc_ah; |
571 | struct ath_common *common = ath9k_hw_common(ah); | ||
570 | struct ath9k_beacon_state bs; | 572 | struct ath9k_beacon_state bs; |
571 | int dtimperiod, dtimcount, sleepduration; | 573 | int dtimperiod, dtimcount, sleepduration; |
572 | int cfpperiod, cfpcount; | 574 | int cfpperiod, cfpcount; |
@@ -605,7 +607,7 @@ static void ath_beacon_config_sta(struct ath_softc *sc, | |||
605 | * Pull nexttbtt forward to reflect the current | 607 | * Pull nexttbtt forward to reflect the current |
606 | * TSF and calculate dtim+cfp state for the result. | 608 | * TSF and calculate dtim+cfp state for the result. |
607 | */ | 609 | */ |
608 | tsf = ath9k_hw_gettsf64(sc->sc_ah); | 610 | tsf = ath9k_hw_gettsf64(ah); |
609 | tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; | 611 | tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE; |
610 | 612 | ||
611 | num_beacons = tsftu / intval + 1; | 613 | num_beacons = tsftu / intval + 1; |
@@ -678,17 +680,18 @@ static void ath_beacon_config_sta(struct ath_softc *sc, | |||
678 | 680 | ||
679 | /* Set the computed STA beacon timers */ | 681 | /* Set the computed STA beacon timers */ |
680 | 682 | ||
681 | ath9k_hw_set_interrupts(sc->sc_ah, 0); | 683 | ath9k_hw_set_interrupts(ah, 0); |
682 | ath9k_hw_set_sta_beacon_timers(sc->sc_ah, &bs); | 684 | ath9k_hw_set_sta_beacon_timers(ah, &bs); |
683 | sc->imask |= ATH9K_INT_BMISS; | 685 | ah->imask |= ATH9K_INT_BMISS; |
684 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); | 686 | ath9k_hw_set_interrupts(ah, ah->imask); |
685 | } | 687 | } |
686 | 688 | ||
687 | static void ath_beacon_config_adhoc(struct ath_softc *sc, | 689 | static void ath_beacon_config_adhoc(struct ath_softc *sc, |
688 | struct ath_beacon_config *conf, | 690 | struct ath_beacon_config *conf, |
689 | struct ieee80211_vif *vif) | 691 | struct ieee80211_vif *vif) |
690 | { | 692 | { |
691 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 693 | struct ath_hw *ah = sc->sc_ah; |
694 | struct ath_common *common = ath9k_hw_common(ah); | ||
692 | u64 tsf; | 695 | u64 tsf; |
693 | u32 tsftu, intval, nexttbtt; | 696 | u32 tsftu, intval, nexttbtt; |
694 | 697 | ||
@@ -703,7 +706,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, | |||
703 | else if (intval) | 706 | else if (intval) |
704 | nexttbtt = roundup(nexttbtt, intval); | 707 | nexttbtt = roundup(nexttbtt, intval); |
705 | 708 | ||
706 | tsf = ath9k_hw_gettsf64(sc->sc_ah); | 709 | tsf = ath9k_hw_gettsf64(ah); |
707 | tsftu = TSF_TO_TU((u32)(tsf>>32), (u32)tsf) + FUDGE; | 710 | tsftu = TSF_TO_TU((u32)(tsf>>32), (u32)tsf) + FUDGE; |
708 | do { | 711 | do { |
709 | nexttbtt += intval; | 712 | nexttbtt += intval; |
@@ -719,20 +722,20 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc, | |||
719 | * self-linked tx descriptor and let the hardware deal with things. | 722 | * self-linked tx descriptor and let the hardware deal with things. |
720 | */ | 723 | */ |
721 | intval |= ATH9K_BEACON_ENA; | 724 | intval |= ATH9K_BEACON_ENA; |
722 | if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) | 725 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) |
723 | sc->imask |= ATH9K_INT_SWBA; | 726 | ah->imask |= ATH9K_INT_SWBA; |
724 | 727 | ||
725 | ath_beaconq_config(sc); | 728 | ath_beaconq_config(sc); |
726 | 729 | ||
727 | /* Set the computed ADHOC beacon timers */ | 730 | /* Set the computed ADHOC beacon timers */ |
728 | 731 | ||
729 | ath9k_hw_set_interrupts(sc->sc_ah, 0); | 732 | ath9k_hw_set_interrupts(ah, 0); |
730 | ath9k_beacon_init(sc, nexttbtt, intval); | 733 | ath9k_beacon_init(sc, nexttbtt, intval); |
731 | sc->beacon.bmisscnt = 0; | 734 | sc->beacon.bmisscnt = 0; |
732 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); | 735 | ath9k_hw_set_interrupts(ah, ah->imask); |
733 | 736 | ||
734 | /* FIXME: Handle properly when vif is NULL */ | 737 | /* FIXME: Handle properly when vif is NULL */ |
735 | if (vif && sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_VEOL) | 738 | if (vif && ah->caps.hw_caps & ATH9K_HW_CAP_VEOL) |
736 | ath_beacon_start_adhoc(sc, vif); | 739 | ath_beacon_start_adhoc(sc, vif); |
737 | } | 740 | } |
738 | 741 | ||
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c index deab8beb0680..1e4578d303dd 100644 --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c | |||
@@ -283,22 +283,17 @@ static void ath9k_gen_timer_start(struct ath_hw *ah, | |||
283 | u32 timer_next, | 283 | u32 timer_next, |
284 | u32 timer_period) | 284 | u32 timer_period) |
285 | { | 285 | { |
286 | struct ath_common *common = ath9k_hw_common(ah); | ||
287 | struct ath_softc *sc = (struct ath_softc *) common->priv; | ||
288 | |||
289 | ath9k_hw_gen_timer_start(ah, timer, timer_next, timer_period); | 286 | ath9k_hw_gen_timer_start(ah, timer, timer_next, timer_period); |
290 | 287 | ||
291 | if ((sc->imask & ATH9K_INT_GENTIMER) == 0) { | 288 | if ((ah->imask & ATH9K_INT_GENTIMER) == 0) { |
292 | ath9k_hw_set_interrupts(ah, 0); | 289 | ath9k_hw_set_interrupts(ah, 0); |
293 | sc->imask |= ATH9K_INT_GENTIMER; | 290 | ah->imask |= ATH9K_INT_GENTIMER; |
294 | ath9k_hw_set_interrupts(ah, sc->imask); | 291 | ath9k_hw_set_interrupts(ah, ah->imask); |
295 | } | 292 | } |
296 | } | 293 | } |
297 | 294 | ||
298 | static void ath9k_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer) | 295 | static void ath9k_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer) |
299 | { | 296 | { |
300 | struct ath_common *common = ath9k_hw_common(ah); | ||
301 | struct ath_softc *sc = (struct ath_softc *) common->priv; | ||
302 | struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers; | 297 | struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers; |
303 | 298 | ||
304 | ath9k_hw_gen_timer_stop(ah, timer); | 299 | ath9k_hw_gen_timer_stop(ah, timer); |
@@ -306,8 +301,8 @@ static void ath9k_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer) | |||
306 | /* if no timer is enabled, turn off interrupt mask */ | 301 | /* if no timer is enabled, turn off interrupt mask */ |
307 | if (timer_table->timer_mask.val == 0) { | 302 | if (timer_table->timer_mask.val == 0) { |
308 | ath9k_hw_set_interrupts(ah, 0); | 303 | ath9k_hw_set_interrupts(ah, 0); |
309 | sc->imask &= ~ATH9K_INT_GENTIMER; | 304 | ah->imask &= ~ATH9K_INT_GENTIMER; |
310 | ath9k_hw_set_interrupts(ah, sc->imask); | 305 | ath9k_hw_set_interrupts(ah, ah->imask); |
311 | } | 306 | } |
312 | } | 307 | } |
313 | 308 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 6b03e1688b22..0ac7a80be082 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -478,6 +478,7 @@ struct ath_hw { | |||
478 | struct ath9k_tx_queue_info txq[ATH9K_NUM_TX_QUEUES]; | 478 | struct ath9k_tx_queue_info txq[ATH9K_NUM_TX_QUEUES]; |
479 | 479 | ||
480 | int16_t curchan_rad_index; | 480 | int16_t curchan_rad_index; |
481 | enum ath9k_int imask; | ||
481 | u32 mask_reg; | 482 | u32 mask_reg; |
482 | u32 imrs2_reg; | 483 | u32 imrs2_reg; |
483 | u32 txok_interrupt_mask; | 484 | u32 txok_interrupt_mask; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 67ca4e5a6017..c25216be616f 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -225,7 +225,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, | |||
225 | 225 | ||
226 | ath_cache_conf_rate(sc, &hw->conf); | 226 | ath_cache_conf_rate(sc, &hw->conf); |
227 | ath_update_txpow(sc); | 227 | ath_update_txpow(sc); |
228 | ath9k_hw_set_interrupts(ah, sc->imask); | 228 | ath9k_hw_set_interrupts(ah, ah->imask); |
229 | 229 | ||
230 | ps_restore: | 230 | ps_restore: |
231 | ath9k_ps_restore(sc); | 231 | ath9k_ps_restore(sc); |
@@ -434,7 +434,7 @@ void ath9k_tasklet(unsigned long data) | |||
434 | ath_gen_timer_isr(sc->sc_ah); | 434 | ath_gen_timer_isr(sc->sc_ah); |
435 | 435 | ||
436 | /* re-enable hardware interrupt */ | 436 | /* re-enable hardware interrupt */ |
437 | ath9k_hw_set_interrupts(ah, sc->imask); | 437 | ath9k_hw_set_interrupts(ah, ah->imask); |
438 | ath9k_ps_restore(sc); | 438 | ath9k_ps_restore(sc); |
439 | } | 439 | } |
440 | 440 | ||
@@ -477,7 +477,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
477 | * value to insure we only process bits we requested. | 477 | * value to insure we only process bits we requested. |
478 | */ | 478 | */ |
479 | ath9k_hw_getisr(ah, &status); /* NB: clears ISR too */ | 479 | ath9k_hw_getisr(ah, &status); /* NB: clears ISR too */ |
480 | status &= sc->imask; /* discard unasked-for bits */ | 480 | status &= ah->imask; /* discard unasked-for bits */ |
481 | 481 | ||
482 | /* | 482 | /* |
483 | * If there are no status bits set, then this interrupt was not | 483 | * If there are no status bits set, then this interrupt was not |
@@ -518,7 +518,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
518 | * the interrupt. | 518 | * the interrupt. |
519 | */ | 519 | */ |
520 | ath9k_hw_procmibevent(ah); | 520 | ath9k_hw_procmibevent(ah); |
521 | ath9k_hw_set_interrupts(ah, sc->imask); | 521 | ath9k_hw_set_interrupts(ah, ah->imask); |
522 | } | 522 | } |
523 | 523 | ||
524 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) | 524 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) |
@@ -536,7 +536,7 @@ chip_reset: | |||
536 | 536 | ||
537 | if (sched) { | 537 | if (sched) { |
538 | /* turn off every interrupt except SWBA */ | 538 | /* turn off every interrupt except SWBA */ |
539 | ath9k_hw_set_interrupts(ah, (sc->imask & ATH9K_INT_SWBA)); | 539 | ath9k_hw_set_interrupts(ah, (ah->imask & ATH9K_INT_SWBA)); |
540 | tasklet_schedule(&sc->intr_tq); | 540 | tasklet_schedule(&sc->intr_tq); |
541 | } | 541 | } |
542 | 542 | ||
@@ -887,7 +887,7 @@ void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
887 | ath_beacon_config(sc, NULL); /* restart beacons */ | 887 | ath_beacon_config(sc, NULL); /* restart beacons */ |
888 | 888 | ||
889 | /* Re-Enable interrupts */ | 889 | /* Re-Enable interrupts */ |
890 | ath9k_hw_set_interrupts(ah, sc->imask); | 890 | ath9k_hw_set_interrupts(ah, ah->imask); |
891 | 891 | ||
892 | /* Enable LED */ | 892 | /* Enable LED */ |
893 | ath9k_hw_cfg_output(ah, ah->led_pin, | 893 | ath9k_hw_cfg_output(ah, ah->led_pin, |
@@ -977,7 +977,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) | |||
977 | if (sc->sc_flags & SC_OP_BEACONS) | 977 | if (sc->sc_flags & SC_OP_BEACONS) |
978 | ath_beacon_config(sc, NULL); /* restart beacons */ | 978 | ath_beacon_config(sc, NULL); /* restart beacons */ |
979 | 979 | ||
980 | ath9k_hw_set_interrupts(ah, sc->imask); | 980 | ath9k_hw_set_interrupts(ah, ah->imask); |
981 | 981 | ||
982 | if (retry_tx) { | 982 | if (retry_tx) { |
983 | int i; | 983 | int i; |
@@ -1162,23 +1162,23 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | /* Setup our intr mask. */ | 1164 | /* Setup our intr mask. */ |
1165 | sc->imask = ATH9K_INT_RX | ATH9K_INT_TX | 1165 | ah->imask = ATH9K_INT_RX | ATH9K_INT_TX |
1166 | | ATH9K_INT_RXEOL | ATH9K_INT_RXORN | 1166 | | ATH9K_INT_RXEOL | ATH9K_INT_RXORN |
1167 | | ATH9K_INT_FATAL | ATH9K_INT_GLOBAL; | 1167 | | ATH9K_INT_FATAL | ATH9K_INT_GLOBAL; |
1168 | 1168 | ||
1169 | if (ah->caps.hw_caps & ATH9K_HW_CAP_GTT) | 1169 | if (ah->caps.hw_caps & ATH9K_HW_CAP_GTT) |
1170 | sc->imask |= ATH9K_INT_GTT; | 1170 | ah->imask |= ATH9K_INT_GTT; |
1171 | 1171 | ||
1172 | if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) | 1172 | if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) |
1173 | sc->imask |= ATH9K_INT_CST; | 1173 | ah->imask |= ATH9K_INT_CST; |
1174 | 1174 | ||
1175 | ath_cache_conf_rate(sc, &hw->conf); | 1175 | ath_cache_conf_rate(sc, &hw->conf); |
1176 | 1176 | ||
1177 | sc->sc_flags &= ~SC_OP_INVALID; | 1177 | sc->sc_flags &= ~SC_OP_INVALID; |
1178 | 1178 | ||
1179 | /* Disable BMISS interrupt when we're not associated */ | 1179 | /* Disable BMISS interrupt when we're not associated */ |
1180 | sc->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); | 1180 | ah->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); |
1181 | ath9k_hw_set_interrupts(ah, sc->imask); | 1181 | ath9k_hw_set_interrupts(ah, ah->imask); |
1182 | 1182 | ||
1183 | ieee80211_wake_queues(hw); | 1183 | ieee80211_wake_queues(hw); |
1184 | 1184 | ||
@@ -1372,14 +1372,15 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1372 | { | 1372 | { |
1373 | struct ath_wiphy *aphy = hw->priv; | 1373 | struct ath_wiphy *aphy = hw->priv; |
1374 | struct ath_softc *sc = aphy->sc; | 1374 | struct ath_softc *sc = aphy->sc; |
1375 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1375 | struct ath_hw *ah = sc->sc_ah; |
1376 | struct ath_common *common = ath9k_hw_common(ah); | ||
1376 | struct ath_vif *avp = (void *)vif->drv_priv; | 1377 | struct ath_vif *avp = (void *)vif->drv_priv; |
1377 | enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED; | 1378 | enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED; |
1378 | int ret = 0; | 1379 | int ret = 0; |
1379 | 1380 | ||
1380 | mutex_lock(&sc->mutex); | 1381 | mutex_lock(&sc->mutex); |
1381 | 1382 | ||
1382 | if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) && | 1383 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) && |
1383 | sc->nvifs > 0) { | 1384 | sc->nvifs > 0) { |
1384 | ret = -ENOBUFS; | 1385 | ret = -ENOBUFS; |
1385 | goto out; | 1386 | goto out; |
@@ -1414,19 +1415,19 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1414 | 1415 | ||
1415 | sc->nvifs++; | 1416 | sc->nvifs++; |
1416 | 1417 | ||
1417 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) | 1418 | if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) |
1418 | ath9k_set_bssid_mask(hw); | 1419 | ath9k_set_bssid_mask(hw); |
1419 | 1420 | ||
1420 | if (sc->nvifs > 1) | 1421 | if (sc->nvifs > 1) |
1421 | goto out; /* skip global settings for secondary vif */ | 1422 | goto out; /* skip global settings for secondary vif */ |
1422 | 1423 | ||
1423 | if (ic_opmode == NL80211_IFTYPE_AP) { | 1424 | if (ic_opmode == NL80211_IFTYPE_AP) { |
1424 | ath9k_hw_set_tsfadjust(sc->sc_ah, 1); | 1425 | ath9k_hw_set_tsfadjust(ah, 1); |
1425 | sc->sc_flags |= SC_OP_TSF_RESET; | 1426 | sc->sc_flags |= SC_OP_TSF_RESET; |
1426 | } | 1427 | } |
1427 | 1428 | ||
1428 | /* Set the device opmode */ | 1429 | /* Set the device opmode */ |
1429 | sc->sc_ah->opmode = ic_opmode; | 1430 | ah->opmode = ic_opmode; |
1430 | 1431 | ||
1431 | /* | 1432 | /* |
1432 | * Enable MIB interrupts when there are hardware phy counters. | 1433 | * Enable MIB interrupts when there are hardware phy counters. |
@@ -1435,11 +1436,11 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
1435 | if ((vif->type == NL80211_IFTYPE_STATION) || | 1436 | if ((vif->type == NL80211_IFTYPE_STATION) || |
1436 | (vif->type == NL80211_IFTYPE_ADHOC) || | 1437 | (vif->type == NL80211_IFTYPE_ADHOC) || |
1437 | (vif->type == NL80211_IFTYPE_MESH_POINT)) { | 1438 | (vif->type == NL80211_IFTYPE_MESH_POINT)) { |
1438 | sc->imask |= ATH9K_INT_MIB; | 1439 | ah->imask |= ATH9K_INT_MIB; |
1439 | sc->imask |= ATH9K_INT_TSFOOR; | 1440 | ah->imask |= ATH9K_INT_TSFOOR; |
1440 | } | 1441 | } |
1441 | 1442 | ||
1442 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); | 1443 | ath9k_hw_set_interrupts(ah, ah->imask); |
1443 | 1444 | ||
1444 | if (vif->type == NL80211_IFTYPE_AP || | 1445 | if (vif->type == NL80211_IFTYPE_AP || |
1445 | vif->type == NL80211_IFTYPE_ADHOC || | 1446 | vif->type == NL80211_IFTYPE_ADHOC || |
@@ -1495,15 +1496,16 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1495 | 1496 | ||
1496 | void ath9k_enable_ps(struct ath_softc *sc) | 1497 | void ath9k_enable_ps(struct ath_softc *sc) |
1497 | { | 1498 | { |
1499 | struct ath_hw *ah = sc->sc_ah; | ||
1500 | |||
1498 | sc->ps_enabled = true; | 1501 | sc->ps_enabled = true; |
1499 | if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { | 1502 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { |
1500 | if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { | 1503 | if ((ah->imask & ATH9K_INT_TIM_TIMER) == 0) { |
1501 | sc->imask |= ATH9K_INT_TIM_TIMER; | 1504 | ah->imask |= ATH9K_INT_TIM_TIMER; |
1502 | ath9k_hw_set_interrupts(sc->sc_ah, | 1505 | ath9k_hw_set_interrupts(ah, ah->imask); |
1503 | sc->imask); | ||
1504 | } | 1506 | } |
1505 | } | 1507 | } |
1506 | ath9k_hw_setrxabort(sc->sc_ah, 1); | 1508 | ath9k_hw_setrxabort(ah, 1); |
1507 | } | 1509 | } |
1508 | 1510 | ||
1509 | static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | 1511 | static int ath9k_config(struct ieee80211_hw *hw, u32 changed) |
@@ -1580,10 +1582,10 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1580 | PS_WAIT_FOR_CAB | | 1582 | PS_WAIT_FOR_CAB | |
1581 | PS_WAIT_FOR_PSPOLL_DATA | | 1583 | PS_WAIT_FOR_PSPOLL_DATA | |
1582 | PS_WAIT_FOR_TX_ACK); | 1584 | PS_WAIT_FOR_TX_ACK); |
1583 | if (sc->imask & ATH9K_INT_TIM_TIMER) { | 1585 | if (ah->imask & ATH9K_INT_TIM_TIMER) { |
1584 | sc->imask &= ~ATH9K_INT_TIM_TIMER; | 1586 | ah->imask &= ~ATH9K_INT_TIM_TIMER; |
1585 | ath9k_hw_set_interrupts(sc->sc_ah, | 1587 | ath9k_hw_set_interrupts(sc->sc_ah, |
1586 | sc->imask); | 1588 | ah->imask); |
1587 | } | 1589 | } |
1588 | } | 1590 | } |
1589 | } | 1591 | } |