Skip to contentSkip to conversation

staging: rtl8723bs: remove wext code

PATCH New Fabio Aiuto 1 participant 6 messages Aug 23, 2021 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: rtl8723bs: remove wext code

This patchset removes all wext code. Some code cleaning is done as well.

cfg80211 wext compatibility is granted by selecting CFG80211_WEXT in kconfig file (so userspace programs can still use old wext handlers).

Tested-on: Miix 300-10IBY

Fabio Aiuto (5):
staging: rtl8723bs: remove obsolete wext support
staging: rtl8723bs: fix code indent issues
staging: rtl8723bs: fix logical continuation issue
staging: rtl8723bs: remove functions notifying wext events
staging: rtl8723bs: remove unused rtw_set_802_11_bssid() function

 drivers/staging/rtl8723bs/Kconfig             |    3 +-
 .../staging/rtl8723bs/core/rtw_ioctl_set.c    |   68 +-
 drivers/staging/rtl8723bs/include/drv_types.h |    3 -
 .../staging/rtl8723bs/include/rtw_ioctl_set.h |    1 -
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 3220 +----------------
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c |    4 -
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   |    1 -
 7 files changed, 44 insertions(+), 3256 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/5 staging: rtl8723bs: remove obsolete wext support

cfg80211 has been fully implemented so remove all wext and wext private handlers and their registration.

Now wext userspace calls can be managed via
cfg80211 wext compatibility.

---
 drivers/staging/rtl8723bs/Kconfig             |    3 +-
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 3170 +----------------
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   |    1 -
 3 files changed, 37 insertions(+), 3137 deletions(-)
drivers/staging/rtl8723bs/Kconfig +1 -2
index 7eae820eae3b..f40b3021fe8a 100644
@@ -3,8 +3,7 @@ config RTL8723BS
 	tristate "Realtek RTL8723BS SDIO Wireless LAN NIC driver"
 	depends on WLAN && MMC && CFG80211
 	depends on m
-	select WIRELESS_EXT
-	select WEXT_PRIV
+	select CFG80211_WEXT
 	select CRYPTO_LIB_ARC4
 	help
 	This option enables support for RTL8723BS SDIO drivers, such as
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +36 -3134

2,991 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -1
index d772a044185d..f78bf174de8e 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.20.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/5 staging: rtl8723bs: fix code indent issues

In reply to Fabio Aiuto

fix the following post commit hook checkpatch issues:

ERROR: code indent should use tabs where possible 2463: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:388:
+ if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_$

ERROR: code indent should use tabs where possible 2464: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389:
+ || padapter->securitypriv.dot11PrivacyAlgrthm

			== _TKIP_WTMIC_$

ERROR: code indent should use tabs where possible 2465: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390:
+ || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)$

ERROR: code indent should use tabs where possible 2466: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:391:
+ /* WPS open need to enable multicast */$

ERROR: code indent should use tabs where possible 2467: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:392:
+ /* check_fwstate(&padapter->mlmepriv,

			WIFI_UNDER_WPS) == true) */$

ERROR: code indent should use tabs where possible 2468: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:393:
+ rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM,

					null_addr);$
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +6 -6
index 790e3b2454e8..5067c2417351 100644
@@ -385,12 +385,12 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
 	}
 
 	/* TKIP and AES disallow multicast packets until installing group key */
-        if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_
-                || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_
-                || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
-                /* WPS open need to enable multicast */
-                /*  check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */
-                rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);
+	if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_
+		|| padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_
+		|| padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
+		/* WPS open need to enable multicast */
+		/*  check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */
+		rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);
 
 exit:
 
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/5 staging: rtl8723bs: fix logical continuation issue

In reply to Fabio Aiuto

fix the following post-commit hook checkpatch issue:

CHECK: Logical continuations should be on the previous line 52: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389:
+ if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_
+ || padapter->securitypriv.dot11PrivacyAlgrthm

					== _TKIP_WTMIC_

CHECK: Logical continuations should be on the previous line 53: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390:
+ || padapter->securitypriv.dot11PrivacyAlgrthm

					== _TKIP_WTMIC_
+		|| padapter->securitypriv.dot11PrivacyAlgrthm
					== _AES_)
---
 drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +3 -3
index 5067c2417351..733c6b93eb8f 100644
@@ -385,9 +385,9 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
 	}
 
 	/* TKIP and AES disallow multicast packets until installing group key */
-	if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_
-		|| padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_
-		|| padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
+	if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ ||
+		padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ ||
+		padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
 		/* WPS open need to enable multicast */
 		/*  check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */
 		rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/5 staging: rtl8723bs: remove functions notifying wext events

In reply to Fabio Aiuto

remove functions that once were meant to notify wext events to userspace. Now they are donig nothing useful so just remove them.

---
 .../staging/rtl8723bs/core/rtw_ioctl_set.c    |  4 +-
 drivers/staging/rtl8723bs/include/drv_types.h |  3 --
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 38 -------------------
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c |  4 --
 4 files changed, 1 insertion(+), 48 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +1 -3
index 5f25cbf83723..eee250f12df3 100644
@@ -449,10 +449,8 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
 		res = true;
 
 	} else {
-		if (rtw_is_scan_deny(padapter)) {
-			indicate_wx_scan_complete_event(padapter);
+		if (rtw_is_scan_deny(padapter))
 			return _SUCCESS;
-		}
 
 		spin_lock_bh(&pmlmepriv->lock);
 
drivers/staging/rtl8723bs/include/drv_types.h +0 -3
index 580028d28c42..ae32963a156d 100644
@@ -495,9 +495,6 @@ static inline u8 *myid(struct eeprom_priv *peepriv)
 
 #include <rtw_btcoex.h>
 
-void rtw_indicate_wx_disassoc_event(struct adapter *padapter);
-void rtw_indicate_wx_assoc_event(struct adapter *padapter);
-void indicate_wx_scan_complete_event(struct adapter *padapter);
 int rtw_change_ifname(struct adapter *padapter, const char *ifname);
 
 extern char *rtw_initmac;
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0 -38
index 733c6b93eb8f..9d4a233a861e 100644
@@ -29,44 +29,6 @@
 #define WEXT_CSCAN_HOME_DWELL_SECTION	'H'
 #define WEXT_CSCAN_TYPE_SECTION		'T'
 
-void indicate_wx_scan_complete_event(struct adapter *padapter)
-{
-	union iwreq_data wrqu;
-
-	memset(&wrqu, 0, sizeof(union iwreq_data));
-}
-
-
-void rtw_indicate_wx_assoc_event(struct adapter *padapter)
-{
-	union iwreq_data wrqu;
-	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-	struct wlan_bssid_ex		*pnetwork = (struct wlan_bssid_ex *)(&(pmlmeinfo->network));
-
-	memset(&wrqu, 0, sizeof(union iwreq_data));
-
-	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-
-	if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)
-		memcpy(wrqu.ap_addr.sa_data, pnetwork->mac_address, ETH_ALEN);
-	else
-		memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.mac_address, ETH_ALEN);
-
-	netdev_dbg(padapter->pnetdev, "assoc success\n");
-}
-
-void rtw_indicate_wx_disassoc_event(struct adapter *padapter)
-{
-	union iwreq_data wrqu;
-
-	memset(&wrqu, 0, sizeof(union iwreq_data));
-
-	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-	eth_zero_addr(wrqu.ap_addr.sa_data);
-}
-
 static int wpa_set_auth_algs(struct net_device *dev, u32 value)
 {
 	struct adapter *padapter = rtw_netdev_priv(dev);
drivers/staging/rtl8723bs/os_dep/mlme_linux.c +0 -4
index a4560ba22db1..1341801e5c21 100644
@@ -48,7 +48,6 @@ void rtw_os_indicate_connect(struct adapter *adapter)
 		rtw_cfg80211_indicate_connect(adapter);
 	}
 
-	rtw_indicate_wx_assoc_event(adapter);
 	netif_carrier_on(adapter->pnetdev);
 
 	if (adapter->pid[2] != 0)
@@ -58,7 +57,6 @@ void rtw_os_indicate_connect(struct adapter *adapter)
 void rtw_os_indicate_scan_done(struct adapter *padapter, bool aborted)
 {
 	rtw_cfg80211_indicate_scan_done(padapter, aborted);
-	indicate_wx_scan_complete_event(padapter);
 }
 
 static struct rt_pmkid_list   backupPMKIDList[NUM_PMKID_CACHE];
@@ -129,8 +127,6 @@ void rtw_os_indicate_disconnect(struct adapter *adapter)
 
 	rtw_cfg80211_indicate_disconnect(adapter);
 
-	rtw_indicate_wx_disassoc_event(adapter);
-
 	/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
 	rtw_reset_securitypriv_cmd(adapter);
 }
Signature · 1 line
2.20.1
#5 lore raw

PATCH 5/5 staging: rtl8723bs: remove unused rtw_set_802_11_bssid() function

In reply to Fabio Aiuto

remove rtw_set_802_11_bssid() function left unused after wext routines removal.

---
 .../staging/rtl8723bs/core/rtw_ioctl_set.c    | 64 -------------------
 .../staging/rtl8723bs/include/rtw_ioctl_set.h |  1 -
 2 files changed, 65 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +0 -64
index eee250f12df3..5cfde7176617 100644
@@ -134,70 +134,6 @@ u8 rtw_do_join(struct adapter *padapter)
 	return ret;
 }
 
-u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
-{
-	u8 status = _SUCCESS;
-
-	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-
-	netdev_dbg(padapter->pnetdev, "set bssid:%pM\n", bssid);
-
-	if ((bssid[0] == 0x00 && bssid[1] == 0x00 && bssid[2] == 0x00 && bssid[3] == 0x00 && bssid[4] == 0x00 && bssid[5] == 0x00) ||
-	    (bssid[0] == 0xFF && bssid[1] == 0xFF && bssid[2] == 0xFF && bssid[3] == 0xFF && bssid[4] == 0xFF && bssid[5] == 0xFF)) {
-		status = _FAIL;
-		goto exit;
-	}
-
-	spin_lock_bh(&pmlmepriv->lock);
-
-
-	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true)
-		goto handle_tkip_countermeasure;
-	else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
-		goto release_mlme_lock;
-
-	if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
-		if (!memcmp(&pmlmepriv->cur_network.network.mac_address, bssid, ETH_ALEN)) {
-			if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)
-				goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
-		} else {
-			rtw_disassoc_cmd(padapter, 0, true);
-
-			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
-				rtw_indicate_disconnect(padapter);
-
-			rtw_free_assoc_resources(padapter, 1);
-
-			if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
-				_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
-				set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
-			}
-		}
-	}
-
-handle_tkip_countermeasure:
-	if (rtw_handle_tkip_countermeasure(padapter, __func__) == _FAIL) {
-		status = _FAIL;
-		goto release_mlme_lock;
-	}
-
-	memset(&pmlmepriv->assoc_ssid, 0, sizeof(struct ndis_802_11_ssid));
-	memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
-	pmlmepriv->assoc_by_bssid = true;
-
-	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true)
-		pmlmepriv->to_join = true;
-	else
-		status = rtw_do_join(padapter);
-
-release_mlme_lock:
-	spin_unlock_bh(&pmlmepriv->lock);
-
-exit:
-
-	return status;
-}
-
 u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
 {
 	u8 status = _SUCCESS;
drivers/staging/rtl8723bs/include/rtw_ioctl_set.h +0 -1
index 31424bf2d926..ab349de733c8 100644
@@ -11,7 +11,6 @@
 typedef u8 NDIS_802_11_PMKID_VALUE[16];
 
 u8 rtw_set_802_11_authentication_mode(struct adapter *pdapter, enum ndis_802_11_authentication_mode authmode);
-u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid);
 u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep);
 u8 rtw_set_802_11_disassociate(struct adapter *padapter);
 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num);
Signature · 1 line
2.20.1