diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-05-10 07:46:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-21 21:47:35 -0400 |
commit | b8be63ffa5dc44324e7f507997870fa3e4b17619 (patch) | |
tree | ad9ef1c3e4e09111ad93b003baaec325bd5e40e0 /drivers/net/wireless/rt2x00/rt2500usb.c | |
parent | dec13b6bda600c7e7da993e634562873112af50b (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/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 33 |
1 files changed, 17 insertions, 16 deletions
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, | |||
1124 | static void rt2500usb_fill_rxdone(struct queue_entry *entry, | 1124 | static 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, | |||
1184 | static void rt2500usb_beacondone(struct urb *urb) | 1185 | static 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 | ||
1803 | static const struct data_queue_desc rt2500usb_queue_tx = { | 1804 | static 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 | ||
1810 | static const struct data_queue_desc rt2500usb_queue_bcn = { | 1811 | static 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 | ||
1824 | static const struct rt2x00_ops rt2500usb_ops = { | 1825 | static const struct rt2x00_ops rt2500usb_ops = { |