Commit 3359e292 authored by Ross Schmidt's avatar Ross Schmidt Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723bs: use WLAN_EID_RSN



Replace unique _WPA2_IE_ID_, EID_WPA2, and _RSN_IE_2_ with kernel provided
WLAN_EID_RSN from linux/ieee80211.h.

Signed-off-by: default avatarRoss Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-4-ross.schm.dev@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b05cc3a9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1080,7 +1080,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
	psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
	p = rtw_get_ie(
		ie + _BEACON_IE_OFFSET_,
		_RSN_IE_2_,
		WLAN_EID_RSN,
		&ie_len,
		(pbss_network->IELength - _BEACON_IE_OFFSET_)
	);
@@ -1780,7 +1780,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)

		break;

	case _RSN_IE_2_:
	case WLAN_EID_RSN:

		update_bcn_rsn_ie(padapter);

+3 −3
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)

unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
{
	return rtw_get_ie(pie, _WPA2_IE_ID_, rsn_ie_len, limit);
	return rtw_get_ie(pie, WLAN_EID_RSN, rsn_ie_len, limit);
}

int rtw_get_wpa_cipher_suite(u8 *s)
@@ -544,7 +544,7 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
		return _FAIL;
	}

	if ((*rsn_ie != _WPA2_IE_ID_) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) {
	if ((*rsn_ie != WLAN_EID_RSN) || (*(rsn_ie+1) != (u8)(rsn_ie_len - 2))) {
		return _FAIL;
	}

@@ -683,7 +683,7 @@ void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie
				*wpa_len = in_ie[cnt+1]+2;
				cnt += in_ie[cnt+1]+2;  /* get next */
		} else {
			if (authmode == _WPA2_IE_ID_) {
			if (authmode == WLAN_EID_RSN) {
				RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n get_rsn_ie: sec_idx =%d in_ie[cnt+1]+2 =%d\n", sec_idx, in_ie[cnt+1]+2));

				if (rsn_ie) {
+4 −4
Original line number Diff line number Diff line
@@ -736,7 +736,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
	    bselected = false;

		if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
			p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_));
			p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_));
			if (p && ie_len > 0)
				bselected = true;
			else
@@ -2361,13 +2361,13 @@ sint rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in
	if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK))
			authmode = WLAN_EID_VENDOR_SPECIFIC;
	if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK))
			authmode = _WPA2_IE_ID_;
			authmode = WLAN_EID_RSN;

	if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
		memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);

		ielength += psecuritypriv->wps_ie_len;
	} else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == _WPA2_IE_ID_)) {
	} else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == WLAN_EID_RSN)) {
		/* copy RSN or SSN */
		memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1]+2);
		/* debug for CONFIG_IEEE80211W
@@ -2386,7 +2386,7 @@ sint rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in
	if (iEntry < 0) {
		return ielength;
	} else {
		if (authmode == _WPA2_IE_ID_)
		if (authmode == WLAN_EID_RSN)
			ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
	}
	return ielength;
+2 −2
Original line number Diff line number Diff line
@@ -3369,8 +3369,8 @@ void issue_assocreq(struct adapter *padapter)
			}
			break;

		case EID_WPA2:
			pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen));
		case WLAN_EID_RSN:
			pframe = rtw_set_ie(pframe, WLAN_EID_RSN, pIE->Length, pIE->data, &(pattrib->pktlen));
			break;
		case WLAN_EID_HT_CAPABILITY:
			if (padapter->mlmepriv.htpriv.ht_option) {
+1 −1
Original line number Diff line number Diff line
@@ -1511,7 +1511,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)

				break;

			case _RSN_IE_2_:
			case WLAN_EID_RSN:
				if (!memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
					return true;
				break;
Loading