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

staging: rtl8723au: Eliminate struct intf_hdl

parent b939da9c
Loading
Loading
Loading
Loading
+27 −27
Original line number Diff line number Diff line
@@ -44,9 +44,9 @@ jackson@realtek.com.tw
u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr)
{
	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;
}
@@ -54,9 +54,9 @@ u8 _rtw_read823a(struct rtw_adapter *adapter, u32 addr)
u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
{
	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);
}
@@ -64,57 +64,57 @@ u16 _rtw_read1623a(struct rtw_adapter *adapter, u32 addr)
u32 _rtw_read3223a(struct rtw_adapter *adapter, u32 addr)
{
	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);
}

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;

	ret = pintfhdl->io_ops._write8(adapter, addr, val);
	ret = io_ops->_write8(adapter, addr, val);

	return RTW_STATUS_CODE23a(ret);
}

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;

	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);
}

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;

	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);
}

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;

	ret = pintfhdl->io_ops._writeN(adapter, addr, length, pdata);
	ret = io_ops->_writeN(adapter, addr, length, pdata);

	return RTW_STATUS_CODE23a(ret);
}
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) ||
	    (adapter->bSurpriseRemoved == true)) {
@@ -125,20 +125,20 @@ void _rtw_read_mem23a(struct rtw_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
	     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)
{
	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,
		       struct recv_buf *rbuf)
{
	struct intf_hdl *pintfhdl = &adapter->intf;
	struct _io_ops *io_ops = &adapter->io_ops;

	if ((adapter->bDriverStopped == true) ||
	    (adapter->bSurpriseRemoved == true)) {
@@ -149,15 +149,15 @@ void _rtw_read_port23a(struct rtw_adapter *adapter, u32 addr, u32 cnt,
	     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 (*_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)
		_read_port_cancel(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,
		    struct xmit_buf *xbuf)
{
	struct intf_hdl *pintfhdl = &adapter->intf;
	struct _io_ops *io_ops = &adapter->io_ops;
	u32 ret = _SUCCESS;

	ret = pintfhdl->io_ops._write_port(adapter, addr, cnt, xbuf);
	ret = io_ops->_write_port(adapter, addr, cnt, xbuf);

	return ret;
}
@@ -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 (*_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)
		_write_port_cancel(adapter);
+3 −3
Original line number Diff line number Diff line
@@ -1227,14 +1227,14 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter)
	u8 i;
	struct recv_buf *precvbuf;
	uint	status;
	struct intf_hdl *pintfhdl = &Adapter->intf;
	struct _io_ops *io_ops = &Adapter->io_ops;
	struct recv_priv *precvpriv = &Adapter->recvpriv;
	u32 (*_read_port)(struct rtw_adapter *padapter, u32 addr, u32 cnt,
			  struct recv_buf *rbuf);
	u32 (*_read_interrupt)(struct rtw_adapter *padapter, u32 addr);
	struct hal_data_8723a	*pHalData = GET_HAL_DATA(Adapter);

	_read_port = pintfhdl->io_ops._read_port;
	_read_port = io_ops->_read_port;

	status = _SUCCESS;

@@ -1255,7 +1255,7 @@ static unsigned int rtl8723au_inirp_init(struct rtw_adapter *Adapter)
		precvbuf++;
		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) {
		RT_TRACE(_module_hci_hal_init_c_, _drv_err_,
			 ("usb_rx_init: usb_read_interrupt error\n"));
+1 −2
Original line number Diff line number Diff line
@@ -824,8 +824,7 @@ void rtl8723au_xmit_tasklet(void *priv)

void rtl8723au_set_intf_ops(struct rtw_adapter *padapter)
{
	struct intf_hdl *pintf = &padapter->intf;
	struct _io_ops *pops = &pintf->io_ops;
	struct _io_ops *pops = &padapter->io_ops;

	memset((u8 *)pops, 0, sizeof(struct _io_ops));

+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ struct rtw_adapter {
	struct	mlme_ext_priv mlmeextpriv;
	struct	cmd_priv	cmdpriv;
	struct	evt_priv	evtpriv;
	struct intf_hdl intf;
	struct _io_ops	io_ops;
	struct	xmit_priv	xmitpriv;
	struct	recv_priv	recvpriv;
	struct	sta_priv	stapriv;
+0 −5
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@
#define _INTF_ASYNC_	BIT(0)	/* support async io */

struct intf_priv;
struct intf_hdl;

struct _io_ops
{
@@ -135,10 +134,6 @@ struct io_req {
	u8 *cnxt;
};

struct	intf_hdl {
	struct _io_ops	io_ops;
};

struct reg_protocol_rd {

#ifdef __LITTLE_ENDIAN