staging:rtl8192u: Clean up ofr8192U_dm.h
cover staging:rtl8192u: Clean up ofr8192U_dm.h
This series of patches is a clean up of the file:drivers/staging/rtl8192u/r8192U_dm.h
Whilst I consider all the changes to be coding style changes some have removed structure member variables which were not implementing any logic, which required them to be a member of a structure. The first patch removes member variables from two separate structures which seem to have been intended to add functionality for debugging. Whether that feature was forgotten about I'm not sure but as it serves no purpose both member variables were removed.
I hope I've not missed something
John Whitmore (18):
staging:rtl8192u: Remove debug member from structures - Style staging:rtl8192u: Remove member variable rx_gain_range_max - Style staging:rtl8192u: Remove member initialgain_lowerbound_state - Style staging:rtl8192u: Rename enum constants - Style staging:rtl8192u: Remove unused extern DM_RxPathSelTable - Style staging:rtl8192u: Remove member variable Enable - Style staging:rtl8192u: Rename cck_Rx_path - Style staging:rtl8192u: Remove SS_TH_low - Style staging:rtl8192u: Remove member diff_TH - Style staging:rtl8192u: Rename member disabledRF - Style staging:rtl8192u: Remove member reserved - Style staging:rtl8192u: Refactor DCMD_TXCMD_T structure - Style staging:rtl8192u: Rename DM_DIG_MIN_Netcore - Style staging:rtl8192u: Rename RateAdaptiveTH_High - Style staging:rtl8192u: Rename constants RateAdaptiveTH_Low_* - Style staging:rtl8192u: Rename constants - Style staging:rtl8192u: Rename Register Constants - Style staging:rtl8192u: Clean up of spacing - Style
drivers/staging/rtl8192u/r8192U_core.c | 14 +-- drivers/staging/rtl8192u/r8192U_dm.c | 97 +++++++--------- drivers/staging/rtl8192u/r8192U_dm.h | 151 +++++++++++-------------- 3 files changed, 115 insertions(+), 147 deletions(-)
Signature · 1 line
2.18.0
PATCH 1/18 staging:rtl8192u: Remove debug member from structures - Style
Two structures, (struct dig and struct dynamic_rx_path_sel) contain a u8 member variable representing debug setting. In the file r8192U_dm.c these member variables, for both structures, are initialised to an enumerated constant 'DM_DBG_OFF'. The member variables are never assigned another value, other then off. Later in code the member variables are tested to for equality to 'DM_DBG_OFF' and if that is the case an assignment statement is executed.
Since the value of the variables is always off the test is redundant and the conditional branch can just be executed without the test. Since the member variables are then actually used both have been removed, along with the enumerated type which defines debug status, on/off.
These are coding style changes to remove unused or redundant code, there should be no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 8 ++------ drivers/staging/rtl8192u/r8192U_dm.h | 8 -------- 2 files changed, 2 insertions(+), 14 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +2 -6
@@ -1635,7 +1635,6 @@ static void dm_dig_init(struct net_device *dev)/* 2007/10/05 MH Disable DIG scheme now. Not tested. */ dm_digtable.dig_enable_flag = true; dm_digtable.dig_algorithm =DIG_ALGO_BY_RSSI ; - dm_digtable.dbg_mode =DM_DBG_OFF ;/* off=by real rssi value, on=by DM_DigTable.Rssi_val for new dig */ dm_digtable.dig_algorithm_switch =0 ;/* 2007/10/04 MH Define init gain threshold. */
@@ -1720,8 +1719,7 @@ static void dm_ctrl_initgain_byrssi_by_driverrssi(/*DbgPrint("DM_DigTable.PreConnectState = %d, DM_DigTable.CurConnectState = %d\n", DM_DigTable.PreConnectState, DM_DigTable.CurConnectState);*/ -if (dm_digtable.dbg_mode ==DM_DBG_OFF ) - dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; + dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb;/*DbgPrint("DM_DigTable.Rssi_val = %d\n", DM_DigTable.Rssi_val);*/ dm_initial_gain (dev);dm_pd_th (dev);
@@ -2398,7 +2396,6 @@ static void dm_init_rxpath_selection(struct net_device *dev) DM_RxPathSelTable.cck_method = CCK_Rx_Version_2; else DM_RxPathSelTable.cck_method = CCK_Rx_Version_1; - DM_RxPathSelTable.DbgMode =DM_DBG_OFF ; DM_RxPathSelTable.disabledRF =0 ;for (i =0 ; i <4 ; i++) { DM_RxPathSelTable.rf_rssi[i] =50 ;
@@ -2440,8 +2437,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)/* decide max/sec/min rssi index */ for (i =0 ; i <RF90_PATH_MAX ; i++) { -if (!DM_RxPathSelTable.DbgMode) - DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i]; + DM_RxPathSelTable.rf_rssi[i] = priv->stats.rx_rssi_percentage[i];if (priv->brfpath_rxenable[i]) { rf_num++;
drivers/staging/rtl8192u/r8192U_dm.h +0 -8
@@ -96,7 +96,6 @@ enum dig_cck_cs_ratio_state {struct dig {u8 dig_enable_flag;enum dig_algorithm dig_algorithm; -u8 dbg_mode;u8 dig_algorithm_switch;long rssi_low_thresh;
@@ -133,7 +132,6 @@ enum cck_rx_path_method {struct dynamic_rx_path_sel {u8 Enable; -u8 DbgMode;enum cck_rx_path_method cck_method;u8 cck_Rx_path;
@@ -147,12 +145,6 @@ struct dynamic_rx_path_sel {long cck_pwdb_sta[4 ]; }; -typedef enum tag_DM_DbgMode_Definition { -DM_DBG_OFF =0 , -DM_DBG_ON =1 , -DM_DBG_MAX -}DM_DBG_E ; - typedef struct tag_Tx_Config_Cmd_Format { u32 Op; /* Command packet type. */ u32 Length; /* Command packet length. */
Signature · 1 line
2.18.0
PATCH 2/18 staging:rtl8192u: Remove member variable rx_gain_range_max - Style
In reply to John WhitmoreThe structure 'dig' defines a member variable, (rx_gain_range_max) which is initialised to the value 'DM_DIG_MAX', (a defined constant). The variable is then used to test and set another variable. Since the member rx_gain_range_max is never assigned any other value then the constant 'DM_DIG_MAX' the code might as well simply use that constant, rather the a member variable set to that constant.
The member variable has been removed and the constant used directly in the code. This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 5 ++--- drivers/staging/rtl8192u/r8192U_dm.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +2 -3
@@ -1650,7 +1650,6 @@ static void dm_dig_init(struct net_device *dev) dm_digtable.rssi_val =50 ;/* for new dig debug rssi value */ dm_digtable.backoff_val =DM_DIG_BACKOFF ; - dm_digtable.rx_gain_range_max =DM_DIG_MAX ;if (priv->CustomerID == RT_CID_819x_Netcore) dm_digtable.rx_gain_range_min = DM_DIG_MIN_Netcore;else
@@ -1968,8 +1967,8 @@ static void dm_initial_gain(if (dm_digtable.pre_connect_state == dm_digtable.cur_connect_state) {if (dm_digtable.cur_connect_state ==DIG_CONNECT ) { -if ((dm_digtable.rssi_val+10 -dm_digtable.backoff_val) > dm_digtable.rx_gain_range_max) - dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_max; +if ((dm_digtable.rssi_val +10 - dm_digtable.backoff_val) >DM_DIG_MAX ) + dm_digtable.cur_ig_value =DM_DIG_MAX ;else if ((dm_digtable.rssi_val+10 -dm_digtable.backoff_val) < dm_digtable.rx_gain_range_min) dm_digtable.cur_ig_value = dm_digtable.rx_gain_range_min;else
drivers/staging/rtl8192u/r8192U_dm.h +0 -1
@@ -118,7 +118,6 @@ struct dig {u32 cur_ig_value;u8 backoff_val; -u8 rx_gain_range_max;u8 rx_gain_range_min;bool initialgain_lowerbound_state;
Signature · 1 line
2.18.0
PATCH 3/18 staging:rtl8192u: Remove member initialgain_lowerbound_state - Style
In reply to John WhitmoreThe structure 'dig' defines a member variable 'initialgain_lowerbound_state', which although initialised to false, is never used in the code. As a result this unused member variable has been removed.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 1 - drivers/staging/rtl8192u/r8192U_dm.h | 1 - 2 files changed, 2 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +0 -1
@@ -1640,7 +1640,6 @@ static void dm_dig_init(struct net_device *dev)/* 2007/10/04 MH Define init gain threshold. */ dm_digtable.dig_state =DM_STA_DIG_MAX ; dm_digtable.dig_highpwr_state =DM_STA_DIG_MAX ; - dm_digtable.initialgain_lowerbound_state = false; dm_digtable.rssi_low_thresh =DM_DIG_THRESH_LOW ; dm_digtable.rssi_high_thresh =DM_DIG_THRESH_HIGH ;
drivers/staging/rtl8192u/r8192U_dm.h +0 -1
@@ -119,7 +119,6 @@ struct dig {u8 backoff_val;u8 rx_gain_range_min; -bool initialgain_lowerbound_state;long rssi_val; };
Signature · 1 line
2.18.0
PATCH 4/18 staging:rtl8192u: Rename enum constants - Style
In reply to John WhitmoreRename the two constants defined in the enumerated type enum cck_rx_path_method so that they are both uppercase, as suggested by the coding style.
This is purely a coding style change and should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 12 ++++++------ drivers/staging/rtl8192u/r8192U_dm.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +6 -6
@@ -2391,9 +2391,9 @@ static void dm_init_rxpath_selection(struct net_device *dev) DM_RxPathSelTable.SS_TH_low = RxPathSelection_SS_TH_low; DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;if (priv->CustomerID == RT_CID_819x_Netcore) - DM_RxPathSelTable.cck_method = CCK_Rx_Version_2; + DM_RxPathSelTable.cck_method =CCK_RX_VERSION_2 ;else - DM_RxPathSelTable.cck_method = CCK_Rx_Version_1; + DM_RxPathSelTable.cck_method =CCK_RX_VERSION_1 ; DM_RxPathSelTable.disabledRF =0 ;for (i =0 ; i <4 ; i++) { DM_RxPathSelTable.rf_rssi[i] =50 ;
@@ -2429,7 +2429,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev) DM_RxPathSelTable.disabledRF = ~DM_RxPathSelTable.disabledRF &0xf ;if (priv->ieee80211->mode ==WIRELESS_MODE_B ) { - DM_RxPathSelTable.cck_method = CCK_Rx_Version_2;/* pure B mode, fixed cck version2 */ + DM_RxPathSelTable.cck_method =CCK_RX_VERSION_2 ;/* pure B mode, fixed cck version2 */ /*DbgPrint("Pure B mode, use cck rx version2\n");*/ }
@@ -2493,7 +2493,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev) rf_num =0 ;/* decide max/sec/min cck pwdb index */ -if (DM_RxPathSelTable.cck_method == CCK_Rx_Version_2) { +if (DM_RxPathSelTable.cck_method ==CCK_RX_VERSION_2 ) {for (i =0 ; i <RF90_PATH_MAX ; i++) {if (priv->brfpath_rxenable[i]) { rf_num++;
@@ -2551,7 +2551,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)* reg0xA07[3:2]=cck default rx path, reg0xa07[1:0]=cck optional rx path. */ update_cck_rx_path =0 ; -if (DM_RxPathSelTable.cck_method == CCK_Rx_Version_2) { +if (DM_RxPathSelTable.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 )
@@ -2567,7 +2567,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)rtl8192_setBBreg (dev, rOFDM1_TRxPathEnable,0x1 <<min_rssi_index,0x0 );/* 0xd04[3:0] */ disabled_rf_cnt++; } -if (DM_RxPathSelTable.cck_method == CCK_Rx_Version_1) { +if (DM_RxPathSelTable.cck_method ==CCK_RX_VERSION_1 ) { cck_default_Rx = max_rssi_index; cck_optional_Rx = sec_rssi_index;if (tmp_max_rssi)
drivers/staging/rtl8192u/r8192U_dm.h +2 -2
@@ -124,8 +124,8 @@ struct dig { };enum cck_rx_path_method { - CCK_Rx_Version_1 =0 , - CCK_Rx_Version_2 =1 , +CCK_RX_VERSION_1 =0 , +CCK_RX_VERSION_2 =1 , };struct dynamic_rx_path_sel {
Signature · 1 line
2.18.0
PATCH 5/18 staging:rtl8192u: Remove unused extern DM_RxPathSelTable - Style
In reply to John WhitmoreThe file r8192U_dm.h defines the structure DM_RxPathSelTable as being external. The structure is however declared in r8192U_dm.c and only used locally in that file.
As a result the external definition has been removed and the declaration in r8192U_dm.c changed to being of type static.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 2 +- drivers/staging/rtl8192u/r8192U_dm.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +1 -1
@@ -41,7 +41,7 @@ struct dig dm_digtable;/* Store current software write register content for MAC PHY. */ u8 dm_shadow[16 ][256 ] = { {0 } };/* For Dynamic Rx Path Selection by Signal Strength */ -struct dynamic_rx_path_sel DM_RxPathSelTable; +static struct dynamic_rx_path_sel DM_RxPathSelTable;/*------------------------Define global variable-----------------------------*/
drivers/staging/rtl8192u/r8192U_dm.h +0 -1
@@ -154,7 +154,6 @@ typedef struct tag_Tx_Config_Cmd_Format {/*------------------------Export global variable----------------------------*/ extern struct dig dm_digtable;extern u8 dm_shadow[16 ][256 ]; -extern struct dynamic_rx_path_sel DM_RxPathSelTable;/*------------------------Export global variable----------------------------*/
Signature · 1 line
2.18.0
PATCH 6/18 staging:rtl8192u: Remove member variable Enable - Style
In reply to John WhitmoreThe structure dynamic_rx_path_sel defines a member variable 'Enable' which is initialised and later tested. The variable is however never changed to the test is redundant and the member variable is then never used.
The member variable, initialisation and test have all been removed.
This is a coding style change which should not impact runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 3 --- drivers/staging/rtl8192u/r8192U_dm.h | 1 - 2 files changed, 4 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +0 -3
@@ -2376,8 +2376,6 @@ void dm_rf_pathcheck_workitemcallback(struct work_struct *work)else priv->brfpath_rxenable[i] = false; } -if (!DM_RxPathSelTable.Enable) -return ;dm_rxpath_sel_byrssi (dev); }/* DM_RFPathCheckWorkItemCallBack */
@@ -2387,7 +2385,6 @@ static void dm_init_rxpath_selection(struct net_device *dev)u8 i;struct r8192_priv *priv =ieee80211_priv (dev); - DM_RxPathSelTable.Enable =1 ;/* default enabled */ DM_RxPathSelTable.SS_TH_low = RxPathSelection_SS_TH_low; DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;if (priv->CustomerID == RT_CID_819x_Netcore)
drivers/staging/rtl8192u/r8192U_dm.h +0 -1
@@ -129,7 +129,6 @@ enum cck_rx_path_method { };struct dynamic_rx_path_sel { -u8 Enable;enum cck_rx_path_method cck_method;u8 cck_Rx_path;
Signature · 1 line
2.18.0
PATCH 7/18 staging:rtl8192u: Rename cck_Rx_path - Style
In reply to John WhitmoreRename the member variable cck_Rx_path to cck_rx_path. This clears the checkpatch issue with CamelCase naming.
This is a coding style change which should have no impact one runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 8 ++++---- drivers/staging/rtl8192u/r8192U_dm.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +4 -4
@@ -2417,8 +2417,8 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)return ;if (!cck_Rx_Path_initialized) { -read_nic_byte (dev,0xa07 , &DM_RxPathSelTable.cck_Rx_path); - DM_RxPathSelTable.cck_Rx_path &=0xf ; +read_nic_byte (dev,0xa07 , &DM_RxPathSelTable.cck_rx_path); + DM_RxPathSelTable.cck_rx_path &=0xf ; cck_Rx_Path_initialized =1 ; }
@@ -2573,8 +2573,8 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev) }if (update_cck_rx_path) { - DM_RxPathSelTable.cck_Rx_path = (cck_default_Rx<<2 )|(cck_optional_Rx); -rtl8192_setBBreg (dev, rCCK0_AFESetting,0x0f000000 , DM_RxPathSelTable.cck_Rx_path); + DM_RxPathSelTable.cck_rx_path = (cck_default_Rx<<2 )|(cck_optional_Rx); +rtl8192_setBBreg (dev, rCCK0_AFESetting,0x0f000000 , DM_RxPathSelTable.cck_rx_path); }if (DM_RxPathSelTable.disabledRF) {
drivers/staging/rtl8192u/r8192U_dm.h +1 -1
@@ -130,7 +130,7 @@ enum cck_rx_path_method {struct dynamic_rx_path_sel {enum cck_rx_path_method cck_method; -u8 cck_Rx_path; +u8 cck_rx_path;u8 SS_TH_low;u8 diff_TH;
Signature · 1 line
2.18.0
PATCH 8/18 staging:rtl8192u: Remove SS_TH_low - Style
In reply to John WhitmoreThe member variable SS_TH_low is assigned a constant and then used in a comparison. This member variable is redundant as the constant can be used directly for the comparison.
In addition the constant RxPathSelection_SS_TH_low has been renamed to RX_PATH_SELECTION_SS_TH_LOW, to clear the checkpatch issue with CamelCase naming.
These changes are coding style in nature and should not impact runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 3 +-- drivers/staging/rtl8192u/r8192U_dm.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +1 -2
@@ -2385,7 +2385,6 @@ static void dm_init_rxpath_selection(struct net_device *dev)u8 i;struct r8192_priv *priv =ieee80211_priv (dev); - DM_RxPathSelTable.SS_TH_low = RxPathSelection_SS_TH_low; DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;if (priv->CustomerID == RT_CID_819x_Netcore) DM_RxPathSelTable.cck_method =CCK_RX_VERSION_2 ;
@@ -2555,7 +2554,7 @@ static void dm_rxpath_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 <RX_PATH_SELECTION_SS_TH_LOW && disabled_rf_cnt <2 ) {if ((tmp_max_rssi - tmp_min_rssi) >= DM_RxPathSelTable.diff_TH) {/* record the enabled rssi threshold */ DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] = tmp_max_rssi+5 ;
drivers/staging/rtl8192u/r8192U_dm.h +1 -2
@@ -37,7 +37,7 @@#define DM_DIG_MIN 0x1c#define DM_DIG_MIN_Netcore 0x12 -#define RxPathSelection_SS_TH_low 30 +#define RX_PATH_SELECTION_SS_TH_LOW 30#define RxPathSelection_diff_TH 18#define RateAdaptiveTH_High 50
@@ -132,7 +132,6 @@ struct dynamic_rx_path_sel {enum cck_rx_path_method cck_method;u8 cck_rx_path; -u8 SS_TH_low;u8 diff_TH;u8 disabledRF;u8 reserved;
Signature · 1 line
2.18.0
PATCH 9/18 staging:rtl8192u: Remove member diff_TH - Style
In reply to John WhitmoreThe member variable diff_TH is assigned a constant value and then used in a comparison. The variable is never changed so the comparison can as easily be performed directly with the defined constant.
The member variable has been removed and the defined constant RxPathSelection_diff_TH renamed to RX_PATH_SELECTION_DIFF_TH, to clear the checkpatch issue with CamelCase naming.
These are coding style changes which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 3 +-- drivers/staging/rtl8192u/r8192U_dm.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +1 -2
@@ -2385,7 +2385,6 @@ static void dm_init_rxpath_selection(struct net_device *dev)u8 i;struct r8192_priv *priv =ieee80211_priv (dev); - DM_RxPathSelTable.diff_TH = RxPathSelection_diff_TH;if (priv->CustomerID == RT_CID_819x_Netcore) DM_RxPathSelTable.cck_method =CCK_RX_VERSION_2 ;else
@@ -2555,7 +2554,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev) }if (tmp_min_rssi <RX_PATH_SELECTION_SS_TH_LOW && disabled_rf_cnt <2 ) { -if ((tmp_max_rssi - tmp_min_rssi) >= DM_RxPathSelTable.diff_TH) { +if ((tmp_max_rssi - tmp_min_rssi) >=RX_PATH_SELECTION_DIFF_TH ) {/* record the enabled rssi threshold */ DM_RxPathSelTable.rf_enable_rssi_th[min_rssi_index] = tmp_max_rssi+5 ;/* disable the BB Rx path, OFDM */
drivers/staging/rtl8192u/r8192U_dm.h +1 -2
@@ -38,7 +38,7 @@#define DM_DIG_MIN_Netcore 0x12#define RX_PATH_SELECTION_SS_TH_LOW 30 -#define RxPathSelection_diff_TH 18 +#define RX_PATH_SELECTION_DIFF_TH 18#define RateAdaptiveTH_High 50#define RateAdaptiveTH_Low_20M 30
@@ -132,7 +132,6 @@ struct dynamic_rx_path_sel {enum cck_rx_path_method cck_method;u8 cck_rx_path; -u8 diff_TH;u8 disabledRF;u8 reserved;
Signature · 1 line
2.18.0
PATCH 10/18 staging:rtl8192u: Rename member disabledRF - Style
In reply to John WhitmoreRename the member variable disabledRF to disabled_rf. This change resolves the checkpatch issue with CamelCase naming.
The change is purely a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 10 +++++----- drivers/staging/rtl8192u/r8192U_dm.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +5 -5
@@ -2389,7 +2389,7 @@ static void dm_init_rxpath_selection(struct net_device *dev) 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 ;
@@ -2420,8 +2420,8 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev) cck_Rx_Path_initialized =1 ; } -read_nic_byte (dev,0xc04 , &DM_RxPathSelTable.disabledRF); - DM_RxPathSelTable.disabledRF = ~DM_RxPathSelTable.disabledRF &0xf ; +read_nic_byte (dev,0xc04 , &DM_RxPathSelTable.disabled_rf); + DM_RxPathSelTable.disabled_rf = ~DM_RxPathSelTable.disabled_rf &0xf ;if (priv->ieee80211->mode ==WIRELESS_MODE_B ) { DM_RxPathSelTable.cck_method =CCK_RX_VERSION_2 ;/* pure B mode, fixed cck version2 */
@@ -2575,9 +2575,9 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev)rtl8192_setBBreg (dev, rCCK0_AFESetting,0x0f000000 , 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 ) {/* disabled rf */ +if ((DM_RxPathSelTable.disabled_rf >> i) &0x1 ) {/* disabled rf */ if (tmp_max_rssi >= DM_RxPathSelTable.rf_enable_rssi_th[i]) {/* enable the BB Rx path */ /*DbgPrint("RF-%d is enabled.\n", 0x1<<i);*/
drivers/staging/rtl8192u/r8192U_dm.h +1 -1
@@ -132,7 +132,7 @@ struct dynamic_rx_path_sel {enum cck_rx_path_method cck_method;u8 cck_rx_path; -u8 disabledRF; +u8 disabled_rf;u8 reserved;u8 rf_rssi[4 ];
Signature · 1 line
2.18.0
PATCH 11/18 staging:rtl8192u: Remove member reserved - Style
In reply to John WhitmoreThe structure dynamic_rx_path_sel contains a u8 member variable called reserved. This member variable is never actually used in the code.
The naming suggests that the sizeof the structure is significant but the only use of the structure is a local static in r8192U_dm.c:
static struct dynamic_rx_path_sel DM_RxPathSelTable;
There is no apparent significance to the sizeof the declared structure DM_RxPathSelTable. As a result the reserved member variable has been removed from the structure.
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.h | 1 - 1 file changed, 1 deletion(-)
drivers/staging/rtl8192u/r8192U_dm.h +0 -1
@@ -133,7 +133,6 @@ struct dynamic_rx_path_sel {u8 cck_rx_path;u8 disabled_rf; -u8 reserved;u8 rf_rssi[4 ];u8 rf_enable_rssi_th[4 ];
Signature · 1 line
2.18.0
PATCH 12/18 staging:rtl8192u: Refactor DCMD_TXCMD_T structure - Style
In reply to John WhitmoreThe structure DCMD_TXCMD_T is declared with a typedef, which causes a checkpatch issue with defining new types. As a result the typedef has been removed.
The structure's name DCMD_TXCMD_T, as a type, is meant to be lowercase so has been renamed to tx_config_cmd.
The structures three members, (Op, Length, and Value) are all violating the coding standard policy on CamelCase naming, so have all been renamed. They have been renamed with longer names, (cmd_op, cmd_length and cmd_value), to make the variable names easier to search for in code.
The magic numbers '4' and '12' have both been replaced with sizeof() calls, as they both represent the size of data elements.
These are coding style changes which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 10 +++++----- drivers/staging/rtl8192u/r8192U_dm.h | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +5 -5
@@ -510,7 +510,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) {struct r8192_priv *priv =ieee80211_priv (dev);bool viviflag = false; -DCMD_TXCMD_T tx_cmd; +struct tx_config_cmd tx_cmd;u8 powerlevelOFDM24G;int i =0 , j =0 , k =0 ;u8 RF_Type, tmp_report[5 ] = {0 ,0 ,0 ,0 ,0 };
@@ -532,10 +532,10 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev)RT_TRACE (COMP_POWER_TRACKING ,"powerlevelOFDM24G = %x\n" , powerlevelOFDM24G);for (j =0 ; j <=30 ; j++) {/* fill tx_cmd */ - tx_cmd.Op =TXCMD_SET_TX_PWR_TRACKING ; - tx_cmd.Length =4 ; - tx_cmd.Value = Value; - rtStatus =SendTxCommandPacket (dev, &tx_cmd,12 ); + tx_cmd.cmd_op =TXCMD_SET_TX_PWR_TRACKING ; + tx_cmd.cmd_length =sizeof (tx_cmd.cmd_op); + tx_cmd.cmd_value = Value; + rtStatus =SendTxCommandPacket (dev, &tx_cmd,sizeof (struct tx_config_cmd ));if (rtStatus ==RT_STATUS_FAILURE )RT_TRACE (COMP_POWER_TRACKING ,"Set configuration with tx cmd queue fail!\n" );usleep_range (1000 ,2000 );
drivers/staging/rtl8192u/r8192U_dm.h +6 -5
@@ -139,11 +139,12 @@ struct dynamic_rx_path_sel {long cck_pwdb_sta[4 ]; }; -typedef struct tag_Tx_Config_Cmd_Format { -u32 Op;/* Command packet type. */ -u32 Length;/* Command packet length. */ -u32 Value; -}DCMD_TXCMD_T , *PDCMD_TXCMD_T ; +struct tx_config_cmd { +u32 cmd_op;/* Command packet type. */ +u32 cmd_length;/* Command packet length. */ +u32 cmd_value; +}; +/*------------------------------Define structure----------------------------*/
Signature · 1 line
2.18.0
PATCH 13/18 staging:rtl8192u: Rename DM_DIG_MIN_Netcore - Style
In reply to John WhitmoreThe constant DM_DIG_MIN_Netcore causes a checkpatch issue with CamelCase naming so has been renamed to DM_DIG_MIN_NETCORE.
This is a simple coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 2 +- drivers/staging/rtl8192u/r8192U_dm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +1 -1
@@ -1650,7 +1650,7 @@ static void dm_dig_init(struct net_device *dev) dm_digtable.rssi_val =50 ;/* for new dig debug rssi value */ dm_digtable.backoff_val =DM_DIG_BACKOFF ;if (priv->CustomerID == RT_CID_819x_Netcore) - dm_digtable.rx_gain_range_min = DM_DIG_MIN_Netcore; + dm_digtable.rx_gain_range_min =DM_DIG_MIN_NETCORE ;else dm_digtable.rx_gain_range_min =DM_DIG_MIN ;
drivers/staging/rtl8192u/r8192U_dm.h +1 -1
@@ -35,7 +35,7 @@#define DM_DIG_BACKOFF 12#define DM_DIG_MAX 0x36#define DM_DIG_MIN 0x1c -#define DM_DIG_MIN_Netcore 0x12 +#define DM_DIG_MIN_NETCORE 0x12#define RX_PATH_SELECTION_SS_TH_LOW 30#define RX_PATH_SELECTION_DIFF_TH 18
Signature · 1 line
2.18.0
PATCH 14/18 staging:rtl8192u: Rename RateAdaptiveTH_High - Style
In reply to John WhitmoreThe constant RateAdaptiveTH_High causes a checkpatch issue with respect to CamelCase naming. As a result the constant has been renamed to RATE_ADAPTIVE_TH_HIGH.
This is purely a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_core.c | 4 ++-- drivers/staging/rtl8192u/r8192U_dm.c | 4 ++-- drivers/staging/rtl8192u/r8192U_dm.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +2 -2
@@ -3079,9 +3079,9 @@ static bool HalRxCheckStuck819xUsb(struct net_device *dev)* or maybe it will continuous silent reset every 2 seconds. */ 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 ;/* high rssi, check rx stuck right now. */ - }else if (priv->undecorated_smoothed_pwdb < (RateAdaptiveTH_High +5 ) && + }else if (priv->undecorated_smoothed_pwdb < (RATE_ADAPTIVE_TH_HIGH +5 ) && ((priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_40M) || (priv->CurrentChannelBW ==HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M))) {if (rx_chk_cnt <2 )
drivers/staging/rtl8192u/r8192U_dm.c +2 -2
@@ -243,11 +243,11 @@ void init_rate_adaptive(struct net_device *dev)prate_adaptive pra = (prate_adaptive)&priv->rate_adaptive; pra->ratr_state =DM_RATR_STA_MAX ; - pra->high2low_rssi_thresh_for_ra = RateAdaptiveTH_High; + pra->high2low_rssi_thresh_for_ra =RATE_ADAPTIVE_TH_HIGH ; pra->low2high_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M+5 ; pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5 ; - pra->high_rssi_thresh_for_ra = RateAdaptiveTH_High+5 ; + pra->high_rssi_thresh_for_ra =RATE_ADAPTIVE_TH_HIGH +5 ; pra->low_rssi_thresh_for_ra20M = RateAdaptiveTH_Low_20M; pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M;
drivers/staging/rtl8192u/r8192U_dm.h +1 -1
@@ -40,7 +40,7 @@#define RX_PATH_SELECTION_SS_TH_LOW 30#define RX_PATH_SELECTION_DIFF_TH 18 -#define RateAdaptiveTH_High 50 +#define RATE_ADAPTIVE_TH_HIGH 50#define RateAdaptiveTH_Low_20M 30#define RateAdaptiveTH_Low_40M 10#define VeryLowRSSI 15
Signature · 1 line
2.18.0
PATCH 15/18 staging:rtl8192u: Rename constants RateAdaptiveTH_Low_* - Style
In reply to John WhitmoreThe two constants, RateAdaptiveTH_Low_20M and RateAdaptiveTH_Low_40M generate a checkpatch warning about CamelCase naming. The two have been renamed to clear this issue. RATE_ADAPTIVE_TH_LOW_20M and RATE_ADAPTIVE_TH_LOW_40M
This is a coding style change which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_core.c | 8 ++++---- drivers/staging/rtl8192u/r8192U_dm.c | 8 ++++---- drivers/staging/rtl8192u/r8192U_dm.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +4 -4
@@ -3082,14 +3082,14 @@ static bool HalRxCheckStuck819xUsb(struct net_device *dev)if (priv->undecorated_smoothed_pwdb >= (RATE_ADAPTIVE_TH_HIGH +5 )) { rx_chk_cnt =0 ;/* high rssi, check rx stuck right now. */ }else if (priv->undecorated_smoothed_pwdb < (RATE_ADAPTIVE_TH_HIGH +5 ) && - ((priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_40M) || - (priv->CurrentChannelBW ==HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb >= RateAdaptiveTH_Low_20M))) { + ((priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb >=RATE_ADAPTIVE_TH_LOW_40M ) || + (priv->CurrentChannelBW ==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->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_40M) || - (priv->CurrentChannelBW ==HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb < RateAdaptiveTH_Low_20M)) && + }else if (((priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb <RATE_ADAPTIVE_TH_LOW_40M ) || + (priv->CurrentChannelBW ==HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb <RATE_ADAPTIVE_TH_LOW_20M )) && priv->undecorated_smoothed_pwdb >= VeryLowRSSI) {if (rx_chk_cnt <4 )return bStuck;
drivers/staging/rtl8192u/r8192U_dm.c +4 -4
@@ -244,12 +244,12 @@ void init_rate_adaptive(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 = RateAdaptiveTH_Low_20M+5 ; - pra->low2high_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M+5 ; + pra->low2high_rssi_thresh_for_ra20M =RATE_ADAPTIVE_TH_LOW_20M +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 = RateAdaptiveTH_Low_20M; - pra->low_rssi_thresh_for_ra40M = RateAdaptiveTH_Low_40M; + pra->low_rssi_thresh_for_ra20M =RATE_ADAPTIVE_TH_LOW_20M ; + pra->low_rssi_thresh_for_ra40M =RATE_ADAPTIVE_TH_LOW_40M ;if (priv->CustomerID == RT_CID_819x_Netcore) pra->ping_rssi_enable =1 ;
drivers/staging/rtl8192u/r8192U_dm.h +2 -2
@@ -41,8 +41,8 @@#define RX_PATH_SELECTION_DIFF_TH 18#define RATE_ADAPTIVE_TH_HIGH 50 -#define RateAdaptiveTH_Low_20M 30 -#define RateAdaptiveTH_Low_40M 10 +#define RATE_ADAPTIVE_TH_LOW_20M 30 +#define RATE_ADAPTIVE_TH_LOW_40M 10#define VeryLowRSSI 15#define CTSToSelfTHVal 30
Signature · 1 line
2.18.0
PATCH 16/18 staging:rtl8192u: Rename constants - Style
In reply to John WhitmoreThe constants 'VeryLowRSSI' and 'CTSToSelfTHVal' generate warnings from checkpatch due to the use of CamelCase naming. The two constants have been renamed to 'VERY_LOW_RSSI' and 'CTS_TO_SELF_TH_VAL' respectively.
These are coding style changes which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_core.c | 2 +- drivers/staging/rtl8192u/r8192U_dm.c | 2 +- drivers/staging/rtl8192u/r8192U_dm.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +1 -1
@@ -3090,7 +3090,7 @@ static bool HalRxCheckStuck819xUsb(struct net_device *dev) rx_chk_cnt =0 ; }else if (((priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 && priv->undecorated_smoothed_pwdb <RATE_ADAPTIVE_TH_LOW_40M ) || (priv->CurrentChannelBW ==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;
drivers/staging/rtl8192u/r8192U_dm.c +1 -1
@@ -2268,7 +2268,7 @@ static void dm_init_ctstoself(struct net_device *dev)struct r8192_priv *priv =ieee80211_priv (dev); priv->ieee80211->bCTSToSelfEnable = true; - priv->ieee80211->CTSToSelfTH = CTSToSelfTHVal; + priv->ieee80211->CTSToSelfTH =CTS_TO_SELF_TH_VAL ; }static void dm_ctstoself (struct net_device *dev)
drivers/staging/rtl8192u/r8192U_dm.h +2 -2
@@ -43,8 +43,8 @@#define RATE_ADAPTIVE_TH_HIGH 50#define RATE_ADAPTIVE_TH_LOW_20M 30#define RATE_ADAPTIVE_TH_LOW_40M 10 -#define VeryLowRSSI 15 -#define CTSToSelfTHVal 30 +#define VERY_LOW_RSSI 15 +#define CTS_TO_SELF_TH_VAL 30/* defined by vivi, for tx power track */ #define E_FOR_TX_POWER_TRACK 300
Signature · 1 line
2.18.0
PATCH 17/18 staging:rtl8192u: Rename Register Constants - Style
In reply to John WhitmoreThe four register constants, 'Current_Tx_Rate_Reg', 'Initial_Tx_Rate_Reg', 'Tx_Retry_Count_Reg' and 'RegC38_TH' all cause checkpatch issue with CamelCase naming. The three have been renamed to 'CURRENT_TX_RATE_REG', 'INITIAL_TX_RATE_REG', 'TX_RETRY_COUNT_REG' and 'REG_C38_TH' respectively.
These are coding style changes which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.c | 16 ++++++++-------- drivers/staging/rtl8192u/r8192U_dm.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.c +8 -8
@@ -2875,13 +2875,13 @@ void dm_check_fsync(struct net_device *dev)if (priv->framesyncMonitor) {if (priv->ieee80211->state ==IEEE80211_LINKED ) { -if (priv->undecorated_smoothed_pwdb <= RegC38_TH) { +if (priv->undecorated_smoothed_pwdb <=REG_C38_TH ) {if (reg_c38_State != RegC38_NonFsync_Other_AP) {write_nic_byte (dev, rOFDM0_RxDetector3,0x90 ); reg_c38_State = RegC38_NonFsync_Other_AP; } - }else if (priv->undecorated_smoothed_pwdb >= (RegC38_TH+5 )) { + }else if (priv->undecorated_smoothed_pwdb >= (REG_C38_TH +5 )) {if (reg_c38_State) {write_nic_byte (dev, rOFDM0_RxDetector3, priv->framesync); reg_c38_State = RegC38_Default;
@@ -3046,15 +3046,15 @@ static void dm_check_txrateandretrycount(struct net_device *dev)struct r8192_priv *priv =ieee80211_priv (dev);struct ieee80211_device *ieee = priv->ieee80211;/* for 11n tx rate */ -/*priv->stats.CurrentShowTxate = read_nic_byte(dev, Current_Tx_Rate_Reg);*/ -read_nic_byte (dev, Current_Tx_Rate_Reg, &ieee->softmac_stats.CurrentShowTxate); +/*priv->stats.CurrentShowTxate = read_nic_byte(dev, CURRENT_TX_RATE_REG);*/ +read_nic_byte (dev,CURRENT_TX_RATE_REG , &ieee->softmac_stats.CurrentShowTxate);/*printk("=============>tx_rate_reg:%x\n", ieee->softmac_stats.CurrentShowTxate);*/ /* for initial tx rate */ -/*priv->stats.last_packet_rate = read_nic_byte(dev, Initial_Tx_Rate_Reg);*/ -read_nic_byte (dev, Initial_Tx_Rate_Reg, &ieee->softmac_stats.last_packet_rate); +/*priv->stats.last_packet_rate = read_nic_byte(dev, INITIAL_TX_RATE_REG);*/ +read_nic_byte (dev,INITIAL_TX_RATE_REG , &ieee->softmac_stats.last_packet_rate);/* for tx tx retry count */ -/*priv->stats.txretrycount = read_nic_dword(dev, Tx_Retry_Count_Reg);*/ -read_nic_dword (dev, Tx_Retry_Count_Reg, &ieee->softmac_stats.txretrycount); +/*priv->stats.txretrycount = read_nic_dword(dev, TX_RETRY_COUNT_REG);*/ +read_nic_dword (dev,TX_RETRY_COUNT_REG , &ieee->softmac_stats.txretrycount); }static void dm_send_rssi_tofw (struct net_device *dev)
drivers/staging/rtl8192u/r8192U_dm.h +4 -4
@@ -56,10 +56,10 @@#define TX_POWER_ATHEROAP_THRESH_LOW 72/* defined by vivi, for showing on UI */ -#define Current_Tx_Rate_Reg 0x1b8 -#define Initial_Tx_Rate_Reg 0x1b9 -#define Tx_Retry_Count_Reg 0x1ac -#define RegC38_TH 20 +#define CURRENT_TX_RATE_REG 0x1b8 +#define INITIAL_TX_RATE_REG 0x1b9 +#define TX_RETRY_COUNT_REG 0x1ac +#define REG_C38_TH 20/*--------------------------Define Parameters-------------------------------*/
Signature · 1 line
2.18.0
PATCH 18/18 staging:rtl8192u: Clean up of spacing - Style
In reply to John WhitmoreMultiple blank line, which cause an issue with checkpath, have been removed and the spacing of definitions have been aligned to look cleaner.
These are coding style changes which should have no impact on runtime code execution.
--- drivers/staging/rtl8192u/r8192U_dm.h | 123 +++++++++++++-------------- 1 file changed, 58 insertions(+), 65 deletions(-)
drivers/staging/rtl8192u/r8192U_dm.h +58 -65
@@ -21,48 +21,46 @@#ifndef __R8192UDM_H__#define __R8192UDM_H__ -/*--------------------------Define Parameters-------------------------------*/ -#define DM_DIG_THRESH_HIGH 40 -#define DM_DIG_THRESH_LOW 35 +#define DM_DIG_THRESH_HIGH 40 +#define DM_DIG_THRESH_LOW 35 -#define DM_DIG_HIGH_PWR_THRESH_HIGH 75 -#define DM_DIG_HIGH_PWR_THRESH_LOW 70 +#define DM_DIG_HIGH_PWR_THRESH_HIGH 75 +#define DM_DIG_HIGH_PWR_THRESH_LOW 70 -#define BW_AUTO_SWITCH_HIGH_LOW 25 -#define BW_AUTO_SWITCH_LOW_HIGH 30 +#define BW_AUTO_SWITCH_HIGH_LOW 25 +#define BW_AUTO_SWITCH_LOW_HIGH 30 -#define DM_DIG_BACKOFF 12 -#define DM_DIG_MAX 0x36 -#define DM_DIG_MIN 0x1c -#define DM_DIG_MIN_NETCORE 0x12 +#define DM_DIG_BACKOFF 12 +#define DM_DIG_MAX 0x36 +#define DM_DIG_MIN 0x1c +#define DM_DIG_MIN_NETCORE 0x12 -#define RX_PATH_SELECTION_SS_TH_LOW 30 -#define RX_PATH_SELECTION_DIFF_TH 18 +#define RX_PATH_SELECTION_SS_TH_LOW 30 +#define RX_PATH_SELECTION_DIFF_TH 18 -#define RATE_ADAPTIVE_TH_HIGH 50 -#define RATE_ADAPTIVE_TH_LOW_20M 30 -#define RATE_ADAPTIVE_TH_LOW_40M 10 -#define VERY_LOW_RSSI 15 -#define CTS_TO_SELF_TH_VAL 30 +#define RATE_ADAPTIVE_TH_HIGH 50 +#define RATE_ADAPTIVE_TH_LOW_20M 30 +#define RATE_ADAPTIVE_TH_LOW_40M 10 +#define VERY_LOW_RSSI 15 +#define CTS_TO_SELF_TH_VAL 30/* defined by vivi, for tx power track */ -#define E_FOR_TX_POWER_TRACK 300 +#define E_FOR_TX_POWER_TRACK 300/* Dynamic Tx Power Control Threshold */ -#define TX_POWER_NEAR_FIELD_THRESH_HIGH 68 -#define TX_POWER_NEAR_FIELD_THRESH_LOW 62 +#define TX_POWER_NEAR_FIELD_THRESH_HIGH 68 +#define TX_POWER_NEAR_FIELD_THRESH_LOW 62/* added by amy for atheros AP */ #define TX_POWER_ATHEROAP_THRESH_HIGH 78 -#define TX_POWER_ATHEROAP_THRESH_LOW 72 +#define TX_POWER_ATHEROAP_THRESH_LOW 72/* defined by vivi, for showing on UI */ -#define CURRENT_TX_RATE_REG 0x1b8 -#define INITIAL_TX_RATE_REG 0x1b9 -#define TX_RETRY_COUNT_REG 0x1ac -#define REG_C38_TH 20 +#define CURRENT_TX_RATE_REG 0x1b8 +#define INITIAL_TX_RATE_REG 0x1b9 +#define TX_RETRY_COUNT_REG 0x1ac +#define REG_C38_TH 20/*--------------------------Define Parameters-------------------------------*/ -/*------------------------------Define structure----------------------------*/ enum dig_algorithm {
@@ -78,49 +76,49 @@ enum dynamic_init_gain_state {enum dig_connect {DIG_DISCONNECT =0 , -DIG_CONNECT =1 , +DIG_CONNECT =1 , };enum dig_pkt_detection_threshold { -DIG_PD_AT_LOW_POWER =0 , +DIG_PD_AT_LOW_POWER =0 ,DIG_PD_AT_NORMAL_POWER =1 , -DIG_PD_AT_HIGH_POWER =2 , +DIG_PD_AT_HIGH_POWER =2 , };enum dig_cck_cs_ratio_state { -DIG_CS_RATIO_LOWER =0 , +DIG_CS_RATIO_LOWER =0 ,DIG_CS_RATIO_HIGHER =1 , };/* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */ struct dig { -u8 dig_enable_flag; -enum dig_algorithm dig_algorithm; -u8 dig_algorithm_switch; +u8 dig_enable_flag; +enum dig_algorithm dig_algorithm; +u8 dig_algorithm_switch; -long rssi_low_thresh; -long rssi_high_thresh; +long rssi_low_thresh; +long rssi_high_thresh; -long rssi_high_power_lowthresh; -long rssi_high_power_highthresh; +long rssi_high_power_lowthresh; +long rssi_high_power_highthresh; -enum dynamic_init_gain_state dig_state; -enum dynamic_init_gain_state dig_highpwr_state; -enum dig_connect cur_connect_state; -enum dig_connect pre_connect_state; +enum dynamic_init_gain_state dig_state; +enum dynamic_init_gain_state dig_highpwr_state; +enum dig_connect cur_connect_state; +enum dig_connect pre_connect_state; -enum dig_pkt_detection_threshold curpd_thstate; -enum dig_pkt_detection_threshold prepd_thstate; -enum dig_cck_cs_ratio_state curcs_ratio_state; -enum dig_cck_cs_ratio_state precs_ratio_state; +enum dig_pkt_detection_threshold curpd_thstate; +enum dig_pkt_detection_threshold prepd_thstate; +enum dig_cck_cs_ratio_state curcs_ratio_state; +enum dig_cck_cs_ratio_state precs_ratio_state; -u32 pre_ig_value; -u32 cur_ig_value; +u32 pre_ig_value; +u32 cur_ig_value; -u8 backoff_val; -u8 rx_gain_range_min; +u8 backoff_val; +u8 rx_gain_range_min; -long rssi_val; +long rssi_val; };enum cck_rx_path_method {
@@ -129,36 +127,33 @@ enum cck_rx_path_method { };struct dynamic_rx_path_sel { -enum cck_rx_path_method cck_method; -u8 cck_rx_path; +enum cck_rx_path_method cck_method; +u8 cck_rx_path; -u8 disabled_rf; +u8 disabled_rf; -u8 rf_rssi[4 ]; -u8 rf_enable_rssi_th[4 ]; -long cck_pwdb_sta[4 ]; +u8 rf_rssi[4 ]; +u8 rf_enable_rssi_th[4 ]; +long cck_pwdb_sta[4 ]; };struct tx_config_cmd { -u32 cmd_op;/* Command packet type. */ -u32 cmd_length;/* Command packet length. */ -u32 cmd_value; +u32 cmd_op;/* Command packet type. */ +u32 cmd_length;/* Command packet length. */ +u32 cmd_value; };/*------------------------------Define structure----------------------------*/ -/*------------------------Export global variable----------------------------*/ extern struct dig dm_digtable;extern u8 dm_shadow[16 ][256 ];/*------------------------Export global variable----------------------------*/ -/*------------------------Export Marco Definition---------------------------*/ /*------------------------Export Marco Definition---------------------------*/ -/*--------------------------Exported Function prototype---------------------*/ void init_hal_dm (struct net_device *dev);void deinit_hal_dm (struct net_device *dev);
@@ -178,8 +173,6 @@ void dm_shadow_init(struct net_device *dev);void dm_initialize_txpower_tracking (struct net_device *dev);/*--------------------------Exported Function prototype---------------------*/ -#endif /*__R8192UDM_H__ */ -/* End of r8192U_dm.h */
Signature · 1 line
2.18.0