Commit f179515d authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

staging: rtl8712: Use constants from <linux/ieee80211.h>



Some constants defined in wifi.h are already defined in <linux/ieee80211.h>
with some other (but similar) names.
Be consistent and use the ones from <linux/ieee80211.h>.

The conversions made are:
_SSID_IE_                -->  WLAN_EID_SSID
_SUPPORTEDRATES_IE_      -->  WLAN_EID_SUPP_RATES
_DSSET_IE_               -->  WLAN_EID_DS_PARAMS
_IBSS_PARA_IE_           -->  WLAN_EID_IBSS_PARAMS
_ERPINFO_IE_             -->  WLAN_EID_ERP_INFO
_EXT_SUPPORTEDRATES_IE_  -->  WLAN_EID_EXT_SUPP_RATES

_HT_CAPABILITY_IE_       -->  WLAN_EID_HT_CAPABILITY
_HT_EXTRA_INFO_IE_       -->  WLAN_EID_HT_OPERATION    (not used)
_HT_ADD_INFO_IE_         -->  WLAN_EID_HT_OPERATION

_VENDOR_SPECIFIC_IE_     -->  WLAN_EID_VENDOR_SPECIFIC

_RESERVED47_             --> (not used)

Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/fe35fb45323adc3a30f31b7280cec7700fd325d8.1617741313.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc21df67
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -181,25 +181,25 @@ int r8712_generate_ie(struct registry_priv *registrypriv)
	sz += 2;
	ie += 2;
	/*SSID*/
	ie = r8712_set_ie(ie, _SSID_IE_, dev_network->Ssid.SsidLength,
	ie = r8712_set_ie(ie, WLAN_EID_SSID, dev_network->Ssid.SsidLength,
			  dev_network->Ssid.Ssid, &sz);
	/*supported rates*/
	set_supported_rate(dev_network->rates, registrypriv->wireless_mode);
	rate_len = r8712_get_rateset_len(dev_network->rates);
	if (rate_len > 8) {
		ie = r8712_set_ie(ie, _SUPPORTEDRATES_IE_, 8,
		ie = r8712_set_ie(ie, WLAN_EID_SUPP_RATES, 8,
				  dev_network->rates, &sz);
		ie = r8712_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8),
		ie = r8712_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8),
				  (dev_network->rates + 8), &sz);
	} else {
		ie = r8712_set_ie(ie, _SUPPORTEDRATES_IE_,
		ie = r8712_set_ie(ie, WLAN_EID_SUPP_RATES,
				  rate_len, dev_network->rates, &sz);
	}
	/*DS parameter set*/
	ie = r8712_set_ie(ie, _DSSET_IE_, 1,
	ie = r8712_set_ie(ie, WLAN_EID_DS_PARAMS, 1,
			  (u8 *)&dev_network->Configuration.DSConfig, &sz);
	/*IBSS Parameter Set*/
	ie = r8712_set_ie(ie, _IBSS_PARA_IE_, 2,
	ie = r8712_set_ie(ie, WLAN_EID_IBSS_PARAMS, 2,
			  (u8 *)&dev_network->Configuration.ATIMWindow, &sz);
	return sz;
}
+4 −4
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ static char *translate_scan(struct _adapter *padapter,
	start = iwe_stream_add_point(info, start, stop, &iwe,
				     pnetwork->network.Ssid.Ssid);
	/* parsing HT_CAP_IE */
	p = r8712_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_,
	p = r8712_get_ie(&pnetwork->network.IEs[12], WLAN_EID_HT_CAPABILITY,
			 &ht_ielen, pnetwork->network.IELength - 12);
	if (p && ht_ielen > 0)
		ht_cap = true;
@@ -565,7 +565,7 @@ static int r871x_set_wpa_ie(struct _adapter *padapter, char *pie,
			while (cnt < ielen) {
				eid = buf[cnt];

				if ((eid == _VENDOR_SPECIFIC_IE_) &&
				if ((eid == WLAN_EID_VENDOR_SPECIFIC) &&
				    (!memcmp(&buf[cnt + 2], wps_oui, 4))) {
					netdev_info(padapter->pnetdev, "r8712u: SET WPS_IE\n");
					padapter->securitypriv.wps_ie_len =
@@ -607,7 +607,7 @@ static int r8711_wx_get_name(struct net_device *dev,
	if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) ==
	    true) {
		/* parsing HT_CAP_IE */
		p = r8712_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_,
		p = r8712_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY,
				 &ht_ielen, pcur_bss->IELength - 12);
		if (p && ht_ielen > 0)
			ht_cap = true;
@@ -1401,7 +1401,7 @@ static int r8711_wx_get_rate(struct net_device *dev,
	i = 0;
	if (!check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE))
		return -ENOLINK;
	p = r8712_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen,
	p = r8712_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY, &ht_ielen,
			 pcur_bss->IELength - 12);
	if (p && ht_ielen > 0) {
		ht_cap = true;
+5 −5
Original line number Diff line number Diff line
@@ -1647,11 +1647,11 @@ unsigned int r8712_restructure_ht_ie(struct _adapter *padapter, u8 *in_ie,
	struct ht_priv *phtpriv = &pmlmepriv->htpriv;

	phtpriv->ht_option = 0;
	p = r8712_get_ie(in_ie + 12, _HT_CAPABILITY_IE_, &ielen, in_len - 12);
	p = r8712_get_ie(in_ie + 12, WLAN_EID_HT_CAPABILITY, &ielen, in_len - 12);
	if (p && (ielen > 0)) {
		if (pqospriv->qos_option == 0) {
			out_len = *pout_len;
			r8712_set_ie(out_ie + out_len, _VENDOR_SPECIFIC_IE_,
			r8712_set_ie(out_ie + out_len, WLAN_EID_VENDOR_SPECIFIC,
				     _WMM_IE_Length_, WMM_IE, pout_len);
			pqospriv->qos_option = 1;
		}
@@ -1665,7 +1665,7 @@ unsigned int r8712_restructure_ht_ie(struct _adapter *padapter, u8 *in_ie,
				    IEEE80211_HT_CAP_DSSSCCK40);
		ht_capie.ampdu_params_info = (IEEE80211_HT_AMPDU_PARM_FACTOR &
				0x03) | (IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00);
		r8712_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_,
		r8712_set_ie(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
			     sizeof(struct rtl_ieee80211_ht_cap),
			     (unsigned char *)&ht_capie, pout_len);
		phtpriv->ht_option = 1;
@@ -1696,7 +1696,7 @@ static void update_ht_cap(struct _adapter *padapter, u8 *pie, uint ie_len)
	/*check Max Rx A-MPDU Size*/
	len = 0;
	p = r8712_get_ie(pie + sizeof(struct NDIS_802_11_FIXED_IEs),
				_HT_CAPABILITY_IE_,
				WLAN_EID_HT_CAPABILITY,
				&len, ie_len -
				sizeof(struct NDIS_802_11_FIXED_IEs));
	if (p && len > 0) {
@@ -1731,7 +1731,7 @@ static void update_ht_cap(struct _adapter *padapter, u8 *pie, uint ie_len)
	}
	len = 0;
	p = r8712_get_ie(pie + sizeof(struct NDIS_802_11_FIXED_IEs),
		   _HT_ADD_INFO_IE_, &len,
		   WLAN_EID_HT_OPERATION, &len,
		   ie_len - sizeof(struct NDIS_802_11_FIXED_IEs));
}

+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "osdep_intf.h"
#include "usb_ops.h"

#include <linux/ieee80211.h>

static const u8 P802_1H_OUI[P80211_OUI_LEN] = {0x00, 0x00, 0xf8};
static const u8 RFC1042_OUI[P80211_OUI_LEN] = {0x00, 0x00, 0x00};
@@ -709,7 +710,7 @@ void r8712_update_protection(struct _adapter *padapter, u8 *ie, uint ie_len)
		break;
	case AUTO_VCS:
	default:
		perp = r8712_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
		perp = r8712_get_ie(ie, WLAN_EID_ERP_INFO, &erp_len, ie_len);
		if (!perp) {
			pxmitpriv->vcs = NONE_VCS;
		} else {
+0 −15
Original line number Diff line number Diff line
@@ -245,21 +245,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)

#define _FIXED_IE_LENGTH_	_BEACON_IE_OFFSET_

#define _SSID_IE_		0
#define _SUPPORTEDRATES_IE_	1
#define _DSSET_IE_		3
#define _IBSS_PARA_IE_		6
#define _ERPINFO_IE_		42
#define _EXT_SUPPORTEDRATES_IE_	50

#define _HT_CAPABILITY_IE_	45
#define _HT_EXTRA_INFO_IE_	61
#define _HT_ADD_INFO_IE_	61 /* _HT_EXTRA_INFO_IE_ */

#define _VENDOR_SPECIFIC_IE_	221

#define	_RESERVED47_		47

/* ---------------------------------------------------------------------------
 *			Below is the fixed elements...
 * ---------------------------------------------------------------------------