linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: r8188eu: Remove 5GHz band related code
@ 2021-08-12  0:25 Fabio M. De Francesco
  2021-08-12  0:25 ` [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types Fabio M. De Francesco
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Fabio M. De Francesco @ 2021-08-12  0:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, Phillip Potter, Martin Kaiser,
	Michael Straube, Fabio Aiuto, linux-staging, linux-kernel
  Cc: Fabio M. De Francesco

This series removes code only needed for 5 GHz because the r8188eu
driver is meant to work with chips that are only capable to operate on
2.4 GHz band with 14 channels.

This driver has been (quickly) tested with an ASUS USB N10 Nano, however
I think it needs some more testing by more experienced users and
programmers.

Thanks to Fabio Aiuto <fabioaiuto83@gmail.com> who gave me the
inspiration to address this work, since he made a (more extended) 
removal of 5 GHz code from rtl8723bs:
https://lore.kernel.org/linux-staging/cover.1624367071.git.fabioaiuto83@gmail.com/.

Fabio M. De Francesco (3):
  staging: r8188eu: Remove all 5GHz network types
  staging: r8188eu: Remove code related to unsupported channel
    bandwidths
  staging: r8188eu: Remove no more necessary definitions and code

 drivers/staging/r8188eu/core/rtw_ap.c         | 13 ++--------
 drivers/staging/r8188eu/core/rtw_debug.c      | 25 +------------------
 drivers/staging/r8188eu/core/rtw_ieee80211.c  | 19 +++-----------
 drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  4 +--
 drivers/staging/r8188eu/core/rtw_mlme.c       | 10 --------
 drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 13 +++-------
 drivers/staging/r8188eu/core/rtw_p2p.c        |  2 +-
 drivers/staging/r8188eu/core/rtw_wlan_util.c  | 15 ++---------
 drivers/staging/r8188eu/hal/odm.c             | 20 +++------------
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c |  3 ---
 .../staging/r8188eu/include/Hal8188EPhyCfg.h  |  4 ---
 drivers/staging/r8188eu/include/ieee80211.h   | 23 ++---------------
 drivers/staging/r8188eu/include/odm.h         |  8 ------
 .../staging/r8188eu/include/rtl8188e_spec.h   |  5 ----
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  1 -
 drivers/staging/r8188eu/include/rtw_rf.h      |  3 ---
 drivers/staging/r8188eu/include/wifi.h        |  2 +-
 drivers/staging/r8188eu/include/wlan_bssdef.h |  2 +-
 18 files changed, 21 insertions(+), 151 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types
  2021-08-12  0:25 [PATCH 0/3] staging: r8188eu: Remove 5GHz band related code Fabio M. De Francesco
@ 2021-08-12  0:25 ` Fabio M. De Francesco
  2021-08-12  2:09   ` Larry Finger
  2021-08-12  0:25 ` [PATCH 2/3] staging: r8188eu: Remove code related to unsupported channels Fabio M. De Francesco
  2021-08-12  0:25 ` [PATCH 3/3] staging: r8188eu: Remove no more necessary definitions and code Fabio M. De Francesco
  2 siblings, 1 reply; 9+ messages in thread
From: Fabio M. De Francesco @ 2021-08-12  0:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, Phillip Potter, Martin Kaiser,
	Michael Straube, Fabio Aiuto, linux-staging, linux-kernel
  Cc: Fabio M. De Francesco

Remove all 5Ghz network types. r8188eu works on
802.11bgn standards and on 2.4Ghz band.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_ap.c         | 13 ++---------
 drivers/staging/r8188eu/core/rtw_ieee80211.c  | 19 +++------------
 drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  2 +-
 drivers/staging/r8188eu/core/rtw_mlme.c       | 10 --------
 drivers/staging/r8188eu/core/rtw_p2p.c        |  2 +-
 drivers/staging/r8188eu/core/rtw_wlan_util.c  | 15 ++----------
 drivers/staging/r8188eu/hal/odm.c             |  1 -
 drivers/staging/r8188eu/include/ieee80211.h   | 23 ++-----------------
 drivers/staging/r8188eu/include/wifi.h        |  2 +-
 drivers/staging/r8188eu/include/wlan_bssdef.h |  2 +-
 10 files changed, 13 insertions(+), 76 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_ap.c b/drivers/staging/r8188eu/core/rtw_ap.c
index 3f23c1a25419..bc4c6dbd5aa3 100644
--- a/drivers/staging/r8188eu/core/rtw_ap.c
+++ b/drivers/staging/r8188eu/core/rtw_ap.c
@@ -460,11 +460,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
 	}
 
 	if (pcur_network->Configuration.DSConfig > 14) {
-		/*  5G band */
-		if (tx_ra_bitmap & 0xffff000)
-			sta_band |= WIRELESS_11_5N | WIRELESS_11A;
-		else
-			sta_band |= WIRELESS_11A;
+		sta_band |= WIRELESS_INVALID;
 	} else {
 		if (tx_ra_bitmap & 0xffff000)
 			sta_band |= WIRELESS_11_24N | WIRELESS_11G | WIRELESS_11B;
@@ -547,9 +543,7 @@ void update_bmc_sta(struct adapter *padapter)
 		}
 
 		if (pcur_network->Configuration.DSConfig > 14) {
-			/* force to A mode. 5G doesn't support CCK rates */
-			network_type = WIRELESS_11A;
-			tx_ra_bitmap = 0x150; /*  6, 12, 24 Mbps */
+			network_type = WIRELESS_INVALID;
 		} else {
 			/* force to b mode */
 			network_type = WIRELESS_11B;
@@ -1050,9 +1044,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/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
index 55d2b8f90d91..0c7231cefdda 100644
--- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
@@ -98,10 +98,7 @@ uint	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)) == true)
-			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)) == true)
 			return WIRELESS_11B;
@@ -328,9 +325,6 @@ void rtw_set_supported_rate(u8 *SupportedRates, uint mode)
 		memcpy(SupportedRates, WIFI_CCKRATES, IEEE80211_CCK_RATE_LEN);
 		break;
 	case WIRELESS_11G:
-	case WIRELESS_11A:
-	case WIRELESS_11_5N:
-	case WIRELESS_11A_5N:/* Todo: no basic rate for ofdm ? */
 		memcpy(SupportedRates, WIFI_OFDMRATES, IEEE80211_NUM_OFDM_RATESLEN);
 		break;
 	case WIRELESS_11BG:
@@ -393,16 +387,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
 	ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
 
 	/* 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);
+	rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);
 
 	rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
 
diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
index 37e8b076be93..8b2f5ace1d86 100644
--- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
@@ -795,7 +795,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
 	    (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)))
 		return 0;
 
-	if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
+	if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N)) {
 		p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
 		if (p && ht_ielen > 0) {
 			pht_capie = (struct ieee80211_ht_cap *)(p+2);
diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c
index d688f2427b03..ae7fd24798c3 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme.c
@@ -1916,16 +1916,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/r8188eu/core/rtw_p2p.c b/drivers/staging/r8188eu/core/rtw_p2p.c
index 9b3ea8a31508..3c518a7cd64f 100644
--- a/drivers/staging/r8188eu/core/rtw_p2p.c
+++ b/drivers/staging/r8188eu/core/rtw_p2p.c
@@ -1950,7 +1950,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
 		/*	Added by Albert 2011/03/22 */
 		/*	In the P2P mode, the driver should not support the b mode. */
 		/*	So, the Tx packet shouldn't use the CCK rate */
-		update_tx_basic_rate(padapter, WIRELESS_11AGN);
+		update_tx_basic_rate(padapter, (WIRELESS_11G | WIRELESS_11_24N));
 
 		/* Enable P2P function */
 		init_wifidirect_info(padapter, role);
diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index e897920b7af1..b9ef671bbc8a 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -78,7 +78,6 @@ unsigned char networktype_to_raid(unsigned char network_type)
 	case WIRELESS_11B:
 		raid = RATR_INX_WIRELESS_B;
 		break;
-	case WIRELESS_11A:
 	case WIRELESS_11G:
 		raid = RATR_INX_WIRELESS_G;
 		break;
@@ -86,10 +85,8 @@ unsigned char networktype_to_raid(unsigned char network_type)
 		raid = RATR_INX_WIRELESS_GB;
 		break;
 	case WIRELESS_11_24N:
-	case WIRELESS_11_5N:
 		raid = RATR_INX_WIRELESS_N;
 		break;
-	case WIRELESS_11A_5N:
 	case WIRELESS_11G_24N:
 		raid = RATR_INX_WIRELESS_NG;
 		break;
@@ -110,10 +107,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
 	struct mlme_ext_info	*pmlmeinfo = &pmlmeext->mlmext_info;
 
 	if (pmlmeext->cur_channel > 14) {
-		if (pmlmeinfo->HT_enable)
-			network_type = WIRELESS_11_5N;
-
-		network_type |= WIRELESS_11A;
+		network_type |= WIRELESS_INVALID;
 	} else {
 		if (pmlmeinfo->HT_enable)
 			network_type = WIRELESS_11_24N;
@@ -1490,8 +1484,6 @@ void update_capinfo(struct adapter *Adapter, u16 updateCap)
 				if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
 					pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
 			}
-		} else if (pmlmeext->cur_wireless_mode & (WIRELESS_11A | WIRELESS_11_5N)) {
-			pmlmeinfo->slotTime = SHORT_SLOT_TIME;
 		} else {
 			/* B Mode */
 			pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
@@ -1516,10 +1508,7 @@ void update_wireless_mode(struct adapter *padapter)
 		pmlmeinfo->HT_enable = 1;
 
 	if (pmlmeext->cur_channel > 14) {
-		if (pmlmeinfo->HT_enable)
-			network_type = WIRELESS_11_5N;
-
-		network_type |= WIRELESS_11A;
+		network_type |= WIRELESS_INVALID;
 	} else {
 		if (pmlmeinfo->HT_enable)
 			network_type = WIRELESS_11_24N;
diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
index 53198bf92c0f..2fd20339460f 100644
--- a/drivers/staging/r8188eu/hal/odm.c
+++ b/drivers/staging/r8188eu/hal/odm.c
@@ -1136,7 +1136,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
 		break;
 	default:
 		/* case WIRELESS_11_24N: */
-		/* case WIRELESS_11_5N: */
 		if (pDM_Odm->RFType == RF_1T2R)
 			rate_bitmap = 0x000fffff;
 		else
diff --git a/drivers/staging/r8188eu/include/ieee80211.h b/drivers/staging/r8188eu/include/ieee80211.h
index 4dfa817175e7..bc5b030e9c40 100644
--- a/drivers/staging/r8188eu/include/ieee80211.h
+++ b/drivers/staging/r8188eu/include/ieee80211.h
@@ -145,53 +145,34 @@ 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_AC		= BIT(6),
 
 	/* Combination */
 	/*  tx: cck & ofdm, rx: cck & ofdm & MCS, hw: cck & ofdm */
 	WIRELESS_11BG = (WIRELESS_11B | WIRELESS_11G),
 	/*  tx: ofdm & MCS, rx: ofdm & cck & MCS, hw: cck & ofdm */
 	WIRELESS_11G_24N = (WIRELESS_11G | WIRELESS_11_24N),
-	/*  tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
-	WIRELESS_11A_5N = (WIRELESS_11A | WIRELESS_11_5N),
 	/*  tx: ofdm & cck & MCS, rx: ofdm & cck & MCS, hw: ofdm & cck */
 	WIRELESS_11BG_24N = (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N),
-	/*  tx: ofdm & MCS, rx: ofdm & MCS, hw: ofdm only */
-	WIRELESS_11AGN = (WIRELESS_11A | WIRELESS_11G | WIRELESS_11_24N |
-			  WIRELESS_11_5N),
-	WIRELESS_11ABGN = (WIRELESS_11A | WIRELESS_11B | WIRELESS_11G |
-			   WIRELESS_11_24N | WIRELESS_11_5N),
 };
 
 #define SUPPORTED_24G_NETTYPE_MSK				\
 	 (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N)
-#define SUPPORTED_5G_NETTYPE_MSK				\
-	 (WIRELESS_11A | WIRELESS_11_5N)
 
 #define IsSupported24G(NetType)					\
 	((NetType) & SUPPORTED_24G_NETTYPE_MSK ? true : false)
-#define IsSupported5G(NetType)					\
-	((NetType) & SUPPORTED_5G_NETTYPE_MSK ? true : false)
 
 #define IsEnableHWCCK(NetType)					\
 	IsSupported24G(NetType)
-#define IsEnableHWOFDM(NetType)					\
-	((NetType) & (WIRELESS_11G | WIRELESS_11_24N |		\
-	 SUPPORTED_5G_NETTYPE_MSK) ? true : false)
 
 #define IsSupportedRxCCK(NetType) IsEnableHWCCK(NetType)
-#define IsSupportedRxOFDM(NetType) IsEnableHWOFDM(NetType)
-#define IsSupportedRxMCS(NetType) IsEnableHWOFDM(NetType)
 
 #define IsSupportedTxCCK(NetType)				\
 	((NetType) & (WIRELESS_11B) ? true : false)
 #define IsSupportedTxOFDM(NetType)				\
-	((NetType) & (WIRELESS_11G|WIRELESS_11A) ? true : false)
+	((NetType) & (WIRELESS_11G) ? true : false)
 #define IsSupportedTxMCS(NetType)				\
-	((NetType) & (WIRELESS_11_24N|WIRELESS_11_5N) ? true : false)
+	((NetType) & (WIRELESS_11_24N) ? true : false)
 
 struct ieee_param {
 	u32 cmd;
diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h
index 65fc677bf4eb..f4212c4f4ada 100644
--- a/drivers/staging/r8188eu/include/wifi.h
+++ b/drivers/staging/r8188eu/include/wifi.h
@@ -464,7 +464,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 #define _PRE_ALLOCMICHDR_		6
 
 #define _SIFSTIME_				\
-	((priv->pmib->dot11BssType.net_work_type & WIRELESS_11A) ? 16 : 10)
+	(priv->pmib->dot11BssType.net_work_type = 10)
 #define _ACKCTSLNG_		14	/* 14 bytes long, including crclng */
 #define _CRCLNG_		4
 
diff --git a/drivers/staging/r8188eu/include/wlan_bssdef.h b/drivers/staging/r8188eu/include/wlan_bssdef.h
index bada3e168c42..99ca097b8edd 100644
--- a/drivers/staging/r8188eu/include/wlan_bssdef.h
+++ b/drivers/staging/r8188eu/include/wlan_bssdef.h
@@ -254,7 +254,7 @@ static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
 
 struct	wlan_network {
 	struct list_head list;
-	int	network_type;	/* refer to ieee80211.h for WIRELESS_11A/B/G */
+	int	network_type;	/* refer to ieee80211.h for WIRELESS_11B/G */
 	int	fixed;		/*  set fixed when not to be removed
 				 *  in site-surveying */
 	unsigned long	last_scanned; /* timestamp for the network */
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] staging: r8188eu: Remove code related to unsupported channels
  2021-08-12  0:25 [PATCH 0/3] staging: r8188eu: Remove 5GHz band related code Fabio M. De Francesco
  2021-08-12  0:25 ` [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types Fabio M. De Francesco
@ 2021-08-12  0:25 ` Fabio M. De Francesco
  2021-08-12  2:11   ` Larry Finger
  2021-08-12  0:25 ` [PATCH 3/3] staging: r8188eu: Remove no more necessary definitions and code Fabio M. De Francesco
  2 siblings, 1 reply; 9+ messages in thread
From: Fabio M. De Francesco @ 2021-08-12  0:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, Phillip Potter, Martin Kaiser,
	Michael Straube, Fabio Aiuto, linux-staging, linux-kernel
  Cc: Fabio M. De Francesco

Remove all code related to unsupported channel
bandwidths. rtl8188eu* NICs work only on 20 and
40 Mhz channels.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
 drivers/staging/r8188eu/include/odm.h    | 3 ---
 drivers/staging/r8188eu/include/rtw_rf.h | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
index a1f8c7fe595c..4dadb22bcc89 100644
--- a/drivers/staging/r8188eu/include/odm.h
+++ b/drivers/staging/r8188eu/include/odm.h
@@ -567,9 +567,6 @@ enum odm_security {
 enum odm_bw {
 	ODM_BW20M		= 0,
 	ODM_BW40M		= 1,
-	ODM_BW80M		= 2,
-	ODM_BW160M		= 3,
-	ODM_BW10M		= 4,
 };
 
 /*  ODM_CMNINFO_BOARD_TYPE */
diff --git a/drivers/staging/r8188eu/include/rtw_rf.h b/drivers/staging/r8188eu/include/rtw_rf.h
index 0f790da7e0aa..48129da9c93f 100644
--- a/drivers/staging/r8188eu/include/rtw_rf.h
+++ b/drivers/staging/r8188eu/include/rtw_rf.h
@@ -97,9 +97,6 @@ enum rf90_radio_path {
 enum ht_channel_width {
 	HT_CHANNEL_WIDTH_20 = 0,
 	HT_CHANNEL_WIDTH_40 = 1,
-	HT_CHANNEL_WIDTH_80 = 2,
-	HT_CHANNEL_WIDTH_160 = 3,
-	HT_CHANNEL_WIDTH_10 = 4,
 };
 
 /*  */
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] staging: r8188eu: Remove no more necessary definitions and code
  2021-08-12  0:25 [PATCH 0/3] staging: r8188eu: Remove 5GHz band related code Fabio M. De Francesco
  2021-08-12  0:25 ` [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types Fabio M. De Francesco
  2021-08-12  0:25 ` [PATCH 2/3] staging: r8188eu: Remove code related to unsupported channels Fabio M. De Francesco
@ 2021-08-12  0:25 ` Fabio M. De Francesco
  2021-08-12  2:15   ` Larry Finger
  2 siblings, 1 reply; 9+ messages in thread
From: Fabio M. De Francesco @ 2021-08-12  0:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, Phillip Potter, Martin Kaiser,
	Michael Straube, Fabio Aiuto, linux-staging, linux-kernel
  Cc: Fabio M. De Francesco

Remove no more necessary further 5GHz related code, along with no
more used definitions of macro and variables.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_debug.c      | 25 +------------------
 drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  2 +-
 drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 13 +++-------
 drivers/staging/r8188eu/hal/odm.c             | 19 +++-----------
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c |  3 ---
 .../staging/r8188eu/include/Hal8188EPhyCfg.h  |  4 ---
 drivers/staging/r8188eu/include/odm.h         |  5 ----
 .../staging/r8188eu/include/rtl8188e_spec.h   |  5 ----
 .../staging/r8188eu/include/rtw_mlme_ext.h    |  1 -
 9 files changed, 8 insertions(+), 69 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_debug.c b/drivers/staging/r8188eu/core/rtw_debug.c
index e7b088563738..771f62452498 100644
--- a/drivers/staging/r8188eu/core/rtw_debug.c
+++ b/drivers/staging/r8188eu/core/rtw_debug.c
@@ -876,13 +876,11 @@ int proc_get_best_channel(char *page, char **start,
 	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 	int len = 0;
-	u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0;
+	u32 i, best_channel_24G = 1, index_24G = 0;
 
 	for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
 		if (pmlmeext->channel_set[i].ChannelNum == 1)
 			index_24G = i;
-		if (pmlmeext->channel_set[i].ChannelNum == 36)
-			index_5G = i;
 	}
 
 	for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
@@ -894,32 +892,11 @@ int proc_get_best_channel(char *page, char **start,
 			}
 		}
 
-		/*  5G */
-		if (pmlmeext->channel_set[i].ChannelNum >= 36 &&
-		    pmlmeext->channel_set[i].ChannelNum < 140) {
-			 /*  Find primary channel */
-			if (((pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) &&
-			    (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
-				index_5G = i;
-				best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
-			}
-		}
-
-		if (pmlmeext->channel_set[i].ChannelNum >= 149 &&
-		    pmlmeext->channel_set[i].ChannelNum < 165) {
-			 /*  find primary channel */
-			if (((pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) &&
-			    (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
-				index_5G = i;
-				best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
-			}
-		}
 		/*  debug */
 		len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
 					pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
 	}
 
-	len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);
 	len += snprintf(page + len, count - len, "best_channel_24G = %d\n", best_channel_24G);
 
 	*eof = 1;
diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
index 8b2f5ace1d86..edcac238076a 100644
--- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
+++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
@@ -870,7 +870,7 @@ int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan)
 */
 int rtw_set_country(struct adapter *adapter, const char *country_code)
 {
-	int channel_plan = RT_CHANNEL_DOMAIN_WORLD_WIDE_5G;
+	int channel_plan = RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G;
 
 	DBG_88E("%s country_code:%s\n", __func__, country_code);
 
diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 967c7574215a..17e7d33a80c4 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -104,7 +104,6 @@ static struct rt_channel_plan_map	RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
 	{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 */
@@ -116,7 +115,6 @@ static struct rt_channel_plan_map	RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
 	{0x00},	/* 0x1C, */
 	{0x00},	/* 0x1D, */
 	{0x00},	/* 0x1E, */
-	{0x05},	/* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */
 	/*  0x20 ~ 0x7F , New Define ===== */
 	{0x00},	/* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */
 	{0x01},	/* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */
@@ -6813,11 +6811,7 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
 			p++;
 
 			for (j = 0; j < noc; j++) {
-				if (fcn <= 14)
-					channel = fcn + j; /*  2.4 GHz */
-				else
-					channel = fcn + j*4; /*  5 GHz */
-
+				channel = fcn + j;
 				chplan_ap.Channel[i++] = channel;
 			}
 		}
@@ -6834,11 +6828,10 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
 		if (pregistrypriv->wireless_mode & WIRELESS_11G) {
 			do {
 				if ((i == MAX_CHANNEL_NUM) ||
-				    (chplan_sta[i].ChannelNum == 0) ||
-				    (chplan_sta[i].ChannelNum > 14))
+				    (chplan_sta[i].ChannelNum == 0))
 					break;
 
-				if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] > 14))
+				if (j == chplan_ap.Len)
 					break;
 
 				if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) {
diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
index 2fd20339460f..3c793852939d 100644
--- a/drivers/staging/r8188eu/hal/odm.c
+++ b/drivers/staging/r8188eu/hal/odm.c
@@ -621,15 +621,9 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
 				FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
 			}
 		} else {
-			if (*pDM_Odm->pBandType == ODM_BAND_5G) {
-				DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0;
-				FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_0);
-				FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0);
-			} else {
-				DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1;
-				FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_1);
-				FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
-			}
+			DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1;
+			FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_1);
+			FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
 		}
 	} else {
 		DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0;
@@ -1094,12 +1088,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
 		else
 			rate_bitmap = 0x0000000f;
 		break;
-	case (ODM_WM_A|ODM_WM_G):
-		if (rssi_level == DM_RATR_STA_HIGH)
-			rate_bitmap = 0x00000f00;
-		else
-			rate_bitmap = 0x00000ff0;
-		break;
 	case (ODM_WM_B|ODM_WM_G):
 		if (rssi_level == DM_RATR_STA_HIGH)
 			rate_bitmap = 0x00000f00;
@@ -1109,7 +1097,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
 			rate_bitmap = 0x00000ff5;
 		break;
 	case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
-	case (ODM_WM_A|ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
 		if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) {
 			if (rssi_level == DM_RATR_STA_HIGH) {
 				rate_bitmap = 0x000f0000;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index f7b6402e1cd2..02955b8c4005 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -1026,9 +1026,6 @@ _PHY_SetBWMode92C(
 	case RF_8256:
 		/*  Please implement this function in Hal8190PciPhy8256.c */
 		break;
-	case RF_8258:
-		/*  Please implement this function in Hal8190PciPhy8258.c */
-		break;
 	case RF_PSEUDO_11N:
 		break;
 	case RF_6052:
diff --git a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
index 96888d66d28c..4370ec2fa981 100644
--- a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
+++ b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
@@ -67,13 +67,10 @@ enum rf_radio_path {
 
 enum wireless_mode {
 	WIRELESS_MODE_UNKNOWN = 0x00,
-	WIRELESS_MODE_A			= BIT(2),
 	WIRELESS_MODE_B			= BIT(0),
 	WIRELESS_MODE_G			= BIT(1),
 	WIRELESS_MODE_AUTO		= BIT(5),
 	WIRELESS_MODE_N_24G		= BIT(3),
-	WIRELESS_MODE_N_5G		= BIT(4),
-	WIRELESS_MODE_AC		= BIT(6)
 };
 
 enum phy_rate_tx_offset_area {
@@ -91,7 +88,6 @@ enum RF_TYPE_8190P {
 	RF_TYPE_MIN,		/*  0 */
 	RF_8225 = 1,		/*  1 11b/g RF for verification only */
 	RF_8256 = 2,		/*  2 11b/g/n */
-	RF_8258 = 3,		/*  3 11a/b/g/n RF */
 	RF_6052 = 4,		/*  4 11b/g/n RF */
 	/*  TODO: We should remove this psudo PHY RF after we get new RF. */
 	RF_PSEUDO_11N = 5,	/*  5, It is a temporality RF. */
diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
index 4dadb22bcc89..19458e66603c 100644
--- a/drivers/staging/r8188eu/include/odm.h
+++ b/drivers/staging/r8188eu/include/odm.h
@@ -531,17 +531,13 @@ enum odm_wireless_mode {
 	ODM_WM_UNKNOW	= 0x0,
 	ODM_WM_B	= BIT(0),
 	ODM_WM_G	= BIT(1),
-	ODM_WM_A	= BIT(2),
 	ODM_WM_N24G	= BIT(3),
-	ODM_WM_N5G	= BIT(4),
 	ODM_WM_AUTO	= BIT(5),
-	ODM_WM_AC	= BIT(6),
 };
 
 /*  ODM_CMNINFO_BAND */
 enum odm_band_type {
 	ODM_BAND_2_4G	= BIT(0),
-	ODM_BAND_5G	= BIT(1),
 };
 
 /*  ODM_CMNINFO_SEC_CHNL_OFFSET */
@@ -933,7 +929,6 @@ enum odm_bb_config_type {
     CONFIG_BB_PHY_REG,
     CONFIG_BB_AGC_TAB,
     CONFIG_BB_AGC_TAB_2G,
-    CONFIG_BB_AGC_TAB_5G,
     CONFIG_BB_PHY_REG_PG,
 };
 
diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h
index 5fdc6aac917c..1c96f7b81245 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h
@@ -523,7 +523,6 @@ Default: 00b.
 
 /*        8192C BW_OPMODE bits		(Offset 0x203, 8bit) */
 #define	BW_OPMODE_20MHZ			BIT(2)
-#define	BW_OPMODE_5G			BIT(1)
 
 /*        8192C CAM Config Setting (offset 0x250, 1 byte) */
 #define	CAM_VALID			BIT(15)
@@ -1343,10 +1342,6 @@ Current IOREG MAP
 #define		EEPROM_DEFAULT_24G_HT20_DIFF	0X02
 #define		EEPROM_DEFAULT_24G_OFDM_DIFF	0X04
 
-#define		EEPROM_DEFAULT_5G_INDEX		0X2A
-#define		EEPROM_DEFAULT_5G_HT20_DIFF	0X00
-#define		EEPROM_DEFAULT_5G_OFDM_DIFF	0X04
-
 #define		EEPROM_DEFAULT_DIFF		0XFE
 #define	EEPROM_DEFAULT_CHANNEL_PLAN		0x7F
 #define	EEPROM_DEFAULT_BOARD_OPTION		0x00
diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
index 3b6e3ae92c9f..d2f4d3ce7b90 100644
--- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
@@ -112,7 +112,6 @@ enum RT_CHANNEL_DOMAIN {
 	RT_CHANNEL_DOMAIN_JAPAN = 0x10,
 	RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
 	RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
-	RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
 	RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,
 
 	/*  new channel plan mapping, (2GDOMAIN_5GDOMAIN) ===== */
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types
  2021-08-12  0:25 ` [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types Fabio M. De Francesco
@ 2021-08-12  2:09   ` Larry Finger
  2021-08-12  8:29     ` Greg Kroah-Hartman
  2021-08-12 12:52     ` Fabio M. De Francesco
  0 siblings, 2 replies; 9+ messages in thread
From: Larry Finger @ 2021-08-12  2:09 UTC (permalink / raw)
  To: Fabio M. De Francesco, Greg Kroah-Hartman, Phillip Potter,
	Martin Kaiser, Michael Straube, Fabio Aiuto, linux-staging,
	linux-kernel

On 8/11/21 7:25 PM, Fabio M. De Francesco wrote:
> Remove all 5Ghz network types. r8188eu works on
> 802.11bgn standards and on 2.4Ghz band.
> 
> Signed-off-by: Fabio M. De Francesco<fmdefrancesco@gmail.com>
> ---
>   drivers/staging/r8188eu/core/rtw_ap.c         | 13 ++---------
>   drivers/staging/r8188eu/core/rtw_ieee80211.c  | 19 +++------------
>   drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  2 +-
>   drivers/staging/r8188eu/core/rtw_mlme.c       | 10 --------
>   drivers/staging/r8188eu/core/rtw_p2p.c        |  2 +-
>   drivers/staging/r8188eu/core/rtw_wlan_util.c  | 15 ++----------
>   drivers/staging/r8188eu/hal/odm.c             |  1 -
>   drivers/staging/r8188eu/include/ieee80211.h   | 23 ++-----------------
>   drivers/staging/r8188eu/include/wifi.h        |  2 +-
>   drivers/staging/r8188eu/include/wlan_bssdef.h |  2 +-
>   10 files changed, 13 insertions(+), 76 deletions(-)

Fabio,

This patch is fine, but it does conflict with my series fixing the smatch 
warnings. Whichever set Greg takes first will apply cleanly, but the second will 
fail. This problem is due to many people working at the same time.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] staging: r8188eu: Remove code related to unsupported channels
  2021-08-12  0:25 ` [PATCH 2/3] staging: r8188eu: Remove code related to unsupported channels Fabio M. De Francesco
@ 2021-08-12  2:11   ` Larry Finger
  0 siblings, 0 replies; 9+ messages in thread
From: Larry Finger @ 2021-08-12  2:11 UTC (permalink / raw)
  To: Fabio M. De Francesco, Greg Kroah-Hartman, Phillip Potter,
	Martin Kaiser, Michael Straube, Fabio Aiuto, linux-staging,
	linux-kernel

On 8/11/21 7:25 PM, Fabio M. De Francesco wrote:
> Remove all code related to unsupported channel
> bandwidths. rtl8188eu* NICs work only on 20 and
> 40 Mhz channels.
> 
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
>   drivers/staging/r8188eu/include/odm.h    | 3 ---
>   drivers/staging/r8188eu/include/rtw_rf.h | 3 ---
>   2 files changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
> index a1f8c7fe595c..4dadb22bcc89 100644
> --- a/drivers/staging/r8188eu/include/odm.h
> +++ b/drivers/staging/r8188eu/include/odm.h
> @@ -567,9 +567,6 @@ enum odm_security {
>   enum odm_bw {
>   	ODM_BW20M		= 0,
>   	ODM_BW40M		= 1,
> -	ODM_BW80M		= 2,
> -	ODM_BW160M		= 3,
> -	ODM_BW10M		= 4,
>   };
>   
>   /*  ODM_CMNINFO_BOARD_TYPE */
> diff --git a/drivers/staging/r8188eu/include/rtw_rf.h b/drivers/staging/r8188eu/include/rtw_rf.h
> index 0f790da7e0aa..48129da9c93f 100644
> --- a/drivers/staging/r8188eu/include/rtw_rf.h
> +++ b/drivers/staging/r8188eu/include/rtw_rf.h
> @@ -97,9 +97,6 @@ enum rf90_radio_path {
>   enum ht_channel_width {
>   	HT_CHANNEL_WIDTH_20 = 0,
>   	HT_CHANNEL_WIDTH_40 = 1,
> -	HT_CHANNEL_WIDTH_80 = 2,
> -	HT_CHANNEL_WIDTH_160 = 3,
> -	HT_CHANNEL_WIDTH_10 = 4,
>   };
>   
>   /*  */
> 

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] staging: r8188eu: Remove no more necessary definitions and code
  2021-08-12  0:25 ` [PATCH 3/3] staging: r8188eu: Remove no more necessary definitions and code Fabio M. De Francesco
@ 2021-08-12  2:15   ` Larry Finger
  0 siblings, 0 replies; 9+ messages in thread
From: Larry Finger @ 2021-08-12  2:15 UTC (permalink / raw)
  To: Fabio M. De Francesco, Greg Kroah-Hartman, Phillip Potter,
	Martin Kaiser, Michael Straube, Fabio Aiuto, linux-staging,
	linux-kernel

On 8/11/21 7:25 PM, Fabio M. De Francesco wrote:
> Remove no more necessary further 5GHz related code, along with no
> more used definitions of macro and variables.
> 
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
>   drivers/staging/r8188eu/core/rtw_debug.c      | 25 +------------------
>   drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  2 +-
>   drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 13 +++-------
>   drivers/staging/r8188eu/hal/odm.c             | 19 +++-----------
>   drivers/staging/r8188eu/hal/rtl8188e_phycfg.c |  3 ---
>   .../staging/r8188eu/include/Hal8188EPhyCfg.h  |  4 ---
>   drivers/staging/r8188eu/include/odm.h         |  5 ----
>   .../staging/r8188eu/include/rtl8188e_spec.h   |  5 ----
>   .../staging/r8188eu/include/rtw_mlme_ext.h    |  1 -
>   9 files changed, 8 insertions(+), 69 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_debug.c b/drivers/staging/r8188eu/core/rtw_debug.c
> index e7b088563738..771f62452498 100644
> --- a/drivers/staging/r8188eu/core/rtw_debug.c
> +++ b/drivers/staging/r8188eu/core/rtw_debug.c
> @@ -876,13 +876,11 @@ int proc_get_best_channel(char *page, char **start,
>   	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
>   	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
>   	int len = 0;
> -	u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0;
> +	u32 i, best_channel_24G = 1, index_24G = 0;
>   
>   	for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
>   		if (pmlmeext->channel_set[i].ChannelNum == 1)
>   			index_24G = i;
> -		if (pmlmeext->channel_set[i].ChannelNum == 36)
> -			index_5G = i;
>   	}
>   
>   	for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
> @@ -894,32 +892,11 @@ int proc_get_best_channel(char *page, char **start,
>   			}
>   		}
>   
> -		/*  5G */
> -		if (pmlmeext->channel_set[i].ChannelNum >= 36 &&
> -		    pmlmeext->channel_set[i].ChannelNum < 140) {
> -			 /*  Find primary channel */
> -			if (((pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) &&
> -			    (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
> -				index_5G = i;
> -				best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
> -			}
> -		}
> -
> -		if (pmlmeext->channel_set[i].ChannelNum >= 149 &&
> -		    pmlmeext->channel_set[i].ChannelNum < 165) {
> -			 /*  find primary channel */
> -			if (((pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) &&
> -			    (pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
> -				index_5G = i;
> -				best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
> -			}
> -		}
>   		/*  debug */
>   		len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
>   					pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
>   	}
>   
> -	len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);
>   	len += snprintf(page + len, count - len, "best_channel_24G = %d\n", best_channel_24G);
>   
>   	*eof = 1;
> diff --git a/drivers/staging/r8188eu/core/rtw_ioctl_set.c b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> index 8b2f5ace1d86..edcac238076a 100644
> --- a/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> +++ b/drivers/staging/r8188eu/core/rtw_ioctl_set.c
> @@ -870,7 +870,7 @@ int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan)
>   */
>   int rtw_set_country(struct adapter *adapter, const char *country_code)
>   {
> -	int channel_plan = RT_CHANNEL_DOMAIN_WORLD_WIDE_5G;
> +	int channel_plan = RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G;
>   
>   	DBG_88E("%s country_code:%s\n", __func__, country_code);
>   
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> index 967c7574215a..17e7d33a80c4 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -104,7 +104,6 @@ static struct rt_channel_plan_map	RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
>   	{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 */
> @@ -116,7 +115,6 @@ static struct rt_channel_plan_map	RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
>   	{0x00},	/* 0x1C, */
>   	{0x00},	/* 0x1D, */
>   	{0x00},	/* 0x1E, */
> -	{0x05},	/* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */
>   	/*  0x20 ~ 0x7F , New Define ===== */
>   	{0x00},	/* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */
>   	{0x01},	/* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */
> @@ -6813,11 +6811,7 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
>   			p++;
>   
>   			for (j = 0; j < noc; j++) {
> -				if (fcn <= 14)
> -					channel = fcn + j; /*  2.4 GHz */
> -				else
> -					channel = fcn + j*4; /*  5 GHz */
> -
> +				channel = fcn + j;
>   				chplan_ap.Channel[i++] = channel;
>   			}
>   		}
> @@ -6834,11 +6828,10 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
>   		if (pregistrypriv->wireless_mode & WIRELESS_11G) {
>   			do {
>   				if ((i == MAX_CHANNEL_NUM) ||
> -				    (chplan_sta[i].ChannelNum == 0) ||
> -				    (chplan_sta[i].ChannelNum > 14))
> +				    (chplan_sta[i].ChannelNum == 0))
>   					break;
>   
> -				if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] > 14))
> +				if (j == chplan_ap.Len)
>   					break;
>   
>   				if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) {
> diff --git a/drivers/staging/r8188eu/hal/odm.c b/drivers/staging/r8188eu/hal/odm.c
> index 2fd20339460f..3c793852939d 100644
> --- a/drivers/staging/r8188eu/hal/odm.c
> +++ b/drivers/staging/r8188eu/hal/odm.c
> @@ -621,15 +621,9 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
>   				FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
>   			}
>   		} else {
> -			if (*pDM_Odm->pBandType == ODM_BAND_5G) {
> -				DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0;
> -				FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_0);
> -				FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0);
> -			} else {
> -				DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1;
> -				FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_1);
> -				FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
> -			}
> +			DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1;
> +			FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_1);
> +			FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
>   		}
>   	} else {
>   		DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0;
> @@ -1094,12 +1088,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
>   		else
>   			rate_bitmap = 0x0000000f;
>   		break;
> -	case (ODM_WM_A|ODM_WM_G):
> -		if (rssi_level == DM_RATR_STA_HIGH)
> -			rate_bitmap = 0x00000f00;
> -		else
> -			rate_bitmap = 0x00000ff0;
> -		break;
>   	case (ODM_WM_B|ODM_WM_G):
>   		if (rssi_level == DM_RATR_STA_HIGH)
>   			rate_bitmap = 0x00000f00;
> @@ -1109,7 +1097,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
>   			rate_bitmap = 0x00000ff5;
>   		break;
>   	case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
> -	case (ODM_WM_A|ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
>   		if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) {
>   			if (rssi_level == DM_RATR_STA_HIGH) {
>   				rate_bitmap = 0x000f0000;
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
> index f7b6402e1cd2..02955b8c4005 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
> @@ -1026,9 +1026,6 @@ _PHY_SetBWMode92C(
>   	case RF_8256:
>   		/*  Please implement this function in Hal8190PciPhy8256.c */
>   		break;
> -	case RF_8258:
> -		/*  Please implement this function in Hal8190PciPhy8258.c */
> -		break;
>   	case RF_PSEUDO_11N:
>   		break;
>   	case RF_6052:
> diff --git a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
> index 96888d66d28c..4370ec2fa981 100644
> --- a/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
> +++ b/drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
> @@ -67,13 +67,10 @@ enum rf_radio_path {
>   
>   enum wireless_mode {
>   	WIRELESS_MODE_UNKNOWN = 0x00,
> -	WIRELESS_MODE_A			= BIT(2),
>   	WIRELESS_MODE_B			= BIT(0),
>   	WIRELESS_MODE_G			= BIT(1),
>   	WIRELESS_MODE_AUTO		= BIT(5),
>   	WIRELESS_MODE_N_24G		= BIT(3),
> -	WIRELESS_MODE_N_5G		= BIT(4),
> -	WIRELESS_MODE_AC		= BIT(6)
>   };
>   
>   enum phy_rate_tx_offset_area {
> @@ -91,7 +88,6 @@ enum RF_TYPE_8190P {
>   	RF_TYPE_MIN,		/*  0 */
>   	RF_8225 = 1,		/*  1 11b/g RF for verification only */
>   	RF_8256 = 2,		/*  2 11b/g/n */
> -	RF_8258 = 3,		/*  3 11a/b/g/n RF */
>   	RF_6052 = 4,		/*  4 11b/g/n RF */
>   	/*  TODO: We should remove this psudo PHY RF after we get new RF. */
>   	RF_PSEUDO_11N = 5,	/*  5, It is a temporality RF. */
> diff --git a/drivers/staging/r8188eu/include/odm.h b/drivers/staging/r8188eu/include/odm.h
> index 4dadb22bcc89..19458e66603c 100644
> --- a/drivers/staging/r8188eu/include/odm.h
> +++ b/drivers/staging/r8188eu/include/odm.h
> @@ -531,17 +531,13 @@ enum odm_wireless_mode {
>   	ODM_WM_UNKNOW	= 0x0,
>   	ODM_WM_B	= BIT(0),
>   	ODM_WM_G	= BIT(1),
> -	ODM_WM_A	= BIT(2),
>   	ODM_WM_N24G	= BIT(3),
> -	ODM_WM_N5G	= BIT(4),
>   	ODM_WM_AUTO	= BIT(5),
> -	ODM_WM_AC	= BIT(6),
>   };
>   
>   /*  ODM_CMNINFO_BAND */
>   enum odm_band_type {
>   	ODM_BAND_2_4G	= BIT(0),
> -	ODM_BAND_5G	= BIT(1),
>   };
>   
>   /*  ODM_CMNINFO_SEC_CHNL_OFFSET */
> @@ -933,7 +929,6 @@ enum odm_bb_config_type {
>       CONFIG_BB_PHY_REG,
>       CONFIG_BB_AGC_TAB,
>       CONFIG_BB_AGC_TAB_2G,
> -    CONFIG_BB_AGC_TAB_5G,
>       CONFIG_BB_PHY_REG_PG,
>   };
>   
> diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h
> index 5fdc6aac917c..1c96f7b81245 100644
> --- a/drivers/staging/r8188eu/include/rtl8188e_spec.h
> +++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h
> @@ -523,7 +523,6 @@ Default: 00b.
>   
>   /*        8192C BW_OPMODE bits		(Offset 0x203, 8bit) */
>   #define	BW_OPMODE_20MHZ			BIT(2)
> -#define	BW_OPMODE_5G			BIT(1)
>   
>   /*        8192C CAM Config Setting (offset 0x250, 1 byte) */
>   #define	CAM_VALID			BIT(15)
> @@ -1343,10 +1342,6 @@ Current IOREG MAP
>   #define		EEPROM_DEFAULT_24G_HT20_DIFF	0X02
>   #define		EEPROM_DEFAULT_24G_OFDM_DIFF	0X04
>   
> -#define		EEPROM_DEFAULT_5G_INDEX		0X2A
> -#define		EEPROM_DEFAULT_5G_HT20_DIFF	0X00
> -#define		EEPROM_DEFAULT_5G_OFDM_DIFF	0X04
> -
>   #define		EEPROM_DEFAULT_DIFF		0XFE
>   #define	EEPROM_DEFAULT_CHANNEL_PLAN		0x7F
>   #define	EEPROM_DEFAULT_BOARD_OPTION		0x00
> diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
> index 3b6e3ae92c9f..d2f4d3ce7b90 100644
> --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h
> +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h
> @@ -112,7 +112,6 @@ enum RT_CHANNEL_DOMAIN {
>   	RT_CHANNEL_DOMAIN_JAPAN = 0x10,
>   	RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
>   	RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
> -	RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
>   	RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,
>   
>   	/*  new channel plan mapping, (2GDOMAIN_5GDOMAIN) ===== */
> 

Looks good.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types
  2021-08-12  2:09   ` Larry Finger
@ 2021-08-12  8:29     ` Greg Kroah-Hartman
  2021-08-12 12:52     ` Fabio M. De Francesco
  1 sibling, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-12  8:29 UTC (permalink / raw)
  To: Larry Finger
  Cc: Fabio M. De Francesco, Phillip Potter, Martin Kaiser,
	Michael Straube, Fabio Aiuto, linux-staging, linux-kernel

On Wed, Aug 11, 2021 at 09:09:49PM -0500, Larry Finger wrote:
> On 8/11/21 7:25 PM, Fabio M. De Francesco wrote:
> > Remove all 5Ghz network types. r8188eu works on
> > 802.11bgn standards and on 2.4Ghz band.
> > 
> > Signed-off-by: Fabio M. De Francesco<fmdefrancesco@gmail.com>
> > ---
> >   drivers/staging/r8188eu/core/rtw_ap.c         | 13 ++---------
> >   drivers/staging/r8188eu/core/rtw_ieee80211.c  | 19 +++------------
> >   drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  2 +-
> >   drivers/staging/r8188eu/core/rtw_mlme.c       | 10 --------
> >   drivers/staging/r8188eu/core/rtw_p2p.c        |  2 +-
> >   drivers/staging/r8188eu/core/rtw_wlan_util.c  | 15 ++----------
> >   drivers/staging/r8188eu/hal/odm.c             |  1 -
> >   drivers/staging/r8188eu/include/ieee80211.h   | 23 ++-----------------
> >   drivers/staging/r8188eu/include/wifi.h        |  2 +-
> >   drivers/staging/r8188eu/include/wlan_bssdef.h |  2 +-
> >   10 files changed, 13 insertions(+), 76 deletions(-)
> 
> Fabio,
> 
> This patch is fine, but it does conflict with my series fixing the smatch
> warnings. Whichever set Greg takes first will apply cleanly, but the second
> will fail. This problem is due to many people working at the same time.
> 
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

I worked it out and took both series, git is good at handling merge
issues like this :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types
  2021-08-12  2:09   ` Larry Finger
  2021-08-12  8:29     ` Greg Kroah-Hartman
@ 2021-08-12 12:52     ` Fabio M. De Francesco
  1 sibling, 0 replies; 9+ messages in thread
From: Fabio M. De Francesco @ 2021-08-12 12:52 UTC (permalink / raw)
  To: Larry Finger
  Cc: Greg Kroah-Hartman, Phillip Potter, Martin Kaiser,
	Michael Straube, Fabio Aiuto, linux-staging, linux-kernel

On Thursday, August 12, 2021 4:09:49 AM CEST Larry Finger wrote:
> On 8/11/21 7:25 PM, Fabio M. De Francesco wrote:
> > Remove all 5Ghz network types. r8188eu works on
> > 802.11bgn standards and on 2.4Ghz band.
> > 
> > Signed-off-by: Fabio M. De Francesco<fmdefrancesco@gmail.com>
> > ---
> > 
> >   drivers/staging/r8188eu/core/rtw_ap.c         | 13 ++---------
> >   drivers/staging/r8188eu/core/rtw_ieee80211.c  | 19 +++------------
> >   drivers/staging/r8188eu/core/rtw_ioctl_set.c  |  2 +-
> >   drivers/staging/r8188eu/core/rtw_mlme.c       | 10 --------
> >   drivers/staging/r8188eu/core/rtw_p2p.c        |  2 +-
> >   drivers/staging/r8188eu/core/rtw_wlan_util.c  | 15 ++----------
> >   drivers/staging/r8188eu/hal/odm.c             |  1 -
> >   drivers/staging/r8188eu/include/ieee80211.h   | 23 ++-----------------
> >   drivers/staging/r8188eu/include/wifi.h        |  2 +-
> >   drivers/staging/r8188eu/include/wlan_bssdef.h |  2 +-
> >   10 files changed, 13 insertions(+), 76 deletions(-)
> 
> Fabio,
> 
> This patch is fine, but it does conflict with my series fixing the smatch
> warnings. Whichever set Greg takes first will apply cleanly, but the second 
will
> fail. This problem is due to many people working at the same time.
> 
Hi Larry,

The Wizard of Git :-) (Greg, of course) has been able to work this problem out 
and took both series, as you probably already know.

Just kidding... However, you may be interested to know that, most of the 
times, the above-mentioned conflict can be worked out by using the 3-way merge 
option of git-am (https://en.wikipedia.org/wiki/Merge_(version_control)#Three-way_merge). I suppose that he used that option to resolve the conflict (am I 
missing something?).

> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Thanks for looking at my patches and acking them.

Fabio
> 
> Larry





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-08-12 12:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12  0:25 [PATCH 0/3] staging: r8188eu: Remove 5GHz band related code Fabio M. De Francesco
2021-08-12  0:25 ` [PATCH 1/3] staging: r8188eu: Remove all 5GHz network types Fabio M. De Francesco
2021-08-12  2:09   ` Larry Finger
2021-08-12  8:29     ` Greg Kroah-Hartman
2021-08-12 12:52     ` Fabio M. De Francesco
2021-08-12  0:25 ` [PATCH 2/3] staging: r8188eu: Remove code related to unsupported channels Fabio M. De Francesco
2021-08-12  2:11   ` Larry Finger
2021-08-12  0:25 ` [PATCH 3/3] staging: r8188eu: Remove no more necessary definitions and code Fabio M. De Francesco
2021-08-12  2:15   ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).