aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00usb.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-15 06:55:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:11 -0400
commite039fa4a4195ac4ee895e6f3d1334beed63256fe (patch)
treecfd0762d73df96b73052378be7b157c4ac6e7035 /drivers/net/wireless/rt2x00/rt2x00usb.c
parente24549485f859be6518929bb1c9c0257d79f033d (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/rt2x00/rt2x00usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index dcee1b4f152b..52d12fdc0ccf 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -129,9 +129,9 @@ 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 *entry_priv = entry->priv_data;
133 struct txdone_entry_desc txdesc; 132 struct txdone_entry_desc txdesc;
134 __le32 *txd = (__le32 *)entry->skb->data; 133 __le32 *txd = (__le32 *)entry->skb->data;
134 enum data_queue_qid qid = skb_get_queue_mapping(entry->skb);
135 u32 word; 135 u32 word;
136 136
137 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) || 137 if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) ||
@@ -159,7 +159,6 @@ 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 = &entry_priv->control;
163 162
164 rt2x00lib_txdone(entry, &txdesc); 163 rt2x00lib_txdone(entry, &txdesc);
165 164
@@ -175,12 +174,11 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)
175 * is reenabled when the txdone handler has finished. 174 * is reenabled when the txdone handler has finished.
176 */ 175 */
177 if (!rt2x00queue_full(entry->queue)) 176 if (!rt2x00queue_full(entry->queue))
178 ieee80211_wake_queue(rt2x00dev->hw, entry_priv->control.queue); 177 ieee80211_wake_queue(rt2x00dev->hw, qid);
179} 178}
180 179
181int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev, 180int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
182 struct data_queue *queue, struct sk_buff *skb, 181 struct data_queue *queue, struct sk_buff *skb)
183 struct ieee80211_tx_control *control)
184{ 182{
185 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev); 183 struct usb_device *usb_dev = rt2x00dev_usb_dev(rt2x00dev);
186 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX); 184 struct queue_entry *entry = rt2x00queue_get_entry(queue, Q_INDEX);
@@ -206,7 +204,7 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
206 * for our information. 204 * for our information.
207 */ 205 */
208 entry->skb = skb; 206 entry->skb = skb;
209 rt2x00queue_create_tx_descriptor(entry, &txdesc, control); 207 rt2x00queue_create_tx_descriptor(entry, &txdesc);
210 208
211 /* 209 /*
212 * Add the descriptor in front of the skb. 210 * Add the descriptor in front of the skb.
@@ -218,13 +216,13 @@ int rt2x00usb_write_tx_data(struct rt2x00_dev *rt2x00dev,
218 * Fill in skb descriptor 216 * Fill in skb descriptor
219 */ 217 */
220 skbdesc = get_skb_frame_desc(skb); 218 skbdesc = get_skb_frame_desc(skb);
219 memset(skbdesc, 0, sizeof(*skbdesc));
221 skbdesc->data = skb->data + queue->desc_size; 220 skbdesc->data = skb->data + queue->desc_size;
222 skbdesc->data_len = skb->len - queue->desc_size; 221 skbdesc->data_len = skb->len - queue->desc_size;
223 skbdesc->desc = skb->data; 222 skbdesc->desc = skb->data;
224 skbdesc->desc_len = queue->desc_size; 223 skbdesc->desc_len = queue->desc_size;
225 skbdesc->entry = entry; 224 skbdesc->entry = entry;
226 225
227 memcpy(&entry_priv->control, control, sizeof(entry_priv->control));
228 rt2x00queue_write_tx_descriptor(entry, &txdesc); 226 rt2x00queue_write_tx_descriptor(entry, &txdesc);
229 227
230 /* 228 /*