staging: r8188eu: misc cleanups
cover staging: r8188eu: misc cleanups
This series consists of various cleanups.
Tested on x86_64 with InterTech DMG-02.
Michael Straube (12):
staging: r8188eu: remove RF_PATH_{C,D}
staging: r8188eu: struct odm_mac_status_info is not used
staging: r8188eu: remove macro PHY_SetRFReg
staging: r8188eu: remove macro PHY_QueryRFReg
staging: r8188eu: remove macro PHY_SetBBReg
staging: r8188eu: remove macro PHY_QueryBBReg
staging: r8188eu: remove duplicate defines
staging: r8188eu: bWIFI_Direct is set but never used
staging: r8188eu: bWIFI_Display is set but never used
staging: r8188eu: remove unused macro IS_FW_81xxC
staging: r8188eu: remove macro GET_HAL_DATA
staging: r8188eu: hal_data_sz is set but never used
drivers/staging/r8188eu/core/rtw_p2p.c | 3 - drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 30 +++---- drivers/staging/r8188eu/hal/odm.c | 14 +-- drivers/staging/r8188eu/hal/odm_interface.c | 12 +-- drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 12 +-- drivers/staging/r8188eu/hal/rtl8188e_dm.c | 14 +-- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 26 ++---- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 86 +++++++------------ drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 38 ++++---- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 +- drivers/staging/r8188eu/hal/rtl8188eu_led.c | 2 +- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 +- drivers/staging/r8188eu/hal/usb_halinit.c | 63 +++++++------- drivers/staging/r8188eu/hal/usb_ops_linux.c | 4 +- .../staging/r8188eu/include/Hal8188EPhyCfg.h | 16 ---- drivers/staging/r8188eu/include/drv_types.h | 3 +- drivers/staging/r8188eu/include/hal_intf.h | 2 - drivers/staging/r8188eu/include/odm.h | 8 -- drivers/staging/r8188eu/include/rtl8188e_dm.h | 7 +- .../staging/r8188eu/include/rtl8188e_hal.h | 5 +- 20 files changed, 136 insertions(+), 215 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/12 staging: r8188eu: remove RF_PATH_{C,D}
pHalData->PHYRegDef[RF_PATH_C] and pHalData->PHYRegDef[RF_PATH_D] are initialized but not used. Remove them and remove RF_PATH_C and RF_PATH_D from the rf_radio_path enum.
--- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 24 ------------------- .../staging/r8188eu/include/Hal8188EPhyCfg.h | 2 -- .../staging/r8188eu/include/rtl8188e_hal.h | 2 +- 3 files changed, 1 insertion(+), 27 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +0 -24
@@ -392,14 +392,10 @@ phy_InitBBRFRegisterDefinition(/* RF Interface Sowrtware Control */ pHalData->PHYRegDef[RF_PATH_A ].rfintfs = rFPGA0_XAB_RFInterfaceSW;/* 16 LSBs if read 32-bit from 0x870 */ pHalData->PHYRegDef[RF_PATH_B ].rfintfs = rFPGA0_XAB_RFInterfaceSW;/* 16 MSBs if read 32-bit from 0x870 (16-bit for 0x872) */ - pHalData->PHYRegDef[RF_PATH_C ].rfintfs = rFPGA0_XCD_RFInterfaceSW;/* 16 LSBs if read 32-bit from 0x874 */ - pHalData->PHYRegDef[RF_PATH_D ].rfintfs = rFPGA0_XCD_RFInterfaceSW;/* 16 MSBs if read 32-bit from 0x874 (16-bit for 0x876) */ /* RF Interface Readback Value */ pHalData->PHYRegDef[RF_PATH_A ].rfintfi = rFPGA0_XAB_RFInterfaceRB;/* 16 LSBs if read 32-bit from 0x8E0 */ pHalData->PHYRegDef[RF_PATH_B ].rfintfi = rFPGA0_XAB_RFInterfaceRB;/* 16 MSBs if read 32-bit from 0x8E0 (16-bit for 0x8E2) */ - pHalData->PHYRegDef[RF_PATH_C ].rfintfi = rFPGA0_XCD_RFInterfaceRB;/* 16 LSBs if read 32-bit from 0x8E4 */ - pHalData->PHYRegDef[RF_PATH_D ].rfintfi = rFPGA0_XCD_RFInterfaceRB;/* 16 MSBs if read 32-bit from 0x8E4 (16-bit for 0x8E6) */ /* RF Interface Output (and Enable) */ pHalData->PHYRegDef[RF_PATH_A ].rfintfo = rFPGA0_XA_RFInterfaceOE;/* 16 LSBs if read 32-bit from 0x860 */
@@ -416,14 +412,10 @@ phy_InitBBRFRegisterDefinition(/* RF parameter */ pHalData->PHYRegDef[RF_PATH_A ].rfLSSI_Select = rFPGA0_XAB_RFParameter;/* BB Band Select */ pHalData->PHYRegDef[RF_PATH_B ].rfLSSI_Select = rFPGA0_XAB_RFParameter; - pHalData->PHYRegDef[RF_PATH_C ].rfLSSI_Select = rFPGA0_XCD_RFParameter; - pHalData->PHYRegDef[RF_PATH_D ].rfLSSI_Select = rFPGA0_XCD_RFParameter;/* Tx AGC Gain Stage (same for all path. Should we remove this?) */ pHalData->PHYRegDef[RF_PATH_A ].rfTxGainStage = rFPGA0_TxGainStage;/* Tx gain stage */ pHalData->PHYRegDef[RF_PATH_B ].rfTxGainStage = rFPGA0_TxGainStage;/* Tx gain stage */ - pHalData->PHYRegDef[RF_PATH_C ].rfTxGainStage = rFPGA0_TxGainStage;/* Tx gain stage */ - pHalData->PHYRegDef[RF_PATH_D ].rfTxGainStage = rFPGA0_TxGainStage;/* Tx gain stage */ /* Tranceiver A~D HSSI Parameter-1 */ pHalData->PHYRegDef[RF_PATH_A ].rfHSSIPara1 = rFPGA0_XA_HSSIParameter1;/* wire control parameter1 */
@@ -436,50 +428,34 @@ phy_InitBBRFRegisterDefinition(/* RF switch Control */ pHalData->PHYRegDef[RF_PATH_A ].rfSwitchControl = rFPGA0_XAB_SwitchControl;/* TR/Ant switch control */ pHalData->PHYRegDef[RF_PATH_B ].rfSwitchControl = rFPGA0_XAB_SwitchControl; - pHalData->PHYRegDef[RF_PATH_C ].rfSwitchControl = rFPGA0_XCD_SwitchControl; - pHalData->PHYRegDef[RF_PATH_D ].rfSwitchControl = rFPGA0_XCD_SwitchControl;/* AGC control 1 */ pHalData->PHYRegDef[RF_PATH_A ].rfAGCControl1 = rOFDM0_XAAGCCore1; pHalData->PHYRegDef[RF_PATH_B ].rfAGCControl1 = rOFDM0_XBAGCCore1; - pHalData->PHYRegDef[RF_PATH_C ].rfAGCControl1 = rOFDM0_XCAGCCore1; - pHalData->PHYRegDef[RF_PATH_D ].rfAGCControl1 = rOFDM0_XDAGCCore1;/* AGC control 2 */ pHalData->PHYRegDef[RF_PATH_A ].rfAGCControl2 = rOFDM0_XAAGCCore2; pHalData->PHYRegDef[RF_PATH_B ].rfAGCControl2 = rOFDM0_XBAGCCore2; - pHalData->PHYRegDef[RF_PATH_C ].rfAGCControl2 = rOFDM0_XCAGCCore2; - pHalData->PHYRegDef[RF_PATH_D ].rfAGCControl2 = rOFDM0_XDAGCCore2;/* RX AFE control 1 */ pHalData->PHYRegDef[RF_PATH_A ].rfRxIQImbalance = rOFDM0_XARxIQImbalance; pHalData->PHYRegDef[RF_PATH_B ].rfRxIQImbalance = rOFDM0_XBRxIQImbalance; - pHalData->PHYRegDef[RF_PATH_C ].rfRxIQImbalance = rOFDM0_XCRxIQImbalance; - pHalData->PHYRegDef[RF_PATH_D ].rfRxIQImbalance = rOFDM0_XDRxIQImbalance;/* RX AFE control 1 */ pHalData->PHYRegDef[RF_PATH_A ].rfRxAFE = rOFDM0_XARxAFE; pHalData->PHYRegDef[RF_PATH_B ].rfRxAFE = rOFDM0_XBRxAFE; - pHalData->PHYRegDef[RF_PATH_C ].rfRxAFE = rOFDM0_XCRxAFE; - pHalData->PHYRegDef[RF_PATH_D ].rfRxAFE = rOFDM0_XDRxAFE;/* Tx AFE control 1 */ pHalData->PHYRegDef[RF_PATH_A ].rfTxIQImbalance = rOFDM0_XATxIQImbalance; pHalData->PHYRegDef[RF_PATH_B ].rfTxIQImbalance = rOFDM0_XBTxIQImbalance; - pHalData->PHYRegDef[RF_PATH_C ].rfTxIQImbalance = rOFDM0_XCTxIQImbalance; - pHalData->PHYRegDef[RF_PATH_D ].rfTxIQImbalance = rOFDM0_XDTxIQImbalance;/* Tx AFE control 2 */ pHalData->PHYRegDef[RF_PATH_A ].rfTxAFE = rOFDM0_XATxAFE; pHalData->PHYRegDef[RF_PATH_B ].rfTxAFE = rOFDM0_XBTxAFE; - pHalData->PHYRegDef[RF_PATH_C ].rfTxAFE = rOFDM0_XCTxAFE; - pHalData->PHYRegDef[RF_PATH_D ].rfTxAFE = rOFDM0_XDTxAFE;/* Tranceiver LSSI Readback SI mode */ pHalData->PHYRegDef[RF_PATH_A ].rfLSSIReadBack = rFPGA0_XA_LSSIReadBack; pHalData->PHYRegDef[RF_PATH_B ].rfLSSIReadBack = rFPGA0_XB_LSSIReadBack; - pHalData->PHYRegDef[RF_PATH_C ].rfLSSIReadBack = rFPGA0_XC_LSSIReadBack; - pHalData->PHYRegDef[RF_PATH_D ].rfLSSIReadBack = rFPGA0_XD_LSSIReadBack;/* Tranceiver LSSI Readback PI mode */ pHalData->PHYRegDef[RF_PATH_A ].rfLSSIReadBackPi = TransceiverA_HSPI_Readback;
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -2
@@ -33,8 +33,6 @@ enum hw90_block {enum rf_radio_path {RF_PATH_A =0 ,/* Radio Path A */ RF_PATH_B =1 ,/* Radio Path B */ -RF_PATH_C =2 ,/* Radio Path C */ -RF_PATH_D =3 ,/* Radio Path D */ };#define MAX_PG_GROUP 13
drivers/staging/r8188eu/include/rtl8188e_hal.h +1 -1
@@ -227,7 +227,7 @@ struct hal_data_8188e {u32 AcParam_BE;/* Original parameter for BE, use for EDCA turbo. */ -struct bb_reg_def PHYRegDef[4 ];/* Radio A/B/C/D */ +struct bb_reg_def PHYRegDef[2 ];/* Radio A/B */ u32 RfRegChnlVal[2 ];
Signature · 1 line
2.34.1
PATCH 2/12 staging: r8188eu: struct odm_mac_status_info is not used
In reply to Michael StraubeThe structure odm_mac_status_info is not used. Remove it.
--- drivers/staging/r8188eu/include/odm.h | 4 ---- 1 file changed, 4 deletions(-)
drivers/staging/r8188eu/include/odm.h +0 -4
@@ -176,10 +176,6 @@ struct odm_per_pkt_info {bool bPacketBeacon; }; -struct odm_mac_status_info { -u8 test; -}; -enum odm_ability {/* BB Team */ ODM_DIG =0x00000001 ,
Signature · 1 line
2.34.1
PATCH 3/12 staging: r8188eu: remove macro PHY_SetRFReg
In reply to Michael StraubeThe macro PHY_SetRFReg just re-defines rtl8188e_PHY_SetRFReg(). Call rtl8188e_PHY_SetRFReg() directly and remove the macro.
--- drivers/staging/r8188eu/hal/odm.c | 2 +- drivers/staging/r8188eu/hal/odm_interface.c | 2 +- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 2 +- drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 4 ++-- drivers/staging/r8188eu/include/Hal8188EPhyCfg.h | 2 -- 5 files changed, 5 insertions(+), 7 deletions(-)
drivers/staging/r8188eu/hal/odm.c +1 -1
@@ -890,7 +890,7 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm)return ;if (!pDM_Odm->RFCalibrateInfo.TM_Trigger) {/* at least delay 1 sec */ -PHY_SetRFReg (Adapter,RF_PATH_A ,RF_T_METER_88E ,BIT (17 ) |BIT (16 ),0x03 ); +rtl8188e_PHY_SetRFReg (Adapter,RF_PATH_A ,RF_T_METER_88E ,BIT (17 ) |BIT (16 ),0x03 ); pDM_Odm->RFCalibrateInfo.TM_Trigger =1 ;return ;
drivers/staging/r8188eu/hal/odm_interface.c +1 -1
@@ -31,7 +31,7 @@ u32 ODM_GetBBReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask)void ODM_SetRFReg (struct odm_dm_struct *pDM_Odm,enum rf_radio_path eRFPath,u32 RegAddr,u32 BitMask,u32 Data) {struct adapter *Adapter = pDM_Odm->Adapter; -PHY_SetRFReg (Adapter, (enum rf_radio_path )eRFPath, RegAddr, BitMask, Data); +rtl8188e_PHY_SetRFReg (Adapter, (enum rf_radio_path )eRFPath, RegAddr, BitMask, Data); }u32 ODM_GetRFReg (struct odm_dm_struct *pDM_Odm,enum rf_radio_path eRFPath,u32 RegAddr,u32 BitMask)
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +1 -1
@@ -771,7 +771,7 @@ static void _PHY_SwChnl8192C(struct adapter *Adapter, u8 channel) param1 =RF_CHNLBW ; param2 = channel; pHalData->RfRegChnlVal[eRFPath] = ((pHalData->RfRegChnlVal[eRFPath] &0xfffffc00 ) | param2); -PHY_SetRFReg (Adapter, (enum rf_radio_path )eRFPath, param1, bRFRegOffsetMask, pHalData->RfRegChnlVal[eRFPath]); +rtl8188e_PHY_SetRFReg (Adapter, (enum rf_radio_path )eRFPath, param1, bRFRegOffsetMask, pHalData->RfRegChnlVal[eRFPath]); }void PHY_SwChnl8188E (struct adapter *Adapter,u8 channel)
drivers/staging/r8188eu/hal/rtl8188e_rf6052.c +2 -2
@@ -51,11 +51,11 @@ void rtl8188e_PHY_RF6052SetBandwidth(struct adapter *Adapter,switch (Bandwidth) {case HT_CHANNEL_WIDTH_20 : pHalData->RfRegChnlVal[0 ] = ((pHalData->RfRegChnlVal[0 ] &0xfffff3ff ) |BIT (10 ) |BIT (11 )); -PHY_SetRFReg (Adapter,RF_PATH_A ,RF_CHNLBW , bRFRegOffsetMask, pHalData->RfRegChnlVal[0 ]); +rtl8188e_PHY_SetRFReg (Adapter,RF_PATH_A ,RF_CHNLBW , bRFRegOffsetMask, pHalData->RfRegChnlVal[0 ]);break ;case HT_CHANNEL_WIDTH_40 : pHalData->RfRegChnlVal[0 ] = ((pHalData->RfRegChnlVal[0 ] &0xfffff3ff ) |BIT (10 )); -PHY_SetRFReg (Adapter,RF_PATH_A ,RF_CHNLBW , bRFRegOffsetMask, pHalData->RfRegChnlVal[0 ]); +rtl8188e_PHY_SetRFReg (Adapter,RF_PATH_A ,RF_CHNLBW , bRFRegOffsetMask, pHalData->RfRegChnlVal[0 ]);break ;default :break ;
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -2
@@ -140,7 +140,5 @@ void storePwrIndexDiffRateOffset(struct adapter *adapter, u32 regaddr, rtl8188e_PHY_SetBBReg((adapt), (regaddr), (bitmask), (data))#define PHY_QueryRFReg (adapt, rfpath, regaddr, bitmask) \ rtl8188e_PHY_QueryRFReg((adapt), (rfpath), (regaddr), (bitmask)) -#define PHY_SetRFReg (adapt, rfpath, regaddr, bitmask, data) \ - rtl8188e_PHY_SetRFReg((adapt), (rfpath), (regaddr), (bitmask), (data))#endif /* __INC_HAL8192CPHYCFG_H */
Signature · 1 line
2.34.1
PATCH 4/12 staging: r8188eu: remove macro PHY_QueryRFReg
In reply to Michael StraubeThe macro PHY_QueryRFReg just re-defines rtl8188e_PHY_QueryRFReg(). Call rtl8188e_PHY_QueryRFReg() directly and remove the macro.
--- drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 6 +++--- drivers/staging/r8188eu/hal/odm_interface.c | 2 +- drivers/staging/r8188eu/hal/usb_halinit.c | 4 ++-- drivers/staging/r8188eu/include/Hal8188EPhyCfg.h | 2 -- 4 files changed, 6 insertions(+), 8 deletions(-)
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +3 -3
@@ -853,11 +853,11 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)if ((tmpreg &0x70 ) !=0 ) {/* 1. Read original RF mode */ /* Path-A */ - RF_Amode =PHY_QueryRFReg (adapt,RF_PATH_A ,RF_AC , bMask12Bits); + RF_Amode =rtl8188e_PHY_QueryRFReg (adapt,RF_PATH_A ,RF_AC , bMask12Bits);/* Path-B */ if (is2t) - RF_Bmode =PHY_QueryRFReg (adapt,RF_PATH_B ,RF_AC , bMask12Bits); + RF_Bmode =rtl8188e_PHY_QueryRFReg (adapt,RF_PATH_B ,RF_AC , bMask12Bits);/* 2. Set RF mode = standby mode */ /* Path-A */
@@ -869,7 +869,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) }/* 3. Read RF reg18 */ - LC_Cal =PHY_QueryRFReg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits); + LC_Cal =rtl8188e_PHY_QueryRFReg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits);/* 4. Set LC calibration begin bit15 */ ODM_SetRFReg (dm_odm,RF_PATH_A ,RF_CHNLBW , bMask12Bits, LC_Cal |0x08000 );
drivers/staging/r8188eu/hal/odm_interface.c +1 -1
@@ -37,7 +37,7 @@ void ODM_SetRFReg(struct odm_dm_struct *pDM_Odm, enum rf_radio_path eRFPath, u32u32 ODM_GetRFReg (struct odm_dm_struct *pDM_Odm,enum rf_radio_path eRFPath,u32 RegAddr,u32 BitMask) {struct adapter *Adapter = pDM_Odm->Adapter; -return PHY_QueryRFReg (Adapter, (enum rf_radio_path )eRFPath, RegAddr, BitMask); +return rtl8188e_PHY_QueryRFReg (Adapter, (enum rf_radio_path )eRFPath, RegAddr, BitMask); }/* ODM Memory relative API. */
drivers/staging/r8188eu/hal/usb_halinit.c +2 -2
@@ -745,8 +745,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)rtw_write16 (Adapter,REG_PKT_BE_BK_LIFE_TIME ,0x0400 );/* unit: 256us. 256ms */ /* Keep RfRegChnlVal for later use. */ - haldata->RfRegChnlVal[0 ] =PHY_QueryRFReg (Adapter, (enum rf_radio_path )0 ,RF_CHNLBW , bRFRegOffsetMask); - haldata->RfRegChnlVal[1 ] =PHY_QueryRFReg (Adapter, (enum rf_radio_path )1 ,RF_CHNLBW , bRFRegOffsetMask); + haldata->RfRegChnlVal[0 ] =rtl8188e_PHY_QueryRFReg (Adapter, (enum rf_radio_path )0 ,RF_CHNLBW , bRFRegOffsetMask); + haldata->RfRegChnlVal[1 ] =rtl8188e_PHY_QueryRFReg (Adapter, (enum rf_radio_path )1 ,RF_CHNLBW , bRFRegOffsetMask);HAL_INIT_PROFILE_TAG (HAL_INIT_STAGES_TURN_ON_BLOCK );_BBTurnOnBlock (Adapter);
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -2
@@ -138,7 +138,5 @@ void storePwrIndexDiffRateOffset(struct adapter *adapter, u32 regaddr, rtl8188e_PHY_QueryBBReg((adapt), (regaddr), (mask))#define PHY_SetBBReg (adapt, regaddr, bitmask, data) \ rtl8188e_PHY_SetBBReg((adapt), (regaddr), (bitmask), (data)) -#define PHY_QueryRFReg (adapt, rfpath, regaddr, bitmask) \ - rtl8188e_PHY_QueryRFReg((adapt), (rfpath), (regaddr), (bitmask))#endif /* __INC_HAL8192CPHYCFG_H */
Signature · 1 line
2.34.1
PATCH 5/12 staging: r8188eu: remove macro PHY_SetBBReg
In reply to Michael StraubeThe macro PHY_SetBBReg just re-defines rtl8188e_PHY_SetBBReg(). Call rtl8188e_PHY_SetBBReg() directly and remove the macro.
--- drivers/staging/r8188eu/hal/odm_interface.c | 4 ++-- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 22 +++++++++---------- drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 20 ++++++++--------- drivers/staging/r8188eu/hal/usb_halinit.c | 6 ++--- .../staging/r8188eu/include/Hal8188EPhyCfg.h | 2 -- 5 files changed, 26 insertions(+), 28 deletions(-)
drivers/staging/r8188eu/hal/odm_interface.c +2 -2
@@ -7,7 +7,7 @@void ODM_SetMACReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask,u32 Data) {struct adapter *Adapter = pDM_Odm->Adapter; -PHY_SetBBReg (Adapter, RegAddr, BitMask, Data); +rtl8188e_PHY_SetBBReg (Adapter, RegAddr, BitMask, Data); }u32 ODM_GetMACReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask)
@@ -19,7 +19,7 @@ u32 ODM_GetMACReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask)void ODM_SetBBReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask,u32 Data) {struct adapter *Adapter = pDM_Odm->Adapter; -PHY_SetBBReg (Adapter, RegAddr, BitMask, Data); +rtl8188e_PHY_SetBBReg (Adapter, RegAddr, BitMask, Data); }u32 ODM_GetBBReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask)
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +11 -11
@@ -169,10 +169,10 @@ phy_RFSerialRead( tmplong2 = (tmplong2 & (~bLSSIReadAddress)) | (NewOffset <<23 ) | bLSSIReadEdge;/* T65 RF */ -PHY_SetBBReg (Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord, tmplong & (~bLSSIReadEdge)); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord, tmplong & (~bLSSIReadEdge));udelay (10 );/* PlatformStallExecution(10); */ -PHY_SetBBReg (Adapter, pPhyReg->rfHSSIPara2, bMaskDWord, tmplong2); +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfHSSIPara2, bMaskDWord, tmplong2);udelay (100 );/* PlatformStallExecution(100); */ udelay (10 );/* PlatformStallExecution(10); */
@@ -263,7 +263,7 @@ phy_RFSerialWrite(/* */ /* Write Operation */ /* */ -PHY_SetBBReg (Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr); +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr); }/**
@@ -567,7 +567,7 @@ PHY_BBConfig8188E(/* write 0x24[16:11] = 0x24[22:17] = CrystalCap */ CrystalCap = pHalData->CrystalCap &0x3F ; -PHY_SetBBReg (Adapter,REG_AFE_XTAL_CTRL ,0x7ff800 , (CrystalCap | (CrystalCap <<6 ))); +rtl8188e_PHY_SetBBReg (Adapter,REG_AFE_XTAL_CTRL ,0x7ff800 , (CrystalCap | (CrystalCap <<6 )));return rtStatus; }
@@ -704,17 +704,17 @@ _PHY_SetBWMode92C(switch (pHalData->CurrentChannelBW) {/* 20 MHz channel*/ case HT_CHANNEL_WIDTH_20 : -PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bRFMOD,0x0 ); -PHY_SetBBReg (Adapter, rFPGA1_RFMOD, bRFMOD,0x0 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bRFMOD,0x0 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA1_RFMOD, bRFMOD,0x0 );break ;/* 40 MHz channel*/ case HT_CHANNEL_WIDTH_40 : -PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bRFMOD,0x1 ); -PHY_SetBBReg (Adapter, rFPGA1_RFMOD, bRFMOD,0x1 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bRFMOD,0x1 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA1_RFMOD, bRFMOD,0x1 );/* Set Control channel to upper or lower. These settings are required only for 40MHz */ -PHY_SetBBReg (Adapter, rCCK0_System, bCCKSideBand, (pHalData->nCur40MhzPrimeSC >>1 )); -PHY_SetBBReg (Adapter, rOFDM1_LSTF,0xC00 , pHalData->nCur40MhzPrimeSC); -PHY_SetBBReg (Adapter,0x818 , (BIT (26 ) |BIT (27 )), +rtl8188e_PHY_SetBBReg (Adapter, rCCK0_System, bCCKSideBand, (pHalData->nCur40MhzPrimeSC >>1 )); +rtl8188e_PHY_SetBBReg (Adapter, rOFDM1_LSTF,0xC00 , pHalData->nCur40MhzPrimeSC); +rtl8188e_PHY_SetBBReg (Adapter,0x818 , (BIT (26 ) |BIT (27 )), (pHalData->nCur40MhzPrimeSC ==HAL_PRIME_CHNL_OFFSET_LOWER ) ?2 :1 );break ;default :
drivers/staging/r8188eu/hal/rtl8188e_rf6052.c +10 -10
@@ -148,15 +148,15 @@ rtl8188e_PHY_RF6052SetCckTxPower(/* rf-A cck tx power */ tmpval = TxAGC[RF_PATH_A ] &0xff ; -PHY_SetBBReg (Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval); +rtl8188e_PHY_SetBBReg (Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval); tmpval = TxAGC[RF_PATH_A ] >>8 ; -PHY_SetBBReg (Adapter, rTxAGC_B_CCK11_A_CCK2_11,0xffffff00 , tmpval); +rtl8188e_PHY_SetBBReg (Adapter, rTxAGC_B_CCK11_A_CCK2_11,0xffffff00 , tmpval);/* rf-B cck tx power */ tmpval = TxAGC[RF_PATH_B ] >>24 ; -PHY_SetBBReg (Adapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval); +rtl8188e_PHY_SetBBReg (Adapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval); tmpval = TxAGC[RF_PATH_B ] &0x00ffffff ; -PHY_SetBBReg (Adapter, rTxAGC_B_CCK1_55_Mcs32,0xffffff00 , tmpval); +rtl8188e_PHY_SetBBReg (Adapter, rTxAGC_B_CCK1_55_Mcs32,0xffffff00 , tmpval); }/* PHY_RF6052SetCckTxPower */ /* */
@@ -298,7 +298,7 @@ static void writeOFDMPowerReg88E(struct adapter *Adapter, u8 index, u32 *pValue)else regoffset = regoffset_b[index]; -PHY_SetBBReg (Adapter, regoffset, bMaskDWord, writeVal); +rtl8188e_PHY_SetBBReg (Adapter, regoffset, bMaskDWord, writeVal);/* 201005115 Joseph: Set Tx Power diff for Tx power training mechanism. */ if (regoffset == rTxAGC_A_Mcs07_Mcs04 || regoffset == rTxAGC_B_Mcs07_Mcs04) {
@@ -392,18 +392,18 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) u4RegValue =PHY_QueryBBReg (Adapter, pPhyReg->rfintfs, bRFSI_RFENV);/*----Set RF_ENV enable----*/ -PHY_SetBBReg (Adapter, pPhyReg->rfintfe, bRFSI_RFENV <<16 ,0x1 ); +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfintfe, bRFSI_RFENV <<16 ,0x1 );udelay (1 );/* PlatformStallExecution(1); */ /*----Set RF_ENV output high----*/ -PHY_SetBBReg (Adapter, pPhyReg->rfintfo, bRFSI_RFENV,0x1 ); +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfintfo, bRFSI_RFENV,0x1 );udelay (1 );/* PlatformStallExecution(1); */ /* Set bit number of Address and Data for RF register */ -PHY_SetBBReg (Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength,0x0 );/* Set 1 to 4 bits for 8255 */ +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength,0x0 );/* Set 1 to 4 bits for 8255 */ udelay (1 );/* PlatformStallExecution(1); */ -PHY_SetBBReg (Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength,0x0 );/* Set 0 to 12 bits for 8255 */ +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength,0x0 );/* Set 0 to 12 bits for 8255 */ udelay (1 );/* PlatformStallExecution(1); */ /*----Initialize RF fom connfiguration file----*/
@@ -411,7 +411,7 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) rtStatus = _FAIL;/*----Restore RFENV control type----*/ ; -PHY_SetBBReg (Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue); +rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);if (rtStatus != _SUCCESS) goto phy_RF6052_Config_ParaFile_Fail;
drivers/staging/r8188eu/hal/usb_halinit.c +3 -3
@@ -558,8 +558,8 @@ static void _BeaconFunctionEnable(struct adapter *Adapter,/* Set CCK and OFDM Block "ON" */ static void _BBTurnOnBlock (struct adapter *Adapter) { -PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bCCKEn,0x1 ); -PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bOFDMEn,0x1 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bCCKEn,0x1 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_RFMOD, bOFDMEn,0x1 ); }enum {
@@ -576,7 +576,7 @@ static void _InitAntenna_Selection(struct adapter *Adapter)DBG_88E ("==> %s ....\n" , __func__);rtw_write32 (Adapter,REG_LEDCFG0 ,rtw_read32 (Adapter,REG_LEDCFG0 ) |BIT (23 )); -PHY_SetBBReg (Adapter, rFPGA0_XAB_RFParameter,BIT (13 ),0x01 ); +rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_XAB_RFParameter,BIT (13 ),0x01 );if (PHY_QueryBBReg (Adapter, rFPGA0_XA_RFInterfaceOE,0x300 ) == Antenna_A) haldata->CurAntenna = Antenna_A;
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -2
@@ -136,7 +136,5 @@ void storePwrIndexDiffRateOffset(struct adapter *adapter, u32 regaddr,#define PHY_QueryBBReg (adapt, regaddr, mask) \ rtl8188e_PHY_QueryBBReg((adapt), (regaddr), (mask)) -#define PHY_SetBBReg (adapt, regaddr, bitmask, data) \ - rtl8188e_PHY_SetBBReg((adapt), (regaddr), (bitmask), (data))#endif /* __INC_HAL8192CPHYCFG_H */
Signature · 1 line
2.34.1
PATCH 6/12 staging: r8188eu: remove macro PHY_QueryBBReg
In reply to Michael StraubeThe macro PHY_QueryBBReg just re-defines rtl8188e_PHY_QueryBBReg(). Call rtl8188e_PHY_QueryBBReg() directly and remove the macro.
--- drivers/staging/r8188eu/hal/odm_interface.c | 4 ++-- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 12 ++++++------ drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 2 +- drivers/staging/r8188eu/hal/usb_halinit.c | 2 +- drivers/staging/r8188eu/include/Hal8188EPhyCfg.h | 3 --- 5 files changed, 10 insertions(+), 13 deletions(-)
drivers/staging/r8188eu/hal/odm_interface.c +2 -2
@@ -13,7 +13,7 @@ void ODM_SetMACReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask, u32u32 ODM_GetMACReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask) {struct adapter *Adapter = pDM_Odm->Adapter; -return PHY_QueryBBReg (Adapter, RegAddr, BitMask); +return rtl8188e_PHY_QueryBBReg (Adapter, RegAddr, BitMask); }void ODM_SetBBReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask,u32 Data)
@@ -25,7 +25,7 @@ void ODM_SetBBReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask, u32 Du32 ODM_GetBBReg (struct odm_dm_struct *pDM_Odm,u32 RegAddr,u32 BitMask) {struct adapter *Adapter = pDM_Odm->Adapter; -return PHY_QueryBBReg (Adapter, RegAddr, BitMask); +return rtl8188e_PHY_QueryBBReg (Adapter, RegAddr, BitMask); }void ODM_SetRFReg (struct odm_dm_struct *pDM_Odm,enum rf_radio_path eRFPath,u32 RegAddr,u32 BitMask,u32 Data)
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +6 -6
@@ -161,11 +161,11 @@ phy_RFSerialRead(/* For 92S LSSI Read RFLSSIRead */ /* For RF A/B write 0x824/82c(does not work in the future) */ /* We must use 0x824 for RF A and B to execute read trigger */ - tmplong =PHY_QueryBBReg (Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord); + tmplong =rtl8188e_PHY_QueryBBReg (Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord);if (eRFPath ==RF_PATH_A ) tmplong2 = tmplong;else - tmplong2 =PHY_QueryBBReg (Adapter, pPhyReg->rfHSSIPara2, bMaskDWord); + tmplong2 =rtl8188e_PHY_QueryBBReg (Adapter, pPhyReg->rfHSSIPara2, bMaskDWord); tmplong2 = (tmplong2 & (~bLSSIReadAddress)) | (NewOffset <<23 ) | bLSSIReadEdge;/* T65 RF */
@@ -178,14 +178,14 @@ phy_RFSerialRead(udelay (10 );/* PlatformStallExecution(10); */ if (eRFPath ==RF_PATH_A ) - RfPiEnable = (u8 )PHY_QueryBBReg (Adapter, rFPGA0_XA_HSSIParameter1,BIT (8 )); + RfPiEnable = (u8 )rtl8188e_PHY_QueryBBReg (Adapter, rFPGA0_XA_HSSIParameter1,BIT (8 ));else if (eRFPath ==RF_PATH_B ) - RfPiEnable = (u8 )PHY_QueryBBReg (Adapter, rFPGA0_XB_HSSIParameter1,BIT (8 )); + RfPiEnable = (u8 )rtl8188e_PHY_QueryBBReg (Adapter, rFPGA0_XB_HSSIParameter1,BIT (8 ));if (RfPiEnable) {/* Read from BBreg8b8, 12 bits for 8190, 20bits for T65 RF */ - retValue =PHY_QueryBBReg (Adapter, pPhyReg->rfLSSIReadBackPi, bLSSIReadBackData); + retValue =rtl8188e_PHY_QueryBBReg (Adapter, pPhyReg->rfLSSIReadBackPi, bLSSIReadBackData); }else {/* Read from BBreg8a0, 12 bits for 8190, 20 bits for T65 RF */ - retValue =PHY_QueryBBReg (Adapter, pPhyReg->rfLSSIReadBack, bLSSIReadBackData); + retValue =rtl8188e_PHY_QueryBBReg (Adapter, pPhyReg->rfLSSIReadBack, bLSSIReadBackData); }return retValue; }
drivers/staging/r8188eu/hal/rtl8188e_rf6052.c +1 -1
@@ -389,7 +389,7 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter) pPhyReg = &pHalData->PHYRegDef[eRFPath];/*----Store original RFENV control type----*/ - u4RegValue =PHY_QueryBBReg (Adapter, pPhyReg->rfintfs, bRFSI_RFENV); + u4RegValue =rtl8188e_PHY_QueryBBReg (Adapter, pPhyReg->rfintfs, bRFSI_RFENV);/*----Set RF_ENV enable----*/ rtl8188e_PHY_SetBBReg (Adapter, pPhyReg->rfintfe, bRFSI_RFENV <<16 ,0x1 );
drivers/staging/r8188eu/hal/usb_halinit.c +1 -1
@@ -578,7 +578,7 @@ static void _InitAntenna_Selection(struct adapter *Adapter)rtw_write32 (Adapter,REG_LEDCFG0 ,rtw_read32 (Adapter,REG_LEDCFG0 ) |BIT (23 ));rtl8188e_PHY_SetBBReg (Adapter, rFPGA0_XAB_RFParameter,BIT (13 ),0x01 ); -if (PHY_QueryBBReg (Adapter, rFPGA0_XA_RFInterfaceOE,0x300 ) == Antenna_A) +if (rtl8188e_PHY_QueryBBReg (Adapter, rFPGA0_XA_RFInterfaceOE,0x300 ) == Antenna_A) haldata->CurAntenna = Antenna_A;else haldata->CurAntenna = Antenna_B;
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -3
@@ -134,7 +134,4 @@ void storePwrIndexDiffRateOffset(struct adapter *adapter, u32 regaddr, u32 mask, u32 data);/*--------------------------Exported Function prototype---------------------*/ -#define PHY_QueryBBReg (adapt, regaddr, mask) \ - rtl8188e_PHY_QueryBBReg((adapt), (regaddr), (mask)) -#endif /* __INC_HAL8192CPHYCFG_H */
Signature · 1 line
2.34.1
PATCH 7/12 staging: r8188eu: remove duplicate defines
In reply to Michael StraubeThe following constants are defined in three different header files.
IQK_MAC_REG_NUMIQK_ADDA_REG_NUMIQK_BB_REG_NUMHP_THERMAL_NUM
Keep them in odm.h and remove them from Hal8188EPhyCfg.h and rtl8188e_dm.h.
--- drivers/staging/r8188eu/include/Hal8188EPhyCfg.h | 5 ----- drivers/staging/r8188eu/include/rtl8188e_dm.h | 7 +------ 2 files changed, 1 insertion(+), 11 deletions(-)
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -5
@@ -11,11 +11,6 @@#define MAX_TXPWR_IDX_NMODE_92S 63#define Reset_Cnt_Limit 3 -#define IQK_MAC_REG_NUM 4 -#define IQK_ADDA_REG_NUM 16 -#define IQK_BB_REG_NUM 9 -#define HP_THERMAL_NUM 8 -#define MAX_AGGR_NUM 0x07/*--------------------------Define Parameters-------------------------------*/
drivers/staging/r8188eu/include/rtl8188e_dm.h +1 -6
@@ -8,12 +8,7 @@ enum{ UP_LINK, DOWN_LINK, }; -/* duplicate code,will move to ODM ######### */ -#define IQK_MAC_REG_NUM 4 -#define IQK_ADDA_REG_NUM 16 -#define IQK_BB_REG_NUM 9 -#define HP_THERMAL_NUM 8 -/* duplicate code,will move to ODM ######### */ +struct dm_priv {u32 InitODMFlag;
Signature · 1 line
2.34.1
PATCH 8/12 staging: r8188eu: bWIFI_Direct is set but never used
In reply to Michael StraubebWIFI_Direct in odm_dm_struct is set but never used. Remove it.
--- drivers/staging/r8188eu/core/rtw_p2p.c | 3 --- drivers/staging/r8188eu/hal/odm.c | 3 --- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 3 --- drivers/staging/r8188eu/include/hal_intf.h | 1 - drivers/staging/r8188eu/include/odm.h | 2 -- 5 files changed, 12 deletions(-)
drivers/staging/r8188eu/core/rtw_p2p.c +0 -3
@@ -1944,7 +1944,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)/* Enable P2P function */ init_wifidirect_info (padapter, role); -rtl8188e_SetHalODMVar (padapter,HAL_ODM_P2P_STATE ,NULL , true); }else if (role ==P2P_ROLE_DISABLE ) {if (_FAIL ==rtw_pwr_wakeup (padapter)) { ret = _FAIL;
@@ -1963,8 +1962,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)memset (&pwdinfo->rx_prov_disc_info,0x00 ,sizeof (struct rx_provdisc_req_info )); } -rtl8188e_SetHalODMVar (padapter,HAL_ODM_P2P_STATE ,NULL , false); -/* Restore to initial setting. */ update_tx_basic_rate (padapter, padapter->registrypriv.wireless_mode); }
drivers/staging/r8188eu/hal/odm.c +0 -3
@@ -260,9 +260,6 @@ void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value)case ODM_CMNINFO_ABILITY : pDM_Odm->SupportAbility = (u32 )Value;break ; -case ODM_CMNINFO_WIFI_DIRECT : - pDM_Odm->bWIFI_Direct = (bool )Value; -break ;case ODM_CMNINFO_WIFI_DISPLAY : pDM_Odm->bWIFI_Display = (bool )Value;break ;
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +0 -3
@@ -874,9 +874,6 @@ void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVaria } }break ; -case HAL_ODM_P2P_STATE : -ODM_CmnInfoUpdate (podmpriv,ODM_CMNINFO_WIFI_DIRECT , bSet); -break ;case HAL_ODM_WIFI_DISPLAY_STATE :ODM_CmnInfoUpdate (podmpriv,ODM_CMNINFO_WIFI_DISPLAY , bSet);break ;
drivers/staging/r8188eu/include/hal_intf.h +0 -1
@@ -96,7 +96,6 @@ enum hal_def_variable {enum hal_odm_variable {HAL_ODM_STA_INFO , -HAL_ODM_P2P_STATE ,HAL_ODM_WIFI_DISPLAY_STATE , };
drivers/staging/r8188eu/include/odm.h +0 -2
@@ -230,7 +230,6 @@ enum odm_common_info_def {/* POINTER REFERENCE----------- */ /* CALL BY VALUE------------- */ -ODM_CMNINFO_WIFI_DIRECT ,ODM_CMNINFO_WIFI_DISPLAY ,ODM_CMNINFO_LINK , ODM_CMNINFO_RSSI_MIN,
@@ -480,7 +479,6 @@ struct odm_dm_struct {/* POINTER REFERENCE----------- */ /* */ /* CALL BY VALUE------------- */ -bool bWIFI_Direct;bool bWIFI_Display;bool bLinked;u8 RSSI_Min;
Signature · 1 line
2.34.1
PATCH 9/12 staging: r8188eu: bWIFI_Display is set but never used
In reply to Michael StraubebWIFI_Display in odm_dm_struct is set but never used. Remove it.
--- drivers/staging/r8188eu/hal/odm.c | 3 --- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 3 --- drivers/staging/r8188eu/include/hal_intf.h | 1 - drivers/staging/r8188eu/include/odm.h | 2 -- 4 files changed, 9 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -3
@@ -260,9 +260,6 @@ void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value)case ODM_CMNINFO_ABILITY : pDM_Odm->SupportAbility = (u32 )Value;break ; -case ODM_CMNINFO_WIFI_DISPLAY : - pDM_Odm->bWIFI_Display = (bool )Value; -break ;case ODM_CMNINFO_LINK : pDM_Odm->bLinked = (bool )Value;break ;
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +0 -3
@@ -874,9 +874,6 @@ void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVaria } }break ; -case HAL_ODM_WIFI_DISPLAY_STATE : -ODM_CmnInfoUpdate (podmpriv,ODM_CMNINFO_WIFI_DISPLAY , bSet); -break ;default :break ; }
drivers/staging/r8188eu/include/hal_intf.h +0 -1
@@ -96,7 +96,6 @@ enum hal_def_variable {enum hal_odm_variable {HAL_ODM_STA_INFO , -HAL_ODM_WIFI_DISPLAY_STATE , };typedef s32 (*c2h_id_filter )(u8 id);
drivers/staging/r8188eu/include/odm.h +0 -2
@@ -230,7 +230,6 @@ enum odm_common_info_def {/* POINTER REFERENCE----------- */ /* CALL BY VALUE------------- */ -ODM_CMNINFO_WIFI_DISPLAY ,ODM_CMNINFO_LINK ,ODM_CMNINFO_RSSI_MIN , ODM_CMNINFO_RF_ANTENNA_TYPE, /* u8 */
@@ -479,7 +478,6 @@ struct odm_dm_struct {/* POINTER REFERENCE----------- */ /* */ /* CALL BY VALUE------------- */ -bool bWIFI_Display;bool bLinked;u8 RSSI_Min;bool bIsMPChip;
Signature · 1 line
2.34.1
PATCH 10/12 staging: r8188eu: remove unused macro IS_FW_81xxC
In reply to Michael StraubeThe macro IS_FW_81xxC is not used. Remove it.
--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 -- 1 file changed, 2 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +0 -2
@@ -508,8 +508,6 @@ static s32 _FWFreeToGo(struct adapter *padapter)return _FAIL; } -#define IS_FW_81xxC (padapter) (((GET_HAL_DATA(padapter))->FirmwareSignature & 0xFFF0) == 0x88C0) -static int load_firmware (struct rt_firmware *pFirmware,struct device *device) {s32 rtStatus = _SUCCESS;
Signature · 1 line
2.34.1
PATCH 11/12 staging: r8188eu: remove macro GET_HAL_DATA
In reply to Michael StraubeThe field HalData of struct adapter is a void pointer and it is always casted to 'struct hal_data_8188e *' in this driver.
Covert the type of HalData to 'struct hal_data_8188e *' and replace the usages of the GET_HAL_DATA macro by using adapter->HalData directly.
Finally we can remove the GET_HAL_DATA macro.
--- drivers/staging/r8188eu/hal/HalPhyRf_8188e.c | 24 ++++----- drivers/staging/r8188eu/hal/odm.c | 6 +-- drivers/staging/r8188eu/hal/rtl8188e_cmd.c | 12 ++--- drivers/staging/r8188eu/hal/rtl8188e_dm.c | 14 +++--- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 18 +++---- drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 26 +++++----- drivers/staging/r8188eu/hal/rtl8188e_rf6052.c | 12 ++--- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 +- drivers/staging/r8188eu/hal/rtl8188eu_led.c | 2 +- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 4 +- drivers/staging/r8188eu/hal/usb_halinit.c | 50 +++++++++---------- drivers/staging/r8188eu/hal/usb_ops_linux.c | 4 +- drivers/staging/r8188eu/include/drv_types.h | 2 +- .../staging/r8188eu/include/rtl8188e_hal.h | 3 -- 14 files changed, 87 insertions(+), 92 deletions(-)
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c +12 -12
@@ -98,7 +98,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(struct adapter *Adapter ) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u8 ThermalValue =0 , delta, delta_LCK, delta_IQK, offset;u8 ThermalValue_AVG_count =0 ;u32 ThermalValue_AVG =0 ;
@@ -365,7 +365,7 @@ phy_PathA_IQK_8188E(struct adapter *adapt) {u32 regeac, regE94, regE9C;u8 result =0x00 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;/* 1 Tx IQK */
@@ -403,7 +403,7 @@ phy_PathA_RxIQK(struct adapter *adapt) {u32 regeac, regE94, regE9C, regEA4, u4tmp;u8 result =0x00 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;/* 1 Get TXIMR setting */
@@ -506,7 +506,7 @@ static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], u {u32 Oldval_0,X ,TX0_A , reg;s32 Y ,TX0_C ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;if (final_candidate ==0xFF ) {
@@ -549,7 +549,7 @@ static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], uvoid _PHY_SaveADDARegisters (struct adapter *adapt,u32 *ADDAReg,u32 *ADDABackup,u32 RegisterNum) {u32 i; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;for (i =0 ; i < RegisterNum; i++) {
@@ -574,7 +574,7 @@ static void _PHY_SaveMACRegisters(static void reload_adda_reg (struct adapter *adapt,u32 *ADDAReg,u32 *ADDABackup,u32 RegiesterNum) {u32 i; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;for (i =0 ; i < RegiesterNum; i++)
@@ -602,7 +602,7 @@ _PHY_PathADDAOn( u32 *ADDAReg) {u32 i; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;ODM_SetBBReg (dm_odm, ADDAReg[0 ], bMaskDWord,0x0b1b25a0 );
@@ -634,7 +634,7 @@ static void _PHY_PIModeSwitch( ) {u32 mode; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv; mode = PIMode ?0x01000100 :0x01000000 ;
@@ -723,7 +723,7 @@ static bool phy_SimularityCompare_8188E(static void phy_IQCalibrate_8188E (struct adapter *adapt,s32 result[][8 ],u8 t) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;u32 i;u8 PathAOK;
@@ -839,7 +839,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t) {u8 tmpreg;u32 RF_Amode =0 , RF_Bmode =0 , LC_Cal; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;/* Check continuous TX and Packet TX */
@@ -894,7 +894,7 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)void PHY_IQCalibrate_8188E (struct adapter *adapt,bool recovery) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;s32 result[4 ][8 ];/* last is final result */ u8 i, final_candidate;
@@ -1006,7 +1006,7 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt) {bool singletone = false, carrier_sup = false;u32 timeout =2000 , timecount =0 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (adapt); +struct hal_data_8188e *pHalData = adapt->HalData;struct odm_dm_struct *dm_odm = &pHalData->odmpriv;if (!(dm_odm->SupportAbility &ODM_RF_CALIBRATION ))
drivers/staging/r8188eu/hal/odm.c +3 -3
@@ -789,7 +789,7 @@ bool ODM_RAStateCheck(struct odm_dm_struct *pDM_Odm, s32 RSSI, bool bForceUpdatestatic void FindMinimumRSSI (struct adapter *pAdapter) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (pAdapter); +struct hal_data_8188e *pHalData = pAdapter->HalData;struct dm_priv *pdmpriv = &pHalData->dmpriv;struct mlme_priv *pmlmepriv = &pAdapter->mlmepriv;
@@ -804,7 +804,7 @@ static void FindMinimumRSSI(struct adapter *pAdapter)void odm_RSSIMonitorCheck (struct odm_dm_struct *pDM_Odm) {struct adapter *Adapter = pDM_Odm->Adapter; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;struct dm_priv *pdmpriv = &pHalData->dmpriv;int i;int tmpEntryMaxPWDB =0 , tmpEntryMinPWDB =0xff ;
@@ -928,7 +928,7 @@ void odm_EdcaTurboCheck(struct odm_dm_struct *pDM_Odm)u64 cur_tx_bytes =0 ;u64 cur_rx_bytes =0 ;u8 bbtchange = false; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;struct xmit_priv *pxmitpriv = &Adapter->xmitpriv;struct recv_priv *precvpriv = &Adapter->recvpriv;struct registry_priv *pregpriv = &Adapter->registrypriv;
drivers/staging/r8188eu/hal/rtl8188e_cmd.c +6 -6
@@ -49,7 +49,7 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 ElementID, u32 CmdLen, u8 *pu8 h2c_box_num;u32 msgbox_addr;u32 msgbox_ex_addr; -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;u8 cmd_idx, ext_cmd_len;u32 h2c_cmd =0 ;u32 h2c_cmd_ex =0 ;
@@ -104,7 +104,7 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask) {u8 buf[3 ];u8 res = _SUCCESS; -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;if (haldata->fw_ractrl) {__le32 lmask;
@@ -128,7 +128,7 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask)/* arg[5] = Short GI */ void rtl8188e_Add_RateATid (struct adapter *pAdapter,u32 bitmap,u8 arg,u8 rssi_level) { -struct hal_data_8188e *haldata =GET_HAL_DATA (pAdapter); +struct hal_data_8188e *haldata = pAdapter->HalData;u8 macid, raid, short_gi_rate = false;
@@ -461,7 +461,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)return ; } - haldata =GET_HAL_DATA (adapt); + haldata = adapt->HalData; pxmitpriv = &adapt->xmitpriv; pmlmeext = &adapt->mlmeextpriv; pmlmeinfo = &pmlmeext->mlmext_info;
@@ -547,7 +547,7 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)void rtl8188e_set_FwJoinBssReport_cmd (struct adapter *adapt,u8 mstatus) { -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;struct mlme_ext_priv *pmlmeext = &adapt->mlmeextpriv;struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;bool bSendBeacon = false;
@@ -642,7 +642,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)void rtl8188e_set_p2p_ps_offload_cmd (struct adapter *adapt,u8 p2p_ps_state) { -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;struct wifidirect_info *pwdinfo = &adapt->wdinfo;struct P2P_PS_Offload_t *p2p_ps_offload = &haldata->p2p_ps_offload;u8 i;
drivers/staging/r8188eu/hal/rtl8188e_dm.c +7 -7
@@ -24,7 +24,7 @@ static void dm_InitGPIOSetting(struct adapter *Adapter)/* */ static void Init_ODM_ComInfo_88E (struct adapter *Adapter) { -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;struct dm_priv *pdmpriv = &hal_data->dmpriv;struct odm_dm_struct *dm_odm = &hal_data->odmpriv;
@@ -48,7 +48,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv; -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;struct odm_dm_struct *dm_odm = &hal_data->odmpriv;struct dm_priv *pdmpriv = &hal_data->dmpriv;int i;
@@ -82,7 +82,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)void rtl8188e_InitHalDm (struct adapter *Adapter) { -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;struct odm_dm_struct *dm_odm = &hal_data->odmpriv;dm_InitGPIOSetting (Adapter);
@@ -94,7 +94,7 @@ void rtl8188e_InitHalDm(struct adapter *Adapter)void rtl8188e_HalDmWatchDog (struct adapter *Adapter) {u8 hw_init_completed = Adapter->hw_init_completed; -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;u8 bLinked = false;
@@ -116,7 +116,7 @@ void rtl8188e_HalDmWatchDog(struct adapter *Adapter)void rtl8188e_init_dm_priv (struct adapter *Adapter) { -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;struct dm_priv *pdmpriv = &hal_data->dmpriv;memset (pdmpriv,0 ,sizeof (struct dm_priv ));
@@ -127,7 +127,7 @@ void rtl8188e_init_dm_priv(struct adapter *Adapter)/* Compare RSSI for deciding antenna */ void AntDivCompare8188E (struct adapter *Adapter,struct wlan_bssid_ex *dst,struct wlan_bssid_ex *src) { -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;if (0 != hal_data->AntDivCfg) {/* select optimum_antenna for before linked =>For antenna diversity */
@@ -141,7 +141,7 @@ void AntDivCompare8188E(struct adapter *Adapter, struct wlan_bssid_ex *dst, stru/* Add new function to reset the state of antenna diversity before link. */ u8 AntDivBeforeLink8188E (struct adapter *Adapter) { -struct hal_data_8188e *hal_data =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data = Adapter->HalData;struct odm_dm_struct *dm_odm = &hal_data->odmpriv;struct sw_ant_switch *dm_swat_tbl = &dm_odm->DM_SWAT_Table;struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +8 -10
@@ -550,7 +550,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)s32 rtStatus = _SUCCESS;u8 writeFW_retry =0 ;u32 fwdl_start_time; -struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); +struct hal_data_8188e *pHalData = padapter->HalData;struct dvobj_priv *dvobj =adapter_to_dvobj (padapter);struct device *device =dvobj_to_dev (dvobj);struct rt_firmware_hdr *pFwHdr =NULL ;
@@ -626,7 +626,7 @@ s32 rtl8188e_FirmwareDownload(struct adapter *padapter)void rtl8188e_InitializeFirmwareVars (struct adapter *padapter) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); +struct hal_data_8188e *pHalData = padapter->HalData;/* Init Fw LPS related. */ padapter->pwrctrlpriv.bFwCurrentInPSMode = false;
@@ -837,9 +837,7 @@ void rtl8188e_read_chip_version(struct adapter *padapter) {u32 value32;struct HAL_VERSION ChipVersion; -struct hal_data_8188e *pHalData; - - pHalData =GET_HAL_DATA (padapter); +struct hal_data_8188e *pHalData = padapter->HalData; value32 =rtw_read32 (padapter,REG_SYS_CFG ); ChipVersion.ChipType = ((value32 &RTL_ID ) ?TEST_CHIP :NORMAL_CHIP );
@@ -855,7 +853,7 @@ void rtl8188e_read_chip_version(struct adapter *padapter)void rtl8188e_SetHalODMVar (struct adapter *Adapter,enum hal_odm_variable eVariable,void *pValue1,bool bSet) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;struct odm_dm_struct *podmpriv = &pHalData->odmpriv;switch (eVariable) {case HAL_ODM_STA_INFO :
@@ -1133,7 +1131,7 @@ void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLvoid Hal_ReadTxPowerInfo88E (struct adapter *padapter,u8 *PROMContent,bool AutoLoadFail) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); +struct hal_data_8188e *pHalData = padapter->HalData;struct txpowerinfo24g pwrInfo24G;u8 rfPath =0 ;u8 ch, group;
@@ -1182,7 +1180,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Autovoid Hal_EfuseParseXtal_8188E (struct adapter *pAdapter,u8 *hwinfo,bool AutoLoadFail) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (pAdapter); +struct hal_data_8188e *pHalData = pAdapter->HalData;if (!AutoLoadFail) { pHalData->CrystalCap = hwinfo[EEPROM_XTAL_88E ];
@@ -1207,7 +1205,7 @@ void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, bool Autovoid Hal_ReadAntennaDiversity88E (struct adapter *pAdapter,u8 *PROMContent,bool AutoLoadFail) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (pAdapter); +struct hal_data_8188e *pHalData = pAdapter->HalData;struct registry_priv *registry_par = &pAdapter->registrypriv;if (!AutoLoadFail) {
@@ -1239,7 +1237,7 @@ void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, boolvoid Hal_ReadThermalMeter_88E (struct adapter *Adapter,u8 *PROMContent,bool AutoloadFail) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;/* ThermalMeter from EEPROM */ if (!AutoloadFail)
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +13 -13
@@ -143,7 +143,7 @@ phy_RFSerialRead( ) {u32 retValue =0 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;struct bb_reg_def *pPhyReg = &pHalData->PHYRegDef[eRFPath];u32 NewOffset;u32 tmplong, tmplong2;
@@ -242,7 +242,7 @@ phy_RFSerialWrite( ) {u32 DataAndAddr =0 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;struct bb_reg_def *pPhyReg = &pHalData->PHYRegDef[eRFPath];u32 NewOffset;
@@ -355,7 +355,7 @@ rtl8188e_PHY_SetRFReg(*---------------------------------------------------------------------------*/ s32 PHY_MACConfig8188E (struct adapter *Adapter) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;int rtStatus = _SUCCESS;/* */
@@ -387,7 +387,7 @@ phy_InitBBRFRegisterDefinition(struct adapter *Adapter ) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;/* RF Interface Sowrtware Control */ pHalData->PHYRegDef[RF_PATH_A ].rfintfs = rFPGA0_XAB_RFInterfaceSW;/* 16 LSBs if read 32-bit from 0x870 */
@@ -464,7 +464,7 @@ phy_InitBBRFRegisterDefinition(void storePwrIndexDiffRateOffset (struct adapter *Adapter,u32 RegAddr,u32 BitMask,u32 Data) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;if (RegAddr == rTxAGC_A_Rate18_06) pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][0 ] = Data;
@@ -505,7 +505,7 @@ void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMastatic int phy_BB8188E_Config_ParaFile (struct adapter *Adapter) {struct eeprom_priv *pEEPROM = &Adapter->eeprompriv; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;int rtStatus = _SUCCESS;/* */
@@ -546,7 +546,7 @@ PHY_BBConfig8188E( ) {int rtStatus = _SUCCESS; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u32 RegVal;u8 CrystalCap;
@@ -585,7 +585,7 @@ static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPower u8 *ofdmPowerLevel, u8 *BW20PowerLevel, u8 *BW40PowerLevel) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u8 index = (channel -1 );/* 1. CCK */
@@ -603,7 +603,7 @@ static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerstatic void phy_PowerIndexCheck88E (struct adapter *Adapter,u8 channel,u8 *cckPowerLevel,u8 *ofdmPowerLevel,u8 *BW20PowerLevel,u8 *BW40PowerLevel) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData; pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0 ]; pHalData->CurrentOfdm24GTxPwrIdx = ofdmPowerLevel[0 ];
@@ -667,7 +667,7 @@ _PHY_SetBWMode92C(struct adapter *Adapter ) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u8 regBwOpMode;u8 regRRSR_RSC;
@@ -742,7 +742,7 @@ _PHY_SetBWMode92C(void PHY_SetBWMode8188E (struct adapter *Adapter,enum ht_channel_width Bandwidth,/* 20M or 40M */ unsigned char Offset)/* Upper, Lower, or Don't care */ { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;enum ht_channel_width tmpBW = pHalData->CurrentChannelBW; pHalData->CurrentChannelBW = Bandwidth;
@@ -759,7 +759,7 @@ static void _PHY_SwChnl8192C(struct adapter *Adapter, u8 channel) {u8 eRFPath =0 ;u32 param1, param2; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;if (Adapter->bNotifyChannelChange)DBG_88E ("[%s] ch = %d\n" , __func__, channel);
@@ -777,7 +777,7 @@ static void _PHY_SwChnl8192C(struct adapter *Adapter, u8 channel)void PHY_SwChnl8188E (struct adapter *Adapter,u8 channel) {/* Call after initialization */ -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;if (channel ==0 ) channel =1 ;
drivers/staging/r8188eu/hal/rtl8188e_rf6052.c +6 -6
@@ -46,7 +46,7 @@void rtl8188e_PHY_RF6052SetBandwidth (struct adapter *Adapter,enum ht_channel_width Bandwidth) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;switch (Bandwidth) {case HT_CHANNEL_WIDTH_20 :
@@ -84,7 +84,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(struct adapter *Adapter, u8 *pPowerlevel) { - struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter); + struct hal_data_8188e *pHalData = Adapter->HalData;struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;u32 TxAGC[2 ] = {0 ,0 }, tmpval =0 , pwrtrac_value;bool TurboScanOff = false;
@@ -166,7 +166,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(static void getpowerbase88e (struct adapter *Adapter,u8 *pPowerLevelOFDM,u8 *pPowerLevelBW20,u8 *pPowerLevelBW40,u8 Channel,u32 *OfdmBase,u32 *MCSBase) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u32 powerBase0, powerBase1;u8 i;
@@ -190,7 +190,7 @@ static void get_rx_power_val_by_reg(struct adapter *Adapter, u8 Channel, u8 index, u32 *powerBase0, u32 *powerBase1, u32 *pOutWriteVal) { - struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter); + struct hal_data_8188e *pHalData = Adapter->HalData;u8 i, chnlGroup =0 , pwr_diff_limit[4 ], customer_pwr_limit;s8 pwr_diff =0 ;u32 writeVal, customer_limit, rf;
@@ -349,7 +349,7 @@ rtl8188e_PHY_RF6052SetOFDMTxPower( u8 *pPowerLevelBW40, u8 Channel) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u32 writeVal[2 ], powerBase0[2 ], powerBase1[2 ], pwrtrac_value;u8 direction;u8 index =0 ;
@@ -379,7 +379,7 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(static int phy_RF6052_Config_ParaFile (struct adapter *Adapter) {struct bb_reg_def *pPhyReg; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *pHalData = Adapter->HalData;u32 u4RegValue =0 ;u8 eRFPath =0 ;int rtStatus = _SUCCESS;
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +1 -1
@@ -126,7 +126,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat {struct adapter *padapter = precvframe->adapter;struct rx_pkt_attrib *pattrib = &precvframe->attrib; -struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); +struct hal_data_8188e *pHalData = padapter->HalData;struct phy_info *pPHYInfo = &pattrib->phy_info;u8 *wlanhdr;struct odm_per_pkt_info pkt_info;
drivers/staging/r8188eu/hal/rtl8188eu_led.c +1 -1
@@ -36,7 +36,7 @@ void SwLedOn(struct adapter *padapter, struct LED_871x *pLed)void SwLedOff (struct adapter *padapter,struct LED_871x *pLed) {u8 LedCfg; -struct hal_data_8188e *pHalData =GET_HAL_DATA (padapter); +struct hal_data_8188e *pHalData = padapter->HalData;if (padapter->bSurpriseRemoved || padapter->bDriverStopped) goto exit;
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +2 -2
@@ -154,7 +154,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagu8 data_rate, pwr_status, offset;struct adapter *adapt = pxmitframe->padapter;struct pkt_attrib *pattrib = &pxmitframe->attrib; -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;struct tx_desc *ptxdesc = (struct tx_desc *)pmem;struct mlme_ext_priv *pmlmeext = &adapt->mlmeextpriv;struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -382,7 +382,7 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)s32 rtl8188eu_xmitframe_complete (struct adapter *adapt,struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitbuf) { -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;struct xmit_frame *pxmitframe =NULL ;struct xmit_frame *pfirstframe =NULL ;
drivers/staging/r8188eu/hal/usb_halinit.c +25 -25
197 lines not on this page · raw message
drivers/staging/r8188eu/hal/usb_ops_linux.c +2 -2
@@ -185,7 +185,7 @@ int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)static void interrupt_handler_8188eu (struct adapter *adapt,u16 pkt_len,u8 *pbuf) { -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;if (pkt_len !=INTERRUPT_MSG_FORMAT_LEN ) {DBG_88E ("%s Invalid interrupt content length (%d)!\n" , __func__, pkt_len);
@@ -213,7 +213,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)struct sk_buff *pkt_copy =NULL ;struct recv_frame *precvframe =NULL ;struct rx_pkt_attrib *pattrib =NULL ; -struct hal_data_8188e *haldata =GET_HAL_DATA (adapt); +struct hal_data_8188e *haldata = adapt->HalData;struct recv_priv *precvpriv = &adapt->recvpriv;struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
drivers/staging/r8188eu/include/drv_types.h +1 -1
@@ -205,7 +205,7 @@ struct adapter {struct hostapd_priv *phostapdpriv;struct wifidirect_info wdinfo; -void *HalData; +struct hal_data_8188e *HalData;u32 hal_data_sz;s32 bDriverStopped;
drivers/staging/r8188eu/include/rtl8188e_hal.h +0 -3
@@ -297,9 +297,6 @@ struct hal_data_8188e {u8 UsbRxAggPageTimeout; }; -#define GET_HAL_DATA (__pAdapter) \ - ((struct hal_data_8188e *)((__pAdapter)->HalData)) -/* rtl8188e_hal_init.c */ s32 rtl8188e_FirmwareDownload (struct adapter *padapter);void _8051Reset88E (struct adapter *padapter);
Signature · 1 line
2.34.1
PATCH 12/12 staging: r8188eu: hal_data_sz is set but never used
In reply to Michael Straubehal_data_sz in struct adapter is set but never used. Remove it.
--- drivers/staging/r8188eu/hal/usb_halinit.c | 1 - drivers/staging/r8188eu/include/drv_types.h | 1 - 2 files changed, 2 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -1
@@ -1969,5 +1969,4 @@ void rtl8188eu_alloc_haldata(struct adapter *adapt) adapt->HalData =kzalloc (sizeof (struct hal_data_8188e ),GFP_KERNEL );if (!adapt->HalData)DBG_88E ("cant not alloc memory for HAL DATA\n" ); - adapt->hal_data_sz =sizeof (struct hal_data_8188e ); }
drivers/staging/r8188eu/include/drv_types.h +0 -1
@@ -206,7 +206,6 @@ struct adapter {struct wifidirect_info wdinfo;struct hal_data_8188e *HalData; -u32 hal_data_sz;s32 bDriverStopped;s32 bSurpriseRemoved;
Signature · 1 line
2.34.1
Re: [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used
Quoted 13 lines · Michael Straube
hal_data_szin struct adapter is set but never used. Remove it.Signed-off-by Michael Straube <[email protected]>--- drivers/staging/r8188eu/hal/usb_halinit.c | 1 - drivers/staging/r8188eu/include/drv_types.h | 1 - 2 files changed, 2 deletions(-)drivers/staging/r8188eu/hal/usb_halinit.c +0
-0
drivers/staging/r8188eu/hal/usb_halinit.c void rtl8188eu_alloc_haldata(struct adapter *adapt) · line 1972
Quoted 5 lines
drivers/staging/r8188eu/hal/usb_halinit.c +0
-1@@ -1969,5 +1969,4 @@ void rtl8188eu_alloc_haldata(struct adapter *adapt) adapt->HalData =kzalloc (sizeof (struct hal_data_8188e ),GFP_KERNEL );if (!adapt->HalData)DBG_88E ("cant not alloc memory for HAL DATA\n" ); - adapt->hal_data_sz =sizeof (struct hal_data_8188e ); }
Not related to your patch, but not returning an error from this function
looks very dangerous to me.
adapt->HalData is used in GET_HAL_DATA() macro all across the driver code and nobody checks if it valid or not. If allocation fails here, than we will likely hit GPF while accessing hal_data fields.
Maybe we can embed struct hal_data_8188e instead of storing a pointer to it?
With regards,
Pavel Skripkin
Re: [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used
Quoted 9 lines · Pavel Skripkin
Quoted 8 lines · Michael Straube
hal_data_szin struct adapter is set but never used. Remove it.Signed-off-by Michael Straube <[email protected]>---
drivers/staging/r8188eu/hal/usb_halinit.c | 1 -drivers/staging/r8188eu/include/drv_types.h| 1 -2 files changed, 2 deletions(-)
Quoted 13 lines
drivers/staging/r8188eu/hal/usb_halinit.c void rtl8188eu_alloc_haldata(struct adapter *adapt) · line 1972
Quoted 10 lines
drivers/staging/r8188eu/hal/usb_halinit.c +0
-1@@ -1969,5 +1969,4 @@ void rtl8188eu_alloc_haldata(struct adapter *adapt) adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL); if (!adapt->HalData) DBG_88E("cant not alloc memory for HAL DATA\n"); - adapt->hal_data_sz = sizeof(struct hal_data_8188e); }Not related to your patch, but not returning an error from this function
looks very dangerous to me.
I agree.
Quoted 7 lines
adapt->HalDatais used inGET_HAL_DATA()macro all across the driver code and nobody checks if it valid or not. If allocation fails here, than we will likely hit GPF while accessinghal_datafields.Maybe we can embed struct
hal_data_8188einstead of storing a pointer to it?
We could remove rtl8188eu_alloc_haldata() completely and replace its usage in the function rtw_usb_if1_init().
drivers/staging/r8188eu/os_dep/usb_intf.c +3 -1
@@ -362,7 +362,9 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj, padapter =rtw_netdev_priv (pnetdev);/* step 2. allocate HalData */ -rtl8188eu_alloc_haldata (padapter); + padapter->HalData =kzalloc (sizeof (*padapter->HalData),GFP_KERNEL ); +if (!padapter->HalData) + goto handle_dualmac;
This way rtw_drv_init() would return -ENODEV if the allocation fails. What do you think?
Regards,
Michael
Re: [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used
In reply to Pavel SkripkinQuoted 23 lines · Pavel Skripkin
Quoted 13 lines · Michael Straube
hal_data_szin struct adapter is set but never used. Remove it.Signed-off-by Michael Straube <[email protected]>---
drivers/staging/r8188eu/hal/usb_halinit.c | 1 -drivers/staging/r8188eu/include/drv_types.h| 1 -2 files changed, 2 deletions(-)drivers/staging/r8188eu/hal/usb_halinit.c +0
-0drivers/staging/r8188eu/hal/usb_halinit.c void rtl8188eu_alloc_haldata(struct adapter *adapt) · line 1972
Quoted 5 lines
drivers/staging/r8188eu/hal/usb_halinit.c +0
-1@@ -1969,5 +1969,4 @@ void rtl8188eu_alloc_haldata(struct adapter *adapt) adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL); if (!adapt->HalData) DBG_88E("cant not alloc memory for HAL DATA\n"); - adapt->hal_data_sz = sizeof(struct hal_data_8188e); }Not related to your patch, but not returning an error from this function
looks very dangerous to me.
Quoted 3 lines
adapt->HalDatais used inGET_HAL_DATA()macro all across the driver code and nobody checks if it valid or not. If allocation fails here, than we will likely hit GPF while accessinghal_datafields.Maybe we can embed struct
hal_data_8188einstead of storing a pointer to it?
Rethinking my prevoius answer, embedding struct hal_data_8188e is the better solution I think.
Regards,
Michael
Re: [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used
Quoted 10 lines · Michael Straube
Quoted 6 lines
Not related to your patch, but not returning an error from this function
looks very dangerous to me.
adapt->HalDatais used inGET_HAL_DATA()macro all across the driver code and nobody checks if it valid or not. If allocation fails here, than we will likely hit GPF while accessinghal_datafields.Maybe we can embed struct
hal_data_8188einstead of storing a pointer to it?Rethinking my prevoius answer, embedding struct
hal_data_8188eis the better solution I think.
I also think so. At least, it looks like this is very core structure and embedding it into struct adapter sounds more reasonable.
Also, it is one step further to make struct adapter more consistent. For now it looks confusing: some of privs are pointers and others are not:
struct adapter {
...
struct dvobj_priv *dvobj; struct mlme_priv mlmepriv; struct mlme_ext_priv mlmeextpriv; struct cmd_priv cmdpriv; struct evt_priv evtpriv; struct io_priv iopriv; struct xmit_priv xmitpriv; struct recv_priv recvpriv; struct sta_priv stapriv; struct security_priv securitypriv; struct registry_priv registrypriv; struct pwrctrl_priv pwrctrlpriv; struct eeprom_priv eeprompriv; struct led_priv ledpriv; struct hostapd_priv *phostapdpriv; struct wifidirect_info wdinfo; void *HalData;
...
and even why Haldata is void *, but not struct hal_data_8188e * :)
so many questions and so few answers....
With regards,
Pavel Skripkin
Re: [PATCH 12/12] staging: r8188eu: hal_data_sz is set but never used
Am 05.12.21 um 18:23 schrieb Pavel Skripkin:
Quoted 3 lines
and even why Haldata is void *, but not struct
hal_data_8188e* :)
I guess it's void because they use the same code for other chips. And drivers for other chips perhaps use a different hal_data structure.
I'm working on embedding hal_data_8188e into the adapter structure instead of using a pointer.
...still much work to do to get rid of the hal layer entirely. ;)
Regards,
Michael