diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-08-28 17:01:54 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:48:51 -0400 |
commit | 8f20fc24986a083228823d9b68adca20714b254e (patch) | |
tree | b5d7638b913649c7a181d6703ccd72e35ca06de9 /net/mac80211/ieee80211_key.h | |
parent | 13262ffd4902805acad2618c12b41fcaa6c50791 (diff) |
[MAC80211]: embed key conf in key, fix driver interface
This patch embeds the struct ieee80211_key_conf into struct ieee80211_key
and thus avoids allocations and having data present twice.
This required some more changes:
1) The removal of the IEEE80211_KEY_DEFAULT_TX_KEY key flag.
This flag isn't used by drivers nor should it be since
we have a set_key_idx() callback. Maybe that callback needs
to be extended to include the key conf, but only a driver that
requires it will tell.
2) The removal of the IEEE80211_KEY_DEFAULT_WEP_ONLY key flag.
This flag is global, so it shouldn't be passed in the key
conf structure. Pass it to the function instead.
Also, this patch removes the AID parameter to the set_key() callback
because it is currently unused and the hardware currently cannot know
about the AID anyway. I suspect this was used with some hardware that
actually selected the AID itself, but that functionality was removed.
Additionally, I've removed the ALG_NULL key algorithm since we have
ALG_NONE.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211_key.h')
-rw-r--r-- | net/mac80211/ieee80211_key.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/net/mac80211/ieee80211_key.h b/net/mac80211/ieee80211_key.h index c33384912782..1b5e539c678f 100644 --- a/net/mac80211/ieee80211_key.h +++ b/net/mac80211/ieee80211_key.h | |||
@@ -44,8 +44,6 @@ | |||
44 | struct ieee80211_key { | 44 | struct ieee80211_key { |
45 | struct kref kref; | 45 | struct kref kref; |
46 | 46 | ||
47 | int hw_key_idx; /* filled and used by low-level driver */ | ||
48 | ieee80211_key_alg alg; | ||
49 | union { | 47 | union { |
50 | struct { | 48 | struct { |
51 | /* last used TSC */ | 49 | /* last used TSC */ |
@@ -73,22 +71,16 @@ struct ieee80211_key { | |||
73 | u8 rx_crypto_buf[6 * AES_BLOCK_LEN]; | 71 | u8 rx_crypto_buf[6 * AES_BLOCK_LEN]; |
74 | } ccmp; | 72 | } ccmp; |
75 | } u; | 73 | } u; |
76 | int tx_rx_count; /* number of times this key has been used */ | ||
77 | int keylen; | ||
78 | 74 | ||
79 | /* if the low level driver can provide hardware acceleration it should | 75 | /* number of times this key has been used */ |
80 | * clear this flag */ | 76 | int tx_rx_count; |
81 | unsigned int force_sw_encrypt:1; | ||
82 | unsigned int default_tx_key:1; /* This key is the new default TX key | ||
83 | * (used only for broadcast keys). */ | ||
84 | s8 keyidx; /* WEP key index */ | ||
85 | 77 | ||
86 | #ifdef CONFIG_MAC80211_DEBUGFS | 78 | #ifdef CONFIG_MAC80211_DEBUGFS |
87 | struct { | 79 | struct { |
88 | struct dentry *stalink; | 80 | struct dentry *stalink; |
89 | struct dentry *dir; | 81 | struct dentry *dir; |
90 | struct dentry *keylen; | 82 | struct dentry *keylen; |
91 | struct dentry *force_sw_encrypt; | 83 | struct dentry *flags; |
92 | struct dentry *keyidx; | 84 | struct dentry *keyidx; |
93 | struct dentry *hw_key_idx; | 85 | struct dentry *hw_key_idx; |
94 | struct dentry *tx_rx_count; | 86 | struct dentry *tx_rx_count; |
@@ -100,7 +92,11 @@ struct ieee80211_key { | |||
100 | } debugfs; | 92 | } debugfs; |
101 | #endif | 93 | #endif |
102 | 94 | ||
103 | u8 key[0]; | 95 | /* |
96 | * key config, must be last because it contains key | ||
97 | * material as variable length member | ||
98 | */ | ||
99 | struct ieee80211_key_conf conf; | ||
104 | }; | 100 | }; |
105 | 101 | ||
106 | #endif /* IEEE80211_KEY_H */ | 102 | #endif /* IEEE80211_KEY_H */ |