aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-07 12:58:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-08 11:42:23 -0400
commit42d98795505314c7af42c7c6b988425300958ed3 (patch)
tree75fc047570677de0a2ea6f9846ca41af61a74c68 /net/mac80211
parent3ea542d3c2862142ae511fac5ce2dfc7419dcc53 (diff)
mac80211: allow driver to generate P1K for IV32
In order to support pre-populating the P1K cache in iwlwifi hardware for WoWLAN, we need to calculate the P1K for the current IV32. Allow drivers to get the P1K for any given IV32 instead of for a given packet, but keep the packet-based version around as an inline. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tkip.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index de570b38460..cc79e697cdb 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -170,15 +170,12 @@ static void ieee80211_compute_tkip_p1k(struct ieee80211_key *key, u32 iv32)
170 tkip_mixing_phase1(tk, ctx, sdata->vif.addr, iv32); 170 tkip_mixing_phase1(tk, ctx, sdata->vif.addr, iv32);
171} 171}
172 172
173void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf, 173void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
174 struct sk_buff *skb, u16 *p1k) 174 u32 iv32, u16 *p1k)
175{ 175{
176 struct ieee80211_key *key = (struct ieee80211_key *) 176 struct ieee80211_key *key = (struct ieee80211_key *)
177 container_of(keyconf, struct ieee80211_key, conf); 177 container_of(keyconf, struct ieee80211_key, conf);
178 struct tkip_ctx *ctx = &key->u.tkip.tx; 178 struct tkip_ctx *ctx = &key->u.tkip.tx;
179 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
180 const u8 *data = (u8 *)hdr + ieee80211_hdrlen(hdr->frame_control);
181 u32 iv32 = get_unaligned_le32(&data[4]);
182 unsigned long flags; 179 unsigned long flags;
183 180
184 spin_lock_irqsave(&key->u.tkip.txlock, flags); 181 spin_lock_irqsave(&key->u.tkip.txlock, flags);
@@ -186,7 +183,7 @@ void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf,
186 memcpy(p1k, ctx->p1k, sizeof(ctx->p1k)); 183 memcpy(p1k, ctx->p1k, sizeof(ctx->p1k));
187 spin_unlock_irqrestore(&key->u.tkip.txlock, flags); 184 spin_unlock_irqrestore(&key->u.tkip.txlock, flags);
188} 185}
189EXPORT_SYMBOL(ieee80211_get_tkip_p1k); 186EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv);
190 187
191void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, 188void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
192 struct sk_buff *skb, u8 *p2k) 189 struct sk_buff *skb, u8 *p2k)