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

staging: rtl8188eu: Remove function _rtw_write8()

_rtw_write8() is a wrapper function, being used to call usb_write8().
Call usb_write8() directly and drop _rtw_write8().
Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9764ed04
...@@ -63,7 +63,7 @@ int proc_set_write_reg(struct file *file, const char __user *buffer, ...@@ -63,7 +63,7 @@ int proc_set_write_reg(struct file *file, const char __user *buffer,
} }
switch (len) { switch (len) {
case 1: case 1:
rtw_write8(padapter, addr, (u8)val); usb_write8(padapter, addr, (u8)val);
break; break;
case 2: case 2:
usb_write16(padapter, addr, (u16)val); usb_write16(padapter, addr, (u16)val);
......
...@@ -181,13 +181,13 @@ ReadEFuseByte( ...@@ -181,13 +181,13 @@ ReadEFuseByte(
} }
/* Write Address */ /* Write Address */
rtw_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff)); usb_write8(Adapter, EFUSE_CTRL+1, (_offset & 0xff));
readbyte = rtw_read8(Adapter, EFUSE_CTRL+2); readbyte = rtw_read8(Adapter, EFUSE_CTRL+2);
rtw_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc)); usb_write8(Adapter, EFUSE_CTRL+2, ((_offset >> 8) & 0x03) | (readbyte & 0xfc));
/* Write bit 32 0 */ /* Write bit 32 0 */
readbyte = rtw_read8(Adapter, EFUSE_CTRL+3); readbyte = rtw_read8(Adapter, EFUSE_CTRL+3);
rtw_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f)); usb_write8(Adapter, EFUSE_CTRL+3, (readbyte & 0x7f));
/* Check bit 32 read-ready */ /* Check bit 32 read-ready */
retry = 0; retry = 0;
...@@ -263,16 +263,16 @@ u8 EFUSE_Read1Byte(struct adapter *Adapter, u16 Address) ...@@ -263,16 +263,16 @@ u8 EFUSE_Read1Byte(struct adapter *Adapter, u16 Address)
if (Address < contentLen) { /* E-fuse 512Byte */ if (Address < contentLen) { /* E-fuse 512Byte */
/* Write E-fuse Register address bit0~7 */ /* Write E-fuse Register address bit0~7 */
temp = Address & 0xFF; temp = Address & 0xFF;
rtw_write8(Adapter, EFUSE_CTRL+1, temp); usb_write8(Adapter, EFUSE_CTRL+1, temp);
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2); Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+2);
/* Write E-fuse Register address bit8~9 */ /* Write E-fuse Register address bit8~9 */
temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC); temp = ((Address >> 8) & 0x03) | (Bytetemp & 0xFC);
rtw_write8(Adapter, EFUSE_CTRL+2, temp); usb_write8(Adapter, EFUSE_CTRL+2, temp);
/* Write 0x30[31]= 0 */ /* Write 0x30[31]= 0 */
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
temp = Bytetemp & 0x7F; temp = Bytetemp & 0x7F;
rtw_write8(Adapter, EFUSE_CTRL+3, temp); usb_write8(Adapter, EFUSE_CTRL+3, temp);
/* Wait Write-ready (0x30[31]= 1) */ /* Wait Write-ready (0x30[31]= 1) */
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3); Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
...@@ -304,11 +304,11 @@ u8 efuse_OneByteRead(struct adapter *pAdapter, u16 addr, u8 *data, bool pseudo) ...@@ -304,11 +304,11 @@ u8 efuse_OneByteRead(struct adapter *pAdapter, u16 addr, u8 *data, bool pseudo)
} }
/* -----------------e-fuse reg ctrl --------------------------------- */ /* -----------------e-fuse reg ctrl --------------------------------- */
/* address */ /* address */
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr & 0xff)); usb_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr & 0xff));
rtw_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) & 0x03)) | usb_write8(pAdapter, EFUSE_CTRL+2, ((u8)((addr>>8) & 0x03)) |
(rtw_read8(pAdapter, EFUSE_CTRL+2) & 0xFC)); (rtw_read8(pAdapter, EFUSE_CTRL+2) & 0xFC));
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);/* read cmd */ usb_write8(pAdapter, EFUSE_CTRL+3, 0x72);/* read cmd */
while (!(0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx < 100)) while (!(0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx < 100))
tmpidx++; tmpidx++;
...@@ -335,13 +335,13 @@ u8 efuse_OneByteWrite(struct adapter *pAdapter, u16 addr, u8 data, bool pseudo) ...@@ -335,13 +335,13 @@ u8 efuse_OneByteWrite(struct adapter *pAdapter, u16 addr, u8 data, bool pseudo)
/* -----------------e-fuse reg ctrl --------------------------------- */ /* -----------------e-fuse reg ctrl --------------------------------- */
/* address */ /* address */
rtw_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff)); usb_write8(pAdapter, EFUSE_CTRL+1, (u8)(addr&0xff));
rtw_write8(pAdapter, EFUSE_CTRL+2, usb_write8(pAdapter, EFUSE_CTRL+2,
(rtw_read8(pAdapter, EFUSE_CTRL+2) & 0xFC) | (rtw_read8(pAdapter, EFUSE_CTRL+2) & 0xFC) |
(u8)((addr>>8) & 0x03)); (u8)((addr>>8) & 0x03));
rtw_write8(pAdapter, EFUSE_CTRL, data);/* data */ usb_write8(pAdapter, EFUSE_CTRL, data);/* data */
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);/* write cmd */ usb_write8(pAdapter, EFUSE_CTRL+3, 0xF2);/* write cmd */
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx < 100)) while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx < 100))
tmpidx++; tmpidx++;
......
...@@ -88,19 +88,6 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr) ...@@ -88,19 +88,6 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr)
return r_val; return r_val;
} }
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_write8)(struct adapter *pintfhdl, u32 addr, u8 val);
int ret;
_write8 = pintfhdl->io_ops._write8;
ret = _write8(adapter, addr, val);
return RTW_STATUS_CODE(ret);
}
int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops)) int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops))
{ {
struct io_priv *piopriv = &padapter->iopriv; struct io_priv *piopriv = &padapter->iopriv;
......
...@@ -50,7 +50,7 @@ void write_macreg(struct adapter *padapter, u32 addr, u32 val, u32 sz) ...@@ -50,7 +50,7 @@ void write_macreg(struct adapter *padapter, u32 addr, u32 val, u32 sz)
{ {
switch (sz) { switch (sz) {
case 1: case 1:
rtw_write8(padapter, addr, (u8)val); usb_write8(padapter, addr, (u8)val);
break; break;
case 2: case 2:
usb_write16(padapter, addr, (u16)val); usb_write16(padapter, addr, (u16)val);
...@@ -304,7 +304,7 @@ static void disable_dm(struct adapter *padapter) ...@@ -304,7 +304,7 @@ static void disable_dm(struct adapter *padapter)
/* disable Power Training, Rate Adaptive */ /* disable Power Training, Rate Adaptive */
v8 = rtw_read8(padapter, REG_BCN_CTRL); v8 = rtw_read8(padapter, REG_BCN_CTRL);
v8 &= ~EN_BCN_FUNCTION; v8 &= ~EN_BCN_FUNCTION;
rtw_write8(padapter, REG_BCN_CTRL, v8); usb_write8(padapter, REG_BCN_CTRL, v8);
/* 3 2. disable driver dynamic mechanism */ /* 3 2. disable driver dynamic mechanism */
/* disable Dynamic Initial Gain */ /* disable Dynamic Initial Gain */
...@@ -423,7 +423,7 @@ s32 mp_start_test(struct adapter *padapter) ...@@ -423,7 +423,7 @@ s32 mp_start_test(struct adapter *padapter)
/* set MSR to WIFI_FW_ADHOC_STATE */ /* set MSR to WIFI_FW_ADHOC_STATE */
val8 = rtw_read8(padapter, MSR) & 0xFC; /* 0x0102 */ val8 = rtw_read8(padapter, MSR) & 0xFC; /* 0x0102 */
val8 |= WIFI_FW_ADHOC_STATE; val8 |= WIFI_FW_ADHOC_STATE;
rtw_write8(padapter, MSR, val8); /* Link in ad hoc network */ usb_write8(padapter, MSR, val8); /* Link in ad hoc network */
} }
return res; return res;
} }
......
...@@ -853,7 +853,7 @@ int rtl8188eu_oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv) ...@@ -853,7 +853,7 @@ int rtl8188eu_oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv)
status = NDIS_STATUS_NOT_ACCEPTED; status = NDIS_STATUS_NOT_ACCEPTED;
break; break;
} }
rtw_write8(padapter, offset, (u8)value); usb_write8(padapter, offset, (u8)value);
break; break;
case 2: case 2:
if (value > 0xFFFF) { if (value > 0xFFFF) {
......
...@@ -848,7 +848,7 @@ _PHY_ReloadMACRegisters( ...@@ -848,7 +848,7 @@ _PHY_ReloadMACRegisters(
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Reload MAC parameters !\n")); ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Reload MAC parameters !\n"));
for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) { for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) {
rtw_write8(adapt, MACReg[i], (u8)MACBackup[i]); usb_write8(adapt, MACReg[i], (u8)MACBackup[i]);
} }
usb_write32(adapt, MACReg[i], MACBackup[i]); usb_write32(adapt, MACReg[i], MACBackup[i]);
} }
...@@ -892,12 +892,12 @@ _PHY_MACSettingCalibration( ...@@ -892,12 +892,12 @@ _PHY_MACSettingCalibration(
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("MAC settings for Calibration.\n")); ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("MAC settings for Calibration.\n"));
rtw_write8(adapt, MACReg[i], 0x3F); usb_write8(adapt, MACReg[i], 0x3F);
for (i = 1; i < (IQK_MAC_REG_NUM - 1); i++) { for (i = 1; i < (IQK_MAC_REG_NUM - 1); i++) {
rtw_write8(adapt, MACReg[i], (u8)(MACBackup[i]&(~BIT3))); usb_write8(adapt, MACReg[i], (u8)(MACBackup[i]&(~BIT3)));
} }
rtw_write8(adapt, MACReg[i], (u8)(MACBackup[i]&(~BIT5))); usb_write8(adapt, MACReg[i], (u8)(MACBackup[i]&(~BIT5)));
} }
void void
...@@ -1208,9 +1208,9 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) ...@@ -1208,9 +1208,9 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
tmpreg = rtw_read8(adapt, 0xd03); tmpreg = rtw_read8(adapt, 0xd03);
if ((tmpreg&0x70) != 0) /* Deal with contisuous TX case */ if ((tmpreg&0x70) != 0) /* Deal with contisuous TX case */
rtw_write8(adapt, 0xd03, tmpreg&0x8F); /* disable all continuous TX */ usb_write8(adapt, 0xd03, tmpreg&0x8F); /* disable all continuous TX */
else /* Deal with Packet TX case */ else /* Deal with Packet TX case */
rtw_write8(adapt, REG_TXPAUSE, 0xFF); /* block all queues */ usb_write8(adapt, REG_TXPAUSE, 0xFF); /* block all queues */
if ((tmpreg&0x70) != 0) { if ((tmpreg&0x70) != 0) {
/* 1. Read original RF mode */ /* 1. Read original RF mode */
...@@ -1242,7 +1242,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) ...@@ -1242,7 +1242,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
if ((tmpreg&0x70) != 0) { if ((tmpreg&0x70) != 0) {
/* Deal with continuous TX case */ /* Deal with continuous TX case */
/* Path-A */ /* Path-A */
rtw_write8(adapt, 0xd03, tmpreg); usb_write8(adapt, 0xd03, tmpreg);
PHY_SetRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode); PHY_SetRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode);
/* Path-B */ /* Path-B */
...@@ -1250,7 +1250,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) ...@@ -1250,7 +1250,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
PHY_SetRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode); PHY_SetRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode);
} else { } else {
/* Deal with Packet TX case */ /* Deal with Packet TX case */
rtw_write8(adapt, REG_TXPAUSE, 0x00); usb_write8(adapt, REG_TXPAUSE, 0x00);
} }
} }
...@@ -1447,7 +1447,7 @@ static void phy_setrfpathswitch_8188e(struct adapter *adapt, bool main, bool is2 ...@@ -1447,7 +1447,7 @@ static void phy_setrfpathswitch_8188e(struct adapter *adapt, bool main, bool is2
if (!adapt->hw_init_completed) { if (!adapt->hw_init_completed) {
u8 u1btmp; u8 u1btmp;
u1btmp = rtw_read8(adapt, REG_LEDCFG2) | BIT7; u1btmp = rtw_read8(adapt, REG_LEDCFG2) | BIT7;
rtw_write8(adapt, REG_LEDCFG2, u1btmp); usb_write8(adapt, REG_LEDCFG2, u1btmp);
PHY_SetBBReg(adapt, rFPGA0_XAB_RFParameter, BIT13, 0x01); PHY_SetBBReg(adapt, rFPGA0_XAB_RFParameter, BIT13, 0x01);
} }
......
...@@ -86,7 +86,7 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers, ...@@ -86,7 +86,7 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
value |= (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd)); value |= (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd));
/* Write the value back to system register */ /* Write the value back to system register */
rtw_write8(padapter, offset, value); usb_write8(padapter, offset, value);
break; break;
case PWR_CMD_POLLING: case PWR_CMD_POLLING:
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n")); RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
......
...@@ -328,7 +328,7 @@ void hal_init_macaddr(struct adapter *adapter) ...@@ -328,7 +328,7 @@ void hal_init_macaddr(struct adapter *adapter)
void c2h_evt_clear(struct adapter *adapter) void c2h_evt_clear(struct adapter *adapter)
{ {
rtw_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE); usb_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE);
} }
s32 c2h_evt_read(struct adapter *adapter, u8 *buf) s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
......
...@@ -833,7 +833,7 @@ void ODM_Write_CCK_CCA_Thres(struct odm_dm_struct *pDM_Odm, u8 CurCCK_CCAThres) ...@@ -833,7 +833,7 @@ void ODM_Write_CCK_CCA_Thres(struct odm_dm_struct *pDM_Odm, u8 CurCCK_CCAThres)
struct adapter *adapt = pDM_Odm->Adapter; struct adapter *adapt = pDM_Odm->Adapter;
if (pDM_DigTable->CurCCK_CCAThres != CurCCK_CCAThres) /* modify by Guo.Mingzhi 2012-01-03 */ if (pDM_DigTable->CurCCK_CCAThres != CurCCK_CCAThres) /* modify by Guo.Mingzhi 2012-01-03 */
rtw_write8(adapt, ODM_REG_CCK_CCA_11N, CurCCK_CCAThres); usb_write8(adapt, ODM_REG_CCK_CCA_11N, CurCCK_CCAThres);
pDM_DigTable->PreCCK_CCAThres = pDM_DigTable->CurCCK_CCAThres; pDM_DigTable->PreCCK_CCAThres = pDM_DigTable->CurCCK_CCAThres;
pDM_DigTable->CurCCK_CCAThres = CurCCK_CCAThres; pDM_DigTable->CurCCK_CCAThres = CurCCK_CCAThres;
} }
......
...@@ -68,7 +68,7 @@ void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data) ...@@ -68,7 +68,7 @@ void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data)
{ {
struct adapter *adapt = pDM_Odm->Adapter; struct adapter *adapt = pDM_Odm->Adapter;
rtw_write8(adapt, Addr, Data); usb_write8(adapt, Addr, Data);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data)); ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data));
} }
......
...@@ -106,13 +106,13 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 ElementID, u32 CmdLen, u8 *p ...@@ -106,13 +106,13 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 ElementID, u32 CmdLen, u8 *p
/* Write Ext command */ /* Write Ext command */
msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num * RTL88E_EX_MESSAGE_BOX_SIZE); msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num * RTL88E_EX_MESSAGE_BOX_SIZE);
for (cmd_idx = 0; cmd_idx < ext_cmd_len; cmd_idx++) { for (cmd_idx = 0; cmd_idx < ext_cmd_len; cmd_idx++) {
rtw_write8(adapt, msgbox_ex_addr+cmd_idx, *((u8 *)(&h2c_cmd_ex)+cmd_idx)); usb_write8(adapt, msgbox_ex_addr+cmd_idx, *((u8 *)(&h2c_cmd_ex)+cmd_idx));
} }
} }
/* Write command */ /* Write command */
msgbox_addr = REG_HMEBOX_0 + (h2c_box_num * RTL88E_MESSAGE_BOX_SIZE); msgbox_addr = REG_HMEBOX_0 + (h2c_box_num * RTL88E_MESSAGE_BOX_SIZE);
for (cmd_idx = 0; cmd_idx < RTL88E_MESSAGE_BOX_SIZE; cmd_idx++) { for (cmd_idx = 0; cmd_idx < RTL88E_MESSAGE_BOX_SIZE; cmd_idx++) {
rtw_write8(adapt, msgbox_addr+cmd_idx, *((u8 *)(&h2c_cmd)+cmd_idx)); usb_write8(adapt, msgbox_addr+cmd_idx, *((u8 *)(&h2c_cmd)+cmd_idx));
} }
bcmd_down = true; bcmd_down = true;
...@@ -620,13 +620,13 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus) ...@@ -620,13 +620,13 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
/* Set REG_CR bit 8. DMA beacon by SW. */ /* Set REG_CR bit 8. DMA beacon by SW. */
haldata->RegCR_1 |= BIT0; haldata->RegCR_1 |= BIT0;
rtw_write8(adapt, REG_CR+1, haldata->RegCR_1); usb_write8(adapt, REG_CR+1, haldata->RegCR_1);
/* Disable Hw protection for a time which revserd for Hw sending beacon. */ /* Disable Hw protection for a time which revserd for Hw sending beacon. */
/* Fix download reserved page packet fail that access collision with the protection time. */ /* Fix download reserved page packet fail that access collision with the protection time. */
/* 2010.05.11. Added by tynli. */ /* 2010.05.11. Added by tynli. */
rtw_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)&(~BIT(3))); usb_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)&(~BIT(3)));
rtw_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)|BIT(4)); usb_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)|BIT(4));
if (haldata->RegFwHwTxQCtrl&BIT6) { if (haldata->RegFwHwTxQCtrl&BIT6) {
DBG_88E("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n"); DBG_88E("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n");
...@@ -634,7 +634,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus) ...@@ -634,7 +634,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
} }
/* Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. */ /* Set FWHW_TXQ_CTRL 0x422[6]=0 to tell Hw the packet is not a real beacon frame. */
rtw_write8(adapt, REG_FWHW_TXQ_CTRL+2, (haldata->RegFwHwTxQCtrl&(~BIT6))); usb_write8(adapt, REG_FWHW_TXQ_CTRL+2, (haldata->RegFwHwTxQCtrl&(~BIT6)));
haldata->RegFwHwTxQCtrl &= (~BIT6); haldata->RegFwHwTxQCtrl &= (~BIT6);
/* Clear beacon valid check bit. */ /* Clear beacon valid check bit. */
...@@ -668,8 +668,8 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus) ...@@ -668,8 +668,8 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
/* */ /* */
/* Enable Bcn */ /* Enable Bcn */
rtw_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)|BIT(3)); usb_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)|BIT(3));
rtw_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)&(~BIT(4))); usb_write8(adapt, REG_BCN_CTRL, rtw_read8(adapt, REG_BCN_CTRL)&(~BIT(4)));
/* To make sure that if there exists an adapter which would like to send beacon. */ /* To make sure that if there exists an adapter which would like to send beacon. */
/* If exists, the origianl value of 0x422[6] will be 1, we should check this to */ /* If exists, the origianl value of 0x422[6] will be 1, we should check this to */
...@@ -677,7 +677,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus) ...@@ -677,7 +677,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
/* the beacon cannot be sent by HW. */ /* the beacon cannot be sent by HW. */
/* 2010.06.23. Added by tynli. */ /* 2010.06.23. Added by tynli. */
if (bSendBeacon) { if (bSendBeacon) {
rtw_write8(adapt, REG_FWHW_TXQ_CTRL+2, (haldata->RegFwHwTxQCtrl|BIT6)); usb_write8(adapt, REG_FWHW_TXQ_CTRL+2, (haldata->RegFwHwTxQCtrl|BIT6));
haldata->RegFwHwTxQCtrl |= BIT6; haldata->RegFwHwTxQCtrl |= BIT6;
} }
...@@ -690,7 +690,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus) ...@@ -690,7 +690,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
/* Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli. */ /* Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli. */
/* Clear CR[8] or beacon packet will not be send to TxBuf anymore. */ /* Clear CR[8] or beacon packet will not be send to TxBuf anymore. */
haldata->RegCR_1 &= (~BIT0); haldata->RegCR_1 &= (~BIT0);
rtw_write8(adapt, REG_CR+1, haldata->RegCR_1); usb_write8(adapt, REG_CR+1, haldata->RegCR_1);
} }
} }
...@@ -713,13 +713,13 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state) ...@@ -713,13 +713,13 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)
/* update CTWindow value. */ /* update CTWindow value. */
if (pwdinfo->ctwindow > 0) { if (pwdinfo->ctwindow > 0) {
p2p_ps_offload->CTWindow_En = 1; p2p_ps_offload->CTWindow_En = 1;
rtw_write8(adapt, REG_P2P_CTWIN, pwdinfo->ctwindow); usb_write8(adapt, REG_P2P_CTWIN, pwdinfo->ctwindow);
} }
/* hw only support 2 set of NoA */ /* hw only support 2 set of NoA */
for (i = 0; i < pwdinfo->noa_num; i++) { for (i = 0; i < pwdinfo->noa_num; i++) {
/* To control the register setting for which NOA */ /* To control the register setting for which NOA */
rtw_write8(adapt, REG_NOA_DESC_SEL, (i << 4)); usb_write8(adapt, REG_NOA_DESC_SEL, (i << 4));
if (i == 0) if (i == 0)
p2p_ps_offload->NoA0_En = 1; p2p_ps_offload->NoA0_En = 1;
else else
...@@ -729,12 +729,12 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state) ...@@ -729,12 +729,12 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)
usb_write32(adapt, REG_NOA_DESC_DURATION, pwdinfo->noa_duration[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_INTERVAL, pwdinfo->noa_interval[i]);
usb_write32(adapt, REG_NOA_DESC_START, pwdinfo->noa_start_time[i]); usb_write32(adapt, REG_NOA_DESC_START, pwdinfo->noa_start_time[i]);
rtw_write8(adapt, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]); usb_write8(adapt, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]);
} }
if ((pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0)) { if ((pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0)) {
/* rst p2p circuit */ /* rst p2p circuit */
rtw_write8(adapt, REG_DUAL_TSF_RST, BIT(4)); usb_write8(adapt, REG_DUAL_TSF_RST, BIT(4));
p2p_ps_offload->Offload_En = 1; p2p_ps_offload->Offload_En = 1;
......
...@@ -39,7 +39,7 @@ static void dm_InitGPIOSetting(struct adapter *Adapter) ...@@ -39,7 +39,7 @@ static void dm_InitGPIOSetting(struct adapter *Adapter)
tmp1byte = rtw_read8(Adapter, REG_GPIO_MUXCFG); tmp1byte = rtw_read8(Adapter, REG_GPIO_MUXCFG);
tmp1byte &= (GPIOSEL_GPIO | ~GPIOSEL_ENBT); tmp1byte &= (GPIOSEL_GPIO | ~GPIOSEL_ENBT);
rtw_write8(Adapter, REG_GPIO_MUXCFG, tmp1byte); usb_write8(Adapter, REG_GPIO_MUXCFG, tmp1byte);
} }
/* */ /* */
......
...@@ -37,7 +37,7 @@ static void iol_mode_enable(struct adapter *padapter, u8 enable) ...@@ -37,7 +37,7 @@ static void iol_mode_enable(struct adapter *padapter, u8 enable)
if (enable) { if (enable) {
/* Enable initial offload */ /* Enable initial offload */
reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG); reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG);
rtw_write8(padapter, REG_SYS_CFG, reg_0xf0|SW_OFFLOAD_EN); usb_write8(padapter, REG_SYS_CFG, reg_0xf0|SW_OFFLOAD_EN);
if (!padapter->bFWReady) { if (!padapter->bFWReady) {
DBG_88E("bFWReady == false call reset 8051...\n"); DBG_88E("bFWReady == false call reset 8051...\n");
...@@ -47,7 +47,7 @@ static void iol_mode_enable(struct adapter *padapter, u8 enable) ...@@ -47,7 +47,7 @@ static void iol_mode_enable(struct adapter *padapter, u8 enable)
} else { } else {
/* disable initial offload */ /* disable initial offload */
reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG); reg_0xf0 = rtw_read8(padapter, REG_SYS_CFG);
rtw_write8(padapter, REG_SYS_CFG, reg_0xf0 & ~SW_OFFLOAD_EN); usb_write8(padapter, REG_SYS_CFG, reg_0xf0 & ~SW_OFFLOAD_EN);
} }
} }
...@@ -59,7 +59,7 @@ static s32 iol_execute(struct adapter *padapter, u8 control) ...@@ -59,7 +59,7 @@ static s32 iol_execute(struct adapter *padapter, u8 control)
control = control&0x0f; control = control&0x0f;
reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0); reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0);
rtw_write8(padapter, REG_HMEBOX_E0, reg_0x88|control); usb_write8(padapter, REG_HMEBOX_E0, reg_0x88|control);
start = jiffies; start = jiffies;
while ((reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0)) & control && while ((reg_0x88 = rtw_read8(padapter, REG_HMEBOX_E0)) & control &&
...@@ -78,7 +78,7 @@ static s32 iol_InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy) ...@@ -78,7 +78,7 @@ static s32 iol_InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy)
{ {
s32 rst = _SUCCESS; s32 rst = _SUCCESS;
iol_mode_enable(padapter, 1); iol_mode_enable(padapter, 1);
rtw_write8(padapter, REG_TDECTRL+1, txpktbuf_bndy); usb_write8(padapter, REG_TDECTRL+1, txpktbuf_bndy);
rst = iol_execute(padapter, CMD_INIT_LLT); rst = iol_execute(padapter, CMD_INIT_LLT);
iol_mode_enable(padapter, 0); iol_mode_enable(padapter, 0);
return rst; return rst;
...@@ -231,14 +231,14 @@ static void efuse_read_phymap_from_txpktbuf( ...@@ -231,14 +231,14 @@ static void efuse_read_phymap_from_txpktbuf(
DBG_88E("%s bcnhead:%d\n", __func__, bcnhead); DBG_88E("%s bcnhead:%d\n", __func__, bcnhead);
rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); usb_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT);
dbg_addr = bcnhead*128/8; /* 8-bytes addressing */ dbg_addr = bcnhead*128/8; /* 8-bytes addressing */
while (1) { while (1) {
usb_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr+i); usb_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr+i);
rtw_write8(adapter, REG_TXPKTBUF_DBG, 0); usb_write8(adapter, REG_TXPKTBUF_DBG, 0);
start = jiffies; start = jiffies;
while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) && while (!(reg_0x143 = rtw_read8(adapter, REG_TXPKTBUF_DBG)) &&
(passing_time = rtw_get_passing_time_ms(start)) < 1000) { (passing_time = rtw_get_passing_time_ms(start)) < 1000) {
...@@ -285,7 +285,7 @@ static void efuse_read_phymap_from_txpktbuf( ...@@ -285,7 +285,7 @@ static void efuse_read_phymap_from_txpktbuf(
break; break;
i++; i++;
} }
rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, DISABLE_TRXPKT_BUF_ACCESS); usb_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, DISABLE_TRXPKT_BUF_ACCESS);
DBG_88E("%s read count:%u\n", __func__, count); DBG_88E("%s read count:%u\n", __func__, count);
*size = count; *size = count;
} }
...@@ -296,9 +296,9 @@ static s32 iol_read_efuse(struct adapter *padapter, u8 txpktbuf_bndy, u16 offset ...@@ -296,9 +296,9 @@ static s32 iol_read_efuse(struct adapter *padapter, u8 txpktbuf_bndy, u16 offset
u8 physical_map[512]; u8 physical_map[512];
u16 size = 512; u16 size = 512;
rtw_write8(padapter, REG_TDECTRL+1, txpktbuf_bndy); usb_write8(padapter, REG_TDECTRL+1, txpktbuf_bndy);
_rtw_memset(physical_map, 0xFF, 512); _rtw_memset(physical_map, 0xFF, 512);
rtw_write8(padapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); usb_write8(padapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT);
status = iol_execute(padapter, CMD_READ_EFUSE_MAP); status = iol_execute(padapter, CMD_READ_EFUSE_MAP);
if (status == _SUCCESS) if (status == _SUCCESS)
efuse_read_phymap_from_txpktbuf(padapter, txpktbuf_bndy, physical_map, &size); efuse_read_phymap_from_txpktbuf(padapter, txpktbuf_bndy, physical_map, &size);
...@@ -326,7 +326,7 @@ static s32 iol_ioconfig(struct adapter *padapter, u8 iocfg_bndy) ...@@ -326,7 +326,7 @@ static s32 iol_ioconfig(struct adapter *padapter, u8 iocfg_bndy)
{ {
s32 rst = _SUCCESS; s32 rst = _SUCCESS;
rtw_write8(padapter, REG_TDECTRL+1, iocfg_bndy); usb_write8(padapter, REG_TDECTRL+1, iocfg_bndy);
rst = iol_execute(padapter, CMD_IOCONFIG); rst = iol_execute(padapter, CMD_IOCONFIG);
return rst; return rst;
} }
...@@ -357,7 +357,7 @@ static int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_fram ...@@ -357,7 +357,7 @@ static int rtl8188e_IOL_exec_cmds_sync(struct adapter *adapter, struct xmit_fram
iol_mode_enable(adapter, 0); iol_mode_enable(adapter, 0);
exit: exit:
/* restore BCN_HEAD */ /* restore BCN_HEAD */
rtw_write8(adapter, REG_TDECTRL+1, 0); usb_write8(adapter, REG_TDECTRL+1, 0);
return ret; return ret;
} }
...@@ -369,7 +369,7 @@ void rtw_IOL_cmd_tx_pkt_buf_dump(struct adapter *Adapter, int data_len) ...@@ -369,7 +369,7 @@ void rtw_IOL_cmd_tx_pkt_buf_dump(struct adapter *Adapter, int data_len)
u8 *pbuf = vzalloc(data_len+10); u8 *pbuf = vzalloc(data_len+10);
DBG_88E("###### %s ######\n", __func__); DBG_88E("###### %s ######\n", __func__);
rtw_write8(Adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); usb_write8(Adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT);
if (pbuf) { if (pbuf) {
for (addr = 0; addr < data_cnts; addr++) { for (addr = 0; addr < data_cnts; addr++) {
usb_write32(Adapter, 0x140, addr); usb_write32(Adapter, 0x140, addr);
...@@ -400,18 +400,18 @@ static void _FWDownloadEnable(struct adapter *padapter, bool enable) ...@@ -400,18 +400,18 @@ static void _FWDownloadEnable(struct adapter *padapter, bool enable)
if (enable) { if (enable) {
/* MCU firmware download enable. */ /* MCU firmware download enable. */
tmp = rtw_read8(padapter, REG_MCUFWDL); tmp = rtw_read8(padapter, REG_MCUFWDL);
rtw_write8(padapter, REG_MCUFWDL, tmp | 0x01); usb_write8(padapter, REG_MCUFWDL, tmp | 0x01);
/* 8051 reset */ /* 8051 reset */
tmp = rtw_read8(padapter, REG_MCUFWDL+2); tmp = rtw_read8(padapter, REG_MCUFWDL+2);
rtw_write8(padapter, REG_MCUFWDL+2, tmp&0xf7); usb_write8(padapter, REG_MCUFWDL+2, tmp&0xf7);
} else { } else {
/* MCU firmware download disable. */ /* MCU firmware download disable. */
tmp = rtw_read8(padapter, REG_MCUFWDL); tmp = rtw_read8(padapter, REG_MCUFWDL);
rtw_write8(padapter, REG_MCUFWDL, tmp&0xfe); usb_write8(padapter, REG_MCUFWDL, tmp&0xfe);
/* Reserved for fw extension. */ /* Reserved for fw extension. */
rtw_write8(padapter, REG_MCUFWDL+1, 0x00); usb_write8(padapter, REG_MCUFWDL+1, 0x00);
} }
} }
...@@ -478,7 +478,7 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize) ...@@ -478,7 +478,7 @@ static int _BlockWrite(struct adapter *padapter, void *buffer, u32 buffSize)
(buffSize-offset), blockSize_p3, blockCount_p3)); (buffSize-offset), blockSize_p3, blockCount_p3));
for (i = 0; i < blockCount_p3; i++) { for (i = 0; i < blockCount_p3; i++) {
ret = rtw_write8(padapter, (FW_8188E_START_ADDRESS + offset + i), *(bufferPtr + offset + i)); ret = usb_write8(padapter, (FW_8188E_START_ADDRESS + offset + i), *(bufferPtr + offset + i));
if (ret == _FAIL) if (ret == _FAIL)
goto exit; goto exit;
...@@ -495,7 +495,7 @@ static int _PageWrite(struct adapter *padapter, u32 page, void *buffer, u32 size ...@@ -495,7 +495,7 @@ static int _PageWrite(struct adapter *padapter, u32 page, void *buffer, u32 size
u8 u8Page = (u8)(page & 0x07); u8 u8Page = (u8)(page & 0x07);
value8 = (rtw_read8(padapter, REG_MCUFWDL+2) & 0xF8) | u8Page; value8 = (rtw_read8(padapter, REG_MCUFWDL+2) & 0xF8) | u8Page;
rtw_write8(padapter, REG_MCUFWDL+2, value8); usb_write8(padapter, REG_MCUFWDL+2, value8);
return _BlockWrite(padapter, buffer, size); return _BlockWrite(padapter, buffer, size);
} }
...@@ -537,8 +537,8 @@ void _8051Reset88E(struct adapter *padapter) ...@@ -537,8 +537,8 @@ void _8051Reset88E(struct adapter *padapter)
u8 u1bTmp; u8 u1bTmp;
u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1); u1bTmp = rtw_read8(padapter, REG_SYS_FUNC_EN+1);
rtw_write8(padapter, REG_SYS_FUNC_EN+1, u1bTmp&(~BIT2)); usb_write8(padapter, REG_SYS_FUNC_EN+1, u1bTmp&(~BIT2));
rtw_write8(padapter, REG_SYS_FUNC_EN+1, u1bTmp|(BIT2)); usb_write8(padapter, REG_SYS_FUNC_EN+1, u1bTmp|(BIT2));
DBG_88E("=====> _8051Reset88E(): 8051 reset success .\n"); DBG_88E("=====> _8051Reset88E(): 8051 reset success .\n");
} }
...@@ -667,7 +667,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter) ...@@ -667,7 +667,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
/* Suggested by Filen. If 8051 is running in RAM code, driver should inform Fw to reset by itself, */ /* Suggested by Filen. If 8051 is running in RAM code, driver should inform Fw to reset by itself, */
/* or it will cause download Fw fail. 2010.02.01. by tynli. */ /* or it will cause download Fw fail. 2010.02.01. by tynli. */
if (rtw_read8(padapter, REG_MCUFWDL) & RAM_DL_SEL) { /* 8051 RAM code */ if (rtw_read8(padapter, REG_MCUFWDL) & RAM_DL_SEL) { /* 8051 RAM code */
rtw_write8(padapter, REG_MCUFWDL, 0x00); usb_write8(padapter, REG_MCUFWDL, 0x00);
_8051Reset88E(padapter); _8051Reset88E(padapter);
} }
...@@ -675,7 +675,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter) ...@@ -675,7 +675,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)
fwdl_start_time = jiffies; fwdl_start_time = jiffies;
while (1) { while (1) {
/* reset the FWDL chksum */ /* reset the FWDL chksum */
rtw_write8(padapter, REG_MCUFWDL, rtw_read8(padapter, REG_MCUFWDL) | FWDL_ChkSum_rpt); usb_write8(padapter, REG_MCUFWDL, rtw_read8(padapter, REG_MCUFWDL) | FWDL_ChkSum_rpt);
rtStatus = _WriteFW(padapter, pFirmwareBuf, FirmwareLen); rtStatus = _WriteFW(padapter, pFirmwareBuf, FirmwareLen);
...@@ -760,7 +760,7 @@ hal_EfusePowerSwitch_RTL8188E( ...@@ -760,7 +760,7 @@ hal_EfusePowerSwitch_RTL8188E(
u16 tmpV16; u16 tmpV16;
if (PwrState) { if (PwrState) {
rtw_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); usb_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON);
/* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), defualt valid */ /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), defualt valid */
tmpV16 = rtw_read16(pAdapter, REG_SYS_ISO_CTRL); tmpV16 = rtw_read16(pAdapter, REG_SYS_ISO_CTRL);
...@@ -787,15 +787,15 @@ hal_EfusePowerSwitch_RTL8188E( ...@@ -787,15 +787,15 @@ hal_EfusePowerSwitch_RTL8188E(
tempval = rtw_read8(pAdapter, EFUSE_TEST+3); tempval = rtw_read8(pAdapter, EFUSE_TEST+3);
tempval &= 0x0F; tempval &= 0x0F;
tempval |= (VOLTAGE_V25 << 4); tempval |= (VOLTAGE_V25 << 4);
rtw_write8(pAdapter, EFUSE_TEST+3, (tempval | 0x80)); usb_write8(pAdapter, EFUSE_TEST+3, (tempval | 0x80));
} }
} else { } else {
rtw_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF); usb_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF);
if (bWrite) { if (bWrite) {
/* Disable LDO 2.5V after read/write action */ /* Disable LDO 2.5V after read/write action */
tempval = rtw_read8(pAdapter, EFUSE_TEST+3); tempval = rtw_read8(pAdapter, EFUSE_TEST+3);
rtw_write8(pAdapter, EFUSE_TEST+3, (tempval & 0x7F)); usb_write8(pAdapter, EFUSE_TEST+3, (tempval & 0x7F));
} }
} }
} }
...@@ -1827,10 +1827,10 @@ static void hal_notch_filter_8188e(struct adapter *adapter, bool enable) ...@@ -1827,10 +1827,10 @@ static void hal_notch_filter_8188e(struct adapter *adapter, bool enable)
{ {
if (enable) { if (enable) {
DBG_88E("Enable notch filter\n"); DBG_88E("Enable notch filter\n");
rtw_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) | BIT1); usb_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) | BIT1);
} else { } else {
DBG_88E("Disable notch filter\n"); DBG_88E("Disable notch filter\n");
rtw_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) & ~BIT1); usb_write8(adapter, rOFDM0_RxDSP+1, rtw_read8(adapter, rOFDM0_RxDSP+1) & ~BIT1);
} }
} }
void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc)
...@@ -2379,5 +2379,5 @@ void SetBcnCtrlReg(struct adapter *padapter, u8 SetBits, u8 ClearBits) ...@@ -2379,5 +2379,5 @@ void SetBcnCtrlReg(struct adapter *padapter, u8 SetBits, u8 ClearBits)
pHalData->RegBcnCtrlVal |= SetBits; pHalData->RegBcnCtrlVal |= SetBits;
pHalData->RegBcnCtrlVal &= ~ClearBits; pHalData->RegBcnCtrlVal &= ~ClearBits;
rtw_write8(padapter, REG_BCN_CTRL, (u8)pHalData->RegBcnCtrlVal); usb_write8(padapter, REG_BCN_CTRL, (u8)pHalData->RegBcnCtrlVal);
} }
...@@ -201,23 +201,23 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven) ...@@ -201,23 +201,23 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(struct adapter *pAdapter, bool beven)
CCK_index = 32; CCK_index = 32;
/* Adjust CCK according to gain index */ /* Adjust CCK according to gain index */
if (!pDM_Odm->RFCalibrateInfo.bCCKinCH14) { if (!pDM_Odm->RFCalibrateInfo.bCCKinCH14) {
rtw_write8(pAdapter, 0xa22, CCKSwingTable_Ch1_Ch13[CCK_index][0]); usb_write8(pAdapter, 0xa22, CCKSwingTable_Ch1_Ch13[CCK_index][0]);
rtw_write8(pAdapter, 0xa23, CCKSwingTable_Ch1_Ch13[CCK_index][1]); usb_write8(pAdapter, 0xa23, CCKSwingTable_Ch1_Ch13[CCK_index][1]);
rtw_write8(pAdapter, 0xa24, CCKSwingTable_Ch1_Ch13[CCK_index][2]); usb_write8(pAdapter, 0xa24, CCKSwingTable_Ch1_Ch13[CCK_index][2]);
rtw_write8(pAdapter, 0xa25, CCKSwingTable_Ch1_Ch13[CCK_index][3]); usb_write8(pAdapter, 0xa25, CCKSwingTable_Ch1_Ch13[CCK_index][3]);
rtw_write8(pAdapter, 0xa26, CCKSwingTable_Ch1_Ch13[CCK_index][4]); usb_write8(pAdapter, 0xa26, CCKSwingTable_Ch1_Ch13[CCK_index][4]);
rtw_write8(pAdapter, 0xa27, CCKSwingTable_Ch1_Ch13[CCK_index][5]); usb_write8(pAdapter, 0xa27, CCKSwingTable_Ch1_Ch13[CCK_index][5]);
rtw_write8(pAdapter, 0xa28, CCKSwingTable_Ch1_Ch13[CCK_index][6]); usb_write8(pAdapter, 0xa28, CCKSwingTable_Ch1_Ch13[CCK_index][6]);
rtw_write8(pAdapter, 0xa29, CCKSwingTable_Ch1_Ch13[CCK_index][7]); usb_write8(pAdapter, 0xa29, CCKSwingTable_Ch1_Ch13[CCK_index][7]);
} else { } else {
rtw_write8(pAdapter, 0xa22, CCKSwingTable_Ch14[CCK_index][0]); usb_write8(pAdapter, 0xa22, CCKSwingTable_Ch14[CCK_index][0]);
rtw_write8(pAdapter, 0xa23, CCKSwingTable_Ch14[CCK_index][1]); usb_write8(pAdapter, 0xa23, CCKSwingTable_Ch14[CCK_index][1]);
rtw_write8(pAdapter, 0xa24, CCKSwingTable_Ch14[CCK_index][2]); usb_write8(pAdapter, 0xa24, CCKSwingTable_Ch14[CCK_index][2]);
rtw_write8(pAdapter, 0xa25, CCKSwingTable_Ch14[CCK_index][3]); usb_write8(pAdapter, 0xa25, CCKSwingTable_Ch14[CCK_index][3]);
rtw_write8(pAdapter, 0xa26, CCKSwingTable_Ch14[CCK_index][4]); usb_write8(pAdapter, 0xa26, CCKSwingTable_Ch14[CCK_index][4]);
rtw_write8(pAdapter, 0xa27, CCKSwingTable_Ch14[CCK_index][5]); usb_write8(pAdapter, 0xa27, CCKSwingTable_Ch14[CCK_index][5]);
rtw_write8(pAdapter, 0xa28, CCKSwingTable_Ch14[CCK_index][6]); usb_write8(pAdapter, 0xa28, CCKSwingTable_Ch14[CCK_index][6]);
rtw_write8(pAdapter, 0xa29, CCKSwingTable_Ch14[CCK_index][7]); usb_write8(pAdapter, 0xa29, CCKSwingTable_Ch14[CCK_index][7]);
} }
} }
} }
......
...@@ -608,9 +608,9 @@ PHY_BBConfig8188E( ...@@ -608,9 +608,9 @@ PHY_BBConfig8188E(
/* 20090923 Joseph: Advised by Steven and Jenyu. Power sequence before init RF. */ /* 20090923 Joseph: Advised by Steven and Jenyu. Power sequence before init RF. */
rtw_write8(Adapter, REG_RF_CTRL, RF_EN|RF_RSTB|RF_SDMRSTB); usb_write8(Adapter, REG_RF_CTRL, RF_EN|RF_RSTB|RF_SDMRSTB);
rtw_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB); usb_write8(Adapter, REG_SYS_FUNC_EN, FEN_USBA | FEN_USBD | FEN_BB_GLB_RSTn | FEN_BBRSTB);
/* Config BB and AGC */ /* Config BB and AGC */
rtStatus = phy_BB8188E_Config_ParaFile(Adapter); rtStatus = phy_BB8188E_Config_ParaFile(Adapter);
...@@ -799,14 +799,14 @@ _PHY_SetBWMode92C( ...@@ -799,14 +799,14 @@ _PHY_SetBWMode92C(
case HT_CHANNEL_WIDTH_20: case HT_CHANNEL_WIDTH_20:
regBwOpMode |= BW_OPMODE_20MHZ; regBwOpMode |= BW_OPMODE_20MHZ;
/* 2007/02/07 Mark by Emily because we have not verify whether this register works */ /* 2007/02/07 Mark by Emily because we have not verify whether this register works */
rtw_write8(Adapter, REG_BWOPMODE, regBwOpMode); usb_write8(Adapter, REG_BWOPMODE, regBwOpMode);
break; break;
case HT_CHANNEL_WIDTH_40: case HT_CHANNEL_WIDTH_40:
regBwOpMode &= ~BW_OPMODE_20MHZ; regBwOpMode &= ~BW_OPMODE_20MHZ;
/* 2007/02/07 Mark by Emily because we have not verify whether this register works */ /* 2007/02/07 Mark by Emily because we have not verify whether this register works */
rtw_write8(Adapter, REG_BWOPMODE, regBwOpMode); usb_write8(Adapter, REG_BWOPMODE, regBwOpMode);
regRRSR_RSC = (regRRSR_RSC&0x90) | (pHalData->nCur40MhzPrimeSC<<5); regRRSR_RSC = (regRRSR_RSC&0x90) | (pHalData->nCur40MhzPrimeSC<<5);
rtw_write8(Adapter, REG_RRSR+2, regRRSR_RSC); usb_write8(Adapter, REG_RRSR+2, regRRSR_RSC);
break; break;
default: default:
break; break;
......
...@@ -366,7 +366,7 @@ static void writeOFDMPowerReg88E(struct adapter *Adapter, u8 index, u32 *pValue) ...@@ -366,7 +366,7 @@ static void writeOFDMPowerReg88E(struct adapter *Adapter, u8 index, u32 *pValue)
writeVal = (writeVal > 8) ? (writeVal-8) : 0; writeVal = (writeVal > 8) ? (writeVal-8) : 0;
else else
writeVal = (writeVal > 6) ? (writeVal-6) : 0; writeVal = (writeVal > 6) ? (writeVal-6) : 0;
rtw_write8(Adapter, (u32)(regoffset+i), (u8)writeVal); usb_write8(Adapter, (u32)(regoffset+i), (u8)writeVal);
} }
} }
} }
......
...@@ -35,7 +35,7 @@ void SwLedOn(struct adapter *padapter, struct LED_871x *pLed) ...@@ -35,7 +35,7 @@ void SwLedOn(struct adapter *padapter, struct LED_871x *pLed)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped) if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
return; return;
LedCfg = rtw_read8(padapter, REG_LEDCFG2); LedCfg = rtw_read8(padapter, REG_LEDCFG2);
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); /* SW control led0 on. */ usb_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); /* SW control led0 on. */
pLed->bLedOn = true; pLed->bLedOn = true;
} }
...@@ -54,12 +54,12 @@ void SwLedOff(struct adapter *padapter, struct LED_871x *pLed) ...@@ -54,12 +54,12 @@ void SwLedOff(struct adapter *padapter, struct LED_871x *pLed)
if (pHalData->bLedOpenDrain) { if (pHalData->bLedOpenDrain) {
/* Open-drain arrangement for controlling the LED) */ /* Open-drain arrangement for controlling the LED) */
LedCfg &= 0x90; /* Set to software control. */ LedCfg &= 0x90; /* Set to software control. */
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3)); usb_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG); LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
LedCfg &= 0xFE; LedCfg &= 0xFE;
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg); usb_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
} else { } else {
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6)); usb_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3|BIT5|BIT6));
} }
exit: exit:
pLed->bLedOn = false; pLed->bLedOn = false;
......
This diff is collapsed.
...@@ -181,7 +181,7 @@ static u32 usb_read32(struct adapter *adapter, u32 addr) ...@@ -181,7 +181,7 @@ static u32 usb_read32(struct adapter *adapter, u32 addr)
return le32_to_cpu(data); return le32_to_cpu(data);
} }
static int usb_write8(struct adapter *adapter, u32 addr, u8 val) int usb_write8(struct adapter *adapter, u32 addr, u8 val)
{ {
u8 request; u8 request;
u8 requesttype; u8 requesttype;
...@@ -669,5 +669,4 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops) ...@@ -669,5 +669,4 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops)
pops->_read8 = &usb_read8; pops->_read8 = &usb_read8;
pops->_read16 = &usb_read16; pops->_read16 = &usb_read16;
pops->_read32 = &usb_read32; pops->_read32 = &usb_read32;
pops->_write8 = &usb_write8;
} }
...@@ -47,7 +47,6 @@ struct _io_ops { ...@@ -47,7 +47,6 @@ struct _io_ops {
u8 (*_read8)(struct adapter *pintfhdl, u32 addr); u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
u16 (*_read16)(struct adapter *pintfhdl, u32 addr); u16 (*_read16)(struct adapter *pintfhdl, u32 addr);
u32 (*_read32)(struct adapter *pintfhdl, u32 addr); u32 (*_read32)(struct adapter *pintfhdl, u32 addr);
int (*_write8)(struct adapter *pintfhdl, u32 addr, u8 val);
}; };
struct io_req { struct io_req {
...@@ -85,7 +84,7 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr); ...@@ -85,7 +84,7 @@ u32 _rtw_read32(struct adapter *adapter, u32 addr);
u32 usb_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 usb_read_port_cancel(struct adapter *adapter); void usb_read_port_cancel(struct adapter *adapter);
int _rtw_write8(struct adapter *adapter, u32 addr, u8 val); int usb_write8(struct adapter *adapter, u32 addr, u8 val);
int usb_write16(struct adapter *adapter, u32 addr, u16 val); int usb_write16(struct adapter *adapter, u32 addr, u16 val);
int usb_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); int usb_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *pdata);
...@@ -97,9 +96,6 @@ void usb_write_port_cancel(struct adapter *adapter); ...@@ -97,9 +96,6 @@ void usb_write_port_cancel(struct adapter *adapter);
#define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr)) #define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr))
#define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr)) #define rtw_read32(adapter, addr) _rtw_read32((adapter), (addr))
#define rtw_write8(adapter, addr, val) \
_rtw_write8((adapter), (addr), (val))
int rtw_init_io_priv(struct adapter *padapter, int rtw_init_io_priv(struct adapter *padapter,
void (*set_intf_ops)(struct _io_ops *pops)); void (*set_intf_ops)(struct _io_ops *pops));
......
...@@ -2222,7 +2222,7 @@ static int rtw_wx_write32(struct net_device *dev, ...@@ -2222,7 +2222,7 @@ static int rtw_wx_write32(struct net_device *dev,
switch (bytes) { switch (bytes) {
case 1: case 1:
rtw_write8(padapter, addr, (u8)data32); usb_write8(padapter, addr, (u8)data32);
DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%02X\n", __func__, addr, (u8)data32); DBG_88E(KERN_INFO "%s: addr = 0x%08X data = 0x%02X\n", __func__, addr, (u8)data32);
break; break;
case 2: case 2:
...@@ -2370,7 +2370,7 @@ static void rtw_dbg_mode_hdl(struct adapter *padapter, u32 id, u8 *pdata, u32 le ...@@ -2370,7 +2370,7 @@ static void rtw_dbg_mode_hdl(struct adapter *padapter, u32 id, u8 *pdata, u32 le
RegRWStruct = (struct mp_rw_reg *)pdata; RegRWStruct = (struct mp_rw_reg *)pdata;
switch (RegRWStruct->width) { switch (RegRWStruct->width) {
case 1: case 1:
rtw_write8(padapter, RegRWStruct->offset, (u8)RegRWStruct->value); usb_write8(padapter, RegRWStruct->offset, (u8)RegRWStruct->value);
break; break;
case 2: case 2:
usb_write16(padapter, RegRWStruct->offset, (u16)RegRWStruct->value); usb_write16(padapter, RegRWStruct->offset, (u16)RegRWStruct->value);
...@@ -4122,8 +4122,8 @@ static int rtw_dbg_port(struct net_device *dev, ...@@ -4122,8 +4122,8 @@ static int rtw_dbg_port(struct net_device *dev,
case 0x71:/* write_reg */ case 0x71:/* write_reg */
switch (minor_cmd) { switch (minor_cmd) {
case 1: case 1:
rtw_write8(padapter, arg, extra_arg); usb_write8(padapter, arg, extra_arg);
DBG_88E("rtw_write8(0x%x) = 0x%02x\n", arg, rtw_read8(padapter, arg)); DBG_88E("usb_write8(0x%x) = 0x%02x\n", arg, rtw_read8(padapter, arg));
break; break;
case 2: case 2:
usb_write16(padapter, arg, extra_arg); usb_write16(padapter, arg, extra_arg);
...@@ -4576,9 +4576,9 @@ static int rtw_dbg_port(struct net_device *dev, ...@@ -4576,9 +4576,9 @@ static int rtw_dbg_port(struct net_device *dev,
break; break;
case 0xfd: case 0xfd:
rtw_write8(padapter, 0xc50, arg); usb_write8(padapter, 0xc50, arg);
DBG_88E("wr(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50)); DBG_88E("wr(0xc50) = 0x%x\n", rtw_read8(padapter, 0xc50));
rtw_write8(padapter, 0xc58, arg); usb_write8(padapter, 0xc58, arg);
DBG_88E("wr(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58)); DBG_88E("wr(0xc58) = 0x%x\n", rtw_read8(padapter, 0xc58));
break; break;
case 0xfe: case 0xfe:
...@@ -6414,7 +6414,7 @@ static int rtw_mp_write_reg(struct net_device *dev, ...@@ -6414,7 +6414,7 @@ static int rtw_mp_write_reg(struct net_device *dev,
ret = -EINVAL; ret = -EINVAL;
break; break;
} }
rtw_write8(padapter, addr, data); usb_write8(padapter, addr, data);
break; break;
case 'w': case 'w':
/* 2 bytes */ /* 2 bytes */
......
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