aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 67ca4e5a601..c25216be616 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
1496void ath9k_enable_ps(struct ath_softc *sc) 1497void 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
1509static int ath9k_config(struct ieee80211_hw *hw, u32 changed) 1511static 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 }