staging: rtl8192e: Remove variable nMaxAMSDUSize and further
cover staging: rtl8192e: Remove variable nMaxAMSDUSize and further
Remove unused or unchanged variables.
Tested with rtl8192e (WLL6130-D99) in Mode n (12.5 MB/s) Transferred this patch over wlan connection of rtl8192e. Tested in b,g,n mode and n mode in channels 2, 9, 13
Philipp Hortmann (10):
staging: rtl8192e: Remove variable bCurrent_AMSDU_Support
staging: rtl8192e: Remove unused variable nMaxAMSDUSize
staging: rtl8192e: Remove constant variable self_mimo_ps
staging: rtl8192e: Remove constant variable peer_mimo_ps
staging: rtl8192e: Remove constant variable forced_short_gi
staging: rtl8192e: Remove unused variable ht_info->amsdu_support
staging: rtl8192e: Remove variable ht_info->mpdu_density
staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode
staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation
staging: rtl8192e: Remove constant variable reg_rx_reorder_enable
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl819x_HT.h | 11 --- drivers/staging/rtl8192e/rtl819x_HTProc.c | 77 ++++--------------- drivers/staging/rtl8192e/rtllib_tx.c | 5 -- 5 files changed, 17 insertions(+), 82 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/10 staging: rtl8192e: Remove variable bCurrent_AMSDU_Support
bCurrent_AMSDU_Support and nCurrent_AMSDU_MaxSize are set but never evaluated.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 2 -- drivers/staging/rtl8192e/rtl819x_HTProc.c | 9 --------- 2 files changed, 11 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -2
@@ -103,8 +103,6 @@ struct rt_hi_throughput {u8 PeerHTInfoBuf[32 ];u8 amsdu_support;u16 amsdu_max_size; -u8 bCurrent_AMSDU_Support; -u16 nCurrent_AMSDU_MaxSize;u8 ampdu_enable;u8 current_ampdu_enable;u8 ampdu_factor;
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -9
@@ -471,15 +471,8 @@ void HTOnAssocRsp(struct rtllib_device *ieee) ht_info->cur_short_gi_20mhz = ((pPeerHTCap->ShortGI20Mhz ==1 ) ? true : false); ht_info->cur_short_gi_40mhz = ((pPeerHTCap->ShortGI40Mhz ==1 ) ? true : false); - ht_info->bCurrent_AMSDU_Support = ht_info->amsdu_support; - nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize ==0 ) ?3839 :7935 ; -if (ht_info->amsdu_max_size > nMaxAMSDUSize) - ht_info->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; -else - ht_info->nCurrent_AMSDU_MaxSize = ht_info->amsdu_max_size; - ht_info->current_ampdu_enable = ht_info->ampdu_enable;if (ieee->rtllib_ap_sec_type && (ieee->rtllib_ap_sec_type (ieee) & (SEC_ALG_WEP |SEC_ALG_TKIP ))) {
@@ -547,8 +540,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) ht_info->cur_short_gi_40mhz = false; ht_info->forced_short_gi = false; - ht_info->bCurrent_AMSDU_Support = false; - ht_info->nCurrent_AMSDU_MaxSize = ht_info->amsdu_max_size; ht_info->current_mpdu_density = ht_info->mpdu_density; ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor;
Signature · 1 line
2.43.0
PATCH 2/10 staging: rtl8192e: Remove unused variable nMaxAMSDUSize
In reply to Philipp HortmannRemove unused variables nMaxAMSDUSize and amsdu_max_size.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ---- 2 files changed, 5 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -102,7 +102,6 @@ struct rt_hi_throughput {u8 PeerHTCapBuf[32 ];u8 PeerHTInfoBuf[32 ];u8 amsdu_support; -u16 amsdu_max_size;u8 ampdu_enable;u8 current_ampdu_enable;u8 ampdu_factor;
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -4
@@ -71,7 +71,6 @@ void ht_update_default_setting(struct rtllib_device *ieee) {struct rt_hi_throughput *ht_info = ieee->ht_info; - ht_info->amsdu_max_size =7935UL ; ht_info->amsdu_support =0 ; ht_info->ampdu_enable =1 ;
@@ -436,7 +435,6 @@ void HTOnAssocRsp(struct rtllib_device *ieee)struct rt_hi_throughput *ht_info = ieee->ht_info;struct ht_capab_ele *pPeerHTCap =NULL ;struct ht_info_ele *pPeerHTInfo =NULL ; -u16 nMaxAMSDUSize =0 ;u8 *pMcsFilter =NULL ;static const u8 EWC11NHTCap[] = {0x00 ,0x90 ,0x4c ,0x33 };
@@ -471,8 +469,6 @@ void HTOnAssocRsp(struct rtllib_device *ieee) ht_info->cur_short_gi_20mhz = ((pPeerHTCap->ShortGI20Mhz ==1 ) ? true : false); ht_info->cur_short_gi_40mhz = ((pPeerHTCap->ShortGI40Mhz ==1 ) ? true : false); - nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize ==0 ) ?3839 :7935 ; - ht_info->current_ampdu_enable = ht_info->ampdu_enable;if (ieee->rtllib_ap_sec_type && (ieee->rtllib_ap_sec_type (ieee) & (SEC_ALG_WEP |SEC_ALG_TKIP ))) {
Signature · 1 line
2.43.0
PATCH 3/10 staging: rtl8192e: Remove constant variable self_mimo_ps
In reply to Philipp HortmannRemove constant variable self_mimo_ps and replace it at the place of usage with the value.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -112,7 +112,6 @@ struct rt_hi_throughput {u8 forced_mpdu_density;u8 forced_short_gi;u8 current_op_mode; -u8 self_mimo_ps;u8 peer_mimo_ps;enum ht_extchnl_offset CurSTAExtChnlOffset;u8 cur_tx_bw40mhz;
drivers/staging/rtl8192e/rtl819x_HTProc.c +1 -4
@@ -77,9 +77,6 @@ void ht_update_default_setting(struct rtllib_device *ieee) ht_info->ampdu_factor =2 ; ht_info->mpdu_density =0 ; - ht_info->self_mimo_ps =3 ; -if (ht_info->self_mimo_ps ==2 ) - ht_info->self_mimo_ps =3 ; ieee->tx_dis_rate_fallback =0 ; ieee->tx_use_drv_assinged_rate =0 ;
@@ -266,7 +263,7 @@ void ht_construct_capability_element(struct rtllib_device *ieee, u8 *posHTCap,else pCapELE->ChlWidth =1 ; - pCapELE->MimoPwrSave = pHT->self_mimo_ps; + pCapELE->MimoPwrSave =3 ; pCapELE->GreenField =0 ; pCapELE->ShortGI20Mhz =1 ; pCapELE->ShortGI40Mhz =1 ;
Signature · 1 line
2.43.0
PATCH 4/10 staging: rtl8192e: Remove constant variable peer_mimo_ps
In reply to Philipp HortmannMimoPwrSave is set to 3 and not changed. peer_mimo_ps is set to MimoPwrSave and not changed. All evaluations of peer_mimo_ps with 0 will have a constant result and can be removed.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 +---- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 +----- 3 files changed, 2 insertions(+), 10 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -4
@@ -1753,10 +1753,7 @@ void rtl92e_update_ratr_table(struct net_device *dev) ratr_value &=0x00000FF7 ;break ;case WIRELESS_MODE_N_24G : -if (ieee->ht_info->peer_mimo_ps ==0 ) - ratr_value &=0x0007F007 ; -else - ratr_value &=0x000FF007 ; + ratr_value &=0x000FF007 ;break ;default :break ;
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -112,7 +112,6 @@ struct rt_hi_throughput {u8 forced_mpdu_density;u8 forced_short_gi;u8 current_op_mode; -u8 peer_mimo_ps;enum ht_extchnl_offset CurSTAExtChnlOffset;u8 cur_tx_bw40mhz;u8 sw_bw_in_progress;
drivers/staging/rtl8192e/rtl819x_HTProc.c +1 -5
@@ -507,11 +507,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)HTFilterMCSRate (ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set); - ht_info->peer_mimo_ps = pPeerHTCap->MimoPwrSave; -if (ht_info->peer_mimo_ps ==MIMO_PS_STATIC ) - pMcsFilter =MCS_FILTER_1SS ; -else - pMcsFilter =MCS_FILTER_ALL ; + pMcsFilter =MCS_FILTER_ALL ; ieee->HTHighestOperaRate =HTGetHighestMCSRate (ieee, ieee->dot11ht_oper_rate_set, pMcsFilter);
Signature · 1 line
2.43.0
PATCH 5/10 staging: rtl8192e: Remove constant variable forced_short_gi
In reply to Philipp Hortmannht_info->forced_short_gi is set to 0 and unchanged. Therefore all equations result accordingly and ht_info->forced_short_gi can be removed.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 1 - drivers/staging/rtl8192e/rtllib_tx.c | 5 ----- 3 files changed, 7 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -110,7 +110,6 @@ struct rt_hi_throughput {u8 current_mpdu_density;u8 forced_ampdu_factor;u8 forced_mpdu_density; -u8 forced_short_gi;u8 current_op_mode;enum ht_extchnl_offset CurSTAExtChnlOffset;u8 cur_tx_bw40mhz;
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -1
@@ -527,7 +527,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) ht_info->cur_short_gi_20mhz = false; ht_info->cur_short_gi_40mhz = false; - ht_info->forced_short_gi = false; ht_info->current_mpdu_density = ht_info->mpdu_density; ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor;
drivers/staging/rtl8192e/rtllib_tx.c +0 -5
@@ -340,11 +340,6 @@ static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee,if (!ht_info->current_ht_support || !ht_info->enable_ht)return ; -if (ht_info->forced_short_gi) { - tcb_desc->bUseShortGI = true; -return ; - } -if (ht_info->cur_bw_40mhz && ht_info->cur_short_gi_40mhz) tcb_desc->bUseShortGI = true;else if (!ht_info->cur_bw_40mhz && ht_info->cur_short_gi_20mhz)
Signature · 1 line
2.43.0
PATCH 6/10 staging: rtl8192e: Remove unused variable ht_info->amsdu_support
In reply to Philipp HortmannRemove unused variable ht_info->amsdu_support.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 2 -- 2 files changed, 3 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -101,7 +101,6 @@ struct rt_hi_throughput {struct ht_capab_ele SelfHTCap;u8 PeerHTCapBuf[32 ];u8 PeerHTInfoBuf[32 ]; -u8 amsdu_support;u8 ampdu_enable;u8 current_ampdu_enable;u8 ampdu_factor;
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -2
@@ -71,8 +71,6 @@ void ht_update_default_setting(struct rtllib_device *ieee) {struct rt_hi_throughput *ht_info = ieee->ht_info; - ht_info->amsdu_support =0 ; - ht_info->ampdu_enable =1 ; ht_info->ampdu_factor =2 ; ht_info->mpdu_density =0 ;
Signature · 1 line
2.43.0
PATCH 7/10 staging: rtl8192e: Remove variable ht_info->mpdu_density
In reply to Philipp Hortmannht_info->mpdu_density is set to 0 and unchanged. Therefore all equations result accordingly and ht_info->forced_short_gi can be removed.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -105,7 +105,6 @@ struct rt_hi_throughput {u8 current_ampdu_enable;u8 ampdu_factor;u8 CurrentAMPDUFactor; -u8 mpdu_density;u8 current_mpdu_density;u8 forced_ampdu_factor;u8 forced_mpdu_density;
drivers/staging/rtl8192e/rtl819x_HTProc.c +2 -4
@@ -73,7 +73,6 @@ void ht_update_default_setting(struct rtllib_device *ieee) ht_info->ampdu_enable =1 ; ht_info->ampdu_factor =2 ; - ht_info->mpdu_density =0 ; ieee->tx_dis_rate_fallback =0 ; ieee->tx_use_drv_assinged_rate =0 ;
@@ -491,8 +490,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee) HT_AGG_SIZE_32K); } } - ht_info->current_mpdu_density =max_t (u8, ht_info->mpdu_density, - pPeerHTCap->MPDUDensity); + ht_info->current_mpdu_density = pPeerHTCap->MPDUDensity;if (ht_info->iot_action &HT_IOT_ACT_TX_USE_AMSDU_8K ) { ht_info->current_ampdu_enable = false; }
@@ -526,7 +524,7 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) ht_info->cur_short_gi_20mhz = false; ht_info->cur_short_gi_40mhz = false; - ht_info->current_mpdu_density = ht_info->mpdu_density; + ht_info->current_mpdu_density =0 ; ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor; memset((void *)(&ht_info->SelfHTCap), 0,
Signature · 1 line
2.43.0
PATCH 8/10 staging: rtl8192e: Remove variable ht_info->RT2RT_HT_Mode
In reply to Philipp HortmannRemove variable ht_info->RT2RT_HT_Mode as it is always set but never evaluated.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 4 ---- 3 files changed, 6 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
@@ -287,7 +287,6 @@ static void _rtl92e_update_beacon(void *data)if (ieee->ht_info->current_ht_support)HT_update_self_and_peer_setting (ieee, net); ieee->ht_info->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time; - ieee->ht_info->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode;_rtl92e_update_cap (dev, net->capability); }
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -113,7 +113,6 @@ struct rt_hi_throughput {u8 cur_tx_bw40mhz;u8 sw_bw_in_progress;u8 reg_rt2rt_aggregation; -u8 RT2RT_HT_Mode;u8 current_rt2rt_aggregation;u8 current_rt2rt_long_slot_time;u8 sz_rt2rt_agg_buf[10 ];
drivers/staging/rtl8192e/rtl819x_HTProc.c +0 -4
@@ -540,7 +540,6 @@ void HTInitializeHTInfo(struct rtllib_device *ieee) ht_info->current_rt2rt_aggregation = false; ht_info->current_rt2rt_long_slot_time = false; - ht_info->RT2RT_HT_Mode = (enum rt_ht_capability )0 ; ht_info->iot_peer =0 ; ht_info->iot_action =0 ;
@@ -601,11 +600,9 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pNetwork->bssht.bd_rt2rt_aggregation; ht_info->current_rt2rt_long_slot_time = pNetwork->bssht.bd_rt2rt_long_slot_time; - ht_info->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; }else { ht_info->current_rt2rt_aggregation = false; ht_info->current_rt2rt_long_slot_time = false; - ht_info->RT2RT_HT_Mode = (enum rt_ht_capability )0 ; }ht_iot_peer_determine (ieee);
@@ -621,7 +618,6 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, ht_info->current_ht_support = false; ht_info->current_rt2rt_aggregation = false; ht_info->current_rt2rt_long_slot_time = false; - ht_info->RT2RT_HT_Mode = (enum rt_ht_capability )0 ; ht_info->iot_action =0 ; ht_info->iot_ra_func =0 ;
Signature · 1 line
2.43.0
PATCH 9/10 staging: rtl8192e: Remove constant variable reg_rt2rt_aggregation
In reply to Philipp Hortmannht_info->reg_rt2rt_aggregation is set to 1 and unchanged. Therefore all equations result accordingly and ht_info->reg_rt2rt_aggregation can be removed.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 37 +++++++---------------- 2 files changed, 11 insertions(+), 27 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -112,7 +112,6 @@ struct rt_hi_throughput {enum ht_extchnl_offset CurSTAExtChnlOffset;u8 cur_tx_bw40mhz;u8 sw_bw_in_progress; -u8 reg_rt2rt_aggregation;u8 current_rt2rt_aggregation;u8 current_rt2rt_long_slot_time;u8 sz_rt2rt_agg_buf[10 ];
drivers/staging/rtl8192e/rtl819x_HTProc.c +11 -26
@@ -79,8 +79,6 @@ void ht_update_default_setting(struct rtllib_device *ieee) ieee->tx_enable_fw_calc_dur =1 ; - ht_info->reg_rt2rt_aggregation =1 ; - ht_info->reg_rx_reorder_enable =1 ; ht_info->rx_reorder_win_size =64 ; ht_info->rx_reorder_pending_time =30 ;
@@ -471,25 +469,17 @@ void HTOnAssocRsp(struct rtllib_device *ieee) ht_info->current_ampdu_enable = false; } -if (!ht_info->reg_rt2rt_aggregation) { -if (ht_info->ampdu_factor > pPeerHTCap->MaxRxAMPDUFactor) +if (ieee->current_network.bssht.bd_rt2rt_aggregation) { +if (ieee->pairwise_key_type !=KEY_TYPE_NA ) ht_info->CurrentAMPDUFactor = - pPeerHTCap->MaxRxAMPDUFactor; + pPeerHTCap->MaxRxAMPDUFactor;else - ht_info->CurrentAMPDUFactor = ht_info->ampdu_factor; - + ht_info->CurrentAMPDUFactor =HT_AGG_SIZE_64K ; }else { -if (ieee->current_network.bssht.bd_rt2rt_aggregation) { -if (ieee->pairwise_key_type !=KEY_TYPE_NA ) - ht_info->CurrentAMPDUFactor = - pPeerHTCap->MaxRxAMPDUFactor; -else - ht_info->CurrentAMPDUFactor =HT_AGG_SIZE_64K ; - }else { - ht_info->CurrentAMPDUFactor =min_t (u32, pPeerHTCap->MaxRxAMPDUFactor, -HT_AGG_SIZE_32K ); - } + ht_info->CurrentAMPDUFactor =min_t (u32, pPeerHTCap->MaxRxAMPDUFactor, +HT_AGG_SIZE_32K ); } + ht_info->current_mpdu_density = pPeerHTCap->MPDUDensity;if (ht_info->iot_action &HT_IOT_ACT_TX_USE_AMSDU_8K ) { ht_info->current_ampdu_enable = false;
@@ -595,15 +585,10 @@ void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, pNetwork->bssht.bd_ht_info_buf, pNetwork->bssht.bd_ht_info_len); -if (ht_info->reg_rt2rt_aggregation) { - ht_info->current_rt2rt_aggregation = - pNetwork->bssht.bd_rt2rt_aggregation; - ht_info->current_rt2rt_long_slot_time = - pNetwork->bssht.bd_rt2rt_long_slot_time; - }else { - ht_info->current_rt2rt_aggregation = false; - ht_info->current_rt2rt_long_slot_time = false; - } + ht_info->current_rt2rt_aggregation = + pNetwork->bssht.bd_rt2rt_aggregation; + ht_info->current_rt2rt_long_slot_time = + pNetwork->bssht.bd_rt2rt_long_slot_time;ht_iot_peer_determine (ieee);
Signature · 1 line
2.43.0
PATCH 10/10 staging: rtl8192e: Remove constant variable reg_rx_reorder_enable
In reply to Philipp HortmannRemove constant variable reg_rx_reorder_enable and replace it at the place of usage with the value.
--- drivers/staging/rtl8192e/rtl819x_HT.h | 1 - drivers/staging/rtl8192e/rtl819x_HTProc.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/rtl8192e/rtl819x_HT.h +0 -1
@@ -115,7 +115,6 @@ struct rt_hi_throughput {u8 current_rt2rt_aggregation;u8 current_rt2rt_long_slot_time;u8 sz_rt2rt_agg_buf[10 ]; -u8 reg_rx_reorder_enable;u8 cur_rx_reorder_enable;u8 rx_reorder_win_size;u8 rx_reorder_pending_time;
drivers/staging/rtl8192e/rtl819x_HTProc.c +1 -2
@@ -79,7 +79,6 @@ void ht_update_default_setting(struct rtllib_device *ieee) ieee->tx_enable_fw_calc_dur =1 ; - ht_info->reg_rx_reorder_enable =1 ; ht_info->rx_reorder_win_size =64 ; ht_info->rx_reorder_pending_time =30 ; }
@@ -484,7 +483,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)if (ht_info->iot_action &HT_IOT_ACT_TX_USE_AMSDU_8K ) { ht_info->current_ampdu_enable = false; } - ht_info->cur_rx_reorder_enable = ht_info->reg_rx_reorder_enable; + ht_info->cur_rx_reorder_enable =1 ;if (pPeerHTCap->MCS[0 ] ==0 ) pPeerHTCap->MCS[0 ] =0xff ;
Signature · 1 line
2.43.0