diff options
Diffstat (limited to 'net/mac80211/key.h')
| -rw-r--r-- | net/mac80211/key.h | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/net/mac80211/key.h b/net/mac80211/key.h index a49f93b79e92..b665bbb7a471 100644 --- a/net/mac80211/key.h +++ b/net/mac80211/key.h | |||
| @@ -38,32 +38,22 @@ struct sta_info; | |||
| 38 | * | 38 | * |
| 39 | * @KEY_FLAG_UPLOADED_TO_HARDWARE: Indicates that this key is present | 39 | * @KEY_FLAG_UPLOADED_TO_HARDWARE: Indicates that this key is present |
| 40 | * in the hardware for TX crypto hardware acceleration. | 40 | * in the hardware for TX crypto hardware acceleration. |
| 41 | * @KEY_FLAG_TODO_DELETE: Key is marked for deletion and will, after an | ||
| 42 | * RCU grace period, no longer be reachable other than from the | ||
| 43 | * todo list. | ||
| 44 | * @KEY_FLAG_TODO_HWACCEL_ADD: Key needs to be added to hardware acceleration. | ||
| 45 | * @KEY_FLAG_TODO_HWACCEL_REMOVE: Key needs to be removed from hardware | ||
| 46 | * acceleration. | ||
| 47 | * @KEY_FLAG_TODO_DEFKEY: Key is default key and debugfs needs to be updated. | ||
| 48 | * @KEY_FLAG_TODO_ADD_DEBUGFS: Key needs to be added to debugfs. | ||
| 49 | * @KEY_FLAG_TODO_DEFMGMTKEY: Key is default management key and debugfs needs | ||
| 50 | * to be updated. | ||
| 51 | */ | 41 | */ |
| 52 | enum ieee80211_internal_key_flags { | 42 | enum ieee80211_internal_key_flags { |
| 53 | KEY_FLAG_UPLOADED_TO_HARDWARE = BIT(0), | 43 | KEY_FLAG_UPLOADED_TO_HARDWARE = BIT(0), |
| 54 | KEY_FLAG_TODO_DELETE = BIT(1), | 44 | }; |
| 55 | KEY_FLAG_TODO_HWACCEL_ADD = BIT(2), | 45 | |
| 56 | KEY_FLAG_TODO_HWACCEL_REMOVE = BIT(3), | 46 | enum ieee80211_internal_tkip_state { |
| 57 | KEY_FLAG_TODO_DEFKEY = BIT(4), | 47 | TKIP_STATE_NOT_INIT, |
| 58 | KEY_FLAG_TODO_ADD_DEBUGFS = BIT(5), | 48 | TKIP_STATE_PHASE1_DONE, |
| 59 | KEY_FLAG_TODO_DEFMGMTKEY = BIT(6), | 49 | TKIP_STATE_PHASE1_HW_UPLOADED, |
| 60 | }; | 50 | }; |
| 61 | 51 | ||
| 62 | struct tkip_ctx { | 52 | struct tkip_ctx { |
| 63 | u32 iv32; | 53 | u32 iv32; |
| 64 | u16 iv16; | 54 | u16 iv16; |
| 65 | u16 p1k[5]; | 55 | u16 p1k[5]; |
| 66 | int initialized; | 56 | enum ieee80211_internal_tkip_state state; |
| 67 | }; | 57 | }; |
| 68 | 58 | ||
| 69 | struct ieee80211_key { | 59 | struct ieee80211_key { |
| @@ -73,10 +63,8 @@ struct ieee80211_key { | |||
| 73 | 63 | ||
| 74 | /* for sdata list */ | 64 | /* for sdata list */ |
| 75 | struct list_head list; | 65 | struct list_head list; |
| 76 | /* for todo list */ | ||
| 77 | struct list_head todo; | ||
| 78 | 66 | ||
| 79 | /* protected by todo lock! */ | 67 | /* protected by key mutex */ |
| 80 | unsigned int flags; | 68 | unsigned int flags; |
| 81 | 69 | ||
| 82 | union { | 70 | union { |
| @@ -89,7 +77,13 @@ struct ieee80211_key { | |||
| 89 | } tkip; | 77 | } tkip; |
| 90 | struct { | 78 | struct { |
| 91 | u8 tx_pn[6]; | 79 | u8 tx_pn[6]; |
| 92 | u8 rx_pn[NUM_RX_DATA_QUEUES][6]; | 80 | /* |
| 81 | * Last received packet number. The first | ||
| 82 | * NUM_RX_DATA_QUEUES counters are used with Data | ||
| 83 | * frames and the last counter is used with Robust | ||
| 84 | * Management frames. | ||
| 85 | */ | ||
| 86 | u8 rx_pn[NUM_RX_DATA_QUEUES + 1][6]; | ||
| 93 | struct crypto_cipher *tfm; | 87 | struct crypto_cipher *tfm; |
| 94 | u32 replays; /* dot11RSNAStatsCCMPReplays */ | 88 | u32 replays; /* dot11RSNAStatsCCMPReplays */ |
| 95 | /* scratch buffers for virt_to_page() (crypto API) */ | 89 | /* scratch buffers for virt_to_page() (crypto API) */ |
| @@ -141,7 +135,8 @@ struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg, | |||
| 141 | void ieee80211_key_link(struct ieee80211_key *key, | 135 | void ieee80211_key_link(struct ieee80211_key *key, |
| 142 | struct ieee80211_sub_if_data *sdata, | 136 | struct ieee80211_sub_if_data *sdata, |
| 143 | struct sta_info *sta); | 137 | struct sta_info *sta); |
| 144 | void ieee80211_key_free(struct ieee80211_key *key); | 138 | void ieee80211_key_free(struct ieee80211_local *local, |
| 139 | struct ieee80211_key *key); | ||
| 145 | void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx); | 140 | void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx); |
| 146 | void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, | 141 | void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, |
| 147 | int idx); | 142 | int idx); |
| @@ -149,6 +144,4 @@ void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata); | |||
| 149 | void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata); | 144 | void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata); |
| 150 | void ieee80211_disable_keys(struct ieee80211_sub_if_data *sdata); | 145 | void ieee80211_disable_keys(struct ieee80211_sub_if_data *sdata); |
| 151 | 146 | ||
| 152 | void ieee80211_key_todo(void); | ||
| 153 | |||
| 154 | #endif /* IEEE80211_KEY_H */ | 147 | #endif /* IEEE80211_KEY_H */ |
