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

staging: rtl8188eu: Remove function _rtw_write32()

_rtw_write32() is a wrapper function, being used to call usb_write32().
Call usb_write32() directly and drop _rtw_write32().
Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14af3550
......@@ -69,7 +69,7 @@ int proc_set_write_reg(struct file *file, const char __user *buffer,
rtw_write16(padapter, addr, (u16)val);
break;
case 4:
rtw_write32(padapter, addr, val);
usb_write32(padapter, addr, val);
break;
default:
DBG_88E("error write length =%d", len);
......
......@@ -113,18 +113,6 @@ int _rtw_write16(struct adapter *adapter, u32 addr, u16 val)
return RTW_STATUS_CODE(ret);
}
int _rtw_write32(struct adapter *adapter, u32 addr, u32 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write32)(struct adapter *pintfhdl, u32 addr, u32 val);
int ret;
_write32 = pintfhdl->io_ops._write32;
ret = _write32(adapter, addr, val);
return RTW_STATUS_CODE(ret);
}
int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops))
{
......
......@@ -56,7 +56,7 @@ void write_macreg(struct adapter *padapter, u32 addr, u32 val, u32 sz)
rtw_write16(padapter, addr, (u16)val);
break;
case 4:
rtw_write32(padapter, addr, val);
usb_write32(padapter, addr, val);
break;
default:
break;
......@@ -221,7 +221,7 @@ s32 MPT_InitializeAdapter(struct adapter *pAdapter, u8 Channel)
/* */
/* Don't accept any packets */
rtw_write32(pAdapter, REG_RCR, 0);
usb_write32(pAdapter, REG_RCR, 0);
PHY_IQCalibrate(pAdapter, false);
dm_CheckTXPowerTracking(&pHalData->odmpriv); /* trigger thermal meter */
......@@ -788,12 +788,12 @@ void SetPacketRx(struct adapter *pAdapter, u8 bStartRx)
pHalData->ReceiveConfig |= ACRC32;
rtw_write32(pAdapter, REG_RCR, pHalData->ReceiveConfig);
usb_write32(pAdapter, REG_RCR, pHalData->ReceiveConfig);
/* Accept all data frames */
rtw_write16(pAdapter, REG_RXFLTMAP2, 0xFFFF);
} else {
rtw_write32(pAdapter, REG_RCR, 0);
usb_write32(pAdapter, REG_RCR, 0);
}
}
......@@ -805,7 +805,7 @@ void ResetPhyRxPktCount(struct adapter *pAdapter)
phyrx_set = 0;
phyrx_set |= _RXERR_RPT_SEL(i); /* select */
phyrx_set |= RXERR_RPT_RST; /* set counter to zero */
rtw_write32(pAdapter, REG_RXERR_RPT, phyrx_set);
usb_write32(pAdapter, REG_RXERR_RPT, phyrx_set);
}
}
......@@ -815,7 +815,7 @@ static u32 GetPhyRxPktCounts(struct adapter *pAdapter, u32 selbit)
u32 phyrx_set = 0, count = 0;
phyrx_set = _RXERR_RPT_SEL(selbit & 0xF);
rtw_write32(pAdapter, REG_RXERR_RPT, phyrx_set);
usb_write32(pAdapter, REG_RXERR_RPT, phyrx_set);
/* Read packet count */
count = rtw_read32(pAdapter, REG_RXERR_RPT) & RXERR_COUNTER_MASK;
......@@ -857,11 +857,11 @@ static u32 rtw_GetPSDData(struct adapter *pAdapter, u32 point)
psd_val &= 0xFFBFFC00;
psd_val |= point;
rtw_write32(pAdapter, 0x808, psd_val);
usb_write32(pAdapter, 0x808, psd_val);
mdelay(1);
psd_val |= 0x00400000;
rtw_write32(pAdapter, 0x808, psd_val);
usb_write32(pAdapter, 0x808, psd_val);
mdelay(1);
psd_val = rtw_read32(pAdapter, 0x8B4);
......
......@@ -863,7 +863,7 @@ int rtl8188eu_oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
rtw_write16(padapter, offset, (u16)value);
break;
case 4:
rtw_write32(padapter, offset, value);
usb_write32(padapter, offset, value);
break;
default:
status = NDIS_STATUS_NOT_ACCEPTED;
......
......@@ -850,7 +850,7 @@ _PHY_ReloadMACRegisters(
for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) {
rtw_write8(adapt, MACReg[i], (u8)MACBackup[i]);
}
rtw_write32(adapt, MACReg[i], MACBackup[i]);
usb_write32(adapt, MACReg[i], MACBackup[i]);
}
void
......
......@@ -1363,7 +1363,7 @@ void odm_EdcaTurboCheckCE(struct odm_dm_struct *pDM_Odm)
else
edca_param = EDCAParam[HT_IOT_PEER_UNKNOWN][trafficIndex];
rtw_write32(Adapter, REG_EDCA_BE_PARAM, edca_param);
usb_write32(Adapter, REG_EDCA_BE_PARAM, edca_param);
pDM_Odm->DM_EDCA_Table.prv_traffic_idx = trafficIndex;
}
......@@ -1373,7 +1373,7 @@ void odm_EdcaTurboCheckCE(struct odm_dm_struct *pDM_Odm)
/* Turn Off EDCA turbo here. */
/* Restore original EDCA according to the declaration of AP. */
if (pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) {
rtw_write32(Adapter, REG_EDCA_BE_PARAM, pHalData->AcParam_BE);
usb_write32(Adapter, REG_EDCA_BE_PARAM, pHalData->AcParam_BE);
pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = false;
}
}
......
......@@ -726,9 +726,9 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)
p2p_ps_offload->NoA1_En = 1;
/* config P2P NoA Descriptor Register */
rtw_write32(adapt, REG_NOA_DESC_DURATION, pwdinfo->noa_duration[i]);
rtw_write32(adapt, REG_NOA_DESC_INTERVAL, pwdinfo->noa_interval[i]);
rtw_write32(adapt, REG_NOA_DESC_START, pwdinfo->noa_start_time[i]);
usb_write32(adapt, REG_NOA_DESC_DURATION, pwdinfo->noa_duration[i]);
usb_write32(adapt, REG_NOA_DESC_INTERVAL, pwdinfo->noa_interval[i]);
usb_write32(adapt, REG_NOA_DESC_START, pwdinfo->noa_start_time[i]);
rtw_write8(adapt, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]);
}
......
......@@ -372,7 +372,7 @@ void rtw_IOL_cmd_tx_pkt_buf_dump(struct adapter *Adapter, int data_len)
rtw_write8(Adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT);
if (pbuf) {
for (addr = 0; addr < data_cnts; addr++) {
rtw_write32(Adapter, 0x140, addr);
usb_write32(Adapter, 0x140, addr);
msleep(1);
loop = 0;
do {
......@@ -563,7 +563,7 @@ static s32 _FWFreeToGo(struct adapter *padapter)
value32 = rtw_read32(padapter, REG_MCUFWDL);
value32 |= MCUFWDL_RDY;
value32 &= ~WINTINI_RDY;
rtw_write32(padapter, REG_MCUFWDL, value32);
usb_write32(padapter, REG_MCUFWDL, value32);
_8051Reset88E(padapter);
......@@ -1903,7 +1903,7 @@ static s32 _LLTWrite(struct adapter *padapter, u32 address, u32 data)
u32 value = _LLT_INIT_ADDR(address) | _LLT_INIT_DATA(data) | _LLT_OP(_LLT_WRITE_ACCESS);
u16 LLTReg = REG_LLT_INIT;
rtw_write32(padapter, LLTReg, value);
usb_write32(padapter, LLTReg, value);
/* polling */
do {
......
......@@ -129,7 +129,7 @@ void rtl8188e_PHY_SetBBReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u3
Data = ((OriginalValue & (~BitMask)) | (Data << BitShift));
}
rtw_write32(Adapter, RegAddr, Data);
usb_write32(Adapter, RegAddr, Data);
}
......
This diff is collapsed.
......@@ -227,7 +227,7 @@ static int usb_write16(struct adapter *adapter, u32 addr, u16 val)
return ret;
}
static int usb_write32(struct adapter *adapter, u32 addr, u32 val)
int usb_write32(struct adapter *adapter, u32 addr, u32 val)
{
u8 request;
u8 requesttype;
......@@ -671,5 +671,4 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops)
pops->_read32 = &usb_read32;
pops->_write8 = &usb_write8;
pops->_write16 = &usb_write16;
pops->_write32 = &usb_write32;
}
......@@ -49,7 +49,6 @@ struct _io_ops {
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);
};
struct io_req {
......@@ -89,7 +88,7 @@ void usb_read_port_cancel(struct adapter *adapter);
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val);
int _rtw_write16(struct adapter *adapter, u32 addr, u16 val);
int _rtw_write32(struct adapter *adapter, u32 addr, u32 val);
int usb_write32(struct adapter *adapter, u32 addr, u32 val);
int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata);
u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
......@@ -103,8 +102,6 @@ void usb_write_port_cancel(struct adapter *adapter);
_rtw_write8((adapter), (addr), (val))
#define rtw_write16(adapter, addr, val) \
_rtw_write16((adapter), (addr), (val))
#define rtw_write32(adapter, addr, val) \
_rtw_write32((adapter), (addr), (val))
int rtw_init_io_priv(struct adapter *padapter,
void (*set_intf_ops)(struct _io_ops *pops));
......
......@@ -2230,7 +2230,7 @@ static int rtw_wx_write32(struct net_device *dev,
DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%04X\n", __func__, addr, (u16)data32);
break;
case 4:
rtw_write32(padapter, addr, data32);
usb_write32(padapter, addr, data32);
DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%08X\n", __func__, addr, data32);
break;
default:
......@@ -2376,7 +2376,7 @@ static void rtw_dbg_mode_hdl(struct adapter *padapter, u32 id, u8 *pdata, u32 le
rtw_write16(padapter, RegRWStruct->offset, (u16)RegRWStruct->value);
break;
case 4:
rtw_write32(padapter, RegRWStruct->offset, (u32)RegRWStruct->value);
usb_write32(padapter, RegRWStruct->offset, (u32)RegRWStruct->value);
break;
default:
break;
......@@ -3948,12 +3948,12 @@ static int rtw_cta_test_start(struct net_device *dev,
if (padapter->in_cta_test) {
u32 v = rtw_read32(padapter, REG_RCR);
v &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN);/* RCR_ADF */
rtw_write32(padapter, REG_RCR, v);
usb_write32(padapter, REG_RCR, v);
DBG_88E("enable RCR_ADF\n");
} else {
u32 v = rtw_read32(padapter, REG_RCR);
v |= RCR_CBSSID_DATA | RCR_CBSSID_BCN;/* RCR_ADF */
rtw_write32(padapter, REG_RCR, v);
usb_write32(padapter, REG_RCR, v);
DBG_88E("disable RCR_ADF\n");
}
return ret;
......@@ -4130,8 +4130,8 @@ static int rtw_dbg_port(struct net_device *dev,
DBG_88E("rtw_write16(0x%x) = 0x%04x\n", arg, rtw_read16(padapter, arg));
break;
case 4:
rtw_write32(padapter, arg, extra_arg);
DBG_88E("rtw_write32(0x%x) = 0x%08x\n", arg, rtw_read32(padapter, arg));
usb_write32(padapter, arg, extra_arg);
DBG_88E("usb_write32(0x%x) = 0x%08x\n", arg, rtw_read32(padapter, arg));
break;
}
break;
......@@ -6426,7 +6426,7 @@ static int rtw_mp_write_reg(struct net_device *dev,
break;
case 'd':
/* 4 bytes */
rtw_write32(padapter, addr, data);
usb_write32(padapter, addr, data);
break;
default:
ret = -EINVAL;
......
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