diff options
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r-- | drivers/net/wireless/ath9k/beacon.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 6 |
5 files changed, 48 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index caf569401a34..00a0eaa08866 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -209,6 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
209 | unsigned int curlen; | 209 | unsigned int curlen; |
210 | struct ath_txq *cabq; | 210 | struct ath_txq *cabq; |
211 | struct ath_txq *mcastq; | 211 | struct ath_txq *mcastq; |
212 | struct ieee80211_tx_info *info; | ||
212 | avp = sc->sc_vaps[if_id]; | 213 | avp = sc->sc_vaps[if_id]; |
213 | 214 | ||
214 | mcastq = &avp->av_mcastq; | 215 | mcastq = &avp->av_mcastq; |
@@ -232,6 +233,18 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
232 | */ | 233 | */ |
233 | curlen = skb->len; | 234 | curlen = skb->len; |
234 | 235 | ||
236 | info = IEEE80211_SKB_CB(skb); | ||
237 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
238 | /* | ||
239 | * TODO: make sure the seq# gets assigned properly (vs. other | ||
240 | * TX frames) | ||
241 | */ | ||
242 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
243 | sc->seq_no += 0x10; | ||
244 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
245 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
246 | } | ||
247 | |||
235 | /* XXX: spin_lock_bh should not be used here, but sparse bitches | 248 | /* XXX: spin_lock_bh should not be used here, but sparse bitches |
236 | * otherwise. We should fix sparse :) */ | 249 | * otherwise. We should fix sparse :) */ |
237 | spin_lock_bh(&mcastq->axq_lock); | 250 | spin_lock_bh(&mcastq->axq_lock); |
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c index f6c45288d0e7..87e37bc39145 100644 --- a/drivers/net/wireless/ath9k/core.c +++ b/drivers/net/wireless/ath9k/core.c | |||
@@ -294,8 +294,6 @@ static int ath_stop(struct ath_softc *sc) | |||
294 | * hardware is gone (invalid). | 294 | * hardware is gone (invalid). |
295 | */ | 295 | */ |
296 | 296 | ||
297 | if (!sc->sc_invalid) | ||
298 | ath9k_hw_set_interrupts(ah, 0); | ||
299 | ath_draintxq(sc, false); | 297 | ath_draintxq(sc, false); |
300 | if (!sc->sc_invalid) { | 298 | if (!sc->sc_invalid) { |
301 | ath_stoprecv(sc); | 299 | ath_stoprecv(sc); |
@@ -797,6 +795,12 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan) | |||
797 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) | 795 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) |
798 | sc->sc_imask |= ATH9K_INT_CST; | 796 | sc->sc_imask |= ATH9K_INT_CST; |
799 | 797 | ||
798 | /* Note: We disable MIB interrupts for now as we don't yet | ||
799 | * handle processing ANI, otherwise you will get an interrupt | ||
800 | * storm after about 7 hours of usage making the system unusable | ||
801 | * with huge latency. Once we do have ANI processing included | ||
802 | * we can re-enable this interrupt. */ | ||
803 | #if 0 | ||
800 | /* | 804 | /* |
801 | * Enable MIB interrupts when there are hardware phy counters. | 805 | * Enable MIB interrupts when there are hardware phy counters. |
802 | * Note we only do this (at the moment) for station mode. | 806 | * Note we only do this (at the moment) for station mode. |
@@ -804,6 +808,7 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan) | |||
804 | if (ath9k_hw_phycounters(ah) && | 808 | if (ath9k_hw_phycounters(ah) && |
805 | ((sc->sc_opmode == ATH9K_M_STA) || (sc->sc_opmode == ATH9K_M_IBSS))) | 809 | ((sc->sc_opmode == ATH9K_M_STA) || (sc->sc_opmode == ATH9K_M_IBSS))) |
806 | sc->sc_imask |= ATH9K_INT_MIB; | 810 | sc->sc_imask |= ATH9K_INT_MIB; |
811 | #endif | ||
807 | /* | 812 | /* |
808 | * Some hardware processes the TIM IE and fires an | 813 | * Some hardware processes the TIM IE and fires an |
809 | * interrupt when the TIM bit is set. For hardware | 814 | * interrupt when the TIM bit is set. For hardware |
@@ -1336,6 +1341,8 @@ void ath_deinit(struct ath_softc *sc) | |||
1336 | 1341 | ||
1337 | DPRINTF(sc, ATH_DBG_CONFIG, "%s\n", __func__); | 1342 | DPRINTF(sc, ATH_DBG_CONFIG, "%s\n", __func__); |
1338 | 1343 | ||
1344 | tasklet_kill(&sc->intr_tq); | ||
1345 | tasklet_kill(&sc->bcon_tasklet); | ||
1339 | ath_stop(sc); | 1346 | ath_stop(sc); |
1340 | if (!sc->sc_invalid) | 1347 | if (!sc->sc_invalid) |
1341 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); | 1348 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 673b3d81133a..2f84093331ee 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -974,7 +974,6 @@ struct ath_softc { | |||
974 | u32 sc_keymax; /* size of key cache */ | 974 | u32 sc_keymax; /* size of key cache */ |
975 | DECLARE_BITMAP(sc_keymap, ATH_KEYMAX); /* key use bit map */ | 975 | DECLARE_BITMAP(sc_keymap, ATH_KEYMAX); /* key use bit map */ |
976 | u8 sc_splitmic; /* split TKIP MIC keys */ | 976 | u8 sc_splitmic; /* split TKIP MIC keys */ |
977 | int sc_keytype; | ||
978 | 977 | ||
979 | /* RX */ | 978 | /* RX */ |
980 | struct list_head sc_rxbuf; | 979 | struct list_head sc_rxbuf; |
@@ -992,6 +991,7 @@ struct ath_softc { | |||
992 | u32 sc_txintrperiod; /* tx interrupt batching */ | 991 | u32 sc_txintrperiod; /* tx interrupt batching */ |
993 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ | 992 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ |
994 | u32 sc_ant_tx[8]; /* recent tx frames/antenna */ | 993 | u32 sc_ant_tx[8]; /* recent tx frames/antenna */ |
994 | u16 seq_no; /* TX sequence number */ | ||
995 | 995 | ||
996 | /* Beacon */ | 996 | /* Beacon */ |
997 | struct ath9k_tx_queue_info sc_beacon_qi; | 997 | struct ath9k_tx_queue_info sc_beacon_qi; |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index c5107f269f24..acebdf1d20a8 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -206,8 +206,6 @@ static int ath_key_config(struct ath_softc *sc, | |||
206 | if (!ret) | 206 | if (!ret) |
207 | return -EIO; | 207 | return -EIO; |
208 | 208 | ||
209 | if (mac) | ||
210 | sc->sc_keytype = hk.kv_type; | ||
211 | return 0; | 209 | return 0; |
212 | } | 210 | } |
213 | 211 | ||
@@ -369,6 +367,20 @@ static int ath9k_tx(struct ieee80211_hw *hw, | |||
369 | { | 367 | { |
370 | struct ath_softc *sc = hw->priv; | 368 | struct ath_softc *sc = hw->priv; |
371 | int hdrlen, padsize; | 369 | int hdrlen, padsize; |
370 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
371 | |||
372 | /* | ||
373 | * As a temporary workaround, assign seq# here; this will likely need | ||
374 | * to be cleaned up to work better with Beacon transmission and virtual | ||
375 | * BSSes. | ||
376 | */ | ||
377 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
378 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
379 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) | ||
380 | sc->seq_no += 0x10; | ||
381 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
382 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
383 | } | ||
372 | 384 | ||
373 | /* Add the padding after the header if this is not already done */ | 385 | /* Add the padding after the header if this is not already done */ |
374 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 386 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
@@ -764,7 +776,6 @@ static int ath9k_set_key(struct ieee80211_hw *hw, | |||
764 | case DISABLE_KEY: | 776 | case DISABLE_KEY: |
765 | ath_key_delete(sc, key); | 777 | ath_key_delete(sc, key); |
766 | clear_bit(key->keyidx, sc->sc_keymap); | 778 | clear_bit(key->keyidx, sc->sc_keymap); |
767 | sc->sc_keytype = ATH9K_CIPHER_CLR; | ||
768 | break; | 779 | break; |
769 | default: | 780 | default: |
770 | ret = -EINVAL; | 781 | ret = -EINVAL; |
@@ -1400,10 +1411,17 @@ static void ath_pci_remove(struct pci_dev *pdev) | |||
1400 | { | 1411 | { |
1401 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); | 1412 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
1402 | struct ath_softc *sc = hw->priv; | 1413 | struct ath_softc *sc = hw->priv; |
1414 | enum ath9k_int status; | ||
1403 | 1415 | ||
1404 | if (pdev->irq) | 1416 | if (pdev->irq) { |
1417 | ath9k_hw_set_interrupts(sc->sc_ah, 0); | ||
1418 | /* clear the ISR */ | ||
1419 | ath9k_hw_getisr(sc->sc_ah, &status); | ||
1420 | sc->sc_invalid = 1; | ||
1405 | free_irq(pdev->irq, sc); | 1421 | free_irq(pdev->irq, sc); |
1422 | } | ||
1406 | ath_detach(sc); | 1423 | ath_detach(sc); |
1424 | |||
1407 | pci_iounmap(pdev, sc->mem); | 1425 | pci_iounmap(pdev, sc->mem); |
1408 | pci_release_region(pdev, 0); | 1426 | pci_release_region(pdev, 0); |
1409 | pci_disable_device(pdev); | 1427 | pci_disable_device(pdev); |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 550129f717e2..8b332e11a656 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -315,11 +315,11 @@ static int ath_tx_prepare(struct ath_softc *sc, | |||
315 | txctl->keyix = tx_info->control.hw_key->hw_key_idx; | 315 | txctl->keyix = tx_info->control.hw_key->hw_key_idx; |
316 | txctl->frmlen += tx_info->control.icv_len; | 316 | txctl->frmlen += tx_info->control.icv_len; |
317 | 317 | ||
318 | if (sc->sc_keytype == ATH9K_CIPHER_WEP) | 318 | if (tx_info->control.hw_key->alg == ALG_WEP) |
319 | txctl->keytype = ATH9K_KEY_TYPE_WEP; | 319 | txctl->keytype = ATH9K_KEY_TYPE_WEP; |
320 | else if (sc->sc_keytype == ATH9K_CIPHER_TKIP) | 320 | else if (tx_info->control.hw_key->alg == ALG_TKIP) |
321 | txctl->keytype = ATH9K_KEY_TYPE_TKIP; | 321 | txctl->keytype = ATH9K_KEY_TYPE_TKIP; |
322 | else if (sc->sc_keytype == ATH9K_CIPHER_AES_CCM) | 322 | else if (tx_info->control.hw_key->alg == ALG_CCMP) |
323 | txctl->keytype = ATH9K_KEY_TYPE_AES; | 323 | txctl->keytype = ATH9K_KEY_TYPE_AES; |
324 | } | 324 | } |
325 | 325 | ||