]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: rtl8188eu: Rework function HalPwrSeqCmdParsing()
authornavin patidar <navin.patidar@gmail.com>
Mon, 1 Sep 2014 15:43:36 +0000 (21:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Sep 2014 18:20:01 +0000 (11:20 -0700)
Rename CamelCase variables and function name.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/HalPwrSeqCmd.c
drivers/staging/rtl8188eu/hal/usb_halinit.c
drivers/staging/rtl8188eu/include/HalPwrSeqCmd.h

index caca535ac17d807d01ab20a02a8b32f5f5065612..2565d6ea80304be8cbf111f007587ed1e397ce91 100644 (file)
  * this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  *
- *
  ******************************************************************************/
-/*++
-Copyright (c) Realtek Semiconductor Corp. All rights reserved.
-
-Module Name:
-       HalPwrSeqCmd.c
-
-Abstract:
-       Implement HW Power sequence configuration CMD handling routine for Realtek devices.
-
-Major Change History:
-       When       Who               What
-       ---------- ---------------   -------------------------------
-       2011-10-26 Lucas            Modify to be compatible with SD4-CE driver.
-       2011-07-07 Roger            Create.
-
---*/
 
 #include <HalPwrSeqCmd.h>
 #include <usb_ops_linux.h>
 
-/*     Description: */
-/*             This routine deals with the Power Configuration CMDs parsing
- *             for RTL8723/RTL8188E Series IC.
- *     Assumption:
- *             We should follow specific format which was released from HW SD.
+/* This routine deals with the Power Configuration CMDs parsing
+ * for RTL8723/RTL8188E Series IC.
  */
-u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
-                      u8 ifacetype, struct wl_pwr_cfg pwrseqcmd[])
+u8 rtl88eu_pwrseqcmdparsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
+                           u8 ifacetype, struct wl_pwr_cfg pwrseqcmd[])
 {
        struct wl_pwr_cfg pwrcfgcmd = {0};
        u8 poll_bit = false;
@@ -58,7 +38,9 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
                pwrcfgcmd = pwrseqcmd[aryidx];
 
                RT_TRACE(_module_hal_init_c_ , _drv_info_,
-                        ("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
+                        ("rtl88eu_pwrseqcmdparsing: offset(%#x) cut_msk(%#x)"
+                         "fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x)"
+                         "msk(%#x) value(%#x)\n",
                         GET_PWR_CFG_OFFSET(pwrcfgcmd),
                         GET_PWR_CFG_CUT_MASK(pwrcfgcmd),
                         GET_PWR_CFG_FAB_MASK(pwrcfgcmd),
@@ -68,37 +50,42 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
                         GET_PWR_CFG_MASK(pwrcfgcmd),
                         GET_PWR_CFG_VALUE(pwrcfgcmd)));
 
-               /* Only Handle the command whose FAB, CUT, and Interface are matched */
+               /* Only Handle the command whose FAB, CUT, and Interface are matched */
                if ((GET_PWR_CFG_FAB_MASK(pwrcfgcmd) & fab_vers) &&
                    (GET_PWR_CFG_CUT_MASK(pwrcfgcmd) & cut_vers) &&
                    (GET_PWR_CFG_INTF_MASK(pwrcfgcmd) & ifacetype)) {
                        switch (GET_PWR_CFG_CMD(pwrcfgcmd)) {
                        case PWR_CMD_READ:
-                               RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
+                               RT_TRACE(_module_hal_init_c_, _drv_info_,
+                                        ("rtl88eu_pwrseqcmdparsing: PWR_CMD_READ\n"));
                                break;
                        case PWR_CMD_WRITE:
-                               RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
+                               RT_TRACE(_module_hal_init_c_, _drv_info_,
+                                        ("rtl88eu_pwrseqcmdparsing: PWR_CMD_WRITE\n"));
                                offset = GET_PWR_CFG_OFFSET(pwrcfgcmd);
 
                                /*  Read the value from system register */
                                value = usb_read8(padapter, offset);
 
                                value &= ~(GET_PWR_CFG_MASK(pwrcfgcmd));
-                               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 */
                                usb_write8(padapter, offset, value);
                                break;
                        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_,
+                                        ("rtl88eu_pwrseqcmdparsing: PWR_CMD_POLLING\n"));
 
                                poll_bit = false;
                                offset = GET_PWR_CFG_OFFSET(pwrcfgcmd);
                                do {
-                                               value = usb_read8(padapter, offset);
-
+                                       value = usb_read8(padapter, offset);
                                        value &= GET_PWR_CFG_MASK(pwrcfgcmd);
-                                       if (value == (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd)))
+
+                                       if (value == (GET_PWR_CFG_VALUE(pwrcfgcmd) &
+                                                     GET_PWR_CFG_MASK(pwrcfgcmd)))
                                                poll_bit = true;
                                        else
                                                udelay(10);
@@ -110,19 +97,22 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
                                } while (!poll_bit);
                                break;
                        case PWR_CMD_DELAY:
-                               RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
+                               RT_TRACE(_module_hal_init_c_, _drv_info_,
+                                        ("rtl88eu_pwrseqcmdparsing: PWR_CMD_DELAY\n"));
                                if (GET_PWR_CFG_VALUE(pwrcfgcmd) == PWRSEQ_DELAY_US)
                                        udelay(GET_PWR_CFG_OFFSET(pwrcfgcmd));
                                else
                                        udelay(GET_PWR_CFG_OFFSET(pwrcfgcmd)*1000);
                                break;
                        case PWR_CMD_END:
-                               /*  When this command is parsed, end the process */
-                               RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
+                               /* When this command is parsed, end the process */
+                               RT_TRACE(_module_hal_init_c_, _drv_info_,
+                                        ("rtl88eu_pwrseqcmdparsing: PWR_CMD_END\n"));
                                return true;
                                break;
                        default:
-                               RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
+                               RT_TRACE(_module_hal_init_c_, _drv_err_,
+                                        ("rtl88eu_pwrseqcmdparsing: Unknown CMD!!\n"));
                                break;
                        }
                }
index f56cbdfc17d0cd754d810004e994af58a69cf300..15a818a6149a2a3138a8ff84d0e3af2cea1cf1df 100644 (file)
@@ -107,7 +107,9 @@ static u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
        if (haldata->bMacPwrCtrlOn)
                return _SUCCESS;
 
-       if (!HalPwrSeqCmdParsing(adapt, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_PWR_ON_FLOW)) {
+       if (!rtl88eu_pwrseqcmdparsing(adapt, PWR_CUT_ALL_MSK,
+                                     PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,
+                                     Rtl8188E_NIC_PWR_ON_FLOW)) {
                DBG_88E(KERN_ERR "%s: run power on flow fail\n", __func__);
                return _FAIL;
        }
@@ -925,7 +927,9 @@ static void CardDisableRTL8188EU(struct adapter *Adapter)
        usb_write8(Adapter, REG_CR, 0x0);
 
        /*  Run LPS WL RFOFF flow */
-       HalPwrSeqCmdParsing(Adapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_LPS_ENTER_FLOW);
+       rtl88eu_pwrseqcmdparsing(Adapter, PWR_CUT_ALL_MSK,
+                                PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,
+                                Rtl8188E_NIC_LPS_ENTER_FLOW);
 
        /*  2. 0x1F[7:0] = 0            turn off RF */
 
@@ -946,7 +950,9 @@ static void CardDisableRTL8188EU(struct adapter *Adapter)
        usb_write8(Adapter, REG_32K_CTRL, val8&(~BIT0));
 
        /*  Card disable power action flow */
-       HalPwrSeqCmdParsing(Adapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_DISABLE_FLOW);
+       rtl88eu_pwrseqcmdparsing(Adapter, PWR_CUT_ALL_MSK,
+                                PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK,
+                                Rtl8188E_NIC_DISABLE_FLOW);
 
        /*  Reset MCU IO Wrapper */
        val8 = usb_read8(Adapter, REG_RSV_CTRL+1);
index d945784ed5d9a2c29b973abf28de9ec68bb531f7..fc24ce49977018f85557b26a3bd7bf3dc1be802c 100644 (file)
@@ -122,7 +122,7 @@ struct wl_pwr_cfg {
 
 
 /*     Prototype of protected function. */
-u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 CutVersion, u8 FabVersion,
-                      u8 InterfaceType, struct wl_pwr_cfg PwrCfgCmd[]);
+u8 rtl88eu_pwrseqcmdparsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
+                           u8 ifacetype, struct wl_pwr_cfg pwrcfgCmd[]);
 
 #endif