diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2019-07-15 18:09:19 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-07-26 10:14:12 -0400 |
commit | a0b4496a43681cbeec03a38e1b685c80c0d7405d (patch) | |
tree | 068b93272fc5f996ed367355bffeeef16c4fc200 | |
parent | ef11a931bd1c57b02fe2603ff95a392a73041f9e (diff) |
mac80211: add IEEE80211_KEY_FLAG_GENERATE_MMIE to ieee80211_key_flags
Add IEEE80211_KEY_FLAG_GENERATE_MMIE flag to ieee80211_key_flags in order
to allow the driver to notify mac80211 to generate MMIE and that it
requires sequence number generation only.
This is a preliminary patch to add BIP_CMAC_128 hw support to mt7615
driver
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/dfe275f9aa0f1cc6b33085f9efd5d8447f68ad13.1563228405.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/net/mac80211.h | 4 | ||||
-rw-r--r-- | net/mac80211/wpa.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 6fe4381ba0ef..9effd286c1ae 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1704,6 +1704,9 @@ struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif); | |||
1704 | * a TKIP key if it only requires MIC space. Do not set together with | 1704 | * a TKIP key if it only requires MIC space. Do not set together with |
1705 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC on the same key. | 1705 | * @IEEE80211_KEY_FLAG_GENERATE_MMIC on the same key. |
1706 | * @IEEE80211_KEY_FLAG_NO_AUTO_TX: Key needs explicit Tx activation. | 1706 | * @IEEE80211_KEY_FLAG_NO_AUTO_TX: Key needs explicit Tx activation. |
1707 | * @IEEE80211_KEY_FLAG_GENERATE_MMIE: This flag should be set by the driver | ||
1708 | * for a AES_CMAC key to indicate that it requires sequence number | ||
1709 | * generation only | ||
1707 | */ | 1710 | */ |
1708 | enum ieee80211_key_flags { | 1711 | enum ieee80211_key_flags { |
1709 | IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0), | 1712 | IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0), |
@@ -1716,6 +1719,7 @@ enum ieee80211_key_flags { | |||
1716 | IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(7), | 1719 | IEEE80211_KEY_FLAG_RESERVE_TAILROOM = BIT(7), |
1717 | IEEE80211_KEY_FLAG_PUT_MIC_SPACE = BIT(8), | 1720 | IEEE80211_KEY_FLAG_PUT_MIC_SPACE = BIT(8), |
1718 | IEEE80211_KEY_FLAG_NO_AUTO_TX = BIT(9), | 1721 | IEEE80211_KEY_FLAG_NO_AUTO_TX = BIT(9), |
1722 | IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(10), | ||
1719 | }; | 1723 | }; |
1720 | 1724 | ||
1721 | /** | 1725 | /** |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index ee72779729e5..91bf32af55e9 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
@@ -946,7 +946,8 @@ ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx) | |||
946 | 946 | ||
947 | info = IEEE80211_SKB_CB(skb); | 947 | info = IEEE80211_SKB_CB(skb); |
948 | 948 | ||
949 | if (info->control.hw_key) | 949 | if (info->control.hw_key && |
950 | !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIE)) | ||
950 | return TX_CONTINUE; | 951 | return TX_CONTINUE; |
951 | 952 | ||
952 | if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) | 953 | if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie))) |
@@ -962,6 +963,9 @@ ieee80211_crypto_aes_cmac_encrypt(struct ieee80211_tx_data *tx) | |||
962 | 963 | ||
963 | bip_ipn_set64(mmie->sequence_number, pn64); | 964 | bip_ipn_set64(mmie->sequence_number, pn64); |
964 | 965 | ||
966 | if (info->control.hw_key) | ||
967 | return TX_CONTINUE; | ||
968 | |||
965 | bip_aad(skb, aad); | 969 | bip_aad(skb, aad); |
966 | 970 | ||
967 | /* | 971 | /* |