Commit 1fee0cc9 authored by Fabio M. De Francesco's avatar Fabio M. De Francesco Committed by Greg Kroah-Hartman

staging: r8188eu: Remove all 5GHz network types

Remove all 5Ghz network types. r8188eu works on
802.11bgn standards and on 2.4Ghz band.
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarFabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-2-fmdefrancesco@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e7dd1a58
...@@ -460,11 +460,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level) ...@@ -460,11 +460,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
} }
if (pcur_network->Configuration.DSConfig > 14) { if (pcur_network->Configuration.DSConfig > 14) {
/* 5G band */ sta_band |= WIRELESS_INVALID;
if (tx_ra_bitmap & 0xffff000)
sta_band |= WIRELESS_11_5N | WIRELESS_11A;
else
sta_band |= WIRELESS_11A;
} else { } else {
if (tx_ra_bitmap & 0xffff000) if (tx_ra_bitmap & 0xffff000)
sta_band |= WIRELESS_11_24N | WIRELESS_11G | WIRELESS_11B; sta_band |= WIRELESS_11_24N | WIRELESS_11G | WIRELESS_11B;
...@@ -547,9 +543,7 @@ void update_bmc_sta(struct adapter *padapter) ...@@ -547,9 +543,7 @@ void update_bmc_sta(struct adapter *padapter)
} }
if (pcur_network->Configuration.DSConfig > 14) { if (pcur_network->Configuration.DSConfig > 14) {
/* force to A mode. 5G doesn't support CCK rates */ network_type = WIRELESS_INVALID;
network_type = WIRELESS_11A;
tx_ra_bitmap = 0x150; /* 6, 12, 24 Mbps */
} else { } else {
/* force to b mode */ /* force to b mode */
network_type = WIRELESS_11B; network_type = WIRELESS_11B;
...@@ -1050,9 +1044,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) ...@@ -1050,9 +1044,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
case WIRELESS_11BG_24N: case WIRELESS_11BG_24N:
pbss_network->NetworkTypeInUse = Ndis802_11OFDM24; pbss_network->NetworkTypeInUse = Ndis802_11OFDM24;
break; break;
case WIRELESS_11A:
pbss_network->NetworkTypeInUse = Ndis802_11OFDM5;
break;
default: default:
pbss_network->NetworkTypeInUse = Ndis802_11OFDM24; pbss_network->NetworkTypeInUse = Ndis802_11OFDM24;
break; break;
......
...@@ -98,10 +98,7 @@ uint rtw_is_cckratesonly_included(u8 *rate) ...@@ -98,10 +98,7 @@ uint rtw_is_cckratesonly_included(u8 *rate)
int rtw_check_network_type(unsigned char *rate, int ratelen, int channel) int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
{ {
if (channel > 14) { if (channel > 14) {
if ((rtw_is_cckrates_included(rate)) == true) return WIRELESS_INVALID;
return WIRELESS_INVALID;
else
return WIRELESS_11A;
} else { /* could be pure B, pure G, or B/G */ } else { /* could be pure B, pure G, or B/G */
if ((rtw_is_cckratesonly_included(rate)) == true) if ((rtw_is_cckratesonly_included(rate)) == true)
return WIRELESS_11B; return WIRELESS_11B;
...@@ -328,9 +325,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode) ...@@ -328,9 +325,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN); memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
break; break;
case WIRELESS_11G: case WIRELESS_11G:
case WIRELESS_11A:
case WIRELESS_11_5N:
case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN); memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
break; break;
case WIRELESS_11BG: case WIRELESS_11BG:
...@@ -393,16 +387,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) ...@@ -393,16 +387,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz); ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
/* supported rates */ /* supported rates */
if (pregistrypriv->wireless_mode == WIRELESS_11ABGN) { wireless_mode = pregistrypriv->wireless_mode;
if (pdev_network->Configuration.DSConfig > 14)
wireless_mode = WIRELESS_11A_5N;
else
wireless_mode = WIRELESS_11BG_24N;
} else {
wireless_mode = pregistrypriv->wireless_mode;
}
rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode); rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);
rateLen = rtw_get_rateset_len(pdev_network->SupportedRates); rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
......
...@@ -795,7 +795,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter) ...@@ -795,7 +795,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
(!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)))
return 0; return 0;
if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) { if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N)) {
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12); p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
if (p && ht_ielen > 0) { if (p && ht_ielen > 0) {
pht_capie = (struct ieee80211_ht_cap *)(p+2); pht_capie = (struct ieee80211_ht_cap *)(p+2);
......
...@@ -1916,16 +1916,6 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter) ...@@ -1916,16 +1916,6 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
case WIRELESS_11BG_24N: case WIRELESS_11BG_24N:
pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24); pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24);
break; break;
case WIRELESS_11A:
case WIRELESS_11A_5N:
pdev_network->NetworkTypeInUse = (Ndis802_11OFDM5);
break;
case WIRELESS_11ABGN:
if (pregistrypriv->channel > 14)
pdev_network->NetworkTypeInUse = (Ndis802_11OFDM5);
else
pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24);
break;
default: default:
/* TODO */ /* TODO */
break; break;
......
...@@ -1950,7 +1950,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role) ...@@ -1950,7 +1950,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
/* Added by Albert 2011/03/22 */ /* Added by Albert 2011/03/22 */
/* In the P2P mode, the driver should not support the b mode. */ /* In the P2P mode, the driver should not support the b mode. */
/* So, the Tx packet shouldn't use the CCK rate */ /* So, the Tx packet shouldn't use the CCK rate */
update_tx_basic_rate(padapter, WIRELESS_11AGN); update_tx_basic_rate(padapter, (WIRELESS_11G | WIRELESS_11_24N));
/* Enable P2P function */ /* Enable P2P function */
init_wifidirect_info(padapter, role); init_wifidirect_info(padapter, role);
......
...@@ -78,7 +78,6 @@ unsigned char networktype_to_raid(unsigned char network_type) ...@@ -78,7 +78,6 @@ unsigned char networktype_to_raid(unsigned char network_type)
case WIRELESS_11B: case WIRELESS_11B:
raid = RATR_INX_WIRELESS_B; raid = RATR_INX_WIRELESS_B;
break; break;
case WIRELESS_11A:
case WIRELESS_11G: case WIRELESS_11G:
raid = RATR_INX_WIRELESS_G; raid = RATR_INX_WIRELESS_G;
break; break;
...@@ -86,10 +85,8 @@ unsigned char networktype_to_raid(unsigned char network_type) ...@@ -86,10 +85,8 @@ unsigned char networktype_to_raid(unsigned char network_type)
raid = RATR_INX_WIRELESS_GB; raid = RATR_INX_WIRELESS_GB;
break; break;
case WIRELESS_11_24N: case WIRELESS_11_24N:
case WIRELESS_11_5N:
raid = RATR_INX_WIRELESS_N; raid = RATR_INX_WIRELESS_N;
break; break;
case WIRELESS_11A_5N:
case WIRELESS_11G_24N: case WIRELESS_11G_24N:
raid = RATR_INX_WIRELESS_NG; raid = RATR_INX_WIRELESS_NG;
break; break;
...@@ -110,10 +107,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen ...@@ -110,10 +107,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
if (pmlmeext->cur_channel > 14) { if (pmlmeext->cur_channel > 14) {
if (pmlmeinfo->HT_enable) network_type |= WIRELESS_INVALID;
network_type = WIRELESS_11_5N;
network_type |= WIRELESS_11A;
} else { } else {
if (pmlmeinfo->HT_enable) if (pmlmeinfo->HT_enable)
network_type = WIRELESS_11_24N; network_type = WIRELESS_11_24N;
...@@ -1490,8 +1484,6 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap) ...@@ -1490,8 +1484,6 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap)
if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME) if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME; pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
} }
} else if (pmlmeext->cur_wireless_mode & (WIRELESS_11A | WIRELESS_11_5N)) {
pmlmeinfo->slotTime = SHORT_SLOT_TIME;
} else { } else {
/* B Mode */ /* B Mode */
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME; pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
...@@ -1516,10 +1508,7 @@ void update_wireless_mode(struct adapter *padapter) ...@@ -1516,10 +1508,7 @@ void update_wireless_mode(struct adapter *padapter)
pmlmeinfo->HT_enable = 1; pmlmeinfo->HT_enable = 1;
if (pmlmeext->cur_channel > 14) { if (pmlmeext->cur_channel > 14) {
if (pmlmeinfo->HT_enable) network_type |= WIRELESS_INVALID;
network_type = WIRELESS_11_5N;
network_type |= WIRELESS_11A;
} else { } else {
if (pmlmeinfo->HT_enable) if (pmlmeinfo->HT_enable)
network_type = WIRELESS_11_24N; network_type = WIRELESS_11_24N;
......
...@@ -1136,7 +1136,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u ...@@ -1136,7 +1136,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
break; break;
default: default:
/* case WIRELESS_11_24N: */ /* case WIRELESS_11_24N: */
/* case WIRELESS_11_5N: */
if (pDM_Odm->RFType == RF_1T2R) if (pDM_Odm->RFType == RF_1T2R)
rate_bitmap = 0x000fffff; rate_bitmap = 0x000fffff;
else else
......
...@@ -145,53 +145,34 @@ enum NETWORK_TYPE { ...@@ -145,53 +145,34 @@ enum NETWORK_TYPE {
/* Sub-Element */ /* Sub-Element */
WIRELESS_11B = BIT(0), /* tx:cck only, rx:cck only, hw: cck */ WIRELESS_11B = BIT(0), /* tx:cck only, rx:cck only, hw: cck */
WIRELESS_11G = BIT(1), /* tx:ofdm only, rx:ofdm & cck, hw:cck & ofdm*/ WIRELESS_11G = BIT(1), /* tx:ofdm only, rx:ofdm & cck, hw:cck & ofdm*/
WIRELESS_11A = BIT(2), /* tx:ofdm only, rx: ofdm only, hw:ofdm only */
WIRELESS_11_24N = BIT(3), /* tx:MCS only, rx:MCS & cck, hw:MCS & cck */ WIRELESS_11_24N = BIT(3), /* tx:MCS only, rx:MCS & cck, hw:MCS & cck */
WIRELESS_11_5N = BIT(4), /* tx:MCS only, rx:MCS & ofdm, hw:ofdm only */
WIRELESS_AC = BIT(6),
/* Combination */ /* Combination */
/* tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm */ /* tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm */
WIRELESS_11BG = (WIRELESS_11B | WIRELESS_11G), WIRELESS_11BG = (WIRELESS_11B | WIRELESS_11G),
/* tx: ofdm & MCS, rx: ofdm & cck & MCS, hw: cck & ofdm */ /* tx: ofdm & MCS, rx: ofdm & cck & MCS, hw: cck & ofdm */
WIRELESS_11G_24N = (WIRELESS_11G | WIRELESS_11_24N), WIRELESS_11G_24N = (WIRELESS_11G | WIRELESS_11_24N),
/* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
WIRELESS_11A_5N = (WIRELESS_11A | WIRELESS_11_5N),
/* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */ /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
WIRELESS_11BG_24N = (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N), WIRELESS_11BG_24N = (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N),
/* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
WIRELESS_11AGN = (WIRELESS_11A | WIRELESS_11G | WIRELESS_11_24N |
WIRELESS_11_5N),
WIRELESS_11ABGN = (WIRELESS_11A | WIRELESS_11B | WIRELESS_11G |
WIRELESS_11_24N | WIRELESS_11_5N),
}; };
#define SUPPORTED_24G_NETTYPE_MSK \ #define SUPPORTED_24G_NETTYPE_MSK \
(WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N) (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N)
#define SUPPORTED_5G_NETTYPE_MSK \
(WIRELESS_11A | WIRELESS_11_5N)
#define IsSupported24G(NetType) \ #define IsSupported24G(NetType) \
((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false) ((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false)
#define IsSupported5G(NetType) \
((NetType) & SUPPORTED_5G_NETTYPE_MSK ? true : false)
#define IsEnableHWCCK(NetType) \ #define IsEnableHWCCK(NetType) \
IsSupported24G(NetType) IsSupported24G(NetType)
#define IsEnableHWOFDM(NetType) \
((NetType) & (WIRELESS_11G | WIRELESS_11_24N | \
SUPPORTED_5G_NETTYPE_MSK) ? true : false)
#define IsSupportedRxCCK(NetType) IsEnableHWCCK(NetType) #define IsSupportedRxCCK(NetType) IsEnableHWCCK(NetType)
#define IsSupportedRxOFDM(NetType) IsEnableHWOFDM(NetType)
#define IsSupportedRxMCS(NetType) IsEnableHWOFDM(NetType)
#define IsSupportedTxCCK(NetType) \ #define IsSupportedTxCCK(NetType) \
((NetType) & (WIRELESS_11B) ? true : false) ((NetType) & (WIRELESS_11B) ? true : false)
#define IsSupportedTxOFDM(NetType) \ #define IsSupportedTxOFDM(NetType) \
((NetType) & (WIRELESS_11G|WIRELESS_11A) ? true : false) ((NetType) & (WIRELESS_11G) ? true : false)
#define IsSupportedTxMCS(NetType) \ #define IsSupportedTxMCS(NetType) \
((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N) ? true : false) ((NetType) & (WIRELESS_11_24N) ? true : false)
struct ieee_param { struct ieee_param {
u32 cmd; u32 cmd;
......
...@@ -464,7 +464,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe) ...@@ -464,7 +464,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
#define _PRE_ALLOCMICHDR_ 6 #define _PRE_ALLOCMICHDR_ 6
#define _SIFSTIME_ \ #define _SIFSTIME_ \
((priv->pmib->dot11BssType.net_work_type & WIRELESS_11A) ? 16 : 10) (priv->pmib->dot11BssType.net_work_type = 10)
#define _ACKCTSLNG_ 14 /* 14 bytes long, including crclng */ #define _ACKCTSLNG_ 14 /* 14 bytes long, including crclng */
#define _CRCLNG_ 4 #define _CRCLNG_ 4
......
...@@ -254,7 +254,7 @@ static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss) ...@@ -254,7 +254,7 @@ static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
struct wlan_network { struct wlan_network {
struct list_head list; struct list_head list;
int network_type; /* refer to ieee80211.h for WIRELESS_11A/B/G */ int network_type; /* refer to ieee80211.h for WIRELESS_11B/G */
int fixed; /* set fixed when not to be removed int fixed; /* set fixed when not to be removed
* in site-surveying */ * in site-surveying */
unsigned long last_scanned; /* timestamp for the network */ unsigned long last_scanned; /* timestamp for the network */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment