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

staging: rtl8188eu: Remove function _rtw_read16()

_rtw_read16() is a wrapper function, being used to call usb_read16().
Call usb_read16() directly and drop _rtw_read16().
Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 99ecfb06
...@@ -101,7 +101,7 @@ int proc_get_read_reg(char *page, char **start, ...@@ -101,7 +101,7 @@ int proc_get_read_reg(char *page, char **start,
len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr)); len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
break; break;
case 2: case 2:
len += snprintf(page + len, count - len, "rtw_read16(0x%x)=0x%x\n", proc_get_read_addr, rtw_read16(padapter, proc_get_read_addr)); len += snprintf(page + len, count - len, "usb_read16(0x%x)=0x%x\n", proc_get_read_addr, usb_read16(padapter, proc_get_read_addr));
break; break;
case 4: case 4:
len += snprintf(page + len, count - len, "usb_read32(0x%x)=0x%x\n", proc_get_read_addr, usb_read32(padapter, proc_get_read_addr)); len += snprintf(page + len, count - len, "usb_read32(0x%x)=0x%x\n", proc_get_read_addr, usb_read32(padapter, proc_get_read_addr));
......
...@@ -64,18 +64,6 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr) ...@@ -64,18 +64,6 @@ u8 _rtw_read8(struct adapter *adapter, u32 addr)
return r_val; return r_val;
} }
u16 _rtw_read16(struct adapter *adapter, u32 addr)
{
u16 r_val;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u16 (*_read16)(struct adapter *pintfhdl, u32 addr);
_read16 = pintfhdl->io_ops._read16;
r_val = _read16(adapter, addr);
return r_val;
}
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;
......
...@@ -33,7 +33,7 @@ u32 read_macreg(struct adapter *padapter, u32 addr, u32 sz) ...@@ -33,7 +33,7 @@ u32 read_macreg(struct adapter *padapter, u32 addr, u32 sz)
val = rtw_read8(padapter, addr); val = rtw_read8(padapter, addr);
break; break;
case 2: case 2:
val = rtw_read16(padapter, addr); val = usb_read16(padapter, addr);
break; break;
case 4: case 4:
val = usb_read32(padapter, addr); val = usb_read32(padapter, addr);
......
...@@ -804,7 +804,7 @@ int rtl8188eu_oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv) ...@@ -804,7 +804,7 @@ int rtl8188eu_oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv)
RegRWStruct->value = rtw_read8(Adapter, offset); RegRWStruct->value = rtw_read8(Adapter, offset);
break; break;
case 2: case 2:
RegRWStruct->value = rtw_read16(Adapter, offset); RegRWStruct->value = usb_read16(Adapter, offset);
break; break;
default: default:
width = 4; width = 4;
......
...@@ -763,20 +763,20 @@ hal_EfusePowerSwitch_RTL8188E( ...@@ -763,20 +763,20 @@ hal_EfusePowerSwitch_RTL8188E(
usb_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 = usb_read16(pAdapter, REG_SYS_ISO_CTRL);
if (!(tmpV16 & PWC_EV12V)) { if (!(tmpV16 & PWC_EV12V)) {
tmpV16 |= PWC_EV12V; tmpV16 |= PWC_EV12V;
usb_write16(pAdapter, REG_SYS_ISO_CTRL, tmpV16); usb_write16(pAdapter, REG_SYS_ISO_CTRL, tmpV16);
} }
/* Reset: 0x0000h[28], default valid */ /* Reset: 0x0000h[28], default valid */
tmpV16 = rtw_read16(pAdapter, REG_SYS_FUNC_EN); tmpV16 = usb_read16(pAdapter, REG_SYS_FUNC_EN);
if (!(tmpV16 & FEN_ELDR)) { if (!(tmpV16 & FEN_ELDR)) {
tmpV16 |= FEN_ELDR; tmpV16 |= FEN_ELDR;
usb_write16(pAdapter, REG_SYS_FUNC_EN, tmpV16); usb_write16(pAdapter, REG_SYS_FUNC_EN, tmpV16);
} }
/* Clock: Gated(0x0008h[5]) 8M(0x0008h[1]) clock from ANA, default valid */ /* Clock: Gated(0x0008h[5]) 8M(0x0008h[1]) clock from ANA, default valid */
tmpV16 = rtw_read16(pAdapter, REG_SYS_CLKR); tmpV16 = usb_read16(pAdapter, REG_SYS_CLKR);
if ((!(tmpV16 & LOADER_CLK_EN)) || (!(tmpV16 & ANA8M))) { if ((!(tmpV16 & LOADER_CLK_EN)) || (!(tmpV16 & ANA8M))) {
tmpV16 |= (LOADER_CLK_EN | ANA8M); tmpV16 |= (LOADER_CLK_EN | ANA8M);
usb_write16(pAdapter, REG_SYS_CLKR, tmpV16); usb_write16(pAdapter, REG_SYS_CLKR, tmpV16);
...@@ -1882,7 +1882,7 @@ u8 GetEEPROMSize8188E(struct adapter *padapter) ...@@ -1882,7 +1882,7 @@ u8 GetEEPROMSize8188E(struct adapter *padapter)
u8 size = 0; u8 size = 0;
u32 cr; u32 cr;
cr = rtw_read16(padapter, REG_9346CR); cr = usb_read16(padapter, REG_9346CR);
/* 6: EEPROM used is 93C46, 4: boot from E-Fuse. */ /* 6: EEPROM used is 93C46, 4: boot from E-Fuse. */
size = (cr & BOOT_FROM_EEPROM) ? 6 : 4; size = (cr & BOOT_FROM_EEPROM) ? 6 : 4;
......
...@@ -603,7 +603,7 @@ PHY_BBConfig8188E( ...@@ -603,7 +603,7 @@ PHY_BBConfig8188E(
/* Enable BB and RF */ /* Enable BB and RF */
RegVal = rtw_read16(Adapter, REG_SYS_FUNC_EN); RegVal = usb_read16(Adapter, REG_SYS_FUNC_EN);
usb_write16(Adapter, REG_SYS_FUNC_EN, (u16)(RegVal|BIT13|BIT0|BIT1)); usb_write16(Adapter, REG_SYS_FUNC_EN, (u16)(RegVal|BIT13|BIT0|BIT1));
/* 20090923 Joseph: Advised by Steven and Jenyu. Power sequence before init RF. */ /* 20090923 Joseph: Advised by Steven and Jenyu. Power sequence before init RF. */
......
...@@ -120,7 +120,7 @@ static u32 rtl8188eu_InitPowerOn(struct adapter *adapt) ...@@ -120,7 +120,7 @@ static u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
usb_write16(adapt, REG_CR, 0x00); /* suggseted by zhouzhou, by page, 20111230 */ usb_write16(adapt, REG_CR, 0x00); /* suggseted by zhouzhou, by page, 20111230 */
/* Enable MAC DMA/WMAC/SCHEDULE/SEC block */ /* Enable MAC DMA/WMAC/SCHEDULE/SEC block */
value16 = rtw_read16(adapt, REG_CR); value16 = usb_read16(adapt, REG_CR);
value16 |= (HCI_TXDMA_EN | HCI_RXDMA_EN | TXDMA_EN | RXDMA_EN value16 |= (HCI_TXDMA_EN | HCI_RXDMA_EN | TXDMA_EN | RXDMA_EN
| PROTOCOL_EN | SCHEDULE_EN | ENSEC | CALTMR_EN); | PROTOCOL_EN | SCHEDULE_EN | ENSEC | CALTMR_EN);
/* for SDIO - Set CR bit10 to enable 32k calibration. Suggested by SD1 Gimmy. Added by tynli. 2011.08.31. */ /* for SDIO - Set CR bit10 to enable 32k calibration. Suggested by SD1 Gimmy. Added by tynli. 2011.08.31. */
...@@ -221,7 +221,7 @@ static void _InitNormalChipRegPriority(struct adapter *Adapter, u16 beQ, ...@@ -221,7 +221,7 @@ static void _InitNormalChipRegPriority(struct adapter *Adapter, u16 beQ,
u16 bkQ, u16 viQ, u16 voQ, u16 mgtQ, u16 bkQ, u16 viQ, u16 voQ, u16 mgtQ,
u16 hiQ) u16 hiQ)
{ {
u16 value16 = (rtw_read16(Adapter, REG_TRXDMA_CTRL) & 0x7); u16 value16 = (usb_read16(Adapter, REG_TRXDMA_CTRL) & 0x7);
value16 |= _TXDMA_BEQ_MAP(beQ) | _TXDMA_BKQ_MAP(bkQ) | value16 |= _TXDMA_BEQ_MAP(beQ) | _TXDMA_BKQ_MAP(bkQ) |
_TXDMA_VIQ_MAP(viQ) | _TXDMA_VOQ_MAP(voQ) | _TXDMA_VIQ_MAP(viQ) | _TXDMA_VOQ_MAP(voQ) |
...@@ -823,7 +823,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter) ...@@ -823,7 +823,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
/* Init CR MACTXEN, MACRXEN after setting RxFF boundary REG_TRXFF_BNDY to patch */ /* Init CR MACTXEN, MACRXEN after setting RxFF boundary REG_TRXFF_BNDY to patch */
/* Hw bug which Hw initials RxFF boundary size to a value which is larger than the real Rx buffer size in 88E. */ /* Hw bug which Hw initials RxFF boundary size to a value which is larger than the real Rx buffer size in 88E. */
/* Enable MACTXEN/MACRXEN block */ /* Enable MACTXEN/MACRXEN block */
value16 = rtw_read16(Adapter, REG_CR); value16 = usb_read16(Adapter, REG_CR);
value16 |= (MACTXEN | MACRXEN); value16 |= (MACTXEN | MACRXEN);
usb_write8(Adapter, REG_CR, value16); usb_write8(Adapter, REG_CR, value16);
...@@ -905,7 +905,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM); ...@@ -905,7 +905,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
usb_write16(Adapter, REG_TX_RPT_TIME, 0x3DF0); usb_write16(Adapter, REG_TX_RPT_TIME, 0x3DF0);
/* enable tx DMA to drop the redundate data of packet */ /* enable tx DMA to drop the redundate data of packet */
usb_write16(Adapter, REG_TXDMA_OFFSET_CHK, (rtw_read16(Adapter, REG_TXDMA_OFFSET_CHK) | DROP_DATA_EN)); usb_write16(Adapter, REG_TXDMA_OFFSET_CHK, (usb_read16(Adapter, REG_TXDMA_OFFSET_CHK) | DROP_DATA_EN));
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK); HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
/* 2010/08/26 MH Merge from 8192CE. */ /* 2010/08/26 MH Merge from 8192CE. */
...@@ -1801,7 +1801,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val) ...@@ -1801,7 +1801,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
usb_write8(Adapter, REG_TXPAUSE, 0xff); usb_write8(Adapter, REG_TXPAUSE, 0xff);
/* keep sn */ /* keep sn */
Adapter->xmitpriv.nqos_ssn = rtw_read16(Adapter, REG_NQOS_SEQ); Adapter->xmitpriv.nqos_ssn = usb_read16(Adapter, REG_NQOS_SEQ);
if (!pwrpriv->bkeepfwalive) { if (!pwrpriv->bkeepfwalive) {
/* RX DMA stop */ /* RX DMA stop */
......
...@@ -139,7 +139,7 @@ static u8 usb_read8(struct adapter *adapter, u32 addr) ...@@ -139,7 +139,7 @@ static u8 usb_read8(struct adapter *adapter, u32 addr)
} }
static u16 usb_read16(struct adapter *adapter, u32 addr) u16 usb_read16(struct adapter *adapter, u32 addr)
{ {
u8 request; u8 request;
u8 requesttype; u8 requesttype;
...@@ -667,5 +667,4 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops) ...@@ -667,5 +667,4 @@ void rtl8188eu_set_intf_ops(struct _io_ops *pops)
{ {
_rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops)); _rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops));
pops->_read8 = &usb_read8; pops->_read8 = &usb_read8;
pops->_read16 = &usb_read16;
} }
...@@ -45,7 +45,6 @@ struct intf_hdl; ...@@ -45,7 +45,6 @@ struct intf_hdl;
struct _io_ops { struct _io_ops {
u8 (*_read8)(struct adapter *pintfhdl, u32 addr); u8 (*_read8)(struct adapter *pintfhdl, u32 addr);
u16 (*_read16)(struct adapter *pintfhdl, u32 addr);
}; };
struct io_req { struct io_req {
...@@ -78,7 +77,7 @@ struct io_priv { ...@@ -78,7 +77,7 @@ struct io_priv {
}; };
u8 _rtw_read8(struct adapter *adapter, u32 addr); u8 _rtw_read8(struct adapter *adapter, u32 addr);
u16 _rtw_read16(struct adapter *adapter, u32 addr); u16 usb_read16(struct adapter *adapter, u32 addr);
u32 usb_read32(struct adapter *adapter, u32 addr); u32 usb_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);
...@@ -92,7 +91,6 @@ u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem); ...@@ -92,7 +91,6 @@ u32 usb_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
void usb_write_port_cancel(struct adapter *adapter); void usb_write_port_cancel(struct adapter *adapter);
#define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr)) #define rtw_read8(adapter, addr) _rtw_read8((adapter), (addr))
#define rtw_read16(adapter, addr) _rtw_read16((adapter), (addr))
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));
......
...@@ -2183,7 +2183,7 @@ static int rtw_wx_read32(struct net_device *dev, ...@@ -2183,7 +2183,7 @@ static int rtw_wx_read32(struct net_device *dev,
sprintf(extra, "0x%02X", data32); sprintf(extra, "0x%02X", data32);
break; break;
case 2: case 2:
data32 = rtw_read16(padapter, addr); data32 = usb_read16(padapter, addr);
sprintf(extra, "0x%04X", data32); sprintf(extra, "0x%04X", data32);
break; break;
case 4: case 4:
...@@ -2356,7 +2356,7 @@ static void rtw_dbg_mode_hdl(struct adapter *padapter, u32 id, u8 *pdata, u32 le ...@@ -2356,7 +2356,7 @@ static void rtw_dbg_mode_hdl(struct adapter *padapter, u32 id, u8 *pdata, u32 le
RegRWStruct->value = rtw_read8(padapter, RegRWStruct->offset); RegRWStruct->value = rtw_read8(padapter, RegRWStruct->offset);
break; break;
case 2: case 2:
RegRWStruct->value = rtw_read16(padapter, RegRWStruct->offset); RegRWStruct->value = usb_read16(padapter, RegRWStruct->offset);
break; break;
case 4: case 4:
RegRWStruct->value = usb_read32(padapter, RegRWStruct->offset); RegRWStruct->value = usb_read32(padapter, RegRWStruct->offset);
...@@ -4112,7 +4112,7 @@ static int rtw_dbg_port(struct net_device *dev, ...@@ -4112,7 +4112,7 @@ static int rtw_dbg_port(struct net_device *dev,
DBG_88E("rtw_read8(0x%x) = 0x%02x\n", arg, rtw_read8(padapter, arg)); DBG_88E("rtw_read8(0x%x) = 0x%02x\n", arg, rtw_read8(padapter, arg));
break; break;
case 2: case 2:
DBG_88E("rtw_read16(0x%x) = 0x%04x\n", arg, rtw_read16(padapter, arg)); DBG_88E("usb_read16(0x%x) = 0x%04x\n", arg, usb_read16(padapter, arg));
break; break;
case 4: case 4:
DBG_88E("usb_read32(0x%x) = 0x%08x\n", arg, usb_read32(padapter, arg)); DBG_88E("usb_read32(0x%x) = 0x%08x\n", arg, usb_read32(padapter, arg));
...@@ -4127,7 +4127,7 @@ static int rtw_dbg_port(struct net_device *dev, ...@@ -4127,7 +4127,7 @@ static int rtw_dbg_port(struct net_device *dev,
break; break;
case 2: case 2:
usb_write16(padapter, arg, extra_arg); usb_write16(padapter, arg, extra_arg);
DBG_88E("usb_write16(0x%x) = 0x%04x\n", arg, rtw_read16(padapter, arg)); DBG_88E("usb_write16(0x%x) = 0x%04x\n", arg, usb_read16(padapter, arg));
break; break;
case 4: case 4:
usb_write32(padapter, arg, extra_arg); usb_write32(padapter, arg, extra_arg);
...@@ -4256,7 +4256,7 @@ static int rtw_dbg_port(struct net_device *dev, ...@@ -4256,7 +4256,7 @@ static int rtw_dbg_port(struct net_device *dev,
if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0)) if (_SUCCESS != rtw_IOL_exec_cmds_sync(padapter, xmit_frame, 5000, 0))
ret = -EPERM; ret = -EPERM;
final = rtw_read16(padapter, reg); final = usb_read16(padapter, reg);
if (start_value+write_num-1 == final) if (start_value+write_num-1 == final)
DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final); DBG_88E("continuous IOL_CMD_WW_REG to 0x%x %u times Success, start:%u, final:%u\n", reg, write_num, start_value, final);
else else
...@@ -6499,7 +6499,7 @@ static int rtw_mp_read_reg(struct net_device *dev, ...@@ -6499,7 +6499,7 @@ static int rtw_mp_read_reg(struct net_device *dev,
break; break;
case 'w': case 'w':
/* 2 bytes */ /* 2 bytes */
sprintf(data, "%04x\n", rtw_read16(padapter, addr)); sprintf(data, "%04x\n", usb_read16(padapter, addr));
for (i = 0; i <= strlen(data); i++) { for (i = 0; i <= strlen(data); i++) {
if (i%2 == 0) { if (i%2 == 0) {
tmp[j] = ' '; tmp[j] = ' ';
......
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