Commit 5dc42962 authored by Vaishali Thakkar's avatar Vaishali Thakkar Committed by Greg Kroah-Hartman

Staging: rtl8192e: Eliminate use of macro IS_NIC_DOWN

This patch eliminates use of unnecessory macro IS_NIC_DOWN
and replaces it with standard code.
Signed-off-by: default avatarVaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 80c598a6
...@@ -996,7 +996,7 @@ static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel) ...@@ -996,7 +996,7 @@ static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel)
&priv->SwChnlStep, &delay)) { &priv->SwChnlStep, &delay)) {
if (delay > 0) if (delay > 0)
msleep(delay); msleep(delay);
if (IS_NIC_DOWN(priv)) if (!priv->up)
break; break;
} }
} }
...@@ -1020,7 +1020,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel) ...@@ -1020,7 +1020,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel)
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
RT_TRACE(COMP_PHY, "=====>%s()\n", __func__); RT_TRACE(COMP_PHY, "=====>%s()\n", __func__);
if (IS_NIC_DOWN(priv)) { if (!priv->up) {
RT_TRACE(COMP_ERR, "%s(): ERR !! driver is not up\n", __func__); RT_TRACE(COMP_ERR, "%s(): ERR !! driver is not up\n", __func__);
return false; return false;
} }
...@@ -1060,7 +1060,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel) ...@@ -1060,7 +1060,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel)
priv->SwChnlStage = 0; priv->SwChnlStage = 0;
priv->SwChnlStep = 0; priv->SwChnlStep = 0;
if (!IS_NIC_DOWN(priv)) if (priv->up)
rtl8192_SwChnl_WorkItem(dev); rtl8192_SwChnl_WorkItem(dev);
priv->SwChnlInProgress = false; priv->SwChnlInProgress = false;
return true; return true;
...@@ -1186,7 +1186,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev) ...@@ -1186,7 +1186,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
priv->SetBWModeInProgress = false; priv->SetBWModeInProgress = false;
return; return;
} }
if (IS_NIC_DOWN(priv)) { if (!priv->up) {
RT_TRACE(COMP_ERR, "%s(): ERR!! driver is not up\n", __func__); RT_TRACE(COMP_ERR, "%s(): ERR!! driver is not up\n", __func__);
return; return;
} }
...@@ -1309,7 +1309,7 @@ void InitialGain819xPci(struct net_device *dev, u8 Operation) ...@@ -1309,7 +1309,7 @@ void InitialGain819xPci(struct net_device *dev, u8 Operation)
u32 BitMask; u32 BitMask;
u8 initial_gain; u8 initial_gain;
if (!IS_NIC_DOWN(priv)) { if (priv->up) {
switch (Operation) { switch (Operation) {
case IG_Backup: case IG_Backup:
RT_TRACE(COMP_SCAN, "IG_Backup, backup the initial" RT_TRACE(COMP_SCAN, "IG_Backup, backup the initial"
......
...@@ -1506,7 +1506,7 @@ static void rtl819x_ifsilentreset(struct net_device *dev) ...@@ -1506,7 +1506,7 @@ static void rtl819x_ifsilentreset(struct net_device *dev)
if (priv->rtllib->state == RTLLIB_LINKED) if (priv->rtllib->state == RTLLIB_LINKED)
LeisurePSLeave(dev); LeisurePSLeave(dev);
if (IS_NIC_DOWN(priv)) { if (priv->up) {
RT_TRACE(COMP_ERR, "%s():the driver is not up! " RT_TRACE(COMP_ERR, "%s():the driver is not up! "
"return\n", __func__); "return\n", __func__);
up(&priv->wx_sem); up(&priv->wx_sem);
...@@ -1650,7 +1650,7 @@ void rtl819x_watchdog_wqcallback(void *data) ...@@ -1650,7 +1650,7 @@ void rtl819x_watchdog_wqcallback(void *data)
bool bHigherBusyRxTraffic = false; bool bHigherBusyRxTraffic = false;
bool bEnterPS = false; bool bEnterPS = false;
if (IS_NIC_DOWN(priv) || priv->bHwRadioOff) if (!priv->up || priv->bHwRadioOff)
return; return;
if (priv->rtllib->state >= RTLLIB_LINKED) { if (priv->rtllib->state >= RTLLIB_LINKED) {
...@@ -1882,7 +1882,7 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -1882,7 +1882,7 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
MAX_DEV_ADDR_SIZE); MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index; u8 queue_index = tcb_desc->queue_index;
if ((priv->rtllib->eRFPowerState == eRfOff) || IS_NIC_DOWN(priv) || if ((priv->rtllib->eRFPowerState == eRfOff) || !priv->up ||
priv->bResetInProgress) { priv->bResetInProgress) {
kfree_skb(skb); kfree_skb(skb);
return; return;
...@@ -1916,7 +1916,7 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1916,7 +1916,7 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (queue_index != TXCMD_QUEUE) { if (queue_index != TXCMD_QUEUE) {
if ((priv->rtllib->eRFPowerState == eRfOff) || if ((priv->rtllib->eRFPowerState == eRfOff) ||
IS_NIC_DOWN(priv) || priv->bResetInProgress) { !priv->up || priv->bResetInProgress) {
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
} }
...@@ -3032,7 +3032,7 @@ bool NicIFEnableNIC(struct net_device *dev) ...@@ -3032,7 +3032,7 @@ bool NicIFEnableNIC(struct net_device *dev)
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
(&(priv->rtllib->PowerSaveControl)); (&(priv->rtllib->PowerSaveControl));
if (IS_NIC_DOWN(priv)) { if (!priv->up) {
RT_TRACE(COMP_ERR, "ERR!!! %s(): Driver is already down!\n", RT_TRACE(COMP_ERR, "ERR!!! %s(): Driver is already down!\n",
__func__); __func__);
priv->bdisable_nic = false; priv->bdisable_nic = false;
......
...@@ -98,8 +98,6 @@ ...@@ -98,8 +98,6 @@
#define BIT(_i) (1<<(_i)) #define BIT(_i) (1<<(_i))
#endif #endif
#define IS_NIC_DOWN(priv) (!(priv)->up)
#define IS_ADAPTER_SENDS_BEACON(dev) 0 #define IS_ADAPTER_SENDS_BEACON(dev) 0
#define IS_UNDER_11N_AES_MODE(_rtllib) \ #define IS_UNDER_11N_AES_MODE(_rtllib) \
......
...@@ -267,7 +267,7 @@ static void dm_check_rate_adaptive(struct net_device *dev) ...@@ -267,7 +267,7 @@ static void dm_check_rate_adaptive(struct net_device *dev)
bool bshort_gi_enabled = false; bool bshort_gi_enabled = false;
static u8 ping_rssi_state; static u8 ping_rssi_state;
if (IS_NIC_DOWN(priv)) { if (!priv->up) {
RT_TRACE(COMP_RATE, "<---- dm_check_rate_adaptive(): driver is going to unload\n"); RT_TRACE(COMP_RATE, "<---- dm_check_rate_adaptive(): driver is going to unload\n");
return; return;
} }
...@@ -1569,7 +1569,7 @@ void dm_restore_dynamic_mechanism_state(struct net_device *dev) ...@@ -1569,7 +1569,7 @@ void dm_restore_dynamic_mechanism_state(struct net_device *dev)
u32 reg_ratr = priv->rate_adaptive.last_ratr; u32 reg_ratr = priv->rate_adaptive.last_ratr;
u32 ratr_value; u32 ratr_value;
if (IS_NIC_DOWN(priv)) { if (!priv->up) {
RT_TRACE(COMP_RATE, "<---- dm_restore_dynamic_mechanism_state(): driver is going to unload\n"); RT_TRACE(COMP_RATE, "<---- dm_restore_dynamic_mechanism_state(): driver is going to unload\n");
return; return;
} }
......
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