diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-08 14:56:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:47:48 -0400 |
commit | 1e2b79761d551c545225e1fa6e7d144f7e804898 (patch) | |
tree | 58b3d7aa75e98abdb0b4a60dfba964c750deb7e6 /drivers/net | |
parent | ac4e4ce54eb9cb4963a1d3d91fc65536d882ffb2 (diff) |
wl1271: Correct TKIP header space handling in TX path
Correct the position to which TKIP header space is appended for TX
packets.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_tx.c | 27 |
2 files changed, 20 insertions, 16 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index bedd19b57499..3d629daf2246 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c | |||
@@ -1160,12 +1160,9 @@ static int wl1271_register_hw(struct wl1271 *wl) | |||
1160 | 1160 | ||
1161 | static int wl1271_init_ieee80211(struct wl1271 *wl) | 1161 | static int wl1271_init_ieee80211(struct wl1271 *wl) |
1162 | { | 1162 | { |
1163 | /* | 1163 | /* The tx descriptor buffer and the TKIP space. */ |
1164 | * The tx descriptor buffer and the TKIP space. | 1164 | wl->hw->extra_tx_headroom = WL1271_TKIP_IV_SPACE + |
1165 | * | 1165 | sizeof(struct wl1271_tx_hw_descr); |
1166 | * FIXME: add correct 1271 descriptor size | ||
1167 | */ | ||
1168 | wl->hw->extra_tx_headroom = WL1271_TKIP_IV_SPACE; | ||
1169 | 1166 | ||
1170 | /* unit us */ | 1167 | /* unit us */ |
1171 | /* FIXME: find a proper value */ | 1168 | /* FIXME: find a proper value */ |
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c index 162f0267a20b..1ad1bc3f152e 100644 --- a/drivers/net/wireless/wl12xx/wl1271_tx.c +++ b/drivers/net/wireless/wl12xx/wl1271_tx.c | |||
@@ -92,6 +92,14 @@ static int wl1271_tx_fill_hdr(struct wl1271 *wl, struct sk_buff *skb, | |||
92 | 92 | ||
93 | desc = (struct wl1271_tx_hw_descr *) skb->data; | 93 | desc = (struct wl1271_tx_hw_descr *) skb->data; |
94 | 94 | ||
95 | /* relocate space for security header */ | ||
96 | if (extra) { | ||
97 | void *framestart = skb->data + sizeof(*desc); | ||
98 | u16 fc = *(u16 *)(framestart + extra); | ||
99 | int hdrlen = ieee80211_hdrlen(fc); | ||
100 | memmove(framestart, framestart + extra, hdrlen); | ||
101 | } | ||
102 | |||
95 | /* configure packet life time */ | 103 | /* configure packet life time */ |
96 | desc->start_time = jiffies_to_usecs(jiffies) - wl->time_offset; | 104 | desc->start_time = jiffies_to_usecs(jiffies) - wl->time_offset; |
97 | desc->life_time = TX_HW_MGMT_PKT_LIFETIME_TU; | 105 | desc->life_time = TX_HW_MGMT_PKT_LIFETIME_TU; |
@@ -257,7 +265,6 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
257 | 265 | ||
258 | struct ieee80211_tx_info *info; | 266 | struct ieee80211_tx_info *info; |
259 | struct sk_buff *skb; | 267 | struct sk_buff *skb; |
260 | u32 header_len; | ||
261 | u16 seq; | 268 | u16 seq; |
262 | int id = result->id; | 269 | int id = result->id; |
263 | 270 | ||
@@ -295,22 +302,22 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, | |||
295 | wl->tx_security_seq_32++; | 302 | wl->tx_security_seq_32++; |
296 | wl->tx_security_seq_16 = seq; | 303 | wl->tx_security_seq_16 = seq; |
297 | 304 | ||
298 | /* get header len */ | 305 | /* remove private header from packet */ |
306 | skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); | ||
307 | |||
308 | /* remove TKIP header space if present */ | ||
299 | if (info->control.hw_key && | 309 | if (info->control.hw_key && |
300 | info->control.hw_key->alg == ALG_TKIP) | 310 | info->control.hw_key->alg == ALG_TKIP) { |
301 | header_len = WL1271_TKIP_IV_SPACE + | 311 | int hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
302 | sizeof(struct wl1271_tx_hw_descr); | 312 | memmove(skb->data + WL1271_TKIP_IV_SPACE, skb->data, hdrlen); |
303 | else | 313 | skb_pull(skb, WL1271_TKIP_IV_SPACE); |
304 | header_len = sizeof(struct wl1271_tx_hw_descr); | 314 | } |
305 | 315 | ||
306 | wl1271_debug(DEBUG_TX, "tx status id %u skb 0x%p failures %u rate 0x%x" | 316 | wl1271_debug(DEBUG_TX, "tx status id %u skb 0x%p failures %u rate 0x%x" |
307 | " status 0x%x", | 317 | " status 0x%x", |
308 | result->id, skb, result->ack_failures, | 318 | result->id, skb, result->ack_failures, |
309 | result->rate_class_index, result->status); | 319 | result->rate_class_index, result->status); |
310 | 320 | ||
311 | /* remove private header from packet */ | ||
312 | skb_pull(skb, header_len); | ||
313 | |||
314 | /* return the packet to the stack */ | 321 | /* return the packet to the stack */ |
315 | ieee80211_tx_status(wl->hw, skb); | 322 | ieee80211_tx_status(wl->hw, skb); |
316 | wl->tx_frames[result->id] = NULL; | 323 | wl->tx_frames[result->id] = NULL; |