diff options
Diffstat (limited to 'drivers/net/wireless/b43/pio.c')
-rw-r--r-- | drivers/net/wireless/b43/pio.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/net/wireless/b43/pio.c b/drivers/net/wireless/b43/pio.c index 08c8a087f30e..8b1555d95f1c 100644 --- a/drivers/net/wireless/b43/pio.c +++ b/drivers/net/wireless/b43/pio.c | |||
@@ -446,29 +446,27 @@ static void pio_tx_frame_4byte_queue(struct b43_pio_txpacket *pack, | |||
446 | } | 446 | } |
447 | 447 | ||
448 | static int pio_tx_frame(struct b43_pio_txqueue *q, | 448 | static int pio_tx_frame(struct b43_pio_txqueue *q, |
449 | struct sk_buff *skb, | 449 | struct sk_buff *skb) |
450 | struct ieee80211_tx_control *ctl) | ||
451 | { | 450 | { |
452 | struct b43_pio_txpacket *pack; | 451 | struct b43_pio_txpacket *pack; |
453 | struct b43_txhdr txhdr; | 452 | struct b43_txhdr txhdr; |
454 | u16 cookie; | 453 | u16 cookie; |
455 | int err; | 454 | int err; |
456 | unsigned int hdrlen; | 455 | unsigned int hdrlen; |
456 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
457 | 457 | ||
458 | B43_WARN_ON(list_empty(&q->packets_list)); | 458 | B43_WARN_ON(list_empty(&q->packets_list)); |
459 | pack = list_entry(q->packets_list.next, | 459 | pack = list_entry(q->packets_list.next, |
460 | struct b43_pio_txpacket, list); | 460 | struct b43_pio_txpacket, list); |
461 | memset(&pack->txstat, 0, sizeof(pack->txstat)); | ||
462 | memcpy(&pack->txstat.control, ctl, sizeof(*ctl)); | ||
463 | 461 | ||
464 | cookie = generate_cookie(q, pack); | 462 | cookie = generate_cookie(q, pack); |
465 | hdrlen = b43_txhdr_size(q->dev); | 463 | hdrlen = b43_txhdr_size(q->dev); |
466 | err = b43_generate_txhdr(q->dev, (u8 *)&txhdr, skb->data, | 464 | err = b43_generate_txhdr(q->dev, (u8 *)&txhdr, skb->data, |
467 | skb->len, ctl, cookie); | 465 | skb->len, info, cookie); |
468 | if (err) | 466 | if (err) |
469 | return err; | 467 | return err; |
470 | 468 | ||
471 | if (ctl->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM) { | 469 | if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { |
472 | /* Tell the firmware about the cookie of the last | 470 | /* Tell the firmware about the cookie of the last |
473 | * mcast frame, so it can clear the more-data bit in it. */ | 471 | * mcast frame, so it can clear the more-data bit in it. */ |
474 | b43_shm_write16(q->dev, B43_SHM_SHARED, | 472 | b43_shm_write16(q->dev, B43_SHM_SHARED, |
@@ -492,17 +490,18 @@ static int pio_tx_frame(struct b43_pio_txqueue *q, | |||
492 | return 0; | 490 | return 0; |
493 | } | 491 | } |
494 | 492 | ||
495 | int b43_pio_tx(struct b43_wldev *dev, | 493 | int b43_pio_tx(struct b43_wldev *dev, struct sk_buff *skb) |
496 | struct sk_buff *skb, struct ieee80211_tx_control *ctl) | ||
497 | { | 494 | { |
498 | struct b43_pio_txqueue *q; | 495 | struct b43_pio_txqueue *q; |
499 | struct ieee80211_hdr *hdr; | 496 | struct ieee80211_hdr *hdr; |
500 | unsigned long flags; | 497 | unsigned long flags; |
501 | unsigned int hdrlen, total_len; | 498 | unsigned int hdrlen, total_len; |
502 | int err = 0; | 499 | int err = 0; |
500 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
503 | 501 | ||
504 | hdr = (struct ieee80211_hdr *)skb->data; | 502 | hdr = (struct ieee80211_hdr *)skb->data; |
505 | if (ctl->flags & IEEE80211_TXCTL_SEND_AFTER_DTIM) { | 503 | |
504 | if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { | ||
506 | /* The multicast queue will be sent after the DTIM. */ | 505 | /* The multicast queue will be sent after the DTIM. */ |
507 | q = dev->pio.tx_queue_mcast; | 506 | q = dev->pio.tx_queue_mcast; |
508 | /* Set the frame More-Data bit. Ucode will clear it | 507 | /* Set the frame More-Data bit. Ucode will clear it |
@@ -510,7 +509,7 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
510 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); | 509 | hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); |
511 | } else { | 510 | } else { |
512 | /* Decide by priority where to put this frame. */ | 511 | /* Decide by priority where to put this frame. */ |
513 | q = select_queue_by_priority(dev, ctl->queue); | 512 | q = select_queue_by_priority(dev, skb_get_queue_mapping(skb)); |
514 | } | 513 | } |
515 | 514 | ||
516 | spin_lock_irqsave(&q->lock, flags); | 515 | spin_lock_irqsave(&q->lock, flags); |
@@ -533,7 +532,7 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
533 | if (total_len > (q->buffer_size - q->buffer_used)) { | 532 | if (total_len > (q->buffer_size - q->buffer_used)) { |
534 | /* Not enough memory on the queue. */ | 533 | /* Not enough memory on the queue. */ |
535 | err = -EBUSY; | 534 | err = -EBUSY; |
536 | ieee80211_stop_queue(dev->wl->hw, ctl->queue); | 535 | ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb)); |
537 | q->stopped = 1; | 536 | q->stopped = 1; |
538 | goto out_unlock; | 537 | goto out_unlock; |
539 | } | 538 | } |
@@ -541,9 +540,9 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
541 | /* Assign the queue number to the ring (if not already done before) | 540 | /* Assign the queue number to the ring (if not already done before) |
542 | * so TX status handling can use it. The mac80211-queue to b43-queue | 541 | * so TX status handling can use it. The mac80211-queue to b43-queue |
543 | * mapping is static, so we don't need to store it per frame. */ | 542 | * mapping is static, so we don't need to store it per frame. */ |
544 | q->queue_prio = ctl->queue; | 543 | q->queue_prio = skb_get_queue_mapping(skb); |
545 | 544 | ||
546 | err = pio_tx_frame(q, skb, ctl); | 545 | err = pio_tx_frame(q, skb); |
547 | if (unlikely(err == -ENOKEY)) { | 546 | if (unlikely(err == -ENOKEY)) { |
548 | /* Drop this packet, as we don't have the encryption key | 547 | /* Drop this packet, as we don't have the encryption key |
549 | * anymore and must not transmit it unencrypted. */ | 548 | * anymore and must not transmit it unencrypted. */ |
@@ -561,7 +560,7 @@ int b43_pio_tx(struct b43_wldev *dev, | |||
561 | if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) || | 560 | if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) || |
562 | (q->free_packet_slots == 0)) { | 561 | (q->free_packet_slots == 0)) { |
563 | /* The queue is full. */ | 562 | /* The queue is full. */ |
564 | ieee80211_stop_queue(dev->wl->hw, ctl->queue); | 563 | ieee80211_stop_queue(dev->wl->hw, skb_get_queue_mapping(skb)); |
565 | q->stopped = 1; | 564 | q->stopped = 1; |
566 | } | 565 | } |
567 | 566 | ||
@@ -578,6 +577,7 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev, | |||
578 | struct b43_pio_txqueue *q; | 577 | struct b43_pio_txqueue *q; |
579 | struct b43_pio_txpacket *pack = NULL; | 578 | struct b43_pio_txpacket *pack = NULL; |
580 | unsigned int total_len; | 579 | unsigned int total_len; |
580 | struct ieee80211_tx_info *info; | ||
581 | 581 | ||
582 | q = parse_cookie(dev, status->cookie, &pack); | 582 | q = parse_cookie(dev, status->cookie, &pack); |
583 | if (unlikely(!q)) | 583 | if (unlikely(!q)) |
@@ -586,15 +586,17 @@ void b43_pio_handle_txstatus(struct b43_wldev *dev, | |||
586 | 586 | ||
587 | spin_lock(&q->lock); /* IRQs are already disabled. */ | 587 | spin_lock(&q->lock); /* IRQs are already disabled. */ |
588 | 588 | ||
589 | b43_fill_txstatus_report(&(pack->txstat), status); | 589 | info = (void *)pack->skb; |
590 | memset(&info->status, 0, sizeof(info->status)); | ||
591 | |||
592 | b43_fill_txstatus_report(info, status); | ||
590 | 593 | ||
591 | total_len = pack->skb->len + b43_txhdr_size(dev); | 594 | total_len = pack->skb->len + b43_txhdr_size(dev); |
592 | total_len = roundup(total_len, 4); | 595 | total_len = roundup(total_len, 4); |
593 | q->buffer_used -= total_len; | 596 | q->buffer_used -= total_len; |
594 | q->free_packet_slots += 1; | 597 | q->free_packet_slots += 1; |
595 | 598 | ||
596 | ieee80211_tx_status_irqsafe(dev->wl->hw, pack->skb, | 599 | ieee80211_tx_status_irqsafe(dev->wl->hw, pack->skb); |
597 | &(pack->txstat)); | ||
598 | pack->skb = NULL; | 600 | pack->skb = NULL; |
599 | list_add(&pack->list, &q->packets_list); | 601 | list_add(&pack->list, &q->packets_list); |
600 | 602 | ||