Commit c4d63244 authored by Johannes Stezenbach's avatar Johannes Stezenbach Committed by John W. Linville

rt2x00: simplify txstatus_fifo handling

Signed-off-by: default avatarJohannes Stezenbach <js@sig21.net>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 97e2c402
...@@ -688,14 +688,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) ...@@ -688,14 +688,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
u32 status; u32 status;
u8 qid; u8 qid;
while (!kfifo_is_empty(&rt2x00dev->txstatus_fifo)) { while (kfifo_get(&rt2x00dev->txstatus_fifo, &status)) {
/* Now remove the tx status from the FIFO */
if (kfifo_out(&rt2x00dev->txstatus_fifo, &status,
sizeof(status)) != sizeof(status)) {
WARN_ON(1);
break;
}
qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE); qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE);
if (qid >= QID_RX) { if (qid >= QID_RX) {
/* /*
...@@ -803,14 +796,7 @@ static void rt2800pci_txstatus_interrupt(struct rt2x00_dev *rt2x00dev) ...@@ -803,14 +796,7 @@ static void rt2800pci_txstatus_interrupt(struct rt2x00_dev *rt2x00dev)
if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID)) if (!rt2x00_get_field32(status, TX_STA_FIFO_VALID))
break; break;
if (kfifo_is_full(&rt2x00dev->txstatus_fifo)) { if (!kfifo_put(&rt2x00dev->txstatus_fifo, &status)) {
WARNING(rt2x00dev, "TX status FIFO overrun,"
" drop tx status report.\n");
break;
}
if (kfifo_in(&rt2x00dev->txstatus_fifo, &status,
sizeof(status)) != sizeof(status)) {
WARNING(rt2x00dev, "TX status FIFO overrun," WARNING(rt2x00dev, "TX status FIFO overrun,"
"drop tx status report.\n"); "drop tx status report.\n");
break; break;
......
...@@ -908,7 +908,7 @@ struct rt2x00_dev { ...@@ -908,7 +908,7 @@ struct rt2x00_dev {
/* /*
* FIFO for storing tx status reports between isr and tasklet. * FIFO for storing tx status reports between isr and tasklet.
*/ */
struct kfifo txstatus_fifo; DECLARE_KFIFO_PTR(txstatus_fifo, u32);
/* /*
* Tasklet for processing tx status reports (rt2800pci). * Tasklet for processing tx status reports (rt2800pci).
......
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