Skip to content

Commit b592932

Browse files
martin-kaisergregkh
authored andcommitted
staging: r8188eu: Revert "staging: r8188eu: simplify rtw_get_ff_hwaddr"
This reverts commit fd48124 ("staging: r8188eu: simplify rtw_get_ff_hwaddr"). The cleanup in this commit removes the qsel to addr mappings in rtw_get_ff_hwaddr. The underlying assumption is that rtw_write_port uses its addr parameter only for the high_queue check. This is obviously incorrect as rtw_write_port calls ffaddr2pipehdl(pdvobj, addr); where addr is mapped to a usb bulk endpoint. Unfortunately, testing did not show any problems. The Edimax V2 on which I tested has two bulk out endpoints. I guess that with the incorrect patch, addr could only be 0 (no high queue) or 6 (high queue), both of which were mapped to the first bulk out endpoint. Data transfers did still work... Fixes: fd48124 ("staging: r8188eu: simplify rtw_get_ff_hwaddr") Signed-off-by: Martin Kaiser <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c17ffe0 commit b592932

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

drivers/staging/r8188eu/core/rtw_xmit.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,9 +1568,39 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
15681568

15691569
u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe)
15701570
{
1571+
u32 addr;
15711572
struct pkt_attrib *pattrib = &pxmitframe->attrib;
15721573

1573-
return pattrib->qsel == 0x11 ? HIGH_QUEUE_INX : 0;
1574+
switch (pattrib->qsel) {
1575+
case 0:
1576+
case 3:
1577+
addr = BE_QUEUE_INX;
1578+
break;
1579+
case 1:
1580+
case 2:
1581+
addr = BK_QUEUE_INX;
1582+
break;
1583+
case 4:
1584+
case 5:
1585+
addr = VI_QUEUE_INX;
1586+
break;
1587+
case 6:
1588+
case 7:
1589+
addr = VO_QUEUE_INX;
1590+
break;
1591+
case 0x10:
1592+
addr = BCN_QUEUE_INX;
1593+
break;
1594+
case 0x11:/* BC/MC in PS (HIQ) */
1595+
addr = HIGH_QUEUE_INX;
1596+
break;
1597+
case 0x12:
1598+
default:
1599+
addr = MGT_QUEUE_INX;
1600+
break;
1601+
}
1602+
1603+
return addr;
15741604
}
15751605

15761606
/*

drivers/staging/r8188eu/include/rtw_xmit.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
#define XMIT_BE_QUEUE (2)
2727
#define XMIT_BK_QUEUE (3)
2828

29+
#define VO_QUEUE_INX 0
30+
#define VI_QUEUE_INX 1
31+
#define BE_QUEUE_INX 2
32+
#define BK_QUEUE_INX 3
33+
#define BCN_QUEUE_INX 4
34+
#define MGT_QUEUE_INX 5
2935
#define HIGH_QUEUE_INX 6
36+
#define TXCMD_QUEUE_INX 7
3037

3138
#define HW_QUEUE_ENTRY 8
3239

0 commit comments

Comments
 (0)