Commit 708180a9 authored by Fabio Aiuto's avatar Fabio Aiuto Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: remove all 5Ghz network types



remove all 5Ghz network types. rtl8723bs works on
802.11bgn standards and on 2.4Ghz band.

So remove all code related to 802.11a and 802.11ac
standards, which the device doesn't support.

Acked-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarFabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/7e4644a71d0ba2819370171b3dc78bfc755f6313.1624367071.git.fabioaiuto83@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b1aca59
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -342,11 +342,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
	shortGIrate = query_ra_short_GI(psta);

	if (pcur_network->Configuration.DSConfig > 14) {
		if (tx_ra_bitmap & 0xffff000)
			sta_band |= WIRELESS_11_5N;

		if (tx_ra_bitmap & 0xff0)
			sta_band |= WIRELESS_11A;
		sta_band |= WIRELESS_INVALID;
	} else {
		if (tx_ra_bitmap & 0xffff000)
			sta_band |= WIRELESS_11_24N;
@@ -412,7 +408,7 @@ void update_bmc_sta(struct adapter *padapter)
		} else if (network_type == WIRELESS_INVALID) { /*  error handling */

			if (pcur_network->Configuration.DSConfig > 14)
				network_type = WIRELESS_11A;
				network_type = WIRELESS_INVALID;
			else
				network_type = WIRELESS_11B;
		}
@@ -1115,9 +1111,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
	case WIRELESS_11BG_24N:
		pbss_network->NetworkTypeInUse = Ndis802_11OFDM24;
		break;
	case WIRELESS_11A:
		pbss_network->NetworkTypeInUse = Ndis802_11OFDM5;
		break;
	default:
		pbss_network->NetworkTypeInUse = Ndis802_11OFDM24;
		break;
+4 −18
Original line number Diff line number Diff line
@@ -96,10 +96,7 @@ bool rtw_is_cckratesonly_included(u8 *rate)
int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
{
	if (channel > 14) {
		if (rtw_is_cckrates_included(rate))
		return WIRELESS_INVALID;
		else
			return WIRELESS_11A;
	} else { /*  could be pure B, pure G, or B/G */
		if (rtw_is_cckratesonly_included(rate))
			return WIRELESS_11B;
@@ -266,10 +263,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
		break;

	case WIRELESS_11G:
	case WIRELESS_11A:
	case WIRELESS_11_5N:
	case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
	case WIRELESS_11_5AC:
		memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
		break;

@@ -327,14 +320,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
	ie = rtw_set_ie(ie, WLAN_EID_SSID, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);

	/* supported rates */
	if (pregistrypriv->wireless_mode == WIRELESS_11ABGN) {
		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);

@@ -359,8 +345,8 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
	}

	/* HT Cap. */
	if (((pregistrypriv->wireless_mode&WIRELESS_11_5N) || (pregistrypriv->wireless_mode&WIRELESS_11_24N))
		&& (pregistrypriv->ht_enable == true)) {
	if ((pregistrypriv->wireless_mode & WIRELESS_11_24N) &&
	    (pregistrypriv->ht_enable == true)) {
		/* todo: */
	}

+0 −10
Original line number Diff line number Diff line
@@ -2184,16 +2184,6 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
	case WIRELESS_11BG_24N:
		pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24);
		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:
		/*  TODO */
		break;
+0 −55
Original line number Diff line number Diff line
@@ -4478,61 +4478,6 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
			}
		}

		if (pregistrypriv->wireless_mode & WIRELESS_11A) {
			do {
				if ((i == MAX_CHANNEL_NUM) ||
					(chplan_sta[i].ChannelNum == 0))
					break;

				if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] == 0))
					break;

				if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) {
					chplan_new[k].ChannelNum = chplan_ap.Channel[j];
					chplan_new[k].ScanType = SCAN_ACTIVE;
					i++;
					j++;
					k++;
				} else if (chplan_sta[i].ChannelNum < chplan_ap.Channel[j]) {
					chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
/* 					chplan_new[k].ScanType = chplan_sta[i].ScanType; */
					chplan_new[k].ScanType = SCAN_PASSIVE;
					i++;
					k++;
				} else if (chplan_sta[i].ChannelNum > chplan_ap.Channel[j]) {
					chplan_new[k].ChannelNum = chplan_ap.Channel[j];
					chplan_new[k].ScanType = SCAN_ACTIVE;
					j++;
					k++;
				}
			} while (1);

			/*  change AP not support channel to Passive scan */
			while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) {
				chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
/* 				chplan_new[k].ScanType = chplan_sta[i].ScanType; */
				chplan_new[k].ScanType = SCAN_PASSIVE;
				i++;
				k++;
			}

			/*  add channel AP supported */
			while ((j < chplan_ap.Len) && (chplan_ap.Channel[j] != 0)) {
				chplan_new[k].ChannelNum = chplan_ap.Channel[j];
				chplan_new[k].ScanType = SCAN_ACTIVE;
				j++;
				k++;
			}
		} else {
			/*  keep original STA 5G channel plan */
			while ((i < MAX_CHANNEL_NUM) && (chplan_sta[i].ChannelNum != 0)) {
				chplan_new[k].ChannelNum = chplan_sta[i].ChannelNum;
				chplan_new[k].ScanType = chplan_sta[i].ScanType;
				i++;
				k++;
			}
		}

		pmlmeext->update_channel_plan_by_ap_done = 1;
	}

+3 −11
Original line number Diff line number Diff line
@@ -55,9 +55,6 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct sta_info *psta)

	if (cur_rf_type == RF_1T1R) {
		rf_type = RF_1T1R;
	} else if (IsSupportedVHT(psta->wireless_mode)) {
		if (psta->ra_mask & 0xffc00000)
			rf_type = RF_2T2R;
	} else if (IsSupportedHT(psta->wireless_mode)) {
		if (psta->ra_mask & 0xfff00000)
			rf_type = RF_2T2R;
@@ -67,7 +64,6 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct sta_info *psta)
	case WIRELESS_11B:
		raid = RATEID_IDX_B;
		break;
	case WIRELESS_11A:
	case WIRELESS_11G:
		raid = RATEID_IDX_G;
		break;
@@ -75,8 +71,6 @@ u8 networktype_to_raid_ex(struct adapter *adapter, struct sta_info *psta)
		raid = RATEID_IDX_BG;
		break;
	case WIRELESS_11_24N:
	case WIRELESS_11_5N:
	case WIRELESS_11A_5N:
	case WIRELESS_11G_24N:
		if (rf_type == RF_2T2R)
			raid = RATEID_IDX_GN_N2SS;
@@ -827,7 +821,7 @@ void WMMOnAssocRsp(struct adapter *padapter)

		AIFS = aSifsTime + (2 * pmlmeinfo->slotTime);

		if (pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11A)) {
		if (pmlmeext->cur_wireless_mode & WIRELESS_11G) {
			ECWMin = 4;
			ECWMax = 10;
		} else if (pmlmeext->cur_wireless_mode & WIRELESS_11B) {
@@ -1623,7 +1617,7 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap)
		pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
	} else {
		/* Filen: See 802.11-2007 p.90 */
		if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N | WIRELESS_11A | WIRELESS_11_5N | WIRELESS_11AC)) {
		if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N)) {
			pmlmeinfo->slotTime = SHORT_SLOT_TIME;
		} else if (pmlmeext->cur_wireless_mode & (WIRELESS_11G)) {
			if ((updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */)
@@ -1653,9 +1647,7 @@ void update_wireless_mode(struct adapter *padapter)
	if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable))
		pmlmeinfo->HT_enable = 1;

	if (pmlmeinfo->VHT_enable)
		network_type = WIRELESS_11AC;
	else if (pmlmeinfo->HT_enable)
	if (pmlmeinfo->HT_enable)
		network_type = WIRELESS_11_24N;

	if (rtw_is_cckratesonly_included(rate))
Loading