Skip to contentSkip to conversation

mac80211: Add IEEE80211_KEY_FLAG_PAIRWISE

PATCH In review Ivo van Doorn 2 participants 2 messages Apr 17, 2008 – Apr 18, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: Add IEEE80211_KEY_FLAG_PAIRWISE

This adds a new flag to the ieee80211_key_conf structure. This flag will inform the driver the key is pairwise rather then a shared key.

This is important for drivers who support both types of keys, and need to be informed which type of key this is. Alternative would be drivers checking the address argument of set_key(), but it will be safer when mac80211 is more explicit.

---

include/net/mac80211.h +3 -0
index 27ef9f7..740c11c 100644
@@ -621,11 +621,14 @@ enum ieee80211_key_alg {
  * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
  *	the driver for a TKIP key if it requires Michael MIC
  *	generation in software.
+ * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
+ *	that the key is pairwise rather then a shared key.
  */
 enum ieee80211_key_flags {
 	IEEE80211_KEY_FLAG_WMM_STA	= 1<<0,
 	IEEE80211_KEY_FLAG_GENERATE_IV	= 1<<1,
 	IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
+	IEEE80211_KEY_FLAG_PAIRWISE	= 1<<3,
 };
 
 /**
net/mac80211/key.c +7 -0
index 150d66d..88b211a 100644
@@ -323,6 +323,13 @@ void ieee80211_key_link(struct ieee80211_key *key,
 		 */
 		if (sta->flags & WLAN_STA_WME)
 			key->conf.flags |= IEEE80211_KEY_FLAG_WMM_STA;
+
+		/*
+		 * This key is for a specific sta interface,
+		 * inform the driver that it should try to store
+		 * this key as pairwise key.
+		 */
+		key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE;
 	} else {
 		if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
 			struct sta_info *ap;
maintainer
#1 lore raw
Quoted 8 lines · Ivo van Doorn

This adds a new flag to the ieee80211_key_conf structure. This flag will inform the driver the key is pairwise rather then a shared key.

This is important for drivers who support both types of keys, and need to be informed which type of key this is. Alternative would be drivers checking the address argument of set_key(), but it will be safer when mac80211 is more explicit.

Looks fine to me.

Quoted 40 lines

---

include/net/mac80211.h +3 -0
index 27ef9f7..740c11c 100644
@@ -621,11 +621,14 @@ enum ieee80211_key_alg {
  * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
  *	the driver for a TKIP key if it requires Michael MIC
  *	generation in software.
+ * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
+ *	that the key is pairwise rather then a shared key.
  */
 enum ieee80211_key_flags {
 	IEEE80211_KEY_FLAG_WMM_STA	= 1<<0,
 	IEEE80211_KEY_FLAG_GENERATE_IV	= 1<<1,
 	IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
+	IEEE80211_KEY_FLAG_PAIRWISE	= 1<<3,
 };
 
 /**
net/mac80211/key.c +7 -0
index 150d66d..88b211a 100644
@@ -323,6 +323,13 @@ void ieee80211_key_link(struct ieee80211_key *key,
 		 */
 		if (sta->flags & WLAN_STA_WME)
 			key->conf.flags |= IEEE80211_KEY_FLAG_WMM_STA;
+
+		/*
+		 * This key is for a specific sta interface,
+		 * inform the driver that it should try to store
+		 * this key as pairwise key.
+		 */
+		key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE;
 	} else {
 		if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
 			struct sta_info *ap;