Commit bf5bff47 authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Greg Kroah-Hartman

staging: rtl8187se: Removed empty functions and one-iteration loop

Removed empty functions, their calls and 'do {} while (0)' loop
condition
Signed-off-by: default avatarMaxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 51150d27
...@@ -217,118 +217,115 @@ static int HwHSSIThreeWire(struct net_device *dev, ...@@ -217,118 +217,115 @@ static int HwHSSIThreeWire(struct net_device *dev,
u8 TryCnt; u8 TryCnt;
u8 u1bTmp; u8 u1bTmp;
do { /* Check if WE and RE are cleared. */
/* Check if WE and RE are cleared. */ for (TryCnt = 0; TryCnt < TC_3W_POLL_MAX_TRY_CNT; TryCnt++) {
for (TryCnt = 0; TryCnt < TC_3W_POLL_MAX_TRY_CNT; TryCnt++) { u1bTmp = read_nic_byte(dev, SW_3W_CMD1);
u1bTmp = read_nic_byte(dev, SW_3W_CMD1); if ((u1bTmp & (SW_3W_CMD1_RE|SW_3W_CMD1_WE)) == 0)
if ((u1bTmp & (SW_3W_CMD1_RE|SW_3W_CMD1_WE)) == 0) break;
break;
udelay(10); udelay(10);
} }
if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) { if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) {
printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:" printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:"
" %#X RE|WE bits are not clear!!\n", u1bTmp); " %#X RE|WE bits are not clear!!\n", u1bTmp);
dump_stack(); dump_stack();
return 0; return 0;
} }
/* RTL8187S HSSI Read/Write Function */ /* RTL8187S HSSI Read/Write Function */
u1bTmp = read_nic_byte(dev, RF_SW_CONFIG); u1bTmp = read_nic_byte(dev, RF_SW_CONFIG);
if (bSI) if (bSI)
u1bTmp |= RF_SW_CFG_SI; /* reg08[1]=1 Serial Interface(SI) */ u1bTmp |= RF_SW_CFG_SI; /* reg08[1]=1 Serial Interface(SI) */
else else
u1bTmp &= ~RF_SW_CFG_SI; /* reg08[1]=0 Parallel Interface(PI) */ u1bTmp &= ~RF_SW_CFG_SI; /* reg08[1]=0 Parallel Interface(PI) */
write_nic_byte(dev, RF_SW_CONFIG, u1bTmp); write_nic_byte(dev, RF_SW_CONFIG, u1bTmp);
if (bSI) { if (bSI) {
/* jong: HW SI read must set reg84[3]=0. */ /* jong: HW SI read must set reg84[3]=0. */
u1bTmp = read_nic_byte(dev, RFPinsSelect); u1bTmp = read_nic_byte(dev, RFPinsSelect);
u1bTmp &= ~BIT3; u1bTmp &= ~BIT3;
write_nic_byte(dev, RFPinsSelect, u1bTmp); write_nic_byte(dev, RFPinsSelect, u1bTmp);
} }
/* Fill up data buffer for write operation. */ /* Fill up data buffer for write operation. */
if (bWrite) { if (bWrite) {
if (nDataBufBitCnt == 16) { if (nDataBufBitCnt == 16) {
write_nic_word(dev, SW_3W_DB0, *((u16 *)pDataBuf)); write_nic_word(dev, SW_3W_DB0, *((u16 *)pDataBuf));
} else if (nDataBufBitCnt == 64) { } else if (nDataBufBitCnt == 64) {
/* RTL8187S shouldn't enter this case */ /* RTL8187S shouldn't enter this case */
write_nic_dword(dev, SW_3W_DB0, *((u32 *)pDataBuf)); write_nic_dword(dev, SW_3W_DB0, *((u32 *)pDataBuf));
write_nic_dword(dev, SW_3W_DB1, *((u32 *)(pDataBuf + 4))); write_nic_dword(dev, SW_3W_DB1, *((u32 *)(pDataBuf + 4)));
} else { } else {
int idx; int idx;
int ByteCnt = nDataBufBitCnt / 8; int ByteCnt = nDataBufBitCnt / 8;
/* printk("%d\n",nDataBufBitCnt); */ /* printk("%d\n",nDataBufBitCnt); */
if ((nDataBufBitCnt % 8) != 0) { if ((nDataBufBitCnt % 8) != 0) {
printk(KERN_ERR "rtl8187se: " printk(KERN_ERR "rtl8187se: "
"HwThreeWire(): nDataBufBitCnt(%d)" "HwThreeWire(): nDataBufBitCnt(%d)"
" should be multiple of 8!!!\n", " should be multiple of 8!!!\n",
nDataBufBitCnt); nDataBufBitCnt);
dump_stack(); dump_stack();
nDataBufBitCnt += 8; nDataBufBitCnt += 8;
nDataBufBitCnt &= ~7; nDataBufBitCnt &= ~7;
} }
if (nDataBufBitCnt > 64) { if (nDataBufBitCnt > 64) {
printk(KERN_ERR "rtl8187se: HwThreeWire():" printk(KERN_ERR "rtl8187se: HwThreeWire():"
" nDataBufBitCnt(%d) should <= 64!!!\n", " nDataBufBitCnt(%d) should <= 64!!!\n",
nDataBufBitCnt); nDataBufBitCnt);
dump_stack(); dump_stack();
nDataBufBitCnt = 64; nDataBufBitCnt = 64;
} }
for (idx = 0; idx < ByteCnt; idx++) for (idx = 0; idx < ByteCnt; idx++)
write_nic_byte(dev, (SW_3W_DB0+idx), *(pDataBuf+idx)); write_nic_byte(dev, (SW_3W_DB0+idx), *(pDataBuf+idx));
}
} else { /* read */
if (bSI) {
/* SI - reg274[3:0] : RF register's Address */
write_nic_word(dev, SW_3W_DB0, *((u16 *)pDataBuf));
} else {
/* PI - reg274[15:12] : RF register's Address */
write_nic_word(dev, SW_3W_DB0, (*((u16 *)pDataBuf)) << 12);
}
} }
} else { /* read */
if (bSI) {
/* SI - reg274[3:0] : RF register's Address */
write_nic_word(dev, SW_3W_DB0, *((u16 *)pDataBuf));
} else {
/* PI - reg274[15:12] : RF register's Address */
write_nic_word(dev, SW_3W_DB0, (*((u16 *)pDataBuf)) << 12);
}
}
/* Set up command: WE or RE. */ /* Set up command: WE or RE. */
if (bWrite) if (bWrite)
write_nic_byte(dev, SW_3W_CMD1, SW_3W_CMD1_WE); write_nic_byte(dev, SW_3W_CMD1, SW_3W_CMD1_WE);
else else
write_nic_byte(dev, SW_3W_CMD1, SW_3W_CMD1_RE); write_nic_byte(dev, SW_3W_CMD1, SW_3W_CMD1_RE);
/* Check if DONE is set. */ /* Check if DONE is set. */
for (TryCnt = 0; TryCnt < TC_3W_POLL_MAX_TRY_CNT; TryCnt++) { for (TryCnt = 0; TryCnt < TC_3W_POLL_MAX_TRY_CNT; TryCnt++) {
u1bTmp = read_nic_byte(dev, SW_3W_CMD1); u1bTmp = read_nic_byte(dev, SW_3W_CMD1);
if ((u1bTmp & SW_3W_CMD1_DONE) != 0) if ((u1bTmp & SW_3W_CMD1_DONE) != 0)
break; break;
udelay(10);
}
write_nic_byte(dev, SW_3W_CMD1, 0); udelay(10);
}
/* Read back data for read operation. */ write_nic_byte(dev, SW_3W_CMD1, 0);
if (bWrite == 0) {
if (bSI) {
/* Serial Interface : reg363_362[11:0] */
*((u16 *)pDataBuf) = read_nic_word(dev, SI_DATA_READ) ;
} else {
/* Parallel Interface : reg361_360[11:0] */
*((u16 *)pDataBuf) = read_nic_word(dev, PI_DATA_READ);
}
*((u16 *)pDataBuf) &= 0x0FFF; /* Read back data for read operation. */
if (bWrite == 0) {
if (bSI) {
/* Serial Interface : reg363_362[11:0] */
*((u16 *)pDataBuf) = read_nic_word(dev, SI_DATA_READ) ;
} else {
/* Parallel Interface : reg361_360[11:0] */
*((u16 *)pDataBuf) = read_nic_word(dev, PI_DATA_READ);
} }
} while (0); *((u16 *)pDataBuf) &= 0x0FFF;
}
return bResult; return bResult;
} }
...@@ -1148,18 +1145,11 @@ void rtl8185b_irq_enable(struct net_device *dev) ...@@ -1148,18 +1145,11 @@ void rtl8185b_irq_enable(struct net_device *dev)
write_nic_dword(dev, IMR, priv->IntrMask); write_nic_dword(dev, IMR, priv->IntrMask);
} }
void DrvIFIndicateDisassociation(struct net_device *dev, u16 reason)
{
/* nothing is needed after disassociation request. */
}
void MgntDisconnectIBSS(struct net_device *dev) void MgntDisconnectIBSS(struct net_device *dev)
{ {
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
u8 i; u8 i;
DrvIFIndicateDisassociation(dev, unspec_reason);
for (i = 0; i < 6 ; i++) for (i = 0; i < 6 ; i++)
priv->ieee80211->current_network.bssid[i] = 0x55; priv->ieee80211->current_network.bssid[i] = 0x55;
...@@ -1190,8 +1180,6 @@ void MlmeDisassociateRequest(struct net_device *dev, u8 *asSta, u8 asRsn) ...@@ -1190,8 +1180,6 @@ void MlmeDisassociateRequest(struct net_device *dev, u8 *asSta, u8 asRsn)
if (memcmp(priv->ieee80211->current_network.bssid, asSta, 6) == 0) { if (memcmp(priv->ieee80211->current_network.bssid, asSta, 6) == 0) {
/* ShuChen TODO: change media status. */ /* ShuChen TODO: change media status. */
/* ShuChen TODO: What to do when disassociate. */
DrvIFIndicateDisassociation(dev, unspec_reason);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
priv->ieee80211->current_network.bssid[i] = 0x22; priv->ieee80211->current_network.bssid[i] = 0x22;
...@@ -1267,14 +1255,6 @@ bool SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) ...@@ -1267,14 +1255,6 @@ bool SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
return bResult; return bResult;
} }
void HalEnableRx8185Dummy(struct net_device *dev)
{
}
void HalDisableRx8185Dummy(struct net_device *dev)
{
}
bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u32 ChangeSource) bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u32 ChangeSource)
{ {
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
...@@ -1359,18 +1339,6 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u ...@@ -1359,18 +1339,6 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u
if (bActionAllowed) { if (bActionAllowed) {
/* Config HW to the specified mode. */ /* Config HW to the specified mode. */
SetRFPowerState(dev, StateToSet); SetRFPowerState(dev, StateToSet);
/* Turn on RF. */
if (StateToSet == eRfOn) {
HalEnableRx8185Dummy(dev);
if (bConnectBySSID) {
/* by amy not supported */
}
}
/* Turn off RF. */
else if (StateToSet == eRfOff)
HalDisableRx8185Dummy(dev);
} }
/* Release RF spinlock */ /* Release RF spinlock */
......
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