From: Jes Sorensen Date: Tue, 15 Apr 2014 17:44:11 +0000 (+0200) Subject: staging: rtl8723au: Remove multiple duplicate defines of the WPA OUI X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=7964eba0d8df78cae4c843330153554c8e775de6;p=deliverable%2Flinux.git staging: rtl8723au: Remove multiple duplicate defines of the WPA OUI Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ap.c b/drivers/staging/rtl8723au/core/rtw_ap.c index d049ba770900..bbf8b2eabdb3 100644 --- a/drivers/staging/rtl8723au/core/rtw_ap.c +++ b/drivers/staging/rtl8723au/core/rtw_ap.c @@ -21,7 +21,6 @@ #ifdef CONFIG_8723AU_AP_MODE -extern unsigned char RTW_WPA_OUI23A[]; extern unsigned char WMM_OUI23A[]; extern unsigned char WPS_OUI23A[]; extern unsigned char P2P_OUI23A[]; @@ -1303,7 +1302,7 @@ static void update_bcn_vendor_spec_ie(struct rtw_adapter *padapter, u8*oui) { DBG_8723A("%s\n", __func__); - if (!memcmp(RTW_WPA_OUI23A, oui, 4)) + if (!memcmp(RTW_WPA_OUI23A_TYPE, oui, 4)) { update_bcn_wpa_ie(padapter); } diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c index 930a9b189998..8fc54c806e7d 100644 --- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c @@ -497,7 +497,6 @@ int rtw_parse_wpa_ie23a(const u8* wpa_ie, int wpa_ie_len, int *group_cipher, int int i, ret = _SUCCESS; int left, count; const u8 *pos; - u8 SUITE_1X[4] = {0x00, 0x50, 0xf2, 1}; if (wpa_ie_len <= 0) { /* No WPA IE - fail silently */ @@ -560,7 +559,7 @@ int rtw_parse_wpa_ie23a(const u8* wpa_ie, int wpa_ie_len, int *group_cipher, int if (is_8021x) { if (left >= 6) { pos += 2; - if (!memcmp(pos, SUITE_1X, 4)) { + if (!memcmp(pos, RTW_WPA_OUI23A_TYPE, 4)) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s : there has 802.1x auth\n", __func__)); @@ -653,11 +652,9 @@ int rtw_get_sec_ie23a(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len) { u8 authmode, sec_idx, i; - u8 wpa_oui[4] = {0x0, 0x50, 0xf2, 0x01}; uint cnt; - /* Search required WPA or WPA2 IE and copy to sec_ie[ ] */ cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_); @@ -668,7 +665,7 @@ int rtw_get_sec_ie23a(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, authmode = in_ie[cnt]; if ((authmode == WLAN_EID_VENDOR_SPECIFIC) && - !memcmp(&in_ie[cnt+2], &wpa_oui[0], 4)) { + !memcmp(&in_ie[cnt+2], RTW_WPA_OUI23A_TYPE, 4)) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("\n rtw_get_wpa_ie23a: sec_idx =%d " "in_ie[cnt+1]+2 =%d\n", diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index a79861e4250c..d08f12f6e9d3 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -87,7 +87,6 @@ static u8 null_addr[ETH_ALEN]= {0, 0, 0, 0, 0, 0}; /************************************************** OUI definitions for the vendor specific IE ***************************************************/ -unsigned char RTW_WPA_OUI23A[] = {0x00, 0x50, 0xf2, 0x01}; unsigned char WMM_OUI23A[] = {0x00, 0x50, 0xf2, 0x02}; unsigned char WPS_OUI23A[] = {0x00, 0x50, 0xf2, 0x04}; unsigned char P2P_OUI23A[] = {0x50, 0x6F, 0x9A, 0x09}; @@ -3366,7 +3365,7 @@ void issue_assocreq23a(struct rtw_adapter *padapter) switch (pIE->ElementID) { case WLAN_EID_VENDOR_SPECIFIC: - if (!memcmp(pIE->data, RTW_WPA_OUI23A, 4) || + if (!memcmp(pIE->data, RTW_WPA_OUI23A_TYPE, 4) || !memcmp(pIE->data, WMM_OUI23A, 4) || !memcmp(pIE->data, WPS_OUI23A, 4)) { if (!padapter->registrypriv.wifi_spec) { diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c index e8127cb6c33a..84753f5ee231 100644 --- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c @@ -1145,7 +1145,7 @@ unsigned int is_ap_in_tkip23a(struct rtw_adapter *padapter) switch (pIE->ElementID) { case WLAN_EID_VENDOR_SPECIFIC: - if ((!memcmp(pIE->data, RTW_WPA_OUI23A, 4)) && (!memcmp((pIE->data + 12), WPA_TKIP_CIPHER23A, 4))) + if ((!memcmp(pIE->data, RTW_WPA_OUI23A_TYPE, 4)) && (!memcmp((pIE->data + 12), WPA_TKIP_CIPHER23A, 4))) return true; break; case WLAN_EID_RSN: @@ -1176,7 +1176,7 @@ unsigned int should_forbid_n_rate23a(struct rtw_adapter * padapter) switch (pIE->ElementID) { case WLAN_EID_VENDOR_SPECIFIC: - if (!memcmp(pIE->data, RTW_WPA_OUI23A, 4) && + if (!memcmp(pIE->data, RTW_WPA_OUI23A_TYPE, 4) && ((!memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP23A, 4)) || (!memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP23A, 4)))) return false; @@ -1211,7 +1211,7 @@ unsigned int is_ap_in_wep23a(struct rtw_adapter *padapter) switch (pIE->ElementID) { case WLAN_EID_VENDOR_SPECIFIC: - if (!memcmp(pIE->data, RTW_WPA_OUI23A, 4)) + if (!memcmp(pIE->data, RTW_WPA_OUI23A_TYPE, 4)) return false; break; case WLAN_EID_RSN: diff --git a/drivers/staging/rtl8723au/include/osdep_service.h b/drivers/staging/rtl8723au/include/osdep_service.h index 92c954eb2179..40445bbafe77 100644 --- a/drivers/staging/rtl8723au/include/osdep_service.h +++ b/drivers/staging/rtl8723au/include/osdep_service.h @@ -137,7 +137,6 @@ void _rtw_vmfree(u8 *pbuf, u32 sz); extern unsigned char REALTEK_96B_IE23A[]; extern unsigned char MCS_rate_2R23A[16]; -extern unsigned char RTW_WPA_OUI23A[]; extern unsigned char WPA_TKIP_CIPHER23A[4]; extern unsigned char RSN_TKIP_CIPHER23A[4]; diff --git a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h index 275f891b6c64..13f580d9d96f 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h @@ -89,7 +89,6 @@ #define _54M_RATE_ 11 -extern unsigned char RTW_WPA_OUI23A[]; extern unsigned char WMM_OUI23A[]; extern unsigned char WPS_OUI23A[]; extern unsigned char WFD_OUI23A[];