aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00queue.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/rt2x00queue.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/rt2x00queue.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 5cf4c2f59260..e69ef4b19239 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -30,13 +30,13 @@
30#include "rt2x00lib.h" 30#include "rt2x00lib.h"
31 31
32void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, 32void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
33 struct txentry_desc *txdesc, 33 struct txentry_desc *txdesc)
34 struct ieee80211_tx_control *control)
35{ 34{
36 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; 35 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
36 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
37 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; 37 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data;
38 struct ieee80211_rate *rate = 38 struct ieee80211_rate *rate =
39 ieee80211_get_tx_rate(rt2x00dev->hw, control); 39 ieee80211_get_tx_rate(rt2x00dev->hw, tx_info);
40 const struct rt2x00_rate *hwrate; 40 const struct rt2x00_rate *hwrate;
41 unsigned int data_length; 41 unsigned int data_length;
42 unsigned int duration; 42 unsigned int duration;
@@ -64,7 +64,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
64 /* 64 /*
65 * Check whether this frame is to be acked. 65 * Check whether this frame is to be acked.
66 */ 66 */
67 if (!(control->flags & IEEE80211_TXCTL_NO_ACK)) 67 if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK))
68 __set_bit(ENTRY_TXD_ACK, &txdesc->flags); 68 __set_bit(ENTRY_TXD_ACK, &txdesc->flags);
69 69
70 /* 70 /*
@@ -72,23 +72,20 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
72 */ 72 */
73 if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { 73 if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) {
74 __set_bit(ENTRY_TXD_BURST, &txdesc->flags); 74 __set_bit(ENTRY_TXD_BURST, &txdesc->flags);
75 if (is_rts_frame(frame_control)) { 75 if (is_rts_frame(frame_control))
76 __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags); 76 __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags);
77 __set_bit(ENTRY_TXD_ACK, &txdesc->flags); 77 else
78 } else {
79 __set_bit(ENTRY_TXD_CTS_FRAME, &txdesc->flags); 78 __set_bit(ENTRY_TXD_CTS_FRAME, &txdesc->flags);
80 __clear_bit(ENTRY_TXD_ACK, &txdesc->flags); 79 if (tx_info->control.rts_cts_rate_idx >= 0)
81 }
82 if (control->rts_cts_rate_idx >= 0)
83 rate = 80 rate =
84 ieee80211_get_rts_cts_rate(rt2x00dev->hw, control); 81 ieee80211_get_rts_cts_rate(rt2x00dev->hw, tx_info);
85 } 82 }
86 83
87 /* 84 /*
88 * Determine retry information. 85 * Determine retry information.
89 */ 86 */
90 txdesc->retry_limit = control->retry_limit; 87 txdesc->retry_limit = tx_info->control.retry_limit;
91 if (control->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) 88 if (tx_info->flags & IEEE80211_TX_CTL_LONG_RETRY_LIMIT)
92 __set_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags); 89 __set_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags);
93 90
94 /* 91 /*
@@ -113,7 +110,7 @@ void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
113 */ 110 */
114 if (test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)) { 111 if (test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags)) {
115 txdesc->ifs = IFS_SIFS; 112 txdesc->ifs = IFS_SIFS;
116 } else if (control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) { 113 } else if (tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) {
117 __set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags); 114 __set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags);
118 txdesc->ifs = IFS_BACKOFF; 115 txdesc->ifs = IFS_BACKOFF;
119 } else { 116 } else {
@@ -179,8 +176,10 @@ void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
179 176
180 /* 177 /*
181 * We are done writing the frame to the queue entry, 178 * We are done writing the frame to the queue entry,
182 * if this entry is a RTS of CTS-to-self frame we are done, 179 * also kick the queue in case the correct flags are set,
183 * otherwise we need to kick the queue. 180 * note that this will automatically filter beacons and
181 * RTS/CTS frames since those frames don't have this flag
182 * set.
184 */ 183 */
185 if (rt2x00dev->ops->lib->kick_tx_queue && 184 if (rt2x00dev->ops->lib->kick_tx_queue &&
186 !(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED)) 185 !(skbdesc->flags & FRAME_DESC_DRIVER_GENERATED))