staging: rtl8192e: Rename constants and variables from rtl_dm.h
cover staging: rtl8192e: Rename constants and variables from rtl_dm.h
Rename constants and variables mainly from rtl_dm.h to fix checkpatch issues as CamelCase, missing spaces and double line breaks. Remove dead code in case of double definition.
Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e
Philipp Hortmann (10):
staging: rtl8192e: Rename AcmHw_ViqEn, AcmHw_VoqEn and
ANAPAR_FOR_8192PciE
staging: rtl8192e: Calculate definition of MSR_LINK_MASK
staging: rtl8192e: Remove blank lines in r8192E_hw.h, rtl_core.h and
.. staging: rtl8192e: Rename MacBlkCtrl and remove double definition
staging: rtl8192e: Rename OFDM_Table.., CCK_Table_.. and
RxPathSelecti..
staging: rtl8192e: Rename RxPathSelectio.., RateAdaptive.. and
RateAdap..
staging: rtl8192e: Rename RateAdaptiveTH.., VeryLowRSSI and WAIotTHVal
staging: rtl8192e: Rename Enable, cck_Rx_path and SS_TH_low
staging: rtl8192e: Rename diff_TH and disabledRF
staging: rtl8192e: Rename DM_RxPathSelTable
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 22 ++--- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 15 ++- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 2 +- .../staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 2 - drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 3 - drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 96 +++++++++---------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 37 +++---- drivers/staging/rtl8192e/rtl8192e/rtl_pm.c | 2 +- 8 files changed, 82 insertions(+), 97 deletions(-)
Signature · 1 line
2.39.1
PATCH 1/10 staging: rtl8192e: Rename AcmHw_ViqEn, AcmHw_VoqEn and ANAPAR_FOR_8192PciE
Rename constants AcmHw_ViqEn to ACM_HW_VIQ_EN and AcmHw_VoqEn to ACM_HW_VOQ_EN and ANAPAR_FOR_8192PciE to ANAPAR_FOR_8192PCIE to avoid CamelCase which is not accepted by checkpatch.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 6 +++--- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 6 +++--- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +3 -3
@@ -225,11 +225,11 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)break ;case AC2_VI : - AcmCtrl |= AcmHw_ViqEn; + AcmCtrl |=ACM_HW_VIQ_EN ;break ;case AC3_VO : - AcmCtrl |= AcmHw_VoqEn; + AcmCtrl |=ACM_HW_VOQ_EN ;break ; } }else {
@@ -239,7 +239,7 @@ void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val)break ;case AC2_VI : - AcmCtrl &= (~AcmHw_ViqEn); + AcmCtrl &= (~ACM_HW_VIQ_EN );break ;case AC3_VO :
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +3 -3
@@ -144,8 +144,8 @@ enum _RTL8192PCI_HW {#define CPU_GEN_NO_LOOPBACK_SET 0x00080000 ACM_HW_CTRL = 0x171,#define ACM_HW_BEQ_EN BIT1 -#define AcmHw_ViqEn BIT2 -#define AcmHw_VoqEn BIT3 +#define ACM_HW_VIQ_EN BIT2 +#define ACM_HW_VOQ_EN BIT3RQPN1 =0x180 ,RQPN2 =0x184 , RQPN3 = 0x188,
@@ -250,6 +250,6 @@ enum _RTL8192PCI_HW {#define GPI 0x108 -#define ANAPAR_FOR_8192PciE 0x17 +#define ANAPAR_FOR_8192PCIE 0x17#endif
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +1 -1
@@ -1273,7 +1273,7 @@ void rtl92e_set_rf_off(struct net_device *dev)rtl92e_set_bb_reg (dev, rOFDM1_TRxPathEnable,0xf ,0x0 );rtl92e_set_bb_reg (dev, rFPGA0_AnalogParameter1,0x60 ,0x0 );rtl92e_set_bb_reg (dev, rFPGA0_AnalogParameter1,0x4 ,0x0 ); -rtl92e_writeb (dev, ANAPAR_FOR_8192PciE,0x07 ); +rtl92e_writeb (dev,ANAPAR_FOR_8192PCIE ,0x07 ); }
Signature · 1 line
2.39.1
PATCH 2/10 staging: rtl8192e: Calculate definition of MSR_LINK_MASK
In reply to Philipp HortmannCalculate definition of MSR_LINK_MASK ((1<<0)|(1<<1)) = 3. Equation is not accepted by checkpatch because of missing spaces.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +1 -1
@@ -170,7 +170,7 @@ enum _RTL8192PCI_HW {#define BW_OPMODE_20MHZ BIT2 IC_VERRSION = 0x301, MSR = 0x303, -#define MSR_LINK_MASK ((1<<0)|(1<<1)) +#define MSR_LINK_MASK 3#define MSR_LINK_MANAGED 2#define MSR_LINK_ADHOC 1#define MSR_LINK_MASTER 3
Signature · 1 line
2.39.1
PATCH 3/10 staging: rtl8192e: Remove blank lines in r8192E_hw.h, rtl_core.h and ..
In reply to Philipp HortmannRemove or add blank lines in r8192E_hw.h, rtl_core.h and rtl_dm.h so that code fits to kernel coding style as shown by checkpatch. Remove one line break after "}" to fit to kernel coding style.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 5 +---- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 3 --- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 8 +------- 3 files changed, 2 insertions(+), 14 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +1 -4
@@ -239,14 +239,11 @@ enum _RTL8192PCI_HW { RATR_MCS11 | RATR_MCS12 | RATR_MCS13 | \ RATR_MCS14|RATR_MCS15) -DRIVER_RSSI =0x32c ,MCS_TXAGC =0x340 ,CCK_TXAGC =0x348 , MacBlkCtrl = 0x403, - -} -; +};#define GPI 0x108
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -3
@@ -203,8 +203,6 @@ struct rtl8192_tx_ring {struct sk_buff_head queue; }; - -struct rtl819x_ops {enum nic_t nic_type;void (*get_eeprom_size)(struct net_device *dev);
@@ -264,7 +262,6 @@ struct r8192_priv {enum rt_customer_id customer_id; -enum rt_rf_type_819xu rf_chip;enum ht_channel_width current_chnl_bw;struct bb_reg_definition phy_reg_def[4 ];
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +1 -7
@@ -7,7 +7,6 @@#ifndef __R8192UDM_H__#define __R8192UDM_H__ -/*--------------------------Define Parameters-------------------------------*/ #define OFDM_Table_Length 19#define CCK_Table_length 12
@@ -49,7 +48,6 @@/*--------------------------Define Parameters-------------------------------*/ -/*------------------------------Define structure----------------------------*/ struct dig_t {u8 dig_enable_flag;
@@ -88,7 +86,6 @@ enum dm_dig_sta {DM_STA_DIG_MAX }; -enum dm_ratr_sta {DM_RATR_STA_HIGH =0 ,DM_RATR_STA_MIDDLE =1 ,
@@ -148,14 +145,13 @@ enum dm_cck_rx_path_method { CCK_Rx_Version_MAX }; -struct dcmd_txcmd {u32 op;u32 length;u32 value; }; -/*------------------------------Define structure----------------------------*/ +/*------------------------------Define structure----------------------------*/ /*------------------------Export global variable----------------------------*/ extern struct dig_t dm_digtable;
@@ -170,7 +166,6 @@ extern const u8 dm_cck_tx_bb_gain_ch14[CCK_TX_BB_GAIN_TABLE_LEN][8];/*------------------------Export global variable----------------------------*/ -/*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/
@@ -179,7 +174,6 @@ void rtl92e_dm_deinit(struct net_device *dev);void rtl92e_dm_watchdog (struct net_device *dev); -void rtl92e_init_adaptive_rate (struct net_device *dev);void rtl92e_dm_txpower_tracking_wq (void *data);
Signature · 1 line
2.39.1
PATCH 4/10 staging: rtl8192e: Rename MacBlkCtrl and remove double definition
In reply to Philipp HortmannRename constant MacBlkCtrl to MAC_BLK_CTRL to avoid CamelCase which is not accepted by checkpatch. Remove double definition.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 2 +- drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 2 -- drivers/staging/rtl8192e/rtl8192e/rtl_pm.c | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -1
@@ -1861,7 +1861,7 @@ void rtl92e_stop_adapter(struct net_device *dev, bool reset)rtl92e_writeb (dev,PMR ,0x5 ); -rtl92e_writeb (dev, MacBlkCtrl,0xa ); +rtl92e_writeb (dev,MAC_BLK_CTRL ,0xa ); } }
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +1 -1
@@ -242,7 +242,7 @@ enum _RTL8192PCI_HW {DRIVER_RSSI =0x32c ,MCS_TXAGC =0x340 ,CCK_TXAGC =0x348 , - MacBlkCtrl = 0x403, + MAC_BLK_CTRL = 0x403, };#define GPI 0x108
drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h +0 -2
@@ -42,8 +42,6 @@#define CCK_TXAGC 0x348/* Mac block on/off control register */ -#define MacBlkCtrl 0x403 -#define rFPGA0_RFMOD 0x800/* RF mode & CCK TxSC */ #define rFPGA0_TxInfo 0x804#define rFPGA0_PSDFunction 0x808
drivers/staging/rtl8192e/rtl8192e/rtl_pm.c +1 -1
@@ -41,7 +41,7 @@ int rtl92e_suspend(struct device *dev_d)rtl92e_writel (dev,WFCRC1 ,0xffffffff );rtl92e_writel (dev,WFCRC2 ,0xffffffff );rtl92e_writeb (dev,PMR ,0x5 ); -rtl92e_writeb (dev, MacBlkCtrl,0xa ); +rtl92e_writeb (dev,MAC_BLK_CTRL ,0xa ); } out_pci_suspend: netdev_info(dev, "WOL is %s\n", priv->rtllib->bSupportRemoteWakeUp ?
Signature · 1 line
2.39.1
PATCH 5/10 staging: rtl8192e: Rename OFDM_Table.., CCK_Table_.. and RxPathSelecti..
In reply to Philipp HortmannRename constants OFDM_Table_Length to OFDM_TABLE_LEN, CCK_Table_length to CCK_TABLE_LEN and RxPathSelection_SS_TH_low to RX_PATH_SEL_SS_TH_LOW to avoid CamelCase which is not accepted by checkpatch.
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 24 +++++++++++----------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +12 -12
@@ -455,7 +455,7 @@ static void _rtl92e_dm_bandwidth_autoswitch(struct net_device *dev) } } -static u32 OFDMSwingTable[OFDM_Table_Length] = { +static u32 OFDMSwingTable[OFDM_TABLE_LEN ] = {0x7f8001fe ,0x71c001c7 ,0x65400195 ,
@@ -477,7 +477,7 @@ static u32 OFDMSwingTable[OFDM_Table_Length] = {0x10000040 }; -static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8 ] = { +static u8 CCKSwingTable_Ch1_Ch13[CCK_TABLE_LEN ][8 ] = { {0x36 ,0x35 ,0x2e ,0x25 ,0x1c ,0x12 ,0x09 ,0x04 }, {0x30 ,0x2f ,0x29 ,0x21 ,0x19 ,0x10 ,0x08 ,0x03 }, {0x2b ,0x2a ,0x25 ,0x1e ,0x16 ,0x0e ,0x07 ,0x03 },
@@ -492,7 +492,7 @@ static u8 CCKSwingTable_Ch1_Ch13[CCK_Table_length][8] = { {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01} }; -static u8 CCKSwingTable_Ch14[CCK_Table_length][8 ] = { +static u8 CCKSwingTable_Ch14[CCK_TABLE_LEN ][8 ] = { {0x36 ,0x35 ,0x2e ,0x1b ,0x00 ,0x00 ,0x00 ,0x00 }, {0x30 ,0x2f ,0x29 ,0x18 ,0x00 ,0x00 ,0x00 ,0x00 }, {0x2b ,0x2a ,0x25 ,0x15 ,0x00 ,0x00 ,0x00 ,0x00 },
@@ -771,13 +771,13 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)if (!priv->tx_pwr_tracking_init) { tmpRegA =rtl92e_get_bb_reg (dev, rOFDM0_XATxIQImbalance, bMaskDWord); -for (i =0 ; i < OFDM_Table_Length; i++) { +for (i =0 ; i <OFDM_TABLE_LEN ; i++) {if (tmpRegA == OFDMSwingTable[i]) priv->ofdm_index[0 ] = i; } TempCCk =rtl92e_get_bb_reg (dev, rCCK0_TxFilter1, bMaskByte2); -for (i =0 ; i < CCK_Table_length; i++) { +for (i =0 ; i <CCK_TABLE_LEN ; i++) {if (TempCCk == (u32 )CCKSwingTable_Ch1_Ch13[i][0 ]) { priv->cck_index = i;break ;
@@ -799,12 +799,12 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev) tmpOFDMindex = tmpCCK20Mindex =6 +(priv->thermal_meter[0 ] - (u8 )tmpRegA); tmpCCK40Mindex = tmpCCK20Mindex -6 ; -if (tmpOFDMindex >= OFDM_Table_Length) - tmpOFDMindex = OFDM_Table_Length-1 ; -if (tmpCCK20Mindex >= CCK_Table_length) - tmpCCK20Mindex = CCK_Table_length-1 ; -if (tmpCCK40Mindex >= CCK_Table_length) - tmpCCK40Mindex = CCK_Table_length-1 ; +if (tmpOFDMindex >=OFDM_TABLE_LEN ) + tmpOFDMindex =OFDM_TABLE_LEN -1 ; +if (tmpCCK20Mindex >=CCK_TABLE_LEN ) + tmpCCK20Mindex =CCK_TABLE_LEN -1 ; +if (tmpCCK40Mindex >=CCK_TABLE_LEN ) + tmpCCK40Mindex =CCK_TABLE_LEN -1 ; }else { tmpval = (u8 )tmpRegA - priv->thermal_meter[0 ];if (tmpval >=6 ) {
@@ -1732,7 +1732,7 @@ static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev)struct r8192_priv *priv =rtllib_priv (dev); DM_RxPathSelTable.Enable =1 ; - DM_RxPathSelTable.SS_TH_low = RxPathSelection_SS_TH_low; + DM_RxPathSelTable.SS_TH_low =RX_PATH_SEL_SS_TH_LOW ; DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;if (priv->customer_id ==RT_CID_819X_NETCORE ) DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +3 -3
@@ -8,8 +8,8 @@#define __R8192UDM_H__/*--------------------------Define Parameters-------------------------------*/ -#define OFDM_Table_Length 19 -#define CCK_Table_length 12 +#define OFDM_TABLE_LEN 19 +#define CCK_TABLE_LEN 12#define DM_DIG_THRESH_HIGH 40#define DM_DIG_THRESH_LOW 35
@@ -25,7 +25,7 @@#define DM_DIG_MIN 0x1c#define DM_DIG_MIN_Netcore 0x12 -#define RxPathSelection_SS_TH_low 30 +#define RX_PATH_SEL_SS_TH_LOW 30#define RxPathSelection_diff_TH 18#define RateAdaptiveTH_High 50
Signature · 1 line
2.39.1
PATCH 6/10 staging: rtl8192e: Rename RxPathSelectio.., RateAdaptive.. and RateAdap..
In reply to Philipp HortmannRename constants RxPathSelection_diff_TH to RX_PATH_SEL_DIFF_TH, RateAdaptiveTH_High to RATE_ADAPTIVE_TH_HIGH and RateAdaptiveTH_Low_20M to RATE_ADAPTIVE_TH_LOW_20M to avoid CamelCase which is not accepted by checkpatch.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 8 ++++---- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 10 +++++----- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +4 -4
@@ -2017,20 +2017,20 @@ bool rtl92e_is_rx_stuck(struct net_device *dev)u8 SilentResetRxSoltNum =4 ; rx_chk_cnt++; -if (priv->undecorated_smoothed_pwdb >= (RateAdaptiveTH_High+5 )) { +if (priv->undecorated_smoothed_pwdb >= (RATE_ADAPTIVE_TH_HIGH +5 )) { rx_chk_cnt =0 ; - }else if ((priv->undecorated_smoothed_pwdb < (RateAdaptiveTH_High +5 )) + }else if ((priv->undecorated_smoothed_pwdb < (RATE_ADAPTIVE_TH_HIGH +5 )) && (((priv->current_chnl_bw !=HT_CHANNEL_WIDTH_20 ) && (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_40M)) || ((priv->current_chnl_bw ==HT_CHANNEL_WIDTH_20 ) && - (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M)))) { + (priv->undecorated_smoothed_pwdb >=RATE_ADAPTIVE_TH_LOW_20M )))) {if (rx_chk_cnt <2 )return bStuck; rx_chk_cnt =0 ; }else if ((((priv->current_chnl_bw !=HT_CHANNEL_WIDTH_20 ) && (priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M)) || ((priv->current_chnl_bw ==HT_CHANNEL_WIDTH_20 ) && - (priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_20M))) && + (priv->undecorated_smoothed_pwdb <RATE_ADAPTIVE_TH_LOW_20M ))) && priv->undecorated_smoothed_pwdb >= VeryLowRSSI) {if (rx_chk_cnt <4 )return bStuck;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +5 -5
@@ -282,12 +282,12 @@ void rtl92e_init_adaptive_rate(struct net_device *dev)struct rate_adaptive *pra = &priv->rate_adaptive; pra->ratr_state =DM_RATR_STA_MAX ; - pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High; - pra->low2high_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M+5 ; + pra->high2low_rssi_thresh_for_ra =RATE_ADAPTIVE_TH_HIGH ; + pra->low2high_rssi_thresh_for_ra20M =RATE_ADAPTIVE_TH_LOW_20M +5 ; pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5 ; - pra->high_rssi_thresh_for_ra = RateAdaptiveTH_High+5 ; - pra->low_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M; + pra->high_rssi_thresh_for_ra =RATE_ADAPTIVE_TH_HIGH +5 ; + pra->low_rssi_thresh_for_ra20M =RATE_ADAPTIVE_TH_LOW_20M ; pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M;if (priv->customer_id ==RT_CID_819X_NETCORE )
@@ -1733,7 +1733,7 @@ static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev) DM_RxPathSelTable.Enable =1 ; DM_RxPathSelTable.SS_TH_low =RX_PATH_SEL_SS_TH_LOW ; - DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH; + DM_RxPathSelTable.diff_TH =RX_PATH_SEL_DIFF_TH ;if (priv->customer_id ==RT_CID_819X_NETCORE ) DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;else
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +3 -3
@@ -26,10 +26,10 @@#define DM_DIG_MIN_Netcore 0x12#define RX_PATH_SEL_SS_TH_LOW 30 -#define RxPathSelection_diff_TH 18 +#define RX_PATH_SEL_DIFF_TH 18 -#define RateAdaptiveTH_High 50 -#define RateAdaptiveTH_Low_20M 30 +#define RATE_ADAPTIVE_TH_HIGH 50 +#define RATE_ADAPTIVE_TH_LOW_20M 30#define RateAdaptiveTH_Low_40M 10#define VeryLowRSSI 15
Signature · 1 line
2.39.1
PATCH 7/10 staging: rtl8192e: Rename RateAdaptiveTH.., VeryLowRSSI and WAIotTHVal
In reply to Philipp HortmannRename constants RateAdaptiveTH_Low_40M to RATE_ADAPTIVE_TH_LOW_40M, VeryLowRSSI to VERY_LOW_RSSI and WAIotTHVal to WA_IOT_TH_VAL to avoid CamelCase which is not accepted by checkpatch.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 6 +++--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 +++--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +3 -3
@@ -2021,17 +2021,17 @@ bool rtl92e_is_rx_stuck(struct net_device *dev) rx_chk_cnt =0 ; }else if ((priv->undecorated_smoothed_pwdb < (RATE_ADAPTIVE_TH_HIGH +5 )) && (((priv->current_chnl_bw !=HT_CHANNEL_WIDTH_20 ) && - (priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_40M)) + (priv->undecorated_smoothed_pwdb >=RATE_ADAPTIVE_TH_LOW_40M )) || ((priv->current_chnl_bw ==HT_CHANNEL_WIDTH_20 ) && (priv->undecorated_smoothed_pwdb >=RATE_ADAPTIVE_TH_LOW_20M )))) {if (rx_chk_cnt <2 )return bStuck; rx_chk_cnt =0 ; }else if ((((priv->current_chnl_bw !=HT_CHANNEL_WIDTH_20 ) && - (priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M)) || + (priv->undecorated_smoothed_pwdb <RATE_ADAPTIVE_TH_LOW_40M )) || ((priv->current_chnl_bw ==HT_CHANNEL_WIDTH_20 ) && (priv->undecorated_smoothed_pwdb <RATE_ADAPTIVE_TH_LOW_20M ))) && - priv->undecorated_smoothed_pwdb >= VeryLowRSSI) { + priv->undecorated_smoothed_pwdb >=VERY_LOW_RSSI ) {if (rx_chk_cnt <4 )return bStuck; rx_chk_cnt =0 ;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +3 -3
@@ -284,11 +284,11 @@ void rtl92e_init_adaptive_rate(struct net_device *dev) pra->ratr_state =DM_RATR_STA_MAX ; pra->high2low_rssi_thresh_for_ra =RATE_ADAPTIVE_TH_HIGH ; pra->low2high_rssi_thresh_for_ra20M =RATE_ADAPTIVE_TH_LOW_20M +5 ; - pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5 ; + pra->low2high_rssi_thresh_for_ra40M =RATE_ADAPTIVE_TH_LOW_40M +5 ; pra->high_rssi_thresh_for_ra =RATE_ADAPTIVE_TH_HIGH +5 ; pra->low_rssi_thresh_for_ra20M =RATE_ADAPTIVE_TH_LOW_20M ; - pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M; + pra->low_rssi_thresh_for_ra40M =RATE_ADAPTIVE_TH_LOW_40M ;if (priv->customer_id ==RT_CID_819X_NETCORE ) pra->ping_rssi_enable =1 ;
@@ -1649,7 +1649,7 @@ static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev)struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; ht_info->bWAIotBroadcom = false; - ht_info->WAIotTH = WAIotTHVal; + ht_info->WAIotTH =WA_IOT_TH_VAL ; }static void _rtl92e_dm_check_rf_ctrl_gpio (void *data)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +3 -3
@@ -30,10 +30,10 @@#define RATE_ADAPTIVE_TH_HIGH 50#define RATE_ADAPTIVE_TH_LOW_20M 30 -#define RateAdaptiveTH_Low_40M 10 -#define VeryLowRSSI 15 +#define RATE_ADAPTIVE_TH_LOW_40M 10 +#define VERY_LOW_RSSI 15 -#define WAIotTHVal 25 +#define WA_IOT_TH_VAL 25#define E_FOR_TX_POWER_TRACK 300#define TX_POWER_NEAR_FIELD_THRESH_HIGH 68
Signature · 1 line
2.39.1
PATCH 8/10 staging: rtl8192e: Rename Enable, cck_Rx_path and SS_TH_low
In reply to Philipp HortmannRename variables Enable to enable, cck_Rx_path to cck_rx_path and SS_TH_low to ss_th_low to avoid CamelCase which is not accepted by checkpatch.
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 14 +++++++------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +7 -7
@@ -1720,7 +1720,7 @@ void rtl92e_dm_rf_pathcheck_wq(void *data)else priv->brfpath_rxenable[i] = false; } -if (!DM_RxPathSelTable.Enable) +if (!DM_RxPathSelTable.enable)return ;_rtl92e_dm_rx_path_sel_byrssi (dev);
@@ -1731,8 +1731,8 @@ static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev)u8 i;struct r8192_priv *priv =rtllib_priv (dev); - DM_RxPathSelTable.Enable =1 ; - DM_RxPathSelTable.SS_TH_low =RX_PATH_SEL_SS_TH_LOW ; + DM_RxPathSelTable.enable =1 ; + DM_RxPathSelTable.ss_th_low =RX_PATH_SEL_SS_TH_LOW ; DM_RxPathSelTable.diff_TH =RX_PATH_SEL_DIFF_TH ;if (priv->customer_id ==RT_CID_819X_NETCORE ) DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
@@ -1769,7 +1769,7 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev)return ;if (!cck_Rx_Path_initialized) { - DM_RxPathSelTable.cck_Rx_path = (rtl92e_readb (dev,0xa07 )&0xf ); + DM_RxPathSelTable.cck_rx_path = (rtl92e_readb (dev,0xa07 )&0xf ); cck_Rx_Path_initialized =1 ; }
@@ -1901,7 +1901,7 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) update_cck_rx_path =1 ; } -if (tmp_min_rssi < DM_RxPathSelTable.SS_TH_low && disabled_rf_cnt <2 ) { +if (tmp_min_rssi < DM_RxPathSelTable.ss_th_low && disabled_rf_cnt <2 ) {if ((tmp_max_rssi - tmp_min_rssi) >= DM_RxPathSelTable.diff_TH) { DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] =
@@ -1921,10 +1921,10 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) }if (update_cck_rx_path) { - DM_RxPathSelTable.cck_Rx_path = (cck_default_Rx<<2 ) | + DM_RxPathSelTable.cck_rx_path = (cck_default_Rx<<2 ) | (cck_optional_Rx);rtl92e_set_bb_reg (dev, rCCK0_AFESetting,0x0f000000 , - DM_RxPathSelTable.cck_Rx_path); + DM_RxPathSelTable.cck_rx_path); }if (DM_RxPathSelTable.disabledRF) {
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +3 -3
@@ -125,11 +125,11 @@ enum dm_dig_cs_ratio { };struct drx_path_sel { -u8 Enable; +u8 enable;u8 cck_method; -u8 cck_Rx_path; +u8 cck_rx_path; -u8 SS_TH_low; +u8 ss_th_low;u8 diff_TH;u8 disabledRF;u8 reserved;
Signature · 1 line
2.39.1
PATCH 9/10 staging: rtl8192e: Rename diff_TH and disabledRF
In reply to Philipp HortmannRename variables diff_TH to diff_th and disabledRF to disabled_rf to avoid CamelCase which is not accepted by checkpatch.
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 14 +++++++------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +7 -7
@@ -1733,12 +1733,12 @@ static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev) DM_RxPathSelTable.enable =1 ; DM_RxPathSelTable.ss_th_low =RX_PATH_SEL_SS_TH_LOW ; - DM_RxPathSelTable.diff_TH =RX_PATH_SEL_DIFF_TH ; + DM_RxPathSelTable.diff_th =RX_PATH_SEL_DIFF_TH ;if (priv->customer_id ==RT_CID_819X_NETCORE ) DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;else DM_RxPathSelTable.cck_method = CCK_Rx_Version_1; - DM_RxPathSelTable.disabledRF =0 ; + DM_RxPathSelTable.disabled_rf =0 ;for (i =0 ; i <4 ; i++) { DM_RxPathSelTable.rf_rssi[i] =50 ; DM_RxPathSelTable.cck_pwdb_sta[i] =-64 ;
@@ -1773,8 +1773,8 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) cck_Rx_Path_initialized =1 ; } - DM_RxPathSelTable.disabledRF =0xf ; - DM_RxPathSelTable.disabledRF &= ~(rtl92e_readb (dev,0xc04 )); + DM_RxPathSelTable.disabled_rf =0xf ; + DM_RxPathSelTable.disabled_rf &= ~(rtl92e_readb (dev,0xc04 ));if (priv->rtllib->mode ==WIRELESS_MODE_B ) DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;
@@ -1903,7 +1903,7 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev)if (tmp_min_rssi < DM_RxPathSelTable.ss_th_low && disabled_rf_cnt <2 ) {if ((tmp_max_rssi - tmp_min_rssi) >= - DM_RxPathSelTable.diff_TH) { + DM_RxPathSelTable.diff_th) { DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] = tmp_max_rssi+5 ; rtl92e_set_bb_reg(dev, rOFDM0_TRxPathEnable,
@@ -1927,9 +1927,9 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) DM_RxPathSelTable.cck_rx_path); } -if (DM_RxPathSelTable.disabledRF) { +if (DM_RxPathSelTable.disabled_rf) {for (i =0 ; i <4 ; i++) { -if ((DM_RxPathSelTable.disabledRF>>i) &0x1 ) { +if ((DM_RxPathSelTable.disabled_rf >> i) &0x1 ) {if (tmp_max_rssi >= DM_RxPathSelTable.rf_enable_rssi_th[i]) { rtl92e_set_bb_reg(dev,
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +2 -2
@@ -130,8 +130,8 @@ struct drx_path_sel {u8 cck_rx_path;u8 ss_th_low; -u8 diff_TH; -u8 disabledRF; +u8 diff_th; +u8 disabled_rf;u8 reserved;u8 rf_rssi[4 ];
Signature · 1 line
2.39.1
PATCH 10/10 staging: rtl8192e: Rename DM_RxPathSelTable
In reply to Philipp HortmannRename variable DM_RxPathSelTable to dm_rx_path_sel_table to avoid CamelCase which is not accepted by checkpatch. Remove "extern struct drx_path_sel DM_RxPathSelTable;" in rtl_dm.h as it is dead code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 60 +++++++++++----------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 1 - 2 files changed, 30 insertions(+), 31 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +30 -30
@@ -144,7 +144,7 @@ const u8 dm_cck_tx_bb_gain_ch14[CCK_TX_BB_GAIN_TABLE_LEN][8] = {/*------------------------Define global variable-----------------------------*/ struct dig_t dm_digtable; -struct drx_path_sel DM_RxPathSelTable; +struct drx_path_sel dm_rx_path_sel_table;/*------------------------Define global variable-----------------------------*/
@@ -1720,7 +1720,7 @@ void rtl92e_dm_rf_pathcheck_wq(void *data)else priv->brfpath_rxenable[i] = false; } -if (!DM_RxPathSelTable.enable) +if (!dm_rx_path_sel_table.enable)return ;_rtl92e_dm_rx_path_sel_byrssi (dev);
@@ -1731,18 +1731,18 @@ static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev)u8 i;struct r8192_priv *priv =rtllib_priv (dev); - DM_RxPathSelTable.enable =1 ; - DM_RxPathSelTable.ss_th_low =RX_PATH_SEL_SS_TH_LOW ; - DM_RxPathSelTable.diff_th =RX_PATH_SEL_DIFF_TH ; + dm_rx_path_sel_table.enable =1 ; + dm_rx_path_sel_table.ss_th_low =RX_PATH_SEL_SS_TH_LOW ; + dm_rx_path_sel_table.diff_th =RX_PATH_SEL_DIFF_TH ;if (priv->customer_id ==RT_CID_819X_NETCORE ) - DM_RxPathSelTable.cck_method = CCK_Rx_Version_2; + dm_rx_path_sel_table.cck_method = CCK_Rx_Version_2;else - DM_RxPathSelTable.cck_method = CCK_Rx_Version_1; - DM_RxPathSelTable.disabled_rf =0 ; + dm_rx_path_sel_table.cck_method = CCK_Rx_Version_1; + dm_rx_path_sel_table.disabled_rf =0 ;for (i =0 ; i <4 ; i++) { - DM_RxPathSelTable.rf_rssi[i] =50 ; - DM_RxPathSelTable.cck_pwdb_sta[i] =-64 ; - DM_RxPathSelTable.rf_enable_rssi_th[i] =100 ; + dm_rx_path_sel_table.rf_rssi[i] =50 ; + dm_rx_path_sel_table.cck_pwdb_sta[i] =-64 ; + dm_rx_path_sel_table.rf_enable_rssi_th[i] =100 ; } }
@@ -1769,22 +1769,22 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev)return ;if (!cck_Rx_Path_initialized) { - DM_RxPathSelTable.cck_rx_path = (rtl92e_readb (dev,0xa07 )&0xf ); + dm_rx_path_sel_table.cck_rx_path = (rtl92e_readb (dev,0xa07 )&0xf ); cck_Rx_Path_initialized =1 ; } - DM_RxPathSelTable.disabled_rf =0xf ; - DM_RxPathSelTable.disabled_rf &= ~(rtl92e_readb (dev,0xc04 )); + dm_rx_path_sel_table.disabled_rf =0xf ; + dm_rx_path_sel_table.disabled_rf &= ~(rtl92e_readb (dev,0xc04 ));if (priv->rtllib->mode ==WIRELESS_MODE_B ) - DM_RxPathSelTable.cck_method = CCK_Rx_Version_2; + dm_rx_path_sel_table.cck_method = CCK_Rx_Version_2;for (i =0 ; i <RF90_PATH_MAX ; i++) { - DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i]; + dm_rx_path_sel_table.rf_rssi[i] = priv->stats.rx_rssi_percentage[i];if (priv->brfpath_rxenable[i]) { rf_num++; - cur_rf_rssi = DM_RxPathSelTable.rf_rssi[i]; + cur_rf_rssi = dm_rx_path_sel_table.rf_rssi[i];if (rf_num ==1 ) { max_rssi_index = min_rssi_index = sec_rssi_index = i;
@@ -1832,12 +1832,12 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) } rf_num =0 ; -if (DM_RxPathSelTable.cck_method == CCK_Rx_Version_2) { +if (dm_rx_path_sel_table.cck_method == CCK_Rx_Version_2) {for (i =0 ; i <RF90_PATH_MAX ; i++) {if (priv->brfpath_rxenable[i]) { rf_num++; cur_cck_pwdb = - DM_RxPathSelTable.cck_pwdb_sta[i]; + dm_rx_path_sel_table.cck_pwdb_sta[i];if (rf_num ==1 ) { cck_rx_ver2_max_index = i;
@@ -1894,17 +1894,17 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) } update_cck_rx_path =0 ; -if (DM_RxPathSelTable.cck_method == CCK_Rx_Version_2) { +if (dm_rx_path_sel_table.cck_method == CCK_Rx_Version_2) { cck_default_Rx = cck_rx_ver2_max_index; cck_optional_Rx = cck_rx_ver2_sec_index;if (tmp_cck_max_pwdb !=-64 ) update_cck_rx_path =1 ; } -if (tmp_min_rssi < DM_RxPathSelTable.ss_th_low && disabled_rf_cnt <2 ) { +if (tmp_min_rssi < dm_rx_path_sel_table.ss_th_low && disabled_rf_cnt <2 ) {if ((tmp_max_rssi - tmp_min_rssi) >= - DM_RxPathSelTable.diff_th) { - DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] = + dm_rx_path_sel_table.diff_th) { + dm_rx_path_sel_table.rf_enable_rssi_th[min_rssi_index] = tmp_max_rssi+5 ;rtl92e_set_bb_reg (dev, rOFDM0_TRxPathEnable,0x1 <<min_rssi_index,0x0 );
@@ -1912,7 +1912,7 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) 0x1<<min_rssi_index, 0x0); disabled_rf_cnt++; } -if (DM_RxPathSelTable.cck_method == CCK_Rx_Version_1) { +if (dm_rx_path_sel_table.cck_method == CCK_Rx_Version_1) { cck_default_Rx = max_rssi_index; cck_optional_Rx = sec_rssi_index;if (tmp_max_rssi)
@@ -1921,24 +1921,24 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev) }if (update_cck_rx_path) { - DM_RxPathSelTable.cck_rx_path = (cck_default_Rx<<2 ) | + dm_rx_path_sel_table.cck_rx_path = (cck_default_Rx<<2 ) | (cck_optional_Rx);rtl92e_set_bb_reg (dev, rCCK0_AFESetting,0x0f000000 , - DM_RxPathSelTable.cck_rx_path); + dm_rx_path_sel_table.cck_rx_path); } -if (DM_RxPathSelTable.disabled_rf) { +if (dm_rx_path_sel_table.disabled_rf) {for (i =0 ; i <4 ; i++) { -if ((DM_RxPathSelTable.disabled_rf >> i) &0x1 ) { +if ((dm_rx_path_sel_table.disabled_rf >> i) &0x1 ) {if (tmp_max_rssi >= - DM_RxPathSelTable.rf_enable_rssi_th[i]) { + dm_rx_path_sel_table.rf_enable_rssi_th[i]) {rtl92e_set_bb_reg (dev, rOFDM0_TRxPathEnable,0x1 << i,0x1 );rtl92e_set_bb_reg (dev, rOFDM1_TRxPathEnable,0x1 << i,0x1 ); - DM_RxPathSelTable.rf_enable_rssi_th[i] + dm_rx_path_sel_table.rf_enable_rssi_th[i] =100 ; disabled_rf_cnt--; }
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +0 -1
@@ -155,7 +155,6 @@ struct dcmd_txcmd {/*------------------------Export global variable----------------------------*/ extern struct dig_t dm_digtable; -extern struct drx_path_sel DM_RxPathSelTable;/* Pre-calculated gain tables */ extern const u32 dm_tx_bb_gain[TX_BB_GAIN_TABLE_LEN ];
Signature · 1 line
2.39.1
Greg Kroah-Hartman
maintainerRe: [PATCH 02/10] staging: rtl8192e: Calculate definition of MSR_LINK_MASK
In reply to Philipp HortmannQuoted 13 lines · Philipp Hortmann
Calculate definition of
MSR_LINK_MASK((1<<0)|(1<<1)) = 3. Equation is not accepted by checkpatch because of missing spaces.Signed-off-by Philipp Hortmann <[email protected]>--- drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +0
-0
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h enum _RTL8192PCI_HW { · line 173
Quoted 5 lines
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +1
-1@@ -170,7 +170,7 @@ enum _RTL8192PCI_HW {#define BW_OPMODE_20MHZ BIT2 IC_VERRSION = 0x301, MSR = 0x303, -#define MSR_LINK_MASK ((1<<0)|(1<<1)) +#define MSR_LINK_MASK 3
This is a bit field, it should be:
#define MSR_LINK_MASK (BIT(1) | BIT(0))
right?
thanks,
greg k-h
Re: [PATCH 02/10] staging: rtl8192e: Calculate definition of MSR_LINK_MASK
Quoted 3 lines · Greg Kroah-Hartman
Quoted 2 lines · Philipp Hortmann
Calculate definition of
MSR_LINK_MASK((1<<0)|(1<<1)) = 3. Equation is not accepted by checkpatch because of missing spaces.
[]
Quoted 1 line
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
Quoted 1 line
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +0
-0
[]
Quoted 10 lines
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h enum _RTL8192PCI_HW { · line 173
Quoted 6 lines
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h +1
-1@@ -170,7 +170,7 @@ enum _RTL8192PCI_HW {#define BW_OPMODE_20MHZ BIT2 IC_VERRSION = 0x301, MSR = 0x303, -#define MSR_LINK_MASK ((1<<0)|(1<<1)) +#define MSR_LINK_MASK 3This is a bit field, it should be:
#define MSR_LINK_MASK (BIT(1) | BIT(0))right?
Perhaps better as GENMASK(1, 0)