aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath9k/hw.c17
-rw-r--r--drivers/net/wireless/ath9k/main.c5
-rw-r--r--drivers/net/wireless/ath9k/recv.c6
-rw-r--r--drivers/net/wireless/ath9k/reg.h6
5 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h
index f2ad62536bf8..3817645b85dc 100644
--- a/drivers/net/wireless/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath9k/ath9k.h
@@ -809,6 +809,8 @@ struct ath_hal {
809#ifndef ATH_NF_PER_CHAN 809#ifndef ATH_NF_PER_CHAN
810 struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS]; 810 struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
811#endif 811#endif
812
813 bool sw_mgmt_crypto;
812}; 814};
813 815
814struct chan_centers { 816struct chan_centers {
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 3c026e6b2453..e9a3951996e2 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -2265,6 +2265,23 @@ int ath9k_hw_reset(struct ath_hal *ah, struct ath9k_channel *chan,
2265 if (r) 2265 if (r)
2266 return r; 2266 return r;
2267 2267
2268 /* Setup MFP options for CCMP */
2269 if (AR_SREV_9280_20_OR_LATER(ah)) {
2270 /* Mask Retry(b11), PwrMgt(b12), MoreData(b13) to 0 in mgmt
2271 * frames when constructing CCMP AAD. */
2272 REG_RMW_FIELD(ah, AR_AES_MUTE_MASK1, AR_AES_MUTE_MASK1_FC_MGMT,
2273 0xc7ff);
2274 ah->sw_mgmt_crypto = false;
2275 } else if (AR_SREV_9160_10_OR_LATER(ah)) {
2276 /* Disable hardware crypto for management frames */
2277 REG_CLR_BIT(ah, AR_PCU_MISC_MODE2,
2278 AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE);
2279 REG_SET_BIT(ah, AR_PCU_MISC_MODE2,
2280 AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT);
2281 ah->sw_mgmt_crypto = true;
2282 } else
2283 ah->sw_mgmt_crypto = true;
2284
2268 if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) 2285 if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
2269 ath9k_hw_set_delta_slope(ah, chan); 2286 ath9k_hw_set_delta_slope(ah, chan);
2270 2287
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index fc4439f97506..72f2956c4c54 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -1557,6 +1557,9 @@ static int ath_attach(u16 devid, struct ath_softc *sc)
1557 IEEE80211_HW_SIGNAL_DBM | 1557 IEEE80211_HW_SIGNAL_DBM |
1558 IEEE80211_HW_AMPDU_AGGREGATION; 1558 IEEE80211_HW_AMPDU_AGGREGATION;
1559 1559
1560 if (AR_SREV_9160_10_OR_LATER(sc->sc_ah))
1561 hw->flags |= IEEE80211_HW_MFP_CAPABLE;
1562
1560 hw->wiphy->interface_modes = 1563 hw->wiphy->interface_modes =
1561 BIT(NL80211_IFTYPE_AP) | 1564 BIT(NL80211_IFTYPE_AP) |
1562 BIT(NL80211_IFTYPE_STATION) | 1565 BIT(NL80211_IFTYPE_STATION) |
@@ -2348,6 +2351,8 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
2348 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 2351 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
2349 if (key->alg == ALG_TKIP) 2352 if (key->alg == ALG_TKIP)
2350 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; 2353 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
2354 if (sc->sc_ah->sw_mgmt_crypto && key->alg == ALG_CCMP)
2355 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT;
2351 ret = 0; 2356 ret = 0;
2352 } 2357 }
2353 break; 2358 break;
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 462e08c3d09d..dbf24be23ccb 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -593,6 +593,12 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
593 if (test_bit(keyix, sc->sc_keymap)) 593 if (test_bit(keyix, sc->sc_keymap))
594 rx_status.flag |= RX_FLAG_DECRYPTED; 594 rx_status.flag |= RX_FLAG_DECRYPTED;
595 } 595 }
596 if (ah->sw_mgmt_crypto &&
597 (rx_status.flag & RX_FLAG_DECRYPTED) &&
598 ieee80211_is_mgmt(hdr->frame_control)) {
599 /* Use software decrypt for management frames. */
600 rx_status.flag &= ~RX_FLAG_DECRYPTED;
601 }
596 602
597 /* Send the frame to mac80211 */ 603 /* Send the frame to mac80211 */
598 __ieee80211_rx(sc->hw, skb, &rx_status); 604 __ieee80211_rx(sc->hw, skb, &rx_status);
diff --git a/drivers/net/wireless/ath9k/reg.h b/drivers/net/wireless/ath9k/reg.h
index 9a615224e4f7..2dffe371ffe4 100644
--- a/drivers/net/wireless/ath9k/reg.h
+++ b/drivers/net/wireless/ath9k/reg.h
@@ -1253,6 +1253,8 @@ enum {
1253 1253
1254#define AR_AES_MUTE_MASK1 0x8060 1254#define AR_AES_MUTE_MASK1 0x8060
1255#define AR_AES_MUTE_MASK1_SEQ 0x0000FFFF 1255#define AR_AES_MUTE_MASK1_SEQ 0x0000FFFF
1256#define AR_AES_MUTE_MASK1_FC_MGMT 0xFFFF0000
1257#define AR_AES_MUTE_MASK1_FC_MGMT_S 16
1256 1258
1257#define AR_GATED_CLKS 0x8064 1259#define AR_GATED_CLKS 0x8064
1258#define AR_GATED_CLKS_TX 0x00000002 1260#define AR_GATED_CLKS_TX 0x00000002
@@ -1477,6 +1479,10 @@ enum {
1477#define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 1479#define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700
1478#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 1480#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380
1479 1481
1482#define AR_PCU_MISC_MODE2 0x8344
1483#define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002
1484#define AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT 0x00000004
1485
1480#define AR_KEYTABLE_0 0x8800 1486#define AR_KEYTABLE_0 0x8800
1481#define AR_KEYTABLE(_n) (AR_KEYTABLE_0 + ((_n)*32)) 1487#define AR_KEYTABLE(_n) (AR_KEYTABLE_0 + ((_n)*32))
1482#define AR_KEY_CACHE_SIZE 128 1488#define AR_KEY_CACHE_SIZE 128