staging: r8188eu: the next set of cleanups
cover staging: r8188eu: the next set of cleanups
This set
- removes some unused structs, enums and defines
- removes set but not used fields from some structures
Tested on x86_64 with Inter-Tech DMG-02.
Michael Straube (11):
staging: r8188eu: remove MAX_CHANNEL_NUM_2G
staging: r8188eu: remove struct rt_channel_plan_2g
staging: r8188eu: remove unused enum and defines
staging: r8188eu: struct rx_hpc is not used
staging: r8188eu: clean up struct rtw_dig
staging: r8188eu: clean up struct sw_ant_switch
staging: r8188eu: struct odm_sta_info is not used
staging: r8188eu: enum hw90_block is not used
staging: r8188eu: remove unneeded comments from Hal8188EPhyCfg.h
staging: r8188eu: remove unused defines from Hal8188EPhyCfg.h
staging: r8188eu: remove unused defines from rtw_eeprom.h
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/hal/odm.c | 11 --- .../staging/r8188eu/include/Hal8188EPhyCfg.h | 34 +------ drivers/staging/r8188eu/include/odm.h | 90 +------------------ drivers/staging/r8188eu/include/rtw_eeprom.h | 31 ------- .../staging/r8188eu/include/rtw_mlme_ext.h | 5 -- drivers/staging/r8188eu/include/rtw_rf.h | 24 ----- 7 files changed, 3 insertions(+), 194 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/11 staging: r8188eu: remove MAX_CHANNEL_NUM_2G
The constants MAX_CHANNEL_NUM_2G and MAX_CHANNEL_NUM have the same value. Remove MAX_CHANNEL_NUM_2G and fix the place where it is used.
--- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- drivers/staging/r8188eu/include/rtw_rf.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/staging/r8188eu/include/rtw_mlme_ext.h +1 -1
@@ -163,7 +163,7 @@ struct rt_channel_plan { };struct rt_channel_plan_2g { -unsigned char Channel[MAX_CHANNEL_NUM_2G ]; +unsigned char Channel[MAX_CHANNEL_NUM ];unsigned char Len; };
drivers/staging/r8188eu/include/rtw_rf.h +0 -5
@@ -19,11 +19,6 @@#define RTL8711_RF_MAX_SENS 6#define RTL8711_RF_DEF_SENS 4 -/* We now define the following channels as the max channels in each -* channel plan. */ -/* 2G, total 14 chnls */ -/* {1,2,3,4,5,6,7,8,9,10,11,12,13,14} */ -#define MAX_CHANNEL_NUM_2G 14#define MAX_CHANNEL_NUM 14/* 2.4 GHz only */ #define NUM_REGULATORYS 1
Signature · 1 line
2.34.1
PATCH 2/11 staging: r8188eu: remove struct rt_channel_plan_2g
In reply to Michael StraubeThe structures rt_channel_plan and rt_channel_plan_2g are identical. Keep rt_channel_plan and remove rt_channel_plan_2g.
--- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-)
drivers/staging/r8188eu/core/rtw_mlme_ext.c +1 -1
@@ -76,7 +76,7 @@ unsigned char MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0,/******************************************************** ChannelPlan definitions *********************************************************/ -static struct rt_channel_plan_2g RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX ] = { +static struct rt_channel_plan RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX ] = { {{1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 },13 },/* 0x00, RT_CHANNEL_DOMAIN_2G_WORLD , Passive scan CH 12, 13 */ {{1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 },13 },/* 0x01, RT_CHANNEL_DOMAIN_2G_ETSI1 */ {{1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 },11 },/* 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 */
drivers/staging/r8188eu/include/rtw_mlme_ext.h +0 -5
@@ -162,11 +162,6 @@ struct rt_channel_plan {unsigned char Len; }; -struct rt_channel_plan_2g { -unsigned char Channel[MAX_CHANNEL_NUM ]; -unsigned char Len; -}; -struct rt_channel_plan_map {unsigned char Index2G; };
Signature · 1 line
2.34.1
PATCH 3/11 staging: r8188eu: remove unused enum and defines
In reply to Michael StraubeRemove the unused enum rf90_radio_path and some unused defines.
--- drivers/staging/r8188eu/include/rtw_eeprom.h | 5 ----- drivers/staging/r8188eu/include/rtw_rf.h | 19 ------------------- 2 files changed, 24 deletions(-)
drivers/staging/r8188eu/include/rtw_eeprom.h +0 -5
@@ -21,11 +21,6 @@#define EEPROM_EWEN_OPCODE 19/* Erase/write enable */ #define EEPROM_EWDS_OPCODE 16/* Erase/write disable */ -/* Country codes */ -#define USA 0x555320 -#define EUROPE 0x1/* temp, should be provided later */ -#define JAPAN 0x2/* temp, should be provided later */ -#define EEPROM_CID_DEFAULT 0x0#define EEPROM_CID_ALPHA 0x1#define EEPROM_CID_Senao 0x3
drivers/staging/r8188eu/include/rtw_rf.h +0 -19
@@ -6,28 +6,16 @@#include "rtw_cmd.h" -#define OFDM_PHY 1 -#define MIXED_PHY 2 -#define CCK_PHY 3 -#define NumRates (13)/* slot time for 11g */ #define SHORT_SLOT_TIME 9#define NON_SHORT_SLOT_TIME 20 -#define RTL8711_RF_MAX_SENS 6 -#define RTL8711_RF_DEF_SENS 4 -#define MAX_CHANNEL_NUM 14/* 2.4 GHz only */ #define NUM_REGULATORYS 1 -/* Country codes */ -#define USA 0x555320 -#define EUROPE 0x1/* temp, should be provided later */ -#define JAPAN 0x2/* temp, should be provided later */ -struct regulatory_class {u32 starting_freq;/* MHz, */ u8 channel_set[MAX_CHANNEL_NUM ];
@@ -64,13 +52,6 @@ enum _REG_PREAMBLE_MODE { PREAMBLE_SHORT = 3, }; -enum rf90_radio_path { -RF90_PATH_A =0 ,/* Radio Path A */ -RF90_PATH_B =1 ,/* Radio Path B */ -RF90_PATH_C =2 ,/* Radio Path C */ -RF90_PATH_D =3 /* Radio Path D */ -}; -/* Bandwidth Offset */ #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0#define HAL_PRIME_CHNL_OFFSET_LOWER 1
Signature · 1 line
2.34.1
PATCH 4/11 staging: r8188eu: struct rx_hpc is not used
In reply to Michael StraubeThe structure rx_hpc is not used. Remove it.
--- drivers/staging/r8188eu/include/odm.h | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/r8188eu/include/odm.h +0 -14
@@ -75,20 +75,6 @@ struct false_alarm_stats {u32 Cnt_BW_LSC;/* Gary */ }; -struct rx_hpc { -u8 RXHP_flag; -u8 PSD_func_trigger; -u8 PSD_bitmap_RXHP[80 ]; -u8 Pre_IGI; -u8 Cur_IGI; -u8 Pre_pw_th; -u8 Cur_pw_th; -bool First_time_enter; -bool RXHP_enable; -u8 TP_Mode; -struct timer_list PSDTimer; -}; -#define ODM_ASSOCIATE_ENTRY_NUM 32/* Max size of AsocEntry[]. */ struct sw_ant_switch {
Signature · 1 line
2.34.1
PATCH 5/11 staging: r8188eu: clean up struct rtw_dig
In reply to Michael StraubeRemove unused and set but never used fields from struct rtw_dig.
--- drivers/staging/r8188eu/hal/odm.c | 11 --------- drivers/staging/r8188eu/include/odm.h | 32 --------------------------- 2 files changed, 43 deletions(-)
drivers/staging/r8188eu/hal/odm.c +0 -11
@@ -146,24 +146,14 @@ static void odm_DIGInit(struct odm_dm_struct *pDM_Odm)struct adapter *adapter = pDM_Odm->Adapter; pDM_DigTable->CurIGValue = (u8 )rtl8188e_PHY_QueryBBReg (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; - pDM_DigTable->FAHighThresh = DM_false_ALARM_THRESH_HIGH; pDM_DigTable->rx_gain_range_max =DM_DIG_MAX_NIC ; pDM_DigTable->rx_gain_range_min =DM_DIG_MIN_NIC ; - pDM_DigTable->BackoffVal =DM_DIG_BACKOFF_DEFAULT ; - pDM_DigTable->BackoffVal_range_max =DM_DIG_BACKOFF_MAX ; - pDM_DigTable->BackoffVal_range_min =DM_DIG_BACKOFF_MIN ; - pDM_DigTable->PreCCK_CCAThres =0xFF ; pDM_DigTable->CurCCK_CCAThres =0x83 ; pDM_DigTable->ForbiddenIGI =DM_DIG_MIN_NIC ; pDM_DigTable->LargeFAHit =0 ; pDM_DigTable->Recover_cnt =0 ; pDM_DigTable->DIG_Dynamic_MIN_0 =DM_DIG_MIN_NIC ; - pDM_DigTable->DIG_Dynamic_MIN_1 =DM_DIG_MIN_NIC ; pDM_DigTable->bMediaConnect_0 = false; - pDM_DigTable->bMediaConnect_1 = false;/* To Initialize pDM_Odm->bDMInitialGainEnable == false to avoid DIG error */ pDM_Odm->bDMInitialGainEnable = true;
@@ -771,7 +761,6 @@ void ODM_Write_CCK_CCA_Thres(struct odm_dm_struct *pDM_Odm, u8 CurCCK_CCAThres)if (pDM_DigTable->CurCCK_CCAThres != CurCCK_CCAThres)/* modify by Guo.Mingzhi 2012-01-03 */ rtw_write8 (pDM_Odm->Adapter,ODM_REG_CCK_CCA_11N , CurCCK_CCAThres); - pDM_DigTable->PreCCK_CCAThres = pDM_DigTable->CurCCK_CCAThres; pDM_DigTable->CurCCK_CCAThres = CurCCK_CCAThres; }
drivers/staging/r8188eu/include/odm.h +0 -32
@@ -5,43 +5,21 @@#define __HALDMOUTSRC_H__struct rtw_dig { -u8 Dig_Enable_Flag; -u8 Dig_Ext_Port_Stage; - -int RssiLowThresh; -int RssiHighThresh; - -u32 FALowThresh; -u32 FAHighThresh; - -u8 CurSTAConnectState; -u8 PreSTAConnectState; -u8 CurMultiSTAConnectState; -u8 PreIGValue;u8 CurIGValue;u8 BackupIGValue; -s8 BackoffVal; -s8 BackoffVal_range_max; -s8 BackoffVal_range_min;u8 rx_gain_range_max;u8 rx_gain_range_min; -u8 Rssi_val_min; -u8 PreCCK_CCAThres;u8 CurCCK_CCAThres; -u8 PreCCKPDState; -u8 CurCCKPDState;u8 LargeFAHit;u8 ForbiddenIGI;u32 Recover_cnt;u8 DIG_Dynamic_MIN_0; -u8 DIG_Dynamic_MIN_1;bool bMediaConnect_0; -bool bMediaConnect_1;u32 AntDiv_RSSI_max;u32 RSSI_max;
@@ -482,12 +460,6 @@ enum odm_bb_config_type { CONFIG_BB_PHY_REG_PG, }; -#define DM_DIG_THRESH_HIGH 40 -#define DM_DIG_THRESH_LOW 35 - -#define DM_false_ALARM_THRESH_LOW 400 -#define DM_false_ALARM_THRESH_HIGH 1000 -#define DM_DIG_MAX_NIC 0x4e#define DM_DIG_MIN_NIC 0x1e/* 0x22/0x1c */
@@ -499,10 +471,6 @@ enum odm_bb_config_type {#define DM_DIG_FA_TH1 0x300/* 0x100 */ #define DM_DIG_FA_TH2 0x400/* 0x200 */ -#define DM_DIG_BACKOFF_MAX 12 -#define DM_DIG_BACKOFF_MIN -4 -#define DM_DIG_BACKOFF_DEFAULT 10 -/* 3=========================================================== */ /* 3 Rate Adaptive */ /* 3=========================================================== */
Signature · 1 line
2.34.1
PATCH 6/11 staging: r8188eu: clean up struct sw_ant_switch
In reply to Michael StraubeRemove unused fields from struct sw_ant_switch.
--- drivers/staging/r8188eu/include/odm.h | 28 +-------------------------- 1 file changed, 1 insertion(+), 27 deletions(-)
drivers/staging/r8188eu/include/odm.h +1 -27
@@ -56,34 +56,8 @@ struct false_alarm_stats {#define ODM_ASSOCIATE_ENTRY_NUM 32/* Max size of AsocEntry[]. */ struct sw_ant_switch { -u8 try_flag; -s32 PreRSSI;u8 CurAntenna; -u8 PreAntenna; -u8 RSSI_Trying; -u8 TestMode; -u8 bTriggerAntennaSwitch; -u8 SelectAntennaMap; -u8 RSSI_target; - -/* Before link Antenna Switch check */ -u8 SWAS_NoLink_State; -u32 SWAS_NoLink_BK_Reg860; - -s32 RSSI_sum_A; -s32 RSSI_sum_B; -s32 RSSI_cnt_A; -s32 RSSI_cnt_B; -u64 lastTxOkCnt; -u64 lastRxOkCnt; -u64 TXByteCnt_A; -u64 TXByteCnt_B; -u64 RXByteCnt_A; -u64 RXByteCnt_B; -u8 TrafficLoad; -struct timer_list SwAntennaSwitchTimer; -u8 TxAnt[ODM_ASSOCIATE_ENTRY_NUM ]; -u8 TargetSTA; +u8 SWAS_NoLink_State;/* Before link Antenna Switch check */ u8 RxIdleAnt; };
Signature · 1 line
2.34.1
PATCH 7/11 staging: r8188eu: struct odm_sta_info is not used
In reply to Michael StraubeThe structure odm_sta_info is not used. Remove it.
--- drivers/staging/r8188eu/include/odm.h | 16 ---------------- 1 file changed, 16 deletions(-)
drivers/staging/r8188eu/include/odm.h +0 -16
@@ -116,22 +116,6 @@ enum odm_ability {ODM_PSD2AFH =0x00000800 }; -/* 2011/20/20 MH For MP driver RT_WLAN_STA = struct sta_info */ -/* Please declare below ODM relative info in your STA info structure. */ - -struct odm_sta_info { -/* Driver Write */ -bool bUsed;/* record the sta status link or not? */ -u8 IOTPeer;/* Enum value. HT_IOT_PEER_E */ - -/* ODM Write */ -/* 1 PHY_STATUS_INFO */ -u8 RSSI_Path[4 ];/* */ -u8 RSSI_Ave; -u8 RXEVM[4 ]; -u8 RXSNR[4 ]; -}; -/* 2011/10/20 MH Define Common info enum for all team. */ enum odm_common_info_def {
Signature · 1 line
2.34.1
PATCH 8/11 staging: r8188eu: enum hw90_block is not used
In reply to Michael StraubeThe enumeration hw90_block is not used. Remove it.
--- drivers/staging/r8188eu/include/Hal8188EPhyCfg.h | 8 -------- 1 file changed, 8 deletions(-)
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -8
@@ -17,14 +17,6 @@/*------------------------------Define structure----------------------------*/ -enum hw90_block { -HW90_BLOCK_MAC =0 , -HW90_BLOCK_PHY0 =1 , -HW90_BLOCK_PHY1 =2 , -HW90_BLOCK_RF =3 , -HW90_BLOCK_MAXIMUM =4 ,/* Never use this */ -}; -enum rf_radio_path {RF_PATH_A =0 ,/* Radio Path A */ RF_PATH_B =1 ,/* Radio Path B */
Signature · 1 line
2.34.1
PATCH 9/11 staging: r8188eu: remove unneeded comments from Hal8188EPhyCfg.h
In reply to Michael StraubeRemove unneeded comments from Hal8188EPhyCfg.h.
--- .../staging/r8188eu/include/Hal8188EPhyCfg.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +1 -18
@@ -4,7 +4,6 @@#ifndef __INC_HAL8188EPHYCFG_H__#define __INC_HAL8188EPHYCFG_H__ -/*--------------------------Define Parameters-------------------------------*/ #define LOOP_LIMIT 5#define MAX_STALL_TIME 50/* us */ #define AntennaDiversityValue 0x80
@@ -13,10 +12,6 @@#define MAX_AGGR_NUM 0x07 -/*--------------------------Define Parameters-------------------------------*/ - -/*------------------------------Define structure----------------------------*/ -enum rf_radio_path {RF_PATH_A =0 ,/* Radio Path A */ RF_PATH_B =1 ,/* Radio Path B */
@@ -81,18 +76,7 @@ struct bb_reg_def {* Path A and B */ }; -/*------------------------------Define structure----------------------------*/ - -/*------------------------Export global variable----------------------------*/ -/*------------------------Export global variable----------------------------*/ - -/*------------------------Export Marco Definition---------------------------*/ -/*------------------------Export Marco Definition---------------------------*/ - -/*--------------------------Exported Function prototype---------------------*/ -/* */ /* 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);
@@ -119,6 +103,5 @@ void PHY_SwChnl8188E(struct adapter *adapter, u8 channel);void storePwrIndexDiffRateOffset (struct adapter *adapter,u32 regaddr,u32 mask,u32 data); -/*--------------------------Exported Function prototype---------------------*/ -#endif /* __INC_HAL8192CPHYCFG_H */ +#endif
Signature · 1 line
2.34.1
PATCH 10/11 staging: r8188eu: remove unused defines from Hal8188EPhyCfg.h
In reply to Michael StraubeRemove unused defines from Hal8188EPhyCfg.h.
--- drivers/staging/r8188eu/include/Hal8188EPhyCfg.h | 7 ------- 1 file changed, 7 deletions(-)
drivers/staging/r8188eu/include/Hal8188EPhyCfg.h +0 -7
@@ -4,12 +4,6 @@#ifndef __INC_HAL8188EPHYCFG_H__#define __INC_HAL8188EPHYCFG_H__ -#define LOOP_LIMIT 5 -#define MAX_STALL_TIME 50/* us */ -#define AntennaDiversityValue 0x80 -#define MAX_TXPWR_IDX_NMODE_92S 63 -#define Reset_Cnt_Limit 3 -#define MAX_AGGR_NUM 0x07 enum rf_radio_path {
@@ -26,7 +20,6 @@ enum rf_radio_path {#define MAX_CHNL_GROUP_24G 6/* ch1~2, ch3~5, ch6~8, *ch9~11, ch12~13, CH 14 * total three groups */ -#define CHANNEL_GROUP_MAX_88E 6struct bb_reg_def {u32 rfintfs;/* set software control: */
Signature · 1 line
2.34.1
PATCH 11/11 staging: r8188eu: remove unused defines from rtw_eeprom.h
In reply to Michael StraubeRemove unused defines from rtw_eeprom.h.
--- drivers/staging/r8188eu/include/rtw_eeprom.h | 26 -------------------- 1 file changed, 26 deletions(-)
drivers/staging/r8188eu/include/rtw_eeprom.h +0 -26
@@ -7,33 +7,7 @@#include "osdep_service.h" #include "drv_types.h" -#define RTL8712_EEPROM_ID 0x8712 -#define HWSET_MAX_SIZE_512 512 -#define EEPROM_MAX_SIZE HWSET_MAX_SIZE_512 - -#define CLOCK_RATE 50/* 100us */ - -/* EEPROM opcodes */ -#define EEPROM_READ_OPCODE 06 -#define EEPROM_WRITE_OPCODE 05 -#define EEPROM_ERASE_OPCODE 07 -#define EEPROM_EWEN_OPCODE 19/* Erase/write enable */ -#define EEPROM_EWDS_OPCODE 16/* Erase/write disable */ - -#define EEPROM_CID_DEFAULT 0x0 -#define EEPROM_CID_ALPHA 0x1 -#define EEPROM_CID_Senao 0x3 -#define EEPROM_CID_NetCore 0x5 -#define EEPROM_CID_CAMEO 0X8 -#define EEPROM_CID_SITECOM 0x9 -#define EEPROM_CID_COREGA 0xB -#define EEPROM_CID_EDIMAX_BELK 0xC -#define EEPROM_CID_SERCOMM_BELK 0xE -#define EEPROM_CID_CAMEO1 0xF -#define EEPROM_CID_WNC_COREGA 0x12 -#define EEPROM_CID_CLEVO 0x13 -#define EEPROM_CID_WHQL 0xFEstruct eeprom_priv {u8 bautoload_fail_flag;
Signature · 1 line
2.34.1
Thus wrote Michael Straube ([email protected]):
Quoted 19 lines
This set
- removes some unused structs, enums and defines
- removes set but not used fields from some structuresTested on
x86_64with Inter-Tech DMG-02.Michael Straube (11):
staging: r8188eu: removeMAX_CHANNEL_NUM_2G
staging: r8188eu: remove structrt_channel_plan_2g
staging: r8188eu: remove unused enum and defines
staging: r8188eu: structrx_hpcis not used
staging: r8188eu: clean up structrtw_dig
staging: r8188eu: clean up structsw_ant_switch
staging: r8188eu: structodm_sta_infois not used
staging: r8188eu: enumhw90_blockis not used
staging: r8188eu: remove unneeded comments fromHal8188EPhyCfg.h
staging: r8188eu: remove unused defines fromHal8188EPhyCfg.h
staging: r8188eu: remove unused defines fromrtw_eeprom.h
Quoted 11 lines
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/hal/odm.c | 11 --- .../staging/r8188eu/include/Hal8188EPhyCfg.h | 34 +------ drivers/staging/r8188eu/include/odm.h | 90 +------------------ drivers/staging/r8188eu/include/rtw_eeprom.h | 31 ------- .../staging/r8188eu/include/rtw_mlme_ext.h | 5 -- drivers/staging/r8188eu/include/rtw_rf.h | 24 ----- 7 files changed, 3 insertions(+), 194 deletions(-)Signature · 1 line
2.34.1
for all patches