Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath9k|ath9k_htc: Seperate the software crypto flag for Tx and Rx

Use the sw_mgmt_crypto_tx flag to trigger the CCMP encryption
for transmitted management frames to be done in software while
the sw_mgmt_crypto_rx flag is used to trigger the CCMP decryption
for received management frames to be done in software.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Chun-Yeow Yeoh and committed by
John W. Linville
e6510b11 7bf16521

+11 -7
+1 -1
drivers/net/wireless/ath/ath9k/common.c
··· 159 159 if (test_bit(keyix, common->keymap)) 160 160 rxs->flag |= RX_FLAG_DECRYPTED; 161 161 } 162 - if (ah->sw_mgmt_crypto && 162 + if (ah->sw_mgmt_crypto_rx && 163 163 (rxs->flag & RX_FLAG_DECRYPTED) && 164 164 ieee80211_is_mgmt(fc)) 165 165 /* Use software decrypt for management frames. */
+1 -1
drivers/net/wireless/ath/ath9k/htc_drv_main.c
··· 1447 1447 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 1448 1448 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) 1449 1449 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; 1450 - if (priv->ah->sw_mgmt_crypto && 1450 + if (priv->ah->sw_mgmt_crypto_tx && 1451 1451 key->cipher == WLAN_CIPHER_SUITE_CCMP) 1452 1452 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; 1453 1453 ret = 0;
+6 -3
drivers/net/wireless/ath/ath9k/hw.c
··· 1598 1598 * frames when constructing CCMP AAD. */ 1599 1599 REG_RMW_FIELD(ah, AR_AES_MUTE_MASK1, AR_AES_MUTE_MASK1_FC_MGMT, 1600 1600 0xc7ff); 1601 - ah->sw_mgmt_crypto = false; 1601 + ah->sw_mgmt_crypto_tx = false; 1602 + ah->sw_mgmt_crypto_rx = false; 1602 1603 } else if (AR_SREV_9160_10_OR_LATER(ah)) { 1603 1604 /* Disable hardware crypto for management frames */ 1604 1605 REG_CLR_BIT(ah, AR_PCU_MISC_MODE2, 1605 1606 AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE); 1606 1607 REG_SET_BIT(ah, AR_PCU_MISC_MODE2, 1607 1608 AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT); 1608 - ah->sw_mgmt_crypto = true; 1609 + ah->sw_mgmt_crypto_tx = true; 1610 + ah->sw_mgmt_crypto_rx = true; 1609 1611 } else { 1610 - ah->sw_mgmt_crypto = true; 1612 + ah->sw_mgmt_crypto_tx = true; 1613 + ah->sw_mgmt_crypto_rx = true; 1611 1614 } 1612 1615 } 1613 1616
+2 -1
drivers/net/wireless/ath/ath9k/hw.h
··· 753 753 } eeprom; 754 754 const struct eeprom_ops *eep_ops; 755 755 756 - bool sw_mgmt_crypto; 756 + bool sw_mgmt_crypto_tx; 757 + bool sw_mgmt_crypto_rx; 757 758 bool is_pciexpress; 758 759 bool aspm_enabled; 759 760 bool is_monitoring;
+1 -1
drivers/net/wireless/ath/ath9k/main.c
··· 1655 1655 key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 1656 1656 if (key->cipher == WLAN_CIPHER_SUITE_TKIP) 1657 1657 key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; 1658 - if (sc->sc_ah->sw_mgmt_crypto && 1658 + if (sc->sc_ah->sw_mgmt_crypto_tx && 1659 1659 key->cipher == WLAN_CIPHER_SUITE_CCMP) 1660 1660 key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; 1661 1661 ret = 0;