On Sat, Sep 04, 2021 at 05:04:45PM +0200, Fabio M. De Francesco wrote:
-static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
+int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata)
{
+ struct io_priv *pio_priv = &adapter->iopriv;
+ struct intf_hdl *pintfhdl = &pio_priv->intf;
u16 wvalue = (u16)(addr & 0x0000ffff);
u8 buf[VENDOR_CMD_MAX_DATA_LEN] = {0};
+ int ret;
if (length > VENDOR_CMD_MAX_DATA_LEN)
return -EINVAL;
The caller treats this negative return as success.
memcpy(buf, pdata, length);
+ ret = usbctrl_vendorreq(pintfhdl, wvalue, buf, (length & 0xffff), REALTEK_USB_VENQT_WRITE);
- return usbctrl_vendorreq(pintfhdl, wvalue, buf, (length & 0xffff), REALTEK_USB_VENQT_WRITE);
+ return RTW_STATUS_CODE(ret);
}
[ snip ]
-void usb_read_port_cancel(struct intf_hdl *pintfhdl)
+void rtw_read_port_cancel(struct adapter *adapter)
{
int i;
- struct recv_buf *precvbuf;
- struct adapter *padapter = pintfhdl->padapter;
- precvbuf = (struct recv_buf *)padapter->recvpriv.precv_buf;
+ struct recv_buf *precvbuf = (struct recv_buf *) adapter->recvpriv.precv_buf;
DBG_88E("%s\n", __func__);
- padapter->bReadPortCancel = true;
+ adapter->bReadPortCancel = true;
In these functions it would be better to rename "padapter" as "adapter"
in a follow on function. Keep it the same for now just to make review
easier.