staging: rtl8188eu: Remove code valid only for 5 GHz
PATCH 1/4 staging: rtl8188eu: Remove code valid only for 5 GHz
Remove code that is only valid for channels > 14.
This addresses the below TODO item.
- find and remove remaining code valid only for 5 GHz. Most of the obvious ones have been removed, but things like channel > 14 still exist.
Signed-off-by Michael Straube <[email protected]>
--- .../staging/rtl8188eu/core/rtw_wlan_util.c | 47 +++++++------------ 1 file changed, 17 insertions(+), 30 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +17 -30
@@ -110,22 +110,16 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelenstruct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -if (pmlmeext->cur_channel >14 ) { -if (pmlmeinfo->HT_enable) - network_type =WIRELESS_11_5N ; +if (pmlmeinfo->HT_enable) + network_type =WIRELESS_11_24N ; + +if ((cckratesonly_included (rate, ratelen)) == true) + network_type |=WIRELESS_11B ; +else if ((cckrates_included (rate, ratelen)) == true) + network_type |=WIRELESS_11BG ; +else + network_type |=WIRELESS_11G ; - network_type |=WIRELESS_11A ; - }else { -if (pmlmeinfo->HT_enable) - network_type =WIRELESS_11_24N ; - -if ((cckratesonly_included (rate, ratelen)) == true) - network_type |=WIRELESS_11B ; -else if ((cckrates_included (rate, ratelen)) == true) - network_type |=WIRELESS_11BG ; -else - network_type |=WIRELESS_11G ; - }return network_type; }
@@ -1429,22 +1423,15 @@ void update_wireless_mode(struct adapter *padapter)if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable)) pmlmeinfo->HT_enable =1 ; -if (pmlmeext->cur_channel >14 ) { -if (pmlmeinfo->HT_enable) - network_type =WIRELESS_11_5N ; +if (pmlmeinfo->HT_enable) + network_type =WIRELESS_11_24N ; - network_type |=WIRELESS_11A ; - }else { -if (pmlmeinfo->HT_enable) - network_type =WIRELESS_11_24N ; - -if ((cckratesonly_included (rate, ratelen)) == true) - network_type |=WIRELESS_11B ; -else if ((cckrates_included (rate, ratelen)) == true) - network_type |=WIRELESS_11BG ; -else - network_type |=WIRELESS_11G ; - } +if ((cckratesonly_included (rate, ratelen)) == true) + network_type |=WIRELESS_11B ; +else if ((cckrates_included (rate, ratelen)) == true) + network_type |=WIRELESS_11BG ; +else + network_type |=WIRELESS_11G ; pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode;
Signature · 1 line
2.18.0
PATCH 2/4 staging: rtl8188eu: fix comparsions to true
Use if(x) instead of if(x == true).
Signed-off-by Michael Straube <[email protected]>
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +4 -4
@@ -113,9 +113,9 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelenif (pmlmeinfo->HT_enable) network_type =WIRELESS_11_24N ; -if ((cckratesonly_included (rate, ratelen)) == true) +if (cckratesonly_included (rate, ratelen)) network_type |=WIRELESS_11B ; -else if ((cckrates_included (rate, ratelen)) == true) +else if (cckrates_included (rate, ratelen)) network_type |=WIRELESS_11BG ;else network_type |=WIRELESS_11G ;
@@ -1426,9 +1426,9 @@ void update_wireless_mode(struct adapter *padapter)if (pmlmeinfo->HT_enable) network_type =WIRELESS_11_24N ; -if ((cckratesonly_included (rate, ratelen)) == true) +if (cckratesonly_included (rate, ratelen)) network_type |=WIRELESS_11B ; -else if ((cckrates_included (rate, ratelen)) == true) +else if (cckrates_included (rate, ratelen)) network_type |=WIRELESS_11BG ;else network_type |=WIRELESS_11G ;
Signature · 1 line
2.18.0
PATCH 3/4 staging: rtl8188eu: remove whitespace
In reply to Michael StraubeReplace tabs with spaces where appropriate.
Signed-off-by Michael Straube <[email protected]>
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +7 -7
@@ -107,8 +107,8 @@ unsigned char networktype_to_raid(unsigned char network_type)u8 judge_network_type (struct adapter *padapter,unsigned char *rate,int ratelen) {u8 network_type =0 ; -struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);if (pmlmeinfo->HT_enable) network_type =WIRELESS_11_24N ;
@@ -120,7 +120,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelenelse network_type |=WIRELESS_11G ; -return network_type; +return network_type; }static unsigned char ratetbl_val_2wifirate (unsigned char rate)
@@ -1413,10 +1413,10 @@ void update_wireless_mode(struct adapter *padapter) {int ratelen, network_type =0 ;u32 SIFS_Timer; -struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); -unsigned char *rate = cur_network->SupportedRates; +struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; +struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); +unsigned char *rate = cur_network->SupportedRates; ratelen =rtw_get_rateset_len (cur_network->SupportedRates);
Signature · 1 line
2.18.0
PATCH 4/4 staging: rtl8188eu: remove unnecessary parentheses
In reply to Michael StraubeRemove unnecessary parentheses to follow kernel coding style and clean checkpatch issues.
Signed-off-by Michael Straube <[email protected]>
--- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +4 -4
@@ -108,7 +108,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen {u8 network_type =0 ;struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); +struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;if (pmlmeinfo->HT_enable) network_type =WIRELESS_11_24N ;
@@ -1414,13 +1414,13 @@ void update_wireless_mode(struct adapter *padapter)int ratelen, network_type =0 ;u32 SIFS_Timer;struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; -struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); -struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); +struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; +struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;unsigned char *rate = cur_network->SupportedRates; ratelen =rtw_get_rateset_len (cur_network->SupportedRates); -if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable)) +if (pmlmeinfo->HT_info_enable && pmlmeinfo->HT_caps_enable) pmlmeinfo->HT_enable =1 ;if (pmlmeinfo->HT_enable)
Signature · 1 line
2.18.0