Commit 28c71e23 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Eliminate struct intf_hdl

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b939da9c
...@@ -44,9 +44,9 @@ jackson@realtek.com.tw ...@@ -44,9 +44,9 @@ jackson@realtek.com.tw
u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr) u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr)
{ {
u8 r_val; u8 r_val;
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
r_val = pintfhdl->io_ops._read8(adapter, addr); r_val = io_ops->_read8(adapter, addr);
return r_val; return r_val;
} }
...@@ -54,9 +54,9 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr) ...@@ -54,9 +54,9 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr)
u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr) u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
{ {
u16 r_val; u16 r_val;
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
r_val = pintfhdl->io_ops._read16(adapter, addr); r_val = io_ops->_read16(adapter, addr);
return le16_to_cpu(r_val); return le16_to_cpu(r_val);
} }
...@@ -64,57 +64,57 @@ u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr) ...@@ -64,57 +64,57 @@ u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr) u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr)
{ {
u32 r_val; u32 r_val;
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
r_val = pintfhdl->io_ops._read32(adapter, addr); r_val = io_ops->_read32(adapter, addr);
return le32_to_cpu(r_val); return le32_to_cpu(r_val);
} }
int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val) int _rtw_write823a(struct rtw_adapter *adapter, u32 addr, u8 val)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
int ret; int ret;
ret = pintfhdl->io_ops._write8(adapter, addr, val); ret = io_ops->_write8(adapter, addr, val);
return RTW_STATUS_CODE23a(ret); return RTW_STATUS_CODE23a(ret);
} }
int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val) int _rtw_write1623a(struct rtw_adapter *adapter, u32 addr, u16 val)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
int ret; int ret;
val = cpu_to_le16(val); val = cpu_to_le16(val);
ret = pintfhdl->io_ops._write16(adapter, addr, val); ret = io_ops->_write16(adapter, addr, val);
return RTW_STATUS_CODE23a(ret); return RTW_STATUS_CODE23a(ret);
} }
int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val) int _rtw_write3223a(struct rtw_adapter *adapter, u32 addr, u32 val)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
int ret; int ret;
val = cpu_to_le32(val); val = cpu_to_le32(val);
ret = pintfhdl->io_ops._write32(adapter, addr, val); ret = io_ops->_write32(adapter, addr, val);
return RTW_STATUS_CODE23a(ret); return RTW_STATUS_CODE23a(ret);
} }
int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdata) int _rtw_writeN23a(struct rtw_adapter *adapter, u32 addr , u32 length , u8 *pdata)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
int ret; int ret;
ret = pintfhdl->io_ops._writeN(adapter, addr, length, pdata); ret = io_ops->_writeN(adapter, addr, length, pdata);
return RTW_STATUS_CODE23a(ret); return RTW_STATUS_CODE23a(ret);
} }
void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
if ((adapter->bDriverStopped == true) || if ((adapter->bDriverStopped == true) ||
(adapter->bSurpriseRemoved == true)) { (adapter->bSurpriseRemoved == true)) {
...@@ -125,20 +125,20 @@ void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) ...@@ -125,20 +125,20 @@ void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
return; return;
} }
pintfhdl->io_ops._read_mem(adapter, addr, cnt, pmem); io_ops->_read_mem(adapter, addr, cnt, pmem);
} }
void _rtw_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem) void _rtw_write_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
pintfhdl->io_ops._write_mem(adapter, addr, cnt, pmem); io_ops->_write_mem(adapter, addr, cnt, pmem);
} }
void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
struct recv_buf *rbuf) struct recv_buf *rbuf)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
if ((adapter->bDriverStopped == true) || if ((adapter->bDriverStopped == true) ||
(adapter->bSurpriseRemoved == true)) { (adapter->bSurpriseRemoved == true)) {
...@@ -149,15 +149,15 @@ void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, ...@@ -149,15 +149,15 @@ void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
return; return;
} }
pintfhdl->io_ops._read_port(adapter, addr, cnt, rbuf); io_ops->_read_port(adapter, addr, cnt, rbuf);
} }
void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) void _rtw_read_port23a_cancel(struct rtw_adapter *adapter)
{ {
void (*_read_port_cancel)(struct rtw_adapter *adapter); void (*_read_port_cancel)(struct rtw_adapter *adapter);
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
_read_port_cancel = pintfhdl->io_ops._read_port_cancel; _read_port_cancel = io_ops->_read_port_cancel;
if (_read_port_cancel) if (_read_port_cancel)
_read_port_cancel(adapter); _read_port_cancel(adapter);
...@@ -166,10 +166,10 @@ void _rtw_read_port23a_cancel(struct rtw_adapter *adapter) ...@@ -166,10 +166,10 @@ void _rtw_read_port23a_cancel(struct rtw_adapter *adapter)
u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
struct xmit_buf *xbuf) struct xmit_buf *xbuf)
{ {
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
u32 ret = _SUCCESS; u32 ret = _SUCCESS;
ret = pintfhdl->io_ops._write_port(adapter, addr, cnt, xbuf); ret = io_ops->_write_port(adapter, addr, cnt, xbuf);
return ret; return ret;
} }
...@@ -177,9 +177,9 @@ u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, ...@@ -177,9 +177,9 @@ u32 _rtw_write_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
void _rtw_write_port23a_cancel(struct rtw_adapter *adapter) void _rtw_write_port23a_cancel(struct rtw_adapter *adapter)
{ {
void (*_write_port_cancel)(struct rtw_adapter *adapter); void (*_write_port_cancel)(struct rtw_adapter *adapter);
struct intf_hdl *pintfhdl = &adapter->intf; struct _io_ops *io_ops = &adapter->io_ops;
_write_port_cancel = pintfhdl->io_ops._write_port_cancel; _write_port_cancel = io_ops->_write_port_cancel;
if (_write_port_cancel) if (_write_port_cancel)
_write_port_cancel(adapter); _write_port_cancel(adapter);
......
...@@ -1227,14 +1227,14 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter) ...@@ -1227,14 +1227,14 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter)
u8 i; u8 i;
struct recv_buf *precvbuf; struct recv_buf *precvbuf;
uint status; uint status;
struct intf_hdl *pintfhdl = &Adapter->intf; struct _io_ops *io_ops = &Adapter->io_ops;
struct recv_priv *precvpriv = &Adapter->recvpriv; struct recv_priv *precvpriv = &Adapter->recvpriv;
u32 (*_read_port)(struct rtw_adapter *padapter, u32 addr, u32 cnt, u32 (*_read_port)(struct rtw_adapter *padapter, u32 addr, u32 cnt,
struct recv_buf *rbuf); struct recv_buf *rbuf);
u32 (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr); u32 (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr);
struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter); struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
_read_port = pintfhdl->io_ops._read_port; _read_port = io_ops->_read_port;
status = _SUCCESS; status = _SUCCESS;
...@@ -1255,7 +1255,7 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter) ...@@ -1255,7 +1255,7 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter)
precvbuf++; precvbuf++;
precvpriv->free_recv_buf_queue_cnt--; precvpriv->free_recv_buf_queue_cnt--;
} }
_read_interrupt = pintfhdl->io_ops._read_interrupt; _read_interrupt = io_ops->_read_interrupt;
if (_read_interrupt(Adapter, RECV_INT_IN_ADDR) == false) { if (_read_interrupt(Adapter, RECV_INT_IN_ADDR) == false) {
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, RT_TRACE(_module_hci_hal_init_c_, _drv_err_,
("usb_rx_init: usb_read_interrupt error\n")); ("usb_rx_init: usb_read_interrupt error\n"));
......
...@@ -824,8 +824,7 @@ void rtl8723au_xmit_tasklet(void *priv) ...@@ -824,8 +824,7 @@ void rtl8723au_xmit_tasklet(void *priv)
void rtl8723au_set_intf_ops(struct rtw_adapter *padapter) void rtl8723au_set_intf_ops(struct rtw_adapter *padapter)
{ {
struct intf_hdl *pintf = &padapter->intf; struct _io_ops *pops = &padapter->io_ops;
struct _io_ops *pops = &pintf->io_ops;
memset((u8 *)pops, 0, sizeof(struct _io_ops)); memset((u8 *)pops, 0, sizeof(struct _io_ops));
......
...@@ -242,7 +242,7 @@ struct rtw_adapter { ...@@ -242,7 +242,7 @@ struct rtw_adapter {
struct mlme_ext_priv mlmeextpriv; struct mlme_ext_priv mlmeextpriv;
struct cmd_priv cmdpriv; struct cmd_priv cmdpriv;
struct evt_priv evtpriv; struct evt_priv evtpriv;
struct intf_hdl intf; struct _io_ops io_ops;
struct xmit_priv xmitpriv; struct xmit_priv xmitpriv;
struct recv_priv recvpriv; struct recv_priv recvpriv;
struct sta_priv stapriv; struct sta_priv stapriv;
......
...@@ -97,7 +97,6 @@ ...@@ -97,7 +97,6 @@
#define _INTF_ASYNC_ BIT(0) /* support async io */ #define _INTF_ASYNC_ BIT(0) /* support async io */
struct intf_priv; struct intf_priv;
struct intf_hdl;
struct _io_ops struct _io_ops
{ {
...@@ -135,10 +134,6 @@ struct io_req { ...@@ -135,10 +134,6 @@ struct io_req {
u8 *cnxt; u8 *cnxt;
}; };
struct intf_hdl {
struct _io_ops io_ops;
};
struct reg_protocol_rd { struct reg_protocol_rd {
#ifdef __LITTLE_ENDIAN #ifdef __LITTLE_ENDIAN
......
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