2021-08-23 14:13:22

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 0/5] 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(-)

--
2.20.1


2021-08-23 14:13:23

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 2/5] staging: rtl8723bs: fix code indent issues

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);$

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 790e3b2454e8..5067c2417351 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -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:

--
2.20.1

2021-08-23 14:13:44

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 3/5] staging: rtl8723bs: fix logical continuation issue

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_)

Signed-off-by: Fabio Aiuto <[email protected]>
---
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 5067c2417351..733c6b93eb8f 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -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);
--
2.20.1

2021-08-23 14:14:19

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 5/5] staging: rtl8723bs: remove unused rtw_set_802_11_bssid() function

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

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../staging/rtl8723bs/core/rtw_ioctl_set.c | 64 -------------------
.../staging/rtl8723bs/include/rtw_ioctl_set.h | 1 -
2 files changed, 65 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index eee250f12df3..5cfde7176617 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -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;
diff --git a/drivers/staging/rtl8723bs/include/rtw_ioctl_set.h b/drivers/staging/rtl8723bs/include/rtw_ioctl_set.h
index 31424bf2d926..ab349de733c8 100644
--- a/drivers/staging/rtl8723bs/include/rtw_ioctl_set.h
+++ b/drivers/staging/rtl8723bs/include/rtw_ioctl_set.h
@@ -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);
--
2.20.1

2021-08-23 14:15:09

by Fabio Aiuto

[permalink] [raw]
Subject: [PATCH 4/5] staging: rtl8723bs: remove functions notifying wext events

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

Signed-off-by: Fabio Aiuto <[email protected]>
---
.../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(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index 5f25cbf83723..eee250f12df3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -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);

diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index 580028d28c42..ae32963a156d 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -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;
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
index 733c6b93eb8f..9d4a233a861e 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
@@ -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);
diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index a4560ba22db1..1341801e5c21 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -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);
}
--
2.20.1