2021-06-22 12:33:28

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH v2 00/17] staging: rtl8723bs: remove 5Ghz code

This patch series removes all occurences of 5Ghz code over the
driver as required from driver's TODO list:

- find and remove remaining code valid only for 5 GHz.
most of the obvious one have been removed, but things
like channel > 14 still exist.

rtl8723bs work on 2.4Ghz band and supports 802.11bgn standards.
So all code related to 802.11a/ac standard is removed, as well
as code related to channel numbers above 14.

VHT code is deleted as well, for it's related to 802.11ac.

Comments are fixed accordingly and many unused variables are
deleted.

Every single patch of this series has been tested on a
Lenovo Ideapad MIIX 300-10IBY except for the last one,
for obvious reason (it deletes just the TODO item).

So:

Tested-by: Fabio Auto <[email protected]>
------------------------------------------------
Changes in v2:
- drop v1 15/18 patch, for it deliberately
does register writes as pointed by Hans.

Fabio Aiuto (17):
staging: rtl8723bs: remove all 5Ghz network types
staging: rtl8723bs: remove code related to unsupported channel
bandwidth
staging: rtl8723bs: remove unused enum items related to channel
bonding
staging: rtl8723bs: rename enum items related to channel bonding
staging: rtl8723bs: remove 5Ghz field in struct registry_priv
staging: rtl8723bs: remove struct rt_channel_plan_5g
staging: rtl8723bs: remove all branchings between 2.4Ghz and 5Ghz band
types
staging: rtl8723bs: beautify prototypes in include/hal_com_phycfg.h
staging: rtl8723bs: remove 5Ghz code related to channel plan
definition
staging: rtl8723bs: remove some unused 5Ghz macro definitions
staging: rtl8723bs: remove 5Ghz code related to RF power calibration
staging: rtl8723bs: remove VHT dead code
staging: rtl8723bs: remove unused ODM_CMNINFO_BOARD_TYPE enum item
staging: rtl8723bs: fix macro value for 2.4Ghz only device
staging: rtl8723bs: remove obsolete 5Ghz comments
staging: rtl8723bs: fix check allowing 5Ghz settings
staging: rtl8723bs: remove item from TODO list

drivers/staging/rtl8723bs/TODO | 2 -
drivers/staging/rtl8723bs/core/rtw_ap.c | 10 +-
.../staging/rtl8723bs/core/rtw_ieee80211.c | 22 +-
drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 -
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 328 ++---
.../staging/rtl8723bs/core/rtw_wlan_util.c | 29 +-
drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 +-
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 4 +-
.../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 5 +-
drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 1 -
.../staging/rtl8723bs/hal/HalHWImg8723B_BB.c | 17 +-
.../staging/rtl8723bs/hal/HalHWImg8723B_RF.c | 595 ++++-----
.../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 19 +-
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 4 -
drivers/staging/rtl8723bs/hal/hal_com.c | 241 ----
.../staging/rtl8723bs/hal/hal_com_phycfg.c | 1059 +++--------------
drivers/staging/rtl8723bs/hal/odm.c | 50 -
drivers/staging/rtl8723bs/hal/odm.h | 42 +-
drivers/staging/rtl8723bs/hal/odm_DIG.c | 2 -
.../rtl8723bs/hal/odm_EdcaTurboCheck.c | 4 +-
.../rtl8723bs/hal/odm_RegConfig8723B.c | 5 +-
.../rtl8723bs/hal/odm_RegConfig8723B.h | 2 -
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c | 1 -
.../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 41 +-
.../staging/rtl8723bs/hal/rtl8723b_phycfg.c | 43 +-
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 -
.../rtl8723bs/include/Hal8192CPhyReg.h | 2 -
drivers/staging/rtl8723bs/include/drv_types.h | 10 +-
drivers/staging/rtl8723bs/include/hal_com.h | 62 +-
.../rtl8723bs/include/hal_com_phycfg.h | 198 +--
.../staging/rtl8723bs/include/hal_com_reg.h | 1 -
drivers/staging/rtl8723bs/include/hal_data.h | 40 +-
drivers/staging/rtl8723bs/include/hal_pg.h | 2 -
drivers/staging/rtl8723bs/include/hal_phy.h | 10 -
drivers/staging/rtl8723bs/include/ieee80211.h | 67 +-
.../staging/rtl8723bs/include/rtl8723b_xmit.h | 21 -
drivers/staging/rtl8723bs/include/rtw_ht.h | 4 -
.../staging/rtl8723bs/include/rtw_mlme_ext.h | 52 +-
drivers/staging/rtl8723bs/include/rtw_rf.h | 33 +-
drivers/staging/rtl8723bs/include/wifi.h | 1 -
.../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 4 -
.../staging/rtl8723bs/os_dep/ioctl_linux.c | 8 +-
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 13 +-
drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 4 -
44 files changed, 640 insertions(+), 2438 deletions(-)

--
2.20.1


2021-06-22 12:33:29

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH v2 15/17] staging: rtl8723bs: remove obsolete 5Ghz comments

remove obsolete 5Ghz comments.

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 --
drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 4 ----
2 files changed, 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 8514cfb3d7e0..427f0b88abd7 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -202,8 +202,6 @@ rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {

static int rtw_ieee80211_channel_to_frequency(int chan, int band)
{
- /* see 802.11 17.3.8.3.2 and Annex J
- * there are overlapping channel numbers in 5GHz and 2GHz bands */
if (band == NL80211_BAND_2GHZ) {
if (chan == 14)
return 2484;
diff --git a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
index 0084589499b9..5eef1d68c6f0 100644
--- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
+++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
@@ -44,10 +44,6 @@ static const struct ieee80211_regdomain rtw_regdom_rd = {

static int rtw_ieee80211_channel_to_frequency(int chan, int band)
{
- /* see 802.11 17.3.8.3.2 and Annex J
- * there are overlapping channel numbers in 5GHz and 2GHz bands
- */
-
/* NL80211_BAND_2GHZ */
if (chan == 14)
return 2484;
--
2.20.1

2021-06-22 12:33:41

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH v2 01/17] 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.

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_ap.c | 10 +---
.../staging/rtl8723bs/core/rtw_ieee80211.c | 22 ++------
drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 ----
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 55 -------------------
.../staging/rtl8723bs/core/rtw_wlan_util.c | 14 +----
drivers/staging/rtl8723bs/hal/odm.c | 30 ----------
drivers/staging/rtl8723bs/hal/odm.h | 3 -
.../rtl8723bs/hal/odm_EdcaTurboCheck.c | 4 +-
drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 --
drivers/staging/rtl8723bs/include/hal_phy.h | 3 -
drivers/staging/rtl8723bs/include/ieee80211.h | 22 +-------
drivers/staging/rtl8723bs/include/wifi.h | 1 -
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
13 files changed, 14 insertions(+), 167 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 23bbdf084631..b0abadd4b4dd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -343,10 +343,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)

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 +409,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 +1112,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;
diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index e341789954b9..0f0fcd9dc652 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -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;
+ return WIRELESS_INVALID;
} 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;
- }
+ 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: */
}

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 158f92d4d882..2dd75e007239 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -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;
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 4df3cba97f42..106779fb9fef 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -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;
}

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index afabb9d48021..2a47d678de01 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -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))
diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c
index fa275138c983..bfe0c3a773af 100644
--- a/drivers/staging/rtl8723bs/hal/odm.c
+++ b/drivers/staging/rtl8723bs/hal/odm.c
@@ -377,7 +377,6 @@ u32 ODM_Get_Rate_Bitmap(
break;

case (ODM_WM_G):
- case (ODM_WM_A):
if (rssi_level == DM_RATR_STA_HIGH)
rate_bitmap = 0x00000f00;
else
@@ -396,7 +395,6 @@ u32 ODM_Get_Rate_Bitmap(
case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
case (ODM_WM_B|ODM_WM_N24G):
case (ODM_WM_G|ODM_WM_N24G):
- case (ODM_WM_A|ODM_WM_N5G):
if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) {
if (rssi_level == DM_RATR_STA_HIGH)
rate_bitmap = 0x000f0000;
@@ -422,34 +420,6 @@ u32 ODM_Get_Rate_Bitmap(
}
break;

- case (ODM_WM_AC|ODM_WM_G):
- if (rssi_level == 1)
- rate_bitmap = 0xfc3f0000;
- else if (rssi_level == 2)
- rate_bitmap = 0xfffff000;
- else
- rate_bitmap = 0xffffffff;
- break;
-
- case (ODM_WM_AC|ODM_WM_A):
-
- if (pDM_Odm->RFType == RF_1T1R) {
- if (rssi_level == 1) /* add by Gary for ac-series */
- rate_bitmap = 0x003f8000;
- else if (rssi_level == 2)
- rate_bitmap = 0x003ff000;
- else
- rate_bitmap = 0x003ff010;
- } else {
- if (rssi_level == 1) /* add by Gary for ac-series */
- rate_bitmap = 0xfe3f8000; /* VHT 2SS MCS3~9 */
- else if (rssi_level == 2)
- rate_bitmap = 0xfffff000; /* VHT 2SS MCS0~9 */
- else
- rate_bitmap = 0xfffff010; /* All */
- }
- break;
-
default:
if (pDM_Odm->RFType == RF_1T2R)
rate_bitmap = 0x000fffff;
diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index 950e7850bac2..7e2d3679c7d0 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -455,11 +455,8 @@ enum { /* tag_Wireless_Mode_Definition */
ODM_WM_UNKNOWN = 0x0,
ODM_WM_B = BIT0,
ODM_WM_G = BIT1,
- ODM_WM_A = BIT2,
ODM_WM_N24G = BIT3,
- ODM_WM_N5G = BIT4,
ODM_WM_AUTO = BIT5,
- ODM_WM_AC = BIT6,
};

/* ODM_CMNINFO_BAND */
diff --git a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
index f3856e47bfd3..578d5712645c 100644
--- a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
+++ b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
@@ -124,12 +124,10 @@ void odm_EdcaTurboCheckCE(void *pDM_VOID)
} else if ((iot_peer == HT_IOT_PEER_CISCO) &&
((wirelessmode == ODM_WM_G) ||
(wirelessmode == (ODM_WM_B | ODM_WM_G)) ||
- (wirelessmode == ODM_WM_A) ||
(wirelessmode == ODM_WM_B))) {
EDCA_BE_DL = edca_setting_DL_GMode[iot_peer];
} else if ((iot_peer == HT_IOT_PEER_AIRGO) &&
- ((wirelessmode == ODM_WM_G) ||
- (wirelessmode == ODM_WM_A))) {
+ (wirelessmode == ODM_WM_G)) {
EDCA_BE_DL = 0xa630;
} else if (iot_peer == HT_IOT_PEER_MARVELL) {
EDCA_BE_DL = edca_setting_DL[iot_peer];
diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
index 3738727feb60..a07a6dacec42 100644
--- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
+++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
@@ -512,8 +512,6 @@ static void _InitOperationMode(struct adapter *padapter)
case WIRELESS_MODE_B:
regBwOpMode = BW_OPMODE_20MHZ;
break;
- case WIRELESS_MODE_A:
- break;
case WIRELESS_MODE_G:
regBwOpMode = BW_OPMODE_20MHZ;
break;
@@ -525,9 +523,6 @@ static void _InitOperationMode(struct adapter *padapter)
/* CCK rate will be filtered out only when associated AP does not support it. */
regBwOpMode = BW_OPMODE_20MHZ;
break;
- case WIRELESS_MODE_N_5G:
- regBwOpMode = BW_OPMODE_5G;
- break;

default: /* for MacOSX compiler warning. */
break;
diff --git a/drivers/staging/rtl8723bs/include/hal_phy.h b/drivers/staging/rtl8723bs/include/hal_phy.h
index 19221289b8ce..6417d1b758d2 100644
--- a/drivers/staging/rtl8723bs/include/hal_phy.h
+++ b/drivers/staging/rtl8723bs/include/hal_phy.h
@@ -51,13 +51,10 @@ enum rf_path {

enum wireless_mode {
WIRELESS_MODE_UNKNOWN = 0x00,
- WIRELESS_MODE_A = 0x01,
WIRELESS_MODE_B = 0x02,
WIRELESS_MODE_G = 0x04,
WIRELESS_MODE_AUTO = 0x08,
WIRELESS_MODE_N_24G = 0x10,
- WIRELESS_MODE_N_5G = 0x20,
- WIRELESS_MODE_AC_5G = 0x40,
WIRELESS_MODE_AC_24G = 0x80,
WIRELESS_MODE_AC_ONLY = 0x100,
};
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 6540c7a22938..ac88bd30b097 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -144,33 +144,20 @@ enum network_type {
/* Sub-Element */
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_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_5N = BIT(4), /* tx: MCS only, rx: MCS & ofdm, hw: ofdm only */
WIRELESS_AUTO = BIT(5),
- WIRELESS_11AC = BIT(6),

/* Combination */
/* Type for current wireless mode */
WIRELESS_11BG = (WIRELESS_11B|WIRELESS_11G), /* tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm */
WIRELESS_11G_24N = (WIRELESS_11G|WIRELESS_11_24N), /* tx: ofdm & MCS, rx: ofdm & cck & MCS, hw: cck & ofdm */
- WIRELESS_11A_5N = (WIRELESS_11A|WIRELESS_11_5N), /* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
WIRELESS_11B_24N = (WIRELESS_11B|WIRELESS_11_24N), /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
WIRELESS_11BG_24N = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N), /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
- WIRELESS_11_24AC = (WIRELESS_11G|WIRELESS_11AC),
- WIRELESS_11_5AC = (WIRELESS_11A|WIRELESS_11AC),
-
-
- /* Type for registry default wireless mode */
- WIRELESS_11AGN = (WIRELESS_11A|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N), /* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
- WIRELESS_11ABGN = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N),
- WIRELESS_MODE_24G = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11AC),
- WIRELESS_MODE_MAX = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N|WIRELESS_11AC),
};

#define SUPPORTED_24G_NETTYPE_MSK (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N)

-#define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG|WIRELESS_11A)))
+#define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG)))

#define IsSupported24G(NetType) ((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false)

@@ -182,11 +169,8 @@ enum network_type {
#define IsSupportedRxHT(NetType) IsEnableHWOFDM(NetType)

#define IsSupportedTxCCK(NetType) (((NetType) & (WIRELESS_11B)) ? true : false)
-#define IsSupportedTxOFDM(NetType) (((NetType) & (WIRELESS_11G|WIRELESS_11A)) ? true : false)
-#define IsSupportedHT(NetType) (((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N)) ? true : false)
-
-#define IsSupportedVHT(NetType) (((NetType) & (WIRELESS_11AC)) ? true : false)
-
+#define IsSupportedTxOFDM(NetType) (((NetType) & (WIRELESS_11G) ? true : false)
+#define IsSupportedHT(NetType) (((NetType) & (WIRELESS_11_24N)) ? true : false)

struct ieee_param {
u32 cmd;
diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h
index 23de3ab87f9c..0bd7b662b972 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -336,7 +336,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
#define _PRE_ALLOCICVHDR_ 5
#define _PRE_ALLOCMICHDR_ 6

-#define _SIFSTIME_ ((priv->pmib->dot11BssType.net_work_type&WIRELESS_11A)?16:10)
#define _ACKCTSLNG_ 14 /* 14 bytes long, including crclng */
#define _CRCLNG_ 4

diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 11b9a5919da4..4e7c115c8bc1 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -22,7 +22,7 @@ static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
/* struct ndis_802_11_ssid ssid; */
static int rtw_channel = 1;/* ad-hoc support requirement */
-static int rtw_wireless_mode = WIRELESS_MODE_MAX;
+static int rtw_wireless_mode = WIRELESS_11BG_24N;
static int rtw_vrtl_carrier_sense = AUTO_VCS;
static int rtw_vcs_type = RTS_CTS;/* */
static int rtw_rts_thresh = 2347;/* */
--
2.20.1

2021-06-22 12:34:22

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH v2 09/17] staging: rtl8723bs: remove 5Ghz code related to channel plan definition

remove 5Ghz code related to channel plan definition.

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 214 ++++++++----------
.../staging/rtl8723bs/hal/hal_com_phycfg.c | 34 ---
drivers/staging/rtl8723bs/include/hal_data.h | 6 +-
.../staging/rtl8723bs/include/rtw_mlme_ext.h | 47 +---
.../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 -
.../staging/rtl8723bs/os_dep/ioctl_linux.c | 1 -
6 files changed, 97 insertions(+), 207 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index cf0079a0c179..285acd3d843b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -81,93 +81,93 @@ static struct rt_channel_plan_2g RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = {

static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
/* 0x00 ~ 0x1F , Old Define ===== */
- {0x02, 0x20}, /* 0x00, RT_CHANNEL_DOMAIN_FCC */
- {0x02, 0x0A}, /* 0x01, RT_CHANNEL_DOMAIN_IC */
- {0x01, 0x01}, /* 0x02, RT_CHANNEL_DOMAIN_ETSI */
- {0x01, 0x00}, /* 0x03, RT_CHANNEL_DOMAIN_SPAIN */
- {0x01, 0x00}, /* 0x04, RT_CHANNEL_DOMAIN_FRANCE */
- {0x03, 0x00}, /* 0x05, RT_CHANNEL_DOMAIN_MKK */
- {0x03, 0x00}, /* 0x06, RT_CHANNEL_DOMAIN_MKK1 */
- {0x01, 0x09}, /* 0x07, RT_CHANNEL_DOMAIN_ISRAEL */
- {0x03, 0x09}, /* 0x08, RT_CHANNEL_DOMAIN_TELEC */
- {0x03, 0x00}, /* 0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN */
- {0x00, 0x00}, /* 0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 */
- {0x02, 0x0F}, /* 0x0B, RT_CHANNEL_DOMAIN_TAIWAN */
- {0x01, 0x08}, /* 0x0C, RT_CHANNEL_DOMAIN_CHINA */
- {0x02, 0x06}, /* 0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO */
- {0x02, 0x0B}, /* 0x0E, RT_CHANNEL_DOMAIN_KOREA */
- {0x02, 0x09}, /* 0x0F, RT_CHANNEL_DOMAIN_TURKEY */
- {0x01, 0x01}, /* 0x10, RT_CHANNEL_DOMAIN_JAPAN */
- {0x02, 0x05}, /* 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS */
- {0x01, 0x21}, /* 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */
- {0x00, 0x04}, /* 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G */
- {0x02, 0x10}, /* 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS */
- {0x00, 0x21}, /* 0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS */
- {0x00, 0x22}, /* 0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS */
- {0x03, 0x21}, /* 0x17, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */
- {0x06, 0x08}, /* 0x18, RT_CHANNEL_DOMAIN_PAKISTAN_NO_DFS */
- {0x02, 0x08}, /* 0x19, RT_CHANNEL_DOMAIN_TAIWAN2_NO_DFS */
- {0x00, 0x00}, /* 0x1A, */
- {0x00, 0x00}, /* 0x1B, */
- {0x00, 0x00}, /* 0x1C, */
- {0x00, 0x00}, /* 0x1D, */
- {0x00, 0x00}, /* 0x1E, */
- {0x06, 0x04}, /* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */
+ {0x02}, /* 0x00, RT_CHANNEL_DOMAIN_FCC */
+ {0x02}, /* 0x01, RT_CHANNEL_DOMAIN_IC */
+ {0x01}, /* 0x02, RT_CHANNEL_DOMAIN_ETSI */
+ {0x01}, /* 0x03, RT_CHANNEL_DOMAIN_SPAIN */
+ {0x01}, /* 0x04, RT_CHANNEL_DOMAIN_FRANCE */
+ {0x03}, /* 0x05, RT_CHANNEL_DOMAIN_MKK */
+ {0x03}, /* 0x06, RT_CHANNEL_DOMAIN_MKK1 */
+ {0x01}, /* 0x07, RT_CHANNEL_DOMAIN_ISRAEL */
+ {0x03}, /* 0x08, RT_CHANNEL_DOMAIN_TELEC */
+ {0x03}, /* 0x09, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN */
+ {0x00}, /* 0x0A, RT_CHANNEL_DOMAIN_WORLD_WIDE_13 */
+ {0x02}, /* 0x0B, RT_CHANNEL_DOMAIN_TAIWAN */
+ {0x01}, /* 0x0C, RT_CHANNEL_DOMAIN_CHINA */
+ {0x02}, /* 0x0D, RT_CHANNEL_DOMAIN_SINGAPORE_INDIA_MEXICO */
+ {0x02}, /* 0x0E, RT_CHANNEL_DOMAIN_KOREA */
+ {0x02}, /* 0x0F, RT_CHANNEL_DOMAIN_TURKEY */
+ {0x01}, /* 0x10, RT_CHANNEL_DOMAIN_JAPAN */
+ {0x02}, /* 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS */
+ {0x01}, /* 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */
+ {0x00}, /* 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G */
+ {0x02}, /* 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS */
+ {0x00}, /* 0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS */
+ {0x00}, /* 0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS */
+ {0x03}, /* 0x17, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */
+ {0x06}, /* 0x18, RT_CHANNEL_DOMAIN_PAKISTAN_NO_DFS */
+ {0x02}, /* 0x19, RT_CHANNEL_DOMAIN_TAIWAN2_NO_DFS */
+ {0x00}, /* 0x1A, */
+ {0x00}, /* 0x1B, */
+ {0x00}, /* 0x1C, */
+ {0x00}, /* 0x1D, */
+ {0x00}, /* 0x1E, */
+ {0x06}, /* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */
/* 0x20 ~ 0x7F , New Define ===== */
- {0x00, 0x00}, /* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */
- {0x01, 0x00}, /* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */
- {0x02, 0x00}, /* 0x22, RT_CHANNEL_DOMAIN_FCC1_NULL */
- {0x03, 0x00}, /* 0x23, RT_CHANNEL_DOMAIN_MKK1_NULL */
- {0x04, 0x00}, /* 0x24, RT_CHANNEL_DOMAIN_ETSI2_NULL */
- {0x02, 0x04}, /* 0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 */
- {0x00, 0x01}, /* 0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 */
- {0x03, 0x0C}, /* 0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 */
- {0x00, 0x0B}, /* 0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 */
- {0x00, 0x05}, /* 0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 */
- {0x00, 0x00}, /* 0x2A, */
- {0x00, 0x00}, /* 0x2B, */
- {0x00, 0x00}, /* 0x2C, */
- {0x00, 0x00}, /* 0x2D, */
- {0x00, 0x00}, /* 0x2E, */
- {0x00, 0x00}, /* 0x2F, */
- {0x00, 0x06}, /* 0x30, RT_CHANNEL_DOMAIN_WORLD_FCC3 */
- {0x00, 0x07}, /* 0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 */
- {0x00, 0x08}, /* 0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 */
- {0x00, 0x09}, /* 0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 */
- {0x02, 0x0A}, /* 0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 */
- {0x00, 0x02}, /* 0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 */
- {0x00, 0x03}, /* 0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 */
- {0x03, 0x0D}, /* 0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 */
- {0x03, 0x0E}, /* 0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 */
- {0x02, 0x0F}, /* 0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 */
- {0x00, 0x00}, /* 0x3A, */
- {0x00, 0x00}, /* 0x3B, */
- {0x00, 0x00}, /* 0x3C, */
- {0x00, 0x00}, /* 0x3D, */
- {0x00, 0x00}, /* 0x3E, */
- {0x00, 0x00}, /* 0x3F, */
- {0x02, 0x10}, /* 0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 */
- {0x05, 0x00}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_NULL */
- {0x01, 0x12}, /* 0x42, RT_CHANNEL_DOMAIN_ETSI1_ETSI4 */
- {0x02, 0x05}, /* 0x43, RT_CHANNEL_DOMAIN_FCC1_FCC2 */
- {0x02, 0x11}, /* 0x44, RT_CHANNEL_DOMAIN_FCC1_NCC3 */
- {0x00, 0x13}, /* 0x45, RT_CHANNEL_DOMAIN_WORLD_ETSI5 */
- {0x02, 0x14}, /* 0x46, RT_CHANNEL_DOMAIN_FCC1_FCC8 */
- {0x00, 0x15}, /* 0x47, RT_CHANNEL_DOMAIN_WORLD_ETSI6 */
- {0x00, 0x16}, /* 0x48, RT_CHANNEL_DOMAIN_WORLD_ETSI7 */
- {0x00, 0x17}, /* 0x49, RT_CHANNEL_DOMAIN_WORLD_ETSI8 */
- {0x00, 0x18}, /* 0x50, RT_CHANNEL_DOMAIN_WORLD_ETSI9 */
- {0x00, 0x19}, /* 0x51, RT_CHANNEL_DOMAIN_WORLD_ETSI10 */
- {0x00, 0x1A}, /* 0x52, RT_CHANNEL_DOMAIN_WORLD_ETSI11 */
- {0x02, 0x1B}, /* 0x53, RT_CHANNEL_DOMAIN_FCC1_NCC4 */
- {0x00, 0x1C}, /* 0x54, RT_CHANNEL_DOMAIN_WORLD_ETSI12 */
- {0x02, 0x1D}, /* 0x55, RT_CHANNEL_DOMAIN_FCC1_FCC9 */
- {0x00, 0x1E}, /* 0x56, RT_CHANNEL_DOMAIN_WORLD_ETSI13 */
- {0x02, 0x1F}, /* 0x57, RT_CHANNEL_DOMAIN_FCC1_FCC10 */
+ {0x00}, /* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */
+ {0x01}, /* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */
+ {0x02}, /* 0x22, RT_CHANNEL_DOMAIN_FCC1_NULL */
+ {0x03}, /* 0x23, RT_CHANNEL_DOMAIN_MKK1_NULL */
+ {0x04}, /* 0x24, RT_CHANNEL_DOMAIN_ETSI2_NULL */
+ {0x02}, /* 0x25, RT_CHANNEL_DOMAIN_FCC1_FCC1 */
+ {0x00}, /* 0x26, RT_CHANNEL_DOMAIN_WORLD_ETSI1 */
+ {0x03}, /* 0x27, RT_CHANNEL_DOMAIN_MKK1_MKK1 */
+ {0x00}, /* 0x28, RT_CHANNEL_DOMAIN_WORLD_KCC1 */
+ {0x00}, /* 0x29, RT_CHANNEL_DOMAIN_WORLD_FCC2 */
+ {0x00}, /* 0x2A, */
+ {0x00}, /* 0x2B, */
+ {0x00}, /* 0x2C, */
+ {0x00}, /* 0x2D, */
+ {0x00}, /* 0x2E, */
+ {0x00}, /* 0x2F, */
+ {0x00}, /* 0x30, RT_CHANNEL_DOMAIN_WORLD_FCC3 */
+ {0x00}, /* 0x31, RT_CHANNEL_DOMAIN_WORLD_FCC4 */
+ {0x00}, /* 0x32, RT_CHANNEL_DOMAIN_WORLD_FCC5 */
+ {0x00}, /* 0x33, RT_CHANNEL_DOMAIN_WORLD_FCC6 */
+ {0x02}, /* 0x34, RT_CHANNEL_DOMAIN_FCC1_FCC7 */
+ {0x00}, /* 0x35, RT_CHANNEL_DOMAIN_WORLD_ETSI2 */
+ {0x00}, /* 0x36, RT_CHANNEL_DOMAIN_WORLD_ETSI3 */
+ {0x03}, /* 0x37, RT_CHANNEL_DOMAIN_MKK1_MKK2 */
+ {0x03}, /* 0x38, RT_CHANNEL_DOMAIN_MKK1_MKK3 */
+ {0x02}, /* 0x39, RT_CHANNEL_DOMAIN_FCC1_NCC1 */
+ {0x00}, /* 0x3A, */
+ {0x00}, /* 0x3B, */
+ {0x00}, /* 0x3C, */
+ {0x00}, /* 0x3D, */
+ {0x00}, /* 0x3E, */
+ {0x00}, /* 0x3F, */
+ {0x02}, /* 0x40, RT_CHANNEL_DOMAIN_FCC1_NCC2 */
+ {0x05}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_NULL */
+ {0x01}, /* 0x42, RT_CHANNEL_DOMAIN_ETSI1_ETSI4 */
+ {0x02}, /* 0x43, RT_CHANNEL_DOMAIN_FCC1_FCC2 */
+ {0x02}, /* 0x44, RT_CHANNEL_DOMAIN_FCC1_NCC3 */
+ {0x00}, /* 0x45, RT_CHANNEL_DOMAIN_WORLD_ETSI5 */
+ {0x02}, /* 0x46, RT_CHANNEL_DOMAIN_FCC1_FCC8 */
+ {0x00}, /* 0x47, RT_CHANNEL_DOMAIN_WORLD_ETSI6 */
+ {0x00}, /* 0x48, RT_CHANNEL_DOMAIN_WORLD_ETSI7 */
+ {0x00}, /* 0x49, RT_CHANNEL_DOMAIN_WORLD_ETSI8 */
+ {0x00}, /* 0x50, RT_CHANNEL_DOMAIN_WORLD_ETSI9 */
+ {0x00}, /* 0x51, RT_CHANNEL_DOMAIN_WORLD_ETSI10 */
+ {0x00}, /* 0x52, RT_CHANNEL_DOMAIN_WORLD_ETSI11 */
+ {0x02}, /* 0x53, RT_CHANNEL_DOMAIN_FCC1_NCC4 */
+ {0x00}, /* 0x54, RT_CHANNEL_DOMAIN_WORLD_ETSI12 */
+ {0x02}, /* 0x55, RT_CHANNEL_DOMAIN_FCC1_FCC9 */
+ {0x00}, /* 0x56, RT_CHANNEL_DOMAIN_WORLD_ETSI13 */
+ {0x02}, /* 0x57, RT_CHANNEL_DOMAIN_FCC1_FCC10 */
};

/* use the combination for max channel numbers */
-static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03, 0x02};
+static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03};

/* Search the @param ch in given @param ch_set
* @ch_set: the given channel set
@@ -189,23 +189,6 @@ int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch)
return i;
}

-/* Check the @param ch is fit with setband setting of @param adapter
- * @adapter: the given adapter
- * @ch: the given channel number
- *
- * return true when check valid, false not valid
- */
-bool rtw_mlme_band_check(struct adapter *adapter, const u32 ch)
-{
- if (adapter->setband == GHZ24_50 /* 2.4G and 5G */
- || (adapter->setband == GHZ_24 && ch < 35) /* 2.4G only */
- || (adapter->setband == GHZ_50 && ch > 35) /* 5G only */
- ) {
- return true;
- }
- return false;
-}
-
/****************************************************************************

Following are the initialization functions for WiFi MLME
@@ -380,7 +363,6 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c
else if ((channel_set[chanset_size].ChannelNum >= 12 && channel_set[chanset_size].ChannelNum <= 14))
channel_set[chanset_size].ScanType = SCAN_PASSIVE;
} else if (RT_CHANNEL_DOMAIN_WORLD_WIDE_13 == ChannelPlan ||
- RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == ChannelPlan ||
RT_CHANNEL_DOMAIN_2G_WORLD == Index2G) { /* channel 12~13, passive scan */
if (channel_set[chanset_size].ChannelNum <= 11)
channel_set[chanset_size].ScanType = SCAN_ACTIVE;
@@ -4434,10 +4416,6 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
while ((i < MAX_CHANNEL_NUM) && (chplan_new[i].ChannelNum != 0)) {
if (chplan_new[i].ChannelNum == channel) {
if (chplan_new[i].ScanType == SCAN_PASSIVE) {
- /* 5G Bnad 2, 3 (DFS) doesn't change to active scan */
- if (channel >= 52 && channel <= 144)
- break;
-
chplan_new[i].ScanType = SCAN_ACTIVE;
}
break;
@@ -5557,7 +5535,6 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, in[i].hw_value);
if (in[i].hw_value && !(in[i].flags & RTW_IEEE80211_CHAN_DISABLED)
&& set_idx >= 0
- && rtw_mlme_band_check(padapter, in[i].hw_value)
) {
if (j >= out_num) {
netdev_dbg(padapter->pnetdev,
@@ -5581,23 +5558,20 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
if (j == 0) {
for (i = 0; i < pmlmeext->max_chan_nums; i++) {

- if (rtw_mlme_band_check(padapter, pmlmeext->channel_set[i].ChannelNum)) {
-
- if (j >= out_num) {
- netdev_dbg(padapter->pnetdev,
- FUNC_ADPT_FMT " out_num:%u not enough\n",
- FUNC_ADPT_ARG(padapter),
- out_num);
- break;
- }
+ if (j >= out_num) {
+ netdev_dbg(padapter->pnetdev,
+ FUNC_ADPT_FMT " out_num:%u not enough\n",
+ FUNC_ADPT_ARG(padapter),
+ out_num);
+ break;
+ }

- out[j].hw_value = pmlmeext->channel_set[i].ChannelNum;
+ out[j].hw_value = pmlmeext->channel_set[i].ChannelNum;

- if (pmlmeext->channel_set[i].ScanType == SCAN_PASSIVE)
- out[j].flags |= RTW_IEEE80211_CHAN_PASSIVE_SCAN;
+ if (pmlmeext->channel_set[i].ScanType == SCAN_PASSIVE)
+ out[j].flags |= RTW_IEEE80211_CHAN_PASSIVE_SCAN;

- j++;
- }
+ j++;
}
}

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index 732659a2d844..395eb3b5af71 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1564,139 +1564,105 @@ void Hal_ChannelPlanToRegulation(struct adapter *Adapter, u16 ChannelPlan)
break;
case RT_CHANNEL_DOMAIN_FCC1_FCC1:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI1:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_MKK1_MKK1:
pHalData->Regulation2_4G = TXPWR_LMT_MKK;
- pHalData->Regulation5G = TXPWR_LMT_MKK;
break;
case RT_CHANNEL_DOMAIN_WORLD_KCC1:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_MKK;
break;
case RT_CHANNEL_DOMAIN_WORLD_FCC2:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_FCC3:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_FCC4:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_FCC5:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_FCC6:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_FCC1_FCC7:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI2:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI3:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_MKK1_MKK2:
pHalData->Regulation2_4G = TXPWR_LMT_MKK;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_MKK1_MKK3:
pHalData->Regulation2_4G = TXPWR_LMT_MKK;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_FCC1_NCC1:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_FCC1_NCC2:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_GLOBAL_NULL:
pHalData->Regulation2_4G = TXPWR_LMT_WW;
- pHalData->Regulation5G = TXPWR_LMT_WW;
break;
case RT_CHANNEL_DOMAIN_ETSI1_ETSI4:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_FCC1_FCC2:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_FCC1_NCC3:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI5:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_FCC1_FCC8:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI6:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI7:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI8:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI9:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI10:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI11:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_FCC1_NCC4:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI12:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_FCC1_FCC9:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_WORLD_ETSI13:
pHalData->Regulation2_4G = TXPWR_LMT_ETSI;
- pHalData->Regulation5G = TXPWR_LMT_ETSI;
break;
case RT_CHANNEL_DOMAIN_FCC1_FCC10:
pHalData->Regulation2_4G = TXPWR_LMT_FCC;
- pHalData->Regulation5G = TXPWR_LMT_FCC;
break;
case RT_CHANNEL_DOMAIN_REALTEK_DEFINE: /* Realtek Reserve */
pHalData->Regulation2_4G = TXPWR_LMT_WW;
- pHalData->Regulation5G = TXPWR_LMT_WW;
break;
default:
break;
diff --git a/drivers/staging/rtl8723bs/include/hal_data.h b/drivers/staging/rtl8723bs/include/hal_data.h
index 78246356927b..3298fa8eb682 100644
--- a/drivers/staging/rtl8723bs/include/hal_data.h
+++ b/drivers/staging/rtl8723bs/include/hal_data.h
@@ -46,17 +46,14 @@ enum rt_ampdu_burst {
RT_AMPDU_BURST_8723B = 7,
};

-#define CHANNEL_MAX_NUMBER (14 + 24 + 21) /* 14 is the max channel number */
+#define CHANNEL_MAX_NUMBER (14) /* 14 is the max channel number */
#define CHANNEL_MAX_NUMBER_2G 14
-#define CHANNEL_MAX_NUMBER_5G 54 /* Please refer to "phy_GetChnlGroup8812A" and "Hal_ReadTxPowerInfo8812A" */
-#define CHANNEL_MAX_NUMBER_5G_80M 7
#define MAX_PG_GROUP 13

/* Tx Power Limit Table Size */
#define MAX_REGULATION_NUM 4
#define MAX_2_4G_BANDWIDTH_NUM 4
#define MAX_RATE_SECTION_NUM 10
-#define MAX_5G_BANDWIDTH_NUM 4

#define MAX_BASE_NUM_IN_PHY_REG_PG_2_4G 10 /* CCK:1, OFDM:1, HT:4, VHT:4 */

@@ -234,7 +231,6 @@ struct hal_com_data {
s8 BW40_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];

u8 Regulation2_4G;
- u8 Regulation5G;

u8 TxPwrInPercentage;

diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index 7d655f02d383..89b389d4c44b 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -195,47 +195,6 @@ enum {
RT_CHANNEL_DOMAIN_2G_MAX,
};

-enum {
- RT_CHANNEL_DOMAIN_5G_NULL = 0x00,
- RT_CHANNEL_DOMAIN_5G_ETSI1 = 0x01, /* Europe */
- RT_CHANNEL_DOMAIN_5G_ETSI2 = 0x02, /* Australia, New Zealand */
- RT_CHANNEL_DOMAIN_5G_ETSI3 = 0x03, /* Russia */
- RT_CHANNEL_DOMAIN_5G_FCC1 = 0x04, /* US */
- RT_CHANNEL_DOMAIN_5G_FCC2 = 0x05, /* FCC o/w DFS Channels */
- RT_CHANNEL_DOMAIN_5G_FCC3 = 0x06, /* India, Mexico */
- RT_CHANNEL_DOMAIN_5G_FCC4 = 0x07, /* Venezuela */
- RT_CHANNEL_DOMAIN_5G_FCC5 = 0x08, /* China */
- RT_CHANNEL_DOMAIN_5G_FCC6 = 0x09, /* Israel */
- RT_CHANNEL_DOMAIN_5G_FCC7_IC1 = 0x0A, /* US, Canada */
- RT_CHANNEL_DOMAIN_5G_KCC1 = 0x0B, /* Korea */
- RT_CHANNEL_DOMAIN_5G_MKK1 = 0x0C, /* Japan */
- RT_CHANNEL_DOMAIN_5G_MKK2 = 0x0D, /* Japan (W52, W53) */
- RT_CHANNEL_DOMAIN_5G_MKK3 = 0x0E, /* Japan (W56) */
- RT_CHANNEL_DOMAIN_5G_NCC1 = 0x0F, /* Taiwan */
- RT_CHANNEL_DOMAIN_5G_NCC2 = 0x10, /* Taiwan o/w DFS */
- RT_CHANNEL_DOMAIN_5G_NCC3 = 0x11, /* Taiwan w/o DFS, Band4 only */
- RT_CHANNEL_DOMAIN_5G_ETSI4 = 0x12, /* Europe w/o DFS, Band1 only */
- RT_CHANNEL_DOMAIN_5G_ETSI5 = 0x13, /* Australia, New Zealand(w/o Weather radar) */
- RT_CHANNEL_DOMAIN_5G_FCC8 = 0x14, /* Latin America */
- RT_CHANNEL_DOMAIN_5G_ETSI6 = 0x15, /* Israel, Bahrain, Egypt, India, China, Malaysia */
- RT_CHANNEL_DOMAIN_5G_ETSI7 = 0x16, /* China */
- RT_CHANNEL_DOMAIN_5G_ETSI8 = 0x17, /* Jordan */
- RT_CHANNEL_DOMAIN_5G_ETSI9 = 0x18, /* Lebanon */
- RT_CHANNEL_DOMAIN_5G_ETSI10 = 0x19, /* Qatar */
- RT_CHANNEL_DOMAIN_5G_ETSI11 = 0x1A, /* Russia */
- RT_CHANNEL_DOMAIN_5G_NCC4 = 0x1B, /* Taiwan, (w/o Weather radar) */
- RT_CHANNEL_DOMAIN_5G_ETSI12 = 0x1C, /* Indonesia */
- RT_CHANNEL_DOMAIN_5G_FCC9 = 0x1D, /* w/o Weather radar) */
- RT_CHANNEL_DOMAIN_5G_ETSI13 = 0x1E, /* w/o Weather radar) */
- RT_CHANNEL_DOMAIN_5G_FCC10 = 0x1F, /* Argentina (w/o Weather radar) */
- /* Add new channel plan above this line =============== */
- /* Driver Self Defined ===== */
- RT_CHANNEL_DOMAIN_5G_FCC = 0x20,
- RT_CHANNEL_DOMAIN_5G_JAPAN_NO_DFS = 0x21,
- RT_CHANNEL_DOMAIN_5G_FCC4_NO_DFS = 0x22,
- RT_CHANNEL_DOMAIN_5G_MAX,
-};
-
#define rtw_is_channel_plan_valid(chplan) (chplan < RT_CHANNEL_DOMAIN_MAX || chplan == RT_CHANNEL_DOMAIN_REALTEK_DEFINE)

struct rt_channel_plan {
@@ -250,7 +209,6 @@ struct rt_channel_plan_2g {

struct rt_channel_plan_map {
unsigned char Index2G;
- unsigned char Index5G;
};

enum {
@@ -343,13 +301,13 @@ struct FW_Sta_Info {
* When the driver scanned RTW_SCAN_NUM_OF_CH channels, it would switch back to AP's operating channel for
* RTW_STAY_AP_CH_MILLISECOND * SURVEY_TO milliseconds.
* Example:
- * For chip supports 2.4G + 5GHz and AP mode is operating in channel 1,
+ * For chip supports 2.4G and AP mode is operating in channel 1,
* RTW_SCAN_NUM_OF_CH is 8, RTW_STAY_AP_CH_MILLISECOND is 3 and SURVEY_TO is 100.
* When it's STA mode gets set_scan command,
* it would
* 1. Doing the scan on channel 1.2.3.4.5.6.7.8
* 2. Back to channel 1 for 300 milliseconds
- * 3. Go through doing site survey on channel 9.10.11.36.40.44.48.52
+ * 3. Go through doing site survey on channel 9.10.11
* 4. Back to channel 1 for 300 milliseconds
* 5. ... and so on, till survey done.
*/
@@ -406,7 +364,6 @@ struct rt_channel_info {
};

int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch);
-bool rtw_mlme_band_check(struct adapter *adapter, const u32 ch);

/* P2P_MAX_REG_CLASSES - Maximum number of regulatory classes */
#define P2P_MAX_REG_CLASSES 10
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index cc5bb534fee6..8514cfb3d7e0 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -77,7 +77,6 @@ static struct ieee80211_rate rtw_rates[] = {
#define RTW_G_RATES_NUM 12

#define RTW_2G_CHANNELS_NUM 14
-#define RTW_5G_CHANNELS_NUM 37

static struct ieee80211_channel rtw_2ghz_channels[] = {
CHAN2G(1, 2412, 0),
@@ -1270,7 +1269,6 @@ void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter)

/* report network only if the current channel set contains the channel to which this network belongs */
if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0
- && rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig) == true
&& true == rtw_validate_ssid(&(pnetwork->network.Ssid))
)
{
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 5032701171f6..afefc2c8a2ac 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -1303,7 +1303,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,

/* report network only if the current channel set contains the channel to which this network belongs */
if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0
- && rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig) == true
&& true == rtw_validate_ssid(&(pnetwork->network.Ssid))) {

ev = translate_scan(padapter, a, pnetwork, ev, stop);
--
2.20.1

2021-06-22 12:45:18

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH v2 01/17] staging: rtl8723bs: remove all 5Ghz network types

Hi,

On 6/22/21 2:29 PM, Fabio Aiuto wrote:
> 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.
>
> Signed-off-by: Fabio Aiuto <[email protected]>
> ---
> drivers/staging/rtl8723bs/core/rtw_ap.c | 10 +---
> .../staging/rtl8723bs/core/rtw_ieee80211.c | 22 ++------
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 ----
> drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 55 -------------------
> .../staging/rtl8723bs/core/rtw_wlan_util.c | 14 +----
> drivers/staging/rtl8723bs/hal/odm.c | 30 ----------
> drivers/staging/rtl8723bs/hal/odm.h | 3 -
> .../rtl8723bs/hal/odm_EdcaTurboCheck.c | 4 +-
> drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 --
> drivers/staging/rtl8723bs/include/hal_phy.h | 3 -
> drivers/staging/rtl8723bs/include/ieee80211.h | 22 +-------
> drivers/staging/rtl8723bs/include/wifi.h | 1 -
> drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
> 13 files changed, 14 insertions(+), 167 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index 23bbdf084631..b0abadd4b4dd 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -343,10 +343,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
>
> 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;

sta_band will now not be touched if tx_ra_bitmap is say 0x20, where as
before it would be ore-d with WIRELESS_11A. Please make the or-ing with
WIRELESS_INVALID unconditional (removing both "if (tx_ra_bitmap & 0x...)"
checks). Also make sure to reduce the indentation level of the
sta_band |= WIRELESS_INVALID; by 1 tab when dropping the if.

Regards,

Hans



> } else {
> if (tx_ra_bitmap & 0xffff000)
> sta_band |= WIRELESS_11_24N;
> @@ -412,7 +409,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 +1112,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;
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> index e341789954b9..0f0fcd9dc652 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> @@ -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;
> + return WIRELESS_INVALID;
> } 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;
> - }
> + 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: */
> }
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 158f92d4d882..2dd75e007239 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -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;
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> index 4df3cba97f42..106779fb9fef 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> @@ -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;
> }
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> index afabb9d48021..2a47d678de01 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> @@ -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))
> diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c
> index fa275138c983..bfe0c3a773af 100644
> --- a/drivers/staging/rtl8723bs/hal/odm.c
> +++ b/drivers/staging/rtl8723bs/hal/odm.c
> @@ -377,7 +377,6 @@ u32 ODM_Get_Rate_Bitmap(
> break;
>
> case (ODM_WM_G):
> - case (ODM_WM_A):
> if (rssi_level == DM_RATR_STA_HIGH)
> rate_bitmap = 0x00000f00;
> else
> @@ -396,7 +395,6 @@ u32 ODM_Get_Rate_Bitmap(
> case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
> case (ODM_WM_B|ODM_WM_N24G):
> case (ODM_WM_G|ODM_WM_N24G):
> - case (ODM_WM_A|ODM_WM_N5G):
> if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) {
> if (rssi_level == DM_RATR_STA_HIGH)
> rate_bitmap = 0x000f0000;
> @@ -422,34 +420,6 @@ u32 ODM_Get_Rate_Bitmap(
> }
> break;
>
> - case (ODM_WM_AC|ODM_WM_G):
> - if (rssi_level == 1)
> - rate_bitmap = 0xfc3f0000;
> - else if (rssi_level == 2)
> - rate_bitmap = 0xfffff000;
> - else
> - rate_bitmap = 0xffffffff;
> - break;
> -
> - case (ODM_WM_AC|ODM_WM_A):
> -
> - if (pDM_Odm->RFType == RF_1T1R) {
> - if (rssi_level == 1) /* add by Gary for ac-series */
> - rate_bitmap = 0x003f8000;
> - else if (rssi_level == 2)
> - rate_bitmap = 0x003ff000;
> - else
> - rate_bitmap = 0x003ff010;
> - } else {
> - if (rssi_level == 1) /* add by Gary for ac-series */
> - rate_bitmap = 0xfe3f8000; /* VHT 2SS MCS3~9 */
> - else if (rssi_level == 2)
> - rate_bitmap = 0xfffff000; /* VHT 2SS MCS0~9 */
> - else
> - rate_bitmap = 0xfffff010; /* All */
> - }
> - break;
> -
> default:
> if (pDM_Odm->RFType == RF_1T2R)
> rate_bitmap = 0x000fffff;
> diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
> index 950e7850bac2..7e2d3679c7d0 100644
> --- a/drivers/staging/rtl8723bs/hal/odm.h
> +++ b/drivers/staging/rtl8723bs/hal/odm.h
> @@ -455,11 +455,8 @@ enum { /* tag_Wireless_Mode_Definition */
> ODM_WM_UNKNOWN = 0x0,
> ODM_WM_B = BIT0,
> ODM_WM_G = BIT1,
> - ODM_WM_A = BIT2,
> ODM_WM_N24G = BIT3,
> - ODM_WM_N5G = BIT4,
> ODM_WM_AUTO = BIT5,
> - ODM_WM_AC = BIT6,
> };
>
> /* ODM_CMNINFO_BAND */
> diff --git a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
> index f3856e47bfd3..578d5712645c 100644
> --- a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
> +++ b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
> @@ -124,12 +124,10 @@ void odm_EdcaTurboCheckCE(void *pDM_VOID)
> } else if ((iot_peer == HT_IOT_PEER_CISCO) &&
> ((wirelessmode == ODM_WM_G) ||
> (wirelessmode == (ODM_WM_B | ODM_WM_G)) ||
> - (wirelessmode == ODM_WM_A) ||
> (wirelessmode == ODM_WM_B))) {
> EDCA_BE_DL = edca_setting_DL_GMode[iot_peer];
> } else if ((iot_peer == HT_IOT_PEER_AIRGO) &&
> - ((wirelessmode == ODM_WM_G) ||
> - (wirelessmode == ODM_WM_A))) {
> + (wirelessmode == ODM_WM_G)) {
> EDCA_BE_DL = 0xa630;
> } else if (iot_peer == HT_IOT_PEER_MARVELL) {
> EDCA_BE_DL = edca_setting_DL[iot_peer];
> diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> index 3738727feb60..a07a6dacec42 100644
> --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> @@ -512,8 +512,6 @@ static void _InitOperationMode(struct adapter *padapter)
> case WIRELESS_MODE_B:
> regBwOpMode = BW_OPMODE_20MHZ;
> break;
> - case WIRELESS_MODE_A:
> - break;
> case WIRELESS_MODE_G:
> regBwOpMode = BW_OPMODE_20MHZ;
> break;
> @@ -525,9 +523,6 @@ static void _InitOperationMode(struct adapter *padapter)
> /* CCK rate will be filtered out only when associated AP does not support it. */
> regBwOpMode = BW_OPMODE_20MHZ;
> break;
> - case WIRELESS_MODE_N_5G:
> - regBwOpMode = BW_OPMODE_5G;
> - break;
>
> default: /* for MacOSX compiler warning. */
> break;
> diff --git a/drivers/staging/rtl8723bs/include/hal_phy.h b/drivers/staging/rtl8723bs/include/hal_phy.h
> index 19221289b8ce..6417d1b758d2 100644
> --- a/drivers/staging/rtl8723bs/include/hal_phy.h
> +++ b/drivers/staging/rtl8723bs/include/hal_phy.h
> @@ -51,13 +51,10 @@ enum rf_path {
>
> enum wireless_mode {
> WIRELESS_MODE_UNKNOWN = 0x00,
> - WIRELESS_MODE_A = 0x01,
> WIRELESS_MODE_B = 0x02,
> WIRELESS_MODE_G = 0x04,
> WIRELESS_MODE_AUTO = 0x08,
> WIRELESS_MODE_N_24G = 0x10,
> - WIRELESS_MODE_N_5G = 0x20,
> - WIRELESS_MODE_AC_5G = 0x40,
> WIRELESS_MODE_AC_24G = 0x80,
> WIRELESS_MODE_AC_ONLY = 0x100,
> };
> diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
> index 6540c7a22938..ac88bd30b097 100644
> --- a/drivers/staging/rtl8723bs/include/ieee80211.h
> +++ b/drivers/staging/rtl8723bs/include/ieee80211.h
> @@ -144,33 +144,20 @@ enum network_type {
> /* Sub-Element */
> 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_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_5N = BIT(4), /* tx: MCS only, rx: MCS & ofdm, hw: ofdm only */
> WIRELESS_AUTO = BIT(5),
> - WIRELESS_11AC = BIT(6),
>
> /* Combination */
> /* Type for current wireless mode */
> WIRELESS_11BG = (WIRELESS_11B|WIRELESS_11G), /* tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm */
> WIRELESS_11G_24N = (WIRELESS_11G|WIRELESS_11_24N), /* tx: ofdm & MCS, rx: ofdm & cck & MCS, hw: cck & ofdm */
> - WIRELESS_11A_5N = (WIRELESS_11A|WIRELESS_11_5N), /* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
> WIRELESS_11B_24N = (WIRELESS_11B|WIRELESS_11_24N), /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
> WIRELESS_11BG_24N = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N), /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
> - WIRELESS_11_24AC = (WIRELESS_11G|WIRELESS_11AC),
> - WIRELESS_11_5AC = (WIRELESS_11A|WIRELESS_11AC),
> -
> -
> - /* Type for registry default wireless mode */
> - WIRELESS_11AGN = (WIRELESS_11A|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N), /* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
> - WIRELESS_11ABGN = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N),
> - WIRELESS_MODE_24G = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11AC),
> - WIRELESS_MODE_MAX = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N|WIRELESS_11AC),
> };
>
> #define SUPPORTED_24G_NETTYPE_MSK (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N)
>
> -#define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG|WIRELESS_11A)))
> +#define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG)))
>
> #define IsSupported24G(NetType) ((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false)
>
> @@ -182,11 +169,8 @@ enum network_type {
> #define IsSupportedRxHT(NetType) IsEnableHWOFDM(NetType)
>
> #define IsSupportedTxCCK(NetType) (((NetType) & (WIRELESS_11B)) ? true : false)
> -#define IsSupportedTxOFDM(NetType) (((NetType) & (WIRELESS_11G|WIRELESS_11A)) ? true : false)
> -#define IsSupportedHT(NetType) (((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N)) ? true : false)
> -
> -#define IsSupportedVHT(NetType) (((NetType) & (WIRELESS_11AC)) ? true : false)
> -
> +#define IsSupportedTxOFDM(NetType) (((NetType) & (WIRELESS_11G) ? true : false)
> +#define IsSupportedHT(NetType) (((NetType) & (WIRELESS_11_24N)) ? true : false)
>
> struct ieee_param {
> u32 cmd;
> diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h
> index 23de3ab87f9c..0bd7b662b972 100644
> --- a/drivers/staging/rtl8723bs/include/wifi.h
> +++ b/drivers/staging/rtl8723bs/include/wifi.h
> @@ -336,7 +336,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
> #define _PRE_ALLOCICVHDR_ 5
> #define _PRE_ALLOCMICHDR_ 6
>
> -#define _SIFSTIME_ ((priv->pmib->dot11BssType.net_work_type&WIRELESS_11A)?16:10)
> #define _ACKCTSLNG_ 14 /* 14 bytes long, including crclng */
> #define _CRCLNG_ 4
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> index 11b9a5919da4..4e7c115c8bc1 100644
> --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> @@ -22,7 +22,7 @@ static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
> static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
> /* struct ndis_802_11_ssid ssid; */
> static int rtw_channel = 1;/* ad-hoc support requirement */
> -static int rtw_wireless_mode = WIRELESS_MODE_MAX;
> +static int rtw_wireless_mode = WIRELESS_11BG_24N;
> static int rtw_vrtl_carrier_sense = AUTO_VCS;
> static int rtw_vcs_type = RTS_CTS;/* */
> static int rtw_rts_thresh = 2347;/* */
>

2021-06-22 12:46:14

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH v2 01/17] staging: rtl8723bs: remove all 5Ghz network types

Hi,

On 6/22/21 2:41 PM, Hans de Goede wrote:
> Hi,
>
> On 6/22/21 2:29 PM, Fabio Aiuto wrote:
>> 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.
>>
>> Signed-off-by: Fabio Aiuto <[email protected]>
>> ---
>> drivers/staging/rtl8723bs/core/rtw_ap.c | 10 +---
>> .../staging/rtl8723bs/core/rtw_ieee80211.c | 22 ++------
>> drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 ----
>> drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 55 -------------------
>> .../staging/rtl8723bs/core/rtw_wlan_util.c | 14 +----
>> drivers/staging/rtl8723bs/hal/odm.c | 30 ----------
>> drivers/staging/rtl8723bs/hal/odm.h | 3 -
>> .../rtl8723bs/hal/odm_EdcaTurboCheck.c | 4 +-
>> drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 --
>> drivers/staging/rtl8723bs/include/hal_phy.h | 3 -
>> drivers/staging/rtl8723bs/include/ieee80211.h | 22 +-------
>> drivers/staging/rtl8723bs/include/wifi.h | 1 -
>> drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 +-
>> 13 files changed, 14 insertions(+), 167 deletions(-)
>>
>> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
>> index 23bbdf084631..b0abadd4b4dd 100644
>> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
>> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
>> @@ -343,10 +343,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
>>
>> 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;
>
> sta_band will now not be touched if tx_ra_bitmap is say 0x20, where as
> before it would be ore-d with WIRELESS_11A. Please make the or-ing with
> WIRELESS_INVALID unconditional (removing both "if (tx_ra_bitmap & 0x...)"
> checks). Also make sure to reduce the indentation level of the
> sta_band |= WIRELESS_INVALID; by 1 tab when dropping the if.

p.s.

The rest of the set looks ok to me.

Regards,

Hans

2021-06-22 13:03:44

by Fabio Aiuto

[permalink] [raw]
Subject: Re: [PATCH v2 01/17] staging: rtl8723bs: remove all 5Ghz network types

Hi Hans,

On Tue, Jun 22, 2021 at 02:41:02PM +0200, Hans de Goede wrote:
> Hi,
>
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > index 23bbdf084631..b0abadd4b4dd 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> > @@ -343,10 +343,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
> >
> > 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;
>
> sta_band will now not be touched if tx_ra_bitmap is say 0x20, where as
> before it would be ore-d with WIRELESS_11A. Please make the or-ing with
> WIRELESS_INVALID unconditional (removing both "if (tx_ra_bitmap & 0x...)"
> checks). Also make sure to reduce the indentation level of the
> sta_band |= WIRELESS_INVALID; by 1 tab when dropping the if.
>
> Regards,
>
> Hans

oops, you're right, will fix soon...

thank you,

fabio

>
>
>
> > } else {
> > if (tx_ra_bitmap & 0xffff000)
> > sta_band |= WIRELESS_11_24N;
> > @@ -412,7 +409,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 +1112,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;
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> > index e341789954b9..0f0fcd9dc652 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> > @@ -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;
> > + return WIRELESS_INVALID;
> > } 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;
> > - }
> > + 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: */
> > }
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > index 158f92d4d882..2dd75e007239 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> > @@ -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;
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > index 4df3cba97f42..106779fb9fef 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> > @@ -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;
> > }
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> > index afabb9d48021..2a47d678de01 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
> > @@ -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))
> > diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c
> > index fa275138c983..bfe0c3a773af 100644
> > --- a/drivers/staging/rtl8723bs/hal/odm.c
> > +++ b/drivers/staging/rtl8723bs/hal/odm.c
> > @@ -377,7 +377,6 @@ u32 ODM_Get_Rate_Bitmap(
> > break;
> >
> > case (ODM_WM_G):
> > - case (ODM_WM_A):
> > if (rssi_level == DM_RATR_STA_HIGH)
> > rate_bitmap = 0x00000f00;
> > else
> > @@ -396,7 +395,6 @@ u32 ODM_Get_Rate_Bitmap(
> > case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
> > case (ODM_WM_B|ODM_WM_N24G):
> > case (ODM_WM_G|ODM_WM_N24G):
> > - case (ODM_WM_A|ODM_WM_N5G):
> > if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) {
> > if (rssi_level == DM_RATR_STA_HIGH)
> > rate_bitmap = 0x000f0000;
> > @@ -422,34 +420,6 @@ u32 ODM_Get_Rate_Bitmap(
> > }
> > break;
> >
> > - case (ODM_WM_AC|ODM_WM_G):
> > - if (rssi_level == 1)
> > - rate_bitmap = 0xfc3f0000;
> > - else if (rssi_level == 2)
> > - rate_bitmap = 0xfffff000;
> > - else
> > - rate_bitmap = 0xffffffff;
> > - break;
> > -
> > - case (ODM_WM_AC|ODM_WM_A):
> > -
> > - if (pDM_Odm->RFType == RF_1T1R) {
> > - if (rssi_level == 1) /* add by Gary for ac-series */
> > - rate_bitmap = 0x003f8000;
> > - else if (rssi_level == 2)
> > - rate_bitmap = 0x003ff000;
> > - else
> > - rate_bitmap = 0x003ff010;
> > - } else {
> > - if (rssi_level == 1) /* add by Gary for ac-series */
> > - rate_bitmap = 0xfe3f8000; /* VHT 2SS MCS3~9 */
> > - else if (rssi_level == 2)
> > - rate_bitmap = 0xfffff000; /* VHT 2SS MCS0~9 */
> > - else
> > - rate_bitmap = 0xfffff010; /* All */
> > - }
> > - break;
> > -
> > default:
> > if (pDM_Odm->RFType == RF_1T2R)
> > rate_bitmap = 0x000fffff;
> > diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
> > index 950e7850bac2..7e2d3679c7d0 100644
> > --- a/drivers/staging/rtl8723bs/hal/odm.h
> > +++ b/drivers/staging/rtl8723bs/hal/odm.h
> > @@ -455,11 +455,8 @@ enum { /* tag_Wireless_Mode_Definition */
> > ODM_WM_UNKNOWN = 0x0,
> > ODM_WM_B = BIT0,
> > ODM_WM_G = BIT1,
> > - ODM_WM_A = BIT2,
> > ODM_WM_N24G = BIT3,
> > - ODM_WM_N5G = BIT4,
> > ODM_WM_AUTO = BIT5,
> > - ODM_WM_AC = BIT6,
> > };
> >
> > /* ODM_CMNINFO_BAND */
> > diff --git a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
> > index f3856e47bfd3..578d5712645c 100644
> > --- a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
> > +++ b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c
> > @@ -124,12 +124,10 @@ void odm_EdcaTurboCheckCE(void *pDM_VOID)
> > } else if ((iot_peer == HT_IOT_PEER_CISCO) &&
> > ((wirelessmode == ODM_WM_G) ||
> > (wirelessmode == (ODM_WM_B | ODM_WM_G)) ||
> > - (wirelessmode == ODM_WM_A) ||
> > (wirelessmode == ODM_WM_B))) {
> > EDCA_BE_DL = edca_setting_DL_GMode[iot_peer];
> > } else if ((iot_peer == HT_IOT_PEER_AIRGO) &&
> > - ((wirelessmode == ODM_WM_G) ||
> > - (wirelessmode == ODM_WM_A))) {
> > + (wirelessmode == ODM_WM_G)) {
> > EDCA_BE_DL = 0xa630;
> > } else if (iot_peer == HT_IOT_PEER_MARVELL) {
> > EDCA_BE_DL = edca_setting_DL[iot_peer];
> > diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> > index 3738727feb60..a07a6dacec42 100644
> > --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> > +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c
> > @@ -512,8 +512,6 @@ static void _InitOperationMode(struct adapter *padapter)
> > case WIRELESS_MODE_B:
> > regBwOpMode = BW_OPMODE_20MHZ;
> > break;
> > - case WIRELESS_MODE_A:
> > - break;
> > case WIRELESS_MODE_G:
> > regBwOpMode = BW_OPMODE_20MHZ;
> > break;
> > @@ -525,9 +523,6 @@ static void _InitOperationMode(struct adapter *padapter)
> > /* CCK rate will be filtered out only when associated AP does not support it. */
> > regBwOpMode = BW_OPMODE_20MHZ;
> > break;
> > - case WIRELESS_MODE_N_5G:
> > - regBwOpMode = BW_OPMODE_5G;
> > - break;
> >
> > default: /* for MacOSX compiler warning. */
> > break;
> > diff --git a/drivers/staging/rtl8723bs/include/hal_phy.h b/drivers/staging/rtl8723bs/include/hal_phy.h
> > index 19221289b8ce..6417d1b758d2 100644
> > --- a/drivers/staging/rtl8723bs/include/hal_phy.h
> > +++ b/drivers/staging/rtl8723bs/include/hal_phy.h
> > @@ -51,13 +51,10 @@ enum rf_path {
> >
> > enum wireless_mode {
> > WIRELESS_MODE_UNKNOWN = 0x00,
> > - WIRELESS_MODE_A = 0x01,
> > WIRELESS_MODE_B = 0x02,
> > WIRELESS_MODE_G = 0x04,
> > WIRELESS_MODE_AUTO = 0x08,
> > WIRELESS_MODE_N_24G = 0x10,
> > - WIRELESS_MODE_N_5G = 0x20,
> > - WIRELESS_MODE_AC_5G = 0x40,
> > WIRELESS_MODE_AC_24G = 0x80,
> > WIRELESS_MODE_AC_ONLY = 0x100,
> > };
> > diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
> > index 6540c7a22938..ac88bd30b097 100644
> > --- a/drivers/staging/rtl8723bs/include/ieee80211.h
> > +++ b/drivers/staging/rtl8723bs/include/ieee80211.h
> > @@ -144,33 +144,20 @@ enum network_type {
> > /* Sub-Element */
> > 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_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_5N = BIT(4), /* tx: MCS only, rx: MCS & ofdm, hw: ofdm only */
> > WIRELESS_AUTO = BIT(5),
> > - WIRELESS_11AC = BIT(6),
> >
> > /* Combination */
> > /* Type for current wireless mode */
> > WIRELESS_11BG = (WIRELESS_11B|WIRELESS_11G), /* tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm */
> > WIRELESS_11G_24N = (WIRELESS_11G|WIRELESS_11_24N), /* tx: ofdm & MCS, rx: ofdm & cck & MCS, hw: cck & ofdm */
> > - WIRELESS_11A_5N = (WIRELESS_11A|WIRELESS_11_5N), /* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
> > WIRELESS_11B_24N = (WIRELESS_11B|WIRELESS_11_24N), /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
> > WIRELESS_11BG_24N = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N), /* tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
> > - WIRELESS_11_24AC = (WIRELESS_11G|WIRELESS_11AC),
> > - WIRELESS_11_5AC = (WIRELESS_11A|WIRELESS_11AC),
> > -
> > -
> > - /* Type for registry default wireless mode */
> > - WIRELESS_11AGN = (WIRELESS_11A|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N), /* tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
> > - WIRELESS_11ABGN = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N),
> > - WIRELESS_MODE_24G = (WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11AC),
> > - WIRELESS_MODE_MAX = (WIRELESS_11A|WIRELESS_11B|WIRELESS_11G|WIRELESS_11_24N|WIRELESS_11_5N|WIRELESS_11AC),
> > };
> >
> > #define SUPPORTED_24G_NETTYPE_MSK (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N)
> >
> > -#define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG|WIRELESS_11A)))
> > +#define IsLegacyOnly(NetType) ((NetType) == ((NetType) & (WIRELESS_11BG)))
> >
> > #define IsSupported24G(NetType) ((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false)
> >
> > @@ -182,11 +169,8 @@ enum network_type {
> > #define IsSupportedRxHT(NetType) IsEnableHWOFDM(NetType)
> >
> > #define IsSupportedTxCCK(NetType) (((NetType) & (WIRELESS_11B)) ? true : false)
> > -#define IsSupportedTxOFDM(NetType) (((NetType) & (WIRELESS_11G|WIRELESS_11A)) ? true : false)
> > -#define IsSupportedHT(NetType) (((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N)) ? true : false)
> > -
> > -#define IsSupportedVHT(NetType) (((NetType) & (WIRELESS_11AC)) ? true : false)
> > -
> > +#define IsSupportedTxOFDM(NetType) (((NetType) & (WIRELESS_11G) ? true : false)
> > +#define IsSupportedHT(NetType) (((NetType) & (WIRELESS_11_24N)) ? true : false)
> >
> > struct ieee_param {
> > u32 cmd;
> > diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h
> > index 23de3ab87f9c..0bd7b662b972 100644
> > --- a/drivers/staging/rtl8723bs/include/wifi.h
> > +++ b/drivers/staging/rtl8723bs/include/wifi.h
> > @@ -336,7 +336,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
> > #define _PRE_ALLOCICVHDR_ 5
> > #define _PRE_ALLOCMICHDR_ 6
> >
> > -#define _SIFSTIME_ ((priv->pmib->dot11BssType.net_work_type&WIRELESS_11A)?16:10)
> > #define _ACKCTSLNG_ 14 /* 14 bytes long, including crclng */
> > #define _CRCLNG_ 4
> >
> > diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > index 11b9a5919da4..4e7c115c8bc1 100644
> > --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
> > @@ -22,7 +22,7 @@ static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
> > static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
> > /* struct ndis_802_11_ssid ssid; */
> > static int rtw_channel = 1;/* ad-hoc support requirement */
> > -static int rtw_wireless_mode = WIRELESS_MODE_MAX;
> > +static int rtw_wireless_mode = WIRELESS_11BG_24N;
> > static int rtw_vrtl_carrier_sense = AUTO_VCS;
> > static int rtw_vcs_type = RTS_CTS;/* */
> > static int rtw_rts_thresh = 2347;/* */
> >
>