Skip to contentSkip to conversation

staging: rtl8723bs: remove NDIS_802_11 types and cleanup style

PATCH In review [email protected] 3 participants 4 messages Feb 10 – Feb 11 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: remove NDIS_802_11 types and cleanup style

From: Mark Wu <[email protected]>

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.

---
 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(-)
drivers/staging/rtl8723bs/core/rtw_ap.c +7 -7
index ebe73abab892..94282360bc3e 100644
@@ -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);
drivers/staging/rtl8723bs/core/rtw_cmd.c +5 -5
index b2e7f479f72b..a7b92d42397e 100644
@@ -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;
 		}
 	}
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +16 -11
index 587a87fbffeb..e70e6e18eb19 100644
@@ -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;
 		}
 
drivers/staging/rtl8723bs/core/rtw_mlme.c +32 -26

173 lines not on this page · raw message

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +8 -8
index 78abc5f5191f..847181486a9c 100644
@@ -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;
drivers/staging/rtl8723bs/core/rtw_recv.c +1 -1
index 337671b1211f..bbd8bd79e1c7 100644
@@ -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);
 
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +1 -1
index bdd4b6d8fd2e..2fc966ac5d3f 100644
@@ -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; */
drivers/staging/rtl8723bs/hal/hal_intf.c +5 -5
index 27c0c0198714..3c3949a92b5d 100644
@@ -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)
drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +3 -3
index af6cdda8238d..23e4d2d82dbd 100644
@@ -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)));
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +1 -1
index afa5631a441a..77b50e72b065 100644
@@ -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];
 };
 
 /*
drivers/staging/rtl8723bs/include/rtw_security.h +4 -4
index 32f6d3a5e309..ade18f7fa6bf 100644
@@ -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	{
drivers/staging/rtl8723bs/include/wlan_bssdef.h +55 -60

189 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +78 -60

347 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/os_intfs.c +3 -3
index 21a0c3cf4c31..7a2f1c82cac3 100644
@@ -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);
Signature · 1 line
2.43.0
#1 lore raw
Quoted 11 lines · markatbritain

From: Mark Wu <[email protected]>

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.

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

#2 lore raw
In reply to [email protected]
kernel test robot noticed the following build errors:

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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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 = &param->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 = &param->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 = &param->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

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#3 lore raw
In reply to [email protected]
kernel test robot noticed the following build errors:

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/[email protected]/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/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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 = &param->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

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki