diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index a033d01bf8a..f66c882a39e 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -250,8 +250,7 @@ static int ath9k_reg_notifier(struct wiphy *wiphy, | |||
250 | struct regulatory_request *request) | 250 | struct regulatory_request *request) |
251 | { | 251 | { |
252 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | 252 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); |
253 | struct ath_wiphy *aphy = hw->priv; | 253 | struct ath_softc *sc = hw->priv; |
254 | struct ath_softc *sc = aphy->sc; | ||
255 | struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah); | 254 | struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah); |
256 | 255 | ||
257 | return ath_reg_notifier_apply(wiphy, request, reg); | 256 | return ath_reg_notifier_apply(wiphy, request, reg); |
@@ -438,9 +437,10 @@ static int ath9k_init_queues(struct ath_softc *sc) | |||
438 | sc->config.cabqReadytime = ATH_CABQ_READY_TIME; | 437 | sc->config.cabqReadytime = ATH_CABQ_READY_TIME; |
439 | ath_cabq_update(sc); | 438 | ath_cabq_update(sc); |
440 | 439 | ||
441 | for (i = 0; i < WME_NUM_AC; i++) | 440 | for (i = 0; i < WME_NUM_AC; i++) { |
442 | sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i); | 441 | sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i); |
443 | 442 | sc->tx.txq_map[i]->mac80211_qnum = i; | |
443 | } | ||
444 | return 0; | 444 | return 0; |
445 | } | 445 | } |
446 | 446 | ||
@@ -512,10 +512,8 @@ static void ath9k_init_misc(struct ath_softc *sc) | |||
512 | 512 | ||
513 | sc->beacon.slottime = ATH9K_SLOT_TIME_9; | 513 | sc->beacon.slottime = ATH9K_SLOT_TIME_9; |
514 | 514 | ||
515 | for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) { | 515 | for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) |
516 | sc->beacon.bslot[i] = NULL; | 516 | sc->beacon.bslot[i] = NULL; |
517 | sc->beacon.bslot_aphy[i] = NULL; | ||
518 | } | ||
519 | 517 | ||
520 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) | 518 | if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) |
521 | sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT; | 519 | sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT; |
@@ -533,6 +531,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
533 | if (!ah) | 531 | if (!ah) |
534 | return -ENOMEM; | 532 | return -ENOMEM; |
535 | 533 | ||
534 | ah->hw = sc->hw; | ||
536 | ah->hw_version.devid = devid; | 535 | ah->hw_version.devid = devid; |
537 | ah->hw_version.subsysid = subsysid; | 536 | ah->hw_version.subsysid = subsysid; |
538 | sc->sc_ah = ah; | 537 | sc->sc_ah = ah; |
@@ -550,10 +549,13 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
550 | common->btcoex_enabled = ath9k_btcoex_enable == 1; | 549 | common->btcoex_enabled = ath9k_btcoex_enable == 1; |
551 | spin_lock_init(&common->cc_lock); | 550 | spin_lock_init(&common->cc_lock); |
552 | 551 | ||
553 | spin_lock_init(&sc->wiphy_lock); | ||
554 | spin_lock_init(&sc->sc_serial_rw); | 552 | spin_lock_init(&sc->sc_serial_rw); |
555 | spin_lock_init(&sc->sc_pm_lock); | 553 | spin_lock_init(&sc->sc_pm_lock); |
556 | mutex_init(&sc->mutex); | 554 | mutex_init(&sc->mutex); |
555 | #ifdef CONFIG_ATH9K_DEBUGFS | ||
556 | spin_lock_init(&sc->nodes_lock); | ||
557 | INIT_LIST_HEAD(&sc->nodes); | ||
558 | #endif | ||
557 | tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); | 559 | tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc); |
558 | tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet, | 560 | tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet, |
559 | (unsigned long)sc); | 561 | (unsigned long)sc); |
@@ -695,7 +697,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
695 | const struct ath_bus_ops *bus_ops) | 697 | const struct ath_bus_ops *bus_ops) |
696 | { | 698 | { |
697 | struct ieee80211_hw *hw = sc->hw; | 699 | struct ieee80211_hw *hw = sc->hw; |
698 | struct ath_wiphy *aphy = hw->priv; | ||
699 | struct ath_common *common; | 700 | struct ath_common *common; |
700 | struct ath_hw *ah; | 701 | struct ath_hw *ah; |
701 | int error = 0; | 702 | int error = 0; |
@@ -750,10 +751,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
750 | 751 | ||
751 | INIT_WORK(&sc->hw_check_work, ath_hw_check); | 752 | INIT_WORK(&sc->hw_check_work, ath_hw_check); |
752 | INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); | 753 | INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); |
753 | INIT_WORK(&sc->chan_work, ath9k_wiphy_chan_work); | 754 | sc->last_rssi = ATH_RSSI_DUMMY_MARKER; |
754 | INIT_DELAYED_WORK(&sc->wiphy_work, ath9k_wiphy_work); | ||
755 | sc->wiphy_scheduler_int = msecs_to_jiffies(500); | ||
756 | aphy->last_rssi = ATH_RSSI_DUMMY_MARKER; | ||
757 | 755 | ||
758 | ath_init_leds(sc); | 756 | ath_init_leds(sc); |
759 | ath_start_rfkill_poll(sc); | 757 | ath_start_rfkill_poll(sc); |
@@ -805,7 +803,6 @@ static void ath9k_deinit_softc(struct ath_softc *sc) | |||
805 | void ath9k_deinit_device(struct ath_softc *sc) | 803 | void ath9k_deinit_device(struct ath_softc *sc) |
806 | { | 804 | { |
807 | struct ieee80211_hw *hw = sc->hw; | 805 | struct ieee80211_hw *hw = sc->hw; |
808 | int i = 0; | ||
809 | 806 | ||
810 | ath9k_ps_wakeup(sc); | 807 | ath9k_ps_wakeup(sc); |
811 | 808 | ||
@@ -814,20 +811,10 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
814 | 811 | ||
815 | ath9k_ps_restore(sc); | 812 | ath9k_ps_restore(sc); |
816 | 813 | ||
817 | for (i = 0; i < sc->num_sec_wiphy; i++) { | ||
818 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; | ||
819 | if (aphy == NULL) | ||
820 | continue; | ||
821 | sc->sec_wiphy[i] = NULL; | ||
822 | ieee80211_unregister_hw(aphy->hw); | ||
823 | ieee80211_free_hw(aphy->hw); | ||
824 | } | ||
825 | |||
826 | ieee80211_unregister_hw(hw); | 814 | ieee80211_unregister_hw(hw); |
827 | ath_rx_cleanup(sc); | 815 | ath_rx_cleanup(sc); |
828 | ath_tx_cleanup(sc); | 816 | ath_tx_cleanup(sc); |
829 | ath9k_deinit_softc(sc); | 817 | ath9k_deinit_softc(sc); |
830 | kfree(sc->sec_wiphy); | ||
831 | } | 818 | } |
832 | 819 | ||
833 | void ath_descdma_cleanup(struct ath_softc *sc, | 820 | void ath_descdma_cleanup(struct ath_softc *sc, |