staging:rtl8192u: Coding style changes
cover staging:rtl8192u: Coding style changes
This series is just coding style changes to clear checkpatch issues. I don't think that there are any changes that impact code execution.
I tacked on the end a patch from my last series that failed, again just a rename to avoid CamelCase warning.
jwhitmore
PATCH 1/13 staging:rtl8192u: remove typedef of enumeration SwChnlCmdID - Style
To clear a checkpatch issue removed the typedef of the enumeration SwChnlCmdID this should not impact runtime code as it's only a coding style change.
--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- drivers/staging/rtl8192u/r819xU_phy.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +1 -1
@@ -1221,7 +1221,7 @@ bool rtl8192_SetRFPowerState(struct net_device *dev,* notice: ******************************************************************************/ static u8 rtl8192_phy_SetSwChnlCmdArray (SwChnlCmd *CmdTable,u32 CmdTableIdx, -u32 CmdTableSz,SwChnlCmdID CmdID, +u32 CmdTableSz,enum SwChnlCmdID CmdID,u32 Para1,u32 Para2,u32 msDelay) {SwChnlCmd *pCmd;
drivers/staging/rtl8192u/r819xU_phy.h +6 -6
@@ -7,7 +7,7 @@#define MAX_RFDEPENDCMD_CNT 16#define MAX_POSTCMD_CNT 16 -typedef enum _SwChnlCmdID { +enum SwChnlCmdID { CmdID_End, CmdID_SetTxPowerLevel, CmdID_BBRegWrite10,
@@ -15,15 +15,15 @@ typedef enum _SwChnlCmdID { CmdID_WritePortUshort, CmdID_WritePortUchar, CmdID_RF_WriteReg, -} SwChnlCmdID; +};/* -----------------------Define structure---------------------- */ /* 1. Switch channel related */ typedef struct _SwChnlCmd { -SwChnlCmdID CmdID; -u32 Para1; -u32 Para2; -u32 msDelay; +enum SwChnlCmdID CmdID; +u32 Para1; +u32 Para2; +u32 msDelay; } __packed SwChnlCmd;extern u32 rtl819XMACPHY_Array_PG[];
Signature · 1 line
2.18.0
PATCH 2/13 staging:rtl8192u: remove typdef from enumeration HW90_BLOCK_E - Style
In reply to John WhitmoreCheckpatch warns about the creation of new types in code. This patch simply removes the typedef from the enumeration HW90_BLOCK_E to clear this warning. There should be no impact on run time code execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 6 +++--- drivers/staging/rtl8192u/r819xU_phy.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +3 -3
@@ -695,7 +695,7 @@ static void rtl8192_InitBBRFRegDef(struct net_device *dev)* return: return whether BB and RF is ok (0:OK, 1:Fail) * notice: This function may be removed in the ASIC ******************************************************************************/ -u8 rtl8192_phy_checkBBAndRF (struct net_device *dev,HW90_BLOCK_E CheckBlock, +u8 rtl8192_phy_checkBBAndRF (struct net_device *dev,enum HW90_BLOCK_E CheckBlock,RF90_RADIO_PATH_E eRFPath) {u8 ret =0 ;
@@ -787,10 +787,10 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev)/* ----Ckeck FPGAPHY0 and PHY1 board is OK---- */ /* TODO: this function should be removed on ASIC */ -for (eCheckItem = (HW90_BLOCK_E )HW90_BLOCK_PHY0 ; +for (eCheckItem = (enum HW90_BLOCK_E )HW90_BLOCK_PHY0 ; eCheckItem <=HW90_BLOCK_PHY1 ; eCheckItem++) {/* don't care RF path */ - status =rtl8192_phy_checkBBAndRF (dev, (HW90_BLOCK_E )eCheckItem, + status =rtl8192_phy_checkBBAndRF (dev, (enum HW90_BLOCK_E )eCheckItem, (RF90_RADIO_PATH_E )0 );if (status !=0 ) { RT_TRACE((COMP_ERR | COMP_PHY),
drivers/staging/rtl8192u/r819xU_phy.h +3 -3
@@ -34,13 +34,13 @@ extern u32 rtl819XRadioB_Array[];extern u32 rtl819XRadioC_Array[];extern u32 rtl819XRadioD_Array[]; -typedef enum _HW90_BLOCK { +enum HW90_BLOCK_E {HW90_BLOCK_MAC =0 ,HW90_BLOCK_PHY0 =1 ,HW90_BLOCK_PHY1 =2 ,HW90_BLOCK_RF =3 ,HW90_BLOCK_MAXIMUM =4 ,/* Never use this */ -}HW90_BLOCK_E , *PHW90_BLOCK_E ; +}; typedef enum _RF90_RADIO_PATH { RF90_PATH_A = 0, /* Radio Path A */
@@ -69,7 +69,7 @@ u32 rtl8192_phy_QueryRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath,void rtl8192_phy_configmac (struct net_device *dev);void rtl8192_phyConfigBB (struct net_device *dev,u8 ConfigType);u8 rtl8192_phy_checkBBAndRF (struct net_device *dev, -HW90_BLOCK_E CheckBlock,RF90_RADIO_PATH_E eRFPath); +enum HW90_BLOCK_E CheckBlock,RF90_RADIO_PATH_E eRFPath);void rtl8192_BBConfig (struct net_device *dev);void rtl8192_phy_getTxPower (struct net_device *dev);void rtl8192_phy_setTxPower (struct net_device *dev,u8 channel);
Signature · 1 line
2.18.0
PATCH 3/13 staging:rtl8192u: Remove typdef from enumeration RF90_RADIO_PATH_E - Style
In reply to John WhitmoreCheckpatch warns about the creation of new types. This patch simply removes the typedef from the enumeration RF90_RADIO_PATH_E to clear this checkpatch warning. There should be no impact on run time code execution, as this is a coding style issue only.
--- drivers/staging/rtl8192u/r8190_rtl8256.c | 42 ++++++++++++------------ drivers/staging/rtl8192u/r8192U_core.c | 4 +-- drivers/staging/rtl8192u/r819xU_phy.c | 31 ++++++++++------- drivers/staging/rtl8192u/r819xU_phy.h | 15 +++++---- 4 files changed, 51 insertions(+), 41 deletions(-)
drivers/staging/rtl8192u/r8190_rtl8256.c +21 -21
@@ -41,16 +41,16 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev, enum ht_channel_width Bandwi || priv->card_8192_version == VERSION_819xU_B) { /* 8256 D-cut, E-cut, xiong: consider it later! */rtl8192_phy_SetRFReg (dev, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath,0x0b , bMask12Bits,0x100 );/* phy para:1ba */ rtl8192_phy_SetRFReg (dev, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath,0x2c , bMask12Bits,0x3d7 );rtl8192_phy_SetRFReg (dev, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath,0x0e , bMask12Bits,0x021 );rtl8192_phy_SetRFReg (dev, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath,0x14 , bMask12Bits,0x5ab ); } else {RT_TRACE (COMP_ERR ,"PHY_SetRF8256Bandwidth(): unknown hardware version\n" );
@@ -58,15 +58,15 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev, enum ht_channel_width Bandwibreak ;case HT_CHANNEL_WIDTH_20_40 :if (priv->card_8192_version == VERSION_819xU_A || priv->card_8192_version == VERSION_819xU_B) {/* 8256 D-cut, E-cut, xiong: consider it later! */ -rtl8192_phy_SetRFReg (dev, (RF90_RADIO_PATH_E )eRFPath,0x0b , bMask12Bits,0x300 );/* phy para:3ba */ -rtl8192_phy_SetRFReg (dev, (RF90_RADIO_PATH_E )eRFPath,0x2c , bMask12Bits,0x3df ); -rtl8192_phy_SetRFReg (dev, (RF90_RADIO_PATH_E )eRFPath,0x0e , bMask12Bits,0x0a1 ); +rtl8192_phy_SetRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath,0x0b , bMask12Bits,0x300 );/* phy para:3ba */ +rtl8192_phy_SetRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath,0x2c , bMask12Bits,0x3df ); +rtl8192_phy_SetRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath,0x0e , bMask12Bits,0x0a1 );if (priv->chan ==3 || priv->chan ==9 )/* I need to set priv->chan whenever current channel changes */ -rtl8192_phy_SetRFReg (dev, (RF90_RADIO_PATH_E )eRFPath,0x14 , bMask12Bits,0x59b ); +rtl8192_phy_SetRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath,0x14 , bMask12Bits,0x59b );else -rtl8192_phy_SetRFReg (dev, (RF90_RADIO_PATH_E )eRFPath,0x14 , bMask12Bits,0x5ab ); +rtl8192_phy_SetRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath,0x14 , bMask12Bits,0x5ab ); }else {RT_TRACE (COMP_ERR ,"PHY_SetRF8256Bandwidth(): unknown hardware version\n" ); }
@@ -115,14 +115,14 @@ void phy_RF8256_Config_ParaFile(struct net_device *dev)u8 ConstRetryTimes =5 , RetryTimes =5 ;u8 ret =0 ;/* Initialize RF */ -for (eRFPath = (RF90_RADIO_PATH_E )RF90_PATH_A ; eRFPath < priv->NumTotalRFPath; eRFPath++) { +for (eRFPath = (enum RF90_RADIO_PATH_E )RF90_PATH_A ; eRFPath < priv->NumTotalRFPath; eRFPath++) {if (!rtl8192_phy_CheckIsLegalRFPath (dev, eRFPath))continue ; pPhyReg = &priv->PHYRegDef[eRFPath];/* Joseph test for shorten RF config -* pHalData->RfReg0Value[eRFPath] = rtl8192_phy_QueryRFReg(dev, (RF90_RADIO_PATH_E)eRFPath, rGlobalCtrl, bMaskDWord); +* pHalData->RfReg0Value[eRFPath] = rtl8192_phy_QueryRFReg(dev, (enum RF90_RADIO_PATH_E)eRFPath, rGlobalCtrl, bMaskDWord); * ----Store original RFENV control type */ switch (eRFPath) {
@@ -146,12 +146,12 @@ void phy_RF8256_Config_ParaFile(struct net_device *dev)rtl8192_setBBreg (dev, pPhyReg->rfHSSIPara2, b3WireAddressLength,0x0 );/* Set 0 to 4 bits for Z-serial and set 1 to 6 bits for 8258 */ rtl8192_setBBreg (dev, pPhyReg->rfHSSIPara2, b3WireDataLength,0x0 );/* Set 0 to 12 bits for Z-serial and 8258, and set 1 to 14 bits for ??? */ -rtl8192_phy_SetRFReg (dev, (RF90_RADIO_PATH_E ) eRFPath,0x0 , bMask12Bits,0xbf ); +rtl8192_phy_SetRFReg (dev, (enum RF90_RADIO_PATH_E ) eRFPath,0x0 , bMask12Bits,0xbf );/* Check RF block (for FPGA platform only)---- * TODO: this function should be removed on ASIC , Emily 2007.2.2 */ -if (rtl8192_phy_checkBBAndRF (dev,HW90_BLOCK_RF , (RF90_RADIO_PATH_E )eRFPath)) { +if (rtl8192_phy_checkBBAndRF (dev,HW90_BLOCK_RF , (enum RF90_RADIO_PATH_E )eRFPath)) {RT_TRACE (COMP_ERR ,"PHY_RF8256_Config():Check Radio[%d] Fail!!\n" , eRFPath); goto phy_RF8256_Config_ParaFile_Fail; }
@@ -162,32 +162,32 @@ void phy_RF8256_Config_ParaFile(struct net_device *dev)switch (eRFPath) {case RF90_PATH_A :while (RF3_Final_Value != RegValueToBeCheck && RetryTimes !=0 ) { - ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (RF90_RADIO_PATH_E )eRFPath); - RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits); + ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (enum RF90_RADIO_PATH_E )eRFPath); + RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits);RT_TRACE (COMP_RF ,"RF %d %d register final value: %x\n" , eRFPath, RegOffSetToBeCheck, RF3_Final_Value); RetryTimes--; }break ;case RF90_PATH_B :while (RF3_Final_Value != RegValueToBeCheck && RetryTimes !=0 ) { - ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (RF90_RADIO_PATH_E )eRFPath); - RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits); + ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (enum RF90_RADIO_PATH_E )eRFPath); + RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits);RT_TRACE (COMP_RF ,"RF %d %d register final value: %x\n" , eRFPath, RegOffSetToBeCheck, RF3_Final_Value); RetryTimes--; }break ;case RF90_PATH_C :while (RF3_Final_Value != RegValueToBeCheck && RetryTimes !=0 ) { - ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (RF90_RADIO_PATH_E )eRFPath); - RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits); + ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (enum RF90_RADIO_PATH_E )eRFPath); + RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits);RT_TRACE (COMP_RF ,"RF %d %d register final value: %x\n" , eRFPath, RegOffSetToBeCheck, RF3_Final_Value); RetryTimes--; }break ;case RF90_PATH_D :while (RF3_Final_Value != RegValueToBeCheck && RetryTimes !=0 ) { - ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (RF90_RADIO_PATH_E )eRFPath); - RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits); + ret =rtl8192_phy_ConfigRFWithHeaderFile (dev, (enum RF90_RADIO_PATH_E )eRFPath); + RF3_Final_Value =rtl8192_phy_QueryRFReg (dev, (enum RF90_RADIO_PATH_E )eRFPath, RegOffSetToBeCheck, bMask12Bits);RT_TRACE (COMP_RF ,"RF %d %d register final value: %x\n" , eRFPath, RegOffSetToBeCheck, RF3_Final_Value); RetryTimes--; }
drivers/staging/rtl8192u/r8192U_core.c +2 -2
@@ -2897,7 +2897,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)*/ for (eRFPath =0 ; eRFPath < pHalData->NumTotalRFPath; eRFPath++)PHY_SetRFReg (Adapter, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath,0x4 ,0xC00 ,0x0 ); }else if (pMgntInfo->RfOffReason >RF_CHANGE_BY_PS ) {/* H/W or S/W RF OFF before sleep. */
@@ -2923,7 +2923,7 @@ static bool rtl8192_adapter_start(struct net_device *dev)*/ for (eRFPath =0 ; eRFPath < pHalData->NumTotalRFPath; eRFPath++)PHY_SetRFReg (Adapter, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath,0x4 ,0xC00 ,0x0 ); } }
drivers/staging/rtl8192u/r819xU_phy.c +19 -12
@@ -108,11 +108,13 @@ u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, u32 bitmask)return (reg & bitmask) >> bitshift; } -static u32 phy_FwRFSerialRead (struct net_device *dev,RF90_RADIO_PATH_E eRFPath, +static u32 phy_FwRFSerialRead (struct net_device *dev, +enum RF90_RADIO_PATH_E eRFPath,u32 offset);static void phy_FwRFSerialWrite (struct net_device *dev, -RF90_RADIO_PATH_E eRFPath,u32 offset, +enum RF90_RADIO_PATH_E eRFPath, +u32 offset,u32 data);/******************************************************************************
@@ -130,7 +132,7 @@ static void phy_FwRFSerialWrite(struct net_device *dev,* ---need more spec for this information. ******************************************************************************/ static u32 rtl8192_phy_RFSerialRead (struct net_device *dev, -RF90_RADIO_PATH_E eRFPath,u32 offset) +enum RF90_RADIO_PATH_E eRFPath,u32 offset) {struct r8192_priv *priv =ieee80211_priv (dev);u32 ret =0 ;
@@ -215,7 +217,8 @@ static u32 rtl8192_phy_RFSerialRead(struct net_device *dev,* --------------------------------------------------------------------------- *****************************************************************************/ static void rtl8192_phy_RFSerialWrite (struct net_device *dev, -RF90_RADIO_PATH_E eRFPath,u32 offset, +enum RF90_RADIO_PATH_E eRFPath, +u32 offset,u32 data) {struct r8192_priv *priv =ieee80211_priv (dev);
@@ -279,7 +282,8 @@ static void rtl8192_phy_RFSerialWrite(struct net_device *dev,* return: none * notice: *****************************************************************************/ -void rtl8192_phy_SetRFReg (struct net_device *dev,RF90_RADIO_PATH_E eRFPath, +void rtl8192_phy_SetRFReg (struct net_device *dev, +enum RF90_RADIO_PATH_E eRFPath,u32 reg_addr,u32 bitmask,u32 data) {struct r8192_priv *priv =ieee80211_priv (dev);
@@ -327,7 +331,8 @@ void rtl8192_phy_SetRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath,* return: u32 data //the readback register value * notice: *****************************************************************************/ -u32 rtl8192_phy_QueryRFReg (struct net_device *dev,RF90_RADIO_PATH_E eRFPath, +u32 rtl8192_phy_QueryRFReg (struct net_device *dev, +enum RF90_RADIO_PATH_E eRFPath,u32 reg_addr,u32 bitmask) {u32 reg, bitshift;
@@ -357,7 +362,8 @@ u32 rtl8192_phy_QueryRFReg(struct net_device *dev, RF90_RADIO_PATH_E eRFPath,* return: u32 * notice: ****************************************************************************/ -static u32 phy_FwRFSerialRead (struct net_device *dev,RF90_RADIO_PATH_E eRFPath, +static u32 phy_FwRFSerialRead (struct net_device *dev, +enum RF90_RADIO_PATH_E eRFPath,u32 offset) {u32 reg =0 ;
@@ -422,7 +428,8 @@ static u32 phy_FwRFSerialRead(struct net_device *dev, RF90_RADIO_PATH_E eRFPath,* notice: ****************************************************************************/ static void phy_FwRFSerialWrite (struct net_device *dev, -RF90_RADIO_PATH_E eRFPath,u32 offset,u32 data) +enum RF90_RADIO_PATH_E eRFPath, +u32 offset,u32 data) {u8 time =0 ;u32 tmp;
@@ -696,7 +703,7 @@ static void rtl8192_InitBBRFRegDef(struct net_device *dev)* notice: This function may be removed in the ASIC ******************************************************************************/ u8 rtl8192_phy_checkBBAndRF (struct net_device *dev,enum HW90_BLOCK_E CheckBlock, -RF90_RADIO_PATH_E eRFPath) +enum RF90_RADIO_PATH_E eRFPath) {u8 ret =0 ;u32 i, CheckTimes =4 , reg =0 ;
@@ -791,7 +798,7 @@ static void rtl8192_BB_Config_ParaFile(struct net_device *dev) eCheckItem <= HW90_BLOCK_PHY1; eCheckItem++) {/* don't care RF path */ status =rtl8192_phy_checkBBAndRF (dev, (enum HW90_BLOCK_E )eCheckItem, - (RF90_RADIO_PATH_E )0 ); + (enum RF90_RADIO_PATH_E )0 );if (status !=0 ) { RT_TRACE((COMP_ERR | COMP_PHY), "PHY_RF8256_Config(): Check PHY%d Fail!!\n",
@@ -969,7 +976,7 @@ void rtl8192_phy_updateInitGain(struct net_device *dev)* notice: Delay may be required for RF configuration *****************************************************************************/ u8 rtl8192_phy_ConfigRFWithHeaderFile (struct net_device *dev, -RF90_RADIO_PATH_E eRFPath) +enum RF90_RADIO_PATH_E eRFPath) {int i;
@@ -1387,7 +1394,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,case CmdID_RF_WriteReg:for (eRFPath =0 ; eRFPath <RF90_PATH_MAX ; eRFPath++) {rtl8192_phy_SetRFReg (dev, - (RF90_RADIO_PATH_E )eRFPath, + (enum RF90_RADIO_PATH_E )eRFPath, CurrentCmd->Para1, bZebra1_ChannelNum, CurrentCmd->Para2);
drivers/staging/rtl8192u/r819xU_phy.h +9 -6
@@ -42,13 +42,13 @@ enum HW90_BLOCK_E { HW90_BLOCK_MAXIMUM = 4, /* Never use this */ }; -typedef enum _RF90_RADIO_PATH { +enum RF90_RADIO_PATH_E {RF90_PATH_A =0 ,/* Radio Path A */ RF90_PATH_B =1 ,/* Radio Path B */ RF90_PATH_C =2 ,/* Radio Path C */ RF90_PATH_D =3 ,/* Radio Path D */ RF90_PATH_MAX /* Max RF number 92 support */ -}RF90_RADIO_PATH_E , *PRF90_RADIO_PATH_E ; +};#define bMaskByte0 0xff#define bMaskByte1 0xff00
@@ -62,21 +62,24 @@ u8 rtl8192_phy_CheckIsLegalRFPath(struct net_device *dev, u32 eRFPath);void rtl8192_setBBreg (struct net_device *dev,u32 reg_addr,u32 bitmask,u32 data);u32 rtl8192_QueryBBReg (struct net_device *dev,u32 reg_addr,u32 bitmask); -void rtl8192_phy_SetRFReg (struct net_device *dev,RF90_RADIO_PATH_E eRFPath, +void rtl8192_phy_SetRFReg (struct net_device *dev, +enum RF90_RADIO_PATH_E eRFPath,u32 reg_addr,u32 bitmask,u32 data); -u32 rtl8192_phy_QueryRFReg (struct net_device *dev,RF90_RADIO_PATH_E eRFPath, +u32 rtl8192_phy_QueryRFReg (struct net_device *dev, +enum RF90_RADIO_PATH_E eRFPath,u32 reg_addr,u32 bitmask);void rtl8192_phy_configmac (struct net_device *dev);void rtl8192_phyConfigBB (struct net_device *dev,u8 ConfigType);u8 rtl8192_phy_checkBBAndRF (struct net_device *dev, -enum HW90_BLOCK_E CheckBlock,RF90_RADIO_PATH_E eRFPath); +enum HW90_BLOCK_E CheckBlock, +enum RF90_RADIO_PATH_E eRFPath);void rtl8192_BBConfig (struct net_device *dev);void rtl8192_phy_getTxPower (struct net_device *dev);void rtl8192_phy_setTxPower (struct net_device *dev,u8 channel);void rtl8192_phy_RFConfig (struct net_device *dev);void rtl8192_phy_updateInitGain (struct net_device *dev);u8 rtl8192_phy_ConfigRFWithHeaderFile (struct net_device *dev, -RF90_RADIO_PATH_E eRFPath); +enum RF90_RADIO_PATH_E eRFPath);u8 rtl8192_phy_SwChnl (struct net_device *dev,u8 channel); void rtl8192_SetBWMode(struct net_device *dev,
Signature · 1 line
2.18.0
PATCH 4/13 staging:rtl8192u: remove typedef from structure SwChnlCmd - Style
In reply to John WhitmoreCheckpatch warns against creation of new types in code. This patch simply removes the "typedef" declaration of the structure SwChnlCmd to clear this issue. Simple coding style issue which should not impact runtime execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 20 ++++++++++---------- drivers/staging/rtl8192u/r819xU_phy.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +10 -10
@@ -1227,11 +1227,11 @@ bool rtl8192_SetRFPowerState(struct net_device *dev,* return: true if finished, false otherwise * notice: ******************************************************************************/ -static u8 rtl8192_phy_SetSwChnlCmdArray (SwChnlCmd *CmdTable,u32 CmdTableIdx, +static u8 rtl8192_phy_SetSwChnlCmdArray (struct SwChnlCmd *CmdTable,u32 CmdTableIdx,u32 CmdTableSz,enum SwChnlCmdID CmdID,u32 Para1,u32 Para2,u32 msDelay) { -SwChnlCmd *pCmd; +struct SwChnlCmd *pCmd;if (CmdTable ==NULL ) {RT_TRACE (COMP_ERR ,"%s(): CmdTable cannot be NULL\n" , __func__);
@@ -1268,14 +1268,14 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8 *stage, u8 *step, u32 *delay) {struct r8192_priv *priv =ieee80211_priv (dev); -SwChnlCmd PreCommonCmd[MAX_PRECMD_CNT ]; -u32 PreCommonCmdCnt; -SwChnlCmd PostCommonCmd[MAX_POSTCMD_CNT ]; -u32 PostCommonCmdCnt; -SwChnlCmd RfDependCmd[MAX_RFDEPENDCMD_CNT ]; -u32 RfDependCmdCnt; -SwChnlCmd *CurrentCmd =NULL ; -u8 eRFPath; +struct SwChnlCmd PreCommonCmd[MAX_PRECMD_CNT ]; +u32 PreCommonCmdCnt; +struct SwChnlCmd PostCommonCmd[MAX_POSTCMD_CNT ]; +u32 PostCommonCmdCnt; +struct SwChnlCmd RfDependCmd[MAX_RFDEPENDCMD_CNT ]; +u32 RfDependCmdCnt; +struct SwChnlCmd *CurrentCmd =NULL ; +u8 eRFPath;RT_TRACE (COMP_CH ,"%s() stage: %d, step: %d, channel: %d\n" , __func__, *stage, *step, channel);
drivers/staging/rtl8192u/r819xU_phy.h +2 -2
@@ -19,12 +19,12 @@ enum SwChnlCmdID {/* -----------------------Define structure---------------------- */ /* 1. Switch channel related */ -typedef struct _SwChnlCmd { +struct SwChnlCmd {enum SwChnlCmdID CmdID;u32 Para1;u32 Para2;u32 msDelay; -} __packed SwChnlCmd; +} __packed;extern u32 rtl819XMACPHY_Array_PG[];extern u32 rtl819XPHY_REG_1T2RArray[];
Signature · 1 line
2.18.0
PATCH 5/13 staging:rtl8192u: Rename SwChnlCmdID > switch_chan_cmd_id - Coding Style
In reply to John WhitmoreRename enumerated type to clear a CamelCase warning from checkpatch. The change is style only. No impact on run time execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 4 ++-- drivers/staging/rtl8192u/r819xU_phy.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +2 -2
@@ -1219,7 +1219,7 @@ bool rtl8192_SetRFPowerState(struct net_device *dev,* input: SwChnlCmd *CmdTable //table to be set * u32 CmdTableIdx //variable index in table to be set * u32 CmdTableSz //table size -* SwChnlCmdID CmdID //command ID to set +* switch_chan_cmd_id CmdID //command ID to set * u32 Para1 * u32 Para2 * u32 msDelay
@@ -1228,7 +1228,7 @@ bool rtl8192_SetRFPowerState(struct net_device *dev,* notice: ******************************************************************************/ static u8 rtl8192_phy_SetSwChnlCmdArray (struct SwChnlCmd *CmdTable,u32 CmdTableIdx, -u32 CmdTableSz,enum SwChnlCmdID CmdID, +u32 CmdTableSz,enum switch_chan_cmd_id CmdID,u32 Para1,u32 Para2,u32 msDelay) {struct SwChnlCmd *pCmd;
drivers/staging/rtl8192u/r819xU_phy.h +2 -2
@@ -7,7 +7,7 @@#define MAX_RFDEPENDCMD_CNT 16#define MAX_POSTCMD_CNT 16 -enum SwChnlCmdID { +enum switch_chan_cmd_id { CmdID_End, CmdID_SetTxPowerLevel, CmdID_BBRegWrite10,
@@ -20,7 +20,7 @@ enum SwChnlCmdID {/* -----------------------Define structure---------------------- */ /* 1. Switch channel related */ struct SwChnlCmd { -enum SwChnlCmdID CmdID; +enum switch_chan_cmd_id CmdID;u32 Para1;u32 Para2;u32 msDelay;
Signature · 1 line
2.18.0
PATCH 6/13 staging:rtl8192u: Rename enum label CmdID_End > CMD_ID_END - Style
In reply to John WhitmoreRename enum label to clear a CamelCase warning from checkpatch. This is a simple style change and should not impact execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 10 +++++----- drivers/staging/rtl8192u/r819xU_phy.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +5 -5
@@ -1295,13 +1295,13 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,MAX_PRECMD_CNT , CmdID_SetTxPowerLevel, 0, 0, 0);rtl8192_phy_SetSwChnlCmdArray (PreCommonCmd, PreCommonCmdCnt++, -MAX_PRECMD_CNT , CmdID_End,0 ,0 ,0 ); +MAX_PRECMD_CNT ,CMD_ID_END ,0 ,0 ,0 );/* <2> Fill up post common command. */ PostCommonCmdCnt =0 ;rtl8192_phy_SetSwChnlCmdArray (PostCommonCmd, PostCommonCmdCnt++, -MAX_POSTCMD_CNT , CmdID_End,0 ,0 ,0 ); +MAX_POSTCMD_CNT ,CMD_ID_END ,0 ,0 ,0 );/* <3> Fill up RF dependent command. */ RfDependCmdCnt =0 ;
@@ -1321,7 +1321,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, 10);rtl8192_phy_SetSwChnlCmdArray (RfDependCmd, RfDependCmdCnt++,MAX_RFDEPENDCMD_CNT , - CmdID_End,0 ,0 ,0 ); +CMD_ID_END ,0 ,0 ,0 );break ;case RF_8256 :
@@ -1338,7 +1338,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, rZebra1_Channel, channel, 10);rtl8192_phy_SetSwChnlCmdArray (RfDependCmd, RfDependCmdCnt++,MAX_RFDEPENDCMD_CNT , - CmdID_End,0 ,0 ,0 ); +CMD_ID_END ,0 ,0 ,0 );break ;case RF_8258 :
@@ -1363,7 +1363,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,break ; } -if (CurrentCmd->CmdID == CmdID_End) { +if (CurrentCmd->CmdID ==CMD_ID_END ) {if ((*stage) ==2 ) { (*delay) = CurrentCmd->msDelay;return true;
drivers/staging/rtl8192u/r819xU_phy.h +1 -1
@@ -8,7 +8,7 @@#define MAX_POSTCMD_CNT 16enum switch_chan_cmd_id { - CmdID_End, +CMD_ID_END , CmdID_SetTxPowerLevel, CmdID_BBRegWrite10, CmdID_WritePortUlong,
Signature · 1 line
2.18.0
PATCH 7/13 staging:rtl8192u: rename CmdID_SetTxPowerLevel > CMD_ID_SET_TX_PWR_LEVEL
In reply to John WhitmoreRename enumeration label CmdID_SetTxPowerLevel to CMD_ID_SET_TX_PWR_LEVEL. This change clears a checkpatch warning on CamelCase. The change should not impact runtime execution, style change only.
--- drivers/staging/rtl8192u/r819xU_phy.c | 4 ++-- drivers/staging/rtl8192u/r819xU_phy.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +2 -2
@@ -1292,7 +1292,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,/* <1> Fill up pre common command. */ PreCommonCmdCnt =0 ;rtl8192_phy_SetSwChnlCmdArray (PreCommonCmd, PreCommonCmdCnt++, -MAX_PRECMD_CNT , CmdID_SetTxPowerLevel, +MAX_PRECMD_CNT ,CMD_ID_SET_TX_PWR_LEVEL ,0 ,0 ,0 );rtl8192_phy_SetSwChnlCmdArray (PreCommonCmd, PreCommonCmdCnt++,MAX_PRECMD_CNT ,CMD_ID_END ,0 ,0 ,0 );
@@ -1374,7 +1374,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, }switch (CurrentCmd->CmdID) { -case CmdID_SetTxPowerLevel: +case CMD_ID_SET_TX_PWR_LEVEL :if (priv->card_8192_version == (u8 )VERSION_819xU_A)/* consider it later! */ rtl8192_SetTxPowerLevel (dev, channel);
drivers/staging/rtl8192u/r819xU_phy.h +1 -1
@@ -9,7 +9,7 @@enum switch_chan_cmd_id {CMD_ID_END , - CmdID_SetTxPowerLevel, +CMD_ID_SET_TX_PWR_LEVEL , CmdID_BBRegWrite10, CmdID_WritePortUlong, CmdID_WritePortUshort,
Signature · 1 line
2.18.0
PATCH 8/13 staging:rtl8192u: Remove unused enum label CmdID_BBRegWrite10
In reply to John WhitmoreThe enum label CmdID_BBRegWrite10 is not used in the code, so removed from the source code.
--- drivers/staging/rtl8192u/r819xU_phy.h | 1 - 1 file changed, 1 deletion(-)
drivers/staging/rtl8192u/r819xU_phy.h +0 -1
@@ -10,7 +10,6 @@enum switch_chan_cmd_id {CMD_ID_END ,CMD_ID_SET_TX_PWR_LEVEL , - CmdID_BBRegWrite10, CmdID_WritePortUlong, CmdID_WritePortUshort, CmdID_WritePortUchar,
Signature · 1 line
2.18.0
PATCH 9/13 staging:rtl8192u: Rename CmdID_WritePortUlong > CMD_ID_WRITE_PORT_ULONG
In reply to John WhitmoreRename enum label CmdID_WritePortUlong to CMD_ID_WRITE_PORT_ULONG to clear the checkpatch CamelCase issue. Simple syle change which should not impact code execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- drivers/staging/rtl8192u/r819xU_phy.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +1 -1
@@ -1379,7 +1379,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,/* consider it later! */ rtl8192_SetTxPowerLevel (dev, channel);break ; -case CmdID_WritePortUlong: +case CMD_ID_WRITE_PORT_ULONG :write_nic_dword (dev, CurrentCmd->Para1, CurrentCmd->Para2);break ;
drivers/staging/rtl8192u/r819xU_phy.h +1 -1
@@ -10,7 +10,7 @@enum switch_chan_cmd_id {CMD_ID_END ,CMD_ID_SET_TX_PWR_LEVEL , - CmdID_WritePortUlong, +CMD_ID_WRITE_PORT_ULONG , CmdID_WritePortUshort, CmdID_WritePortUchar, CmdID_RF_WriteReg,
Signature · 1 line
2.18.0
PATCH 10/13 staging:rtl8192u: Rename CmdID_WritePortUshort > CMD_ID_WRITE_PORT_USHORT
In reply to John WhitmoreRename the enum label CmdID_WritePortUshort to CMD_ID_WRITE_PORT_USHORT to clear the checkpatch warning on CamelCase naming. This is a coding style change only and should not impact code execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- drivers/staging/rtl8192u/r819xU_phy.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +1 -1
@@ -1383,7 +1383,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,write_nic_dword (dev, CurrentCmd->Para1, CurrentCmd->Para2);break ; -case CmdID_WritePortUshort: +case CMD_ID_WRITE_PORT_USHORT :write_nic_word (dev, CurrentCmd->Para1, (u16 )CurrentCmd->Para2);break ;
drivers/staging/rtl8192u/r819xU_phy.h +1 -1
@@ -11,7 +11,7 @@ enum switch_chan_cmd_id {CMD_ID_END ,CMD_ID_SET_TX_PWR_LEVEL ,CMD_ID_WRITE_PORT_ULONG , - CmdID_WritePortUshort, +CMD_ID_WRITE_PORT_USHORT , CmdID_WritePortUchar, CmdID_RF_WriteReg, };
Signature · 1 line
2.18.0
PATCH 11/13 staging:rtl8192u: Rename CmdID_WritePortUchar > CMD_ID_WRITE_PORT_UCHAR
In reply to John WhitmoreRename the enum label CmdID_WritePortUchar to CMD_ID_WRITE_PORT_UCHAR, to clear the checkpatch issue with CamelCase. The change is a coding style change only and should not impact code execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 2 +- drivers/staging/rtl8192u/r819xU_phy.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +1 -1
@@ -1387,7 +1387,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,write_nic_word (dev, CurrentCmd->Para1, (u16 )CurrentCmd->Para2);break ; -case CmdID_WritePortUchar: +case CMD_ID_WRITE_PORT_UCHAR :write_nic_byte (dev, CurrentCmd->Para1, (u8 )CurrentCmd->Para2);break ;
drivers/staging/rtl8192u/r819xU_phy.h +1 -1
@@ -12,7 +12,7 @@ enum switch_chan_cmd_id {CMD_ID_SET_TX_PWR_LEVEL ,CMD_ID_WRITE_PORT_ULONG ,CMD_ID_WRITE_PORT_USHORT , - CmdID_WritePortUchar, +CMD_ID_WRITE_PORT_UCHAR , CmdID_RF_WriteReg, };
Signature · 1 line
2.18.0
PATCH 12/13 staging:rtl8192u: Rename CmdID_RF_WriteReg > CMD_ID_RF_WRITE_REG - Style
In reply to John WhitmoreRename enum label CmdID_RF_WriteReg to CMD_ID_RF_WRITE_REG. This change clears the checkpatch issue with CamelCase. The change is style only and should not impact code execution.
--- drivers/staging/rtl8192u/r819xU_phy.c | 6 +++--- drivers/staging/rtl8192u/r819xU_phy.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r819xU_phy.c +3 -3
@@ -1315,7 +1315,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, }rtl8192_phy_SetSwChnlCmdArray (RfDependCmd, RfDependCmdCnt++,MAX_RFDEPENDCMD_CNT , - CmdID_RF_WriteReg, +CMD_ID_RF_WRITE_REG , rZebra1_Channel,RF_CHANNEL_TABLE_ZEBRA [channel],10 );
@@ -1334,7 +1334,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, }rtl8192_phy_SetSwChnlCmdArray (RfDependCmd, RfDependCmdCnt++,MAX_RFDEPENDCMD_CNT , - CmdID_RF_WriteReg, +CMD_ID_RF_WRITE_REG , rZebra1_Channel, channel,10 ); rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT,
@@ -1391,7 +1391,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,write_nic_byte (dev, CurrentCmd->Para1, (u8 )CurrentCmd->Para2);break ; -case CmdID_RF_WriteReg: +case CMD_ID_RF_WRITE_REG :for (eRFPath =0 ; eRFPath <RF90_PATH_MAX ; eRFPath++) { rtl8192_phy_SetRFReg(dev, (enum RF90_RADIO_PATH_E)eRFPath,
drivers/staging/rtl8192u/r819xU_phy.h +1 -1
@@ -13,7 +13,7 @@ enum switch_chan_cmd_id {CMD_ID_WRITE_PORT_ULONG ,CMD_ID_WRITE_PORT_USHORT ,CMD_ID_WRITE_PORT_UCHAR , - CmdID_RF_WriteReg, + CMD_ID_RF_WRITE_REG, };/* -----------------------Define structure---------------------- */
Signature · 1 line
2.18.0
PATCH 13/13 staging:rtl8192u: Rename file macro to avoid camel case - Coding Style
In reply to John WhitmoreSimple rename of the preprosessor switch, protecting against multiple inclusion of the header file. Change to clear the checkpatch coding style issue.
--- drivers/staging/rtl8192u/r8192U.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U.h +2 -2
@@ -15,8 +15,8 @@* project Authors. */ -#ifndef R819xU_H -#define R819xU_H +#ifndef R8192U_H +#define R8192U_H #include <linux/compiler.h> #include <linux/module.h>
Signature · 1 line
2.18.0