aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2010-08-23 13:53:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-25 14:34:54 -0400
commit933314582ee5db00123683cf4c4d713ec9add306 (patch)
tree6d0be156f19ad0f4b78da5577f56995beb43a15a /drivers/net/wireless/rt2x00/rt2500pci.c
parent18c121d7558a550e8e48956fbd389759a850ab53 (diff)
rt2x00: Simplify arguments to rt2x00 driver callback functions
write_tx_desc shouldn't pass a rt2x00dev and skb pointer, instead it should use the same format as other TX frame callback functions, which is passing the data_entry pointer which contains all the information which is needed to work on a TX frame. Most callers of the kick_tx_queue and kill_tx_queue already have the data_queue pointer, so rather then sending the QID with the given function, when the driver requests a new pointer to the data_queue, it is more efficient to just send the data_queue pointer directly. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index c2a555d5376b..21f45810fd1e 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1161,12 +1161,11 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
1161/* 1161/*
1162 * TX descriptor initialization 1162 * TX descriptor initialization
1163 */ 1163 */
1164static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, 1164static void rt2500pci_write_tx_desc(struct queue_entry *entry,
1165 struct sk_buff *skb,
1166 struct txentry_desc *txdesc) 1165 struct txentry_desc *txdesc)
1167{ 1166{
1168 struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); 1167 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
1169 struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; 1168 struct queue_entry_priv_pci *entry_priv = entry->priv_data;
1170 __le32 *txd = entry_priv->desc; 1169 __le32 *txd = entry_priv->desc;
1171 u32 word; 1170 u32 word;
1172 1171
@@ -1249,7 +1248,7 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
1249 /* 1248 /*
1250 * Write the TX descriptor for the beacon. 1249 * Write the TX descriptor for the beacon.
1251 */ 1250 */
1252 rt2500pci_write_tx_desc(rt2x00dev, entry->skb, txdesc); 1251 rt2500pci_write_tx_desc(entry, txdesc);
1253 1252
1254 /* 1253 /*
1255 * Dump beacon to userspace through debugfs. 1254 * Dump beacon to userspace through debugfs.
@@ -1265,24 +1264,24 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
1265 rt2x00pci_register_write(rt2x00dev, CSR14, reg); 1264 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1266} 1265}
1267 1266
1268static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, 1267static void rt2500pci_kick_tx_queue(struct data_queue *queue)
1269 const enum data_queue_qid queue)
1270{ 1268{
1269 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
1271 u32 reg; 1270 u32 reg;
1272 1271
1273 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); 1272 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
1274 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE)); 1273 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue->qid == QID_AC_BE));
1275 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK)); 1274 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue->qid == QID_AC_BK));
1276 rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue == QID_ATIM)); 1275 rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue->qid == QID_ATIM));
1277 rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); 1276 rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
1278} 1277}
1279 1278
1280static void rt2500pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev, 1279static void rt2500pci_kill_tx_queue(struct data_queue *queue)
1281 const enum data_queue_qid qid)
1282{ 1280{
1281 struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
1283 u32 reg; 1282 u32 reg;
1284 1283
1285 if (qid == QID_BEACON) { 1284 if (queue->qid == QID_BEACON) {
1286 rt2x00pci_register_write(rt2x00dev, CSR14, 0); 1285 rt2x00pci_register_write(rt2x00dev, CSR14, 0);
1287 } else { 1286 } else {
1288 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); 1287 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);