mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2024-11-22 13:35:00 +00:00
ctrl vendor req value is always 0x05
The bRequest value for the vendor specific control requests sent by this driver is always 0x05. Replace the function parameter with the define from usb_ops.h. This patch is an adaptation of commit eeb4661560ff ("staging: rtl8188eu: ctrl vendor req value is always 0x05") for the new r8188eu driver. Link: https://lore.kernel.org/r/20210818200041.10870-1-martin@kaiser.cx
This commit is contained in:
parent
64831e6777
commit
28e0bba794
@ -319,7 +319,6 @@ int usb_async_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||||||
|
|
||||||
u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -327,7 +326,6 @@ u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
u8 data = 0;
|
u8 data = 0;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x01;/* read_in */
|
requesttype = 0x01;/* read_in */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
@ -340,8 +338,7 @@ u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
usbctrl_vendorreq(pintfhdl, wvalue, index, &data, len, requesttype);
|
||||||
&data, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -349,7 +346,6 @@ u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
|
|
||||||
u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -357,7 +353,6 @@ u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
u16 data = 0;
|
u16 data = 0;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x01;/* read_in */
|
requesttype = 0x01;/* read_in */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
@ -370,8 +365,7 @@ u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
usbctrl_vendorreq(pintfhdl, wvalue, index, &data, len, requesttype);
|
||||||
&data, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -380,7 +374,6 @@ u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
|
|
||||||
u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -388,7 +381,6 @@ u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
u32 data = 0;
|
u32 data = 0;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x01;/* read_in */
|
requesttype = 0x01;/* read_in */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
@ -401,8 +393,7 @@ u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
usbctrl_vendorreq(pintfhdl, wvalue, index, &data, len, requesttype);
|
||||||
&data, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -410,7 +401,6 @@ u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
|
|
||||||
int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -419,7 +409,6 @@ int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x00;/* write_out */
|
requesttype = 0x00;/* write_out */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
@ -433,8 +422,7 @@ int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
ret = usbctrl_vendorreq(pintfhdl, wvalue, index, &data, len, requesttype);
|
||||||
&data, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -442,7 +430,6 @@ int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
|||||||
|
|
||||||
int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -451,7 +438,6 @@ int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x00;/* write_out */
|
requesttype = 0x00;/* write_out */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
@ -465,8 +451,7 @@ int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
ret = usbctrl_vendorreq(pintfhdl, wvalue, index, &data, len, requesttype);
|
||||||
&data, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -475,7 +460,6 @@ int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
|||||||
|
|
||||||
int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -484,7 +468,6 @@ int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x00;/* write_out */
|
requesttype = 0x00;/* write_out */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
@ -498,8 +481,7 @@ int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
ret = usbctrl_vendorreq(pintfhdl, wvalue, index, &data, len, requesttype);
|
||||||
&data, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -508,7 +490,6 @@ int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||||||
|
|
||||||
int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
||||||
{
|
{
|
||||||
u8 request;
|
|
||||||
u8 requesttype;
|
u8 requesttype;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
u16 index;
|
||||||
@ -517,15 +498,13 @@ int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
||||||
request = 0x05;
|
|
||||||
requesttype = 0x00;/* write_out */
|
requesttype = 0x00;/* write_out */
|
||||||
index = 0;/* n/a */
|
index = 0;/* n/a */
|
||||||
|
|
||||||
wvalue = (u16)(addr & 0x0000ffff);
|
wvalue = (u16)(addr & 0x0000ffff);
|
||||||
len = length;
|
len = length;
|
||||||
_rtw_memcpy(buf, pdata, len);
|
_rtw_memcpy(buf, pdata, len);
|
||||||
ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index,
|
ret = usbctrl_vendorreq(pintfhdl, wvalue, index, buf, len, requesttype);
|
||||||
buf, len, requesttype);
|
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -60,7 +60,7 @@ void usb_read_port_cancel(struct intf_hdl *pintfhdl);
|
|||||||
u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
|
u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
|
||||||
void usb_write_port_cancel(struct intf_hdl *pintfhdl);
|
void usb_write_port_cancel(struct intf_hdl *pintfhdl);
|
||||||
|
|
||||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
||||||
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
|
#ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ
|
||||||
int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
|
int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
|
||||||
u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
||||||
|
@ -23,7 +23,7 @@ struct rtw_async_write_data {
|
|||||||
struct usb_ctrlrequest dr;
|
struct usb_ctrlrequest dr;
|
||||||
};
|
};
|
||||||
|
|
||||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
|
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
|
||||||
{
|
{
|
||||||
_adapter *padapter = pintfhdl->padapter;
|
_adapter *padapter = pintfhdl->padapter;
|
||||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||||
@ -106,7 +106,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde
|
|||||||
_rtw_memcpy(pIo_buf, pdata, len);
|
_rtw_memcpy(pIo_buf, pdata, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
||||||
|
|
||||||
if (status == len) { /* Success this control transfer. */
|
if (status == len) { /* Success this control transfer. */
|
||||||
rtw_reset_continual_io_error(pdvobjpriv);
|
rtw_reset_continual_io_error(pdvobjpriv);
|
||||||
|
Loading…
Reference in New Issue
Block a user