aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-05-10 07:46:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:35 -0400
commitb8be63ffa5dc44324e7f507997870fa3e4b17619 (patch)
treead9ef1c3e4e09111ad93b003baaec325bd5e40e0 /drivers
parentdec13b6bda600c7e7da993e634562873112af50b (diff)
rt2x00: Merge RX and TX entry private data
With the pending removal of the tx_control structure we can merge the RX and TX entry private data structure in advance. This will temporarily increase the required memory for the queue, but that overhead will only be limited. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c78
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c72
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c33
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c89
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.h22
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c144
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.h17
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c69
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c6
9 files changed, 223 insertions, 307 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index a491ba5bb5c3..b11f445c7479 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -620,39 +620,38 @@ static void rt2400pci_link_tuner(struct rt2x00_dev *rt2x00dev)
620static void rt2400pci_init_rxentry(struct rt2x00_dev *rt2x00dev, 620static void rt2400pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
621 struct queue_entry *entry) 621 struct queue_entry *entry)
622{ 622{
623 struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; 623 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
624 u32 word; 624 u32 word;
625 625
626 rt2x00_desc_read(priv_rx->desc, 2, &word); 626 rt2x00_desc_read(entry_priv->desc, 2, &word);
627 rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH, 627 rt2x00_set_field32(&word, RXD_W2_BUFFER_LENGTH,
628 entry->queue->data_size); 628 entry->queue->data_size);
629 rt2x00_desc_write(priv_rx->desc, 2, word); 629 rt2x00_desc_write(entry_priv->desc, 2, word);
630 630
631 rt2x00_desc_read(priv_rx->desc, 1, &word); 631 rt2x00_desc_read(entry_priv->desc, 1, &word);
632 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, priv_rx->data_dma); 632 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, entry_priv->data_dma);
633 rt2x00_desc_write(priv_rx->desc, 1, word); 633 rt2x00_desc_write(entry_priv->desc, 1, word);
634 634
635 rt2x00_desc_read(priv_rx->desc, 0, &word); 635 rt2x00_desc_read(entry_priv->desc, 0, &word);
636 rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); 636 rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
637 rt2x00_desc_write(priv_rx->desc, 0, word); 637 rt2x00_desc_write(entry_priv->desc, 0, word);
638} 638}
639 639
640static void rt2400pci_init_txentry(struct rt2x00_dev *rt2x00dev, 640static void rt2400pci_init_txentry(struct rt2x00_dev *rt2x00dev,
641 struct queue_entry *entry) 641 struct queue_entry *entry)
642{ 642{
643 struct queue_entry_priv_pci_tx *priv_tx = entry->priv_data; 643 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
644 u32 word; 644 u32 word;
645 645
646 rt2x00_desc_read(priv_tx->desc, 0, &word); 646 rt2x00_desc_read(entry_priv->desc, 0, &word);
647 rt2x00_set_field32(&word, TXD_W0_VALID, 0); 647 rt2x00_set_field32(&word, TXD_W0_VALID, 0);
648 rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); 648 rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
649 rt2x00_desc_write(priv_tx->desc, 0, word); 649 rt2x00_desc_write(entry_priv->desc, 0, word);
650} 650}
651 651
652static int rt2400pci_init_queues(struct rt2x00_dev *rt2x00dev) 652static int rt2400pci_init_queues(struct rt2x00_dev *rt2x00dev)
653{ 653{
654 struct queue_entry_priv_pci_rx *priv_rx; 654 struct queue_entry_priv_pci *entry_priv;
655 struct queue_entry_priv_pci_tx *priv_tx;
656 u32 reg; 655 u32 reg;
657 656
658 /* 657 /*
@@ -665,28 +664,28 @@ static int rt2400pci_init_queues(struct rt2x00_dev *rt2x00dev)
665 rt2x00_set_field32(&reg, TXCSR2_NUM_PRIO, rt2x00dev->tx[0].limit); 664 rt2x00_set_field32(&reg, TXCSR2_NUM_PRIO, rt2x00dev->tx[0].limit);
666 rt2x00pci_register_write(rt2x00dev, TXCSR2, reg); 665 rt2x00pci_register_write(rt2x00dev, TXCSR2, reg);
667 666
668 priv_tx = rt2x00dev->tx[1].entries[0].priv_data; 667 entry_priv = rt2x00dev->tx[1].entries[0].priv_data;
669 rt2x00pci_register_read(rt2x00dev, TXCSR3, &reg); 668 rt2x00pci_register_read(rt2x00dev, TXCSR3, &reg);
670 rt2x00_set_field32(&reg, TXCSR3_TX_RING_REGISTER, 669 rt2x00_set_field32(&reg, TXCSR3_TX_RING_REGISTER,
671 priv_tx->desc_dma); 670 entry_priv->desc_dma);
672 rt2x00pci_register_write(rt2x00dev, TXCSR3, reg); 671 rt2x00pci_register_write(rt2x00dev, TXCSR3, reg);
673 672
674 priv_tx = rt2x00dev->tx[0].entries[0].priv_data; 673 entry_priv = rt2x00dev->tx[0].entries[0].priv_data;
675 rt2x00pci_register_read(rt2x00dev, TXCSR5, &reg); 674 rt2x00pci_register_read(rt2x00dev, TXCSR5, &reg);
676 rt2x00_set_field32(&reg, TXCSR5_PRIO_RING_REGISTER, 675 rt2x00_set_field32(&reg, TXCSR5_PRIO_RING_REGISTER,
677 priv_tx->desc_dma); 676 entry_priv->desc_dma);
678 rt2x00pci_register_write(rt2x00dev, TXCSR5, reg); 677 rt2x00pci_register_write(rt2x00dev, TXCSR5, reg);
679 678
680 priv_tx = rt2x00dev->bcn[1].entries[0].priv_data; 679 entry_priv = rt2x00dev->bcn[1].entries[0].priv_data;
681 rt2x00pci_register_read(rt2x00dev, TXCSR4, &reg); 680 rt2x00pci_register_read(rt2x00dev, TXCSR4, &reg);
682 rt2x00_set_field32(&reg, TXCSR4_ATIM_RING_REGISTER, 681 rt2x00_set_field32(&reg, TXCSR4_ATIM_RING_REGISTER,
683 priv_tx->desc_dma); 682 entry_priv->desc_dma);
684 rt2x00pci_register_write(rt2x00dev, TXCSR4, reg); 683 rt2x00pci_register_write(rt2x00dev, TXCSR4, reg);
685 684
686 priv_tx = rt2x00dev->bcn[0].entries[0].priv_data; 685 entry_priv = rt2x00dev->bcn[0].entries[0].priv_data;
687 rt2x00pci_register_read(rt2x00dev, TXCSR6, &reg); 686 rt2x00pci_register_read(rt2x00dev, TXCSR6, &reg);
688 rt2x00_set_field32(&reg, TXCSR6_BEACON_RING_REGISTER, 687 rt2x00_set_field32(&reg, TXCSR6_BEACON_RING_REGISTER,
689 priv_tx->desc_dma); 688 entry_priv->desc_dma);
690 rt2x00pci_register_write(rt2x00dev, TXCSR6, reg); 689 rt2x00pci_register_write(rt2x00dev, TXCSR6, reg);
691 690
692 rt2x00pci_register_read(rt2x00dev, RXCSR1, &reg); 691 rt2x00pci_register_read(rt2x00dev, RXCSR1, &reg);
@@ -694,9 +693,10 @@ static int rt2400pci_init_queues(struct rt2x00_dev *rt2x00dev)
694 rt2x00_set_field32(&reg, RXCSR1_NUM_RXD, rt2x00dev->rx->limit); 693 rt2x00_set_field32(&reg, RXCSR1_NUM_RXD, rt2x00dev->rx->limit);
695 rt2x00pci_register_write(rt2x00dev, RXCSR1, reg); 694 rt2x00pci_register_write(rt2x00dev, RXCSR1, reg);
696 695
697 priv_rx = rt2x00dev->rx->entries[0].priv_data; 696 entry_priv = rt2x00dev->rx->entries[0].priv_data;
698 rt2x00pci_register_read(rt2x00dev, RXCSR2, &reg); 697 rt2x00pci_register_read(rt2x00dev, RXCSR2, &reg);
699 rt2x00_set_field32(&reg, RXCSR2_RX_RING_REGISTER, priv_rx->desc_dma); 698 rt2x00_set_field32(&reg, RXCSR2_RX_RING_REGISTER,
699 entry_priv->desc_dma);
700 rt2x00pci_register_write(rt2x00dev, RXCSR2, reg); 700 rt2x00pci_register_write(rt2x00dev, RXCSR2, reg);
701 701
702 return 0; 702 return 0;
@@ -995,7 +995,7 @@ static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
995 struct txentry_desc *txdesc) 995 struct txentry_desc *txdesc)
996{ 996{
997 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); 997 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
998 struct queue_entry_priv_pci_tx *entry_priv = skbdesc->entry->priv_data; 998 struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
999 __le32 *txd = skbdesc->desc; 999 __le32 *txd = skbdesc->desc;
1000 u32 word; 1000 u32 word;
1001 1001
@@ -1078,14 +1078,14 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1078static void rt2400pci_fill_rxdone(struct queue_entry *entry, 1078static void rt2400pci_fill_rxdone(struct queue_entry *entry,
1079 struct rxdone_entry_desc *rxdesc) 1079 struct rxdone_entry_desc *rxdesc)
1080{ 1080{
1081 struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; 1081 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
1082 u32 word0; 1082 u32 word0;
1083 u32 word2; 1083 u32 word2;
1084 u32 word3; 1084 u32 word3;
1085 1085
1086 rt2x00_desc_read(priv_rx->desc, 0, &word0); 1086 rt2x00_desc_read(entry_priv->desc, 0, &word0);
1087 rt2x00_desc_read(priv_rx->desc, 2, &word2); 1087 rt2x00_desc_read(entry_priv->desc, 2, &word2);
1088 rt2x00_desc_read(priv_rx->desc, 3, &word3); 1088 rt2x00_desc_read(entry_priv->desc, 3, &word3);
1089 1089
1090 if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) 1090 if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
1091 rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; 1091 rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
@@ -1114,15 +1114,15 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
1114 const enum data_queue_qid queue_idx) 1114 const enum data_queue_qid queue_idx)
1115{ 1115{
1116 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); 1116 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
1117 struct queue_entry_priv_pci_tx *priv_tx; 1117 struct queue_entry_priv_pci *entry_priv;
1118 struct queue_entry *entry; 1118 struct queue_entry *entry;
1119 struct txdone_entry_desc txdesc; 1119 struct txdone_entry_desc txdesc;
1120 u32 word; 1120 u32 word;
1121 1121
1122 while (!rt2x00queue_empty(queue)) { 1122 while (!rt2x00queue_empty(queue)) {
1123 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); 1123 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
1124 priv_tx = entry->priv_data; 1124 entry_priv = entry->priv_data;
1125 rt2x00_desc_read(priv_tx->desc, 0, &word); 1125 rt2x00_desc_read(entry_priv->desc, 0, &word);
1126 1126
1127 if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || 1127 if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
1128 !rt2x00_get_field32(word, TXD_W0_VALID)) 1128 !rt2x00_get_field32(word, TXD_W0_VALID))
@@ -1489,14 +1489,14 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1489{ 1489{
1490 struct rt2x00_dev *rt2x00dev = hw->priv; 1490 struct rt2x00_dev *rt2x00dev = hw->priv;
1491 struct rt2x00_intf *intf = vif_to_intf(control->vif); 1491 struct rt2x00_intf *intf = vif_to_intf(control->vif);
1492 struct queue_entry_priv_pci_tx *priv_tx; 1492 struct queue_entry_priv_pci *entry_priv;
1493 struct skb_frame_desc *skbdesc; 1493 struct skb_frame_desc *skbdesc;
1494 struct txentry_desc txdesc; 1494 struct txentry_desc txdesc;
1495 u32 reg; 1495 u32 reg;
1496 1496
1497 if (unlikely(!intf->beacon)) 1497 if (unlikely(!intf->beacon))
1498 return -ENOBUFS; 1498 return -ENOBUFS;
1499 priv_tx = intf->beacon->priv_data; 1499 entry_priv = intf->beacon->priv_data;
1500 1500
1501 /* 1501 /*
1502 * Copy all TX descriptor information into txdesc, 1502 * Copy all TX descriptor information into txdesc,
@@ -1514,7 +1514,7 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1514 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; 1514 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED;
1515 skbdesc->data = skb->data; 1515 skbdesc->data = skb->data;
1516 skbdesc->data_len = skb->len; 1516 skbdesc->data_len = skb->len;
1517 skbdesc->desc = priv_tx->desc; 1517 skbdesc->desc = entry_priv->desc;
1518 skbdesc->desc_len = intf->beacon->queue->desc_size; 1518 skbdesc->desc_len = intf->beacon->queue->desc_size;
1519 skbdesc->entry = intf->beacon; 1519 skbdesc->entry = intf->beacon;
1520 1520
@@ -1533,7 +1533,7 @@ static int rt2400pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1533 * Write entire beacon with descriptor to register, 1533 * Write entire beacon with descriptor to register,
1534 * and kick the beacon generator. 1534 * and kick the beacon generator.
1535 */ 1535 */
1536 memcpy(priv_tx->data, skb->data, skb->len); 1536 memcpy(entry_priv->data, skb->data, skb->len);
1537 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc); 1537 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc);
1538 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON); 1538 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
1539 1539
@@ -1594,28 +1594,28 @@ static const struct data_queue_desc rt2400pci_queue_rx = {
1594 .entry_num = RX_ENTRIES, 1594 .entry_num = RX_ENTRIES,
1595 .data_size = DATA_FRAME_SIZE, 1595 .data_size = DATA_FRAME_SIZE,
1596 .desc_size = RXD_DESC_SIZE, 1596 .desc_size = RXD_DESC_SIZE,
1597 .priv_size = sizeof(struct queue_entry_priv_pci_rx), 1597 .priv_size = sizeof(struct queue_entry_priv_pci),
1598}; 1598};
1599 1599
1600static const struct data_queue_desc rt2400pci_queue_tx = { 1600static const struct data_queue_desc rt2400pci_queue_tx = {
1601 .entry_num = TX_ENTRIES, 1601 .entry_num = TX_ENTRIES,
1602 .data_size = DATA_FRAME_SIZE, 1602 .data_size = DATA_FRAME_SIZE,
1603 .desc_size = TXD_DESC_SIZE, 1603 .desc_size = TXD_DESC_SIZE,
1604 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 1604 .priv_size = sizeof(struct queue_entry_priv_pci),
1605}; 1605};
1606 1606
1607static const struct data_queue_desc rt2400pci_queue_bcn = { 1607static const struct data_queue_desc rt2400pci_queue_bcn = {
1608 .entry_num = BEACON_ENTRIES, 1608 .entry_num = BEACON_ENTRIES,
1609 .data_size = MGMT_FRAME_SIZE, 1609 .data_size = MGMT_FRAME_SIZE,
1610 .desc_size = TXD_DESC_SIZE, 1610 .desc_size = TXD_DESC_SIZE,
1611 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 1611 .priv_size = sizeof(struct queue_entry_priv_pci),
1612}; 1612};
1613 1613
1614static const struct data_queue_desc rt2400pci_queue_atim = { 1614static const struct data_queue_desc rt2400pci_queue_atim = {
1615 .entry_num = ATIM_ENTRIES, 1615 .entry_num = ATIM_ENTRIES,
1616 .data_size = DATA_FRAME_SIZE, 1616 .data_size = DATA_FRAME_SIZE,
1617 .desc_size = TXD_DESC_SIZE, 1617 .desc_size = TXD_DESC_SIZE,
1618 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 1618 .priv_size = sizeof(struct queue_entry_priv_pci),
1619}; 1619};
1620 1620
1621static const struct rt2x00_ops rt2400pci_ops = { 1621static const struct rt2x00_ops rt2400pci_ops = {
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 805781306dd1..06e87cdff455 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -715,34 +715,33 @@ dynamic_cca_tune:
715static void rt2500pci_init_rxentry(struct rt2x00_dev *rt2x00dev, 715static void rt2500pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
716 struct queue_entry *entry) 716 struct queue_entry *entry)
717{ 717{
718 struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; 718 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
719 u32 word; 719 u32 word;
720 720
721 rt2x00_desc_read(priv_rx->desc, 1, &word); 721 rt2x00_desc_read(entry_priv->desc, 1, &word);
722 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, priv_rx->data_dma); 722 rt2x00_set_field32(&word, RXD_W1_BUFFER_ADDRESS, entry_priv->data_dma);
723 rt2x00_desc_write(priv_rx->desc, 1, word); 723 rt2x00_desc_write(entry_priv->desc, 1, word);
724 724
725 rt2x00_desc_read(priv_rx->desc, 0, &word); 725 rt2x00_desc_read(entry_priv->desc, 0, &word);
726 rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); 726 rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
727 rt2x00_desc_write(priv_rx->desc, 0, word); 727 rt2x00_desc_write(entry_priv->desc, 0, word);
728} 728}
729 729
730static void rt2500pci_init_txentry(struct rt2x00_dev *rt2x00dev, 730static void rt2500pci_init_txentry(struct rt2x00_dev *rt2x00dev,
731 struct queue_entry *entry) 731 struct queue_entry *entry)
732{ 732{
733 struct queue_entry_priv_pci_tx *priv_tx = entry->priv_data; 733 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
734 u32 word; 734 u32 word;
735 735
736 rt2x00_desc_read(priv_tx->desc, 0, &word); 736 rt2x00_desc_read(entry_priv->desc, 0, &word);
737 rt2x00_set_field32(&word, TXD_W0_VALID, 0); 737 rt2x00_set_field32(&word, TXD_W0_VALID, 0);
738 rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); 738 rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
739 rt2x00_desc_write(priv_tx->desc, 0, word); 739 rt2x00_desc_write(entry_priv->desc, 0, word);
740} 740}
741 741
742static int rt2500pci_init_queues(struct rt2x00_dev *rt2x00dev) 742static int rt2500pci_init_queues(struct rt2x00_dev *rt2x00dev)
743{ 743{
744 struct queue_entry_priv_pci_rx *priv_rx; 744 struct queue_entry_priv_pci *entry_priv;
745 struct queue_entry_priv_pci_tx *priv_tx;
746 u32 reg; 745 u32 reg;
747 746
748 /* 747 /*
@@ -755,28 +754,28 @@ static int rt2500pci_init_queues(struct rt2x00_dev *rt2x00dev)
755 rt2x00_set_field32(&reg, TXCSR2_NUM_PRIO, rt2x00dev->tx[0].limit); 754 rt2x00_set_field32(&reg, TXCSR2_NUM_PRIO, rt2x00dev->tx[0].limit);
756 rt2x00pci_register_write(rt2x00dev, TXCSR2, reg); 755 rt2x00pci_register_write(rt2x00dev, TXCSR2, reg);
757 756
758 priv_tx = rt2x00dev->tx[1].entries[0].priv_data; 757 entry_priv = rt2x00dev->tx[1].entries[0].priv_data;
759 rt2x00pci_register_read(rt2x00dev, TXCSR3, &reg); 758 rt2x00pci_register_read(rt2x00dev, TXCSR3, &reg);
760 rt2x00_set_field32(&reg, TXCSR3_TX_RING_REGISTER, 759 rt2x00_set_field32(&reg, TXCSR3_TX_RING_REGISTER,
761 priv_tx->desc_dma); 760 entry_priv->desc_dma);
762 rt2x00pci_register_write(rt2x00dev, TXCSR3, reg); 761 rt2x00pci_register_write(rt2x00dev, TXCSR3, reg);
763 762
764 priv_tx = rt2x00dev->tx[0].entries[0].priv_data; 763 entry_priv = rt2x00dev->tx[0].entries[0].priv_data;
765 rt2x00pci_register_read(rt2x00dev, TXCSR5, &reg); 764 rt2x00pci_register_read(rt2x00dev, TXCSR5, &reg);
766 rt2x00_set_field32(&reg, TXCSR5_PRIO_RING_REGISTER, 765 rt2x00_set_field32(&reg, TXCSR5_PRIO_RING_REGISTER,
767 priv_tx->desc_dma); 766 entry_priv->desc_dma);
768 rt2x00pci_register_write(rt2x00dev, TXCSR5, reg); 767 rt2x00pci_register_write(rt2x00dev, TXCSR5, reg);
769 768
770 priv_tx = rt2x00dev->bcn[1].entries[0].priv_data; 769 entry_priv = rt2x00dev->bcn[1].entries[0].priv_data;
771 rt2x00pci_register_read(rt2x00dev, TXCSR4, &reg); 770 rt2x00pci_register_read(rt2x00dev, TXCSR4, &reg);
772 rt2x00_set_field32(&reg, TXCSR4_ATIM_RING_REGISTER, 771 rt2x00_set_field32(&reg, TXCSR4_ATIM_RING_REGISTER,
773 priv_tx->desc_dma); 772 entry_priv->desc_dma);
774 rt2x00pci_register_write(rt2x00dev, TXCSR4, reg); 773 rt2x00pci_register_write(rt2x00dev, TXCSR4, reg);
775 774
776 priv_tx = rt2x00dev->bcn[0].entries[0].priv_data; 775 entry_priv = rt2x00dev->bcn[0].entries[0].priv_data;
777 rt2x00pci_register_read(rt2x00dev, TXCSR6, &reg); 776 rt2x00pci_register_read(rt2x00dev, TXCSR6, &reg);
778 rt2x00_set_field32(&reg, TXCSR6_BEACON_RING_REGISTER, 777 rt2x00_set_field32(&reg, TXCSR6_BEACON_RING_REGISTER,
779 priv_tx->desc_dma); 778 entry_priv->desc_dma);
780 rt2x00pci_register_write(rt2x00dev, TXCSR6, reg); 779 rt2x00pci_register_write(rt2x00dev, TXCSR6, reg);
781 780
782 rt2x00pci_register_read(rt2x00dev, RXCSR1, &reg); 781 rt2x00pci_register_read(rt2x00dev, RXCSR1, &reg);
@@ -784,9 +783,10 @@ static int rt2500pci_init_queues(struct rt2x00_dev *rt2x00dev)
784 rt2x00_set_field32(&reg, RXCSR1_NUM_RXD, rt2x00dev->rx->limit); 783 rt2x00_set_field32(&reg, RXCSR1_NUM_RXD, rt2x00dev->rx->limit);
785 rt2x00pci_register_write(rt2x00dev, RXCSR1, reg); 784 rt2x00pci_register_write(rt2x00dev, RXCSR1, reg);
786 785
787 priv_rx = rt2x00dev->rx->entries[0].priv_data; 786 entry_priv = rt2x00dev->rx->entries[0].priv_data;
788 rt2x00pci_register_read(rt2x00dev, RXCSR2, &reg); 787 rt2x00pci_register_read(rt2x00dev, RXCSR2, &reg);
789 rt2x00_set_field32(&reg, RXCSR2_RX_RING_REGISTER, priv_rx->desc_dma); 788 rt2x00_set_field32(&reg, RXCSR2_RX_RING_REGISTER,
789 entry_priv->desc_dma);
790 rt2x00pci_register_write(rt2x00dev, RXCSR2, reg); 790 rt2x00pci_register_write(rt2x00dev, RXCSR2, reg);
791 791
792 return 0; 792 return 0;
@@ -1154,7 +1154,7 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1154 struct txentry_desc *txdesc) 1154 struct txentry_desc *txdesc)
1155{ 1155{
1156 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); 1156 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
1157 struct queue_entry_priv_pci_tx *entry_priv = skbdesc->entry->priv_data; 1157 struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
1158 __le32 *txd = skbdesc->desc; 1158 __le32 *txd = skbdesc->desc;
1159 u32 word; 1159 u32 word;
1160 1160
@@ -1235,12 +1235,12 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1235static void rt2500pci_fill_rxdone(struct queue_entry *entry, 1235static void rt2500pci_fill_rxdone(struct queue_entry *entry,
1236 struct rxdone_entry_desc *rxdesc) 1236 struct rxdone_entry_desc *rxdesc)
1237{ 1237{
1238 struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; 1238 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
1239 u32 word0; 1239 u32 word0;
1240 u32 word2; 1240 u32 word2;
1241 1241
1242 rt2x00_desc_read(priv_rx->desc, 0, &word0); 1242 rt2x00_desc_read(entry_priv->desc, 0, &word0);
1243 rt2x00_desc_read(priv_rx->desc, 2, &word2); 1243 rt2x00_desc_read(entry_priv->desc, 2, &word2);
1244 1244
1245 if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) 1245 if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
1246 rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; 1246 rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
@@ -1271,15 +1271,15 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
1271 const enum data_queue_qid queue_idx) 1271 const enum data_queue_qid queue_idx)
1272{ 1272{
1273 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); 1273 struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
1274 struct queue_entry_priv_pci_tx *priv_tx; 1274 struct queue_entry_priv_pci *entry_priv;
1275 struct queue_entry *entry; 1275 struct queue_entry *entry;
1276 struct txdone_entry_desc txdesc; 1276 struct txdone_entry_desc txdesc;
1277 u32 word; 1277 u32 word;
1278 1278
1279 while (!rt2x00queue_empty(queue)) { 1279 while (!rt2x00queue_empty(queue)) {
1280 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); 1280 entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE);
1281 priv_tx = entry->priv_data; 1281 entry_priv = entry->priv_data;
1282 rt2x00_desc_read(priv_tx->desc, 0, &word); 1282 rt2x00_desc_read(entry_priv->desc, 0, &word);
1283 1283
1284 if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || 1284 if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
1285 !rt2x00_get_field32(word, TXD_W0_VALID)) 1285 !rt2x00_get_field32(word, TXD_W0_VALID))
@@ -1804,7 +1804,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1804{ 1804{
1805 struct rt2x00_dev *rt2x00dev = hw->priv; 1805 struct rt2x00_dev *rt2x00dev = hw->priv;
1806 struct rt2x00_intf *intf = vif_to_intf(control->vif); 1806 struct rt2x00_intf *intf = vif_to_intf(control->vif);
1807 struct queue_entry_priv_pci_tx *priv_tx; 1807 struct queue_entry_priv_pci *entry_priv;
1808 struct skb_frame_desc *skbdesc; 1808 struct skb_frame_desc *skbdesc;
1809 struct txentry_desc txdesc; 1809 struct txentry_desc txdesc;
1810 u32 reg; 1810 u32 reg;
@@ -1812,7 +1812,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1812 if (unlikely(!intf->beacon)) 1812 if (unlikely(!intf->beacon))
1813 return -ENOBUFS; 1813 return -ENOBUFS;
1814 1814
1815 priv_tx = intf->beacon->priv_data; 1815 entry_priv = intf->beacon->priv_data;
1816 1816
1817 /* 1817 /*
1818 * Copy all TX descriptor information into txdesc, 1818 * Copy all TX descriptor information into txdesc,
@@ -1830,7 +1830,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1830 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; 1830 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED;
1831 skbdesc->data = skb->data; 1831 skbdesc->data = skb->data;
1832 skbdesc->data_len = skb->len; 1832 skbdesc->data_len = skb->len;
1833 skbdesc->desc = priv_tx->desc; 1833 skbdesc->desc = entry_priv->desc;
1834 skbdesc->desc_len = intf->beacon->queue->desc_size; 1834 skbdesc->desc_len = intf->beacon->queue->desc_size;
1835 skbdesc->entry = intf->beacon; 1835 skbdesc->entry = intf->beacon;
1836 1836
@@ -1849,7 +1849,7 @@ static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1849 * Write entire beacon with descriptor to register, 1849 * Write entire beacon with descriptor to register,
1850 * and kick the beacon generator. 1850 * and kick the beacon generator.
1851 */ 1851 */
1852 memcpy(priv_tx->data, skb->data, skb->len); 1852 memcpy(entry_priv->data, skb->data, skb->len);
1853 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc); 1853 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc);
1854 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON); 1854 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
1855 1855
@@ -1910,28 +1910,28 @@ static const struct data_queue_desc rt2500pci_queue_rx = {
1910 .entry_num = RX_ENTRIES, 1910 .entry_num = RX_ENTRIES,
1911 .data_size = DATA_FRAME_SIZE, 1911 .data_size = DATA_FRAME_SIZE,
1912 .desc_size = RXD_DESC_SIZE, 1912 .desc_size = RXD_DESC_SIZE,
1913 .priv_size = sizeof(struct queue_entry_priv_pci_rx), 1913 .priv_size = sizeof(struct queue_entry_priv_pci),
1914}; 1914};
1915 1915
1916static const struct data_queue_desc rt2500pci_queue_tx = { 1916static const struct data_queue_desc rt2500pci_queue_tx = {
1917 .entry_num = TX_ENTRIES, 1917 .entry_num = TX_ENTRIES,
1918 .data_size = DATA_FRAME_SIZE, 1918 .data_size = DATA_FRAME_SIZE,
1919 .desc_size = TXD_DESC_SIZE, 1919 .desc_size = TXD_DESC_SIZE,
1920 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 1920 .priv_size = sizeof(struct queue_entry_priv_pci),
1921}; 1921};
1922 1922
1923static const struct data_queue_desc rt2500pci_queue_bcn = { 1923static const struct data_queue_desc rt2500pci_queue_bcn = {
1924 .entry_num = BEACON_ENTRIES, 1924 .entry_num = BEACON_ENTRIES,
1925 .data_size = MGMT_FRAME_SIZE, 1925 .data_size = MGMT_FRAME_SIZE,
1926 .desc_size = TXD_DESC_SIZE, 1926 .desc_size = TXD_DESC_SIZE,
1927 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 1927 .priv_size = sizeof(struct queue_entry_priv_pci),
1928}; 1928};
1929 1929
1930static const struct data_queue_desc rt2500pci_queue_atim = { 1930static const struct data_queue_desc rt2500pci_queue_atim = {
1931 .entry_num = ATIM_ENTRIES, 1931 .entry_num = ATIM_ENTRIES,
1932 .data_size = DATA_FRAME_SIZE, 1932 .data_size = DATA_FRAME_SIZE,
1933 .desc_size = TXD_DESC_SIZE, 1933 .desc_size = TXD_DESC_SIZE,
1934 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 1934 .priv_size = sizeof(struct queue_entry_priv_pci),
1935}; 1935};
1936 1936
1937static const struct rt2x00_ops rt2500pci_ops = { 1937static const struct rt2x00_ops rt2500pci_ops = {
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 0bf9ab3da5e6..4122c5ebe7c3 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1124,11 +1124,12 @@ static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1124static void rt2500usb_fill_rxdone(struct queue_entry *entry, 1124static void rt2500usb_fill_rxdone(struct queue_entry *entry,
1125 struct rxdone_entry_desc *rxdesc) 1125 struct rxdone_entry_desc *rxdesc)
1126{ 1126{
1127 struct queue_entry_priv_usb_rx *priv_rx = entry->priv_data; 1127 struct queue_entry_priv_usb *entry_priv = entry->priv_data;
1128 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); 1128 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
1129 __le32 *rxd = 1129 __le32 *rxd =
1130 (__le32 *)(entry->skb->data + 1130 (__le32 *)(entry->skb->data +
1131 (priv_rx->urb->actual_length - entry->queue->desc_size)); 1131 (entry_priv->urb->actual_length -
1132 entry->queue->desc_size));
1132 u32 word0; 1133 u32 word0;
1133 u32 word1; 1134 u32 word1;
1134 1135
@@ -1184,7 +1185,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,
1184static void rt2500usb_beacondone(struct urb *urb) 1185static void rt2500usb_beacondone(struct urb *urb)
1185{ 1186{
1186 struct queue_entry *entry = (struct queue_entry *)urb->context; 1187 struct queue_entry *entry = (struct queue_entry *)urb->context;
1187 struct queue_entry_priv_usb_bcn *priv_bcn = entry->priv_data; 1188 struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data;
1188 1189
1189 if (!test_bit(DEVICE_ENABLED_RADIO, &entry->queue->rt2x00dev->flags)) 1190 if (!test_bit(DEVICE_ENABLED_RADIO, &entry->queue->rt2x00dev->flags))
1190 return; 1191 return;
@@ -1195,9 +1196,9 @@ static void rt2500usb_beacondone(struct urb *urb)
1195 * Otherwise we should free the sk_buffer, the device 1196 * Otherwise we should free the sk_buffer, the device
1196 * should be doing the rest of the work now. 1197 * should be doing the rest of the work now.
1197 */ 1198 */
1198 if (priv_bcn->guardian_urb == urb) { 1199 if (bcn_priv->guardian_urb == urb) {
1199 usb_submit_urb(priv_bcn->urb, GFP_ATOMIC); 1200 usb_submit_urb(bcn_priv->urb, GFP_ATOMIC);
1200 } else if (priv_bcn->urb == urb) { 1201 } else if (bcn_priv->urb == urb) {
1201 dev_kfree_skb(entry->skb); 1202 dev_kfree_skb(entry->skb);
1202 entry->skb = NULL; 1203 entry->skb = NULL;
1203 } 1204 }
@@ -1672,7 +1673,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1672 struct rt2x00_dev *rt2x00dev = hw->priv; 1673 struct rt2x00_dev *rt2x00dev = hw->priv;
1673 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); 1674 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev);
1674 struct rt2x00_intf *intf = vif_to_intf(control->vif); 1675 struct rt2x00_intf *intf = vif_to_intf(control->vif);
1675 struct queue_entry_priv_usb_bcn *priv_bcn; 1676 struct queue_entry_priv_usb_bcn *bcn_priv;
1676 struct skb_frame_desc *skbdesc; 1677 struct skb_frame_desc *skbdesc;
1677 struct txentry_desc txdesc; 1678 struct txentry_desc txdesc;
1678 int pipe = usb_sndbulkpipe(usb_dev, 1); 1679 int pipe = usb_sndbulkpipe(usb_dev, 1);
@@ -1682,7 +1683,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1682 if (unlikely(!intf->beacon)) 1683 if (unlikely(!intf->beacon))
1683 return -ENOBUFS; 1684 return -ENOBUFS;
1684 1685
1685 priv_bcn = intf->beacon->priv_data; 1686 bcn_priv = intf->beacon->priv_data;
1686 1687
1687 /* 1688 /*
1688 * Copy all TX descriptor information into txdesc, 1689 * Copy all TX descriptor information into txdesc,
@@ -1729,7 +1730,7 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1729 */ 1730 */
1730 length = rt2500usb_get_tx_data_len(rt2x00dev, skb); 1731 length = rt2500usb_get_tx_data_len(rt2x00dev, skb);
1731 1732
1732 usb_fill_bulk_urb(priv_bcn->urb, usb_dev, pipe, 1733 usb_fill_bulk_urb(bcn_priv->urb, usb_dev, pipe,
1733 skb->data, length, rt2500usb_beacondone, 1734 skb->data, length, rt2500usb_beacondone,
1734 intf->beacon); 1735 intf->beacon);
1735 1736
@@ -1738,15 +1739,15 @@ static int rt2500usb_beacon_update(struct ieee80211_hw *hw,
1738 * We only need a single byte, so lets recycle 1739 * We only need a single byte, so lets recycle
1739 * the 'flags' field we are not using for beacons. 1740 * the 'flags' field we are not using for beacons.
1740 */ 1741 */
1741 priv_bcn->guardian_data = 0; 1742 bcn_priv->guardian_data = 0;
1742 usb_fill_bulk_urb(priv_bcn->guardian_urb, usb_dev, pipe, 1743 usb_fill_bulk_urb(bcn_priv->guardian_urb, usb_dev, pipe,
1743 &priv_bcn->guardian_data, 1, rt2500usb_beacondone, 1744 &bcn_priv->guardian_data, 1, rt2500usb_beacondone,
1744 intf->beacon); 1745 intf->beacon);
1745 1746
1746 /* 1747 /*
1747 * Send out the guardian byte. 1748 * Send out the guardian byte.
1748 */ 1749 */
1749 usb_submit_urb(priv_bcn->guardian_urb, GFP_ATOMIC); 1750 usb_submit_urb(bcn_priv->guardian_urb, GFP_ATOMIC);
1750 1751
1751 /* 1752 /*
1752 * Enable beacon generation. 1753 * Enable beacon generation.
@@ -1797,14 +1798,14 @@ static const struct data_queue_desc rt2500usb_queue_rx = {
1797 .entry_num = RX_ENTRIES, 1798 .entry_num = RX_ENTRIES,
1798 .data_size = DATA_FRAME_SIZE, 1799 .data_size = DATA_FRAME_SIZE,
1799 .desc_size = RXD_DESC_SIZE, 1800 .desc_size = RXD_DESC_SIZE,
1800 .priv_size = sizeof(struct queue_entry_priv_usb_rx), 1801 .priv_size = sizeof(struct queue_entry_priv_usb),
1801}; 1802};
1802 1803
1803static const struct data_queue_desc rt2500usb_queue_tx = { 1804static const struct data_queue_desc rt2500usb_queue_tx = {
1804 .entry_num = TX_ENTRIES, 1805 .entry_num = TX_ENTRIES,
1805 .data_size = DATA_FRAME_SIZE, 1806 .data_size = DATA_FRAME_SIZE,
1806 .desc_size = TXD_DESC_SIZE, 1807 .desc_size = TXD_DESC_SIZE,
1807 .priv_size = sizeof(struct queue_entry_priv_usb_tx), 1808 .priv_size = sizeof(struct queue_entry_priv_usb),
1808}; 1809};
1809 1810
1810static const struct data_queue_desc rt2500usb_queue_bcn = { 1811static const struct data_queue_desc rt2500usb_queue_bcn = {
@@ -1818,7 +1819,7 @@ static const struct data_queue_desc rt2500usb_queue_atim = {
1818 .entry_num = ATIM_ENTRIES, 1819 .entry_num = ATIM_ENTRIES,
1819 .data_size = DATA_FRAME_SIZE, 1820 .data_size = DATA_FRAME_SIZE,
1820 .desc_size = TXD_DESC_SIZE, 1821 .desc_size = TXD_DESC_SIZE,
1821 .priv_size = sizeof(struct queue_entry_priv_usb_tx), 1822 .priv_size = sizeof(struct queue_entry_priv_usb),
1822}; 1823};
1823 1824
1824static const struct rt2x00_ops rt2500usb_ops = { 1825static const struct rt2x00_ops rt2500usb_ops = {
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index a056b12fbd1c..fa7de41be049 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -39,7 +39,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
39 struct ieee80211_tx_control *control) 39 struct ieee80211_tx_control *control)
40{ 40{
41 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); 41 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX);
42 struct queue_entry_priv_pci_tx *priv_tx = entry->priv_data; 42 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
43 struct skb_frame_desc *skbdesc; 43 struct skb_frame_desc *skbdesc;
44 struct txentry_desc txdesc; 44 struct txentry_desc txdesc;
45 u32 word; 45 u32 word;
@@ -47,7 +47,7 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
47 if (rt2x00queue_full(queue)) 47 if (rt2x00queue_full(queue))
48 return -EINVAL; 48 return -EINVAL;
49 49
50 rt2x00_desc_read(priv_tx->desc, 0, &word); 50 rt2x00_desc_read(entry_priv->desc, 0, &word);
51 51
52 if (rt2x00_get_field32(word, TXD_ENTRY_OWNER_NIC) || 52 if (rt2x00_get_field32(word, TXD_ENTRY_OWNER_NIC) ||
53 rt2x00_get_field32(word, TXD_ENTRY_VALID)) { 53 rt2x00_get_field32(word, TXD_ENTRY_VALID)) {
@@ -72,12 +72,12 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
72 skbdesc = get_skb_frame_desc(skb); 72 skbdesc = get_skb_frame_desc(skb);
73 skbdesc->data = skb->data; 73 skbdesc->data = skb->data;
74 skbdesc->data_len = skb->len; 74 skbdesc->data_len = skb->len;
75 skbdesc->desc = priv_tx->desc; 75 skbdesc->desc = entry_priv->desc;
76 skbdesc->desc_len = queue->desc_size; 76 skbdesc->desc_len = queue->desc_size;
77 skbdesc->entry = entry; 77 skbdesc->entry = entry;
78 78
79 memcpy(&priv_tx->control, control, sizeof(priv_tx->control)); 79 memcpy(&entry_priv->control, control, sizeof(entry_priv->control));
80 memcpy(priv_tx->data, skb->data, skb->len); 80 memcpy(entry_priv->data, skb->data, skb->len);
81 81
82 rt2x00queue_write_tx_descriptor(entry, &txdesc); 82 rt2x00queue_write_tx_descriptor(entry, &txdesc);
83 rt2x00queue_index_inc(queue, Q_INDEX); 83 rt2x00queue_index_inc(queue, Q_INDEX);
@@ -93,7 +93,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
93{ 93{
94 struct data_queue *queue = rt2x00dev->rx; 94 struct data_queue *queue = rt2x00dev->rx;
95 struct queue_entry *entry; 95 struct queue_entry *entry;
96 struct queue_entry_priv_pci_rx *priv_rx; 96 struct queue_entry_priv_pci *entry_priv;
97 struct ieee80211_hdr *hdr; 97 struct ieee80211_hdr *hdr;
98 struct skb_frame_desc *skbdesc; 98 struct skb_frame_desc *skbdesc;
99 struct rxdone_entry_desc rxdesc; 99 struct rxdone_entry_desc rxdesc;
@@ -103,8 +103,8 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
103 103
104 while (1) { 104 while (1) {
105 entry = rt2x00queue_get_entry(queue, Q_INDEX); 105 entry = rt2x00queue_get_entry(queue, Q_INDEX);
106 priv_rx = entry->priv_data; 106 entry_priv = entry->priv_data;
107 rt2x00_desc_read(priv_rx->desc, 0, &word); 107 rt2x00_desc_read(entry_priv->desc, 0, &word);
108 108
109 if (rt2x00_get_field32(word, RXD_ENTRY_OWNER_NIC)) 109 if (rt2x00_get_field32(word, RXD_ENTRY_OWNER_NIC))
110 break; 110 break;
@@ -112,7 +112,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
112 memset(&rxdesc, 0, sizeof(rxdesc)); 112 memset(&rxdesc, 0, sizeof(rxdesc));
113 rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc); 113 rt2x00dev->ops->lib->fill_rxdone(entry, &rxdesc);
114 114
115 hdr = (struct ieee80211_hdr *)priv_rx->data; 115 hdr = (struct ieee80211_hdr *)entry_priv->data;
116 header_size = 116 header_size =
117 ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control)); 117 ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
118 118
@@ -132,7 +132,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
132 132
133 skb_reserve(entry->skb, align); 133 skb_reserve(entry->skb, align);
134 memcpy(skb_put(entry->skb, rxdesc.size), 134 memcpy(skb_put(entry->skb, rxdesc.size),
135 priv_rx->data, rxdesc.size); 135 entry_priv->data, rxdesc.size);
136 136
137 /* 137 /*
138 * Fill in skb descriptor 138 * Fill in skb descriptor
@@ -141,7 +141,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
141 memset(skbdesc, 0, sizeof(*skbdesc)); 141 memset(skbdesc, 0, sizeof(*skbdesc));
142 skbdesc->data = entry->skb->data; 142 skbdesc->data = entry->skb->data;
143 skbdesc->data_len = entry->skb->len; 143 skbdesc->data_len = entry->skb->len;
144 skbdesc->desc = priv_rx->desc; 144 skbdesc->desc = entry_priv->desc;
145 skbdesc->desc_len = queue->desc_size; 145 skbdesc->desc_len = queue->desc_size;
146 skbdesc->entry = entry; 146 skbdesc->entry = entry;
147 147
@@ -152,7 +152,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
152 152
153 if (test_bit(DEVICE_ENABLED_RADIO, &queue->rt2x00dev->flags)) { 153 if (test_bit(DEVICE_ENABLED_RADIO, &queue->rt2x00dev->flags)) {
154 rt2x00_set_field32(&word, RXD_ENTRY_OWNER_NIC, 1); 154 rt2x00_set_field32(&word, RXD_ENTRY_OWNER_NIC, 1);
155 rt2x00_desc_write(priv_rx->desc, 0, word); 155 rt2x00_desc_write(entry_priv->desc, 0, word);
156 } 156 }
157 157
158 rt2x00queue_index_inc(queue, Q_INDEX); 158 rt2x00queue_index_inc(queue, Q_INDEX);
@@ -163,10 +163,10 @@ EXPORT_SYMBOL_GPL(rt2x00pci_rxdone);
163void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry, 163void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry,
164 struct txdone_entry_desc *txdesc) 164 struct txdone_entry_desc *txdesc)
165{ 165{
166 struct queue_entry_priv_pci_tx *priv_tx = entry->priv_data; 166 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
167 u32 word; 167 u32 word;
168 168
169 txdesc->control = &priv_tx->control; 169 txdesc->control = &entry_priv->control;
170 rt2x00lib_txdone(entry, txdesc); 170 rt2x00lib_txdone(entry, txdesc);
171 171
172 /* 172 /*
@@ -174,10 +174,10 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry,
174 */ 174 */
175 entry->flags = 0; 175 entry->flags = 0;
176 176
177 rt2x00_desc_read(priv_tx->desc, 0, &word); 177 rt2x00_desc_read(entry_priv->desc, 0, &word);
178 rt2x00_set_field32(&word, TXD_ENTRY_OWNER_NIC, 0); 178 rt2x00_set_field32(&word, TXD_ENTRY_OWNER_NIC, 0);
179 rt2x00_set_field32(&word, TXD_ENTRY_VALID, 0); 179 rt2x00_set_field32(&word, TXD_ENTRY_VALID, 0);
180 rt2x00_desc_write(priv_tx->desc, 0, word); 180 rt2x00_desc_write(entry_priv->desc, 0, word);
181 181
182 rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE); 182 rt2x00queue_index_inc(entry->queue, Q_INDEX_DONE);
183 183
@@ -187,7 +187,7 @@ void rt2x00pci_txdone(struct rt2x00_dev *rt2x00dev, struct queue_entry *entry,
187 * is reenabled when the txdone handler has finished. 187 * is reenabled when the txdone handler has finished.
188 */ 188 */
189 if (!rt2x00queue_full(entry->queue)) 189 if (!rt2x00queue_full(entry->queue))
190 ieee80211_wake_queue(rt2x00dev->hw, priv_tx->control.queue); 190 ieee80211_wake_queue(rt2x00dev->hw, entry_priv->control.queue);
191 191
192} 192}
193EXPORT_SYMBOL_GPL(rt2x00pci_txdone); 193EXPORT_SYMBOL_GPL(rt2x00pci_txdone);
@@ -226,14 +226,9 @@ static int rt2x00pci_alloc_queue_dma(struct rt2x00_dev *rt2x00dev,
226 struct data_queue *queue) 226 struct data_queue *queue)
227{ 227{
228 struct pci_dev *pci_dev = rt2x00dev_pci(rt2x00dev); 228 struct pci_dev *pci_dev = rt2x00dev_pci(rt2x00dev);
229 struct queue_entry_priv_pci_rx *priv_rx; 229 struct queue_entry_priv_pci *entry_priv;
230 struct queue_entry_priv_pci_tx *priv_tx;
231 void *addr; 230 void *addr;
232 dma_addr_t dma; 231 dma_addr_t dma;
233 void *desc_addr;
234 dma_addr_t desc_dma;
235 void *data_addr;
236 dma_addr_t data_dma;
237 unsigned int i; 232 unsigned int i;
238 233
239 /* 234 /*
@@ -249,24 +244,11 @@ static int rt2x00pci_alloc_queue_dma(struct rt2x00_dev *rt2x00dev,
249 * Initialize all queue entries to contain valid addresses. 244 * Initialize all queue entries to contain valid addresses.
250 */ 245 */
251 for (i = 0; i < queue->limit; i++) { 246 for (i = 0; i < queue->limit; i++) {
252 desc_addr = desc_offset(queue, addr, i); 247 entry_priv = queue->entries[i].priv_data;
253 desc_dma = desc_offset(queue, dma, i); 248 entry_priv->desc = desc_offset(queue, addr, i);
254 data_addr = data_offset(queue, addr, i); 249 entry_priv->desc_dma = desc_offset(queue, dma, i);
255 data_dma = data_offset(queue, dma, i); 250 entry_priv->data = data_offset(queue, addr, i);
256 251 entry_priv->data_dma = data_offset(queue, dma, i);
257 if (queue->qid == QID_RX) {
258 priv_rx = queue->entries[i].priv_data;
259 priv_rx->desc = desc_addr;
260 priv_rx->desc_dma = desc_dma;
261 priv_rx->data = data_addr;
262 priv_rx->data_dma = data_dma;
263 } else {
264 priv_tx = queue->entries[i].priv_data;
265 priv_tx->desc = desc_addr;
266 priv_tx->desc_dma = desc_dma;
267 priv_tx->data = data_addr;
268 priv_tx->data_dma = data_dma;
269 }
270 } 252 }
271 253
272 return 0; 254 return 0;
@@ -276,28 +258,13 @@ static void rt2x00pci_free_queue_dma(struct rt2x00_dev *rt2x00dev,
276 struct data_queue *queue) 258 struct data_queue *queue)
277{ 259{
278 struct pci_dev *pci_dev = rt2x00dev_pci(rt2x00dev); 260 struct pci_dev *pci_dev = rt2x00dev_pci(rt2x00dev);
279 struct queue_entry_priv_pci_rx *priv_rx; 261 struct queue_entry_priv_pci *entry_priv =
280 struct queue_entry_priv_pci_tx *priv_tx; 262 queue->entries[0].priv_data;
281 void *data_addr;
282 dma_addr_t data_dma;
283
284 if (queue->qid == QID_RX) {
285 priv_rx = queue->entries[0].priv_data;
286 data_addr = priv_rx->data;
287 data_dma = priv_rx->data_dma;
288
289 priv_rx->data = NULL;
290 } else {
291 priv_tx = queue->entries[0].priv_data;
292 data_addr = priv_tx->data;
293 data_dma = priv_tx->data_dma;
294
295 priv_tx->data = NULL;
296 }
297 263
298 if (data_addr) 264 if (entry_priv->data)
299 pci_free_consistent(pci_dev, dma_size(queue), 265 pci_free_consistent(pci_dev, dma_size(queue),
300 data_addr, data_dma); 266 entry_priv->data, entry_priv->data_dma);
267 entry_priv->data = NULL;
301} 268}
302 269
303int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev) 270int rt2x00pci_initialize(struct rt2x00_dev *rt2x00dev)
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h
index 2b0ef17bba6e..557d15a888ab 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.h
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.h
@@ -95,31 +95,15 @@ int rt2x00pci_write_tx_data(struct rt2x00_dev *rt2x00dev,
95 struct ieee80211_tx_control *control); 95 struct ieee80211_tx_control *control);
96 96
97/** 97/**
98 * struct queue_entry_priv_pci_rx: Per RX entry PCI specific information 98 * struct queue_entry_priv_pci: Per entry PCI specific information
99 *
100 * @desc: Pointer to device descriptor.
101 * @desc_dma: DMA pointer to @desc.
102 * @data: Pointer to device's entry memory.
103 * @data_dma: DMA pointer to &data.
104 */
105struct queue_entry_priv_pci_rx {
106 __le32 *desc;
107 dma_addr_t desc_dma;
108
109 void *data;
110 dma_addr_t data_dma;
111};
112
113/**
114 * struct queue_entry_priv_pci_tx: Per TX entry PCI specific information
115 * 99 *
116 * @desc: Pointer to device descriptor 100 * @desc: Pointer to device descriptor
117 * @desc_dma: DMA pointer to @desc. 101 * @desc_dma: DMA pointer to &desc.
118 * @data: Pointer to device's entry memory. 102 * @data: Pointer to device's entry memory.
119 * @data_dma: DMA pointer to &data. 103 * @data_dma: DMA pointer to &data.
120 * @control: mac80211 control structure used to transmit data. 104 * @control: mac80211 control structure used to transmit data.
121 */ 105 */
122struct queue_entry_priv_pci_tx { 106struct queue_entry_priv_pci {
123 __le32 *desc; 107 __le32 *desc;
124 dma_addr_t desc_dma; 108 dma_addr_t desc_dma;
125 109
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index df6621025f4b..dcee1b4f152b 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -129,7 +129,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
129{ 129{
130 struct queue_entry *entry = (struct queue_entry *)urb->context; 130 struct queue_entry *entry = (struct queue_entry *)urb->context;
131 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 131 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
132 struct queue_entry_priv_usb_tx *priv_tx = entry->priv_data; 132 struct queue_entry_priv_usb *entry_priv = entry->priv_data;
133 struct txdone_entry_desc txdesc; 133 struct txdone_entry_desc txdesc;
134 __le32 *txd = (__le32 *)entry->skb->data; 134 __le32 *txd = (__le32 *)entry->skb->data;
135 u32 word; 135 u32 word;
@@ -159,7 +159,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
159 else 159 else
160 __set_bit(TXDONE_FAILURE, &txdesc.flags); 160 __set_bit(TXDONE_FAILURE, &txdesc.flags);
161 txdesc.retry = 0; 161 txdesc.retry = 0;
162 txdesc.control = &priv_tx->control; 162 txdesc.control = &entry_priv->control;
163 163
164 rt2x00lib_txdone(entry, &txdesc); 164 rt2x00lib_txdone(entry, &txdesc);
165 165
@@ -175,7 +175,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
175 * is reenabled when the txdone handler has finished. 175 * is reenabled when the txdone handler has finished.
176 */ 176 */
177 if (!rt2x00queue_full(entry->queue)) 177 if (!rt2x00queue_full(entry->queue))
178 ieee80211_wake_queue(rt2x00dev->hw, priv_tx->control.queue); 178 ieee80211_wake_queue(rt2x00dev->hw, entry_priv->control.queue);
179} 179}
180 180
181int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, 181int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
@@ -184,7 +184,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
184{ 184{
185 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); 185 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev);
186 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); 186 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX);
187 struct queue_entry_priv_usb_tx *priv_tx = entry->priv_data; 187 struct queue_entry_priv_usb *entry_priv = entry->priv_data;
188 struct skb_frame_desc *skbdesc; 188 struct skb_frame_desc *skbdesc;
189 struct txentry_desc txdesc; 189 struct txentry_desc txdesc;
190 u32 length; 190 u32 length;
@@ -224,7 +224,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
224 skbdesc->desc_len = queue->desc_size; 224 skbdesc->desc_len = queue->desc_size;
225 skbdesc->entry = entry; 225 skbdesc->entry = entry;
226 226
227 memcpy(&priv_tx->control, control, sizeof(priv_tx->control)); 227 memcpy(&entry_priv->control, control, sizeof(entry_priv->control));
228 rt2x00queue_write_tx_descriptor(entry, &txdesc); 228 rt2x00queue_write_tx_descriptor(entry, &txdesc);
229 229
230 /* 230 /*
@@ -238,9 +238,9 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
238 * Initialize URB and send the frame to the device. 238 * Initialize URB and send the frame to the device.
239 */ 239 */
240 __set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags); 240 __set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
241 usb_fill_bulk_urb(priv_tx->urb, usb_dev, usb_sndbulkpipe(usb_dev, 1), 241 usb_fill_bulk_urb(entry_priv->urb, usb_dev, usb_sndbulkpipe(usb_dev, 1),
242 skb->data, length, rt2x00usb_interrupt_txdone, entry); 242 skb->data, length, rt2x00usb_interrupt_txdone, entry);
243 usb_submit_urb(priv_tx->urb, GFP_ATOMIC); 243 usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
244 244
245 rt2x00queue_index_inc(queue, Q_INDEX); 245 rt2x00queue_index_inc(queue, Q_INDEX);
246 246
@@ -380,10 +380,8 @@ skip_entry:
380 */ 380 */
381void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev) 381void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
382{ 382{
383 struct queue_entry_priv_usb_rx *priv_rx; 383 struct queue_entry_priv_usb *entry_priv;
384 struct queue_entry_priv_usb_tx *priv_tx; 384 struct queue_entry_priv_usb_bcn *bcn_priv;
385 struct queue_entry_priv_usb_bcn *priv_bcn;
386 struct data_queue *queue;
387 unsigned int i; 385 unsigned int i;
388 386
389 rt2x00usb_vendor_request_sw(rt2x00dev, USB_RX_CONTROL, 0, 0, 387 rt2x00usb_vendor_request_sw(rt2x00dev, USB_RX_CONTROL, 0, 0,
@@ -393,31 +391,17 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
393 * Cancel all queues. 391 * Cancel all queues.
394 */ 392 */
395 for (i = 0; i < rt2x00dev->rx->limit; i++) { 393 for (i = 0; i < rt2x00dev->rx->limit; i++) {
396 priv_rx = rt2x00dev->rx->entries[i].priv_data; 394 entry_priv = rt2x00dev->rx->entries[i].priv_data;
397 usb_kill_urb(priv_rx->urb); 395 usb_kill_urb(entry_priv->urb);
398 }
399
400 tx_queue_for_each(rt2x00dev, queue) {
401 for (i = 0; i < queue->limit; i++) {
402 priv_tx = queue->entries[i].priv_data;
403 usb_kill_urb(priv_tx->urb);
404 }
405 } 396 }
406 397
398 /*
399 * Kill guardian urb.
400 */
407 for (i = 0; i < rt2x00dev->bcn->limit; i++) { 401 for (i = 0; i < rt2x00dev->bcn->limit; i++) {
408 priv_bcn = rt2x00dev->bcn->entries[i].priv_data; 402 bcn_priv = rt2x00dev->bcn->entries[i].priv_data;
409 usb_kill_urb(priv_bcn->urb); 403 if (bcn_priv->guardian_urb)
410 404 usb_kill_urb(bcn_priv->guardian_urb);
411 if (priv_bcn->guardian_urb)
412 usb_kill_urb(priv_bcn->guardian_urb);
413 }
414
415 if (!test_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags))
416 return;
417
418 for (i = 0; i < rt2x00dev->bcn[1].limit; i++) {
419 priv_tx = rt2x00dev->bcn[1].entries[i].priv_data;
420 usb_kill_urb(priv_tx->urb);
421 } 405 }
422} 406}
423EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio); 407EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio);
@@ -429,15 +413,15 @@ void rt2x00usb_init_rxentry(struct rt2x00_dev *rt2x00dev,
429 struct queue_entry *entry) 413 struct queue_entry *entry)
430{ 414{
431 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); 415 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev);
432 struct queue_entry_priv_usb_rx *priv_rx = entry->priv_data; 416 struct queue_entry_priv_usb *entry_priv = entry->priv_data;
433 417
434 usb_fill_bulk_urb(priv_rx->urb, usb_dev, 418 usb_fill_bulk_urb(entry_priv->urb, usb_dev,
435 usb_rcvbulkpipe(usb_dev, 1), 419 usb_rcvbulkpipe(usb_dev, 1),
436 entry->skb->data, entry->skb->len, 420 entry->skb->data, entry->skb->len,
437 rt2x00usb_interrupt_rxdone, entry); 421 rt2x00usb_interrupt_rxdone, entry);
438 422
439 __set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags); 423 __set_bit(ENTRY_OWNER_DEVICE_DATA, &entry->flags);
440 usb_submit_urb(priv_rx->urb, GFP_ATOMIC); 424 usb_submit_urb(entry_priv->urb, GFP_ATOMIC);
441} 425}
442EXPORT_SYMBOL_GPL(rt2x00usb_init_rxentry); 426EXPORT_SYMBOL_GPL(rt2x00usb_init_rxentry);
443 427
@@ -451,38 +435,31 @@ EXPORT_SYMBOL_GPL(rt2x00usb_init_txentry);
451static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev, 435static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev,
452 struct data_queue *queue) 436 struct data_queue *queue)
453{ 437{
454 struct queue_entry_priv_usb_rx *priv_rx; 438 struct queue_entry_priv_usb *entry_priv;
455 struct queue_entry_priv_usb_tx *priv_tx; 439 struct queue_entry_priv_usb_bcn *bcn_priv;
456 struct queue_entry_priv_usb_bcn *priv_bcn;
457 struct urb *urb;
458 unsigned int guardian =
459 test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags);
460 unsigned int i; 440 unsigned int i;
461 441
442 for (i = 0; i < queue->limit; i++) {
443 entry_priv = queue->entries[i].priv_data;
444 entry_priv->urb = usb_alloc_urb(0, GFP_KERNEL);
445 if (!entry_priv->urb)
446 return -ENOMEM;
447 }
448
462 /* 449 /*
463 * Allocate the URB's 450 * If this is not the beacon queue or
451 * no guardian byte was required for the beacon,
452 * then we are done.
464 */ 453 */
454 if (rt2x00dev->bcn != queue ||
455 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
456 return 0;
457
465 for (i = 0; i < queue->limit; i++) { 458 for (i = 0; i < queue->limit; i++) {
466 urb = usb_alloc_urb(0, GFP_KERNEL); 459 bcn_priv = queue->entries[i].priv_data;
467 if (!urb) 460 bcn_priv->guardian_urb = usb_alloc_urb(0, GFP_KERNEL);
461 if (!bcn_priv->guardian_urb)
468 return -ENOMEM; 462 return -ENOMEM;
469
470 if (queue->qid == QID_RX) {
471 priv_rx = queue->entries[i].priv_data;
472 priv_rx->urb = urb;
473 } else if (queue->qid == QID_MGMT && guardian) {
474 priv_bcn = queue->entries[i].priv_data;
475 priv_bcn->urb = urb;
476
477 urb = usb_alloc_urb(0, GFP_KERNEL);
478 if (!urb)
479 return -ENOMEM;
480
481 priv_bcn->guardian_urb = urb;
482 } else {
483 priv_tx = queue->entries[i].priv_data;
484 priv_tx->urb = urb;
485 }
486 } 463 }
487 464
488 return 0; 465 return 0;
@@ -491,38 +468,35 @@ static int rt2x00usb_alloc_urb(struct rt2x00_dev *rt2x00dev,
491static void rt2x00usb_free_urb(struct rt2x00_dev *rt2x00dev, 468static void rt2x00usb_free_urb(struct rt2x00_dev *rt2x00dev,
492 struct data_queue *queue) 469 struct data_queue *queue)
493{ 470{
494 struct queue_entry_priv_usb_rx *priv_rx; 471 struct queue_entry_priv_usb *entry_priv;
495 struct queue_entry_priv_usb_tx *priv_tx; 472 struct queue_entry_priv_usb_bcn *bcn_priv;
496 struct queue_entry_priv_usb_bcn *priv_bcn;
497 struct urb *urb;
498 unsigned int guardian =
499 test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags);
500 unsigned int i; 473 unsigned int i;
501 474
502 if (!queue->entries) 475 if (!queue->entries)
503 return; 476 return;
504 477
505 for (i = 0; i < queue->limit; i++) { 478 for (i = 0; i < queue->limit; i++) {
506 if (queue->qid == QID_RX) { 479 entry_priv = queue->entries[i].priv_data;
507 priv_rx = queue->entries[i].priv_data; 480 usb_kill_urb(entry_priv->urb);
508 urb = priv_rx->urb; 481 usb_free_urb(entry_priv->urb);
509 } else if (queue->qid == QID_MGMT && guardian) {
510 priv_bcn = queue->entries[i].priv_data;
511
512 usb_kill_urb(priv_bcn->guardian_urb);
513 usb_free_urb(priv_bcn->guardian_urb);
514
515 urb = priv_bcn->urb;
516 } else {
517 priv_tx = queue->entries[i].priv_data;
518 urb = priv_tx->urb;
519 }
520
521 usb_kill_urb(urb);
522 usb_free_urb(urb);
523 if (queue->entries[i].skb) 482 if (queue->entries[i].skb)
524 kfree_skb(queue->entries[i].skb); 483 kfree_skb(queue->entries[i].skb);
525 } 484 }
485
486 /*
487 * If this is not the beacon queue or
488 * no guardian byte was required for the beacon,
489 * then we are done.
490 */
491 if (rt2x00dev->bcn != queue ||
492 !test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
493 return;
494
495 for (i = 0; i < queue->limit; i++) {
496 bcn_priv = queue->entries[i].priv_data;
497 usb_kill_urb(bcn_priv->guardian_urb);
498 usb_free_urb(bcn_priv->guardian_urb);
499 }
526} 500}
527 501
528int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev) 502int rt2x00usb_initialize(struct rt2x00_dev *rt2x00dev)
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h
index 4da9eb376ebd..15b404aa714d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.h
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.h
@@ -220,30 +220,21 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
220 struct ieee80211_tx_control *control); 220 struct ieee80211_tx_control *control);
221 221
222/** 222/**
223 * struct queue_entry_priv_usb_rx: Per RX entry USB specific information 223 * struct queue_entry_priv_usb: Per entry USB specific information
224 *
225 * @urb: Urb structure used for device communication.
226 */
227struct queue_entry_priv_usb_rx {
228 struct urb *urb;
229};
230
231/**
232 * struct queue_entry_priv_usb_tx: Per TX entry USB specific information
233 * 224 *
234 * @urb: Urb structure used for device communication. 225 * @urb: Urb structure used for device communication.
235 * @control: mac80211 control structure used to transmit data. 226 * @control: mac80211 control structure used to transmit data.
236 */ 227 */
237struct queue_entry_priv_usb_tx { 228struct queue_entry_priv_usb {
238 struct urb *urb; 229 struct urb *urb;
239 230
240 struct ieee80211_tx_control control; 231 struct ieee80211_tx_control control;
241}; 232};
242 233
243/** 234/**
244 * struct queue_entry_priv_usb_tx: Per TX entry USB specific information 235 * struct queue_entry_priv_usb_bcn: Per TX entry USB specific information
245 * 236 *
246 * The first section should match &struct queue_entry_priv_usb_tx exactly. 237 * The first section should match &struct queue_entry_priv_usb exactly.
247 * rt2500usb can use this structure to send a guardian byte when working 238 * rt2500usb can use this structure to send a guardian byte when working
248 * with beacons. 239 * with beacons.
249 * 240 *
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 2e5e45cbd2e5..7598b6e15784 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1018,35 +1018,34 @@ static int rt61pci_load_firmware(struct rt2x00_dev *rt2x00dev, void *data,
1018static void rt61pci_init_rxentry(struct rt2x00_dev *rt2x00dev, 1018static void rt61pci_init_rxentry(struct rt2x00_dev *rt2x00dev,
1019 struct queue_entry *entry) 1019 struct queue_entry *entry)
1020{ 1020{
1021 struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; 1021 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
1022 u32 word; 1022 u32 word;
1023 1023
1024 rt2x00_desc_read(priv_rx->desc, 5, &word); 1024 rt2x00_desc_read(entry_priv->desc, 5, &word);
1025 rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS, 1025 rt2x00_set_field32(&word, RXD_W5_BUFFER_PHYSICAL_ADDRESS,
1026 priv_rx->data_dma); 1026 entry_priv->data_dma);
1027 rt2x00_desc_write(priv_rx->desc, 5, word); 1027 rt2x00_desc_write(entry_priv->desc, 5, word);
1028 1028
1029 rt2x00_desc_read(priv_rx->desc, 0, &word); 1029 rt2x00_desc_read(entry_priv->desc, 0, &word);
1030 rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1); 1030 rt2x00_set_field32(&word, RXD_W0_OWNER_NIC, 1);
1031 rt2x00_desc_write(priv_rx->desc, 0, word); 1031 rt2x00_desc_write(entry_priv->desc, 0, word);
1032} 1032}
1033 1033
1034static void rt61pci_init_txentry(struct rt2x00_dev *rt2x00dev, 1034static void rt61pci_init_txentry(struct rt2x00_dev *rt2x00dev,
1035 struct queue_entry *entry) 1035 struct queue_entry *entry)
1036{ 1036{
1037 struct queue_entry_priv_pci_tx *priv_tx = entry->priv_data; 1037 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
1038 u32 word; 1038 u32 word;
1039 1039
1040 rt2x00_desc_read(priv_tx->desc, 0, &word); 1040 rt2x00_desc_read(entry_priv->desc, 0, &word);
1041 rt2x00_set_field32(&word, TXD_W0_VALID, 0); 1041 rt2x00_set_field32(&word, TXD_W0_VALID, 0);
1042 rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0); 1042 rt2x00_set_field32(&word, TXD_W0_OWNER_NIC, 0);
1043 rt2x00_desc_write(priv_tx->desc, 0, word); 1043 rt2x00_desc_write(entry_priv->desc, 0, word);
1044} 1044}
1045 1045
1046static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev) 1046static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev)
1047{ 1047{
1048 struct queue_entry_priv_pci_rx *priv_rx; 1048 struct queue_entry_priv_pci *entry_priv;
1049 struct queue_entry_priv_pci_tx *priv_tx;
1050 u32 reg; 1049 u32 reg;
1051 1050
1052 /* 1051 /*
@@ -1068,28 +1067,28 @@ static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev)
1068 rt2x00dev->tx[0].desc_size / 4); 1067 rt2x00dev->tx[0].desc_size / 4);
1069 rt2x00pci_register_write(rt2x00dev, TX_RING_CSR1, reg); 1068 rt2x00pci_register_write(rt2x00dev, TX_RING_CSR1, reg);
1070 1069
1071 priv_tx = rt2x00dev->tx[0].entries[0].priv_data; 1070 entry_priv = rt2x00dev->tx[0].entries[0].priv_data;
1072 rt2x00pci_register_read(rt2x00dev, AC0_BASE_CSR, &reg); 1071 rt2x00pci_register_read(rt2x00dev, AC0_BASE_CSR, &reg);
1073 rt2x00_set_field32(&reg, AC0_BASE_CSR_RING_REGISTER, 1072 rt2x00_set_field32(&reg, AC0_BASE_CSR_RING_REGISTER,
1074 priv_tx->desc_dma); 1073 entry_priv->desc_dma);
1075 rt2x00pci_register_write(rt2x00dev, AC0_BASE_CSR, reg); 1074 rt2x00pci_register_write(rt2x00dev, AC0_BASE_CSR, reg);
1076 1075
1077 priv_tx = rt2x00dev->tx[1].entries[0].priv_data; 1076 entry_priv = rt2x00dev->tx[1].entries[0].priv_data;
1078 rt2x00pci_register_read(rt2x00dev, AC1_BASE_CSR, &reg); 1077 rt2x00pci_register_read(rt2x00dev, AC1_BASE_CSR, &reg);
1079 rt2x00_set_field32(&reg, AC1_BASE_CSR_RING_REGISTER, 1078 rt2x00_set_field32(&reg, AC1_BASE_CSR_RING_REGISTER,
1080 priv_tx->desc_dma); 1079 entry_priv->desc_dma);
1081 rt2x00pci_register_write(rt2x00dev, AC1_BASE_CSR, reg); 1080 rt2x00pci_register_write(rt2x00dev, AC1_BASE_CSR, reg);
1082 1081
1083 priv_tx = rt2x00dev->tx[2].entries[0].priv_data; 1082 entry_priv = rt2x00dev->tx[2].entries[0].priv_data;
1084 rt2x00pci_register_read(rt2x00dev, AC2_BASE_CSR, &reg); 1083 rt2x00pci_register_read(rt2x00dev, AC2_BASE_CSR, &reg);
1085 rt2x00_set_field32(&reg, AC2_BASE_CSR_RING_REGISTER, 1084 rt2x00_set_field32(&reg, AC2_BASE_CSR_RING_REGISTER,
1086 priv_tx->desc_dma); 1085 entry_priv->desc_dma);
1087 rt2x00pci_register_write(rt2x00dev, AC2_BASE_CSR, reg); 1086 rt2x00pci_register_write(rt2x00dev, AC2_BASE_CSR, reg);
1088 1087
1089 priv_tx = rt2x00dev->tx[3].entries[0].priv_data; 1088 entry_priv = rt2x00dev->tx[3].entries[0].priv_data;
1090 rt2x00pci_register_read(rt2x00dev, AC3_BASE_CSR, &reg); 1089 rt2x00pci_register_read(rt2x00dev, AC3_BASE_CSR, &reg);
1091 rt2x00_set_field32(&reg, AC3_BASE_CSR_RING_REGISTER, 1090 rt2x00_set_field32(&reg, AC3_BASE_CSR_RING_REGISTER,
1092 priv_tx->desc_dma); 1091 entry_priv->desc_dma);
1093 rt2x00pci_register_write(rt2x00dev, AC3_BASE_CSR, reg); 1092 rt2x00pci_register_write(rt2x00dev, AC3_BASE_CSR, reg);
1094 1093
1095 rt2x00pci_register_read(rt2x00dev, RX_RING_CSR, &reg); 1094 rt2x00pci_register_read(rt2x00dev, RX_RING_CSR, &reg);
@@ -1099,10 +1098,10 @@ static int rt61pci_init_queues(struct rt2x00_dev *rt2x00dev)
1099 rt2x00_set_field32(&reg, RX_RING_CSR_RXD_WRITEBACK_SIZE, 4); 1098 rt2x00_set_field32(&reg, RX_RING_CSR_RXD_WRITEBACK_SIZE, 4);
1100 rt2x00pci_register_write(rt2x00dev, RX_RING_CSR, reg); 1099 rt2x00pci_register_write(rt2x00dev, RX_RING_CSR, reg);
1101 1100
1102 priv_rx = rt2x00dev->rx->entries[0].priv_data; 1101 entry_priv = rt2x00dev->rx->entries[0].priv_data;
1103 rt2x00pci_register_read(rt2x00dev, RX_BASE_CSR, &reg); 1102 rt2x00pci_register_read(rt2x00dev, RX_BASE_CSR, &reg);
1104 rt2x00_set_field32(&reg, RX_BASE_CSR_RING_REGISTER, 1103 rt2x00_set_field32(&reg, RX_BASE_CSR_RING_REGISTER,
1105 priv_rx->desc_dma); 1104 entry_priv->desc_dma);
1106 rt2x00pci_register_write(rt2x00dev, RX_BASE_CSR, reg); 1105 rt2x00pci_register_write(rt2x00dev, RX_BASE_CSR, reg);
1107 1106
1108 rt2x00pci_register_read(rt2x00dev, TX_DMA_DST_CSR, &reg); 1107 rt2x00pci_register_read(rt2x00dev, TX_DMA_DST_CSR, &reg);
@@ -1515,7 +1514,7 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1515 struct txentry_desc *txdesc) 1514 struct txentry_desc *txdesc)
1516{ 1515{
1517 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); 1516 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb);
1518 struct queue_entry_priv_pci_tx *entry_priv = skbdesc->entry->priv_data; 1517 struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data;
1519 __le32 *txd = skbdesc->desc; 1518 __le32 *txd = skbdesc->desc;
1520 u32 word; 1519 u32 word;
1521 1520
@@ -1661,12 +1660,12 @@ static int rt61pci_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1)
1661static void rt61pci_fill_rxdone(struct queue_entry *entry, 1660static void rt61pci_fill_rxdone(struct queue_entry *entry,
1662 struct rxdone_entry_desc *rxdesc) 1661 struct rxdone_entry_desc *rxdesc)
1663{ 1662{
1664 struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data; 1663 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
1665 u32 word0; 1664 u32 word0;
1666 u32 word1; 1665 u32 word1;
1667 1666
1668 rt2x00_desc_read(priv_rx->desc, 0, &word0); 1667 rt2x00_desc_read(entry_priv->desc, 0, &word0);
1669 rt2x00_desc_read(priv_rx->desc, 1, &word1); 1668 rt2x00_desc_read(entry_priv->desc, 1, &word1);
1670 1669
1671 if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR)) 1670 if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
1672 rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC; 1671 rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
@@ -1695,7 +1694,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
1695 struct data_queue *queue; 1694 struct data_queue *queue;
1696 struct queue_entry *entry; 1695 struct queue_entry *entry;
1697 struct queue_entry *entry_done; 1696 struct queue_entry *entry_done;
1698 struct queue_entry_priv_pci_tx *priv_tx; 1697 struct queue_entry_priv_pci *entry_priv;
1699 struct txdone_entry_desc txdesc; 1698 struct txdone_entry_desc txdesc;
1700 u32 word; 1699 u32 word;
1701 u32 reg; 1700 u32 reg;
@@ -1740,8 +1739,8 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
1740 continue; 1739 continue;
1741 1740
1742 entry = &queue->entries[index]; 1741 entry = &queue->entries[index];
1743 priv_tx = entry->priv_data; 1742 entry_priv = entry->priv_data;
1744 rt2x00_desc_read(priv_tx->desc, 0, &word); 1743 rt2x00_desc_read(entry_priv->desc, 0, &word);
1745 1744
1746 if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) || 1745 if (rt2x00_get_field32(word, TXD_W0_OWNER_NIC) ||
1747 !rt2x00_get_field32(word, TXD_W0_VALID)) 1746 !rt2x00_get_field32(word, TXD_W0_VALID))
@@ -2363,7 +2362,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2363{ 2362{
2364 struct rt2x00_dev *rt2x00dev = hw->priv; 2363 struct rt2x00_dev *rt2x00dev = hw->priv;
2365 struct rt2x00_intf *intf = vif_to_intf(control->vif); 2364 struct rt2x00_intf *intf = vif_to_intf(control->vif);
2366 struct queue_entry_priv_pci_tx *priv_tx; 2365 struct queue_entry_priv_pci *entry_priv;
2367 struct skb_frame_desc *skbdesc; 2366 struct skb_frame_desc *skbdesc;
2368 struct txentry_desc txdesc; 2367 struct txentry_desc txdesc;
2369 unsigned int beacon_base; 2368 unsigned int beacon_base;
@@ -2380,8 +2379,8 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2380 intf->beacon->skb = skb; 2379 intf->beacon->skb = skb;
2381 rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control); 2380 rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc, control);
2382 2381
2383 priv_tx = intf->beacon->priv_data; 2382 entry_priv = intf->beacon->priv_data;
2384 memset(priv_tx->desc, 0, intf->beacon->queue->desc_size); 2383 memset(entry_priv->desc, 0, intf->beacon->queue->desc_size);
2385 2384
2386 /* 2385 /*
2387 * Fill in skb descriptor 2386 * Fill in skb descriptor
@@ -2391,7 +2390,7 @@ static int rt61pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
2391 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED; 2390 skbdesc->flags |= FRAME_DESC_DRIVER_GENERATED;
2392 skbdesc->data = skb->data; 2391 skbdesc->data = skb->data;
2393 skbdesc->data_len = skb->len; 2392 skbdesc->data_len = skb->len;
2394 skbdesc->desc = priv_tx->desc; 2393 skbdesc->desc = entry_priv->desc;
2395 skbdesc->desc_len = intf->beacon->queue->desc_size; 2394 skbdesc->desc_len = intf->beacon->queue->desc_size;
2396 skbdesc->entry = intf->beacon; 2395 skbdesc->entry = intf->beacon;
2397 2396
@@ -2468,21 +2467,21 @@ static const struct data_queue_desc rt61pci_queue_rx = {
2468 .entry_num = RX_ENTRIES, 2467 .entry_num = RX_ENTRIES,
2469 .data_size = DATA_FRAME_SIZE, 2468 .data_size = DATA_FRAME_SIZE,
2470 .desc_size = RXD_DESC_SIZE, 2469 .desc_size = RXD_DESC_SIZE,
2471 .priv_size = sizeof(struct queue_entry_priv_pci_rx), 2470 .priv_size = sizeof(struct queue_entry_priv_pci),
2472}; 2471};
2473 2472
2474static const struct data_queue_desc rt61pci_queue_tx = { 2473static const struct data_queue_desc rt61pci_queue_tx = {
2475 .entry_num = TX_ENTRIES, 2474 .entry_num = TX_ENTRIES,
2476 .data_size = DATA_FRAME_SIZE, 2475 .data_size = DATA_FRAME_SIZE,
2477 .desc_size = TXD_DESC_SIZE, 2476 .desc_size = TXD_DESC_SIZE,
2478 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 2477 .priv_size = sizeof(struct queue_entry_priv_pci),
2479}; 2478};
2480 2479
2481static const struct data_queue_desc rt61pci_queue_bcn = { 2480static const struct data_queue_desc rt61pci_queue_bcn = {
2482 .entry_num = 4 * BEACON_ENTRIES, 2481 .entry_num = 4 * BEACON_ENTRIES,
2483 .data_size = 0, /* No DMA required for beacons */ 2482 .data_size = 0, /* No DMA required for beacons */
2484 .desc_size = TXINFO_SIZE, 2483 .desc_size = TXINFO_SIZE,
2485 .priv_size = sizeof(struct queue_entry_priv_pci_tx), 2484 .priv_size = sizeof(struct queue_entry_priv_pci),
2486}; 2485};
2487 2486
2488static const struct rt2x00_ops rt61pci_ops = { 2487static const struct rt2x00_ops rt61pci_ops = {
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 5d70dd840c15..e55bcbdfc1e1 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2058,21 +2058,21 @@ static const struct data_queue_desc rt73usb_queue_rx = {
2058 .entry_num = RX_ENTRIES, 2058 .entry_num = RX_ENTRIES,
2059 .data_size = DATA_FRAME_SIZE, 2059 .data_size = DATA_FRAME_SIZE,
2060 .desc_size = RXD_DESC_SIZE, 2060 .desc_size = RXD_DESC_SIZE,
2061 .priv_size = sizeof(struct queue_entry_priv_usb_rx), 2061 .priv_size = sizeof(struct queue_entry_priv_usb),
2062}; 2062};
2063 2063
2064static const struct data_queue_desc rt73usb_queue_tx = { 2064static const struct data_queue_desc rt73usb_queue_tx = {
2065 .entry_num = TX_ENTRIES, 2065 .entry_num = TX_ENTRIES,
2066 .data_size = DATA_FRAME_SIZE, 2066 .data_size = DATA_FRAME_SIZE,
2067 .desc_size = TXD_DESC_SIZE, 2067 .desc_size = TXD_DESC_SIZE,
2068 .priv_size = sizeof(struct queue_entry_priv_usb_tx), 2068 .priv_size = sizeof(struct queue_entry_priv_usb),
2069}; 2069};
2070 2070
2071static const struct data_queue_desc rt73usb_queue_bcn = { 2071static const struct data_queue_desc rt73usb_queue_bcn = {
2072 .entry_num = 4 * BEACON_ENTRIES, 2072 .entry_num = 4 * BEACON_ENTRIES,
2073 .data_size = MGMT_FRAME_SIZE, 2073 .data_size = MGMT_FRAME_SIZE,
2074 .desc_size = TXINFO_SIZE, 2074 .desc_size = TXINFO_SIZE,
2075 .priv_size = sizeof(struct queue_entry_priv_usb_tx), 2075 .priv_size = sizeof(struct queue_entry_priv_usb),
2076}; 2076};
2077 2077
2078static const struct rt2x00_ops rt73usb_ops = { 2078static const struct rt2x00_ops rt73usb_ops = {