wireless: drivers: make use of WLAN_EID_VENDOR_SPECIFIC
The include file linux/ieee80211.h contains three definitions for the same thing in enum ieee80211_eid due to historic changes: /* Information Element IDs */ enum ieee80211_eid { : WLAN_EID_WPA = 221, WLAN_EID_GENERIC = 221, WLAN_EID_VENDOR_SPECIFIC = 221, : }; The standard refers to this as "vendor specific" element so the other two definitions are better not used. This patch changes the wireless drivers to use one definition, ie. WLAN_EID_VENDOR_SPECIFIC. Cc: Jouni Malinen <j@w1.fi> Cc: Dan Williams <dcbw@redhat.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> [ath6kl] Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex] Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com> [ipw2x00] Signed-off-by: Arend van Spriel <arend@broadcom.com> [change libipw as well] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
c13a765bd9
commit
04b2312a68
|
@ -7433,7 +7433,7 @@ static inline char *airo_translate_scan(struct net_device *dev,
|
||||||
num_null_ies++;
|
num_null_ies++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WLAN_EID_GENERIC:
|
case WLAN_EID_VENDOR_SPECIFIC:
|
||||||
if (ie[1] >= 4 &&
|
if (ie[1] >= 4 &&
|
||||||
ie[2] == 0x00 &&
|
ie[2] == 0x00 &&
|
||||||
ie[3] == 0x50 &&
|
ie[3] == 0x50 &&
|
||||||
|
|
|
@ -301,7 +301,7 @@ static bool ath6kl_cfg80211_ready(struct ath6kl_vif *vif)
|
||||||
|
|
||||||
static bool ath6kl_is_wpa_ie(const u8 *pos)
|
static bool ath6kl_is_wpa_ie(const u8 *pos)
|
||||||
{
|
{
|
||||||
return pos[0] == WLAN_EID_WPA && pos[1] >= 4 &&
|
return pos[0] == WLAN_EID_VENDOR_SPECIFIC && pos[1] >= 4 &&
|
||||||
pos[2] == 0x00 && pos[3] == 0x50 &&
|
pos[2] == 0x00 && pos[3] == 0x50 &&
|
||||||
pos[4] == 0xf2 && pos[5] == 0x01;
|
pos[4] == 0xf2 && pos[5] == 0x01;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2679,7 +2679,7 @@ brcmf_find_wpaie(u8 *parse, u32 len)
|
||||||
{
|
{
|
||||||
struct brcmf_tlv *ie;
|
struct brcmf_tlv *ie;
|
||||||
|
|
||||||
while ((ie = brcmf_parse_tlvs(parse, len, WLAN_EID_WPA))) {
|
while ((ie = brcmf_parse_tlvs(parse, len, WLAN_EID_VENDOR_SPECIFIC))) {
|
||||||
if (brcmf_tlv_has_ie((u8 *)ie, &parse, &len,
|
if (brcmf_tlv_has_ie((u8 *)ie, &parse, &len,
|
||||||
WPA_OUI, TLV_OUI_LEN, WPA_OUI_TYPE))
|
WPA_OUI, TLV_OUI_LEN, WPA_OUI_TYPE))
|
||||||
return (struct brcmf_vs_tlv *)ie;
|
return (struct brcmf_vs_tlv *)ie;
|
||||||
|
|
|
@ -415,7 +415,7 @@ static void hostap_rx_sta_beacon(local_info_t *local, struct sk_buff *skb,
|
||||||
ssid = pos + 2;
|
ssid = pos + 2;
|
||||||
ssid_len = pos[1];
|
ssid_len = pos[1];
|
||||||
break;
|
break;
|
||||||
case WLAN_EID_GENERIC:
|
case WLAN_EID_VENDOR_SPECIFIC:
|
||||||
if (pos[1] >= 4 &&
|
if (pos[1] >= 4 &&
|
||||||
pos[2] == 0x00 && pos[3] == 0x50 &&
|
pos[2] == 0x00 && pos[3] == 0x50 &&
|
||||||
pos[4] == 0xf2 && pos[5] == 1) {
|
pos[4] == 0xf2 && pos[5] == 1) {
|
||||||
|
|
|
@ -1108,7 +1108,7 @@ static const char *get_info_element_string(u16 id)
|
||||||
MFIE_STRING(ERP_INFO);
|
MFIE_STRING(ERP_INFO);
|
||||||
MFIE_STRING(RSN);
|
MFIE_STRING(RSN);
|
||||||
MFIE_STRING(EXT_SUPP_RATES);
|
MFIE_STRING(EXT_SUPP_RATES);
|
||||||
MFIE_STRING(GENERIC);
|
MFIE_STRING(VENDOR_SPECIFIC);
|
||||||
MFIE_STRING(QOS_PARAMETER);
|
MFIE_STRING(QOS_PARAMETER);
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
|
@ -1248,8 +1248,8 @@ static int libipw_parse_info_param(struct libipw_info_element
|
||||||
LIBIPW_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n");
|
LIBIPW_DEBUG_MGMT("WLAN_EID_CHALLENGE: ignored\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WLAN_EID_GENERIC:
|
case WLAN_EID_VENDOR_SPECIFIC:
|
||||||
LIBIPW_DEBUG_MGMT("WLAN_EID_GENERIC: %d bytes\n",
|
LIBIPW_DEBUG_MGMT("WLAN_EID_VENDOR_SPECIFIC: %d bytes\n",
|
||||||
info_element->len);
|
info_element->len);
|
||||||
if (!libipw_parse_qos_info_param_IE(info_element,
|
if (!libipw_parse_qos_info_param_IE(info_element,
|
||||||
network))
|
network))
|
||||||
|
|
|
@ -101,7 +101,7 @@ static int lbs_mesh_config(struct lbs_private *priv, uint16_t action,
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case CMD_ACT_MESH_CONFIG_START:
|
case CMD_ACT_MESH_CONFIG_START:
|
||||||
ie->id = WLAN_EID_GENERIC;
|
ie->id = WLAN_EID_VENDOR_SPECIFIC;
|
||||||
ie->val.oui[0] = 0x00;
|
ie->val.oui[0] = 0x00;
|
||||||
ie->val.oui[1] = 0x50;
|
ie->val.oui[1] = 0x50;
|
||||||
ie->val.oui[2] = 0x43;
|
ie->val.oui[2] = 0x43;
|
||||||
|
|
|
@ -153,7 +153,7 @@ mwifiex_is_wpa_oui_present(struct mwifiex_bssdescriptor *bss_desc, u32 cipher)
|
||||||
|
|
||||||
if (((bss_desc->bcn_wpa_ie) &&
|
if (((bss_desc->bcn_wpa_ie) &&
|
||||||
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id ==
|
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id ==
|
||||||
WLAN_EID_WPA))) {
|
WLAN_EID_VENDOR_SPECIFIC))) {
|
||||||
iebody = (struct ie_body *) bss_desc->bcn_wpa_ie->data;
|
iebody = (struct ie_body *) bss_desc->bcn_wpa_ie->data;
|
||||||
oui = &mwifiex_wpa_oui[cipher][0];
|
oui = &mwifiex_wpa_oui[cipher][0];
|
||||||
ret = mwifiex_search_oui_in_ie(iebody, oui);
|
ret = mwifiex_search_oui_in_ie(iebody, oui);
|
||||||
|
@ -202,7 +202,7 @@ mwifiex_is_bss_no_sec(struct mwifiex_private *priv,
|
||||||
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
|
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
|
||||||
!priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) ||
|
!priv->sec_info.wpa2_enabled && ((!bss_desc->bcn_wpa_ie) ||
|
||||||
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id !=
|
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id !=
|
||||||
WLAN_EID_WPA)) &&
|
WLAN_EID_VENDOR_SPECIFIC)) &&
|
||||||
((!bss_desc->bcn_rsn_ie) ||
|
((!bss_desc->bcn_rsn_ie) ||
|
||||||
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id !=
|
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id !=
|
||||||
WLAN_EID_RSN)) &&
|
WLAN_EID_RSN)) &&
|
||||||
|
@ -237,7 +237,8 @@ mwifiex_is_bss_wpa(struct mwifiex_private *priv,
|
||||||
{
|
{
|
||||||
if (!priv->sec_info.wep_enabled && priv->sec_info.wpa_enabled &&
|
if (!priv->sec_info.wep_enabled && priv->sec_info.wpa_enabled &&
|
||||||
!priv->sec_info.wpa2_enabled && ((bss_desc->bcn_wpa_ie) &&
|
!priv->sec_info.wpa2_enabled && ((bss_desc->bcn_wpa_ie) &&
|
||||||
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id == WLAN_EID_WPA))
|
((*(bss_desc->bcn_wpa_ie)).
|
||||||
|
vend_hdr.element_id == WLAN_EID_VENDOR_SPECIFIC))
|
||||||
/*
|
/*
|
||||||
* Privacy bit may NOT be set in some APs like
|
* Privacy bit may NOT be set in some APs like
|
||||||
* LinkSys WRT54G && bss_desc->privacy
|
* LinkSys WRT54G && bss_desc->privacy
|
||||||
|
@ -309,7 +310,8 @@ mwifiex_is_bss_adhoc_aes(struct mwifiex_private *priv,
|
||||||
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
|
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
|
||||||
!priv->sec_info.wpa2_enabled &&
|
!priv->sec_info.wpa2_enabled &&
|
||||||
((!bss_desc->bcn_wpa_ie) ||
|
((!bss_desc->bcn_wpa_ie) ||
|
||||||
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != WLAN_EID_WPA)) &&
|
((*(bss_desc->bcn_wpa_ie)).
|
||||||
|
vend_hdr.element_id != WLAN_EID_VENDOR_SPECIFIC)) &&
|
||||||
((!bss_desc->bcn_rsn_ie) ||
|
((!bss_desc->bcn_rsn_ie) ||
|
||||||
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id != WLAN_EID_RSN)) &&
|
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id != WLAN_EID_RSN)) &&
|
||||||
!priv->sec_info.encryption_mode && bss_desc->privacy) {
|
!priv->sec_info.encryption_mode && bss_desc->privacy) {
|
||||||
|
@ -329,7 +331,8 @@ mwifiex_is_bss_dynamic_wep(struct mwifiex_private *priv,
|
||||||
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
|
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
|
||||||
!priv->sec_info.wpa2_enabled &&
|
!priv->sec_info.wpa2_enabled &&
|
||||||
((!bss_desc->bcn_wpa_ie) ||
|
((!bss_desc->bcn_wpa_ie) ||
|
||||||
((*(bss_desc->bcn_wpa_ie)).vend_hdr.element_id != WLAN_EID_WPA)) &&
|
((*(bss_desc->bcn_wpa_ie)).
|
||||||
|
vend_hdr.element_id != WLAN_EID_VENDOR_SPECIFIC)) &&
|
||||||
((!bss_desc->bcn_rsn_ie) ||
|
((!bss_desc->bcn_rsn_ie) ||
|
||||||
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id != WLAN_EID_RSN)) &&
|
((*(bss_desc->bcn_rsn_ie)).ieee_hdr.element_id != WLAN_EID_RSN)) &&
|
||||||
priv->sec_info.encryption_mode && bss_desc->privacy) {
|
priv->sec_info.encryption_mode && bss_desc->privacy) {
|
||||||
|
|
|
@ -713,7 +713,7 @@ static int mwifiex_set_wpa_ie_helper(struct mwifiex_private *priv,
|
||||||
dev_dbg(priv->adapter->dev, "cmd: Set Wpa_ie_len=%d IE=%#x\n",
|
dev_dbg(priv->adapter->dev, "cmd: Set Wpa_ie_len=%d IE=%#x\n",
|
||||||
priv->wpa_ie_len, priv->wpa_ie[0]);
|
priv->wpa_ie_len, priv->wpa_ie[0]);
|
||||||
|
|
||||||
if (priv->wpa_ie[0] == WLAN_EID_WPA) {
|
if (priv->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) {
|
||||||
priv->sec_info.wpa_enabled = true;
|
priv->sec_info.wpa_enabled = true;
|
||||||
} else if (priv->wpa_ie[0] == WLAN_EID_RSN) {
|
} else if (priv->wpa_ie[0] == WLAN_EID_RSN) {
|
||||||
priv->sec_info.wpa2_enabled = true;
|
priv->sec_info.wpa2_enabled = true;
|
||||||
|
@ -1253,7 +1253,7 @@ mwifiex_set_gen_ie_helper(struct mwifiex_private *priv, u8 *ie_data_ptr,
|
||||||
}
|
}
|
||||||
pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr;
|
pvendor_ie = (struct ieee_types_vendor_header *) ie_data_ptr;
|
||||||
/* Test to see if it is a WPA IE, if not, then it is a gen IE */
|
/* Test to see if it is a WPA IE, if not, then it is a gen IE */
|
||||||
if (((pvendor_ie->element_id == WLAN_EID_WPA) &&
|
if (((pvendor_ie->element_id == WLAN_EID_VENDOR_SPECIFIC) &&
|
||||||
(!memcmp(pvendor_ie->oui, wpa_oui, sizeof(wpa_oui)))) ||
|
(!memcmp(pvendor_ie->oui, wpa_oui, sizeof(wpa_oui)))) ||
|
||||||
(pvendor_ie->element_id == WLAN_EID_RSN)) {
|
(pvendor_ie->element_id == WLAN_EID_RSN)) {
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ static inline u8 *orinoco_get_wpa_ie(u8 *data, size_t len)
|
||||||
{
|
{
|
||||||
u8 *p = data;
|
u8 *p = data;
|
||||||
while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) {
|
while ((p + 2 + WPA_SELECTOR_LEN) < (data + len)) {
|
||||||
if ((p[0] == WLAN_EID_GENERIC) &&
|
if ((p[0] == WLAN_EID_VENDOR_SPECIFIC) &&
|
||||||
(memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0))
|
(memcmp(&p[2], WPA_OUI_TYPE, WPA_SELECTOR_LEN) == 0))
|
||||||
return p;
|
return p;
|
||||||
p += p[1] + 2;
|
p += p[1] + 2;
|
||||||
|
|
Loading…
Reference in New Issue