diff options
Diffstat (limited to 'net/mac80211/key.h')
-rw-r--r-- | net/mac80211/key.h | 54 |
1 files changed, 21 insertions, 33 deletions
diff --git a/net/mac80211/key.h b/net/mac80211/key.h index f52c3df1fe9a..425816e0996c 100644 --- a/net/mac80211/key.h +++ b/net/mac80211/key.h | |||
@@ -16,31 +16,18 @@ | |||
16 | #include <linux/rcupdate.h> | 16 | #include <linux/rcupdate.h> |
17 | #include <net/mac80211.h> | 17 | #include <net/mac80211.h> |
18 | 18 | ||
19 | /* ALG_TKIP | 19 | #define WEP_IV_LEN 4 |
20 | * struct ieee80211_key::key is encoded as a 256-bit (32 byte) data block: | 20 | #define WEP_ICV_LEN 4 |
21 | * Temporal Encryption Key (128 bits) | 21 | #define ALG_TKIP_KEY_LEN 32 |
22 | * Temporal Authenticator Tx MIC Key (64 bits) | 22 | #define ALG_CCMP_KEY_LEN 16 |
23 | * Temporal Authenticator Rx MIC Key (64 bits) | 23 | #define CCMP_HDR_LEN 8 |
24 | */ | 24 | #define CCMP_MIC_LEN 8 |
25 | 25 | #define CCMP_TK_LEN 16 | |
26 | #define WEP_IV_LEN 4 | 26 | #define CCMP_PN_LEN 6 |
27 | #define WEP_ICV_LEN 4 | 27 | #define TKIP_IV_LEN 8 |
28 | 28 | #define TKIP_ICV_LEN 4 | |
29 | #define ALG_TKIP_KEY_LEN 32 | 29 | |
30 | /* Starting offsets for each key */ | 30 | #define NUM_RX_DATA_QUEUES 17 |
31 | #define ALG_TKIP_TEMP_ENCR_KEY 0 | ||
32 | #define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16 | ||
33 | #define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24 | ||
34 | #define TKIP_IV_LEN 8 | ||
35 | #define TKIP_ICV_LEN 4 | ||
36 | |||
37 | #define ALG_CCMP_KEY_LEN 16 | ||
38 | #define CCMP_HDR_LEN 8 | ||
39 | #define CCMP_MIC_LEN 8 | ||
40 | #define CCMP_TK_LEN 16 | ||
41 | #define CCMP_PN_LEN 6 | ||
42 | |||
43 | #define NUM_RX_DATA_QUEUES 17 | ||
44 | 31 | ||
45 | struct ieee80211_local; | 32 | struct ieee80211_local; |
46 | struct ieee80211_sub_if_data; | 33 | struct ieee80211_sub_if_data; |
@@ -69,6 +56,13 @@ enum ieee80211_internal_key_flags { | |||
69 | KEY_FLAG_TODO_ADD_DEBUGFS = BIT(5), | 56 | KEY_FLAG_TODO_ADD_DEBUGFS = BIT(5), |
70 | }; | 57 | }; |
71 | 58 | ||
59 | struct tkip_ctx { | ||
60 | u32 iv32; | ||
61 | u16 iv16; | ||
62 | u16 p1k[5]; | ||
63 | int initialized; | ||
64 | }; | ||
65 | |||
72 | struct ieee80211_key { | 66 | struct ieee80211_key { |
73 | struct ieee80211_local *local; | 67 | struct ieee80211_local *local; |
74 | struct ieee80211_sub_if_data *sdata; | 68 | struct ieee80211_sub_if_data *sdata; |
@@ -85,16 +79,10 @@ struct ieee80211_key { | |||
85 | union { | 79 | union { |
86 | struct { | 80 | struct { |
87 | /* last used TSC */ | 81 | /* last used TSC */ |
88 | u32 iv32; | 82 | struct tkip_ctx tx; |
89 | u16 iv16; | ||
90 | u16 p1k[5]; | ||
91 | int tx_initialized; | ||
92 | 83 | ||
93 | /* last received RSC */ | 84 | /* last received RSC */ |
94 | u32 iv32_rx[NUM_RX_DATA_QUEUES]; | 85 | struct tkip_ctx rx[NUM_RX_DATA_QUEUES]; |
95 | u16 iv16_rx[NUM_RX_DATA_QUEUES]; | ||
96 | u16 p1k_rx[NUM_RX_DATA_QUEUES][5]; | ||
97 | int rx_initialized[NUM_RX_DATA_QUEUES]; | ||
98 | } tkip; | 86 | } tkip; |
99 | struct { | 87 | struct { |
100 | u8 tx_pn[6]; | 88 | u8 tx_pn[6]; |