mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2024-11-22 13:35:00 +00:00
ctrl vendor req index is not used
The index for r8188eu's vendor-specific control requests is not used. Remove the index parameter from usbctrl_vendorreq and pass index 0 to usb_control_msg. This patch is an adaptation of commit 3d0be94f62fd ("staging: rtl8188eu: ctrl vendor req index is not used") for the new r8188eu driver. Link: https://lore.kernel.org/r/20210818200041.10870-2-martin@kaiser.cx
This commit is contained in:
parent
4ddd7165fb
commit
507d1c07e0
@ -262,15 +262,13 @@ int usb_write_async(struct usb_device *udev, u32 addr, void *pdata, u16 len)
|
|||||||
{
|
{
|
||||||
u8 request;
|
u8 request;
|
||||||
u16 wvalue;
|
u16 wvalue;
|
||||||
u16 index;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
request = REALTEK_USB_VENQT_CMD_REQ;
|
request = REALTEK_USB_VENQT_CMD_REQ;
|
||||||
index = REALTEK_USB_VENQT_CMD_IDX;/* n/a */
|
|
||||||
|
|
||||||
wvalue = (u16)(addr & 0x0000ffff);
|
wvalue = (u16)(addr & 0x0000ffff);
|
||||||
|
|
||||||
ret = _usbctrl_vendorreq_async_write(udev, request, wvalue, index, pdata, len, REALTEK_USB_VENQT_WRITE);
|
ret = _usbctrl_vendorreq_async_write(udev, request, wvalue, pdata, len, REALTEK_USB_VENQT_WRITE);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -327,7 +325,7 @@ u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usbctrl_vendorreq(pintfhdl, wvalue, 0, &data, 1, REALTEK_USB_VENQT_READ);
|
usbctrl_vendorreq(pintfhdl, wvalue, &data, 1, REALTEK_USB_VENQT_READ);
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -344,7 +342,7 @@ u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usbctrl_vendorreq(pintfhdl, wvalue, 0, &data, 2, REALTEK_USB_VENQT_READ);
|
usbctrl_vendorreq(pintfhdl, wvalue, &data, 2, REALTEK_USB_VENQT_READ);
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -362,7 +360,7 @@ u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
usbctrl_vendorreq(pintfhdl, wvalue, 0, &data, 4, REALTEK_USB_VENQT_READ);
|
usbctrl_vendorreq(pintfhdl, wvalue, &data, 4, REALTEK_USB_VENQT_READ);
|
||||||
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@ -378,7 +376,7 @@ int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, &val, 1, REALTEK_USB_VENQT_WRITE);
|
return usbctrl_vendorreq(pintfhdl, wvalue, &val, 1, REALTEK_USB_VENQT_WRITE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +390,7 @@ int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, &val, 2, REALTEK_USB_VENQT_WRITE);
|
return usbctrl_vendorreq(pintfhdl, wvalue, &val, 2, REALTEK_USB_VENQT_WRITE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,7 +404,7 @@ int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
|
|||||||
wvalue |= 0x8000;
|
wvalue |= 0x8000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, &val, 4, REALTEK_USB_VENQT_WRITE);
|
return usbctrl_vendorreq(pintfhdl, wvalue, &val, 4, REALTEK_USB_VENQT_WRITE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,7 +417,7 @@ int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
memcpy(buf, pdata, length);
|
memcpy(buf, pdata, length);
|
||||||
return usbctrl_vendorreq(pintfhdl, wvalue, 0, buf, (length & 0xffff), REALTEK_USB_VENQT_WRITE);
|
return usbctrl_vendorreq(pintfhdl, wvalue, buf, (length & 0xffff), REALTEK_USB_VENQT_WRITE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,10 +522,6 @@ usb_put_dev(struct usb_device *dev)
|
|||||||
int rtw_usb_submit_urb(struct urb *urb, uint16_t mem_flags);
|
int rtw_usb_submit_urb(struct urb *urb, uint16_t mem_flags);
|
||||||
int rtw_usb_unlink_urb(struct urb *urb);
|
int rtw_usb_unlink_urb(struct urb *urb);
|
||||||
int rtw_usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe);
|
int rtw_usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe);
|
||||||
int rtw_usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
|
|
||||||
uint8_t request, uint8_t requesttype,
|
|
||||||
uint16_t value, uint16_t index, void *data,
|
|
||||||
uint16_t size, usb_timeout_t timeout);
|
|
||||||
int rtw_usb_set_interface(struct usb_device *dev, uint8_t iface_no, uint8_t alt_index);
|
int rtw_usb_set_interface(struct usb_device *dev, uint8_t iface_no, uint8_t alt_index);
|
||||||
int rtw_usb_setup_endpoint(struct usb_device *dev,
|
int rtw_usb_setup_endpoint(struct usb_device *dev,
|
||||||
struct usb_host_endpoint *uhe, usb_size_t bufsize);
|
struct usb_host_endpoint *uhe, usb_size_t bufsize);
|
||||||
|
@ -59,10 +59,10 @@ 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, u16 value, u16 index, void *pdata, u16 len, u8 requesttype);
|
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, 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, void *pdata, u16 len, u8 requesttype);
|
||||||
#endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */
|
#endif /* CONFIG_USB_SUPPORT_ASYNC_VDN_REQ */
|
||||||
|
|
||||||
u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr);
|
u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr);
|
||||||
|
@ -23,7 +23,7 @@ struct rtw_async_write_data {
|
|||||||
struct usb_ctrlrequest dr;
|
struct usb_ctrlrequest dr;
|
||||||
};
|
};
|
||||||
|
|
||||||
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
|
int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, 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, u16 value, u16 index, void *pda
|
|||||||
memcpy(pIo_buf, pdata, len);
|
memcpy(pIo_buf, pdata, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ, requesttype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
status = usb_control_msg(udev, pipe, REALTEK_USB_VENQT_CMD_REQ, requesttype, value, REALTEK_USB_VENQT_CMD_IDX, 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);
|
||||||
@ -166,13 +166,10 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u16 value, u16 index, void *pda
|
|||||||
if (current_reg_sec == REG_ON_SEC) {
|
if (current_reg_sec == REG_ON_SEC) {
|
||||||
unsigned int t_pipe = usb_sndctrlpipe(udev, 0);/* write_out */
|
unsigned int t_pipe = usb_sndctrlpipe(udev, 0);/* write_out */
|
||||||
u8 t_len = 1;
|
u8 t_len = 1;
|
||||||
u8 t_req = 0x05;
|
|
||||||
u16 t_reg = 0;
|
u16 t_reg = 0;
|
||||||
u16 t_index = 0;
|
|
||||||
|
|
||||||
t_reg = 0x4e0;
|
t_reg = 0x4e0;
|
||||||
|
|
||||||
status = usb_control_msg(udev, t_pipe, t_req, REALTEK_USB_VENQT_WRITE, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
status = usb_control_msg(udev, t_pipe, REALTEK_USB_VENQT_CMD_REQ, REALTEK_USB_VENQT_WRITE, t_reg, REALTEK_USB_VENQT_CMD_IDX, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT);
|
||||||
|
|
||||||
if (status == t_len)
|
if (status == t_len)
|
||||||
rtw_reset_continual_io_error(pdvobjpriv);
|
rtw_reset_continual_io_error(pdvobjpriv);
|
||||||
@ -207,7 +204,7 @@ static void _usbctrl_vendorreq_async_callback(struct urb *urb, struct pt_regs *r
|
|||||||
}
|
}
|
||||||
|
|
||||||
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, void *pdata, u16 len, u8 requesttype)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
unsigned int pipe;
|
unsigned int pipe;
|
||||||
@ -240,7 +237,7 @@ int _usbctrl_vendorreq_async_write(struct usb_device *udev, u8 request,
|
|||||||
dr->bRequestType = requesttype;
|
dr->bRequestType = requesttype;
|
||||||
dr->bRequest = request;
|
dr->bRequest = request;
|
||||||
dr->wValue = cpu_to_le16(value);
|
dr->wValue = cpu_to_le16(value);
|
||||||
dr->wIndex = cpu_to_le16(index);
|
dr->wIndex = cpu_to_le16(REALTEK_USB_VENQT_CMD_IDX);
|
||||||
dr->wLength = cpu_to_le16(len);
|
dr->wLength = cpu_to_le16(len);
|
||||||
|
|
||||||
memcpy(buf, pdata, len);
|
memcpy(buf, pdata, len);
|
||||||
|
Loading…
Reference in New Issue
Block a user