ath9k_htc: Enable software crypto for mgmt frame in Tx for USB devices
authorChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Sat, 15 Nov 2014 19:05:41 +0000 (03:05 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Nov 2014 20:32:15 +0000 (15:32 -0500)
In secured mesh, the unicast mgmt frame is encrypted using
the same key that used for encrypting the unicast data frame.
This patch "ath9k_htc_firmware: fix the offset of CCMP header
for mesh data frame" applied to open-ath9k-htc-firmware allows
the ath9k_htc to be loaded without "nohwcrypt=1". Unfortunately,
this is not working and we still need CCMP encryption of
transmitted management frames to be done in software.

So this patch allows the software encryption for transmitted
management frame to be done in software but remain the hardware
decryption for received management frame.

This patch is tested with the following hardwares:
- TP-Link TL-WN821N v3 802.11n [Atheros AR7010+AR9287]
- AR9271 802.11n

and managed to work with peer mesh STA equipped with ath9k.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw.c

index c1c2f2158b7547cfd4afafb4d5b38213f643a7f2..fa9e5e9983378eae8c895d9b1d4ca2790bf06cc8 100644 (file)
@@ -1598,7 +1598,10 @@ static void ath9k_hw_init_mfp(struct ath_hw *ah)
                 * frames when constructing CCMP AAD. */
                REG_RMW_FIELD(ah, AR_AES_MUTE_MASK1, AR_AES_MUTE_MASK1_FC_MGMT,
                              0xc7ff);
-               ah->sw_mgmt_crypto_tx = false;
+               if (AR_SREV_9271(ah) || AR_DEVID_7010(ah))
+                       ah->sw_mgmt_crypto_tx = true;
+               else
+                       ah->sw_mgmt_crypto_tx = false;
                ah->sw_mgmt_crypto_rx = false;
        } else if (AR_SREV_9160_10_OR_LATER(ah)) {
                /* Disable hardware crypto for management frames */