* [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style
@ 2026-02-10 22:15 markatbritain
2026-02-10 22:38 ` Ethan Tidmore
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: markatbritain @ 2026-02-10 22:15 UTC (permalink / raw)
To: gregkh; +Cc: straube.linux, dan.carpenter, linux-staging, linux-kernel,
Mark Wu
From: Mark Wu <markatbritain@gmail.com>
The rtl8723bs driver contains legacy NDIS_802_11 definitions and
typedefs that are not idiomatic to the Linux kernel. This patch
replaces these with standard Linux types and enums where applicable
to improve portability and readability.
These changes bring the driver closer to the standard Linux kernel
coding style and prepare it for eventual promotion out of staging.
Signed-off-by: Mark Wu <markatbritain@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_ap.c | 14 +-
drivers/staging/rtl8723bs/core/rtw_cmd.c | 10 +-
.../staging/rtl8723bs/core/rtw_ioctl_set.c | 27 ++--
drivers/staging/rtl8723bs/core/rtw_mlme.c | 58 ++++----
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 16 +-
drivers/staging/rtl8723bs/core/rtw_recv.c | 2 +-
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 +-
drivers/staging/rtl8723bs/hal/hal_intf.c | 10 +-
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 6 +-
.../staging/rtl8723bs/include/rtw_mlme_ext.h | 2 +-
.../staging/rtl8723bs/include/rtw_security.h | 8 +-
.../staging/rtl8723bs/include/wlan_bssdef.h | 115 +++++++--------
.../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 138 ++++++++++--------
drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 +-
14 files changed, 219 insertions(+), 195 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
index ebe73abab892..94282360bc3e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ap.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
@@ -829,7 +829,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
memcpy(ie, pbuf, pbss_network->ie_length);
- if (pbss_network->infrastructure_mode != Ndis802_11APMode)
+ if (pbss_network->infrastructure_mode != NDIS_802_11_AP_MODE)
return _FAIL;
pbss_network->rssi = 0;
@@ -1063,16 +1063,16 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
switch (network_type) {
case WIRELESS_11B:
- pbss_network->network_type_in_use = Ndis802_11DS;
+ pbss_network->network_type_in_use = NDIS_802_11_DS;
break;
case WIRELESS_11G:
case WIRELESS_11BG:
case WIRELESS_11G_24N:
case WIRELESS_11BG_24N:
- pbss_network->network_type_in_use = Ndis802_11OFDM24;
+ pbss_network->network_type_in_use = NDIS_802_11_FDM24;
break;
default:
- pbss_network->network_type_in_use = Ndis802_11OFDM24;
+ pbss_network->network_type_in_use = NDIS_802_11_FDM24;
break;
}
@@ -1959,7 +1959,7 @@ void rtw_ap_restore_network(struct adapter *padapter)
char chk_alive_list[NUM_STA];
int i;
- rtw_setopmode_cmd(padapter, Ndis802_11APMode, false);
+ rtw_setopmode_cmd(padapter, NDIS_802_11_AP_MODE, false);
set_channel_bwmode(padapter,
pmlmeext->cur_channel,
@@ -2079,8 +2079,8 @@ void stop_ap_mode(struct adapter *padapter)
memset((unsigned char *)&padapter->securitypriv,
0,
sizeof(struct security_priv));
- padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
+ padapter->securitypriv.ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
/* for ACL */
spin_lock_bh(&pacl_node_q->lock);
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index b2e7f479f72b..a7b92d42397e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -697,17 +697,17 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
/* for hidden ap to set fw_state here */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) != true) {
switch (ndis_network_mode) {
- case Ndis802_11IBSS:
+ case NDIS_802_11_IBSS:
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
break;
- case Ndis802_11Infrastructure:
+ case NDIS_802_11_INFRASTRUCTURE:
set_fwstate(pmlmepriv, WIFI_STATION_STATE);
break;
- case Ndis802_11APMode:
- case Ndis802_11AutoUnknown:
- case Ndis802_11InfrastructureMax:
+ case NDIS_802_11_AP_MODE:
+ case NDIS_802_11_AUTO_UNKNOWN:
+ case NDIS_802_11_INFRASTRUCTURE_MAX:
break;
}
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index 587a87fbffeb..e70e6e18eb19 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -292,8 +292,8 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
enum ndis_802_11_network_infrastructure *pold_state = &(cur_network->network.infrastructure_mode);
if (*pold_state != networktype) {
- if (*pold_state == Ndis802_11APMode) {
- /* change to other mode from Ndis802_11APMode */
+ if (*pold_state == NDIS_802_11_AP_MODE) {
+ /* change to other mode from NDIS_802_11_AP_MODE */
cur_network->join_res = -1;
stop_ap_mode(padapter);
@@ -301,16 +301,21 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
spin_lock_bh(&pmlmepriv->lock);
- if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || (*pold_state == Ndis802_11IBSS))
+ if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||
+ (*pold_state == NDIS_802_11_IBSS))
rtw_disassoc_cmd(padapter, 0, true);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||
- (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true))
+ (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true))
rtw_free_assoc_resources(padapter, 1);
- if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
+ if ((*pold_state == NDIS_802_11_INFRASTRUCTURE) ||
+ (*pold_state == NDIS_802_11_IBSS)) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
- rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
+ /* will clr Linked_state; before this function
+ * we must have checked whether issue dis-assoc_cmd or not
+ */
+ rtw_indicate_disconnect(padapter);
}
*pold_state = networktype;
@@ -318,23 +323,23 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
_clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE);
switch (networktype) {
- case Ndis802_11IBSS:
+ case NDIS_802_11_IBSS:
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
break;
- case Ndis802_11Infrastructure:
+ case NDIS_802_11_INFRASTRUCTURE:
set_fwstate(pmlmepriv, WIFI_STATION_STATE);
break;
- case Ndis802_11APMode:
+ case NDIS_802_11_AP_MODE:
set_fwstate(pmlmepriv, WIFI_AP_STATE);
start_ap_mode(padapter);
/* rtw_indicate_connect(padapter); */
break;
- case Ndis802_11AutoUnknown:
- case Ndis802_11InfrastructureMax:
+ case NDIS_802_11_AUTO_UNKNOWN:
+ case NDIS_802_11_INFRASTRUCTURE_MAX:
break;
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 22dc36e8e38a..1cd017d2ebcf 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -51,8 +51,12 @@ int rtw_init_mlme_priv(struct adapter *padapter)
pmlmepriv->pscanned = NULL;
pmlmepriv->fw_state = WIFI_STATION_STATE; /* Must sync with rtw_wdev_alloc() */
- pmlmepriv->cur_network.network.infrastructure_mode = Ndis802_11AutoUnknown;
- pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this varable to "active_mode" (Jeff) */
+ pmlmepriv->cur_network.network.infrastructure_mode = NDIS_802_11_AUTO_UNKNOWN;
+ /*
+ * SCAN_ACTIVE: 1=active, 0=passive. Maybe someday we
+ * should rename this variable to "active_mode" (Jeff).
+ */
+ pmlmepriv->scan_mode = SCAN_ACTIVE;
spin_lock_init(&pmlmepriv->lock);
INIT_LIST_HEAD(&pmlmepriv->free_bss_pool.queue);
@@ -267,7 +271,7 @@ signed int rtw_if_up(struct adapter *padapter)
signed int res;
if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
- !check_fwstate(&padapter->mlmepriv, _FW_LINKED))
+ !check_fwstate(&padapter->mlmepriv, _FW_LINKED))
res = false;
else
res = true;
@@ -336,7 +340,7 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
struct security_priv *psecuritypriv = &adapter->securitypriv;
if ((psecuritypriv->dot11PrivacyAlgrthm != _NO_PRIVACY_) &&
- (pnetwork->network.privacy == 0))
+ (pnetwork->network.privacy == 0))
ret = false;
else if ((psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_) &&
(pnetwork->network.privacy == 1))
@@ -416,7 +420,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
}
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
- struct adapter *padapter, bool update_ie)
+ struct adapter *padapter, bool update_ie)
{
long rssi_ori = dst->rssi;
@@ -465,14 +469,14 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
rtw_bug_check(&pmlmepriv->cur_network.network,
- &pmlmepriv->cur_network.network,
- &pmlmepriv->cur_network.network,
- &pmlmepriv->cur_network.network);
+ &pmlmepriv->cur_network.network,
+ &pmlmepriv->cur_network.network,
+ &pmlmepriv->cur_network.network);
if (check_fwstate(pmlmepriv, _FW_LINKED) && (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true);
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fix_ie),
- pmlmepriv->cur_network.network.ie_length);
+ pmlmepriv->cur_network.network.ie_length);
}
}
@@ -618,10 +622,10 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
u8 *p = NULL;
uint ie_len = 0;
- if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0))
+ if ((desired_encmode == NDIS_802_11_ENCRYPTION_DISABLED) && (privacy != 0))
bselected = false;
- if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
+ if (psecuritypriv->ndisauthtype == NDIS_802_11_AUTH_MODE_WPA_2_PSK) {
p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
if (p && ie_len > 0)
bselected = true;
@@ -630,7 +634,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
}
}
- if ((desired_encmode != Ndis802_11EncryptionDisabled) && (privacy == 0))
+ if ((desired_encmode != NDIS_802_11_ENCRYPTION_DISABLED) && (privacy == 0))
bselected = false;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
@@ -1065,7 +1069,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
/* update fw_state will clr _FW_UNDER_LINKING here indirectly */
switch (pnetwork->network.infrastructure_mode) {
- case Ndis802_11Infrastructure:
+ case NDIS_802_11_INFRASTRUCTURE:
if (pmlmepriv->fw_state & WIFI_UNDER_WPS)
pmlmepriv->fw_state = WIFI_STATION_STATE | WIFI_UNDER_WPS;
@@ -1073,7 +1077,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
pmlmepriv->fw_state = WIFI_STATION_STATE;
break;
- case Ndis802_11IBSS:
+ case NDIS_802_11_IBSS:
pmlmepriv->fw_state = WIFI_ADHOC_STATE;
break;
default:
@@ -1082,7 +1086,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
}
rtw_update_protection(padapter, (cur_network->network.ies) + sizeof(struct ndis_802_11_fix_ie),
- (cur_network->network.ie_length));
+ (cur_network->network.ie_length));
rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config);
}
@@ -1123,8 +1127,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
- adapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
- adapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
+ adapter->securitypriv.ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
+ adapter->securitypriv.ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
} else {
/* reset values in securitypriv */
@@ -1139,8 +1143,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_;
psec_priv->dot118021XGrpKeyid = 1;
- psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
- psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
+ psec_priv->ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
+ psec_priv->ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
/* */
}
/* add for CONFIG_IEEE80211W, none 11w also can use */
@@ -1469,7 +1473,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
}
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
- check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+ check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
rtw_free_stainfo(adapter, psta);
if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
@@ -2023,7 +2027,7 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
for (i = 0; i < NUM_PMKID_CACHE; i++)
if ((p->PMKIDList[i].bUsed) &&
- (!memcmp(p->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
+ (!memcmp(p->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
return i;
return -1;
}
@@ -2099,9 +2103,11 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
/* copy fixed ie only */
memcpy(out_ie, in_ie, 12);
ielength = 12;
- if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK))
+ if ((ndisauthmode == NDIS_802_11_AUTH_MODE_WPA) ||
+ (ndisauthmode == NDIS_802_11_AUTH_MODE_WPA_PSK))
authmode = WLAN_EID_VENDOR_SPECIFIC;
- if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK))
+ if ((ndisauthmode == NDIS_802_11_AUTH_MODE_WPA_2) ||
+ (ndisauthmode == NDIS_802_11_AUTH_MODE_WPA_2_PSK))
authmode = WLAN_EID_RSN;
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
@@ -2154,14 +2160,14 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
switch (pregistrypriv->wireless_mode) {
case WIRELESS_11B:
- pdev_network->network_type_in_use = (Ndis802_11DS);
+ pdev_network->network_type_in_use = (NDIS_802_11_DS);
break;
case WIRELESS_11G:
case WIRELESS_11BG:
case WIRELESS_11_24N:
case WIRELESS_11G_24N:
case WIRELESS_11BG_24N:
- pdev_network->network_type_in_use = (Ndis802_11OFDM24);
+ pdev_network->network_type_in_use = (NDIS_802_11_FDM24);
break;
default:
/* TODO */
@@ -2170,7 +2176,7 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
pdev_network->configuration.ds_config = (pregistrypriv->channel);
- if (cur_network->network.infrastructure_mode == Ndis802_11IBSS)
+ if (cur_network->network.infrastructure_mode == NDIS_802_11_IBSS)
pdev_network->configuration.atim_window = (0);
pdev_network->infrastructure_mode = (cur_network->network.infrastructure_mode);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 78abc5f5191f..847181486a9c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -3969,7 +3969,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str
memcpy(bssid->supported_rates + i, (p + 2), len);
}
- bssid->network_type_in_use = Ndis802_11OFDM24;
+ bssid->network_type_in_use = NDIS_802_11_FDM24;
if (bssid->ie_length < 12)
return _FAIL;
@@ -4001,10 +4001,10 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str
val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);
if (val16 & BIT(0)) {
- bssid->infrastructure_mode = Ndis802_11Infrastructure;
+ bssid->infrastructure_mode = NDIS_802_11_INFRASTRUCTURE;
memcpy(bssid->mac_address, GetAddr2Ptr(pframe), ETH_ALEN);
} else {
- bssid->infrastructure_mode = Ndis802_11IBSS;
+ bssid->infrastructure_mode = NDIS_802_11_IBSS;
memcpy(bssid->mac_address, GetAddr3Ptr(pframe), ETH_ALEN);
}
@@ -5170,15 +5170,15 @@ u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf;
- if (psetop->mode == Ndis802_11APMode) {
+ if (psetop->mode == NDIS_802_11_AP_MODE) {
pmlmeinfo->state = WIFI_FW_AP_STATE;
type = _HW_STATE_AP_;
/* start_ap_mode(padapter); */
- } else if (psetop->mode == Ndis802_11Infrastructure) {
+ } else if (psetop->mode == NDIS_802_11_INFRASTRUCTURE) {
pmlmeinfo->state &= ~(BIT(0) | BIT(1));/* clear state */
pmlmeinfo->state |= WIFI_FW_STATION_STATE;/* set to STATION_STATE */
type = _HW_STATE_STATION_;
- } else if (psetop->mode == Ndis802_11IBSS) {
+ } else if (psetop->mode == NDIS_802_11_IBSS) {
type = _HW_STATE_ADHOC_;
} else {
type = _HW_STATE_NOLINK_;
@@ -5187,7 +5187,7 @@ u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf)
rtw_hal_set_hwreg(padapter, HW_VAR_SET_OPMODE, (u8 *)(&type));
/* set_msr(padapter, type); */
- if (psetop->mode == Ndis802_11APMode) {
+ if (psetop->mode == NDIS_802_11_AP_MODE) {
/* Do this after port switch to */
/* prevent from downloading rsvd page to wrong port */
rtw_btcoex_MediaStatusNotify(padapter, 1); /* connect */
@@ -5210,7 +5210,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
}
/* below is for ad-hoc master */
- if (pparm->network.infrastructure_mode == Ndis802_11IBSS) {
+ if (pparm->network.infrastructure_mode == NDIS_802_11_IBSS) {
rtw_joinbss_reset(padapter);
pmlmeext->cur_bwmode = CHANNEL_WIDTH_20;
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index 337671b1211f..bbd8bd79e1c7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -2196,7 +2196,7 @@ static int recv_func(struct adapter *padapter, union recv_frame *rframe)
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
!is_multicast_ether_addr(prxattrib->ra) && prxattrib->encrypt > 0 &&
(prxattrib->bdecrypted == 0 || psecuritypriv->sw_decrypt == true) &&
- psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK &&
+ psecuritypriv->ndisauthtype == NDIS_802_11_AUTH_MODE_WPA_PSK &&
!psecuritypriv->busetkipkey) {
rtw_enqueue_recvframe(rframe, &padapter->recvpriv.uc_swdec_pending_queue);
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index bdd4b6d8fd2e..2fc966ac5d3f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -491,7 +491,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
u32 rtw_init_bcmc_stainfo(struct adapter *padapter)
{
struct sta_info *psta;
- NDIS_802_11_MAC_ADDRESS bcast_addr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+ u8 bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
struct sta_priv *pstapriv = &padapter->stapriv;
/* struct __queue *pstapending = &padapter->xmitpriv.bm_pending; */
diff --git a/drivers/staging/rtl8723bs/hal/hal_intf.c b/drivers/staging/rtl8723bs/hal/hal_intf.c
index 27c0c0198714..3c3949a92b5d 100644
--- a/drivers/staging/rtl8723bs/hal/hal_intf.c
+++ b/drivers/staging/rtl8723bs/hal/hal_intf.c
@@ -40,22 +40,22 @@ void rtw_hal_dm_init(struct adapter *padapter)
static void rtw_hal_init_opmode(struct adapter *padapter)
{
- enum ndis_802_11_network_infrastructure networkType = Ndis802_11InfrastructureMax;
+ enum ndis_802_11_network_infrastructure network_type = NDIS_802_11_INFRASTRUCTURE_MAX;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
signed int fw_state;
fw_state = get_fwstate(pmlmepriv);
if (fw_state & WIFI_ADHOC_STATE)
- networkType = Ndis802_11IBSS;
+ network_type = NDIS_802_11_IBSS;
else if (fw_state & WIFI_STATION_STATE)
- networkType = Ndis802_11Infrastructure;
+ network_type = NDIS_802_11_INFRASTRUCTURE;
else if (fw_state & WIFI_AP_STATE)
- networkType = Ndis802_11APMode;
+ network_type = NDIS_802_11_AP_MODE;
else
return;
- rtw_setopmode_cmd(padapter, networkType, false);
+ rtw_setopmode_cmd(padapter, network_type, false);
}
uint rtw_hal_init(struct adapter *padapter)
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
index af6cdda8238d..23e4d2d82dbd 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c
@@ -245,19 +245,19 @@ static void ConstructNullFunctionData(
SetPwrMgt(fctrl);
switch (cur_network->network.infrastructure_mode) {
- case Ndis802_11Infrastructure:
+ case NDIS_802_11_INFRASTRUCTURE:
SetToDs(fctrl);
ether_addr_copy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)));
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
ether_addr_copy(pwlanhdr->addr3, StaAddr);
break;
- case Ndis802_11APMode:
+ case NDIS_802_11_AP_MODE:
SetFrDs(fctrl);
ether_addr_copy(pwlanhdr->addr1, StaAddr);
ether_addr_copy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)));
ether_addr_copy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)));
break;
- case Ndis802_11IBSS:
+ case NDIS_802_11_IBSS:
default:
ether_addr_copy(pwlanhdr->addr1, StaAddr);
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index afa5631a441a..77b50e72b065 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -253,7 +253,7 @@ struct FW_Sta_Info {
u32 status;
u32 rx_pkt;
u32 retry;
- NDIS_802_11_RATES_EX SupportedRates;
+ u8 SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
};
/*
diff --git a/drivers/staging/rtl8723bs/include/rtw_security.h b/drivers/staging/rtl8723bs/include/rtw_security.h
index 32f6d3a5e309..ade18f7fa6bf 100644
--- a/drivers/staging/rtl8723bs/include/rtw_security.h
+++ b/drivers/staging/rtl8723bs/include/rtw_security.h
@@ -35,12 +35,12 @@ enum {
};
-#ifndef Ndis802_11AuthModeWPA2
-#define Ndis802_11AuthModeWPA2 (Ndis802_11AuthModeWPANone + 1)
+#ifndef NDIS_802_11_AUTH_MODE_WPA_2
+#define NDIS_802_11_AUTH_MODE_WPA_2 (NDIS_802_11_AUTH_MODE_WPA_NONE + 1)
#endif
-#ifndef Ndis802_11AuthModeWPA2PSK
-#define Ndis802_11AuthModeWPA2PSK (Ndis802_11AuthModeWPANone + 2)
+#ifndef NDIS_802_11_AUTH_MODE_WPA_2_PSK
+#define NDIS_802_11_AUTH_MODE_WPA_2_PSK (NDIS_802_11_AUTH_MODE_WPA_NONE + 2)
#endif
union pn48 {
diff --git a/drivers/staging/rtl8723bs/include/wlan_bssdef.h b/drivers/staging/rtl8723bs/include/wlan_bssdef.h
index eb38594c8f5c..a8c596d20039 100644
--- a/drivers/staging/rtl8723bs/include/wlan_bssdef.h
+++ b/drivers/staging/rtl8723bs/include/wlan_bssdef.h
@@ -7,17 +7,12 @@
#ifndef __WLAN_BSSDEF_H__
#define __WLAN_BSSDEF_H__
-
#define MAX_IE_SZ 768
-
#define NDIS_802_11_LENGTH_SSID 32
#define NDIS_802_11_LENGTH_RATES 8
#define NDIS_802_11_LENGTH_RATES_EX 16
-
-typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
-typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */
-typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */
+#define ETH_ALEN 6
struct ndis_802_11_ssid {
u32 ssid_length;
@@ -25,30 +20,30 @@ struct ndis_802_11_ssid {
};
enum ndis_802_11_network_type {
- Ndis802_11FH,
- Ndis802_11DS,
- Ndis802_11OFDM5,
- Ndis802_11OFDM24,
- Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound */
+ NDIS_802_11_FH,
+ NDIS_802_11_DS,
+ NDIS_802_11_FDM5,
+ NDIS_802_11_FDM24,
+ NDIS_802_11_NETWORK_TYPE_MAX /* not a real type, defined as an upper bound */
};
/*
- FW will only save the channel number in DSConfig.
- ODI Handler will convert the channel number to freq. number.
-*/
+ * FW will only save the channel number in DSConfig.
+ * ODI Handler will convert the channel number to freq. number.
+ */
struct ndis_802_11_conf {
- u32 length; /* Length of structure */
+ u32 length; /* Length of structure */
u32 beacon_period; /* units are Kusec */
u32 atim_window; /* units are Kusec */
u32 ds_config; /* Frequency, units are kHz */
};
enum ndis_802_11_network_infrastructure {
- Ndis802_11IBSS,
- Ndis802_11Infrastructure,
- Ndis802_11AutoUnknown,
- Ndis802_11InfrastructureMax, /* Not a real value, defined as upper bound */
- Ndis802_11APMode,
+ NDIS_802_11_IBSS,
+ NDIS_802_11_INFRASTRUCTURE,
+ NDIS_802_11_AUTO_UNKNOWN,
+ NDIS_802_11_INFRASTRUCTURE_MAX, /* Not a real value, defined as upper bound */
+ NDIS_802_11_AP_MODE,
};
struct ndis_802_11_fix_ie {
@@ -63,40 +58,39 @@ struct ndis_80211_var_ie {
u8 data[];
};
-/* Length is the 4 bytes multiples of the sum of
- * sizeof (NDIS_802_11_MAC_ADDRESS) + 2 +
- * sizeof (struct ndis_802_11_ssid) + sizeof (u32) +
- * sizeof (long) + sizeof (enum ndis_802_11_network_type) +
- * sizeof (struct ndis_802_11_conf) + sizeof (NDIS_802_11_RATES_EX) + ie_length
+/* Length is the 4-byte multiple of the sum of:
+ * ETH_ALEN + 2 + sizeof(struct ndis_802_11_ssid) + sizeof(u32) +
+ * sizeof(long) + sizeof(enum ndis_802_11_network_type) +
+ * sizeof(struct ndis_802_11_conf) + NDIS_802_11_LENGTH_RATES_EX + ie_length
*
* Except for ie_length, all other fields are fixed length. Therefore, we can
- * define a macro to present the partial sum.
+ * define a macro to represent the partial sum.
*/
enum ndis_802_11_authentication_mode {
- Ndis802_11AuthModeOpen,
- Ndis802_11AuthModeShared,
- Ndis802_11AuthModeAutoSwitch,
- Ndis802_11AuthModeWPA,
- Ndis802_11AuthModeWPAPSK,
- Ndis802_11AuthModeWPANone,
- Ndis802_11AuthModeWAPI,
- Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
+ NDIS_802_11_AUTH_MODE_OPEN,
+ NDIS_802_11_AUTH_MODE_SHARED,
+ NDIS_802_11_AUTH_MODE_AUTO_SWITCH,
+ NDIS_802_11_AUTH_MODE_WPA,
+ NDIS_802_11_AUTH_MODE_WPA_PSK,
+ NDIS_802_11_AUTH_MODE_WPA_NONE,
+ NDIS_802_11_AUTH_MODE_W_A_P_I,
+ NDIS_802_11_AUTH_MODE_MAX /* Not a real mode, defined as upper bound */
};
enum {
- Ndis802_11WEPEnabled,
- Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
- Ndis802_11WEPDisabled,
- Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
- Ndis802_11WEPKeyAbsent,
- Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
- Ndis802_11WEPNotSupported,
- Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
- Ndis802_11Encryption2Enabled,
- Ndis802_11Encryption2KeyAbsent,
- Ndis802_11Encryption3Enabled,
- Ndis802_11Encryption3KeyAbsent,
- Ndis802_11_EncrypteionWAPI
+ NDIS_802_11_WEP_ENABLED,
+ NDIS_802_11_ENCRYPTION_ENABLED = NDIS_802_11_WEP_ENABLED,
+ NDIS_802_11_WEP_DISABLED,
+ NDIS_802_11_ENCRYPTION_DISABLED = NDIS_802_11_WEP_DISABLED,
+ NDIS_802_11_WEP_KEY_ABSENT,
+ NDIS_802_11_ENCRYPTION_1_KEY_ABSENT = NDIS_802_11_WEP_KEY_ABSENT,
+ NDIS_802_11_WEP_NOT_SUPPORTED,
+ NDIS_802_11_ENCRYPTION_NOT_SUPPORTED = NDIS_802_11_WEP_NOT_SUPPORTED,
+ NDIS_802_11_ENCRYPTION_2_ENABLED,
+ NDIS_802_11_ENCRYPTION_2_KEY_ABSENT,
+ NDIS_802_11_ENCRYPTION_3_ENABLED,
+ NDIS_802_11_ENCRYPTION_3_KEY_ABSENT,
+ NDIS_802_11_ENCRYPTION_W_A_P_I
};
#define NDIS_802_11_AI_REQFI_CAPABILITIES 1
@@ -110,7 +104,7 @@ enum {
/* Key mapping keys require a BSSID */
struct ndis_802_11_wep {
- u32 length; /* Length of this structure */
+ u32 length; /* Length of this structure */
u32 key_index; /* 0 is the per-client key, 1-N are the global keys */
u32 key_length; /* length of key in bytes */
u8 key_material[16];/* variable length depending on above field */
@@ -126,21 +120,22 @@ struct ndis_802_11_wep {
/* MIC check time, 60 seconds. */
#define MIC_CHECK_TIME 60000000
-#ifndef Ndis802_11APMode
-#define Ndis802_11APMode (Ndis802_11InfrastructureMax + 1)
+#ifndef NDIS_802_11_AP_MODE
+#define NDIS_802_11_AP_MODE (NDIS_802_11_INFRASTRUCTURE_MAX + 1)
#endif
struct wlan_phy_info {
- u8 signal_strength;/* in percentage) */
- u8 signal_quality;/* in percentage) */
+ u8 signal_strength; /* in percentage) */
+ u8 signal_quality; /* in percentage) */
u8 optimum_antenna; /* for Antenna diversity */
u8 reserved_0;
};
struct wlan_bcn_info {
/* these infor get from rtw_get_encrypt_info when
- * * translate scan to UI */
- u8 encryp_protocol;/* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2/WAPI */
+ * translate scan to UI
+ */
+ u8 encryp_protocol; /* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2/WAPI */
int group_cipher; /* WPA/WPA2 group cipher */
int pairwise_cipher;/* WPA/WPA2/WEP pairwise cipher */
int is_8021x;
@@ -151,19 +146,19 @@ struct wlan_bcn_info {
};
/* temporally add #pragma pack for structure alignment issue of
-* struct wlan_bssid_ex and get_wlan_bssid_ex_sz()
-*/
+ * struct wlan_bssid_ex and get_wlan_bssid_ex_sz()
+ */
struct wlan_bssid_ex {
u32 length;
- NDIS_802_11_MAC_ADDRESS mac_address;
- u8 reserved[2];/* 0]: IS beacon frame */
+ u8 mac_address[ETH_ALEN];
+ u8 reserved[2]; /* 0]: IS beacon frame */
struct ndis_802_11_ssid ssid;
u32 privacy;
- long rssi;/* in dBM, raw data , get from PHY) */
+ long rssi; /* in dBM, raw data , get from PHY) */
enum ndis_802_11_network_type network_type_in_use;
struct ndis_802_11_conf configuration;
enum ndis_802_11_network_infrastructure infrastructure_mode;
- NDIS_802_11_RATES_EX supported_rates;
+ u8 supported_rates[NDIS_802_11_LENGTH_RATES_EX];
struct wlan_phy_info phy_info;
u32 ie_length;
u8 ies[MAX_IE_SZ]; /* timestamp, beacon interval, and capability information) */
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index a47d0d3fa2b7..55570b1eb26c 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -380,9 +380,10 @@ void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter)
rtw_warn_on(1);
return;
}
- if (!memcmp(&(scanned->network.ssid), &(pnetwork->ssid), sizeof(struct ndis_802_11_ssid))
- && !memcmp(scanned->network.mac_address, pnetwork->mac_address, sizeof(NDIS_802_11_MAC_ADDRESS))
- )
+
+ if (!memcmp(&scanned->network.ssid, &pnetwork->ssid,
+ sizeof(struct ndis_802_11_ssid)) &&
+ !memcmp(scanned->network.mac_address, pnetwork->mac_address, ETH_ALEN))
rtw_cfg80211_inform_bss(padapter, scanned);
else
rtw_warn_on(1);
@@ -422,7 +423,7 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter)
goto check_bss;
}
- if (!memcmp(scanned->network.mac_address, pnetwork->mac_address, sizeof(NDIS_802_11_MAC_ADDRESS))
+ if (!memcmp(scanned->network.mac_address, pnetwork->mac_address, ETH_ALEN)
&& !memcmp(&(scanned->network.ssid), &(pnetwork->ssid), sizeof(struct ndis_802_11_ssid))
)
rtw_cfg80211_inform_bss(padapter, scanned);
@@ -547,7 +548,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
/* wep default key has not been set, so use this key index as default key. */
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
- psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
@@ -743,7 +744,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
wep_key_len = wep_key_len <= 5 ? 5 : 13;
- psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
@@ -775,15 +776,19 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
if (strcmp(param->u.crypt.alg, "none") != 0)
psta->ieee8021x_blocked = false;
- if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) ||
- (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) {
+ if ((padapter->securitypriv.ndisencryptstatus ==
+ NDIS_802_11_ENCRYPTION_2_ENABLED) ||
+ (padapter->securitypriv.ndisencryptstatus ==
+ NDIS_802_11_ENCRYPTION_3_ENABLED)) {
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
}
if (param->u.crypt.set_tx == 1) { /* pairwise key */
+ struct ieee_crypt_arg *crypt = ¶m->u.crypt;
+ u32 len = min(crypt->key_len, 16U);
- memcpy(psta->dot118021x_UncstKey.skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len));
-
+ memcpy(psta->dot118021x_UncstKey.skey,
+ crypt->key, len);
if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */
memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8);
memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8);
@@ -794,19 +799,30 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
rtw_setstakey_cmd(padapter, psta, true, true);
} else { /* group key */
- if (strcmp(param->u.crypt.alg, "TKIP") == 0 || strcmp(param->u.crypt.alg, "CCMP") == 0) {
- memcpy(padapter->securitypriv.dot118021XGrpKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len));
- memcpy(padapter->securitypriv.dot118021XGrptxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[16]), 8);
- memcpy(padapter->securitypriv.dot118021XGrprxmickey[param->u.crypt.idx].skey, &(param->u.crypt.key[24]), 8);
- padapter->securitypriv.binstallGrpkey = true;
-
- padapter->securitypriv.dot118021XGrpKeyid = param->u.crypt.idx;
- rtw_set_key(padapter, &padapter->securitypriv, param->u.crypt.idx, 1, true);
- } else if (strcmp(param->u.crypt.alg, "BIP") == 0) {
+ struct security_priv *psec = &padapter->securitypriv;
+ struct ieee_crypt_arg *crypt = ¶m->u.crypt;
+ u32 len = min(crypt->key_len, 16U);
+
+ if (strcmp(crypt->alg, "TKIP") == 0 ||
+ strcmp(crypt->alg, "CCMP") == 0) {
+ memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
+ crypt->key, len);
+
+ memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
+ &crypt->key[16], 8);
+
+ memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
+ &crypt->key[24], 8);
+
+ psec->binstallGrpkey = true;
+ psec->dot118021XGrpKeyid = crypt->idx;
+ rtw_set_key(padapter, psec, crypt->idx, 1, true);
+ } else if (strcmp(crypt->alg, "BIP") == 0) {
/* save the IGTK key, length 16 bytes */
- memcpy(padapter->securitypriv.dot11wBIPKey[param->u.crypt.idx].skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len));
- padapter->securitypriv.dot11wBIPKeyid = param->u.crypt.idx;
- padapter->securitypriv.binstallBIPkey = true;
+ memcpy(psec->dot11wBIPKey[crypt->idx].skey,
+ crypt->key, len);
+ psec->dot11wBIPKeyid = crypt->idx;
+ psec->binstallBIPkey = true;
}
}
}
@@ -817,8 +833,10 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
if (strcmp(param->u.crypt.alg, "none") != 0)
pbcmc_sta->ieee8021x_blocked = false;
- if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) ||
- (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) {
+ if ((padapter->securitypriv.ndisencryptstatus ==
+ NDIS_802_11_ENCRYPTION_2_ENABLED) ||
+ (padapter->securitypriv.ndisencryptstatus ==
+ NDIS_802_11_ENCRYPTION_3_ENABLED)) {
pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
}
}
@@ -942,7 +960,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
struct security_priv *psecuritypriv = &padapter->securitypriv;
if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) { /* set wep default key */
- psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
psecuritypriv->dot11PrivacyKeyIndex = key_index;
@@ -1025,7 +1043,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
struct vif_params *params)
{
enum nl80211_iftype old_type;
- enum ndis_802_11_network_infrastructure networkType;
+ enum ndis_802_11_network_infrastructure network_type;
struct adapter *padapter = rtw_netdev_priv(ndev);
struct wireless_dev *rtw_wdev = padapter->rtw_wdev;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
@@ -1057,13 +1075,13 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
switch (type) {
case NL80211_IFTYPE_ADHOC:
- networkType = Ndis802_11IBSS;
+ network_type = NDIS_802_11_IBSS;
break;
case NL80211_IFTYPE_STATION:
- networkType = Ndis802_11Infrastructure;
+ network_type = NDIS_802_11_INFRASTRUCTURE;
break;
case NL80211_IFTYPE_AP:
- networkType = Ndis802_11APMode;
+ network_type = NDIS_802_11_AP_MODE;
break;
default:
ret = -EOPNOTSUPP;
@@ -1072,13 +1090,13 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
rtw_wdev->iftype = type;
- if (rtw_set_802_11_infrastructure_mode(padapter, networkType) == false) {
+ if (rtw_set_802_11_infrastructure_mode(padapter, network_type) == false) {
rtw_wdev->iftype = old_type;
ret = -EPERM;
goto exit;
}
- rtw_setopmode_cmd(padapter, networkType, true);
+ rtw_setopmode_cmd(padapter, network_type, true);
exit:
@@ -1307,12 +1325,12 @@ static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, int radio_idx,
static int rtw_cfg80211_set_wpa_version(struct security_priv *psecuritypriv, u32 wpa_version)
{
if (!wpa_version) {
- psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
+ psecuritypriv->ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
return 0;
}
if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2))
- psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK;
+ psecuritypriv->ndisauthtype = NDIS_802_11_AUTH_MODE_WPA_PSK;
return 0;
}
@@ -1330,7 +1348,7 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
- if (psecuritypriv->ndisauthtype > Ndis802_11AuthModeWPA)
+ if (psecuritypriv->ndisauthtype > NDIS_802_11_AUTH_MODE_WPA)
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
break;
@@ -1338,7 +1356,7 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
- psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
default:
@@ -1351,7 +1369,7 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast)
{
- u32 ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ u32 ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
u32 *profile_cipher = ucast ? &psecuritypriv->dot11PrivacyAlgrthm :
&psecuritypriv->dot118021XGrpPrivacy;
@@ -1365,23 +1383,23 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
switch (cipher) {
case IW_AUTH_CIPHER_NONE:
*profile_cipher = _NO_PRIVACY_;
- ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
break;
case WLAN_CIPHER_SUITE_WEP40:
*profile_cipher = _WEP40_;
- ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
case WLAN_CIPHER_SUITE_WEP104:
*profile_cipher = _WEP104_;
- ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
case WLAN_CIPHER_SUITE_TKIP:
*profile_cipher = _TKIP_;
- ndisencryptstatus = Ndis802_11Encryption2Enabled;
+ ndisencryptstatus = NDIS_802_11_ENCRYPTION_2_ENABLED;
break;
case WLAN_CIPHER_SUITE_CCMP:
*profile_cipher = _AES_;
- ndisencryptstatus = Ndis802_11Encryption3Enabled;
+ ndisencryptstatus = NDIS_802_11_ENCRYPTION_3_ENABLED;
break;
default:
return -ENOTSUPP;
@@ -1391,7 +1409,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
psecuritypriv->ndisencryptstatus = ndisencryptstatus;
/* if (psecuritypriv->dot11PrivacyAlgrthm >= _AES_) */
- /* psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPA2PSK; */
+ /* psecuritypriv->ndisauthtype = NDIS_802_11_AUTH_MODE_WPA_2_PSK; */
}
return 0;
@@ -1447,7 +1465,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
if (pwpa && wpa_ielen > 0) {
if (rtw_parse_wpa_ie(pwpa, wpa_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
- padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK;
+ padapter->securitypriv.ndisauthtype = NDIS_802_11_AUTH_MODE_WPA_PSK;
memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen + 2);
}
}
@@ -1456,7 +1474,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
if (pwpa2 && wpa2_ielen > 0) {
if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
- padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK;
+ padapter->securitypriv.ndisauthtype = NDIS_802_11_AUTH_MODE_WPA_2_PSK;
memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen + 2);
}
}
@@ -1470,46 +1488,46 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
switch (group_cipher) {
case WPA_CIPHER_NONE:
padapter->securitypriv.dot118021XGrpPrivacy = _NO_PRIVACY_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
break;
case WPA_CIPHER_WEP40:
padapter->securitypriv.dot118021XGrpPrivacy = _WEP40_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
case WPA_CIPHER_TKIP:
padapter->securitypriv.dot118021XGrpPrivacy = _TKIP_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_2_ENABLED;
break;
case WPA_CIPHER_CCMP:
padapter->securitypriv.dot118021XGrpPrivacy = _AES_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_3_ENABLED;
break;
case WPA_CIPHER_WEP104:
padapter->securitypriv.dot118021XGrpPrivacy = _WEP104_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
}
switch (pairwise_cipher) {
case WPA_CIPHER_NONE:
padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
break;
case WPA_CIPHER_WEP40:
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
case WPA_CIPHER_TKIP:
padapter->securitypriv.dot11PrivacyAlgrthm = _TKIP_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_2_ENABLED;
break;
case WPA_CIPHER_CCMP:
padapter->securitypriv.dot11PrivacyAlgrthm = _AES_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_3_ENABLED;
break;
case WPA_CIPHER_WEP104:
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_;
- padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
+ padapter->securitypriv.ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
break;
}
@@ -1575,11 +1593,11 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
ndis_ssid.ssid_length = params->ssid_len;
memcpy(ndis_ssid.ssid, (u8 *)params->ssid, params->ssid_len);
- psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
- psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
+ psecuritypriv->ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
ret = rtw_cfg80211_set_auth_type(psecuritypriv, NL80211_AUTHTYPE_OPEN_SYSTEM);
rtw_set_802_11_authentication_mode(padapter, psecuritypriv->ndisauthtype);
@@ -1610,12 +1628,12 @@ static int cfg80211_rtw_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
rtw_wdev->iftype = NL80211_IFTYPE_STATION;
- if (rtw_set_802_11_infrastructure_mode(padapter, Ndis802_11Infrastructure) == false) {
+ if (!rtw_set_802_11_infrastructure_mode(padapter, NDIS_802_11_INFRASTRUCTURE)) {
rtw_wdev->iftype = old_type;
ret = -EPERM;
goto leave_ibss;
}
- rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure, true);
+ rtw_setopmode_cmd(padapter, NDIS_802_11_INFRASTRUCTURE, true);
}
leave_ibss:
@@ -1671,11 +1689,11 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true)
rtw_scan_abort(padapter);
- psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_DISABLED;
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
- psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
+ psecuritypriv->ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
ret = rtw_cfg80211_set_wpa_version(psecuritypriv, sme->crypto.wpa_versions);
if (ret < 0)
diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
index 21a0c3cf4c31..7a2f1c82cac3 100644
--- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c
@@ -19,7 +19,7 @@ static int rtw_rfintfs = HWPI;
static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
-static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
+static int rtw_network_mode = NDIS_802_11_IBSS;/* 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_11BG_24N;
@@ -542,8 +542,8 @@ static void rtw_init_default_value(struct adapter *padapter)
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
psecuritypriv->dot118021XGrpKeyid = 1;
- psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
- psecuritypriv->ndisencryptstatus = Ndis802_11WEPDisabled;
+ psecuritypriv->ndisauthtype = NDIS_802_11_AUTH_MODE_OPEN;
+ psecuritypriv->ndisencryptstatus = NDIS_802_11_WEP_DISABLED;
/* registry_priv */
rtw_init_registrypriv_dev_network(padapter);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style
2026-02-10 22:15 [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style markatbritain
@ 2026-02-10 22:38 ` Ethan Tidmore
2026-02-11 2:26 ` kernel test robot
2026-02-11 5:04 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: Ethan Tidmore @ 2026-02-10 22:38 UTC (permalink / raw)
To: markatbritain, gregkh
Cc: straube.linux, dan.carpenter, linux-staging, linux-kernel
On Tue Feb 10, 2026 at 4:15 PM CST, markatbritain wrote:
> From: Mark Wu <markatbritain@gmail.com>
>
> The rtl8723bs driver contains legacy NDIS_802_11 definitions and
> typedefs that are not idiomatic to the Linux kernel. This patch
> replaces these with standard Linux types and enums where applicable
> to improve portability and readability.
>
> These changes bring the driver closer to the standard Linux kernel
> coding style and prepare it for eventual promotion out of staging.
>
> Signed-off-by: Mark Wu <markatbritain@gmail.com>
Please split this up into a patch series. One logical change per patch.
For instance group the style fixes by their checkpatch.pl warnings.
Thanks,
ET
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style
2026-02-10 22:15 [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style markatbritain
2026-02-10 22:38 ` Ethan Tidmore
@ 2026-02-11 2:26 ` kernel test robot
2026-02-11 5:04 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-02-11 2:26 UTC (permalink / raw)
To: markatbritain, gregkh
Cc: oe-kbuild-all, straube.linux, dan.carpenter, linux-staging,
linux-kernel, Mark Wu
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/markatbritain-gmail-com/staging-rtl8723bs-remove-NDIS_802_11-types-and-cleanup-style/20260211-062107
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20260210221556.73872-1-markatbritain%40gmail.com
patch subject: [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style
config: um-randconfig-r073-20260211 (https://download.01.org/0day-ci/archive/20260211/202602111040.PumsMipt-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch version: v0.5.0-8994-gd50c5a4c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260211/202602111040.PumsMipt-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602111040.PumsMipt-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c: In function 'rtw_cfg80211_set_encryption':
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:787:72: error: initialization of 'struct ieee_crypt_arg *' from incompatible pointer type 'struct <anonymous> *' [-Wincompatible-pointer-types]
787 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
In file included from include/linux/kernel.h:28,
from include/linux/skbuff.h:13,
from include/linux/if_ether.h:19,
from include/linux/etherdevice.h:20,
from drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:8:
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:788:60: error: invalid use of undefined type 'struct ieee_crypt_arg'
788 | u32 len = min(crypt->key_len, 16U);
| ^~
include/linux/minmax.h:92:20: note: in definition of macro '__careful_cmp_once'
92 | auto ux = (x); auto uy = (y); \
| ^
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:788:51: note: in expansion of macro 'min'
788 | u32 len = min(crypt->key_len, 16U);
| ^~~
In file included from <command-line>:
include/linux/compiler.h:168:17: error: '__UNIQUE_ID_x__656' undeclared (first use in this function); did you mean '__UNIQUE_ID_y__657'?
168 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~~~~~~
include/linux/compiler_types.h:610:23: note: in definition of macro '__compiletime_assert'
610 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:630:9: note: in expansion of macro '_compiletime_assert'
630 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:49:25: note: in expansion of macro 'is_signed_type'
49 | #define __sign_use(ux) (is_signed_type(typeof(ux)) ? \
| ^~~~~~~~~~~~~~
include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
75 | (__sign_use(ux) & __sign_use(uy))
| ^~~~~~~~~~
include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~
include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:16:23: note: in expansion of macro '___PASTE'
16 | #define __PASTE(a, b) ___PASTE(a, b)
| ^~~~~~~~
include/linux/compiler.h:168:9: note: in expansion of macro '__PASTE'
168 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~
include/linux/minmax.h:98:38: note: in expansion of macro '__UNIQUE_ID'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:788:51: note: in expansion of macro 'min'
788 | u32 len = min(crypt->key_len, 16U);
| ^~~
include/linux/compiler.h:168:17: note: each undeclared identifier is reported only once for each function it appears in
168 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~~~~~~
include/linux/compiler_types.h:610:23: note: in definition of macro '__compiletime_assert'
610 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:630:9: note: in expansion of macro '_compiletime_assert'
630 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:49:25: note: in expansion of macro 'is_signed_type'
49 | #define __sign_use(ux) (is_signed_type(typeof(ux)) ? \
| ^~~~~~~~~~~~~~
include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
75 | (__sign_use(ux) & __sign_use(uy))
| ^~~~~~~~~~
include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~
include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:16:23: note: in expansion of macro '___PASTE'
16 | #define __PASTE(a, b) ___PASTE(a, b)
| ^~~~~~~~
include/linux/compiler.h:168:9: note: in expansion of macro '__PASTE'
168 | __PASTE(__UNIQUE_ID_, \
| ^~~~~~~
include/linux/minmax.h:98:38: note: in expansion of macro '__UNIQUE_ID'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:788:51: note: in expansion of macro 'min'
788 | u32 len = min(crypt->key_len, 16U);
| ^~~
include/linux/minmax.h:71:17: error: first argument to '__builtin_choose_expr' not a constant
71 | (typeof(__builtin_choose_expr(sizeof(ux) > 4, 1LL, 1L)))(ux) >= 0)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:610:23: note: in definition of macro '__compiletime_assert'
--
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:93:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~~~~~~~
include/linux/minmax.h:70:25: note: in expansion of macro 'statically_true'
70 | #define __is_nonneg(ux) statically_true( \
| ^~~~~~~~~~~~~~~
include/linux/minmax.h:50:14: note: in expansion of macro '__is_nonneg'
50 | (2 + __is_nonneg(ux)) : (1 + 2 * (sizeof(ux) < 4)))
| ^~~~~~~~~~~
include/linux/minmax.h:75:10: note: in expansion of macro '__sign_use'
75 | (__sign_use(ux) & __sign_use(uy))
| ^~~~~~~~~~
include/linux/minmax.h:93:27: note: in expansion of macro '__types_ok'
93 | BUILD_BUG_ON_MSG(!__types_ok(ux, uy), \
| ^~~~~~~~~~
include/linux/minmax.h:98:9: note: in expansion of macro '__careful_cmp_once'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^~~~~~~~~~~~~~~~~~
include/linux/minmax.h:105:25: note: in expansion of macro '__careful_cmp'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:804:51: note: in expansion of macro 'min'
804 | u32 len = min(crypt->key_len, 16U);
| ^~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:806:57: error: invalid use of undefined type 'struct ieee_crypt_arg'
806 | if (strcmp(crypt->alg, "TKIP") == 0 ||
| ^~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:807:57: error: invalid use of undefined type 'struct ieee_crypt_arg'
807 | strcmp(crypt->alg, "CCMP") == 0) {
| ^~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:84: error: invalid use of undefined type 'struct ieee_crypt_arg'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:628:34: note: in definition of macro '__fortify_memcpy_chk'
628 | const size_t __p_size = (p_size); \
| ^~~~~~
include/linux/fortify-string.h:691:17: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:49: note: in expansion of macro 'memcpy'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:809:61: error: invalid use of undefined type 'struct ieee_crypt_arg'
809 | crypt->key, len);
| ^~
include/linux/fortify-string.h:629:34: note: in definition of macro '__fortify_memcpy_chk'
629 | const size_t __q_size = (q_size); \
| ^~~~~~
include/linux/fortify-string.h:691:35: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:49: note: in expansion of macro 'memcpy'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:84: error: invalid use of undefined type 'struct ieee_crypt_arg'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:630:40: note: in definition of macro '__fortify_memcpy_chk'
630 | const size_t __p_size_field = (p_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:17: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:49: note: in expansion of macro 'memcpy'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:809:61: error: invalid use of undefined type 'struct ieee_crypt_arg'
809 | crypt->key, len);
| ^~
include/linux/fortify-string.h:631:40: note: in definition of macro '__fortify_memcpy_chk'
631 | const size_t __q_size_field = (q_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:35: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:49: note: in expansion of macro 'memcpy'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:84: error: invalid use of undefined type 'struct ieee_crypt_arg'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:645:27: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:49: note: in expansion of macro 'memcpy'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:809:61: error: invalid use of undefined type 'struct ieee_crypt_arg'
809 | crypt->key, len);
| ^~
include/linux/fortify-string.h:645:30: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:49: note: in expansion of macro 'memcpy'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ^~~~~~
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:62: error: 'struct security_priv' has no member named 'dot18021XGrptxmickey'; did you mean 'dot118021XGrptxmickey'?
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:628:34: note: in definition of macro '__fortify_memcpy_chk'
628 | const size_t __p_size = (p_size); \
| ^~~~~~
include/linux/fortify-string.h:691:17: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:88: error: invalid use of undefined type 'struct ieee_crypt_arg'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:628:34: note: in definition of macro '__fortify_memcpy_chk'
628 | const size_t __p_size = (p_size); \
| ^~~~~~
include/linux/fortify-string.h:691:17: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:812:62: error: invalid use of undefined type 'struct ieee_crypt_arg'
812 | &crypt->key[16], 8);
| ^~
include/linux/fortify-string.h:629:34: note: in definition of macro '__fortify_memcpy_chk'
629 | const size_t __q_size = (q_size); \
| ^~~~~~
include/linux/fortify-string.h:691:35: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:62: error: 'struct security_priv' has no member named 'dot18021XGrptxmickey'; did you mean 'dot118021XGrptxmickey'?
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:630:40: note: in definition of macro '__fortify_memcpy_chk'
630 | const size_t __p_size_field = (p_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:17: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:88: error: invalid use of undefined type 'struct ieee_crypt_arg'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:630:40: note: in definition of macro '__fortify_memcpy_chk'
630 | const size_t __p_size_field = (p_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:17: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:812:62: error: invalid use of undefined type 'struct ieee_crypt_arg'
812 | &crypt->key[16], 8);
| ^~
include/linux/fortify-string.h:631:40: note: in definition of macro '__fortify_memcpy_chk'
631 | const size_t __q_size_field = (q_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:35: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:62: error: 'struct security_priv' has no member named 'dot18021XGrptxmickey'; did you mean 'dot118021XGrptxmickey'?
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~~~~~~~~~~~~~~~
include/linux/fortify-string.h:645:27: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:88: error: invalid use of undefined type 'struct ieee_crypt_arg'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:645:27: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:812:62: error: invalid use of undefined type 'struct ieee_crypt_arg'
812 | &crypt->key[16], 8);
| ^~
include/linux/fortify-string.h:645:30: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:49: note: in expansion of macro 'memcpy'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:89: error: invalid use of undefined type 'struct ieee_crypt_arg'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:628:34: note: in definition of macro '__fortify_memcpy_chk'
628 | const size_t __p_size = (p_size); \
| ^~~~~~
include/linux/fortify-string.h:691:17: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:49: note: in expansion of macro 'memcpy'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:815:62: error: invalid use of undefined type 'struct ieee_crypt_arg'
815 | &crypt->key[24], 8);
| ^~
include/linux/fortify-string.h:629:34: note: in definition of macro '__fortify_memcpy_chk'
629 | const size_t __q_size = (q_size); \
| ^~~~~~
include/linux/fortify-string.h:691:35: note: in expansion of macro '__struct_size'
691 | __struct_size(p), __struct_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:49: note: in expansion of macro 'memcpy'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:89: error: invalid use of undefined type 'struct ieee_crypt_arg'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:630:40: note: in definition of macro '__fortify_memcpy_chk'
630 | const size_t __p_size_field = (p_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:17: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:49: note: in expansion of macro 'memcpy'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:815:62: error: invalid use of undefined type 'struct ieee_crypt_arg'
815 | &crypt->key[24], 8);
| ^~
include/linux/fortify-string.h:631:40: note: in definition of macro '__fortify_memcpy_chk'
631 | const size_t __q_size_field = (q_size_field); \
| ^~~~~~~~~~~~
include/linux/fortify-string.h:692:35: note: in expansion of macro '__member_size'
692 | __member_size(p), __member_size(q), \
| ^~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:49: note: in expansion of macro 'memcpy'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:89: error: invalid use of undefined type 'struct ieee_crypt_arg'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~
include/linux/fortify-string.h:645:27: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:49: note: in expansion of macro 'memcpy'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:815:62: error: invalid use of undefined type 'struct ieee_crypt_arg'
815 | &crypt->key[24], 8);
| ^~
include/linux/fortify-string.h:645:30: note: in definition of macro '__fortify_memcpy_chk'
645 | __underlying_##op(p, q, __copy_size); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:49: note: in expansion of macro 'memcpy'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ^~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:818:81: error: invalid use of undefined type 'struct ieee_crypt_arg'
818 | psec->dot118021XGrpKeyid = crypt->idx;
| ^~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:819:82: error: invalid use of undefined type 'struct ieee_crypt_arg'
819 | rtw_set_key(padapter, psec, crypt->idx, 1, true);
| ^~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:820:64: error: invalid use of undefined type 'struct ieee_crypt_arg'
820 | } else if (strcmp(crypt->alg, "BIP") == 0) {
vim +787 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
697
698 static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len)
699 {
700 int ret = 0;
701 u8 max_idx;
702 u32 wep_key_idx, wep_key_len;
703 struct adapter *padapter = rtw_netdev_priv(dev);
704 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
705 struct security_priv *psecuritypriv = &padapter->securitypriv;
706
707 param->u.crypt.err = 0;
708 param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0';
709
710 if (param_len < (u32)((u8 *)param->u.crypt.key - (u8 *)param) + param->u.crypt.key_len) {
711 ret = -EINVAL;
712 goto exit;
713 }
714
715 if (param->sta_addr[0] != 0xff || param->sta_addr[1] != 0xff ||
716 param->sta_addr[2] != 0xff || param->sta_addr[3] != 0xff ||
717 param->sta_addr[4] != 0xff || param->sta_addr[5] != 0xff) {
718 ret = -EINVAL;
719 goto exit;
720 }
721
722 if (strcmp(param->u.crypt.alg, "WEP") == 0)
723 max_idx = WEP_KEYS - 1;
724 else
725 max_idx = BIP_MAX_KEYID;
726
727 if (param->u.crypt.idx > max_idx) {
728 netdev_err(dev, "Error crypt.idx %d > %d\n", param->u.crypt.idx, max_idx);
729 ret = -EINVAL;
730 goto exit;
731 }
732
733 if (strcmp(param->u.crypt.alg, "WEP") == 0) {
734 wep_key_idx = param->u.crypt.idx;
735 wep_key_len = param->u.crypt.key_len;
736
737 if (wep_key_len <= 0) {
738 ret = -EINVAL;
739 goto exit;
740 }
741
742 if (psecuritypriv->bWepDefaultKeyIdxSet == 0) {
743 /* wep default key has not been set, so use this key index as default key. */
744
745 wep_key_len = wep_key_len <= 5 ? 5 : 13;
746
747 psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
748 psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
749 psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
750
751 if (wep_key_len == 13) {
752 psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
753 psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
754 }
755
756 psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
757 }
758
759 memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), param->u.crypt.key, wep_key_len);
760
761 psecuritypriv->dot11DefKeylen[wep_key_idx] = wep_key_len;
762
763 rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0, true);
764
765 goto exit;
766 }
767
768 if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802_1x */
769 struct sta_info *psta, *pbcmc_sta;
770 struct sta_priv *pstapriv = &padapter->stapriv;
771
772 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) == true) { /* sta mode */
773 psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
774 if (psta) {
775 /* Jeff: don't disable ieee8021x_blocked while clearing key */
776 if (strcmp(param->u.crypt.alg, "none") != 0)
777 psta->ieee8021x_blocked = false;
778
779 if ((padapter->securitypriv.ndisencryptstatus ==
780 NDIS_802_11_ENCRYPTION_2_ENABLED) ||
781 (padapter->securitypriv.ndisencryptstatus ==
782 NDIS_802_11_ENCRYPTION_3_ENABLED)) {
783 psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
784 }
785
786 if (param->u.crypt.set_tx == 1) { /* pairwise key */
> 787 struct ieee_crypt_arg *crypt = ¶m->u.crypt;
> 788 u32 len = min(crypt->key_len, 16U);
789
790 memcpy(psta->dot118021x_UncstKey.skey,
791 crypt->key, len);
792 if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */
793 memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8);
794 memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8);
795
796 padapter->securitypriv.busetkipkey = false;
797 /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */
798 }
799
800 rtw_setstakey_cmd(padapter, psta, true, true);
801 } else { /* group key */
802 struct security_priv *psec = &padapter->securitypriv;
803 struct ieee_crypt_arg *crypt = ¶m->u.crypt;
804 u32 len = min(crypt->key_len, 16U);
805
806 if (strcmp(crypt->alg, "TKIP") == 0 ||
807 strcmp(crypt->alg, "CCMP") == 0) {
808 memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
809 crypt->key, len);
810
> 811 memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
812 &crypt->key[16], 8);
813
814 memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
815 &crypt->key[24], 8);
816
817 psec->binstallGrpkey = true;
818 psec->dot118021XGrpKeyid = crypt->idx;
819 rtw_set_key(padapter, psec, crypt->idx, 1, true);
820 } else if (strcmp(crypt->alg, "BIP") == 0) {
821 /* save the IGTK key, length 16 bytes */
822 memcpy(psec->dot11wBIPKey[crypt->idx].skey,
823 crypt->key, len);
824 psec->dot11wBIPKeyid = crypt->idx;
825 psec->binstallBIPkey = true;
826 }
827 }
828 }
829
830 pbcmc_sta = rtw_get_bcmc_stainfo(padapter);
831 if (pbcmc_sta) {
832 /* Jeff: don't disable ieee8021x_blocked while clearing key */
833 if (strcmp(param->u.crypt.alg, "none") != 0)
834 pbcmc_sta->ieee8021x_blocked = false;
835
836 if ((padapter->securitypriv.ndisencryptstatus ==
837 NDIS_802_11_ENCRYPTION_2_ENABLED) ||
838 (padapter->securitypriv.ndisencryptstatus ==
839 NDIS_802_11_ENCRYPTION_3_ENABLED)) {
840 pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
841 }
842 }
843 } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* adhoc mode */
844 }
845 }
846
847 exit:
848
849 return ret;
850 }
851
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style
2026-02-10 22:15 [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style markatbritain
2026-02-10 22:38 ` Ethan Tidmore
2026-02-11 2:26 ` kernel test robot
@ 2026-02-11 5:04 ` kernel test robot
2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-02-11 5:04 UTC (permalink / raw)
To: markatbritain, gregkh
Cc: llvm, oe-kbuild-all, straube.linux, dan.carpenter, linux-staging,
linux-kernel, Mark Wu
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/markatbritain-gmail-com/staging-rtl8723bs-remove-NDIS_802_11-types-and-cleanup-style/20260211-062107
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20260210221556.73872-1-markatbritain%40gmail.com
patch subject: [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260211/202602111248.03HAaYiv-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260211/202602111248.03HAaYiv-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602111248.03HAaYiv-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:787:29: error: incompatible pointer types initializing 'struct ieee_crypt_arg *' with an expression of type 'struct (unnamed struct at drivers/staging/rtl8723bs/include/ieee80211.h:181:3) *' [-Werror,-Wincompatible-pointer-types]
787 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^ ~~~~~~~~~~~~~~~
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:788:25: error: incomplete definition of type 'struct ieee_crypt_arg'
788 | u32 len = min(crypt->key_len, 16U);
| ~~~~~^
include/linux/minmax.h:105:38: note: expanded from macro 'min'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^
include/linux/minmax.h:98:25: note: expanded from macro '__careful_cmp'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^
include/linux/minmax.h:92:13: note: expanded from macro '__careful_cmp_once'
92 | auto ux = (x); auto uy = (y); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:787:13: note: forward declaration of 'struct ieee_crypt_arg'
787 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:791:18: error: incomplete definition of type 'struct ieee_crypt_arg'
791 | crypt->key, len);
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:787:13: note: forward declaration of 'struct ieee_crypt_arg'
787 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:29: error: incompatible pointer types initializing 'struct ieee_crypt_arg *' with an expression of type 'struct (unnamed struct at drivers/staging/rtl8723bs/include/ieee80211.h:181:3) *' [-Werror,-Wincompatible-pointer-types]
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^ ~~~~~~~~~~~~~~~
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:804:25: error: incomplete definition of type 'struct ieee_crypt_arg'
804 | u32 len = min(crypt->key_len, 16U);
| ~~~~~^
include/linux/minmax.h:105:38: note: expanded from macro 'min'
105 | #define min(x, y) __careful_cmp(min, x, y)
| ^
include/linux/minmax.h:98:25: note: expanded from macro '__careful_cmp'
98 | __careful_cmp_once(op, x, y, __UNIQUE_ID(x_), __UNIQUE_ID(y_))
| ^
include/linux/minmax.h:92:13: note: expanded from macro '__careful_cmp_once'
92 | auto ux = (x); auto uy = (y); \
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:806:22: error: incomplete definition of type 'struct ieee_crypt_arg'
806 | if (strcmp(crypt->alg, "TKIP") == 0 ||
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:807:22: error: incomplete definition of type 'struct ieee_crypt_arg'
807 | strcmp(crypt->alg, "CCMP") == 0) {
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:808:42: error: incomplete definition of type 'struct ieee_crypt_arg'
808 | memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:809:19: error: incomplete definition of type 'struct ieee_crypt_arg'
809 | crypt->key, len);
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:46: error: incomplete definition of type 'struct ieee_crypt_arg'
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
>> drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:811:20: error: no member named 'dot18021XGrptxmickey' in 'struct security_priv'; did you mean 'dot118021XGrptxmickey'?
811 | memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
| ^~~~~~~~~~~~~~~~~~~~
| dot118021XGrptxmickey
drivers/staging/rtl8723bs/include/rtw_security.h:106:16: note: 'dot118021XGrptxmickey' declared here
106 | union Keytype dot118021XGrptxmickey[BIP_MAX_KEYID + 1];
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:812:20: error: incomplete definition of type 'struct ieee_crypt_arg'
812 | &crypt->key[16], 8);
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:814:47: error: incomplete definition of type 'struct ieee_crypt_arg'
814 | memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:815:20: error: incomplete definition of type 'struct ieee_crypt_arg'
815 | &crypt->key[24], 8);
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:818:39: error: incomplete definition of type 'struct ieee_crypt_arg'
818 | psec->dot118021XGrpKeyid = crypt->idx;
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:819:40: error: incomplete definition of type 'struct ieee_crypt_arg'
819 | rtw_set_key(padapter, psec, crypt->idx, 1, true);
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:820:29: error: incomplete definition of type 'struct ieee_crypt_arg'
820 | } else if (strcmp(crypt->alg, "BIP") == 0) {
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:822:38: error: incomplete definition of type 'struct ieee_crypt_arg'
822 | memcpy(psec->dot11wBIPKey[crypt->idx].skey,
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:823:19: error: incomplete definition of type 'struct ieee_crypt_arg'
823 | crypt->key, len);
| ~~~~~^
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:803:13: note: forward declaration of 'struct ieee_crypt_arg'
803 | struct ieee_crypt_arg *crypt = ¶m->u.crypt;
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
vim +787 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
697
698 static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len)
699 {
700 int ret = 0;
701 u8 max_idx;
702 u32 wep_key_idx, wep_key_len;
703 struct adapter *padapter = rtw_netdev_priv(dev);
704 struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
705 struct security_priv *psecuritypriv = &padapter->securitypriv;
706
707 param->u.crypt.err = 0;
708 param->u.crypt.alg[IEEE_CRYPT_ALG_NAME_LEN - 1] = '\0';
709
710 if (param_len < (u32)((u8 *)param->u.crypt.key - (u8 *)param) + param->u.crypt.key_len) {
711 ret = -EINVAL;
712 goto exit;
713 }
714
715 if (param->sta_addr[0] != 0xff || param->sta_addr[1] != 0xff ||
716 param->sta_addr[2] != 0xff || param->sta_addr[3] != 0xff ||
717 param->sta_addr[4] != 0xff || param->sta_addr[5] != 0xff) {
718 ret = -EINVAL;
719 goto exit;
720 }
721
722 if (strcmp(param->u.crypt.alg, "WEP") == 0)
723 max_idx = WEP_KEYS - 1;
724 else
725 max_idx = BIP_MAX_KEYID;
726
727 if (param->u.crypt.idx > max_idx) {
728 netdev_err(dev, "Error crypt.idx %d > %d\n", param->u.crypt.idx, max_idx);
729 ret = -EINVAL;
730 goto exit;
731 }
732
733 if (strcmp(param->u.crypt.alg, "WEP") == 0) {
734 wep_key_idx = param->u.crypt.idx;
735 wep_key_len = param->u.crypt.key_len;
736
737 if (wep_key_len <= 0) {
738 ret = -EINVAL;
739 goto exit;
740 }
741
742 if (psecuritypriv->bWepDefaultKeyIdxSet == 0) {
743 /* wep default key has not been set, so use this key index as default key. */
744
745 wep_key_len = wep_key_len <= 5 ? 5 : 13;
746
747 psecuritypriv->ndisencryptstatus = NDIS_802_11_ENCRYPTION_ENABLED;
748 psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
749 psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
750
751 if (wep_key_len == 13) {
752 psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
753 psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
754 }
755
756 psecuritypriv->dot11PrivacyKeyIndex = wep_key_idx;
757 }
758
759 memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), param->u.crypt.key, wep_key_len);
760
761 psecuritypriv->dot11DefKeylen[wep_key_idx] = wep_key_len;
762
763 rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0, true);
764
765 goto exit;
766 }
767
768 if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802_1x */
769 struct sta_info *psta, *pbcmc_sta;
770 struct sta_priv *pstapriv = &padapter->stapriv;
771
772 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) == true) { /* sta mode */
773 psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
774 if (psta) {
775 /* Jeff: don't disable ieee8021x_blocked while clearing key */
776 if (strcmp(param->u.crypt.alg, "none") != 0)
777 psta->ieee8021x_blocked = false;
778
779 if ((padapter->securitypriv.ndisencryptstatus ==
780 NDIS_802_11_ENCRYPTION_2_ENABLED) ||
781 (padapter->securitypriv.ndisencryptstatus ==
782 NDIS_802_11_ENCRYPTION_3_ENABLED)) {
783 psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
784 }
785
786 if (param->u.crypt.set_tx == 1) { /* pairwise key */
> 787 struct ieee_crypt_arg *crypt = ¶m->u.crypt;
> 788 u32 len = min(crypt->key_len, 16U);
789
790 memcpy(psta->dot118021x_UncstKey.skey,
791 crypt->key, len);
792 if (strcmp(param->u.crypt.alg, "TKIP") == 0) { /* set mic key */
793 memcpy(psta->dot11tkiptxmickey.skey, &(param->u.crypt.key[16]), 8);
794 memcpy(psta->dot11tkiprxmickey.skey, &(param->u.crypt.key[24]), 8);
795
796 padapter->securitypriv.busetkipkey = false;
797 /* _set_timer(&padapter->securitypriv.tkip_timer, 50); */
798 }
799
800 rtw_setstakey_cmd(padapter, psta, true, true);
801 } else { /* group key */
802 struct security_priv *psec = &padapter->securitypriv;
803 struct ieee_crypt_arg *crypt = ¶m->u.crypt;
804 u32 len = min(crypt->key_len, 16U);
805
806 if (strcmp(crypt->alg, "TKIP") == 0 ||
807 strcmp(crypt->alg, "CCMP") == 0) {
808 memcpy(psec->dot118021XGrpKey[crypt->idx].skey,
809 crypt->key, len);
810
> 811 memcpy(psec->dot18021XGrptxmickey[crypt->idx].skey,
812 &crypt->key[16], 8);
813
814 memcpy(psec->dot118021XGrprxmickey[crypt->idx].skey,
815 &crypt->key[24], 8);
816
817 psec->binstallGrpkey = true;
818 psec->dot118021XGrpKeyid = crypt->idx;
819 rtw_set_key(padapter, psec, crypt->idx, 1, true);
820 } else if (strcmp(crypt->alg, "BIP") == 0) {
821 /* save the IGTK key, length 16 bytes */
822 memcpy(psec->dot11wBIPKey[crypt->idx].skey,
823 crypt->key, len);
824 psec->dot11wBIPKeyid = crypt->idx;
825 psec->binstallBIPkey = true;
826 }
827 }
828 }
829
830 pbcmc_sta = rtw_get_bcmc_stainfo(padapter);
831 if (pbcmc_sta) {
832 /* Jeff: don't disable ieee8021x_blocked while clearing key */
833 if (strcmp(param->u.crypt.alg, "none") != 0)
834 pbcmc_sta->ieee8021x_blocked = false;
835
836 if ((padapter->securitypriv.ndisencryptstatus ==
837 NDIS_802_11_ENCRYPTION_2_ENABLED) ||
838 (padapter->securitypriv.ndisencryptstatus ==
839 NDIS_802_11_ENCRYPTION_3_ENABLED)) {
840 pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
841 }
842 }
843 } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* adhoc mode */
844 }
845 }
846
847 exit:
848
849 return ret;
850 }
851
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-11 5:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 22:15 [PATCH] staging: rtl8723bs: remove NDIS_802_11 types and cleanup style markatbritain
2026-02-10 22:38 ` Ethan Tidmore
2026-02-11 2:26 ` kernel test robot
2026-02-11 5:04 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox