staging: rtl8188eu: Rework function phy_CalculateBitShift()
PATCH 1/20 staging: rtl8188eu: Rework function phy_CalculateBitShift()
Rename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 42 ++++------------------- 1 file changed, 6 insertions(+), 36 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +6 -36
@@ -24,48 +24,18 @@#include <rtw_iol.h> #include <rtl8188e_hal.h> -/*---------------------------Define Local Constant---------------------------*/ -/* Channel switch:The size of command tables for switch channel*/ #define MAX_PRECMD_CNT 16#define MAX_RFDEPENDCMD_CNT 16#define MAX_POSTCMD_CNT 16#define MAX_DOZE_WAITING_TIMES_9x 64 -/*---------------------------Define Local Constant---------------------------*/ - - -/*------------------------Define global variable-----------------------------*/ - -/*------------------------Define local variable------------------------------*/ - - -/*--------------------Define export function prototype-----------------------*/ -/* Please refer to header file */ -/*--------------------Define export function prototype-----------------------*/ - -/*----------------------------Function Body----------------------------------*/ -/* */ -/* 1. BB register R/W API */ -/* */ - -/** -* Function: phy_CalculateBitShift -* -* OverView: Get shifted position of the BitMask -* -* Input: -* u32 BitMask, -* -* Output: none -* Return: u32 Return the shift bit bit position of the mask -*/ -static u32 phy_CalculateBitShift (u32 BitMask) +static u32 cal_bit_shift (u32 bitmask) {u32 i;for (i =0 ; i <=31 ; i++) { -if (((BitMask>>i) &0x1 ) ==1 ) +if (((bitmask >> i) &0x1 ) ==1 )break ; }return i;
@@ -95,7 +65,7 @@ rtl8188e_PHY_QueryBBReg(u32 ReturnValue =0 , OriginalValue, BitShift; OriginalValue =usb_read32 (Adapter, RegAddr); - BitShift =phy_CalculateBitShift (BitMask); + BitShift =cal_bit_shift (BitMask); ReturnValue = (OriginalValue & BitMask) >> BitShift;return ReturnValue; }
@@ -125,7 +95,7 @@ void rtl8188e_PHY_SetBBReg(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u3if (BitMask != bMaskDWord) {/* if not "double word" write */ OriginalValue =usb_read32 (Adapter, RegAddr); - BitShift =phy_CalculateBitShift (BitMask); + BitShift =cal_bit_shift (BitMask); Data = ((OriginalValue & (~BitMask)) | (Data << BitShift)); }
@@ -310,7 +280,7 @@ u32 rtl8188e_PHY_QueryRFReg(struct adapter *Adapter, enum rf_radio_path eRFPath, Original_Value =phy_RFSerialRead (Adapter, eRFPath, RegAddr); - BitShift =phy_CalculateBitShift (BitMask); + BitShift =cal_bit_shift (BitMask); Readback_Value = (Original_Value & BitMask) >> BitShift;return Readback_Value; }
@@ -347,7 +317,7 @@ rtl8188e_PHY_SetRFReg(/* RF data is 12 bits only */ if (BitMask != bRFRegOffsetMask) { Original_Value =phy_RFSerialRead (Adapter, eRFPath, RegAddr); - BitShift =phy_CalculateBitShift (BitMask); + BitShift =cal_bit_shift (BitMask); Data = ((Original_Value & (~BitMask)) | (Data << BitShift)); }
Signature · 1 line
1.7.10.4
PATCH 2/20 staging: rtl8188eu: Remove unused wrapper function rtw_hal_read_bbreg()
--- drivers/staging/rtl8188eu/hal/hal_intf.c | 9 --------- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 1 - drivers/staging/rtl8188eu/include/hal_intf.h | 4 ---- 3 files changed, 14 deletions(-)
drivers/staging/rtl8188eu/hal/hal_intf.c +0 -9
@@ -256,15 +256,6 @@ void rtw_hal_add_ra_tid(struct adapter *adapt, u32 bitmap, u8 arg, rssi_level); } -u32 rtw_hal_read_bbreg (struct adapter *adapt,u32 regaddr,u32 bitmask) -{ -u32 data =0 ; - -if (adapt->HalFunc.read_bbreg) - data = adapt->HalFunc.read_bbreg (adapt, regaddr, bitmask); -return data; -} -void rtw_hal_write_bbreg (struct adapter *adapt,u32 regaddr,u32 bitmask,u32 data) {
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +0 -1
@@ -230,7 +230,6 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E; pHalFunc->AntDivCompareHandler = &AntDivCompare8188E; - pHalFunc->read_bbreg = &rtl8188e_PHY_QueryBBReg; pHalFunc->write_bbreg = &rtl8188e_PHY_SetBBReg; pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg; pHalFunc->write_rfreg = &rtl8188e_PHY_SetRFReg;
drivers/staging/rtl8188eu/include/hal_intf.h +0 -4
@@ -213,9 +213,6 @@ struct hal_ops { struct xmit_frame *pxmitframe);s32 (*mgnt_xmit)(struct adapter *padapter,struct xmit_frame *pmgntframe); - -u32 (*read_bbreg)(struct adapter *padapter,u32 RegAddr, -u32 BitMask);void (*write_bbreg)(struct adapter *padapter,u32 RegAddr,u32 BitMask,u32 Data); u32 (*read_rfreg)(struct adapter *padapter,
@@ -303,7 +300,6 @@ void rtw_hal_clone_data(struct adapter *dst_adapt,void rtw_hal_bcn_related_reg_setting (struct adapter *padapter); -u32 rtw_hal_read_bbreg (struct adapter *padapter,u32 RegAddr,u32 BitMask);void rtw_hal_write_bbreg (struct adapter *padapter,u32 RegAddr,u32 BitMask,u32 Data); u32 rtw_hal_read_rfreg(struct adapter *padapter, enum rf_radio_path eRFPath,
Signature · 1 line
1.7.10.4
PATCH 3/20 staging: rtl8188eu: Rework function PHY_QueryBBReg()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c | 8 +-- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 69 ++++++++++---------- drivers/staging/rtl8188eu/hal/odm.c | 31 ++++----- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 9 +-- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 44 ++++--------- drivers/staging/rtl8188eu/hal/usb_halinit.c | 2 +- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 3 - drivers/staging/rtl8188eu/include/phy.h | 2 + 8 files changed, 75 insertions(+), 93 deletions(-)
drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c +4 -4
@@ -245,13 +245,13 @@ static bool rf6052_conf_para(struct adapter *adapt)switch (rfpath) {case RF90_PATH_A :case RF90_PATH_C : - u4val =PHY_QueryBBReg (adapt, pphyreg->rfintfs, -BRFSI_RFENV ); + u4val =phy_query_bb_reg (adapt, pphyreg->rfintfs, +BRFSI_RFENV );break ;case RF90_PATH_B :case RF90_PATH_D : - u4val =PHY_QueryBBReg (adapt, pphyreg->rfintfs, -BRFSI_RFENV <<16 ); + u4val =phy_query_bb_reg (adapt, pphyreg->rfintfs, +BRFSI_RFENV <<16 );break ; }
drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +35 -34
186 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/odm.c +16 -15
@@ -21,6 +21,7 @@/* include files */ #include "odm_precomp.h" +#include "phy.h" static const u16 dB_Invert_Table[8 ][12 ] = { {1 ,1 ,1 ,2 ,2 ,2 ,2 ,3 ,3 ,3 ,4 ,4 },
@@ -429,8 +430,8 @@ void odm_CommonInfoSelfInit(struct odm_dm_struct *pDM_Odm) {struct adapter *adapter = pDM_Odm->Adapter; - pDM_Odm->bCckHighPower = (bool )PHY_QueryBBReg (adapter,0x824 ,BIT9 ); - pDM_Odm->RFPathRxEnable = (u8 )PHY_QueryBBReg (adapter,0xc04 ,0x0F ); + pDM_Odm->bCckHighPower = (bool )phy_query_bb_reg (adapter,0x824 ,BIT9 ); + pDM_Odm->RFPathRxEnable = (u8 )phy_query_bb_reg (adapter,0xc04 ,0x0F );ODM_InitDebugSetting (pDM_Odm); }
@@ -521,7 +522,7 @@ void odm_DIGInit(struct odm_dm_struct *pDM_Odm)struct adapter *adapter = pDM_Odm->Adapter;struct rtw_dig *pDM_DigTable = &pDM_Odm->DM_DigTable; - pDM_DigTable->CurIGValue = (u8 )PHY_QueryBBReg (adapter,ODM_REG_IGI_A_11N ,ODM_BIT_IGI_11N ); + pDM_DigTable->CurIGValue = (u8 )phy_query_bb_reg (adapter,ODM_REG_IGI_A_11N ,ODM_BIT_IGI_11N ); pDM_DigTable->RssiLowThresh =DM_DIG_THRESH_LOW ; pDM_DigTable->RssiHighThresh =DM_DIG_THRESH_HIGH ; pDM_DigTable->FALowThresh = DM_false_ALARM_THRESH_LOW;
@@ -736,23 +737,23 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)PHY_SetBBReg (adapter,ODM_REG_OFDM_FA_HOLDC_11N ,BIT31 ,1 );/* hold page C counter */ PHY_SetBBReg (adapter,ODM_REG_OFDM_FA_RSTD_11N ,BIT31 ,1 );/* hold page D counter */ - ret_value =PHY_QueryBBReg (adapter,ODM_REG_OFDM_FA_TYPE1_11N , bMaskDWord); + ret_value =phy_query_bb_reg (adapter,ODM_REG_OFDM_FA_TYPE1_11N , bMaskDWord); FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff ); FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000 )>>16 ); - ret_value =PHY_QueryBBReg (adapter,ODM_REG_OFDM_FA_TYPE2_11N , bMaskDWord); + ret_value =phy_query_bb_reg (adapter,ODM_REG_OFDM_FA_TYPE2_11N , bMaskDWord); FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff ); FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000 )>>16 ); - ret_value =PHY_QueryBBReg (adapter,ODM_REG_OFDM_FA_TYPE3_11N , bMaskDWord); + ret_value =phy_query_bb_reg (adapter,ODM_REG_OFDM_FA_TYPE3_11N , bMaskDWord); FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff ); FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000 )>>16 ); - ret_value =PHY_QueryBBReg (adapter,ODM_REG_OFDM_FA_TYPE4_11N , bMaskDWord); + ret_value =phy_query_bb_reg (adapter,ODM_REG_OFDM_FA_TYPE4_11N , bMaskDWord); FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff ); FalseAlmCnt->Cnt_Ofdm_fail = FalseAlmCnt->Cnt_Parity_Fail + FalseAlmCnt->Cnt_Rate_Illegal + FalseAlmCnt->Cnt_Crc8_fail + FalseAlmCnt->Cnt_Mcs_fail + FalseAlmCnt->Cnt_Fast_Fsync + FalseAlmCnt->Cnt_SB_Search_fail; - ret_value =PHY_QueryBBReg (adapter,ODM_REG_SC_CNT_11N , bMaskDWord); + ret_value =phy_query_bb_reg (adapter,ODM_REG_SC_CNT_11N , bMaskDWord); FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff ); FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000 )>>16 );
@@ -760,12 +761,12 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)PHY_SetBBReg (adapter,ODM_REG_CCK_FA_RST_11N ,BIT12 ,1 );PHY_SetBBReg (adapter,ODM_REG_CCK_FA_RST_11N ,BIT14 ,1 ); - ret_value =PHY_QueryBBReg (adapter,ODM_REG_CCK_FA_LSB_11N , bMaskByte0); + ret_value =phy_query_bb_reg (adapter,ODM_REG_CCK_FA_LSB_11N , bMaskByte0); FalseAlmCnt->Cnt_Cck_fail = ret_value; - ret_value =PHY_QueryBBReg (adapter,ODM_REG_CCK_FA_MSB_11N , bMaskByte3); + ret_value =phy_query_bb_reg (adapter,ODM_REG_CCK_FA_MSB_11N , bMaskByte3); FalseAlmCnt->Cnt_Cck_fail += (ret_value &0xff )<<8 ; - ret_value =PHY_QueryBBReg (adapter,ODM_REG_CCK_CCA_CNT_11N , bMaskDWord); + ret_value =phy_query_bb_reg (adapter,ODM_REG_CCK_CCA_CNT_11N , bMaskDWord); FalseAlmCnt->Cnt_CCK_CCA = ((ret_value&0xFF )<<8 ) | ((ret_value&0xFF00 )>>8 ); FalseAlmCnt->Cnt_all = (FalseAlmCnt->Cnt_Fast_Fsync +
@@ -849,10 +850,10 @@ void ODM_RF_Saving(struct odm_dm_struct *pDM_Odm, u8 bForceInNormal) Rssi_Low_bound =45 ; }if (pDM_PSTable->initialize ==0 ) { - pDM_PSTable->Reg874 = (PHY_QueryBBReg (adapter,0x874 , bMaskDWord)&0x1CC000 )>>14 ; - pDM_PSTable->RegC70 = (PHY_QueryBBReg (adapter,0xc70 , bMaskDWord)&BIT3 )>>3 ; - pDM_PSTable->Reg85C = (PHY_QueryBBReg (adapter,0x85c , bMaskDWord)&0xFF000000 )>>24 ; - pDM_PSTable->RegA74 = (PHY_QueryBBReg (adapter,0xa74 , bMaskDWord)&0xF000 )>>12 ; + pDM_PSTable->Reg874 = (phy_query_bb_reg (adapter,0x874 , bMaskDWord)&0x1CC000 )>>14 ; + pDM_PSTable->RegC70 = (phy_query_bb_reg (adapter,0xc70 , bMaskDWord)&BIT3 )>>3 ; + pDM_PSTable->Reg85C = (phy_query_bb_reg (adapter,0x85c , bMaskDWord)&0xFF000000 )>>24 ; + pDM_PSTable->RegA74 = (phy_query_bb_reg (adapter,0xa74 , bMaskDWord)&0xF000 )>>12 ; pDM_PSTable->initialize =1 ; }
drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +5 -4
@@ -19,6 +19,7 @@******************************************************************************/ #include "odm_precomp.h" +#include "phy.h" static void odm_RX_HWAntDivInit (struct odm_dm_struct *dm_odm) {
@@ -34,7 +35,7 @@ static void odm_RX_HWAntDivInit(struct odm_dm_struct *dm_odm)ODM_RT_TRACE (dm_odm,ODM_COMP_ANT_DIV ,ODM_DBG_LOUD , ("odm_RX_HWAntDivInit()\n" ));/* MAC Setting */ - value32 =PHY_QueryBBReg (adapter,ODM_REG_ANTSEL_PIN_11N , bMaskDWord); + value32 =phy_query_bb_reg (adapter,ODM_REG_ANTSEL_PIN_11N , bMaskDWord);PHY_SetBBReg (adapter,ODM_REG_ANTSEL_PIN_11N , bMaskDWord, value32|(BIT23 |BIT25 ));/* Reg4C[25]=1, Reg4C[23]=1 for pin output */ /* Pin Settings */ PHY_SetBBReg (adapter,ODM_REG_PIN_CTRL_11N ,BIT9 |BIT8 ,0 );/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
@@ -64,7 +65,7 @@ static void odm_TRX_HWAntDivInit(struct odm_dm_struct *dm_odm)ODM_RT_TRACE (dm_odm,ODM_COMP_ANT_DIV ,ODM_DBG_LOUD , ("odm_TRX_HWAntDivInit()\n" ));/* MAC Setting */ - value32 =PHY_QueryBBReg (adapter,ODM_REG_ANTSEL_PIN_11N , bMaskDWord); + value32 =phy_query_bb_reg (adapter,ODM_REG_ANTSEL_PIN_11N , bMaskDWord);PHY_SetBBReg (adapter,ODM_REG_ANTSEL_PIN_11N , bMaskDWord, value32|(BIT23 |BIT25 ));/* Reg4C[25]=1, Reg4C[23]=1 for pin output */ /* Pin Settings */ PHY_SetBBReg (adapter,ODM_REG_PIN_CTRL_11N ,BIT9 |BIT8 ,0 );/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
@@ -113,9 +114,9 @@ static void odm_FastAntTrainingInit(struct odm_dm_struct *dm_odm) dm_fat_tbl->FAT_State =FAT_NORMAL_STATE ;/* MAC Setting */ - value32 =PHY_QueryBBReg (adapter,0x4c , bMaskDWord); + value32 =phy_query_bb_reg (adapter,0x4c , bMaskDWord);PHY_SetBBReg (adapter,0x4c , bMaskDWord, value32|(BIT23 |BIT25 ));/* Reg4C[25]=1, Reg4C[23]=1 for pin output */ - value32 =PHY_QueryBBReg (adapter,0x7B4 , bMaskDWord); + value32 =phy_query_bb_reg (adapter,0x7B4 , bMaskDWord);PHY_SetBBReg (adapter,0x7b4 , bMaskDWord, value32|(BIT16 |BIT17 ));/* Reg7B4[16]=1 enable antenna training, Reg7B4[17]=1 enable A2 match */ /* Match MAC ADDR */
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +12 -32
73 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/usb_halinit.c +1 -1
@@ -633,7 +633,7 @@ static void _InitAntenna_Selection(struct adapter *Adapter)usb_write32 (Adapter,REG_LEDCFG0 ,usb_read32 (Adapter,REG_LEDCFG0 )|BIT23 );PHY_SetBBReg (Adapter, rFPGA0_XAB_RFParameter,BIT13 ,0x01 ); -if (PHY_QueryBBReg (Adapter, rFPGA0_XA_RFInterfaceOE,0x300 ) == Antenna_A) +if (phy_query_bb_reg (Adapter, rFPGA0_XA_RFInterfaceOE,0x300 ) == Antenna_A) haldata->CurAntenna = Antenna_A;else haldata->CurAntenna = Antenna_B;
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -3
@@ -198,7 +198,6 @@ struct ant_sel_cck {/* */ /* BB and RF register read/write */ /* */ -u32 rtl8188e_PHY_QueryBBReg (struct adapter *adapter,u32 regaddr,u32 mask);void rtl8188e_PHY_SetBBReg (struct adapter *Adapter,u32 RegAddr,u32 mask,u32 data); u32 rtl8188e_PHY_QueryRFReg(struct adapter *adapter, enum rf_radio_path rfpath,
@@ -235,8 +234,6 @@ bool SetAntennaConfig92C(struct adapter *adapter, u8 defaultant);/*--------------------------Exported Function prototype---------------------*/ -#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))#define PHY_QueryRFReg (adapt, rfpath, regaddr, bitmask) \
drivers/staging/rtl8188eu/include/phy.h +2 -0
@@ -1,3 +1,5 @@bool rtl88eu_phy_mac_config (struct adapter *adapt);bool rtl88eu_phy_rf_config (struct adapter *adapt);bool rtl88eu_phy_bb_config (struct adapter *adapt); + +u32 phy_query_bb_reg (struct adapter *adapt,u32 regaddr,u32 bitmask);
Signature · 1 line
1.7.10.4
Greg KH
maintainerRe: [PATCH 03/20] staging: rtl8188eu: Rework function PHY_QueryBBReg()
Quoted 3 lines · navin patidar
Rename CamelCase variables and function name.
Signed-off-by navin patidar <[email protected]>
This patch fails to apply:
checking file drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c checking file drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c checking file drivers/staging/rtl8188eu/hal/odm.c checking file drivers/staging/rtl8188eu/hal/odm_RTL8188E.c checking file drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c checking file drivers/staging/rtl8188eu/hal/usb_halinit.c checking file drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h checking file drivers/staging/rtl8188eu/include/phy.h Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED
Can you please refresh it against my staging-next branch of the staging.git tree on git.kernel.org and resend it, and the rest of the patches in this series so that I can apply them?
thanks,
greg k-h
Re: [PATCH 03/20] staging: rtl8188eu: Rework function PHY_QueryBBReg()
Quoted 18 lines · Greg KH
Quoted 3 lines · navin patidar
Rename CamelCase variables and function name.
Signed-off-by navin patidar <[email protected]>This patch fails to apply:
checking file
drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.cchecking filedrivers/staging/rtl8188eu/hal/HalPhyRf_8188e.cchecking filedrivers/staging/rtl8188eu/hal/odm.cchecking filedrivers/staging/rtl8188eu/hal/odm_RTL8188E.cchecking filedrivers/staging/rtl8188eu/hal/rtl8188e_phycfg.cchecking filedrivers/staging/rtl8188eu/hal/usb_halinit.cchecking filedrivers/staging/rtl8188eu/include/Hal8188EPhyCfg.hchecking filedrivers/staging/rtl8188eu/include/phy.hHunk #1 FAILED at 1.
1 out of 1 hunk FAILED
Quoted 3 lines
Can you please refresh it against my staging-next branch of the staging.git tree on git.kernel.org and resend it, and the rest of the patches in this series so that I can apply them?
I've sent v2 of the rest of the patches in this series.
regards,
--navin-patidar
PATCH 4/20 staging: rtl8188eu: Remove unused wrapper function rtw_hal_write_bbreg()
In reply to navin patidar--- drivers/staging/rtl8188eu/hal/hal_intf.c | 7 ------- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 1 - drivers/staging/rtl8188eu/include/hal_intf.h | 4 ---- 3 files changed, 12 deletions(-)
drivers/staging/rtl8188eu/hal/hal_intf.c +0 -7
@@ -256,13 +256,6 @@ void rtw_hal_add_ra_tid(struct adapter *adapt, u32 bitmap, u8 arg, rssi_level); } -void rtw_hal_write_bbreg (struct adapter *adapt,u32 regaddr,u32 bitmask, -u32 data) -{ -if (adapt->HalFunc.write_bbreg) - adapt->HalFunc.write_bbreg (adapt, regaddr, bitmask, data); -} -u32 rtw_hal_read_rfreg (struct adapter *adapt,enum rf_radio_path rfpath,u32 regaddr,u32 bitmask) {
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +0 -1
@@ -230,7 +230,6 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E; pHalFunc->AntDivCompareHandler = &AntDivCompare8188E; - pHalFunc->write_bbreg = &rtl8188e_PHY_SetBBReg; pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg; pHalFunc->write_rfreg = &rtl8188e_PHY_SetRFReg;
drivers/staging/rtl8188eu/include/hal_intf.h +0 -4
@@ -213,8 +213,6 @@ struct hal_ops { struct xmit_frame *pxmitframe);s32 (*mgnt_xmit)(struct adapter *padapter,struct xmit_frame *pmgntframe); -void (*write_bbreg)(struct adapter *padapter,u32 RegAddr, -u32 BitMask,u32 Data);u32 (*read_rfreg)(struct adapter *padapter,enum rf_radio_path eRFPath,u32 RegAddr,u32 BitMask);
@@ -300,8 +298,6 @@ void rtw_hal_clone_data(struct adapter *dst_adapt,void rtw_hal_bcn_related_reg_setting (struct adapter *padapter); -void rtw_hal_write_bbreg (struct adapter *padapter,u32 RegAddr,u32 BitMask, -u32 Data);u32 rtw_hal_read_rfreg (struct adapter *padapter,enum rf_radio_path eRFPath,u32 RegAddr,u32 BitMask); void rtw_hal_write_rfreg(struct adapter *padapter,
Signature · 1 line
1.7.10.4
PATCH 5/20 staging: rtl8188eu: Rework function PHY_SetBBReg()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c | 6 +- drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c | 16 +- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 176 ++++++++++---------- drivers/staging/rtl8188eu/hal/odm.c | 34 ++-- drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 144 ++++++++-------- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 53 ++---- drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c | 12 +- drivers/staging/rtl8188eu/hal/usb_halinit.c | 6 +- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 4 - drivers/staging/rtl8188eu/include/phy.h | 1 + 10 files changed, 216 insertions(+), 236 deletions(-)
drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c +3 -3
@@ -174,7 +174,7 @@ static bool set_baseband_agc_config(struct adapter *adapt)u32 v2 = array[i+1 ];if (v1 <0xCDCDCDCD ){ -PHY_SetBBReg (adapt, v1, bMaskDWord, v2); +phy_set_bb_reg (adapt, v1, bMaskDWord, v2);udelay (1 ); } }
@@ -392,7 +392,7 @@ static void rtl_bb_delay(struct adapter *adapt, u32 addr, u32 data) }else if (addr ==0xf9 ) {udelay (1 ); }else { -PHY_SetBBReg (adapt, addr, bMaskDWord, data); +phy_set_bb_reg (adapt, addr, bMaskDWord, data);/* Add 1us delay between BB/RF register setting. */ udelay (1 ); }
@@ -709,7 +709,7 @@ bool rtl88eu_phy_bb_config(struct adapter *adapt)/* write 0x24[16:11] = 0x24[22:17] = crystal_cap */ crystal_cap = hal_data->CrystalCap &0x3F ; -PHY_SetBBReg (adapt,REG_AFE_XTAL_CTRL ,0x7ff800 , (crystal_cap | (crystal_cap <<6 ))); +phy_set_bb_reg (adapt,REG_AFE_XTAL_CTRL ,0x7ff800 , (crystal_cap | (crystal_cap <<6 )));return rtstatus; }
drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c +9 -7
@@ -255,17 +255,18 @@ static bool rf6052_conf_para(struct adapter *adapt)break ; } -PHY_SetBBReg (adapt, pphyreg->rfintfe,BRFSI_RFENV <<16 ,0x1 ); +phy_set_bb_reg (adapt, pphyreg->rfintfe,BRFSI_RFENV <<16 ,0x1 );udelay (1 ); -PHY_SetBBReg (adapt, pphyreg->rfintfo,BRFSI_RFENV ,0x1 ); +phy_set_bb_reg (adapt, pphyreg->rfintfo,BRFSI_RFENV ,0x1 );udelay (1 ); -PHY_SetBBReg (adapt, pphyreg->rfHSSIPara2, +phy_set_bb_reg (adapt, pphyreg->rfHSSIPara2,B3WIREADDREAALENGTH ,0x0 );udelay (1 ); -PHY_SetBBReg (adapt, pphyreg->rfHSSIPara2,B3WIREDATALENGTH ,0x0 ); +phy_set_bb_reg (adapt, pphyreg->rfHSSIPara2, +B3WIREDATALENGTH ,0x0 );udelay (1 );switch (rfpath) {
@@ -284,12 +285,13 @@ static bool rf6052_conf_para(struct adapter *adapt)switch (rfpath) {case RF90_PATH_A :case RF90_PATH_C : -PHY_SetBBReg (adapt, pphyreg->rfintfs,BRFSI_RFENV , u4val); +phy_set_bb_reg (adapt, pphyreg->rfintfs, +BRFSI_RFENV , u4val);break ;case RF90_PATH_B :case RF90_PATH_D : -PHY_SetBBReg (adapt, pphyreg->rfintfs,BRFSI_RFENV <<16 , - u4val); +phy_set_bb_reg (adapt, pphyreg->rfintfs, +BRFSI_RFENV <<16 , u4val);break ; }
drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +88 -88
382 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/odm.c +17 -17
@@ -512,7 +512,7 @@ void ODM_Write_DIG(struct odm_dm_struct *pDM_Odm, u8 CurrentIGI)struct adapter *adapter = pDM_Odm->Adapter;if (pDM_DigTable->CurIGValue != CurrentIGI) { -PHY_SetBBReg (adapter,ODM_REG_IGI_A_11N ,ODM_BIT_IGI_11N , CurrentIGI); +phy_set_bb_reg (adapter,ODM_REG_IGI_A_11N ,ODM_BIT_IGI_11N , CurrentIGI); pDM_DigTable->CurIGValue = CurrentIGI; } }
@@ -734,8 +734,8 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)return ;/* hold ofdm counter */ -PHY_SetBBReg (adapter,ODM_REG_OFDM_FA_HOLDC_11N ,BIT31 ,1 );/* hold page C counter */ -PHY_SetBBReg (adapter,ODM_REG_OFDM_FA_RSTD_11N ,BIT31 ,1 );/* hold page D counter */ +phy_set_bb_reg (adapter,ODM_REG_OFDM_FA_HOLDC_11N ,BIT31 ,1 );/* hold page C counter */ +phy_set_bb_reg (adapter,ODM_REG_OFDM_FA_RSTD_11N ,BIT31 ,1 );/* hold page D counter */ ret_value =phy_query_bb_reg (adapter,ODM_REG_OFDM_FA_TYPE1_11N , bMaskDWord); FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff );
@@ -758,8 +758,8 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm) FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000 )>>16 );/* hold cck counter */ -PHY_SetBBReg (adapter,ODM_REG_CCK_FA_RST_11N ,BIT12 ,1 ); -PHY_SetBBReg (adapter,ODM_REG_CCK_FA_RST_11N ,BIT14 ,1 ); +phy_set_bb_reg (adapter,ODM_REG_CCK_FA_RST_11N ,BIT12 ,1 ); +phy_set_bb_reg (adapter,ODM_REG_CCK_FA_RST_11N ,BIT14 ,1 ); ret_value =phy_query_bb_reg (adapter,ODM_REG_CCK_FA_LSB_11N , bMaskByte0); FalseAlmCnt->Cnt_Cck_fail = ret_value;
@@ -879,19 +879,19 @@ void ODM_RF_Saving(struct odm_dm_struct *pDM_Odm, u8 bForceInNormal)if (pDM_PSTable->PreRFState != pDM_PSTable->CurRFState) {if (pDM_PSTable->CurRFState == RF_Save) { -PHY_SetBBReg (adapter,0x874 ,0x1C0000 ,0x2 );/* Reg874[20:18]=3'b010 */ -PHY_SetBBReg (adapter,0xc70 ,BIT3 ,0 );/* RegC70[3]=1'b0 */ -PHY_SetBBReg (adapter,0x85c ,0xFF000000 ,0x63 );/* Reg85C[31:24]=0x63 */ -PHY_SetBBReg (adapter,0x874 ,0xC000 ,0x2 );/* Reg874[15:14]=2'b10 */ -PHY_SetBBReg (adapter,0xa74 ,0xF000 ,0x3 );/* RegA75[7:4]=0x3 */ -PHY_SetBBReg (adapter,0x818 ,BIT28 ,0x0 );/* Reg818[28]=1'b0 */ -PHY_SetBBReg (adapter,0x818 ,BIT28 ,0x1 );/* Reg818[28]=1'b1 */ +phy_set_bb_reg (adapter,0x874 ,0x1C0000 ,0x2 );/* Reg874[20:18]=3'b010 */ +phy_set_bb_reg (adapter,0xc70 ,BIT3 ,0 );/* RegC70[3]=1'b0 */ +phy_set_bb_reg (adapter,0x85c ,0xFF000000 ,0x63 );/* Reg85C[31:24]=0x63 */ +phy_set_bb_reg (adapter,0x874 ,0xC000 ,0x2 );/* Reg874[15:14]=2'b10 */ +phy_set_bb_reg (adapter,0xa74 ,0xF000 ,0x3 );/* RegA75[7:4]=0x3 */ +phy_set_bb_reg (adapter,0x818 ,BIT28 ,0x0 );/* Reg818[28]=1'b0 */ +phy_set_bb_reg (adapter,0x818 ,BIT28 ,0x1 );/* Reg818[28]=1'b1 */ }else { -PHY_SetBBReg (adapter,0x874 ,0x1CC000 , pDM_PSTable->Reg874); -PHY_SetBBReg (adapter,0xc70 ,BIT3 , pDM_PSTable->RegC70); -PHY_SetBBReg (adapter,0x85c ,0xFF000000 , pDM_PSTable->Reg85C); -PHY_SetBBReg (adapter,0xa74 ,0xF000 , pDM_PSTable->RegA74); -PHY_SetBBReg (adapter,0x818 ,BIT28 ,0x0 ); +phy_set_bb_reg (adapter,0x874 ,0x1CC000 , pDM_PSTable->Reg874); +phy_set_bb_reg (adapter,0xc70 ,BIT3 , pDM_PSTable->RegC70); +phy_set_bb_reg (adapter,0x85c ,0xFF000000 , pDM_PSTable->Reg85C); +phy_set_bb_reg (adapter,0xa74 ,0xF000 , pDM_PSTable->RegA74); +phy_set_bb_reg (adapter,0x818 ,BIT28 ,0x0 ); } pDM_PSTable->PreRFState = pDM_PSTable->CurRFState; }
drivers/staging/rtl8188eu/hal/odm_RTL8188E.c +72 -72
227 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +17 -36
89 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c +6 -6
@@ -43,7 +43,7 @@#include <osdep_service.h> #include <drv_types.h> - +#include <phy.h> #include <rtl8188e_hal.h> /*-----------------------------------------------------------------------------
@@ -182,15 +182,15 @@ i * Currently, we cannot fully disable driver dynamic/* rf-A cck tx power */ tmpval = TxAGC[RF_PATH_A ]&0xff ; -PHY_SetBBReg (Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval); +phy_set_bb_reg (Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval); tmpval = TxAGC[RF_PATH_A ]>>8 ; -PHY_SetBBReg (Adapter, rTxAGC_B_CCK11_A_CCK2_11,0xffffff00 , tmpval); +phy_set_bb_reg (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); +phy_set_bb_reg (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); +phy_set_bb_reg (Adapter, rTxAGC_B_CCK1_55_Mcs32,0xffffff00 , tmpval); }/* PHY_RF6052SetCckTxPower */ /* */
@@ -349,7 +349,7 @@ static void writeOFDMPowerReg88E(struct adapter *Adapter, u8 index, u32 *pValue)else regoffset = regoffset_b[index]; -PHY_SetBBReg (Adapter, regoffset, bMaskDWord, writeVal); +phy_set_bb_reg (Adapter, regoffset, bMaskDWord, writeVal);/* 201005115 Joseph: Set Tx Power diff for Tx power training mechanism. */ if (((pHalData->rf_type == RF_2T2R) &&
drivers/staging/rtl8188eu/hal/usb_halinit.c +3 -3
@@ -613,8 +613,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 ); +phy_set_bb_reg (Adapter, rFPGA0_RFMOD, bCCKEn,0x1 ); +phy_set_bb_reg (Adapter, rFPGA0_RFMOD, bOFDMEn,0x1 ); }enum {
@@ -631,7 +631,7 @@ static void _InitAntenna_Selection(struct adapter *Adapter)DBG_88E ("==> %s ....\n" , __func__);usb_write32 (Adapter,REG_LEDCFG0 ,usb_read32 (Adapter,REG_LEDCFG0 )|BIT23 ); -PHY_SetBBReg (Adapter, rFPGA0_XAB_RFParameter,BIT13 ,0x01 ); +phy_set_bb_reg (Adapter, rFPGA0_XAB_RFParameter,BIT13 ,0x01 );if (phy_query_bb_reg (Adapter, rFPGA0_XA_RFInterfaceOE,0x300 ) == Antenna_A) haldata->CurAntenna = Antenna_A;
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -4
@@ -198,8 +198,6 @@ struct ant_sel_cck {/* */ /* BB and RF register read/write */ /* */ -void rtl8188e_PHY_SetBBReg (struct adapter *Adapter,u32 RegAddr, -u32 mask,u32 data);u32 rtl8188e_PHY_QueryRFReg (struct adapter *adapter,enum rf_radio_path rfpath,u32 regaddr,u32 mask); void rtl8188e_PHY_SetRFReg(struct adapter *adapter, enum rf_radio_path rfpath,
@@ -234,8 +232,6 @@ bool SetAntennaConfig92C(struct adapter *adapter, u8 defaultant);/*--------------------------Exported Function prototype---------------------*/ -#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))#define PHY_SetRFReg (adapt, rfpath, regaddr, bitmask, data) \
drivers/staging/rtl8188eu/include/phy.h +1 -0
@@ -3,3 +3,4 @@ bool rtl88eu_phy_rf_config(struct adapter *adapt);bool rtl88eu_phy_bb_config (struct adapter *adapt);u32 phy_query_bb_reg (struct adapter *adapt,u32 regaddr,u32 bitmask); +void phy_set_bb_reg (struct adapter *adapt,u32 regaddr,u32 bitmask,u32 data);
Signature · 1 line
1.7.10.4
PATCH 6/20 staging: rtl8188eu: Rework function phy_RFSerialRead()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 99 ++++++++--------------- 1 file changed, 34 insertions(+), 65 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +34 -65
@@ -64,81 +64,50 @@ void phy_set_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask, u32 data)usb_write32 (adapt, regaddr, data); } -/* */ -/* 2. RF register R/W API */ -/* */ -/** -* Function: phy_RFSerialRead -* -* OverView: Read regster from RF chips -* -* Input: -* struct adapter *Adapter, -* enum rf_radio_path eRFPath, Radio path of A/B/C/D -* u32 Offset, The target address to be read -* -* Output: None -* Return: u32 reback value -* Note: Threre are three types of serial operations: -* 1. Software serial write -* 2. Hardware LSSI-Low Speed Serial Interface -* 3. Hardware HSSI-High speed -* serial write. Driver need to implement (1) and (2). -* This function is equal to the combination of RF_ReadReg() and RFLSSIRead() -*/ -static u32 -phy_RFSerialRead ( -struct adapter *Adapter, -enum rf_radio_path eRFPath, -u32 Offset - ) +static u32 rf_serial_read (struct adapter *adapt, +enum rf_radio_path rfpath,u32 offset) { -u32 retValue =0 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); -struct bb_reg_def *pPhyReg = &pHalData->PHYRegDef[eRFPath]; -u32 NewOffset; +u32 ret =0 ; +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); +struct bb_reg_def *phyreg = &hal_data->PHYRegDef[rfpath]; +u32 newoffset;u32 tmplong, tmplong2; -u8 RfPiEnable =0 ; -/* */ -/* Make sure RF register offset is correct */ -/* */ - Offset &=0xff ; +u8 rfpi_enable =0 ; -/* */ -/* Switch page for 8256 RF IC */ -/* */ - NewOffset = Offset; + offset &=0xff ; + newoffset = offset; -/* 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_query_bb_reg (Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord); -if (eRFPath ==RF_PATH_A ) + tmplong =phy_query_bb_reg (adapt, rFPGA0_XA_HSSIParameter2, bMaskDWord); +if (rfpath ==RF_PATH_A ) tmplong2 = tmplong;else - tmplong2 =phy_query_bb_reg (Adapter, pPhyReg->rfHSSIPara2, bMaskDWord); + tmplong2 =phy_query_bb_reg (adapt, phyreg->rfHSSIPara2, + bMaskDWord); - tmplong2 = (tmplong2 & (~bLSSIReadAddress)) | (NewOffset<<23 ) | bLSSIReadEdge;/* T65 RF */ + tmplong2 = (tmplong2 & (~bLSSIReadAddress)) | + (newoffset<<23 ) | bLSSIReadEdge; -phy_set_bb_reg (Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord, tmplong&(~bLSSIReadEdge)); -udelay (10 );/* PlatformStallExecution(10); */ +phy_set_bb_reg (adapt, rFPGA0_XA_HSSIParameter2, bMaskDWord, + tmplong&(~bLSSIReadEdge)); +udelay (10 ); -phy_set_bb_reg (Adapter, pPhyReg->rfHSSIPara2, bMaskDWord, tmplong2); -udelay (100 );/* PlatformStallExecution(100); */ +phy_set_bb_reg (adapt, phyreg->rfHSSIPara2, bMaskDWord, tmplong2); +udelay (100 ); -udelay (10 );/* PlatformStallExecution(10); */ +udelay (10 ); -if (eRFPath ==RF_PATH_A ) - RfPiEnable = (u8 )phy_query_bb_reg (Adapter, rFPGA0_XA_HSSIParameter1,BIT8 ); -else if (eRFPath ==RF_PATH_B ) - RfPiEnable = (u8 )phy_query_bb_reg (Adapter, rFPGA0_XB_HSSIParameter1,BIT8 ); +if (rfpath ==RF_PATH_A ) + rfpi_enable = (u8 )phy_query_bb_reg (adapt, rFPGA0_XA_HSSIParameter1,BIT8 ); +else if (rfpath ==RF_PATH_B ) + rfpi_enable = (u8 )phy_query_bb_reg (adapt, rFPGA0_XB_HSSIParameter1,BIT8 ); -if (RfPiEnable) {/* Read from BBreg8b8, 12 bits for 8190, 20bits for T65 RF */ - retValue =phy_query_bb_reg (Adapter, pPhyReg->rfLSSIReadBackPi, bLSSIReadBackData); - }else {/* Read from BBreg8a0, 12 bits for 8190, 20 bits for T65 RF */ - retValue =phy_query_bb_reg (Adapter, pPhyReg->rfLSSIReadBack, bLSSIReadBackData); - } -return retValue; +if (rfpi_enable) + ret =phy_query_bb_reg (adapt, phyreg->rfLSSIReadBackPi, + bLSSIReadBackData); +else + ret =phy_query_bb_reg (adapt, phyreg->rfLSSIReadBack, + bLSSIReadBackData); +return ret; }/**
@@ -239,7 +208,7 @@ u32 rtl8188e_PHY_QueryRFReg(struct adapter *Adapter, enum rf_radio_path eRFPath, {u32 Original_Value, Readback_Value, BitShift; - Original_Value =phy_RFSerialRead (Adapter, eRFPath, RegAddr); + Original_Value =rf_serial_read (Adapter, eRFPath, RegAddr); BitShift =cal_bit_shift (BitMask); Readback_Value = (Original_Value & BitMask) >> BitShift;
@@ -277,7 +246,7 @@ rtl8188e_PHY_SetRFReg(/* RF data is 12 bits only */ if (BitMask != bRFRegOffsetMask) { - Original_Value =phy_RFSerialRead (Adapter, eRFPath, RegAddr); + Original_Value =rf_serial_read (Adapter, eRFPath, RegAddr); BitShift =cal_bit_shift (BitMask); Data = ((Original_Value & (~BitMask)) | (Data << BitShift)); }
Signature · 1 line
1.7.10.4
PATCH 7/20 staging: rtl8188eu: Rework function phy_RFSerialWrite()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 85 +++-------------------- 1 file changed, 11 insertions(+), 74 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +11 -74
@@ -110,81 +110,18 @@ static u32 rf_serial_read(struct adapter *adapt,return ret; } -/** -* Function: phy_RFSerialWrite -* -* OverView: Write data to RF register (page 8~) -* -* Input: -* struct adapter *Adapter, -* enum rf_radio_path eRFPath, Radio path of A/B/C/D -* u32 Offset, The target address to be read -* u32 Data The new register Data in the target bit position -* of the target to be read -* -* Output: None -* Return: None -* Note: Threre are three types of serial operations: -* 1. Software serial write -* 2. Hardware LSSI-Low Speed Serial Interface -* 3. Hardware HSSI-High speed -* serial write. Driver need to implement (1) and (2). -* This function is equal to the combination of RF_ReadReg() and RFLSSIRead() -* -* Note: For RF8256 only -* The total count of RTL8256(Zebra4) register is around 36 bit it only employs -* 4-bit RF address. RTL8256 uses "register mode control bit" (Reg00[12], Reg00[10]) -* to access register address bigger than 0xf. See "Appendix-4 in PHY Configuration -* programming guide" for more details. -* Thus, we define a sub-finction for RTL8526 register address conversion -* =========================================================== -* Register Mode RegCTL[1] RegCTL[0] Note -* (Reg00[12]) (Reg00[10]) -* =========================================================== -* Reg_Mode0 0 x Reg 0 ~15(0x0 ~ 0xf) -* ------------------------------------------------------------------ -* Reg_Mode1 1 0 Reg 16 ~30(0x1 ~ 0xf) -* ------------------------------------------------------------------ -* Reg_Mode2 1 1 Reg 31 ~ 45(0x1 ~ 0xf) -* ------------------------------------------------------------------ -* -* 2008/09/02 MH Add 92S RF definition -* -* -* -*/ -static void -phy_RFSerialWrite ( -struct adapter *Adapter, -enum rf_radio_path eRFPath, -u32 Offset, -u32 Data - ) +static void rf_serial_write (struct adapter *adapt, +enum rf_radio_path rfpath,u32 offset, +u32 data) { -u32 DataAndAddr =0 ; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); -struct bb_reg_def *pPhyReg = &pHalData->PHYRegDef[eRFPath]; -u32 NewOffset; - - -/* 2009/06/17 MH We can not execute IO for power save or other accident mode. */ - - Offset &=0xff ; - -/* */ -/* Switch page for 8256 RF IC */ -/* */ - NewOffset = Offset; - -/* */ -/* Put write addr in [5:0] and write data in [31:16] */ -/* */ - DataAndAddr = ((NewOffset<<20 ) | (Data&0x000fffff )) &0x0fffffff ;/* T65 RF */ +u32 data_and_addr =0 ; +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); +struct bb_reg_def *phyreg = &hal_data->PHYRegDef[rfpath]; +u32 newoffset; -/* */ -/* Write Operation */ -/* */ -phy_set_bb_reg (Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr); + newoffset = offset &0xff ; + data_and_addr = ((newoffset<<20 ) | (data&0x000fffff )) &0x0fffffff ; +phy_set_bb_reg (adapt, phyreg->rf3wireOffset, bMaskDWord, data_and_addr); }/**
@@ -251,7 +188,7 @@ rtl8188e_PHY_SetRFReg( Data = ((Original_Value & (~BitMask)) | (Data << BitShift)); } -phy_RFSerialWrite (Adapter, eRFPath, RegAddr, Data); +rf_serial_write (Adapter, eRFPath, RegAddr, Data); } static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,
Signature · 1 line
1.7.10.4
PATCH 8/20 staging: rtl8188eu: Rework function PHY_QueryRFReg()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 10 +++---- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 4 +-- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 31 +++++--------------- drivers/staging/rtl8188eu/hal/usb_halinit.c | 4 +-- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 4 --- drivers/staging/rtl8188eu/include/phy.h | 2 ++ 6 files changed, 18 insertions(+), 37 deletions(-)
drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +5 -5
@@ -169,7 +169,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E( ("===>dm_TXPowerTrackingCallback_ThermalMeter_8188E txpowercontrol %d\n" , dm_odm->RFCalibrateInfo.TxPowerTrackControl)); - ThermalValue = (u8 )PHY_QueryRFReg (Adapter,RF_PATH_A ,RF_T_METER_88E ,0xfc00 );/* 0x42: RF Reg[15:10] 88E */ + ThermalValue = (u8 )phy_query_rf_reg (Adapter,RF_PATH_A ,RF_T_METER_88E ,0xfc00 );/* 0x42: RF Reg[15:10] 88E */ ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Readback Thermal Meter = 0x%x pre thermal meter 0x%x EEPROMthermalmeter 0x%x\n",
@@ -446,7 +446,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(ODM_RT_TRACE (dm_odm,ODM_COMP_CALIBRATION ,ODM_DBG_LOUD , ("TxPwrTracking 0xc80 = 0x%x, 0xc94 = 0x%x RF 0x24 = 0x%x\n" ,phy_query_bb_reg (Adapter,0xc80 , bMaskDWord),phy_query_bb_reg (Adapter, -0xc94 , bMaskDWord),PHY_QueryRFReg (Adapter,RF_PATH_A ,0x24 , bRFRegOffsetMask))); +0xc94 , bMaskDWord),phy_query_rf_reg (Adapter,RF_PATH_A ,0x24 , bRFRegOffsetMask))); } }
@@ -1216,11 +1216,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 =phy_query_rf_reg (adapt,RF_PATH_A ,RF_AC , bMask12Bits);/* Path-B */ if (is2t) - RF_Bmode =PHY_QueryRFReg (adapt,RF_PATH_B ,RF_AC , bMask12Bits); + RF_Bmode =phy_query_rf_reg (adapt,RF_PATH_B ,RF_AC , bMask12Bits);/* 2. Set RF mode = standby mode */ /* Path-A */
@@ -1232,7 +1232,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 =phy_query_rf_reg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits);/* 4. Set LC calibration begin bit15 */ PHY_SetRFReg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits, LC_Cal|0x08000 );
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +2 -2
@@ -23,7 +23,7 @@#include <linux/vmalloc.h> #include <drv_types.h> #include <rtw_efuse.h> - +#include <phy.h> #include <rtl8188e_hal.h> #include <rtw_iol.h>
@@ -230,7 +230,7 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E; pHalFunc->AntDivCompareHandler = &AntDivCompare8188E; - pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg; + pHalFunc->read_rfreg = &phy_query_rf_reg; pHalFunc->write_rfreg = &rtl8188e_PHY_SetRFReg; pHalFunc->sreset_init_value = &sreset_init_value;
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +7 -24
@@ -124,32 +124,15 @@ static void rf_serial_write(struct adapter *adapt,phy_set_bb_reg (adapt, phyreg->rf3wireOffset, bMaskDWord, data_and_addr); } -/** -* Function: PHY_QueryRFReg -* -* OverView: Query "Specific bits" to RF register (page 8~) -* -* Input: -* struct adapter *Adapter, -* enum rf_radio_path eRFPath, Radio path of A/B/C/D -* u32 RegAddr, The target address to be read -* u32 BitMask The target bit position in the target address -* to be read -* -* Output: None -* Return: u32 Readback value -* Note: This function is equal to "GetRFRegSetting" in PHY programming guide -*/ -u32 rtl8188e_PHY_QueryRFReg (struct adapter *Adapter,enum rf_radio_path eRFPath, -u32 RegAddr,u32 BitMask) +u32 phy_query_rf_reg (struct adapter *adapt,enum rf_radio_path rf_path, +u32 reg_addr,u32 bit_mask) { -u32 Original_Value, Readback_Value, BitShift; - - Original_Value =rf_serial_read (Adapter, eRFPath, RegAddr); +u32 original_value, readback_value, bit_shift; - BitShift =cal_bit_shift (BitMask); - Readback_Value = (Original_Value & BitMask) >> BitShift; -return Readback_Value; + original_value =rf_serial_read (adapt, rf_path, reg_addr); + bit_shift =cal_bit_shift (bit_mask); + readback_value = (original_value & bit_mask) >> bit_shift; +return readback_value; }/**
drivers/staging/rtl8188eu/hal/usb_halinit.c +2 -2
@@ -818,8 +818,8 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)usb_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 ] =phy_query_rf_reg (Adapter, (enum rf_radio_path )0 ,RF_CHNLBW , bRFRegOffsetMask); + haldata->RfRegChnlVal[1 ] =phy_query_rf_reg (Adapter, (enum rf_radio_path )1 ,RF_CHNLBW , bRFRegOffsetMask);HAL_INIT_PROFILE_TAG (HAL_INIT_STAGES_TURN_ON_BLOCK );_BBTurnOnBlock (Adapter);
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -4
@@ -198,8 +198,6 @@ struct ant_sel_cck {/* */ /* BB and RF register read/write */ /* */ -u32 rtl8188e_PHY_QueryRFReg (struct adapter *adapter,enum rf_radio_path rfpath, -u32 regaddr,u32 mask);void rtl8188e_PHY_SetRFReg (struct adapter *adapter,enum rf_radio_path rfpath,u32 regaddr,u32 mask,u32 data);
@@ -232,8 +230,6 @@ bool SetAntennaConfig92C(struct adapter *adapter, u8 defaultant);/*--------------------------Exported Function prototype---------------------*/ -#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))
drivers/staging/rtl8188eu/include/phy.h +2 -0
@@ -4,3 +4,5 @@ bool rtl88eu_phy_bb_config(struct adapter *adapt);u32 phy_query_bb_reg (struct adapter *adapt,u32 regaddr,u32 bitmask);void phy_set_bb_reg (struct adapter *adapt,u32 regaddr,u32 bitmask,u32 data); +u32 phy_query_rf_reg (struct adapter *adapt,enum rf_radio_path rf_path, +u32 reg_addr,u32 bit_mask);
Signature · 1 line
1.7.10.4
PATCH 9/20 staging: rtl8188eu: Rework function rtl8188e_PHY_SetRFReg()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c | 2 +- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 32 +++++++-------- drivers/staging/rtl8188eu/hal/odm.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 42 +++++--------------- drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c | 4 +- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 5 --- drivers/staging/rtl8188eu/include/phy.h | 2 + 8 files changed, 32 insertions(+), 59 deletions(-)
drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c +1 -1
@@ -179,7 +179,7 @@ static void rtl_rfreg_delay(struct adapter *adapt, enum rf_radio_path rfpath,u32 }else if (addr ==0xf9 ) {udelay (1 ); }else { -rtl8188e_PHY_SetRFReg (adapt, rfpath, addr, mask, data); +phy_set_rf_reg (adapt, rfpath, addr, mask, data);udelay (1 ); } }
drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +16 -16
@@ -527,14 +527,14 @@ phy_PathA_RxIQK(struct adapter *adapt, bool configPathB)/* modify RXIQK mode table */ ODM_RT_TRACE (dm_odm,ODM_COMP_CALIBRATION ,ODM_DBG_LOUD , ("Path-A Rx IQK modify RXIQK mode table!\n" ));phy_set_bb_reg (adapt, rFPGA0_IQK, bMaskDWord,0x00000000 ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_WE_LUT , bRFRegOffsetMask,0x800a0 ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_RCK_OS , bRFRegOffsetMask,0x30000 ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_TXPA_G1 , bRFRegOffsetMask,0x0000f ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_TXPA_G2 , bRFRegOffsetMask,0xf117B ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_WE_LUT , bRFRegOffsetMask,0x800a0 ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_RCK_OS , bRFRegOffsetMask,0x30000 ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_TXPA_G1 , bRFRegOffsetMask,0x0000f ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_TXPA_G2 , bRFRegOffsetMask,0xf117B );/* PA,PAD off */ -PHY_SetRFReg (adapt,RF_PATH_A ,0xdf , bRFRegOffsetMask,0x980 ); -PHY_SetRFReg (adapt,RF_PATH_A ,0x56 , bRFRegOffsetMask,0x51000 ); +phy_set_rf_reg (adapt,RF_PATH_A ,0xdf , bRFRegOffsetMask,0x980 ); +phy_set_rf_reg (adapt,RF_PATH_A ,0x56 , bRFRegOffsetMask,0x51000 );phy_set_bb_reg (adapt, rFPGA0_IQK, bMaskDWord,0x80800000 );
@@ -589,10 +589,10 @@ phy_PathA_RxIQK(struct adapter *adapt, bool configPathB)/* modify RXIQK mode table */ ODM_RT_TRACE (dm_odm,ODM_COMP_CALIBRATION ,ODM_DBG_LOUD , ("Path-A Rx IQK modify RXIQK mode table 2!\n" ));phy_set_bb_reg (adapt, rFPGA0_IQK, bMaskDWord,0x00000000 ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_WE_LUT , bRFRegOffsetMask,0x800a0 ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_RCK_OS , bRFRegOffsetMask,0x30000 ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_TXPA_G1 , bRFRegOffsetMask,0x0000f ); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_TXPA_G2 , bRFRegOffsetMask,0xf7ffa ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_WE_LUT , bRFRegOffsetMask,0x800a0 ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_RCK_OS , bRFRegOffsetMask,0x30000 ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_TXPA_G1 , bRFRegOffsetMask,0x0000f ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_TXPA_G2 , bRFRegOffsetMask,0xf7ffa );phy_set_bb_reg (adapt, rFPGA0_IQK, bMaskDWord,0x80800000 );/* IQK setting */
@@ -630,7 +630,7 @@ phy_PathA_RxIQK(struct adapter *adapt, bool configPathB)/* reload RF 0xdf */ phy_set_bb_reg (adapt, rFPGA0_IQK, bMaskDWord,0x00000000 ); -PHY_SetRFReg (adapt,RF_PATH_A ,0xdf , bRFRegOffsetMask,0x180 ); +phy_set_rf_reg (adapt,RF_PATH_A ,0xdf , bRFRegOffsetMask,0x180 ); if (!(regeac & BIT27) && /* if Tx is OK, check whether Rx is OK */ (((regEA4 & 0x03FF0000)>>16) != 0x132) &&
@@ -1224,18 +1224,18 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)/* 2. Set RF mode = standby mode */ /* Path-A */ -PHY_SetRFReg (adapt,RF_PATH_A ,RF_AC , bMask12Bits, (RF_Amode&0x8FFFF )|0x10000 ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_AC , bMask12Bits, (RF_Amode&0x8FFFF )|0x10000 );/* Path-B */ if (is2t) -PHY_SetRFReg (adapt,RF_PATH_B ,RF_AC , bMask12Bits, (RF_Bmode&0x8FFFF )|0x10000 ); +phy_set_rf_reg (adapt,RF_PATH_B ,RF_AC , bMask12Bits, (RF_Bmode&0x8FFFF )|0x10000 ); }/* 3. Read RF reg18 */ LC_Cal =phy_query_rf_reg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits);/* 4. Set LC calibration begin bit15 */ -PHY_SetRFReg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits, LC_Cal|0x08000 ); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_CHNLBW , bMask12Bits, LC_Cal|0x08000 );msleep (100 );
@@ -1244,11 +1244,11 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)/* Deal with continuous TX case */ /* Path-A */ usb_write8 (adapt,0xd03 , tmpreg); -PHY_SetRFReg (adapt,RF_PATH_A ,RF_AC , bMask12Bits, RF_Amode); +phy_set_rf_reg (adapt,RF_PATH_A ,RF_AC , bMask12Bits, RF_Amode);/* Path-B */ if (is2t) -PHY_SetRFReg (adapt,RF_PATH_B ,RF_AC , bMask12Bits, RF_Bmode); +phy_set_rf_reg (adapt,RF_PATH_B ,RF_AC , bMask12Bits, RF_Bmode); }else {/* Deal with Packet TX case */ usb_write8 (adapt,REG_TXPAUSE ,0x00 );
drivers/staging/rtl8188eu/hal/odm.c +1 -1
@@ -1236,7 +1236,7 @@ void odm_TXPowerTrackingCheckCE(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 ,BIT17 |BIT16 ,0x03 ); +phy_set_rf_reg (Adapter,RF_PATH_A ,RF_T_METER_88E ,BIT17 |BIT16 ,0x03 ); pDM_Odm->RFCalibrateInfo.TM_Trigger =1 ;return ;
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +1 -1
@@ -231,7 +231,7 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E; pHalFunc->AntDivCompareHandler = &AntDivCompare8188E; pHalFunc->read_rfreg = &phy_query_rf_reg; - pHalFunc->write_rfreg = &rtl8188e_PHY_SetRFReg; + pHalFunc->write_rfreg = &phy_set_rf_reg; pHalFunc->sreset_init_value = &sreset_init_value; pHalFunc->sreset_get_wifi_status = &sreset_get_wifi_status;
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +9 -33
59 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/rtl8188e_rf6052.c +2 -2
@@ -68,11 +68,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 ]); +phy_set_rf_reg (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 ]); +phy_set_rf_reg (Adapter,RF_PATH_A ,RF_CHNLBW , bRFRegOffsetMask, pHalData->RfRegChnlVal[0 ]);break ;default :break ;
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -5
@@ -198,8 +198,6 @@ struct ant_sel_cck {/* */ /* BB and RF register read/write */ /* */ -void rtl8188e_PHY_SetRFReg (struct adapter *adapter,enum rf_radio_path rfpath, -u32 regaddr,u32 mask,u32 data);/* Read initi reg value for tx power setting. */ void rtl8192c_PHY_GetHWRegOriginalValue (struct adapter *adapter);
@@ -230,9 +228,6 @@ bool SetAntennaConfig92C(struct adapter *adapter, u8 defaultant);/*--------------------------Exported Function prototype---------------------*/ -#define PHY_SetRFReg (adapt, rfpath, regaddr, bitmask, data) \ - rtl8188e_PHY_SetRFReg((adapt), (rfpath), (regaddr), (bitmask), (data)) -#define PHY_SetMacReg PHY_SetBBReg#define SIC_HW_SUPPORT 0
drivers/staging/rtl8188eu/include/phy.h +2 -0
@@ -6,3 +6,5 @@ u32 phy_query_bb_reg(struct adapter *adapt, u32 regaddr, u32 bitmask);void phy_set_bb_reg (struct adapter *adapt,u32 regaddr,u32 bitmask,u32 data);u32 phy_query_rf_reg (struct adapter *adapt,enum rf_radio_path rf_path,u32 reg_addr,u32 bit_mask); +void phy_set_rf_reg (struct adapter *adapt,enum rf_radio_path rf_path, +u32 reg_addr,u32 bit_mask,u32 data);
Signature · 1 line
1.7.10.4
PATCH 10/20 staging: rtl8188eu: Rework function getTxPowerIndex88E()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 105 ++++++++++------------- 1 file changed, 45 insertions(+), 60 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +45 -60
@@ -150,78 +150,63 @@ void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path,rf_serial_write (adapt, rf_path, reg_addr, data); } -static void getTxPowerIndex88E (struct adapter *Adapter,u8 channel,u8 *cckPowerLevel, -u8 *ofdmPowerLevel,u8 *BW20PowerLevel, -u8 *BW40PowerLevel) +static void get_tx_power_index (struct adapter *adapt,u8 channel,u8 *cck_pwr, +u8 *ofdm_pwr,u8 *bw20_pwr,u8 *bw40_pwr) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt);u8 index = (channel -1 );u8 TxCount =0 , path_nums; -if ((RF_1T2R == pHalData->rf_type) || (RF_1T1R == pHalData->rf_type)) +if ((RF_1T2R == hal_data->rf_type) || (RF_1T1R == hal_data->rf_type)) path_nums =1 ;else path_nums =2 ;for (TxCount =0 ; TxCount < path_nums; TxCount++) {if (TxCount ==RF_PATH_A ) { -/* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; -/* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->OFDM_24G_Diff[TxCount][RF_PATH_A ]; -/* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[TxCount][RF_PATH_A ]; -/* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; + cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index]; + ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->OFDM_24G_Diff[TxCount][RF_PATH_A ]; + + bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[TxCount][RF_PATH_A ]; + bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index]; }else if (TxCount ==RF_PATH_B ) { -/* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; -/* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[TxCount][index]; -/* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[TxCount][RF_PATH_A ]+ - pHalData->BW20_24G_Diff[TxCount][index]; -/* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; + cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index]; + ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[TxCount][index]; + + bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[TxCount][RF_PATH_A ]+ + hal_data->BW20_24G_Diff[TxCount][index]; + bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index]; }else if (TxCount ==RF_PATH_C ) { -/* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; -/* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_B ][index]+ - pHalData->BW20_24G_Diff[TxCount][index]; -/* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_B ][index]+ - pHalData->BW20_24G_Diff[TxCount][index]; -/* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; + cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index]; + ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_B ][index]+ + hal_data->BW20_24G_Diff[TxCount][index]; + + bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_B ][index]+ + hal_data->BW20_24G_Diff[TxCount][index]; + bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index]; }else if (TxCount ==RF_PATH_D ) { -/* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; -/* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_B ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_C ][index]+ - pHalData->BW20_24G_Diff[TxCount][index]; - -/* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_A ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_B ][index]+ - pHalData->BW20_24G_Diff[RF_PATH_C ][index]+ - pHalData->BW20_24G_Diff[TxCount][index]; - -/* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; + cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index]; + ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_B ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_C ][index]+ + hal_data->BW20_24G_Diff[TxCount][index]; + + bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_A ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_B ][index]+ + hal_data->BW20_24G_Diff[RF_PATH_C ][index]+ + hal_data->BW20_24G_Diff[TxCount][index]; + bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index]; } } }
@@ -265,7 +250,7 @@ PHY_SetTxPowerLevel8188E(u8 BW20PowerLevel[MAX_TX_COUNT ] = {0 };u8 BW40PowerLevel[MAX_TX_COUNT ] = {0 }; -getTxPowerIndex88E (Adapter, channel, &cckPowerLevel[0 ], &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ]); +get_tx_power_index (Adapter, channel, &cckPowerLevel[0 ], &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ]);phy_PowerIndexCheck88E (Adapter, channel, &cckPowerLevel[0 ], &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ]);
Signature · 1 line
1.7.10.4
PATCH 11/20 staging: rtl8188eu: Rework function phy_PowerIndexCheck88E()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +9 -8
@@ -211,15 +211,16 @@ static void get_tx_power_index(struct adapter *adapt, u8 channel, u8 *cck_pwr, } } -static void phy_PowerIndexCheck88E (struct adapter *Adapter,u8 channel,u8 *cckPowerLevel, -u8 *ofdmPowerLevel,u8 *BW20PowerLevel,u8 *BW40PowerLevel) +static void phy_power_index_check (struct adapter *adapt,u8 channel, +u8 *cck_pwr,u8 *ofdm_pwr,u8 *bw20_pwr, +u8 *bw40_pwr) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); - pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0 ]; - pHalData->CurrentOfdm24GTxPwrIdx = ofdmPowerLevel[0 ]; - pHalData->CurrentBW2024GTxPwrIdx = BW20PowerLevel[0 ]; - pHalData->CurrentBW4024GTxPwrIdx = BW40PowerLevel[0 ]; + hal_data->CurrentCckTxPwrIdx = cck_pwr[0 ]; + hal_data->CurrentOfdm24GTxPwrIdx = ofdm_pwr[0 ]; + hal_data->CurrentBW2024GTxPwrIdx = bw20_pwr[0 ]; + hal_data->CurrentBW4024GTxPwrIdx = bw40_pwr[0 ]; }/*-----------------------------------------------------------------------------
@@ -252,7 +253,7 @@ PHY_SetTxPowerLevel8188E(get_tx_power_index (Adapter, channel, &cckPowerLevel[0 ], &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ]); -phy_PowerIndexCheck88E (Adapter, channel, &cckPowerLevel[0 ], &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ]); +phy_power_index_check (Adapter, channel, &cckPowerLevel[0 ], &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ]);rtl8188e_PHY_RF6052SetCckTxPower (Adapter, &cckPowerLevel[0 ]);rtl8188e_PHY_RF6052SetOFDMTxPower (Adapter, &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ], channel);
Signature · 1 line
1.7.10.4
PATCH 12/20 staging: rtl8188eu: Rework function _PHY_SetBWMode92C()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 98 +++++++++-------------- 1 file changed, 37 insertions(+), 61 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +37 -61
@@ -259,102 +259,78 @@ PHY_SetTxPowerLevel8188E(rtl8188e_PHY_RF6052SetOFDMTxPower (Adapter, &ofdmPowerLevel[0 ], &BW20PowerLevel[0 ], &BW40PowerLevel[0 ], channel); } -/*----------------------------------------------------------------------------- -* Function: PHY_SetBWModeCallback8192C() -* -* Overview: Timer callback function for SetSetBWMode -* -* Input: PRT_TIMER pTimer -* -* Output: NONE -* -* Return: NONE -* -* Note: (1) We do not take j mode into consideration now -* (2) Will two workitem of "switch channel" and "switch channel bandwidth" run -* concurrently? -*---------------------------------------------------------------------------*/ -static void -_PHY_SetBWMode92C ( -struct adapter *Adapter -) +static void phy_set_bw_mode_callback (struct adapter *adapt) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); -u8 regBwOpMode; -u8 regRRSR_RSC; +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); +u8 reg_bw_opmode; +u8 reg_prsr_rsc; -if (pHalData->rf_chip ==RF_PSEUDO_11N ) +if (hal_data->rf_chip ==RF_PSEUDO_11N )return ;/* There is no 40MHz mode in RF_8225. */ -if (pHalData->rf_chip ==RF_8225 ) +if (hal_data->rf_chip ==RF_8225 )return ; -if (Adapter->bDriverStopped) +if (adapt->bDriverStopped)return ; -/* 3 */ -/* 3<1>Set MAC register */ -/* 3 */ +/* Set MAC register */ - regBwOpMode =usb_read8 (Adapter,REG_BWOPMODE ); - regRRSR_RSC =usb_read8 (Adapter,REG_RRSR +2 ); + reg_bw_opmode =usb_read8 (adapt,REG_BWOPMODE ); + reg_prsr_rsc =usb_read8 (adapt,REG_RRSR +2 ); -switch (pHalData->CurrentChannelBW) { +switch (hal_data->CurrentChannelBW) {case HT_CHANNEL_WIDTH_20 : - regBwOpMode |=BW_OPMODE_20MHZ ; -/* 2007/02/07 Mark by Emily because we have not verify whether this register works */ -usb_write8 (Adapter,REG_BWOPMODE , regBwOpMode); + reg_bw_opmode |=BW_OPMODE_20MHZ ; +usb_write8 (adapt,REG_BWOPMODE , reg_bw_opmode);break ;case HT_CHANNEL_WIDTH_40 : - regBwOpMode &= ~BW_OPMODE_20MHZ ; -/* 2007/02/07 Mark by Emily because we have not verify whether this register works */ -usb_write8 (Adapter,REG_BWOPMODE , regBwOpMode); - regRRSR_RSC = (regRRSR_RSC&0x90 ) | (pHalData->nCur40MhzPrimeSC<<5 ); -usb_write8 (Adapter,REG_RRSR +2 , regRRSR_RSC); + reg_bw_opmode &= ~BW_OPMODE_20MHZ ; +usb_write8 (adapt,REG_BWOPMODE , reg_bw_opmode); + reg_prsr_rsc = (reg_prsr_rsc&0x90 ) | + (hal_data->nCur40MhzPrimeSC<<5 ); +usb_write8 (adapt,REG_RRSR +2 , reg_prsr_rsc);break ;default :break ; } -/* 3 */ -/* 3 <2>Set PHY related register */ -/* 3 */ -switch (pHalData->CurrentChannelBW) { -/* 20 MHz channel*/ +/* Set PHY related register */ +switch (hal_data->CurrentChannelBW) {case HT_CHANNEL_WIDTH_20 : -phy_set_bb_reg (Adapter, rFPGA0_RFMOD, bRFMOD,0x0 ); -phy_set_bb_reg (Adapter, rFPGA1_RFMOD, bRFMOD,0x0 ); +phy_set_bb_reg (adapt, rFPGA0_RFMOD, bRFMOD,0x0 ); +phy_set_bb_reg (adapt, rFPGA1_RFMOD, bRFMOD,0x0 );break ; -/* 40 MHz channel*/ case HT_CHANNEL_WIDTH_40 : -phy_set_bb_reg (Adapter, rFPGA0_RFMOD, bRFMOD,0x1 ); -phy_set_bb_reg (Adapter, rFPGA1_RFMOD, bRFMOD,0x1 ); -/* Set Control channel to upper or lower. These settings are required only for 40MHz */ -phy_set_bb_reg (Adapter, rCCK0_System, bCCKSideBand, (pHalData->nCur40MhzPrimeSC>>1 )); -phy_set_bb_reg (Adapter, rOFDM1_LSTF,0xC00 , pHalData->nCur40MhzPrimeSC); -phy_set_bb_reg (Adapter,0x818 , (BIT26 |BIT27 ), - (pHalData->nCur40MhzPrimeSC ==HAL_PRIME_CHNL_OFFSET_LOWER ) ?2 :1 ); +phy_set_bb_reg (adapt, rFPGA0_RFMOD, bRFMOD,0x1 ); +phy_set_bb_reg (adapt, rFPGA1_RFMOD, bRFMOD,0x1 ); +/* Set Control channel to upper or lower. +* These settings are required only for 40MHz +*/ +phy_set_bb_reg (adapt, rCCK0_System, bCCKSideBand, + (hal_data->nCur40MhzPrimeSC>>1 )); +phy_set_bb_reg (adapt, rOFDM1_LSTF,0xC00 , + hal_data->nCur40MhzPrimeSC); +phy_set_bb_reg (adapt,0x818 , (BIT26 |BIT27 ), + (hal_data->nCur40MhzPrimeSC ==HAL_PRIME_CHNL_OFFSET_LOWER ) ?2 :1 );break ;default :break ; } -/* Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 */ -/* 3<3>Set RF related register */ -switch (pHalData->rf_chip) { +/* Set RF related register */ +switch (hal_data->rf_chip) {case RF_8225 :break ;case RF_8256 : -/* Please implement this function in Hal8190PciPhy8256.c */ break ;case RF_8258 : -/* Please implement this function in Hal8190PciPhy8258.c */ break ;case RF_PSEUDO_11N :break ;case RF_6052 : -rtl8188e_PHY_RF6052SetBandwidth (Adapter, pHalData->CurrentChannelBW); +rtl8188e_PHY_RF6052SetBandwidth (adapt, hal_data->CurrentChannelBW);break ;default :break ;
@@ -386,7 +362,7 @@ void PHY_SetBWMode8188E(struct adapter *Adapter, enum ht_channel_width Bandwidth pHalData->nCur40MhzPrimeSC = Offset;if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved)) -_PHY_SetBWMode92C (Adapter); +phy_set_bw_mode_callback (Adapter);else pHalData->CurrentChannelBW = tmpBW; }
Signature · 1 line
1.7.10.4
PATCH 13/20 staging: rtl8188eu: Rework function _PHY_SwChnl8192C()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +11 -11
@@ -367,24 +367,24 @@ void PHY_SetBWMode8188E(struct adapter *Adapter, enum ht_channel_width Bandwidth pHalData->CurrentChannelBW = tmpBW; } -static void _PHY_SwChnl8192C (struct adapter *Adapter,u8 channel) +static void phy_sw_chnl_callback (struct adapter *adapt,u8 channel) { -u8 eRFPath; +u8 rf_path;u32 param1, param2; -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); -if (Adapter->bNotifyChannelChange) +if (adapt->bNotifyChannelChange)DBG_88E ("[%s] ch = %d\n" , __func__, channel); -/* s1. pre common command - CmdID_SetTxPowerLevel */ -PHY_SetTxPowerLevel8188E (Adapter, channel); +PHY_SetTxPowerLevel8188E (adapt, channel); -/* s2. RF dependent command - CmdID_RF_WriteReg, param1=RF_CHNLBW, param2=channel */ param1 =RF_CHNLBW ; param2 = channel; -for (eRFPath =0 ; eRFPath < pHalData->NumTotalRFPath; eRFPath++) { - pHalData->RfRegChnlVal[eRFPath] = ((pHalData->RfRegChnlVal[eRFPath] &0xfffffc00 ) | param2); -phy_set_rf_reg (Adapter, (enum rf_radio_path )eRFPath, param1, bRFRegOffsetMask, pHalData->RfRegChnlVal[eRFPath]); +for (rf_path =0 ; rf_path < hal_data->NumTotalRFPath; rf_path++) { + hal_data->RfRegChnlVal[rf_path] = (hal_data->RfRegChnlVal[rf_path] & +0xfffffc00 ) | param2; +phy_set_rf_reg (adapt, (enum rf_radio_path )rf_path, param1, + bRFRegOffsetMask, hal_data->RfRegChnlVal[rf_path]); } }
@@ -404,7 +404,7 @@ void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel) pHalData->CurrentChannel = channel;if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved)) { -_PHY_SwChnl8192C (Adapter, channel); +phy_sw_chnl_callback (Adapter, channel);if (bResult) ;
Signature · 1 line
1.7.10.4
PATCH 14/20 staging: rtl8188eu: Rework function PHY_SetTxPowerLevel8188E()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 44 ++++++-------------- drivers/staging/rtl8188eu/hal/usb_halinit.c | 2 +- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 1 - drivers/staging/rtl8188eu/include/phy.h | 2 + 5 files changed, 17 insertions(+), 34 deletions(-)
drivers/staging/rtl8188eu/hal/HalPhyRf_8188e.c +1 -1
@@ -114,7 +114,7 @@ static void odm_TxPwrTrackSetPwr88E(struct odm_dm_struct *dm_odm) {if (dm_odm->BbSwingFlagOfdm || dm_odm->BbSwingFlagCck) {ODM_RT_TRACE (dm_odm,ODM_COMP_TX_PWR_TRACK ,ODM_DBG_LOUD , ("odm_TxPwrTrackSetPwr88E CH=%d\n" , *(dm_odm->pChannel))); -PHY_SetTxPowerLevel8188E (dm_odm->Adapter, *(dm_odm->pChannel)); +phy_set_tx_power_level (dm_odm->Adapter, *(dm_odm->pChannel)); dm_odm->BbSwingFlagOfdm = false; dm_odm->BbSwingFlagCck = false; }
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +13 -31
60 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/usb_halinit.c +1 -1
@@ -829,7 +829,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_SECURITY);HAL_INIT_PROFILE_TAG (HAL_INIT_STAGES_MISC11 );/* 2010/12/17 MH We need to set TX power according to EFUSE content at first. */ -PHY_SetTxPowerLevel8188E (Adapter, haldata->CurrentChannel); +phy_set_tx_power_level (Adapter, haldata->CurrentChannel);/* Move by Neo for USB SS to below setp */ /* _RfPowerSave(Adapter); */
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -1
@@ -204,7 +204,6 @@ void rtl8192c_PHY_GetHWRegOriginalValue(struct adapter *adapter);/* BB TX Power R/W */ void PHY_GetTxPowerLevel8188E (struct adapter *adapter,u32 *powerlevel); -void PHY_SetTxPowerLevel8188E (struct adapter *adapter,u8 channel);void PHY_ScanOperationBackup8188E (struct adapter *Adapter,u8 Operation);
drivers/staging/rtl8188eu/include/phy.h +2 -0
@@ -8,3 +8,5 @@ u32 phy_query_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path, u32 reg_addr, u32 bit_mask);void phy_set_rf_reg (struct adapter *adapt,enum rf_radio_path rf_path,u32 reg_addr,u32 bit_mask,u32 data); + +void phy_set_tx_power_level (struct adapter *adapt,u8 channel);
Signature · 1 line
1.7.10.4
PATCH 15/20 staging: rtl8188eu: Rework function PHY_SetBWMode8188E()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 33 ++++++-------------- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 4 --- drivers/staging/rtl8188eu/include/phy.h | 3 ++ 4 files changed, 13 insertions(+), 29 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +1 -1
@@ -221,7 +221,7 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->read_chip_version = &rtl8188e_read_chip_version; - pHalFunc->set_bwmode_handler = &PHY_SetBWMode8188E; + pHalFunc->set_bwmode_handler = &phy_set_bw_mode; pHalFunc->set_channel_handler = &PHY_SwChnl8188E; pHalFunc->hal_dm_watchdog = &rtl8188e_HalDmWatchDog;
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +9 -24
@@ -319,34 +319,19 @@ static void phy_set_bw_mode_callback(struct adapter *adapt) } } -/*----------------------------------------------------------------------------- -* Function: SetBWMode8190Pci() -* -* Overview: This function is export to "HalCommon" moudule -* -* Input: struct adapter *Adapter -* enum ht_channel_width Bandwidth 20M or 40M -* -* Output: NONE -* -* Return: NONE -* -* Note: We do not take j mode into consideration now -*---------------------------------------------------------------------------*/ -void PHY_SetBWMode8188E (struct adapter *Adapter,enum ht_channel_width Bandwidth,/* 20M or 40M */ -unsigned char Offset)/* Upper, Lower, or Don't care */ +void phy_set_bw_mode (struct adapter *adapt,enum ht_channel_width bandwidth, +unsigned char offset) { -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); -enum ht_channel_width tmpBW = pHalData->CurrentChannelBW; - - pHalData->CurrentChannelBW = Bandwidth; +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); +enum ht_channel_width tmp_bw = hal_data->CurrentChannelBW; - pHalData->nCur40MhzPrimeSC = Offset; + hal_data->CurrentChannelBW = bandwidth; + hal_data->nCur40MhzPrimeSC = offset; -if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved)) -phy_set_bw_mode_callback (Adapter); +if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) +phy_set_bw_mode_callback (adapt);else - pHalData->CurrentChannelBW = tmpBW; + hal_data->CurrentChannelBW = tmp_bw; }static void phy_sw_chnl_callback (struct adapter *adapt,u8 channel)
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -4
@@ -207,10 +207,6 @@ void PHY_GetTxPowerLevel8188E(struct adapter *adapter, u32 *powerlevel);void PHY_ScanOperationBackup8188E (struct adapter *Adapter,u8 Operation); -/* Switch bandwidth for 8192S */ -void PHY_SetBWMode8188E (struct adapter *adapter, -enum ht_channel_width chnlwidth,unsigned char offset); -/* channel switch related funciton */ void PHY_SwChnl8188E (struct adapter *adapter,u8 channel);/* Call after initialization */
drivers/staging/rtl8188eu/include/phy.h +3 -0
@@ -10,3 +10,6 @@ void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path, u32 reg_addr, u32 bit_mask, u32 data);void phy_set_tx_power_level (struct adapter *adapt,u8 channel); + +void phy_set_bw_mode (struct adapter *adapt,enum ht_channel_width bandwidth, +unsigned char offset);
Signature · 1 line
1.7.10.4
PATCH 16/20 staging: rtl8188eu: Rework function PHY_SwChnl8188E()
In reply to navin patidarRename CamelCase variables and function name.
--- drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 27 +++++++++----------- drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h | 2 -- drivers/staging/rtl8188eu/include/phy.h | 1 + 4 files changed, 14 insertions(+), 18 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +1 -1
@@ -222,7 +222,7 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc) pHalFunc->read_chip_version = &rtl8188e_read_chip_version; pHalFunc->set_bwmode_handler = &phy_set_bw_mode; - pHalFunc->set_channel_handler = &PHY_SwChnl8188E; + pHalFunc->set_channel_handler = &phy_sw_chnl; pHalFunc->hal_dm_watchdog = &rtl8188e_HalDmWatchDog;
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c +12 -15
@@ -355,30 +355,27 @@ static void phy_sw_chnl_callback(struct adapter *adapt, u8 channel) } } -void PHY_SwChnl8188E (struct adapter *Adapter,u8 channel) +void phy_sw_chnl (struct adapter *adapt,u8 channel) { -/* Call after initialization */ -struct hal_data_8188e *pHalData =GET_HAL_DATA (Adapter); -u8 tmpchannel = pHalData->CurrentChannel; -bool bResult = true; +struct hal_data_8188e *hal_data =GET_HAL_DATA (adapt); +u8 tmpchannel = hal_data->CurrentChannel; +bool result = true; -if (pHalData->rf_chip ==RF_PSEUDO_11N ) -return ;/* return immediately if it is peudo-phy */ +if (hal_data->rf_chip ==RF_PSEUDO_11N ) +return ;if (channel ==0 ) channel =1 ; - pHalData->CurrentChannel = channel; + hal_data->CurrentChannel = channel; -if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved)) { -phy_sw_chnl_callback (Adapter, channel); +if ((!adapt->bDriverStopped) && (!adapt->bSurpriseRemoved)) { +phy_sw_chnl_callback (adapt, channel); -if (bResult) - ; -else - pHalData->CurrentChannel = tmpchannel; +if (!result) + hal_data->CurrentChannel = tmpchannel; }else { - pHalData->CurrentChannel = tmpchannel; + hal_data->CurrentChannel = tmpchannel; } }
drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h +0 -2
@@ -207,8 +207,6 @@ void PHY_GetTxPowerLevel8188E(struct adapter *adapter, u32 *powerlevel);void PHY_ScanOperationBackup8188E (struct adapter *Adapter,u8 Operation); -/* channel switch related funciton */ -void PHY_SwChnl8188E (struct adapter *adapter,u8 channel);/* Call after initialization */ void ChkFwCmdIoDone (struct adapter *adapter);
drivers/staging/rtl8188eu/include/phy.h +1 -0
@@ -13,3 +13,4 @@ void phy_set_tx_power_level(struct adapter *adapt, u8 channel);void phy_set_bw_mode (struct adapter *adapt,enum ht_channel_width bandwidth,unsigned char offset); +void phy_sw_chnl (struct adapter *adapt,u8 channel);
Signature · 1 line
1.7.10.4
PATCH 17/20 staging: rtl8188eu: Rename rtl8188e_phycfg.c to phy.c
In reply to navin patidar--- drivers/staging/rtl8188eu/Makefile | 2 +- drivers/staging/rtl8188eu/hal/phy.c | 381 +++++++++++++++++++++++ drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c | 381 ----------------------- 3 files changed, 382 insertions(+), 382 deletions(-) create mode 100644 drivers/staging/rtl8188eu/hal/phy.c delete mode 100644 drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c
drivers/staging/rtl8188eu/Makefile +1 -1
@@ -34,7 +34,7 @@ r8188eu-y := \ hal/rtl8188e_cmd.o \ hal/rtl8188e_dm.o \ hal/rtl8188e_hal_init.o \ - hal/rtl8188e_phycfg.o \ + hal/phy.o \ hal/rtl8188e_rf6052.o \ hal/rtl8188e_rxdesc.o \ hal/rtl8188e_xmit.o \
drivers/staging/rtl8188eu/hal/phy.c new file +381 -0
381 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/rtl8188e_phycfg.c deleted +0 -381
381 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 18/20 staging: rtl8188eu: Rename HalHWImg8188E_BB.c to bb_cfg.c
In reply to navin patidar--- drivers/staging/rtl8188eu/Makefile | 2 +- drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c | 715 ---------------------- drivers/staging/rtl8188eu/hal/bb_cfg.c | 715 ++++++++++++++++++++++ 3 files changed, 716 insertions(+), 716 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c create mode 100644 drivers/staging/rtl8188eu/hal/bb_cfg.c
drivers/staging/rtl8188eu/Makefile +1 -1
@@ -19,7 +19,7 @@ r8188eu-y := \ core/rtw_xmit.o \ hal/fw.o \ hal/HalHWImg8188E_MAC.o \ - hal/HalHWImg8188E_BB.o \ + hal/bb_cfg.o \ hal/HalHWImg8188E_RF.o \ hal/HalPhyRf_8188e.o \ hal/HalPwrSeqCmd.o \
drivers/staging/rtl8188eu/hal/HalHWImg8188E_BB.c deleted +0 -715
715 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/bb_cfg.c new file +715 -0
715 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 19/20 staging: rtl8188eu: Rename HalHWImg8188E_RF.c to rf_cfg.c
In reply to navin patidar--- drivers/staging/rtl8188eu/Makefile | 2 +- drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c | 320 ---------------------- drivers/staging/rtl8188eu/hal/rf_cfg.c | 320 ++++++++++++++++++++++ 3 files changed, 321 insertions(+), 321 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c create mode 100644 drivers/staging/rtl8188eu/hal/rf_cfg.c
drivers/staging/rtl8188eu/Makefile +1 -1
@@ -20,7 +20,7 @@ r8188eu-y := \ hal/fw.o \ hal/HalHWImg8188E_MAC.o \ hal/bb_cfg.o \ - hal/HalHWImg8188E_RF.o \ + hal/rf_cfg.o \ hal/HalPhyRf_8188e.o \ hal/HalPwrSeqCmd.o \ hal/Hal8188EPwrSeq.o \
drivers/staging/rtl8188eu/hal/HalHWImg8188E_RF.c deleted +0 -320
320 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/rf_cfg.c new file +320 -0
320 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 20/20 staging: rtl8188eu: Rename HalHWImg8188E_MAC.c to mac_cfg.c
In reply to navin patidar--- drivers/staging/rtl8188eu/Makefile | 2 +- drivers/staging/rtl8188eu/hal/HalHWImg8188E_MAC.c | 133 --------------------- drivers/staging/rtl8188eu/hal/mac_cfg.c | 133 +++++++++++++++++++++ 3 files changed, 134 insertions(+), 134 deletions(-) delete mode 100644 drivers/staging/rtl8188eu/hal/HalHWImg8188E_MAC.c create mode 100644 drivers/staging/rtl8188eu/hal/mac_cfg.c
drivers/staging/rtl8188eu/Makefile +1 -1
@@ -18,7 +18,7 @@ r8188eu-y := \ core/rtw_wlan_util.o \ core/rtw_xmit.o \ hal/fw.o \ - hal/HalHWImg8188E_MAC.o \ + hal/mac_cfg.o \ hal/bb_cfg.o \ hal/rf_cfg.o \ hal/HalPhyRf_8188e.o \
drivers/staging/rtl8188eu/hal/HalHWImg8188E_MAC.c deleted +0 -133
133 lines not on this page · raw message
drivers/staging/rtl8188eu/hal/mac_cfg.c new file +133 -0
133 lines not on this page · raw message
Signature · 1 line
1.7.10.4