Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/fe35fb45323adc3a30f31b7280cec7700fd325d8.1617741313.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Christophe JAILLET and committed by
Greg Kroah-Hartman
f179515d bc21df67

+17 -31
+6 -6
drivers/staging/rtl8712/ieee80211.c
··· 181 181 sz += 2; 182 182 ie += 2; 183 183 /*SSID*/ 184 - ie = r8712_set_ie(ie, _SSID_IE_, dev_network->Ssid.SsidLength, 184 + ie = r8712_set_ie(ie, WLAN_EID_SSID, dev_network->Ssid.SsidLength, 185 185 dev_network->Ssid.Ssid, &sz); 186 186 /*supported rates*/ 187 187 set_supported_rate(dev_network->rates, registrypriv->wireless_mode); 188 188 rate_len = r8712_get_rateset_len(dev_network->rates); 189 189 if (rate_len > 8) { 190 - ie = r8712_set_ie(ie, _SUPPORTEDRATES_IE_, 8, 190 + ie = r8712_set_ie(ie, WLAN_EID_SUPP_RATES, 8, 191 191 dev_network->rates, &sz); 192 - ie = r8712_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), 192 + ie = r8712_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), 193 193 (dev_network->rates + 8), &sz); 194 194 } else { 195 - ie = r8712_set_ie(ie, _SUPPORTEDRATES_IE_, 195 + ie = r8712_set_ie(ie, WLAN_EID_SUPP_RATES, 196 196 rate_len, dev_network->rates, &sz); 197 197 } 198 198 /*DS parameter set*/ 199 - ie = r8712_set_ie(ie, _DSSET_IE_, 1, 199 + ie = r8712_set_ie(ie, WLAN_EID_DS_PARAMS, 1, 200 200 (u8 *)&dev_network->Configuration.DSConfig, &sz); 201 201 /*IBSS Parameter Set*/ 202 - ie = r8712_set_ie(ie, _IBSS_PARA_IE_, 2, 202 + ie = r8712_set_ie(ie, WLAN_EID_IBSS_PARAMS, 2, 203 203 (u8 *)&dev_network->Configuration.ATIMWindow, &sz); 204 204 return sz; 205 205 }
+4 -4
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
··· 234 234 start = iwe_stream_add_point(info, start, stop, &iwe, 235 235 pnetwork->network.Ssid.Ssid); 236 236 /* parsing HT_CAP_IE */ 237 - p = r8712_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, 237 + p = r8712_get_ie(&pnetwork->network.IEs[12], WLAN_EID_HT_CAPABILITY, 238 238 &ht_ielen, pnetwork->network.IELength - 12); 239 239 if (p && ht_ielen > 0) 240 240 ht_cap = true; ··· 565 565 while (cnt < ielen) { 566 566 eid = buf[cnt]; 567 567 568 - if ((eid == _VENDOR_SPECIFIC_IE_) && 568 + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && 569 569 (!memcmp(&buf[cnt + 2], wps_oui, 4))) { 570 570 netdev_info(padapter->pnetdev, "r8712u: SET WPS_IE\n"); 571 571 padapter->securitypriv.wps_ie_len = ··· 607 607 if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == 608 608 true) { 609 609 /* parsing HT_CAP_IE */ 610 - p = r8712_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, 610 + p = r8712_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY, 611 611 &ht_ielen, pcur_bss->IELength - 12); 612 612 if (p && ht_ielen > 0) 613 613 ht_cap = true; ··· 1401 1401 i = 0; 1402 1402 if (!check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE)) 1403 1403 return -ENOLINK; 1404 - p = r8712_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, 1404 + p = r8712_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY, &ht_ielen, 1405 1405 pcur_bss->IELength - 12); 1406 1406 if (p && ht_ielen > 0) { 1407 1407 ht_cap = true;
+5 -5
drivers/staging/rtl8712/rtl871x_mlme.c
··· 1647 1647 struct ht_priv *phtpriv = &pmlmepriv->htpriv; 1648 1648 1649 1649 phtpriv->ht_option = 0; 1650 - p = r8712_get_ie(in_ie + 12, _HT_CAPABILITY_IE_, &ielen, in_len - 12); 1650 + p = r8712_get_ie(in_ie + 12, WLAN_EID_HT_CAPABILITY, &ielen, in_len - 12); 1651 1651 if (p && (ielen > 0)) { 1652 1652 if (pqospriv->qos_option == 0) { 1653 1653 out_len = *pout_len; 1654 - r8712_set_ie(out_ie + out_len, _VENDOR_SPECIFIC_IE_, 1654 + r8712_set_ie(out_ie + out_len, WLAN_EID_VENDOR_SPECIFIC, 1655 1655 _WMM_IE_Length_, WMM_IE, pout_len); 1656 1656 pqospriv->qos_option = 1; 1657 1657 } ··· 1665 1665 IEEE80211_HT_CAP_DSSSCCK40); 1666 1666 ht_capie.ampdu_params_info = (IEEE80211_HT_AMPDU_PARM_FACTOR & 1667 1667 0x03) | (IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00); 1668 - r8712_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_, 1668 + r8712_set_ie(out_ie + out_len, WLAN_EID_HT_CAPABILITY, 1669 1669 sizeof(struct rtl_ieee80211_ht_cap), 1670 1670 (unsigned char *)&ht_capie, pout_len); 1671 1671 phtpriv->ht_option = 1; ··· 1696 1696 /*check Max Rx A-MPDU Size*/ 1697 1697 len = 0; 1698 1698 p = r8712_get_ie(pie + sizeof(struct NDIS_802_11_FIXED_IEs), 1699 - _HT_CAPABILITY_IE_, 1699 + WLAN_EID_HT_CAPABILITY, 1700 1700 &len, ie_len - 1701 1701 sizeof(struct NDIS_802_11_FIXED_IEs)); 1702 1702 if (p && len > 0) { ··· 1731 1731 } 1732 1732 len = 0; 1733 1733 p = r8712_get_ie(pie + sizeof(struct NDIS_802_11_FIXED_IEs), 1734 - _HT_ADD_INFO_IE_, &len, 1734 + WLAN_EID_HT_OPERATION, &len, 1735 1735 ie_len - sizeof(struct NDIS_802_11_FIXED_IEs)); 1736 1736 } 1737 1737
+2 -1
drivers/staging/rtl8712/rtl871x_xmit.c
··· 22 22 #include "osdep_intf.h" 23 23 #include "usb_ops.h" 24 24 25 + #include <linux/ieee80211.h> 25 26 26 27 static const u8 P802_1H_OUI[P80211_OUI_LEN] = {0x00, 0x00, 0xf8}; 27 28 static const u8 RFC1042_OUI[P80211_OUI_LEN] = {0x00, 0x00, 0x00}; ··· 710 709 break; 711 710 case AUTO_VCS: 712 711 default: 713 - perp = r8712_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len); 712 + perp = r8712_get_ie(ie, WLAN_EID_ERP_INFO, &erp_len, ie_len); 714 713 if (!perp) { 715 714 pxmitpriv->vcs = NONE_VCS; 716 715 } else {
-15
drivers/staging/rtl8712/wifi.h
··· 245 245 246 246 #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_ 247 247 248 - #define _SSID_IE_ 0 249 - #define _SUPPORTEDRATES_IE_ 1 250 - #define _DSSET_IE_ 3 251 - #define _IBSS_PARA_IE_ 6 252 - #define _ERPINFO_IE_ 42 253 - #define _EXT_SUPPORTEDRATES_IE_ 50 254 - 255 - #define _HT_CAPABILITY_IE_ 45 256 - #define _HT_EXTRA_INFO_IE_ 61 257 - #define _HT_ADD_INFO_IE_ 61 /* _HT_EXTRA_INFO_IE_ */ 258 - 259 - #define _VENDOR_SPECIFIC_IE_ 221 260 - 261 - #define _RESERVED47_ 47 262 - 263 248 /* --------------------------------------------------------------------------- 264 249 * Below is the fixed elements... 265 250 * ---------------------------------------------------------------------------