diff options
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 14 |
4 files changed, 26 insertions, 18 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 833b15751292..6f1eb5824d2d 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -427,8 +427,10 @@ int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, | |||
427 | } | 427 | } |
428 | EXPORT_SYMBOL_GPL(rt2800_load_firmware); | 428 | EXPORT_SYMBOL_GPL(rt2800_load_firmware); |
429 | 429 | ||
430 | void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc) | 430 | void rt2800_write_tx_data(struct queue_entry *entry, |
431 | struct txentry_desc *txdesc) | ||
431 | { | 432 | { |
433 | __le32 *txwi = rt2800_drv_get_txwi(entry); | ||
432 | u32 word; | 434 | u32 word; |
433 | 435 | ||
434 | /* | 436 | /* |
@@ -479,7 +481,7 @@ void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc) | |||
479 | _rt2x00_desc_write(txwi, 2, 0 /* skbdesc->iv[0] */); | 481 | _rt2x00_desc_write(txwi, 2, 0 /* skbdesc->iv[0] */); |
480 | _rt2x00_desc_write(txwi, 3, 0 /* skbdesc->iv[1] */); | 482 | _rt2x00_desc_write(txwi, 3, 0 /* skbdesc->iv[1] */); |
481 | } | 483 | } |
482 | EXPORT_SYMBOL_GPL(rt2800_write_txwi); | 484 | EXPORT_SYMBOL_GPL(rt2800_write_tx_data); |
483 | 485 | ||
484 | static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxwi_w2) | 486 | static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxwi_w2) |
485 | { | 487 | { |
@@ -601,7 +603,7 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc) | |||
601 | /* | 603 | /* |
602 | * Add the TXWI for the beacon to the skb. | 604 | * Add the TXWI for the beacon to the skb. |
603 | */ | 605 | */ |
604 | rt2800_write_txwi((__le32 *)entry->skb->data, txdesc); | 606 | rt2800_write_tx_data(entry, txdesc); |
605 | 607 | ||
606 | /* | 608 | /* |
607 | * Dump beacon to userspace through debugfs. | 609 | * Dump beacon to userspace through debugfs. |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h index 091641e3c5e2..8f975180727f 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/rt2x00/rt2800lib.h | |||
@@ -44,6 +44,7 @@ struct rt2800_ops { | |||
44 | int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, | 44 | int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, |
45 | const u8 *data, const size_t len); | 45 | const u8 *data, const size_t len); |
46 | int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); | 46 | int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); |
47 | __le32 *(*drv_get_txwi)(struct queue_entry *entry); | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev, | 50 | static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev, |
@@ -126,6 +127,13 @@ static inline int rt2800_drv_init_registers(struct rt2x00_dev *rt2x00dev) | |||
126 | return rt2800ops->drv_init_registers(rt2x00dev); | 127 | return rt2800ops->drv_init_registers(rt2x00dev); |
127 | } | 128 | } |
128 | 129 | ||
130 | static inline __le32 *rt2800_drv_get_txwi(struct queue_entry *entry) | ||
131 | { | ||
132 | const struct rt2800_ops *rt2800ops = entry->queue->rt2x00dev->ops->drv; | ||
133 | |||
134 | return rt2800ops->drv_get_txwi(entry); | ||
135 | } | ||
136 | |||
129 | void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, | 137 | void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, |
130 | const u8 command, const u8 token, | 138 | const u8 command, const u8 token, |
131 | const u8 arg0, const u8 arg1); | 139 | const u8 arg0, const u8 arg1); |
@@ -135,7 +143,8 @@ int rt2800_check_firmware(struct rt2x00_dev *rt2x00dev, | |||
135 | int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, | 143 | int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, |
136 | const u8 *data, const size_t len); | 144 | const u8 *data, const size_t len); |
137 | 145 | ||
138 | void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc); | 146 | void rt2800_write_tx_data(struct queue_entry *entry, |
147 | struct txentry_desc *txdesc); | ||
139 | void rt2800_process_rxwi(struct queue_entry *entry, struct rxdone_entry_desc *txdesc); | 148 | void rt2800_process_rxwi(struct queue_entry *entry, struct rxdone_entry_desc *txdesc); |
140 | 149 | ||
141 | void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc); | 150 | void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc); |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 39b3846fa340..f415f6d5f601 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -566,15 +566,11 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
566 | /* | 566 | /* |
567 | * TX descriptor initialization | 567 | * TX descriptor initialization |
568 | */ | 568 | */ |
569 | static void rt2800pci_write_tx_data(struct queue_entry* entry, | 569 | static __le32 *rt2800pci_get_txwi(struct queue_entry *entry) |
570 | struct txentry_desc *txdesc) | ||
571 | { | 570 | { |
572 | __le32 *txwi = (__le32 *) entry->skb->data; | 571 | return (__le32 *) entry->skb->data; |
573 | |||
574 | rt2800_write_txwi(txwi, txdesc); | ||
575 | } | 572 | } |
576 | 573 | ||
577 | |||
578 | static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | 574 | static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, |
579 | struct sk_buff *skb, | 575 | struct sk_buff *skb, |
580 | struct txentry_desc *txdesc) | 576 | struct txentry_desc *txdesc) |
@@ -1011,6 +1007,7 @@ static const struct rt2800_ops rt2800pci_rt2800_ops = { | |||
1011 | .regbusy_read = rt2x00pci_regbusy_read, | 1007 | .regbusy_read = rt2x00pci_regbusy_read, |
1012 | .drv_write_firmware = rt2800pci_write_firmware, | 1008 | .drv_write_firmware = rt2800pci_write_firmware, |
1013 | .drv_init_registers = rt2800pci_init_registers, | 1009 | .drv_init_registers = rt2800pci_init_registers, |
1010 | .drv_get_txwi = rt2800pci_get_txwi, | ||
1014 | }; | 1011 | }; |
1015 | 1012 | ||
1016 | static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | 1013 | static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { |
@@ -1030,7 +1027,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | |||
1030 | .reset_tuner = rt2800_reset_tuner, | 1027 | .reset_tuner = rt2800_reset_tuner, |
1031 | .link_tuner = rt2800_link_tuner, | 1028 | .link_tuner = rt2800_link_tuner, |
1032 | .write_tx_desc = rt2800pci_write_tx_desc, | 1029 | .write_tx_desc = rt2800pci_write_tx_desc, |
1033 | .write_tx_data = rt2800pci_write_tx_data, | 1030 | .write_tx_data = rt2800_write_tx_data, |
1034 | .write_beacon = rt2800_write_beacon, | 1031 | .write_beacon = rt2800_write_beacon, |
1035 | .kick_tx_queue = rt2800pci_kick_tx_queue, | 1032 | .kick_tx_queue = rt2800pci_kick_tx_queue, |
1036 | .kill_tx_queue = rt2800pci_kill_tx_queue, | 1033 | .kill_tx_queue = rt2800pci_kill_tx_queue, |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 5a2dfe87c6b6..9084b9a36b57 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -320,15 +320,14 @@ static int rt2800usb_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
320 | /* | 320 | /* |
321 | * TX descriptor initialization | 321 | * TX descriptor initialization |
322 | */ | 322 | */ |
323 | static void rt2800usb_write_tx_data(struct queue_entry* entry, | 323 | static __le32 *rt2800usb_get_txwi(struct queue_entry *entry) |
324 | struct txentry_desc *txdesc) | ||
325 | { | 324 | { |
326 | __le32 *txwi = (__le32 *) (entry->skb->data + TXINFO_DESC_SIZE); | 325 | if (entry->queue->qid == QID_BEACON) |
327 | 326 | return (__le32 *) (entry->skb->data); | |
328 | rt2800_write_txwi(txwi, txdesc); | 327 | else |
328 | return (__le32 *) (entry->skb->data + TXINFO_DESC_SIZE); | ||
329 | } | 329 | } |
330 | 330 | ||
331 | |||
332 | static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | 331 | static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, |
333 | struct sk_buff *skb, | 332 | struct sk_buff *skb, |
334 | struct txentry_desc *txdesc) | 333 | struct txentry_desc *txdesc) |
@@ -549,6 +548,7 @@ static const struct rt2800_ops rt2800usb_rt2800_ops = { | |||
549 | .regbusy_read = rt2x00usb_regbusy_read, | 548 | .regbusy_read = rt2x00usb_regbusy_read, |
550 | .drv_write_firmware = rt2800usb_write_firmware, | 549 | .drv_write_firmware = rt2800usb_write_firmware, |
551 | .drv_init_registers = rt2800usb_init_registers, | 550 | .drv_init_registers = rt2800usb_init_registers, |
551 | .drv_get_txwi = rt2800usb_get_txwi, | ||
552 | }; | 552 | }; |
553 | 553 | ||
554 | static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { | 554 | static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { |
@@ -566,7 +566,7 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { | |||
566 | .link_tuner = rt2800_link_tuner, | 566 | .link_tuner = rt2800_link_tuner, |
567 | .watchdog = rt2x00usb_watchdog, | 567 | .watchdog = rt2x00usb_watchdog, |
568 | .write_tx_desc = rt2800usb_write_tx_desc, | 568 | .write_tx_desc = rt2800usb_write_tx_desc, |
569 | .write_tx_data = rt2800usb_write_tx_data, | 569 | .write_tx_data = rt2800_write_tx_data, |
570 | .write_beacon = rt2800_write_beacon, | 570 | .write_beacon = rt2800_write_beacon, |
571 | .get_tx_data_len = rt2800usb_get_tx_data_len, | 571 | .get_tx_data_len = rt2800usb_get_tx_data_len, |
572 | .kick_tx_queue = rt2x00usb_kick_tx_queue, | 572 | .kick_tx_queue = rt2x00usb_kick_tx_queue, |