staging: rtl8187se: Convert _RT_RF_POWER_STATE typedef into an enum
authorAna Rey <anarey@gmail.com>
Mon, 10 Mar 2014 17:56:47 +0000 (18:56 +0100)
committerPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Thu, 13 Mar 2014 22:41:43 +0000 (15:41 -0700)
The Documentation/CodingStyle doesn't recommend the use of typedef,
convert this to an enum.

While at it, I have also renamed the variable names that were used in
this typedef not to use Hungarian notation.

Signed-off-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
drivers/staging/rtl8187se/r8180.h
drivers/staging/rtl8187se/r8180_core.c
drivers/staging/rtl8187se/r8180_dm.c
drivers/staging/rtl8187se/r8180_rtl8225.h
drivers/staging/rtl8187se/r8180_rtl8225z2.c
drivers/staging/rtl8187se/r8185b_init.c

index 482b193e175999f418e29ec25ca332f8833790f0..81ea9f71ebb44da0792e82574eebdb66e9dc6069 100644 (file)
@@ -250,11 +250,11 @@ typedef enum _LED_CTL_MODE {
        LED_CTL_POWER_OFF = 7
 } LED_CTL_MODE;
 
-typedef enum _RT_RF_POWER_STATE {
-       eRfOn,
-       eRfSleep,
-       eRfOff
-} RT_RF_POWER_STATE;
+enum rt_rf_power_state {
+       RF_ON,
+       RF_SLEEP,
+       RF_OFF
+};
 
 enum _ReasonCode {
        unspec_reason = 0x1,
@@ -467,8 +467,8 @@ struct r8180_priv {
        struct timer_list watch_dog_timer;
        bool bInactivePs;
        bool bSwRfProcessing;
-       RT_RF_POWER_STATE eInactivePowerState;
-       RT_RF_POWER_STATE eRFPowerState;
+       enum rt_rf_power_state eInactivePowerState;
+       enum rt_rf_power_state eRFPowerState;
        u32 RfOffReason;
        bool RFChangeInProgress;
        bool SetRFPowerStateInProgress;
@@ -694,7 +694,7 @@ void fix_tx_fifo(struct net_device *dev);
 void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch);
 void rtl8180_rate_adapter(struct work_struct *work);
 /* #endif */
-bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
+bool MgntActSet_RF_State(struct net_device *dev, enum rt_rf_power_state StateToSet,
                         u32 ChangeSource);
 
 #endif
index c5a6b002c8c933f6e005c4c19fecf414f17a25dd..06f439d5f501a3c7ea4c0fa5e3e5bc448a95da2d 100644 (file)
@@ -2439,7 +2439,7 @@ static short rtl8180_init(struct net_device *dev)
        priv->bInactivePs = true; /* false; */
        priv->ieee80211->bInactivePs = priv->bInactivePs;
        priv->bSwRfProcessing = false;
-       priv->eRFPowerState = eRfOff;
+       priv->eRFPowerState = RF_OFF;
        priv->RfOffReason = 0;
        priv->led_strategy = SW_LED_MODE0;
        priv->TxPollingTimes = 0; /* lzm add 080826 */
@@ -2967,7 +2967,7 @@ void rtl8180_watch_dog(struct net_device *dev)
                if ((priv->ieee80211->iw_mode != IW_MODE_ADHOC) &&
                    (priv->ieee80211->state == IEEE80211_NOLINK) &&
                    (priv->ieee80211->beinretry == false) &&
-                   (priv->eRFPowerState == eRfOn))
+                   (priv->eRFPowerState == RF_ON))
                        IPSEnter(dev);
        }
        /* YJ,add,080828,for link state check */
@@ -3101,7 +3101,7 @@ int rtl8180_down(struct net_device *dev)
        cancel_delayed_work(&priv->ieee80211->hw_dig_wq);
        cancel_delayed_work(&priv->ieee80211->tx_pw_wq);
        del_timer_sync(&priv->SwAntennaDiversityTimer);
-       SetZebraRFPowerState8185(dev, eRfOff);
+       SetZebraRFPowerState8185(dev, RF_OFF);
        memset(&priv->ieee80211->current_network,
                0, sizeof(struct ieee80211_network));
        priv->ieee80211->state = IEEE80211_NOLINK;
@@ -3752,7 +3752,7 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work)
        struct r8180_priv *priv = ieee80211_priv(dev);
        u8 btPSR;
        u8 btConfig0;
-       RT_RF_POWER_STATE       eRfPowerStateToSet;
+       enum rt_rf_power_state eRfPowerStateToSet;
        bool bActuallySet = false;
 
        char *argv[3];
@@ -3774,18 +3774,18 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work)
        /* HW radio On/Off according to the value of FF51[4](config0) */
        btConfig0 = btPSR = read_nic_byte(dev, CONFIG0);
 
-       eRfPowerStateToSet = (btConfig0 & BIT4) ?  eRfOn : eRfOff;
+       eRfPowerStateToSet = (btConfig0 & BIT4) ?  RF_ON : RF_OFF;
 
        /* Turn LED back on when radio enabled */
-       if (eRfPowerStateToSet == eRfOn)
+       if (eRfPowerStateToSet == RF_ON)
                write_nic_byte(dev, PSR, btPSR | BIT3);
 
        if ((priv->ieee80211->bHwRadioOff == true) &&
-          (eRfPowerStateToSet == eRfOn)) {
+          (eRfPowerStateToSet == RF_ON)) {
                priv->ieee80211->bHwRadioOff = false;
                bActuallySet = true;
        } else if ((priv->ieee80211->bHwRadioOff == false) &&
-                 (eRfPowerStateToSet == eRfOff)) {
+                 (eRfPowerStateToSet == RF_OFF)) {
                priv->ieee80211->bHwRadioOff = true;
                bActuallySet = true;
        }
index 2ccd2cb70face1c2ea6f0e53a87091c861acba98..8c020e0648694a26f953b4a8e134dcad92d816eb 100644 (file)
@@ -1116,14 +1116,14 @@ bool CheckTxPwrTracking(struct net_device *dev)
 void SwAntennaDiversityTimerCallback(struct net_device *dev)
 {
        struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
-       RT_RF_POWER_STATE rtState;
+       enum rt_rf_power_state rtState;
 
         /* We do NOT need to switch antenna while RF is off. */
        rtState = priv->eRFPowerState;
        do {
-               if (rtState == eRfOff) {
+               if (rtState == RF_OFF) {
                        break;
-               } else if (rtState == eRfSleep) {
+               } else if (rtState == RF_SLEEP) {
                        /* Don't access BB/RF under Disable PLL situation. */
                        break;
                }
index de084f07a071bbd4e814be2ed6f51e9b0bc075c3..9bfe45c2f5ebf4c54f53bc931310671596b32d63 100644 (file)
@@ -29,7 +29,7 @@ u16 RF_ReadReg(struct net_device *dev, u8 offset);
 void rtl8180_set_mode(struct net_device *dev, int mode);
 void rtl8180_set_mode(struct net_device *dev, int mode);
 bool SetZebraRFPowerState8185(struct net_device *dev,
-                             RT_RF_POWER_STATE eRFPowerState);
+                             enum rt_rf_power_state eRFPowerState);
 void rtl8225z4_rf_sleep(struct net_device *dev);
 void rtl8225z4_rf_wakeup(struct net_device *dev);
 
index 0677ae37d70c2007fd71d73adf599d93fbe2fa17..73a58d10d07239af6d95459d9f6f0d5a24b0b7c2 100644 (file)
@@ -650,7 +650,7 @@ void rtl8225z2_rf_set_mode(struct net_device *dev)
 #define LPS_MAX_SLEEP_WAITING_TIMES_87SE       5
 
 bool SetZebraRFPowerState8185(struct net_device *dev,
-                             RT_RF_POWER_STATE eRFPowerState)
+                             enum rt_rf_power_state eRFPowerState)
 {
        struct r8180_priv *priv = ieee80211_priv(dev);
        u8                      btCR9346, btConfig3;
@@ -672,7 +672,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
        write_nic_byte(dev, CONFIG3, (btConfig3 | CONFIG3_PARM_En));
 
        switch (eRFPowerState) {
-       case eRfOn:
+       case RF_ON:
                write_nic_word(dev, 0x37C, 0x00EC);
 
                /* turn on AFE */
@@ -697,7 +697,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
                u1bTmp = read_nic_byte(dev, 0x24E);
                write_nic_byte(dev, 0x24E, (u1bTmp & (~(BIT5 | BIT6))));
                break;
-       case eRfSleep:
+       case RF_SLEEP:
                for (QueueID = 0, i = 0; QueueID < 6;) {
                        if (get_curr_tx_free_desc(dev, QueueID) ==
                                                        priv->txringcount) {
@@ -764,7 +764,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
                        }
                }
                break;
-       case eRfOff:
+       case RF_OFF:
                for (QueueID = 0, i = 0; QueueID < 6;) {
                        if (get_curr_tx_free_desc(dev, QueueID) ==
                                        priv->txringcount) {
@@ -841,10 +841,10 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
 
 void rtl8225z4_rf_sleep(struct net_device *dev)
 {
-       MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS);
+       MgntActSet_RF_State(dev, RF_SLEEP, RF_CHANGE_BY_PS);
 }
 
 void rtl8225z4_rf_wakeup(struct net_device *dev)
 {
-       MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS);
+       MgntActSet_RF_State(dev, RF_ON, RF_CHANGE_BY_PS);
 }
index 9c8b57f1f3bed95d176327fdf3461833b5882e13..cc6f100814f333b56a7e0740c3ee568856116fb6 100644 (file)
@@ -619,10 +619,10 @@ void UpdateInitialGain(struct net_device *dev)
        struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
 
        /* lzm add 080826 */
-       if (priv->eRFPowerState != eRfOn) {
+       if (priv->eRFPowerState != RF_ON) {
                /*      Don't access BB/RF under disable PLL situation.
                 *      RT_TRACE(COMP_DIG, DBG_LOUD, ("UpdateInitialGain -
-                *      pHalData->eRFPowerState!=eRfOn\n"));
+                *      pHalData->eRFPowerState!=RF_ON\n"));
                 *      Back to the original state
                 */
                priv->InitialGain = priv->InitialGainBackUp;
@@ -1085,7 +1085,7 @@ static bool MgntDisconnect(struct net_device *dev, u8 asRsn)
  *             PASSIVE LEVEL.
  */
 static bool SetRFPowerState(struct net_device *dev,
-                           RT_RF_POWER_STATE eRFPowerState)
+                           enum rt_rf_power_state eRFPowerState)
 {
        struct  r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
        bool    bResult = false;
@@ -1098,13 +1098,13 @@ static bool SetRFPowerState(struct net_device *dev,
        return bResult;
 }
 
-bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
+bool MgntActSet_RF_State(struct net_device *dev, enum rt_rf_power_state StateToSet,
                         u32 ChangeSource)
 {
        struct  r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
        bool    bActionAllowed = false;
        bool    bConnectBySSID = false;
-       RT_RF_POWER_STATE rtState;
+       enum rt_rf_power_state rtState;
        u16     RFWaitCounter = 0;
        unsigned long flag;
        /*
@@ -1140,7 +1140,7 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
        rtState = priv->eRFPowerState;
 
        switch (StateToSet) {
-       case eRfOn:
+       case RF_ON:
                /*
                 *      Turn On RF no matter the IPS setting because we need to
                 *      update the RF state to Ndis under Vista, or the Windows
@@ -1153,13 +1153,13 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
                        priv->RfOffReason = 0;
                        bActionAllowed = true;
 
-                       if (rtState == eRfOff &&
+                       if (rtState == RF_OFF &&
                            ChangeSource >= RF_CHANGE_BY_HW)
                                bConnectBySSID = true;
                }
                break;
 
-       case eRfOff:
+       case RF_OFF:
                 /* 070125, rcnjko: we always keep connected in AP mode. */
 
                if (priv->RfOffReason > RF_CHANGE_BY_IPS) {
@@ -1182,7 +1182,7 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
                priv->RfOffReason |= ChangeSource;
                bActionAllowed = true;
                break;
-       case eRfSleep:
+       case RF_SLEEP:
                priv->RfOffReason |= ChangeSource;
                bActionAllowed = true;
                break;
@@ -1233,7 +1233,7 @@ static void InactivePowerSave(struct net_device *dev)
 void IPSEnter(struct net_device *dev)
 {
        struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
-       RT_RF_POWER_STATE rtState;
+       enum rt_rf_power_state rtState;
        if (priv->bInactivePs) {
                rtState = priv->eRFPowerState;
 
@@ -1245,9 +1245,9 @@ void IPSEnter(struct net_device *dev)
                 *      trigger IPS)(4) IBSS (send Beacon)
                 *      (5) AP mode (send Beacon)
                 */
-               if (rtState == eRfOn && !priv->bSwRfProcessing
+               if (rtState == RF_ON && !priv->bSwRfProcessing
                        && (priv->ieee80211->state != IEEE80211_LINKED)) {
-                       priv->eInactivePowerState = eRfOff;
+                       priv->eInactivePowerState = RF_OFF;
                        InactivePowerSave(dev);
                }
        }
@@ -1255,13 +1255,13 @@ void IPSEnter(struct net_device *dev)
 void IPSLeave(struct net_device *dev)
 {
        struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
-       RT_RF_POWER_STATE rtState;
+       enum rt_rf_power_state rtState;
        if (priv->bInactivePs) {
                rtState = priv->eRFPowerState;
-               if ((rtState == eRfOff || rtState == eRfSleep) &&
+               if ((rtState == RF_OFF || rtState == RF_SLEEP) &&
                    !priv->bSwRfProcessing
                    && priv->RfOffReason <= RF_CHANGE_BY_IPS) {
-                       priv->eInactivePowerState = eRfOn;
+                       priv->eInactivePowerState = RF_ON;
                        InactivePowerSave(dev);
                }
        }
@@ -1391,17 +1391,17 @@ void rtl8185b_adapter_start(struct net_device *dev)
        /* One of B, G, A. */
                InitWirelessMode = ieee->mode;
        }
-       priv->eRFPowerState = eRfOff;
+       priv->eRFPowerState = RF_OFF;
        priv->RfOffReason = 0;
        {
-               MgntActSet_RF_State(dev, eRfOn, 0);
+               MgntActSet_RF_State(dev, RF_ON, 0);
        }
                /*
                 * If inactive power mode is enabled, disable rf while in
                 * disconnected state.
                 */
        if (priv->bInactivePs)
-               MgntActSet_RF_State(dev , eRfOff, RF_CHANGE_BY_IPS);
+               MgntActSet_RF_State(dev , RF_OFF, RF_CHANGE_BY_IPS);
 
        ActSetWirelessMode8185(dev, (u8)(InitWirelessMode));