diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-15 06:55:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:48:11 -0400 |
commit | e039fa4a4195ac4ee895e6f3d1334beed63256fe (patch) | |
tree | cfd0762d73df96b73052378be7b157c4ac6e7035 /drivers/net/wireless/b43legacy | |
parent | e24549485f859be6518929bb1c9c0257d79f033d (diff) |
mac80211: move TX info into skb->cb
This patch converts mac80211 and all drivers to have transmit
information and status in skb->cb rather than allocating extra
memory for it and copying all the data around. To make it fit,
a union is used where only data that is necessary for all steps
is kept outside of the union.
A number of fixes were done by Ivo, as well as the rt2x00 part
of this patch.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.c | 36 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/pio.c | 19 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/pio.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.c | 44 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/xmit.h | 2 |
7 files changed, 58 insertions, 63 deletions
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index d6686f713b6d..c1c501d963bc 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -1205,10 +1205,10 @@ struct b43legacy_dmaring *parse_cookie(struct b43legacy_wldev *dev, | |||
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, | 1207 | static int dma_tx_fragment(struct b43legacy_dmaring *ring, |
1208 | struct sk_buff *skb, | 1208 | struct sk_buff *skb) |
1209 | struct ieee80211_tx_control *ctl) | ||
1210 | { | 1209 | { |
1211 | const struct b43legacy_dma_ops *ops = ring->ops; | 1210 | const struct b43legacy_dma_ops *ops = ring->ops; |
1211 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1212 | u8 *header; | 1212 | u8 *header; |
1213 | int slot, old_top_slot, old_used_slots; | 1213 | int slot, old_top_slot, old_used_slots; |
1214 | int err; | 1214 | int err; |
@@ -1231,7 +1231,7 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1231 | header = &(ring->txhdr_cache[slot * sizeof( | 1231 | header = &(ring->txhdr_cache[slot * sizeof( |
1232 | struct b43legacy_txhdr_fw3)]); | 1232 | struct b43legacy_txhdr_fw3)]); |
1233 | err = b43legacy_generate_txhdr(ring->dev, header, | 1233 | err = b43legacy_generate_txhdr(ring->dev, header, |
1234 | skb->data, skb->len, ctl, | 1234 | skb->data, skb->len, info, |
1235 | generate_cookie(ring, slot)); | 1235 | generate_cookie(ring, slot)); |
1236 | if (unlikely(err)) { | 1236 | if (unlikely(err)) { |
1237 | ring->current_slot = old_top_slot; | 1237 | ring->current_slot = old_top_slot; |
@@ -1255,7 +1255,6 @@ static int dma_tx_fragment(struct b43legacy_dmaring *ring, | |||
1255 | desc = ops->idx2desc(ring, slot, &meta); | 1255 | desc = ops->idx2desc(ring, slot, &meta); |
1256 | memset(meta, 0, sizeof(*meta)); | 1256 | memset(meta, 0, sizeof(*meta)); |
1257 | 1257 | ||
1258 | memcpy(&meta->txstat.control, ctl, sizeof(*ctl)); | ||
1259 | meta->skb = skb; | 1258 | meta->skb = skb; |
1260 | meta->is_last_fragment = 1; | 1259 | meta->is_last_fragment = 1; |
1261 | 1260 | ||
@@ -1323,14 +1322,14 @@ int should_inject_overflow(struct b43legacy_dmaring *ring) | |||
1323 | } | 1322 | } |
1324 | 1323 | ||
1325 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 1324 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
1326 | struct sk_buff *skb, | 1325 | struct sk_buff *skb) |
1327 | struct ieee80211_tx_control *ctl) | ||
1328 | { | 1326 | { |
1329 | struct b43legacy_dmaring *ring; | 1327 | struct b43legacy_dmaring *ring; |
1328 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
1330 | int err = 0; | 1329 | int err = 0; |
1331 | unsigned long flags; | 1330 | unsigned long flags; |
1332 | 1331 | ||
1333 | ring = priority_to_txring(dev, ctl->queue); | 1332 | ring = priority_to_txring(dev, info->queue); |
1334 | spin_lock_irqsave(&ring->lock, flags); | 1333 | spin_lock_irqsave(&ring->lock, flags); |
1335 | B43legacy_WARN_ON(!ring->tx); | 1334 | B43legacy_WARN_ON(!ring->tx); |
1336 | if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { | 1335 | if (unlikely(free_slots(ring) < SLOTS_PER_PACKET)) { |
@@ -1343,7 +1342,7 @@ int b43legacy_dma_tx(struct b43legacy_wldev *dev, | |||
1343 | * That would be a mac80211 bug. */ | 1342 | * That would be a mac80211 bug. */ |
1344 | B43legacy_BUG_ON(ring->stopped); | 1343 | B43legacy_BUG_ON(ring->stopped); |
1345 | 1344 | ||
1346 | err = dma_tx_fragment(ring, skb, ctl); | 1345 | err = dma_tx_fragment(ring, skb); |
1347 | if (unlikely(err == -ENOKEY)) { | 1346 | if (unlikely(err == -ENOKEY)) { |
1348 | /* Drop this packet, as we don't have the encryption key | 1347 | /* Drop this packet, as we don't have the encryption key |
1349 | * anymore and must not transmit it unencrypted. */ | 1348 | * anymore and must not transmit it unencrypted. */ |
@@ -1401,26 +1400,29 @@ void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | |||
1401 | 1); | 1400 | 1); |
1402 | 1401 | ||
1403 | if (meta->is_last_fragment) { | 1402 | if (meta->is_last_fragment) { |
1404 | B43legacy_WARN_ON(!meta->skb); | 1403 | struct ieee80211_tx_info *info; |
1404 | BUG_ON(!meta->skb); | ||
1405 | info = IEEE80211_SKB_CB(meta->skb); | ||
1405 | /* Call back to inform the ieee80211 subsystem about the | 1406 | /* Call back to inform the ieee80211 subsystem about the |
1406 | * status of the transmission. | 1407 | * status of the transmission. |
1407 | * Some fields of txstat are already filled in dma_tx(). | 1408 | * Some fields of txstat are already filled in dma_tx(). |
1408 | */ | 1409 | */ |
1410 | |||
1411 | memset(&info->status, 0, sizeof(info->status)); | ||
1412 | |||
1409 | if (status->acked) { | 1413 | if (status->acked) { |
1410 | meta->txstat.flags |= IEEE80211_TX_STATUS_ACK; | 1414 | info->flags |= IEEE80211_TX_STAT_ACK; |
1411 | } else { | 1415 | } else { |
1412 | if (!(meta->txstat.control.flags | 1416 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
1413 | & IEEE80211_TXCTL_NO_ACK)) | 1417 | info->status.excessive_retries = 1; |
1414 | meta->txstat.excessive_retries = 1; | ||
1415 | } | 1418 | } |
1416 | if (status->frame_count == 0) { | 1419 | if (status->frame_count == 0) { |
1417 | /* The frame was not transmitted at all. */ | 1420 | /* The frame was not transmitted at all. */ |
1418 | meta->txstat.retry_count = 0; | 1421 | info->status.retry_count = 0; |
1419 | } else | 1422 | } else |
1420 | meta->txstat.retry_count = status->frame_count | 1423 | info->status.retry_count = status->frame_count |
1421 | - 1; | 1424 | - 1; |
1422 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb, | 1425 | ieee80211_tx_status_irqsafe(dev->wl->hw, meta->skb); |
1423 | &(meta->txstat)); | ||
1424 | /* skb is freed by ieee80211_tx_status_irqsafe() */ | 1426 | /* skb is freed by ieee80211_tx_status_irqsafe() */ |
1425 | meta->skb = NULL; | 1427 | meta->skb = NULL; |
1426 | } else { | 1428 | } else { |
diff --git a/drivers/net/wireless/b43legacy/dma.h b/drivers/net/wireless/b43legacy/dma.h index 2dd488c5be2d..67537a7495ff 100644 --- a/drivers/net/wireless/b43legacy/dma.h +++ b/drivers/net/wireless/b43legacy/dma.h | |||
@@ -195,7 +195,6 @@ struct b43legacy_dmadesc_meta { | |||
195 | dma_addr_t dmaaddr; | 195 | dma_addr_t dmaaddr; |
196 | /* ieee80211 TX status. Only used once per 802.11 frag. */ | 196 | /* ieee80211 TX status. Only used once per 802.11 frag. */ |
197 | bool is_last_fragment; | 197 | bool is_last_fragment; |
198 | struct ieee80211_tx_status txstat; | ||
199 | }; | 198 | }; |
200 | 199 | ||
201 | struct b43legacy_dmaring; | 200 | struct b43legacy_dmaring; |
@@ -297,8 +296,7 @@ void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev, | |||
297 | struct ieee80211_tx_queue_stats *stats); | 296 | struct ieee80211_tx_queue_stats *stats); |
298 | 297 | ||
299 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, | 298 | int b43legacy_dma_tx(struct b43legacy_wldev *dev, |
300 | struct sk_buff *skb, | 299 | struct sk_buff *skb); |
301 | struct ieee80211_tx_control *ctl); | ||
302 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, | 300 | void b43legacy_dma_handle_txstatus(struct b43legacy_wldev *dev, |
303 | const struct b43legacy_txstatus *status); | 301 | const struct b43legacy_txstatus *status); |
304 | 302 | ||
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index b05a507ed44d..f706ca65f159 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2358,8 +2358,7 @@ static int b43legacy_rng_init(struct b43legacy_wl *wl) | |||
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | static int b43legacy_op_tx(struct ieee80211_hw *hw, | 2360 | static int b43legacy_op_tx(struct ieee80211_hw *hw, |
2361 | struct sk_buff *skb, | 2361 | struct sk_buff *skb) |
2362 | struct ieee80211_tx_control *ctl) | ||
2363 | { | 2362 | { |
2364 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 2363 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
2365 | struct b43legacy_wldev *dev = wl->current_dev; | 2364 | struct b43legacy_wldev *dev = wl->current_dev; |
@@ -2373,10 +2372,10 @@ static int b43legacy_op_tx(struct ieee80211_hw *hw, | |||
2373 | /* DMA-TX is done without a global lock. */ | 2372 | /* DMA-TX is done without a global lock. */ |
2374 | if (b43legacy_using_pio(dev)) { | 2373 | if (b43legacy_using_pio(dev)) { |
2375 | spin_lock_irqsave(&wl->irq_lock, flags); | 2374 | spin_lock_irqsave(&wl->irq_lock, flags); |
2376 | err = b43legacy_pio_tx(dev, skb, ctl); | 2375 | err = b43legacy_pio_tx(dev, skb); |
2377 | spin_unlock_irqrestore(&wl->irq_lock, flags); | 2376 | spin_unlock_irqrestore(&wl->irq_lock, flags); |
2378 | } else | 2377 | } else |
2379 | err = b43legacy_dma_tx(dev, skb, ctl); | 2378 | err = b43legacy_dma_tx(dev, skb); |
2380 | out: | 2379 | out: |
2381 | if (unlikely(err)) | 2380 | if (unlikely(err)) |
2382 | return NETDEV_TX_BUSY; | 2381 | return NETDEV_TX_BUSY; |
@@ -3409,7 +3408,7 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3409 | * field, but that would probably require resizing and moving of data | 3408 | * field, but that would probably require resizing and moving of data |
3410 | * within the beacon template. Simply request a new beacon and let | 3409 | * within the beacon template. Simply request a new beacon and let |
3411 | * mac80211 do the hard work. */ | 3410 | * mac80211 do the hard work. */ |
3412 | beacon = ieee80211_beacon_get(hw, wl->vif, NULL); | 3411 | beacon = ieee80211_beacon_get(hw, wl->vif); |
3413 | if (unlikely(!beacon)) | 3412 | if (unlikely(!beacon)) |
3414 | return -ENOMEM; | 3413 | return -ENOMEM; |
3415 | spin_lock_irqsave(&wl->irq_lock, flags); | 3414 | spin_lock_irqsave(&wl->irq_lock, flags); |
@@ -3420,8 +3419,7 @@ static int b43legacy_op_beacon_set_tim(struct ieee80211_hw *hw, | |||
3420 | } | 3419 | } |
3421 | 3420 | ||
3422 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, | 3421 | static int b43legacy_op_ibss_beacon_update(struct ieee80211_hw *hw, |
3423 | struct sk_buff *beacon, | 3422 | struct sk_buff *beacon) |
3424 | struct ieee80211_tx_control *ctl) | ||
3425 | { | 3423 | { |
3426 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3424 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
3427 | unsigned long flags; | 3425 | unsigned long flags; |
diff --git a/drivers/net/wireless/b43legacy/pio.c b/drivers/net/wireless/b43legacy/pio.c index 8d3d27d3cd67..a86c7647fa2d 100644 --- a/drivers/net/wireless/b43legacy/pio.c +++ b/drivers/net/wireless/b43legacy/pio.c | |||
@@ -196,7 +196,7 @@ static int pio_tx_write_fragment(struct b43legacy_pioqueue *queue, | |||
196 | B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0); | 196 | B43legacy_WARN_ON(skb_shinfo(skb)->nr_frags != 0); |
197 | err = b43legacy_generate_txhdr(queue->dev, | 197 | err = b43legacy_generate_txhdr(queue->dev, |
198 | txhdr, skb->data, skb->len, | 198 | txhdr, skb->data, skb->len, |
199 | &packet->txstat.control, | 199 | IEEE80211_SKB_CB(skb), |
200 | generate_cookie(queue, packet)); | 200 | generate_cookie(queue, packet)); |
201 | if (err) | 201 | if (err) |
202 | return err; | 202 | return err; |
@@ -463,8 +463,7 @@ err_destroy0: | |||
463 | } | 463 | } |
464 | 464 | ||
465 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 465 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
466 | struct sk_buff *skb, | 466 | struct sk_buff *skb) |
467 | struct ieee80211_tx_control *ctl) | ||
468 | { | 467 | { |
469 | struct b43legacy_pioqueue *queue = dev->pio.queue1; | 468 | struct b43legacy_pioqueue *queue = dev->pio.queue1; |
470 | struct b43legacy_pio_txpacket *packet; | 469 | struct b43legacy_pio_txpacket *packet; |
@@ -476,9 +475,6 @@ int b43legacy_pio_tx(struct b43legacy_wldev *dev, | |||
476 | list); | 475 | list); |
477 | packet->skb = skb; | 476 | packet->skb = skb; |
478 | 477 | ||
479 | memset(&packet->txstat, 0, sizeof(packet->txstat)); | ||
480 | memcpy(&packet->txstat.control, ctl, sizeof(*ctl)); | ||
481 | |||
482 | list_move_tail(&packet->list, &queue->txqueue); | 478 | list_move_tail(&packet->list, &queue->txqueue); |
483 | queue->nr_txfree--; | 479 | queue->nr_txfree--; |
484 | queue->nr_tx_packets++; | 480 | queue->nr_tx_packets++; |
@@ -494,6 +490,7 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
494 | { | 490 | { |
495 | struct b43legacy_pioqueue *queue; | 491 | struct b43legacy_pioqueue *queue; |
496 | struct b43legacy_pio_txpacket *packet; | 492 | struct b43legacy_pio_txpacket *packet; |
493 | struct ieee80211_tx_info *info; | ||
497 | 494 | ||
498 | queue = parse_cookie(dev, status->cookie, &packet); | 495 | queue = parse_cookie(dev, status->cookie, &packet); |
499 | B43legacy_WARN_ON(!queue); | 496 | B43legacy_WARN_ON(!queue); |
@@ -505,11 +502,13 @@ void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | |||
505 | queue->tx_devq_used -= (packet->skb->len + | 502 | queue->tx_devq_used -= (packet->skb->len + |
506 | sizeof(struct b43legacy_txhdr_fw3)); | 503 | sizeof(struct b43legacy_txhdr_fw3)); |
507 | 504 | ||
505 | info = IEEE80211_SKB_CB(packet->skb); | ||
506 | memset(&info->status, 0, sizeof(info->status)); | ||
507 | |||
508 | if (status->acked) | 508 | if (status->acked) |
509 | packet->txstat.flags |= IEEE80211_TX_STATUS_ACK; | 509 | info->flags |= IEEE80211_TX_STAT_ACK; |
510 | packet->txstat.retry_count = status->frame_count - 1; | 510 | info->status.retry_count = status->frame_count - 1; |
511 | ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb, | 511 | ieee80211_tx_status_irqsafe(dev->wl->hw, packet->skb); |
512 | &(packet->txstat)); | ||
513 | packet->skb = NULL; | 512 | packet->skb = NULL; |
514 | 513 | ||
515 | free_txpacket(packet, 1); | 514 | free_txpacket(packet, 1); |
diff --git a/drivers/net/wireless/b43legacy/pio.h b/drivers/net/wireless/b43legacy/pio.h index 5bfed0c40030..49310dfaf2d1 100644 --- a/drivers/net/wireless/b43legacy/pio.h +++ b/drivers/net/wireless/b43legacy/pio.h | |||
@@ -41,7 +41,6 @@ struct b43legacy_xmitstatus; | |||
41 | struct b43legacy_pio_txpacket { | 41 | struct b43legacy_pio_txpacket { |
42 | struct b43legacy_pioqueue *queue; | 42 | struct b43legacy_pioqueue *queue; |
43 | struct sk_buff *skb; | 43 | struct sk_buff *skb; |
44 | struct ieee80211_tx_status txstat; | ||
45 | struct list_head list; | 44 | struct list_head list; |
46 | }; | 45 | }; |
47 | 46 | ||
@@ -104,8 +103,7 @@ int b43legacy_pio_init(struct b43legacy_wldev *dev); | |||
104 | void b43legacy_pio_free(struct b43legacy_wldev *dev); | 103 | void b43legacy_pio_free(struct b43legacy_wldev *dev); |
105 | 104 | ||
106 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, | 105 | int b43legacy_pio_tx(struct b43legacy_wldev *dev, |
107 | struct sk_buff *skb, | 106 | struct sk_buff *skb); |
108 | struct ieee80211_tx_control *ctl); | ||
109 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, | 107 | void b43legacy_pio_handle_txstatus(struct b43legacy_wldev *dev, |
110 | const struct b43legacy_txstatus *status); | 108 | const struct b43legacy_txstatus *status); |
111 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, | 109 | void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev, |
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c index 55dc251bf510..82dc04d59446 100644 --- a/drivers/net/wireless/b43legacy/xmit.c +++ b/drivers/net/wireless/b43legacy/xmit.c | |||
@@ -188,11 +188,11 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
188 | struct b43legacy_txhdr_fw3 *txhdr, | 188 | struct b43legacy_txhdr_fw3 *txhdr, |
189 | const unsigned char *fragment_data, | 189 | const unsigned char *fragment_data, |
190 | unsigned int fragment_len, | 190 | unsigned int fragment_len, |
191 | const struct ieee80211_tx_control *txctl, | 191 | const struct ieee80211_tx_info *info, |
192 | u16 cookie) | 192 | u16 cookie) |
193 | { | 193 | { |
194 | const struct ieee80211_hdr *wlhdr; | 194 | const struct ieee80211_hdr *wlhdr; |
195 | int use_encryption = (!(txctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)); | 195 | int use_encryption = (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT)); |
196 | u16 fctl; | 196 | u16 fctl; |
197 | u8 rate; | 197 | u8 rate; |
198 | struct ieee80211_rate *rate_fb; | 198 | struct ieee80211_rate *rate_fb; |
@@ -208,11 +208,11 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
208 | 208 | ||
209 | memset(txhdr, 0, sizeof(*txhdr)); | 209 | memset(txhdr, 0, sizeof(*txhdr)); |
210 | 210 | ||
211 | tx_rate = ieee80211_get_tx_rate(dev->wl->hw, txctl); | 211 | tx_rate = ieee80211_get_tx_rate(dev->wl->hw, info); |
212 | 212 | ||
213 | rate = tx_rate->hw_value; | 213 | rate = tx_rate->hw_value; |
214 | rate_ofdm = b43legacy_is_ofdm_rate(rate); | 214 | rate_ofdm = b43legacy_is_ofdm_rate(rate); |
215 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, txctl) ? : tx_rate; | 215 | rate_fb = ieee80211_get_alt_retry_rate(dev->wl->hw, info) ? : tx_rate; |
216 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); | 216 | rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); |
217 | 217 | ||
218 | txhdr->mac_frame_ctl = wlhdr->frame_control; | 218 | txhdr->mac_frame_ctl = wlhdr->frame_control; |
@@ -228,14 +228,14 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
228 | txhdr->dur_fb = wlhdr->duration_id; | 228 | txhdr->dur_fb = wlhdr->duration_id; |
229 | } else { | 229 | } else { |
230 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, | 230 | txhdr->dur_fb = ieee80211_generic_frame_duration(dev->wl->hw, |
231 | txctl->vif, | 231 | info->control.vif, |
232 | fragment_len, | 232 | fragment_len, |
233 | rate_fb); | 233 | rate_fb); |
234 | } | 234 | } |
235 | 235 | ||
236 | plcp_fragment_len = fragment_len + FCS_LEN; | 236 | plcp_fragment_len = fragment_len + FCS_LEN; |
237 | if (use_encryption) { | 237 | if (use_encryption) { |
238 | u8 key_idx = txctl->hw_key->hw_key_idx; | 238 | u8 key_idx = info->control.hw_key->hw_key_idx; |
239 | struct b43legacy_key *key; | 239 | struct b43legacy_key *key; |
240 | int wlhdr_len; | 240 | int wlhdr_len; |
241 | size_t iv_len; | 241 | size_t iv_len; |
@@ -245,7 +245,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
245 | 245 | ||
246 | if (key->enabled) { | 246 | if (key->enabled) { |
247 | /* Hardware appends ICV. */ | 247 | /* Hardware appends ICV. */ |
248 | plcp_fragment_len += txctl->icv_len; | 248 | plcp_fragment_len += info->control.icv_len; |
249 | 249 | ||
250 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); | 250 | key_idx = b43legacy_kidx_to_fw(dev, key_idx); |
251 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & | 251 | mac_ctl |= (key_idx << B43legacy_TX4_MAC_KEYIDX_SHIFT) & |
@@ -254,7 +254,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
254 | B43legacy_TX4_MAC_KEYALG_SHIFT) & | 254 | B43legacy_TX4_MAC_KEYALG_SHIFT) & |
255 | B43legacy_TX4_MAC_KEYALG; | 255 | B43legacy_TX4_MAC_KEYALG; |
256 | wlhdr_len = ieee80211_get_hdrlen(fctl); | 256 | wlhdr_len = ieee80211_get_hdrlen(fctl); |
257 | iv_len = min((size_t)txctl->iv_len, | 257 | iv_len = min((size_t)info->control.iv_len, |
258 | ARRAY_SIZE(txhdr->iv)); | 258 | ARRAY_SIZE(txhdr->iv)); |
259 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); | 259 | memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); |
260 | } else { | 260 | } else { |
@@ -278,7 +278,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
278 | phy_ctl |= B43legacy_TX4_PHY_OFDM; | 278 | phy_ctl |= B43legacy_TX4_PHY_OFDM; |
279 | if (dev->short_preamble) | 279 | if (dev->short_preamble) |
280 | phy_ctl |= B43legacy_TX4_PHY_SHORTPRMBL; | 280 | phy_ctl |= B43legacy_TX4_PHY_SHORTPRMBL; |
281 | switch (txctl->antenna_sel_tx) { | 281 | switch (info->antenna_sel_tx) { |
282 | case 0: | 282 | case 0: |
283 | phy_ctl |= B43legacy_TX4_PHY_ANTLAST; | 283 | phy_ctl |= B43legacy_TX4_PHY_ANTLAST; |
284 | break; | 284 | break; |
@@ -293,21 +293,21 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /* MAC control */ | 295 | /* MAC control */ |
296 | if (!(txctl->flags & IEEE80211_TXCTL_NO_ACK)) | 296 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
297 | mac_ctl |= B43legacy_TX4_MAC_ACK; | 297 | mac_ctl |= B43legacy_TX4_MAC_ACK; |
298 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && | 298 | if (!(((fctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) && |
299 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) | 299 | ((fctl & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL))) |
300 | mac_ctl |= B43legacy_TX4_MAC_HWSEQ; | 300 | mac_ctl |= B43legacy_TX4_MAC_HWSEQ; |
301 | if (txctl->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) | 301 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) |
302 | mac_ctl |= B43legacy_TX4_MAC_STMSDU; | 302 | mac_ctl |= B43legacy_TX4_MAC_STMSDU; |
303 | if (rate_fb_ofdm) | 303 | if (rate_fb_ofdm) |
304 | mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; | 304 | mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM; |
305 | if (txctl->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) | 305 | if (info->flags & IEEE80211_TX_CTL_LONG_RETRY_LIMIT) |
306 | mac_ctl |= B43legacy_TX4_MAC_LONGFRAME; | 306 | mac_ctl |= B43legacy_TX4_MAC_LONGFRAME; |
307 | 307 | ||
308 | /* Generate the RTS or CTS-to-self frame */ | 308 | /* Generate the RTS or CTS-to-self frame */ |
309 | if ((txctl->flags & IEEE80211_TXCTL_USE_RTS_CTS) || | 309 | if ((info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) || |
310 | (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)) { | 310 | (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT)) { |
311 | unsigned int len; | 311 | unsigned int len; |
312 | struct ieee80211_hdr *hdr; | 312 | struct ieee80211_hdr *hdr; |
313 | int rts_rate; | 313 | int rts_rate; |
@@ -315,26 +315,26 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev, | |||
315 | int rts_rate_ofdm; | 315 | int rts_rate_ofdm; |
316 | int rts_rate_fb_ofdm; | 316 | int rts_rate_fb_ofdm; |
317 | 317 | ||
318 | rts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, txctl)->hw_value; | 318 | rts_rate = ieee80211_get_rts_cts_rate(dev->wl->hw, info)->hw_value; |
319 | rts_rate_ofdm = b43legacy_is_ofdm_rate(rts_rate); | 319 | rts_rate_ofdm = b43legacy_is_ofdm_rate(rts_rate); |
320 | rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate); | 320 | rts_rate_fb = b43legacy_calc_fallback_rate(rts_rate); |
321 | rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb); | 321 | rts_rate_fb_ofdm = b43legacy_is_ofdm_rate(rts_rate_fb); |
322 | if (rts_rate_fb_ofdm) | 322 | if (rts_rate_fb_ofdm) |
323 | mac_ctl |= B43legacy_TX4_MAC_CTSFALLBACKOFDM; | 323 | mac_ctl |= B43legacy_TX4_MAC_CTSFALLBACKOFDM; |
324 | 324 | ||
325 | if (txctl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { | 325 | if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { |
326 | ieee80211_ctstoself_get(dev->wl->hw, | 326 | ieee80211_ctstoself_get(dev->wl->hw, |
327 | txctl->vif, | 327 | info->control.vif, |
328 | fragment_data, | 328 | fragment_data, |
329 | fragment_len, txctl, | 329 | fragment_len, info, |
330 | (struct ieee80211_cts *) | 330 | (struct ieee80211_cts *) |
331 | (txhdr->rts_frame)); | 331 | (txhdr->rts_frame)); |
332 | mac_ctl |= B43legacy_TX4_MAC_SENDCTS; | 332 | mac_ctl |= B43legacy_TX4_MAC_SENDCTS; |
333 | len = sizeof(struct ieee80211_cts); | 333 | len = sizeof(struct ieee80211_cts); |
334 | } else { | 334 | } else { |
335 | ieee80211_rts_get(dev->wl->hw, | 335 | ieee80211_rts_get(dev->wl->hw, |
336 | txctl->vif, | 336 | info->control.vif, |
337 | fragment_data, fragment_len, txctl, | 337 | fragment_data, fragment_len, info, |
338 | (struct ieee80211_rts *) | 338 | (struct ieee80211_rts *) |
339 | (txhdr->rts_frame)); | 339 | (txhdr->rts_frame)); |
340 | mac_ctl |= B43legacy_TX4_MAC_SENDRTS; | 340 | mac_ctl |= B43legacy_TX4_MAC_SENDRTS; |
@@ -365,12 +365,12 @@ int b43legacy_generate_txhdr(struct b43legacy_wldev *dev, | |||
365 | u8 *txhdr, | 365 | u8 *txhdr, |
366 | const unsigned char *fragment_data, | 366 | const unsigned char *fragment_data, |
367 | unsigned int fragment_len, | 367 | unsigned int fragment_len, |
368 | const struct ieee80211_tx_control *txctl, | 368 | const struct ieee80211_tx_info *info, |
369 | u16 cookie) | 369 | u16 cookie) |
370 | { | 370 | { |
371 | return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr, | 371 | return generate_txhdr_fw3(dev, (struct b43legacy_txhdr_fw3 *)txhdr, |
372 | fragment_data, fragment_len, | 372 | fragment_data, fragment_len, |
373 | txctl, cookie); | 373 | info, cookie); |
374 | } | 374 | } |
375 | 375 | ||
376 | static s8 b43legacy_rssi_postprocess(struct b43legacy_wldev *dev, | 376 | static s8 b43legacy_rssi_postprocess(struct b43legacy_wldev *dev, |
diff --git a/drivers/net/wireless/b43legacy/xmit.h b/drivers/net/wireless/b43legacy/xmit.h index bab47928a0c9..e56777e0feab 100644 --- a/drivers/net/wireless/b43legacy/xmit.h +++ b/drivers/net/wireless/b43legacy/xmit.h | |||
@@ -80,7 +80,7 @@ int b43legacy_generate_txhdr(struct b43legacy_wldev *dev, | |||
80 | u8 *txhdr, | 80 | u8 *txhdr, |
81 | const unsigned char *fragment_data, | 81 | const unsigned char *fragment_data, |
82 | unsigned int fragment_len, | 82 | unsigned int fragment_len, |
83 | const struct ieee80211_tx_control *txctl, | 83 | const struct ieee80211_tx_info *info, |
84 | u16 cookie); | 84 | u16 cookie); |
85 | 85 | ||
86 | 86 | ||