Commit 2478a1ce authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman

staging: rtl8188eu: Remove function _rtw_read_port()

_rtw_read_port() is a wrapper function, being used to call usb_read_port().
use usb_read_port() directly and drop _rtw_read_port().
Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9c74f31
......@@ -126,26 +126,6 @@ int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
return RTW_STATUS_CODE(ret);
}
void _rtw_read_port(struct adapter *adapter, 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);
if (adapter->bDriverStopped || adapter->bSurpriseRemoved) {
RT_TRACE(_module_rtl871x_io_c_, _drv_info_,
("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
adapter->bDriverStopped, adapter->bSurpriseRemoved));
return;
}
_read_port = pintfhdl->io_ops._read_port;
_read_port(adapter, addr, cnt, pmem);
}
void _rtw_read_port_cancel(struct adapter *adapter)
{
void (*_read_port_cancel)(struct adapter *pintfhdl);
......
......@@ -1037,12 +1037,7 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
u8 i;
struct recv_buf *precvbuf;
uint status;
struct intf_hdl *pintfhdl = &Adapter->iopriv.intf;
struct recv_priv *precvpriv = &(Adapter->recvpriv);
u32 (*_read_port)(struct adapter *padapter, u32 addr, u32 cnt, u8 *pmem);
_read_port = pintfhdl->io_ops._read_port;
status = _SUCCESS;
......@@ -1054,7 +1049,7 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
/* issue Rx irp to receive data */
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for (i = 0; i < NR_RECVBUFF; i++) {
if (_read_port(Adapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false) {
if (usb_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;
......
......@@ -511,7 +511,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
RT_TRACE(_module_hci_ops_os_c_, _drv_err_,
("usb_read_port_complete: (purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)\n"));
precvbuf->reuse = true;
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
} else {
rtw_reset_continual_urb_error(adapter_to_dvobj(adapt));
......@@ -524,7 +524,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
precvbuf->pskb = NULL;
precvbuf->reuse = false;
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
}
} else {
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("usb_read_port_complete : purb->status(%d) != 0\n", purb->status));
......@@ -553,7 +553,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
haldata->srestpriv.Wifi_Error_Status = USB_READ_PORT_FAIL;
}
precvbuf->reuse = true;
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
usb_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
break;
case -EINPROGRESS:
DBG_88E("ERROR: URB IS IN PROGRESS!\n");
......@@ -564,7 +564,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
}
}
static u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
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;
......@@ -669,7 +669,6 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops)
pops->_read8 = &usb_read8;
pops->_read16 = &usb_read16;
pops->_read32 = &usb_read32;
pops->_read_port = &usb_read_port;
pops->_write8 = &usb_write8;
pops->_write16 = &usb_write16;
pops->_write32 = &usb_write32;
......
......@@ -50,8 +50,6 @@ struct _io_ops {
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);
u32 (*_read_port)(struct adapter *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
u32 (*_write_port)(struct adapter *pintfhdl, u32 addr, u32 cnt,
u8 *pmem);
void (*_read_port_cancel)(struct adapter *pintfhdl);
......@@ -90,7 +88,7 @@ struct io_priv {
u8 _rtw_read8(struct adapter *adapter, u32 addr);
u16 _rtw_read16(struct adapter *adapter, u32 addr);
u32 _rtw_read32(struct adapter *adapter, u32 addr);
void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
u32 usb_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
void _rtw_read_port_cancel(struct adapter *adapter);
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val);
......@@ -104,8 +102,6 @@ void _rtw_write_port_cancel(struct adapter *adapter);
#define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr))
#define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr))
#define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr))
#define rtw_read_port(adapter, addr, cnt, mem) \
_rtw_read_port((adapter), (addr), (cnt), (mem))
#define rtw_read_port_cancel(adapter) _rtw_read_port_cancel((adapter))
#define rtw_write8(adapter, addr, val) \
......
......@@ -199,7 +199,7 @@ void rtw_os_read_port(struct adapter *padapter, struct recv_buf *precvbuf)
dev_kfree_skb_any(precvbuf->pskb);
precvbuf->pskb = NULL;
precvbuf->reuse = false;
rtw_read_port(padapter, precvpriv->ff_hwaddr, 0,
usb_read_port(padapter, precvpriv->ff_hwaddr, 0,
(unsigned char *)precvbuf);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment