[PATCH] staging: rtl8723bs: remove some 5 GHz code
From: Michael Straube
Date: Sun Jun 15 2025 - 08:39:25 EST
Chips that use this driver are 2.4 GHz only. Remove some code that is
executed only for 5 GHz (channel > 14) . This addresses the following
TODO item:
- find and remove any code for other chips that is left over
Signed-off-by: Michael Straube <straube.linux@xxxxxxxxx>
---
Compile tested only, due to lack of hardware.
drivers/staging/rtl8723bs/core/rtw_ap.c | 9 ++-------
drivers/staging/rtl8723bs/core/rtw_mlme.c | 18 ++++--------------
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 9 ++-------
3 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index 383a6f7c06f4..b2e7e7267aa4 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -741,13 +741,8 @@ void start_bss_network(struct adapter *padapter)
if (p && ie_len) {
pht_info = (struct HT_info_element *)(p + 2);
- if (cur_channel > 14) {
- if ((pregpriv->bw_mode & 0xf0) > 0)
- cbw40_enable = 1;
- } else {
- if ((pregpriv->bw_mode & 0x0f) > 0)
- cbw40_enable = 1;
- }
+ if ((pregpriv->bw_mode & 0x0f) > 0)
+ cbw40_enable = 1;
if ((cbw40_enable) && (pht_info->infos[0] & BIT(2))) {
/* switch to the 40M Hz mode */
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 1d23ea7d6f59..0b0ee023a239 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2252,13 +2252,8 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
}
/* to disable 40M Hz support while gd_bw_40MHz_en = 0 */
- if (channel > 14) {
- if ((pregistrypriv->bw_mode & 0xf0) > 0)
- cbw40_enable = 1;
- } else {
- if ((pregistrypriv->bw_mode & 0x0f) > 0)
- cbw40_enable = 1;
- }
+ if ((pregistrypriv->bw_mode & 0x0f) > 0)
+ cbw40_enable = 1;
if ((cbw40_enable == 1) && (operation_bw == CHANNEL_WIDTH_40)) {
ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH);
@@ -2366,13 +2361,8 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
/* todo: */
}
- if (channel > 14) {
- if ((pregistrypriv->bw_mode & 0xf0) > 0)
- cbw40_enable = 1;
- } else {
- if ((pregistrypriv->bw_mode & 0x0f) > 0)
- cbw40_enable = 1;
- }
+ if ((pregistrypriv->bw_mode & 0x0f) > 0)
+ cbw40_enable = 1;
/* update cur_bwmode & cur_ch_offset */
if ((cbw40_enable) &&
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 73c70b016f00..0c6072d08661 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -854,13 +854,8 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_80211_var_
pHT_info = (struct HT_info_element *)pIE->data;
- if (pmlmeext->cur_channel > 14) {
- if ((pregistrypriv->bw_mode & 0xf0) > 0)
- cbw40_enable = 1;
- } else {
- if ((pregistrypriv->bw_mode & 0x0f) > 0)
- cbw40_enable = 1;
- }
+ if ((pregistrypriv->bw_mode & 0x0f) > 0)
+ cbw40_enable = 1;
if ((pHT_info->infos[0] & BIT(2)) && cbw40_enable) {
new_bwmode = CHANNEL_WIDTH_40;
--
2.49.0