use actual request type as parameter

At the moment, usbctrl_vendorreq's requesttype parameter must be set to
1 for reading and 0 for writing. It's then converted to the actual
bmRequestType for the USB control request. We can simplify the code and
avoid this conversion if the caller passes the actual bmRequestType.

This patch is an adaptation of commit 788fde031027 ("staging: rtl8188eu:
use actual request type as parameter") for the new r8188eu driver.

Link: https://lore.kernel.org/r/20210821164859.4351-3-martin@kaiser.cx
This commit is contained in:
Carlos Garces
2021-10-14 15:56:07 +02:00
parent a0549c5041
commit 4ddd7165fb
3 changed files with 16 additions and 29 deletions

View File

@@ -22,10 +22,6 @@
#define REALTEK_USB_VENQT_CMD_IDX 0x00
#define REALTEK_USB_IN_INT_EP_IDX 1
enum {
VENDOR_WRITE = 0x00,
VENDOR_READ = 0x01,
};
#define ALIGNMENT_UNIT 16
#define MAX_VENDOR_REQ_CMD_SIZE 254 /* 8188cu SIE Support */
#define MAX_USB_IO_CTL_SIZE (MAX_VENDOR_REQ_CMD_SIZE + ALIGNMENT_UNIT)