Commit 93331458 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville

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: default avatarIvo van Doorn <IvDoorn@gmail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 18c121d7
...@@ -1007,12 +1007,11 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1007,12 +1007,11 @@ static int rt2400pci_set_device_state(struct rt2x00_dev *rt2x00dev,
/* /*
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt2400pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2400pci_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; struct queue_entry_priv_pci *entry_priv = entry->priv_data;
__le32 *txd = entry_priv->desc; __le32 *txd = entry_priv->desc;
u32 word; u32 word;
...@@ -1096,7 +1095,7 @@ static void rt2400pci_write_beacon(struct queue_entry *entry, ...@@ -1096,7 +1095,7 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
/* /*
* Write the TX descriptor for the beacon. * Write the TX descriptor for the beacon.
*/ */
rt2400pci_write_tx_desc(rt2x00dev, entry->skb, txdesc); rt2400pci_write_tx_desc(entry, txdesc);
/* /*
* Dump beacon to userspace through debugfs. * Dump beacon to userspace through debugfs.
...@@ -1112,24 +1111,24 @@ static void rt2400pci_write_beacon(struct queue_entry *entry, ...@@ -1112,24 +1111,24 @@ static void rt2400pci_write_beacon(struct queue_entry *entry,
rt2x00pci_register_write(rt2x00dev, CSR14, reg); rt2x00pci_register_write(rt2x00dev, CSR14, reg);
} }
static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt2400pci_kick_tx_queue(struct data_queue *queue)
const enum data_queue_qid queue)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE)); rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue->qid == QID_AC_BE));
rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK)); rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue->qid == QID_AC_BK));
rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue == QID_ATIM)); rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue->qid == QID_ATIM));
rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
} }
static void rt2400pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt2400pci_kill_tx_queue(struct data_queue *queue)
const enum data_queue_qid qid)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
if (qid == QID_BEACON) { if (queue->qid == QID_BEACON) {
rt2x00pci_register_write(rt2x00dev, CSR14, 0); rt2x00pci_register_write(rt2x00dev, CSR14, 0);
} else { } else {
rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
......
...@@ -1161,12 +1161,11 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1161,12 +1161,11 @@ static int rt2500pci_set_device_state(struct rt2x00_dev *rt2x00dev,
/* /*
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2500pci_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; struct queue_entry_priv_pci *entry_priv = entry->priv_data;
__le32 *txd = entry_priv->desc; __le32 *txd = entry_priv->desc;
u32 word; u32 word;
...@@ -1249,7 +1248,7 @@ static void rt2500pci_write_beacon(struct queue_entry *entry, ...@@ -1249,7 +1248,7 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
/* /*
* Write the TX descriptor for the beacon. * Write the TX descriptor for the beacon.
*/ */
rt2500pci_write_tx_desc(rt2x00dev, entry->skb, txdesc); rt2500pci_write_tx_desc(entry, txdesc);
/* /*
* Dump beacon to userspace through debugfs. * Dump beacon to userspace through debugfs.
...@@ -1265,24 +1264,24 @@ static void rt2500pci_write_beacon(struct queue_entry *entry, ...@@ -1265,24 +1264,24 @@ static void rt2500pci_write_beacon(struct queue_entry *entry,
rt2x00pci_register_write(rt2x00dev, CSR14, reg); rt2x00pci_register_write(rt2x00dev, CSR14, reg);
} }
static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt2500pci_kick_tx_queue(struct data_queue *queue)
const enum data_queue_qid queue)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE)); rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue->qid == QID_AC_BE));
rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK)); rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue->qid == QID_AC_BK));
rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue == QID_ATIM)); rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, (queue->qid == QID_ATIM));
rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
} }
static void rt2500pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt2500pci_kill_tx_queue(struct data_queue *queue)
const enum data_queue_qid qid)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
if (qid == QID_BEACON) { if (queue->qid == QID_BEACON) {
rt2x00pci_register_write(rt2x00dev, CSR14, 0); rt2x00pci_register_write(rt2x00dev, CSR14, 0);
} else { } else {
rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
......
...@@ -1041,12 +1041,11 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1041,12 +1041,11 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev,
/* /*
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2500usb_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
__le32 *txd = (__le32 *) skb->data; __le32 *txd = (__le32 *) entry->skb->data;
u32 word; u32 word;
/* /*
...@@ -1129,7 +1128,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, ...@@ -1129,7 +1128,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry,
/* /*
* Write the TX descriptor for the beacon. * Write the TX descriptor for the beacon.
*/ */
rt2500usb_write_tx_desc(rt2x00dev, entry->skb, txdesc); rt2500usb_write_tx_desc(entry, txdesc);
/* /*
* Dump beacon to userspace through debugfs. * Dump beacon to userspace through debugfs.
......
...@@ -571,12 +571,11 @@ static __le32 *rt2800pci_get_txwi(struct queue_entry *entry) ...@@ -571,12 +571,11 @@ static __le32 *rt2800pci_get_txwi(struct queue_entry *entry)
return (__le32 *) entry->skb->data; return (__le32 *) entry->skb->data;
} }
static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2800pci_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; struct queue_entry_priv_pci *entry_priv = entry->priv_data;
__le32 *txd = entry_priv->desc; __le32 *txd = entry_priv->desc;
u32 word; u32 word;
...@@ -596,7 +595,7 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -596,7 +595,7 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_desc_write(txd, 0, word); rt2x00_desc_write(txd, 0, word);
rt2x00_desc_read(txd, 1, &word); rt2x00_desc_read(txd, 1, &word);
rt2x00_set_field32(&word, TXD_W1_SD_LEN1, skb->len); rt2x00_set_field32(&word, TXD_W1_SD_LEN1, entry->skb->len);
rt2x00_set_field32(&word, TXD_W1_LAST_SEC1, rt2x00_set_field32(&word, TXD_W1_LAST_SEC1,
!test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags)); !test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
rt2x00_set_field32(&word, TXD_W1_BURST, rt2x00_set_field32(&word, TXD_W1_BURST,
...@@ -627,41 +626,35 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -627,41 +626,35 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
/* /*
* TX data initialization * TX data initialization
*/ */
static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt2800pci_kick_tx_queue(struct data_queue *queue)
const enum data_queue_qid queue_idx)
{ {
struct data_queue *queue; struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
unsigned int idx, qidx = 0; unsigned int idx = queue->index[Q_INDEX];
unsigned int qidx = 0;
if (queue_idx > QID_HCCA && queue_idx != QID_MGMT)
return;
queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
idx = queue->index[Q_INDEX];
if (queue_idx == QID_MGMT) if (queue->qid == QID_MGMT)
qidx = 5; qidx = 5;
else else
qidx = queue_idx; qidx = queue->qid;
rt2800_register_write(rt2x00dev, TX_CTX_IDX(qidx), idx); rt2800_register_write(rt2x00dev, TX_CTX_IDX(qidx), idx);
} }
static void rt2800pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt2800pci_kill_tx_queue(struct data_queue *queue)
const enum data_queue_qid qid)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
if (qid == QID_BEACON) { if (queue->qid == QID_BEACON) {
rt2800_register_write(rt2x00dev, BCN_TIME_CFG, 0); rt2800_register_write(rt2x00dev, BCN_TIME_CFG, 0);
return; return;
} }
rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, &reg); rt2800_register_read(rt2x00dev, WPDMA_RST_IDX, &reg);
rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX0, (qid == QID_AC_BE)); rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX0, (queue->qid == QID_AC_BE));
rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX1, (qid == QID_AC_BK)); rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX1, (queue->qid == QID_AC_BK));
rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX2, (qid == QID_AC_VI)); rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX2, (queue->qid == QID_AC_VI));
rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX3, (qid == QID_AC_VO)); rt2x00_set_field32(&reg, WPDMA_RST_IDX_DTX_IDX3, (queue->qid == QID_AC_VO));
rt2800_register_write(rt2x00dev, WPDMA_RST_IDX, reg); rt2800_register_write(rt2x00dev, WPDMA_RST_IDX, reg);
} }
......
...@@ -329,12 +329,11 @@ static __le32 *rt2800usb_get_txwi(struct queue_entry *entry) ...@@ -329,12 +329,11 @@ static __le32 *rt2800usb_get_txwi(struct queue_entry *entry)
return (__le32 *) (entry->skb->data + TXINFO_DESC_SIZE); return (__le32 *) (entry->skb->data + TXINFO_DESC_SIZE);
} }
static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt2800usb_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
__le32 *txi = (__le32 *) skb->data; __le32 *txi = (__le32 *) entry->skb->data;
u32 word; u32 word;
/* /*
...@@ -342,7 +341,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -342,7 +341,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
*/ */
rt2x00_desc_read(txi, 0, &word); rt2x00_desc_read(txi, 0, &word);
rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN, rt2x00_set_field32(&word, TXINFO_W0_USB_DMA_TX_PKT_LEN,
skb->len - TXINFO_DESC_SIZE); entry->skb->len - TXINFO_DESC_SIZE);
rt2x00_set_field32(&word, TXINFO_W0_WIV, rt2x00_set_field32(&word, TXINFO_W0_WIV,
!test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags)); !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc->flags));
rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2); rt2x00_set_field32(&word, TXINFO_W0_QSEL, 2);
......
...@@ -559,18 +559,15 @@ struct rt2x00lib_ops { ...@@ -559,18 +559,15 @@ struct rt2x00lib_ops {
/* /*
* TX control handlers * TX control handlers
*/ */
void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev, void (*write_tx_desc) (struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc); struct txentry_desc *txdesc);
void (*write_tx_data) (struct queue_entry *entry, void (*write_tx_data) (struct queue_entry *entry,
struct txentry_desc *txdesc); struct txentry_desc *txdesc);
void (*write_beacon) (struct queue_entry *entry, void (*write_beacon) (struct queue_entry *entry,
struct txentry_desc *txdesc); struct txentry_desc *txdesc);
int (*get_tx_data_len) (struct queue_entry *entry); int (*get_tx_data_len) (struct queue_entry *entry);
void (*kick_tx_queue) (struct rt2x00_dev *rt2x00dev, void (*kick_tx_queue) (struct data_queue *queue);
const enum data_queue_qid queue); void (*kill_tx_queue) (struct data_queue *queue);
void (*kill_tx_queue) (struct rt2x00_dev *rt2x00dev,
const enum data_queue_qid queue);
/* /*
* RX control handlers * RX control handlers
......
...@@ -449,15 +449,14 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry, ...@@ -449,15 +449,14 @@ static void rt2x00queue_write_tx_descriptor(struct queue_entry *entry,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct data_queue *queue = entry->queue; struct data_queue *queue = entry->queue;
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, entry->skb, txdesc); queue->rt2x00dev->ops->lib->write_tx_desc(entry, txdesc);
/* /*
* All processing on the frame has been completed, this means * All processing on the frame has been completed, this means
* it is now ready to be dumped to userspace through debugfs. * it is now ready to be dumped to userspace through debugfs.
*/ */
rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, entry->skb); rt2x00debug_dump_frame(queue->rt2x00dev, DUMP_FRAME_TX, entry->skb);
} }
static void rt2x00queue_kick_tx_queue(struct queue_entry *entry, static void rt2x00queue_kick_tx_queue(struct queue_entry *entry,
...@@ -477,7 +476,7 @@ static void rt2x00queue_kick_tx_queue(struct queue_entry *entry, ...@@ -477,7 +476,7 @@ static void rt2x00queue_kick_tx_queue(struct queue_entry *entry,
*/ */
if (rt2x00queue_threshold(queue) || if (rt2x00queue_threshold(queue) ||
!test_bit(ENTRY_TXD_BURST, &txdesc->flags)) !test_bit(ENTRY_TXD_BURST, &txdesc->flags))
rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, queue->qid); rt2x00dev->ops->lib->kick_tx_queue(queue);
} }
int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb, int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
...@@ -591,7 +590,7 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev, ...@@ -591,7 +590,7 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
intf->beacon->skb = NULL; intf->beacon->skb = NULL;
if (!enable_beacon) { if (!enable_beacon) {
rt2x00dev->ops->lib->kill_tx_queue(rt2x00dev, QID_BEACON); rt2x00dev->ops->lib->kill_tx_queue(intf->beacon->queue);
mutex_unlock(&intf->beacon_skb_mutex); mutex_unlock(&intf->beacon_skb_mutex);
return 0; return 0;
} }
...@@ -719,7 +718,7 @@ void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev) ...@@ -719,7 +718,7 @@ void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev)
struct data_queue *queue; struct data_queue *queue;
txall_queue_for_each(rt2x00dev, queue) txall_queue_for_each(rt2x00dev, queue)
rt2x00dev->ops->lib->kill_tx_queue(rt2x00dev, queue->qid); rt2x00dev->ops->lib->kill_tx_queue(queue);
} }
void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev) void rt2x00queue_init_queues(struct rt2x00_dev *rt2x00dev)
......
...@@ -249,10 +249,8 @@ static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry) ...@@ -249,10 +249,8 @@ static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry)
} }
} }
void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, void rt2x00usb_kick_tx_queue(struct data_queue *queue)
const enum data_queue_qid qid)
{ {
struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, qid);
unsigned long irqflags; unsigned long irqflags;
unsigned int index; unsigned int index;
unsigned int index_done; unsigned int index_done;
...@@ -286,10 +284,8 @@ void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, ...@@ -286,10 +284,8 @@ void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
} }
EXPORT_SYMBOL_GPL(rt2x00usb_kick_tx_queue); EXPORT_SYMBOL_GPL(rt2x00usb_kick_tx_queue);
void rt2x00usb_kill_tx_queue(struct rt2x00_dev *rt2x00dev, void rt2x00usb_kill_tx_queue(struct data_queue *queue)
const enum data_queue_qid qid)
{ {
struct data_queue *queue = rt2x00queue_get_queue(rt2x00dev, qid);
struct queue_entry_priv_usb *entry_priv; struct queue_entry_priv_usb *entry_priv;
struct queue_entry_priv_usb_bcn *bcn_priv; struct queue_entry_priv_usb_bcn *bcn_priv;
unsigned int i; unsigned int i;
...@@ -300,8 +296,8 @@ void rt2x00usb_kill_tx_queue(struct rt2x00_dev *rt2x00dev, ...@@ -300,8 +296,8 @@ void rt2x00usb_kill_tx_queue(struct rt2x00_dev *rt2x00dev,
* the beacon guard byte. * the beacon guard byte.
*/ */
kill_guard = kill_guard =
(qid == QID_BEACON) && (queue->qid == QID_BEACON) &&
(test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)); (test_bit(DRIVER_REQUIRE_BEACON_GUARD, &queue->rt2x00dev->flags));
/* /*
* Cancel all entries. * Cancel all entries.
...@@ -447,7 +443,7 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev) ...@@ -447,7 +443,7 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
* The USB version of kill_tx_queue also works * The USB version of kill_tx_queue also works
* on the RX queue. * on the RX queue.
*/ */
rt2x00dev->ops->lib->kill_tx_queue(rt2x00dev, QID_RX); rt2x00dev->ops->lib->kill_tx_queue(rt2x00dev->rx);
} }
EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio); EXPORT_SYMBOL_GPL(rt2x00usb_disable_radio);
......
...@@ -379,25 +379,21 @@ struct queue_entry_priv_usb_bcn { ...@@ -379,25 +379,21 @@ struct queue_entry_priv_usb_bcn {
/** /**
* rt2x00usb_kick_tx_queue - Kick data queue * rt2x00usb_kick_tx_queue - Kick data queue
* @rt2x00dev: Pointer to &struct rt2x00_dev * @queue: Data queue to kick
* @qid: Data queue to kick
* *
* This will walk through all entries of the queue and push all pending * This will walk through all entries of the queue and push all pending
* frames to the hardware as a single burst. * frames to the hardware as a single burst.
*/ */
void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev, void rt2x00usb_kick_tx_queue(struct data_queue *queue);
const enum data_queue_qid qid);
/** /**
* rt2x00usb_kill_tx_queue - Kill data queue * rt2x00usb_kill_tx_queue - Kill data queue
* @rt2x00dev: Pointer to &struct rt2x00_dev * @queue: Data queue to kill
* @qid: Data queue to kill
* *
* This will walk through all entries of the queue and kill all * This will walk through all entries of the queue and kill all
* previously kicked frames before they can be send. * previously kicked frames before they can be send.
*/ */
void rt2x00usb_kill_tx_queue(struct rt2x00_dev *rt2x00dev, void rt2x00usb_kill_tx_queue(struct data_queue *queue);
const enum data_queue_qid qid);
/** /**
* rt2x00usb_watchdog - Watchdog for USB communication * rt2x00usb_watchdog - Watchdog for USB communication
......
...@@ -1766,12 +1766,11 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1766,12 +1766,11 @@ static int rt61pci_set_device_state(struct rt2x00_dev *rt2x00dev,
/* /*
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt61pci_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
struct queue_entry_priv_pci *entry_priv = skbdesc->entry->priv_data; struct queue_entry_priv_pci *entry_priv = entry->priv_data;
__le32 *txd = entry_priv->desc; __le32 *txd = entry_priv->desc;
u32 word; u32 word;
...@@ -1802,11 +1801,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1802,11 +1801,11 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
} }
rt2x00_desc_read(txd, 5, &word); rt2x00_desc_read(txd, 5, &word);
rt2x00_set_field32(&word, TXD_W5_PID_TYPE, skbdesc->entry->queue->qid); rt2x00_set_field32(&word, TXD_W5_PID_TYPE, entry->queue->qid);
rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE, rt2x00_set_field32(&word, TXD_W5_PID_SUBTYPE,
skbdesc->entry->entry_idx); skbdesc->entry->entry_idx);
rt2x00_set_field32(&word, TXD_W5_TX_POWER, rt2x00_set_field32(&word, TXD_W5_TX_POWER,
TXPOWER_TO_DEV(rt2x00dev->tx_power)); TXPOWER_TO_DEV(entry->queue->rt2x00dev->tx_power));
rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
rt2x00_desc_write(txd, 5, word); rt2x00_desc_write(txd, 5, word);
...@@ -1882,7 +1881,7 @@ static void rt61pci_write_beacon(struct queue_entry *entry, ...@@ -1882,7 +1881,7 @@ static void rt61pci_write_beacon(struct queue_entry *entry,
/* /*
* Write the TX descriptor for the beacon. * Write the TX descriptor for the beacon.
*/ */
rt61pci_write_tx_desc(rt2x00dev, entry->skb, txdesc); rt61pci_write_tx_desc(entry, txdesc);
/* /*
* Dump beacon to userspace through debugfs. * Dump beacon to userspace through debugfs.
...@@ -1918,34 +1917,34 @@ static void rt61pci_write_beacon(struct queue_entry *entry, ...@@ -1918,34 +1917,34 @@ static void rt61pci_write_beacon(struct queue_entry *entry,
entry->skb = NULL; entry->skb = NULL;
} }
static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt61pci_kick_tx_queue(struct data_queue *queue)
const enum data_queue_qid queue)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg); rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg);
rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC0, (queue == QID_AC_BE)); rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC0, (queue->qid == QID_AC_BE));
rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC1, (queue == QID_AC_BK)); rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC1, (queue->qid == QID_AC_BK));
rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC2, (queue == QID_AC_VI)); rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC2, (queue->qid == QID_AC_VI));
rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC3, (queue == QID_AC_VO)); rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC3, (queue->qid == QID_AC_VO));
rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg); rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg);
} }
static void rt61pci_kill_tx_queue(struct rt2x00_dev *rt2x00dev, static void rt61pci_kill_tx_queue(struct data_queue *queue)
const enum data_queue_qid qid)
{ {
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
u32 reg; u32 reg;
if (qid == QID_BEACON) { if (queue->qid == QID_BEACON) {
rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, 0); rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, 0);
return; return;
} }
rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg); rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg);
rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC0, (qid == QID_AC_BE)); rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC0, (queue->qid == QID_AC_BE));
rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC1, (qid == QID_AC_BK)); rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC1, (queue->qid == QID_AC_BK));
rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC2, (qid == QID_AC_VI)); rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC2, (queue->qid == QID_AC_VI));
rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC3, (qid == QID_AC_VO)); rt2x00_set_field32(&reg, TX_CNTL_CSR_ABORT_TX_AC3, (queue->qid == QID_AC_VO));
rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg); rt2x00pci_register_write(rt2x00dev, TX_CNTL_CSR, reg);
} }
......
...@@ -1426,12 +1426,11 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev, ...@@ -1426,12 +1426,11 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
/* /*
* TX descriptor initialization * TX descriptor initialization
*/ */
static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, static void rt73usb_write_tx_desc(struct queue_entry *entry,
struct sk_buff *skb,
struct txentry_desc *txdesc) struct txentry_desc *txdesc)
{ {
struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
__le32 *txd = (__le32 *) skb->data; __le32 *txd = (__le32 *) entry->skb->data;
u32 word; u32 word;
/* /*
...@@ -1487,7 +1486,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, ...@@ -1487,7 +1486,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
rt2x00_desc_read(txd, 5, &word); rt2x00_desc_read(txd, 5, &word);
rt2x00_set_field32(&word, TXD_W5_TX_POWER, rt2x00_set_field32(&word, TXD_W5_TX_POWER,
TXPOWER_TO_DEV(rt2x00dev->tx_power)); TXPOWER_TO_DEV(entry->queue->rt2x00dev->tx_power));
rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
rt2x00_desc_write(txd, 5, word); rt2x00_desc_write(txd, 5, word);
...@@ -1526,7 +1525,7 @@ static void rt73usb_write_beacon(struct queue_entry *entry, ...@@ -1526,7 +1525,7 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
/* /*
* Write the TX descriptor for the beacon. * Write the TX descriptor for the beacon.
*/ */
rt73usb_write_tx_desc(rt2x00dev, entry->skb, txdesc); rt73usb_write_tx_desc(entry, txdesc);
/* /*
* Dump beacon to userspace through debugfs. * Dump beacon to userspace through debugfs.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment