|
@@ -486,15 +486,15 @@ unsigned char *rtw_get_wpa2_ie(unsigned char *pie, int *rsn_ie_len, int limit)
|
|
|
|
|
|
int rtw_get_wpa_cipher_suite(u8 *s)
|
|
int rtw_get_wpa_cipher_suite(u8 *s)
|
|
{
|
|
{
|
|
- if (!memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, WPA_CIPHER_SUITE_NONE, WPA_SELECTOR_LEN))
|
|
return WPA_CIPHER_NONE;
|
|
return WPA_CIPHER_NONE;
|
|
- if (!memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, WPA_CIPHER_SUITE_WEP40, WPA_SELECTOR_LEN))
|
|
return WPA_CIPHER_WEP40;
|
|
return WPA_CIPHER_WEP40;
|
|
- if (!memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, WPA_CIPHER_SUITE_TKIP, WPA_SELECTOR_LEN))
|
|
return WPA_CIPHER_TKIP;
|
|
return WPA_CIPHER_TKIP;
|
|
- if (!memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, WPA_CIPHER_SUITE_CCMP, WPA_SELECTOR_LEN))
|
|
return WPA_CIPHER_CCMP;
|
|
return WPA_CIPHER_CCMP;
|
|
- if (!memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, WPA_CIPHER_SUITE_WEP104, WPA_SELECTOR_LEN))
|
|
return WPA_CIPHER_WEP104;
|
|
return WPA_CIPHER_WEP104;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -502,15 +502,15 @@ int rtw_get_wpa_cipher_suite(u8 *s)
|
|
|
|
|
|
int rtw_get_wpa2_cipher_suite(u8 *s)
|
|
int rtw_get_wpa2_cipher_suite(u8 *s)
|
|
{
|
|
{
|
|
- if (!memcmp(s, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN))
|
|
return WPA_CIPHER_NONE;
|
|
return WPA_CIPHER_NONE;
|
|
- if (!memcmp(s, RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN))
|
|
return WPA_CIPHER_WEP40;
|
|
return WPA_CIPHER_WEP40;
|
|
- if (!memcmp(s, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN))
|
|
return WPA_CIPHER_TKIP;
|
|
return WPA_CIPHER_TKIP;
|
|
- if (!memcmp(s, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, RSN_CIPHER_SUITE_CCMP, RSN_SELECTOR_LEN))
|
|
return WPA_CIPHER_CCMP;
|
|
return WPA_CIPHER_CCMP;
|
|
- if (!memcmp(s, RSN_CIPHER_SUITE_WEP104, RSN_SELECTOR_LEN) == true)
|
|
|
|
|
|
+ if (!memcmp(s, RSN_CIPHER_SUITE_WEP104, RSN_SELECTOR_LEN))
|
|
return WPA_CIPHER_WEP104;
|
|
return WPA_CIPHER_WEP104;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -531,7 +531,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|
|
|
|
|
|
|
|
|
if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
|
|
if ((*wpa_ie != _WPA_IE_ID_) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
|
|
- (!memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN) != true))
|
|
|
|
|
|
+ (memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN)))
|
|
return _FAIL;
|
|
return _FAIL;
|
|
|
|
|
|
pos = wpa_ie;
|
|
pos = wpa_ie;
|
|
@@ -576,7 +576,7 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|
if (is_8021x) {
|
|
if (is_8021x) {
|
|
if (left >= 6) {
|
|
if (left >= 6) {
|
|
pos += 2;
|
|
pos += 2;
|
|
- if (!memcmp(pos, SUITE_1X, 4) == 1) {
|
|
|
|
|
|
+ if (!memcmp(pos, SUITE_1X, 4)) {
|
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s : there has 802.1x auth\n", __func__));
|
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s : there has 802.1x auth\n", __func__));
|
|
*is_8021x = 1;
|
|
*is_8021x = 1;
|
|
}
|
|
}
|
|
@@ -646,7 +646,7 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|
if (is_8021x) {
|
|
if (is_8021x) {
|
|
if (left >= 6) {
|
|
if (left >= 6) {
|
|
pos += 2;
|
|
pos += 2;
|
|
- if (!memcmp(pos, SUITE_1X, 4) == 1) {
|
|
|
|
|
|
+ if (!memcmp(pos, SUITE_1X, 4)) {
|
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s (): there has 802.1x auth\n", __func__));
|
|
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s (): there has 802.1x auth\n", __func__));
|
|
*is_8021x = 1;
|
|
*is_8021x = 1;
|
|
}
|
|
}
|
|
@@ -800,7 +800,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_at
|
|
*len_attr = 0;
|
|
*len_attr = 0;
|
|
|
|
|
|
if ((wps_ie[0] != _VENDOR_SPECIFIC_IE_) ||
|
|
if ((wps_ie[0] != _VENDOR_SPECIFIC_IE_) ||
|
|
- (!memcmp(wps_ie + 2, wps_oui , 4) != true))
|
|
|
|
|
|
+ (memcmp(wps_ie + 2, wps_oui , 4)))
|
|
return attr_ptr;
|
|
return attr_ptr;
|
|
|
|
|
|
/* 6 = 1(Element ID) + 1(Length) + 4(WPS OUI) */
|
|
/* 6 = 1(Element ID) + 1(Length) + 4(WPS OUI) */
|
|
@@ -1210,7 +1210,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|
dump_stack();
|
|
dump_stack();
|
|
return NULL;
|
|
return NULL;
|
|
}
|
|
}
|
|
- if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&in_ie[cnt+2], p2p_oui, 4) == true)) {
|
|
|
|
|
|
+ if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&in_ie[cnt+2], p2p_oui, 4))) {
|
|
p2p_ie_ptr = in_ie + cnt;
|
|
p2p_ie_ptr = in_ie + cnt;
|
|
|
|
|
|
if (p2p_ie != NULL)
|
|
if (p2p_ie != NULL)
|
|
@@ -1245,7 +1245,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_att
|
|
*len_attr = 0;
|
|
*len_attr = 0;
|
|
|
|
|
|
if (!p2p_ie || (p2p_ie[0] != _VENDOR_SPECIFIC_IE_) ||
|
|
if (!p2p_ie || (p2p_ie[0] != _VENDOR_SPECIFIC_IE_) ||
|
|
- (!memcmp(p2p_ie + 2, p2p_oui , 4) != true))
|
|
|
|
|
|
+ (memcmp(p2p_ie + 2, p2p_oui , 4)))
|
|
return attr_ptr;
|
|
return attr_ptr;
|
|
|
|
|
|
/* 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type) */
|
|
/* 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type) */
|