staging: rtl8192e: Remove wireless modes A and N_5G
cover staging: rtl8192e: Remove wireless modes A and N_5G
Remove WIRELESS_MODE_N_5G and WIRELESS_MODE_A which are not supported by hardware to remove dead code and increase readability.
Tested with rtl8192e on wireless modes: B, G, N_24G Transferred this patch over wlan connection of rtl8192e
Philipp Hortmann (7):
staging: rtl8192e: Remove rtl92e_config_phy
staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode
staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode
staging: rtl8192e: Remove unused if clauses in
rtl92e_set_wireless_mode
staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig
staging: rtl8192e: Remove wireless modes A, N_5G from
rtl92e_set_channel
staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G
.../staging/rtl8192e/rtl8192e/r8192E_dev.c | 19 +------- .../staging/rtl8192e/rtl8192e/r8192E_phy.c | 18 -------- .../staging/rtl8192e/rtl8192e/r8192E_phy.h | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 43 ++++--------------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 +-- 5 files changed, 12 insertions(+), 75 deletions(-)
Signature · 1 line
2.39.2
PATCH 1/7 staging: rtl8192e: Remove rtl92e_config_phy
Remove rtl92e_config_phy to improve readability.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 2 +- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 9 --------- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h | 1 - 3 files changed, 1 insertion(+), 11 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -1
@@ -691,7 +691,7 @@ bool rtl92e_start_adapter(struct net_device *dev) }if (priv->rst_progress ==RESET_TYPE_NORESET ) { - rtStatus =rtl92e_config_phy (dev); + rtStatus =rtl92e_config_rf (dev);if (!rtStatus) {netdev_info (dev,"RF Config failed\n" );return rtStatus;
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +0 -9
@@ -468,15 +468,6 @@ void rtl92e_set_tx_power(struct net_device *dev, u8 channel)rtl92e_set_ofdm_tx_power (dev, powerlevelOFDM24G); } -bool rtl92e_config_phy (struct net_device *dev) -{ -bool rtStatus = true; - - rtStatus =rtl92e_config_rf (dev); - -return rtStatus; -} -u8 rtl92e_config_rf_path (struct net_device *dev,enum rf90_radio_path eRFPath) {
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.h +0 -1
@@ -39,7 +39,6 @@ bool rtl92e_check_bb_and_rf(struct net_device *dev,bool rtl92e_config_bb (struct net_device *dev);void rtl92e_get_tx_power (struct net_device *dev);void rtl92e_set_tx_power (struct net_device *dev,u8 channel); -bool rtl92e_config_phy (struct net_device *dev);u8 rtl92e_config_rf_path (struct net_device *dev,enum rf90_radio_path eRFPath);u8 rtl92e_set_channel (struct net_device *dev,u8 channel);
Signature · 1 line
2.39.2
PATCH 2/7 staging: rtl8192e: Remove _rtl92e_get_supported_wireless_mode
In reply to Philipp HortmannRemove _rtl92e_get_supported_wireless_mode to improve readability.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -9
@@ -593,18 +593,10 @@ static void _rtl92e_refresh_support_rate(struct r8192_priv *priv) } } -static u8 _rtl92e_get_supported_wireless_mode (struct net_device *dev) -{ -u8 ret =0 ; - - ret = (WIRELESS_MODE_N_24G |WIRELESS_MODE_G |WIRELESS_MODE_B ); -return ret; -} -void rtl92e_set_wireless_mode (struct net_device *dev,u8 wireless_mode) {struct r8192_priv *priv =rtllib_priv (dev); -u8 support_mode =_rtl92e_get_supported_wireless_mode (dev); +u8 support_mode = (WIRELESS_MODE_N_24G |WIRELESS_MODE_G |WIRELESS_MODE_B );if ((wireless_mode ==WIRELESS_MODE_AUTO ) || ((wireless_mode & support_mode) ==0 )) {
Signature · 1 line
2.39.2
PATCH 3/7 staging: rtl8192e: Remove 5G wireless_mode in rtl92e_set_wireless_mode
In reply to Philipp HortmannRemove wireless_mode == WIRELESS_MODE_N_5G as 5G is not supported by hardware and to improve readability.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -4
@@ -624,12 +624,11 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) priv->rtllib->mode = wireless_mode; -if ((wireless_mode ==WIRELESS_MODE_N_24G ) || - (wireless_mode ==WIRELESS_MODE_N_5G )) { +if (wireless_mode ==WIRELESS_MODE_N_24G ) priv->rtllib->ht_info->enable_ht =1 ; - }else { +else priv->rtllib->ht_info->enable_ht =0 ; - } +_rtl92e_refresh_support_rate (priv); }
Signature · 1 line
2.39.2
PATCH 4/7 staging: rtl8192e: Remove unused if clauses in rtl92e_set_wireless_mode
In reply to Philipp HortmannEquation (support_mode & WIRELESS_MODE_N_24G) will always be true. Remove resulting dead code.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 21 ++------------------ 1 file changed, 2 insertions(+), 19 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +2 -19
@@ -598,25 +598,8 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)struct r8192_priv *priv =rtllib_priv (dev);u8 support_mode = (WIRELESS_MODE_N_24G |WIRELESS_MODE_G |WIRELESS_MODE_B ); -if ((wireless_mode ==WIRELESS_MODE_AUTO ) || - ((wireless_mode & support_mode) ==0 )) { -if (support_mode &WIRELESS_MODE_N_24G ) { - wireless_mode =WIRELESS_MODE_N_24G ; - }else if (support_mode &WIRELESS_MODE_N_5G ) { - wireless_mode =WIRELESS_MODE_N_5G ; - }else if ((support_mode &WIRELESS_MODE_A )) { - wireless_mode =WIRELESS_MODE_A ; - }else if ((support_mode &WIRELESS_MODE_G )) { - wireless_mode =WIRELESS_MODE_G ; - }else if ((support_mode &WIRELESS_MODE_B )) { - wireless_mode =WIRELESS_MODE_B ; - }else { -netdev_info (dev, -"%s(): Unsupported mode requested. Fallback to 802.11b\n" , - __func__); - wireless_mode =WIRELESS_MODE_B ; - } - } +if ((wireless_mode ==WIRELESS_MODE_AUTO ) || ((wireless_mode & support_mode) ==0 )) + wireless_mode =WIRELESS_MODE_N_24G ;if ((wireless_mode & (WIRELESS_MODE_B |WIRELESS_MODE_G )) == (WIRELESS_MODE_G |WIRELESS_MODE_B ))
Signature · 1 line
2.39.2
PATCH 5/7 staging: rtl8192e: Remove wireless modes A, N_5G from _rtl92e_hwconfig
In reply to Philipp HortmannRemove WIRELESS_MODE_N_5G and WIRELESS_MODE_A as those are not supported by hardware and to improve readability. Combine WIRELESS_MODE_G with default to improve readability.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +1 -16
@@ -503,16 +503,6 @@ static void _rtl92e_hwconfig(struct net_device *dev) regRATR =RATE_ALL_CCK ; regRRSR =RATE_ALL_CCK ;break ; -case WIRELESS_MODE_A : - regBwOpMode =BW_OPMODE_5G |BW_OPMODE_20MHZ ; - regRATR =RATE_ALL_OFDM_AG ; - regRRSR =RATE_ALL_OFDM_AG ; -break ; -case WIRELESS_MODE_G : - regBwOpMode =BW_OPMODE_20MHZ ; - regRATR =RATE_ALL_CCK |RATE_ALL_OFDM_AG ; - regRRSR =RATE_ALL_CCK |RATE_ALL_OFDM_AG ; -break ;case WIRELESS_MODE_AUTO :case WIRELESS_MODE_N_24G : regBwOpMode =BW_OPMODE_20MHZ ;
@@ -520,12 +510,7 @@ static void _rtl92e_hwconfig(struct net_device *dev)RATE_ALL_OFDM_1SS |RATE_ALL_OFDM_2SS ; regRRSR =RATE_ALL_CCK |RATE_ALL_OFDM_AG ;break ; -case WIRELESS_MODE_N_5G : - regBwOpMode =BW_OPMODE_5G ; - regRATR =RATE_ALL_OFDM_AG |RATE_ALL_OFDM_1SS | -RATE_ALL_OFDM_2SS ; - regRRSR =RATE_ALL_OFDM_AG ; -break ; +case WIRELESS_MODE_G :default : regBwOpMode =BW_OPMODE_20MHZ ; regRATR =RATE_ALL_CCK |RATE_ALL_OFDM_AG ;
Signature · 1 line
2.39.2
PATCH 6/7 staging: rtl8192e: Remove wireless modes A, N_5G from rtl92e_set_channel
In reply to Philipp HortmannRemove WIRELESS_MODE_N_5G and WIRELESS_MODE_A as those are not supported by hardware and to improve readability.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +0 -9
@@ -696,15 +696,6 @@ u8 rtl92e_set_channel(struct net_device *dev, u8 channel)switch (priv->rtllib->mode) { -case WIRELESS_MODE_A : -case WIRELESS_MODE_N_5G : -if (channel <=14 ) { -netdev_warn (dev, -"Channel %d not available in 802.11a.\n" , - channel); -return false; - } -break ;case WIRELESS_MODE_B :if (channel >14 ) { netdev_warn(dev,
Signature · 1 line
2.39.2
PATCH 7/7 staging: rtl8192e: Remove wireless mode WIRELESS_MODE_N_5G
In reply to Philipp HortmannRemove WIRELESS_MODE_N_5G from equations as it is not supported by hardware and to improve readability.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +-- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -581,8 +581,7 @@ static void _rtl92e_refresh_support_rate(struct r8192_priv *priv) {struct rtllib_device *ieee = priv->rtllib; -if (ieee->mode ==WIRELESS_MODE_N_24G || - ieee->mode ==WIRELESS_MODE_N_5G ) { +if (ieee->mode ==WIRELESS_MODE_N_24G ) {memcpy (ieee->reg_dot11ht_oper_rate_set, ieee->reg_ht_supp_rate_set,16 ); memcpy(ieee->reg_dot11tx_ht_oper_rate_set,
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +2 -4
@@ -296,8 +296,7 @@ static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev)if (pra->rate_adaptive_disabled)return ; -if (!(priv->rtllib->mode ==WIRELESS_MODE_N_24G || - priv->rtllib->mode ==WIRELESS_MODE_N_5G )) +if (priv->rtllib->mode !=WIRELESS_MODE_N_24G )return ;if (priv->rtllib->state ==RTLLIB_LINKED ) {
@@ -971,8 +970,7 @@ void rtl92e_dm_restore_state(struct net_device *dev)if (priv->rate_adaptive.rate_adaptive_disabled)return ; -if (!(priv->rtllib->mode ==WIRELESS_MODE_N_24G || - priv->rtllib->mode ==WIRELESS_MODE_N_5G )) +if (priv->rtllib->mode !=WIRELESS_MODE_N_24G )return ; ratr_value = reg_ratr; ratr_value &= ~(RATE_ALL_OFDM_2SS );
Signature · 1 line
2.39.2