aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2011-07-06 16:57:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-07 13:20:58 -0400
commit77b5621bac4a56b83b9081f48d4e7d1accdde400 (patch)
tree4a8f5d10ba0a84c597a6b9596292f4725d7e7f56 /drivers/net/wireless/rt2x00
parent77a861c405da75d81e9e6e32c50eb7f9777777e8 (diff)
rt2x00: Don't use queue entry as parameter when creating TX descriptor.
The functions that create the tx descriptor structure do not operate on a queue entry at all. Signal this fact in the code by not providing a queue entry as a parameter, but the rt2x00 device structure and the skb directly. This patch is a preparation for reducing the time a queue is locked for a tx operation. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> 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')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00crypto.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c52
3 files changed, 33 insertions, 28 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c
index 1bb9d46077ff..1ca4c7ffc189 100644
--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c
+++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c
@@ -45,11 +45,11 @@ enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key)
45 } 45 }
46} 46}
47 47
48void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, 48void rt2x00crypto_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
49 struct sk_buff *skb,
49 struct txentry_desc *txdesc) 50 struct txentry_desc *txdesc)
50{ 51{
51 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 52 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
52 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
53 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 53 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
54 54
55 if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags) || !hw_key) 55 if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags) || !hw_key)
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 322cc4f3de5d..15cdc7e57fc4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -336,7 +336,8 @@ static inline void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
336 */ 336 */
337#ifdef CONFIG_RT2X00_LIB_CRYPTO 337#ifdef CONFIG_RT2X00_LIB_CRYPTO
338enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key); 338enum cipher rt2x00crypto_key_to_cipher(struct ieee80211_key_conf *key);
339void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, 339void rt2x00crypto_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
340 struct sk_buff *skb,
340 struct txentry_desc *txdesc); 341 struct txentry_desc *txdesc);
341unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev, 342unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,
342 struct sk_buff *skb); 343 struct sk_buff *skb);
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 551cee1209ca..a70e7000b528 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -200,11 +200,12 @@ void rt2x00queue_remove_l2pad(struct sk_buff *skb, unsigned int header_length)
200 skb_pull(skb, l2pad); 200 skb_pull(skb, l2pad);
201} 201}
202 202
203static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry, 203static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
204 struct sk_buff *skb,
204 struct txentry_desc *txdesc) 205 struct txentry_desc *txdesc)
205{ 206{
206 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 207 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
207 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; 208 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
208 struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif); 209 struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif);
209 210
210 if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)) 211 if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
@@ -212,7 +213,7 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
212 213
213 __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags); 214 __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
214 215
215 if (!test_bit(REQUIRE_SW_SEQNO, &entry->queue->rt2x00dev->cap_flags)) 216 if (!test_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags))
216 return; 217 return;
217 218
218 /* 219 /*
@@ -237,12 +238,12 @@ static void rt2x00queue_create_tx_descriptor_seq(struct queue_entry *entry,
237 238
238} 239}
239 240
240static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry, 241static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev,
242 struct sk_buff *skb,
241 struct txentry_desc *txdesc, 243 struct txentry_desc *txdesc,
242 const struct rt2x00_rate *hwrate) 244 const struct rt2x00_rate *hwrate)
243{ 245{
244 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 246 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
245 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
246 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; 247 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
247 unsigned int data_length; 248 unsigned int data_length;
248 unsigned int duration; 249 unsigned int duration;
@@ -259,8 +260,8 @@ static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,
259 txdesc->u.plcp.ifs = IFS_SIFS; 260 txdesc->u.plcp.ifs = IFS_SIFS;
260 261
261 /* Data length + CRC + Crypto overhead (IV/EIV/ICV/MIC) */ 262 /* Data length + CRC + Crypto overhead (IV/EIV/ICV/MIC) */
262 data_length = entry->skb->len + 4; 263 data_length = skb->len + 4;
263 data_length += rt2x00crypto_tx_overhead(rt2x00dev, entry->skb); 264 data_length += rt2x00crypto_tx_overhead(rt2x00dev, skb);
264 265
265 /* 266 /*
266 * PLCP setup 267 * PLCP setup
@@ -301,13 +302,14 @@ static void rt2x00queue_create_tx_descriptor_plcp(struct queue_entry *entry,
301 } 302 }
302} 303}
303 304
304static void rt2x00queue_create_tx_descriptor_ht(struct queue_entry *entry, 305static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
306 struct sk_buff *skb,
305 struct txentry_desc *txdesc, 307 struct txentry_desc *txdesc,
306 const struct rt2x00_rate *hwrate) 308 const struct rt2x00_rate *hwrate)
307{ 309{
308 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 310 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
309 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; 311 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
310 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; 312 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
311 313
312 if (tx_info->control.sta) 314 if (tx_info->control.sta)
313 txdesc->u.ht.mpdu_density = 315 txdesc->u.ht.mpdu_density =
@@ -380,12 +382,12 @@ static void rt2x00queue_create_tx_descriptor_ht(struct queue_entry *entry,
380 txdesc->u.ht.txop = TXOP_HTTXOP; 382 txdesc->u.ht.txop = TXOP_HTTXOP;
381} 383}
382 384
383static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, 385static void rt2x00queue_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
386 struct sk_buff *skb,
384 struct txentry_desc *txdesc) 387 struct txentry_desc *txdesc)
385{ 388{
386 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 389 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
387 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 390 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
388 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data;
389 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; 391 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
390 struct ieee80211_rate *rate; 392 struct ieee80211_rate *rate;
391 const struct rt2x00_rate *hwrate = NULL; 393 const struct rt2x00_rate *hwrate = NULL;
@@ -395,8 +397,8 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
395 /* 397 /*
396 * Header and frame information. 398 * Header and frame information.
397 */ 399 */
398 txdesc->length = entry->skb->len; 400 txdesc->length = skb->len;
399 txdesc->header_length = ieee80211_get_hdrlen_from_skb(entry->skb); 401 txdesc->header_length = ieee80211_get_hdrlen_from_skb(skb);
400 402
401 /* 403 /*
402 * Check whether this frame is to be acked. 404 * Check whether this frame is to be acked.
@@ -471,13 +473,15 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
471 /* 473 /*
472 * Apply TX descriptor handling by components 474 * Apply TX descriptor handling by components
473 */ 475 */
474 rt2x00crypto_create_tx_descriptor(entry, txdesc); 476 rt2x00crypto_create_tx_descriptor(rt2x00dev, skb, txdesc);
475 rt2x00queue_create_tx_descriptor_seq(entry, txdesc); 477 rt2x00queue_create_tx_descriptor_seq(rt2x00dev, skb, txdesc);
476 478
477 if (test_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags)) 479 if (test_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags))
478 rt2x00queue_create_tx_descriptor_ht(entry, txdesc, hwrate); 480 rt2x00queue_create_tx_descriptor_ht(rt2x00dev, skb, txdesc,
481 hwrate);
479 else 482 else
480 rt2x00queue_create_tx_descriptor_plcp(entry, txdesc, hwrate); 483 rt2x00queue_create_tx_descriptor_plcp(rt2x00dev, skb, txdesc,
484 hwrate);
481} 485}
482 486
483static int rt2x00queue_write_tx_data(struct queue_entry *entry, 487static int rt2x00queue_write_tx_data(struct queue_entry *entry,
@@ -588,7 +592,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
588 * for our information. 592 * for our information.
589 */ 593 */
590 entry->skb = skb; 594 entry->skb = skb;
591 rt2x00queue_create_tx_descriptor(entry, &txdesc); 595 rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc);
592 596
593 /* 597 /*
594 * All information is retrieved from the skb->cb array, 598 * All information is retrieved from the skb->cb array,
@@ -707,7 +711,7 @@ int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev,
707 * after that we are free to use the skb->cb array 711 * after that we are free to use the skb->cb array
708 * for our information. 712 * for our information.
709 */ 713 */
710 rt2x00queue_create_tx_descriptor(intf->beacon, &txdesc); 714 rt2x00queue_create_tx_descriptor(rt2x00dev, intf->beacon->skb, &txdesc);
711 715
712 /* 716 /*
713 * Fill in skb descriptor 717 * Fill in skb descriptor