u8 r_val;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
- u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
+ u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
_read8 = pintfhdl->io_ops._read8;
- r_val = _read8(pintfhdl, addr);
+ r_val = _read8(adapter, addr);
return r_val;
}
u16 r_val;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
- u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
+ u16 (*_read16)(struct adapter *pintfhdl, u32 addr);
_read16 = pintfhdl->io_ops._read16;
- r_val = _read16(pintfhdl, addr);
+ r_val = _read16(adapter, addr);
return r_val;
}
u32 r_val;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
- u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
+ u32 (*_read32)(struct adapter *pintfhdl, u32 addr);
_read32 = pintfhdl->io_ops._read32;
- r_val = _read32(pintfhdl, addr);
+ r_val = _read32(adapter, addr);
return r_val;
}
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
- int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
+ int (*_write8)(struct adapter *pintfhdl, u32 addr, u8 val);
int ret;
_write8 = pintfhdl->io_ops._write8;
- ret = _write8(pintfhdl, addr, val);
+ ret = _write8(adapter, addr, val);
return RTW_STATUS_CODE(ret);
}
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
- int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
+ int (*_write16)(struct adapter *pintfhdl, u32 addr, u16 val);
int ret;
_write16 = pintfhdl->io_ops._write16;
- ret = _write16(pintfhdl, addr, val);
+ ret = _write16(adapter, addr, val);
return RTW_STATUS_CODE(ret);
}
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
- int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
+ int (*_write32)(struct adapter *pintfhdl, u32 addr, u32 val);
int ret;
_write32 = pintfhdl->io_ops._write32;
- ret = _write32(pintfhdl, addr, val);
+ ret = _write32(adapter, addr, val);
return RTW_STATUS_CODE(ret);
}
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = (struct intf_hdl *)(&(pio_priv->intf));
- int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata);
+ int (*_writeN)(struct adapter *pintfhdl, u32 addr, u32 length, u8 *pdata);
int ret;
_writeN = pintfhdl->io_ops._writeN;
- ret = _writeN(pintfhdl, addr, length, pdata);
+ ret = _writeN(adapter, addr, length, pdata);
return RTW_STATUS_CODE(ret);
}
void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{
- u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
+ u32 (*_read_port)(struct adapter *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_read_port = pintfhdl->io_ops._read_port;
- _read_port(pintfhdl, addr, cnt, pmem);
+ _read_port(adapter, addr, cnt, pmem);
}
void _rtw_read_port_cancel(struct adapter *adapter)
{
- void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
+ void (*_read_port_cancel)(struct adapter *pintfhdl);
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
if (_read_port_cancel)
- _read_port_cancel(pintfhdl);
+ _read_port_cancel(adapter);
}
u32 _rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{
- u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
+ u32 (*_write_port)(struct adapter *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u32 ret = _SUCCESS;
_write_port = pintfhdl->io_ops._write_port;
- ret = _write_port(pintfhdl, addr, cnt, pmem);
+ ret = _write_port(adapter, addr, cnt, pmem);
return ret;
void _rtw_write_port_cancel(struct adapter *adapter)
{
- void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
+ void (*_write_port_cancel)(struct adapter *pintfhdl);
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
if (_write_port_cancel)
- _write_port_cancel(pintfhdl);
+ _write_port_cancel(adapter);
}
int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops))
uint status;
struct intf_hdl *pintfhdl = &Adapter->iopriv.intf;
struct recv_priv *precvpriv = &(Adapter->recvpriv);
- u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
+ u32 (*_read_port)(struct adapter *padapter, u32 addr, u32 cnt, u8 *pmem);
_read_port = pintfhdl->io_ops._read_port;
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
- if (_read_port(pintfhdl, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
+ if (_read_port(Adapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
goto exit;
#include <recv_osdep.h>
#include <rtl8188e_hal.h>
-static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
+static int usbctrl_vendorreq(struct adapter *adapt, u8 request, u16 value, u16 index, void *pdata, u16 len, u8 requesttype)
{
- struct adapter *adapt = pintfhdl->padapter;
struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt);
struct usb_device *udev = dvobjpriv->pusbdev;
unsigned int pipe;
return status;
}
-static u8 usb_read8(struct intf_hdl *pintfhdl, u32 addr)
+static u8 usb_read8(struct adapter *adapter, u32 addr)
{
u8 request;
u8 requesttype;
wvalue = (u16)(addr&0x0000ffff);
len = 1;
- usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
+ usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
return data;
}
-static u16 usb_read16(struct intf_hdl *pintfhdl, u32 addr)
+static u16 usb_read16(struct adapter *adapter, u32 addr)
{
u8 request;
u8 requesttype;
index = 0;/* n/a */
wvalue = (u16)(addr&0x0000ffff);
len = 2;
- usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
+ usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
return (u16)(le32_to_cpu(data)&0xffff);
}
-static u32 usb_read32(struct intf_hdl *pintfhdl, u32 addr)
+static u32 usb_read32(struct adapter *adapter, u32 addr)
{
u8 request;
u8 requesttype;
wvalue = (u16)(addr&0x0000ffff);
len = 4;
- usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
+ usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
return le32_to_cpu(data);
}
-static int usb_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val)
+static int usb_write8(struct adapter *adapter, u32 addr, u8 val)
{
u8 request;
u8 requesttype;
wvalue = (u16)(addr&0x0000ffff);
len = 1;
data = val;
- ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
+ ret = usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
return ret;
}
-static int usb_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val)
+static int usb_write16(struct adapter *adapter, u32 addr, u16 val)
{
u8 request;
u8 requesttype;
data = cpu_to_le32(val & 0x0000ffff);
- ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
+ ret = usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
return ret;
}
-static int usb_write32(struct intf_hdl *pintfhdl, u32 addr, u32 val)
+static int usb_write32(struct adapter *adapter, u32 addr, u32 val)
{
u8 request;
u8 requesttype;
len = 4;
data = cpu_to_le32(val);
- ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, &data, len, requesttype);
+ ret = usbctrl_vendorreq(adapter, request, wvalue, index, &data, len, requesttype);
return ret;
}
-static int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata)
+static int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata)
{
u8 request;
u8 requesttype;
len = length;
memcpy(buf, pdata, len);
- ret = usbctrl_vendorreq(pintfhdl, request, wvalue, index, buf, len, requesttype);
+ ret = usbctrl_vendorreq(adapter, request, wvalue, index, buf, len, requesttype);
return ret;
}
}
-static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
+static u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
{
struct urb *purb = NULL;
struct recv_buf *precvbuf = (struct recv_buf *)rmem;
- struct adapter *adapter = pintfhdl->padapter;
struct dvobj_priv *pdvobj = adapter_to_dvobj(adapter);
struct recv_priv *precvpriv = &adapter->recvpriv;
struct usb_device *pusbd = pdvobj->pusbdev;
struct intf_hdl;
struct _io_ops {
- u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
- u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
- u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
- int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
- int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
- int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
- int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr, u32 length,
+ u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
+ u16 (*_read16)(struct adapter *pintfhdl, u32 addr);
+ u32 (*_read32)(struct adapter *pintfhdl, u32 addr);
+ int (*_write8)(struct adapter *pintfhdl, u32 addr, u8 val);
+ int (*_write16)(struct adapter *pintfhdl, u32 addr, u16 val);
+ int (*_write32)(struct adapter *pintfhdl, u32 addr, u32 val);
+ int (*_writeN)(struct adapter *pintfhdl, u32 addr, u32 length,
u8 *pdata);
- u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
+ u32 (*_read_port)(struct adapter *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
- u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt,
+ u32 (*_write_port)(struct adapter *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
- void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
- void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
+ void (*_read_port_cancel)(struct adapter *pintfhdl);
+ void (*_write_port_cancel)(struct adapter *pintfhdl);
};
struct io_req {
void usb_read_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem);
void usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
-void usb_read_port_cancel(struct intf_hdl *pintfhdl);
+void usb_read_port_cancel(struct adapter *padapter);
-u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem);
-void usb_write_port_cancel(struct intf_hdl *pintfhdl);
+u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem);
+void usb_write_port_cancel(struct adapter *padapter);
#endif
return pipe;
}
-void usb_read_port_cancel(struct intf_hdl *pintfhdl)
+void usb_read_port_cancel(struct adapter *padapter)
{
int i;
struct recv_buf *precvbuf;
- struct adapter *padapter = pintfhdl->padapter;
precvbuf = (struct recv_buf *)padapter->recvpriv.precv_buf;
DBG_88E("%s\n", __func__);
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
-u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
+u32 usb_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
{
unsigned long irqL;
unsigned int pipe;
int status;
u32 ret = _FAIL;
struct urb *purb = NULL;
- struct adapter *padapter = (struct adapter *)pintfhdl->padapter;
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)wmem;
return ret;
}
-void usb_write_port_cancel(struct intf_hdl *pintfhdl)
+void usb_write_port_cancel(struct adapter *padapter)
{
int i, j;
- struct adapter *padapter = pintfhdl->padapter;
struct xmit_buf *pxmitbuf = (struct xmit_buf *)padapter->xmitpriv.pxmitbuf;
DBG_88E("%s\n", __func__);