rtl8188eu: Remove the wrapper around memcmp()

The tricky part here is that the wrapper, _rtw_memcmp(), returns true if the
two arguments are equal, whereas memcmp() returns false in that case.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-12-17 13:31:01 -06:00
parent 999a777041
commit a010d15b64
35 changed files with 881 additions and 890 deletions

View file

@ -296,7 +296,7 @@ void expire_timeout_chk(_adapter *padapter)
/* then driver may check fail due to not recv client's frame under sitesurvey, /* then driver may check fail due to not recv client's frame under sitesurvey,
* don't expire timeout chk under MCC under sitesurvey */ * don't expire timeout chk under MCC under sitesurvey */
if (rtw_hal_mcc_link_status_chk(padapter, __func__) == false) if (!rtw_hal_mcc_link_status_chk(padapter, __func__))
return; return;
#endif #endif
@ -307,19 +307,19 @@ void expire_timeout_chk(_adapter *padapter)
/* check auth_queue */ /* check auth_queue */
#ifdef DBG_EXPIRATION_CHK #ifdef DBG_EXPIRATION_CHK
if (rtw_end_of_queue_search(phead, plist) == false) { if (!rtw_end_of_queue_search(phead, plist)) {
RTW_INFO(FUNC_NDEV_FMT" auth_list, cnt:%u\n" RTW_INFO(FUNC_NDEV_FMT" auth_list, cnt:%u\n"
, FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->auth_list_cnt); , FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->auth_list_cnt);
} }
#endif #endif
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((!rtw_end_of_queue_search(phead, plist))) {
psta = LIST_CONTAINOR(plist, struct sta_info, auth_list); psta = LIST_CONTAINOR(plist, struct sta_info, auth_list);
plist = get_next(plist); plist = get_next(plist);
#ifdef CONFIG_ATMEL_RC_PATCH #ifdef CONFIG_ATMEL_RC_PATCH
if (true == _rtw_memcmp((void *)(pstapriv->atmel_rc_pattern), (void *)(psta->hwaddr), ETH_ALEN)) if (!memcmp((void *)(pstapriv->atmel_rc_pattern), (void *)(psta->hwaddr), ETH_ALEN))
continue; continue;
if (psta->flag_atmel_rc) if (psta->flag_atmel_rc)
continue; continue;
@ -356,18 +356,18 @@ void expire_timeout_chk(_adapter *padapter)
/* check asoc_queue */ /* check asoc_queue */
#ifdef DBG_EXPIRATION_CHK #ifdef DBG_EXPIRATION_CHK
if (rtw_end_of_queue_search(phead, plist) == false) { if (!rtw_end_of_queue_search(phead, plist)) {
RTW_INFO(FUNC_NDEV_FMT" asoc_list, cnt:%u\n" RTW_INFO(FUNC_NDEV_FMT" asoc_list, cnt:%u\n"
, FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->asoc_list_cnt); , FUNC_NDEV_ARG(padapter->pnetdev), pstapriv->asoc_list_cnt);
} }
#endif #endif
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((!rtw_end_of_queue_search(phead, plist))) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);
#ifdef CONFIG_ATMEL_RC_PATCH #ifdef CONFIG_ATMEL_RC_PATCH
RTW_INFO("%s:%d psta=%p, %02x,%02x||%02x,%02x \n\n", __func__, __LINE__, RTW_INFO("%s:%d psta=%p, %02x,%02x||%02x,%02x \n\n", __func__, __LINE__,
psta, pstapriv->atmel_rc_pattern[0], pstapriv->atmel_rc_pattern[5], psta->hwaddr[0], psta->hwaddr[5]); psta, pstapriv->atmel_rc_pattern[0], pstapriv->atmel_rc_pattern[5], psta->hwaddr[0], psta->hwaddr[5]);
if (true == _rtw_memcmp((void *)pstapriv->atmel_rc_pattern, (void *)(psta->hwaddr), ETH_ALEN)) if (!memcmp((void *)pstapriv->atmel_rc_pattern, (void *)(psta->hwaddr), ETH_ALEN))
continue; continue;
if (psta->flag_atmel_rc) if (psta->flag_atmel_rc)
continue; continue;
@ -429,7 +429,7 @@ void expire_timeout_chk(_adapter *padapter)
} else if ((psta->keep_alive_trycnt > KEEP_ALIVE_TRYCNT) && !(psta->state & WIFI_STA_ALIVE_CHK_STATE)) } else if ((psta->keep_alive_trycnt > KEEP_ALIVE_TRYCNT) && !(psta->state & WIFI_STA_ALIVE_CHK_STATE))
psta->keep_alive_trycnt = 0; psta->keep_alive_trycnt = 0;
if ((psta->htpriv.ht_option == true) && (psta->htpriv.ampdu_enable == true)) { if ((psta->htpriv.ht_option ) && (psta->htpriv.ampdu_enable == true)) {
uint priority = 1; /* test using BK */ uint priority = 1; /* test using BK */
u8 issued = 0; u8 issued = 0;
@ -534,7 +534,7 @@ void expire_timeout_chk(_adapter *padapter)
} }
#endif #endif
/* switch to correct channel of current network before issue keep-alive frames */ /* switch to correct channel of current network before issue keep-alive frames */
if (switch_channel == true && rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) { if (switch_channel && rtw_get_oper_ch(padapter) != pmlmeext->cur_channel) {
backup_ch = rtw_get_oper_ch(padapter); backup_ch = rtw_get_oper_ch(padapter);
backup_bw = rtw_get_oper_bw(padapter); backup_bw = rtw_get_oper_bw(padapter);
backup_offset = rtw_get_oper_choffset(padapter); backup_offset = rtw_get_oper_choffset(padapter);
@ -547,7 +547,7 @@ void expire_timeout_chk(_adapter *padapter)
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]); psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
#ifdef CONFIG_ATMEL_RC_PATCH #ifdef CONFIG_ATMEL_RC_PATCH
if (true == _rtw_memcmp(pstapriv->atmel_rc_pattern, psta->hwaddr, ETH_ALEN)) if (!memcmp(pstapriv->atmel_rc_pattern, psta->hwaddr, ETH_ALEN))
continue; continue;
if (psta->flag_atmel_rc) if (psta->flag_atmel_rc)
continue; continue;
@ -575,7 +575,7 @@ void expire_timeout_chk(_adapter *padapter)
psta->keep_alive_trycnt = 0; psta->keep_alive_trycnt = 0;
RTW_INFO("asoc expire "MAC_FMT", state=0x%x\n", MAC_ARG(psta->hwaddr), psta->state); RTW_INFO("asoc expire "MAC_FMT", state=0x%x\n", MAC_ARG(psta->hwaddr), psta->state);
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
if (rtw_is_list_empty(&psta->asoc_list) == false) { if (!rtw_is_list_empty(&psta->asoc_list)) {
rtw_list_delete(&psta->asoc_list); rtw_list_delete(&psta->asoc_list);
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
updated = ap_free_sta(padapter, psta, false, WLAN_REASON_DEAUTH_LEAVING, true); updated = ap_free_sta(padapter, psta, false, WLAN_REASON_DEAUTH_LEAVING, true);
@ -1063,7 +1063,7 @@ static void rtw_ap_check_scan(_adapter *padapter)
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
phead = get_list_head(queue); phead = get_list_head(queue);
if (rtw_end_of_queue_search(phead, get_next(phead)) == true) if (rtw_end_of_queue_search(phead, get_next(phead)) )
if (padapter->registrypriv.wifi_spec) { if (padapter->registrypriv.wifi_spec) {
do_scan = true; do_scan = true;
reason |= RTW_AUTO_SCAN_REASON_2040_BSS; reason |= RTW_AUTO_SCAN_REASON_2040_BSS;
@ -1078,7 +1078,7 @@ static void rtw_ap_check_scan(_adapter *padapter)
} }
#endif #endif
if (true == do_scan) { if (do_scan) {
RTW_INFO("%s : drv scans by itself and wait_completed\n", __func__); RTW_INFO("%s : drv scans by itself and wait_completed\n", __func__);
rtw_drv_scan_by_self(padapter, reason); rtw_drv_scan_by_self(padapter, reason);
rtw_scan_wait_completed(padapter); rtw_scan_wait_completed(padapter);
@ -1095,14 +1095,14 @@ static void rtw_ap_check_scan(_adapter *padapter)
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0 if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0
&& rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig) == true && rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig)
&& true == rtw_validate_ssid(&(pnetwork->network.Ssid))) { && rtw_validate_ssid(&(pnetwork->network.Ssid))) {
delta_time = (u32) rtw_get_passing_time_ms(pnetwork->last_scanned); delta_time = (u32) rtw_get_passing_time_ms(pnetwork->last_scanned);
if (delta_time < lifetime) { if (delta_time < lifetime) {
@ -1314,11 +1314,11 @@ chbw_decision:
update_beacon: update_beacon:
/* update beacon content only if bstart_bss is true */ /* update beacon content only if bstart_bss is true */
if (true == pmlmeext->bstart_bss) { if (pmlmeext->bstart_bss) {
unsigned long irqL; unsigned long irqL;
if ((ATOMIC_READ(&pmlmepriv->olbc) == true) || (ATOMIC_READ(&pmlmepriv->olbc_ht) == true)) { if ((ATOMIC_READ(&pmlmepriv->olbc) ) || (ATOMIC_READ(&pmlmepriv->olbc_ht) == true)) {
/* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */ /* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */
pmlmepriv->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK); pmlmepriv->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK);
@ -1528,7 +1528,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_; psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) { for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
if ((p) && (_rtw_memcmp(p + 2, OUI1, 4))) { if ((p) && (!memcmp(p + 2, OUI1, 4))) {
if (rtw_parse_wpa_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { if (rtw_parse_wpa_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
@ -1552,7 +1552,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
if (pregistrypriv->wmm_enable) { if (pregistrypriv->wmm_enable) {
for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) { for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) {
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
if ((p) && _rtw_memcmp(p + 2, WMM_PARA_IE, 6)) { if ((p) && !memcmp(p + 2, WMM_PARA_IE, 6)) {
pmlmepriv->qospriv.qos_option = 1; pmlmepriv->qospriv.qos_option = 1;
*(p + 8) |= BIT(7); /* QoS Info, support U-APSD */ *(p + 8) |= BIT(7); /* QoS Info, support U-APSD */
@ -1590,10 +1590,10 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
rtw_ht_use_default_setting(padapter); rtw_ht_use_default_setting(padapter);
/* Update HT Capabilities Info field */ /* Update HT Capabilities Info field */
if (pmlmepriv->htpriv.sgi_20m == false) if (!pmlmepriv->htpriv.sgi_20m)
pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_20)); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_20));
if (pmlmepriv->htpriv.sgi_40m == false) if (!pmlmepriv->htpriv.sgi_40m)
pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_40)); pht_cap->cap_info &= cpu_to_le16(~(IEEE80211_HT_CAP_SGI_40));
if (!TEST_FLAG(pmlmepriv->htpriv.ldpc_cap, LDPC_HT_ENABLE_RX)) if (!TEST_FLAG(pmlmepriv->htpriv.ldpc_cap, LDPC_HT_ENABLE_RX))
@ -1718,7 +1718,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
} }
/* ht_cap */ /* ht_cap */
if (pregistrypriv->ht_enable && ht_cap == true) { if (pregistrypriv->ht_enable && ht_cap ) {
pmlmepriv->htpriv.ht_option = true; pmlmepriv->htpriv.ht_option = true;
pmlmepriv->qospriv.qos_option = 1; pmlmepriv->qospriv.qos_option = 1;
@ -1807,11 +1807,11 @@ static void rtw_macaddr_acl_deinit(_adapter *adapter)
_enter_critical_bh(&(acl_node_q->lock), &irqL); _enter_critical_bh(&(acl_node_q->lock), &irqL);
head = get_list_head(acl_node_q); head = get_list_head(acl_node_q);
list = get_next(head); list = get_next(head);
while (rtw_end_of_queue_search(head, list) == false) { while (!rtw_end_of_queue_search(head, list)) {
acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list);
list = get_next(list); list = get_next(list);
if (acl_node->valid == true) { if (acl_node->valid ) {
acl_node->valid = false; acl_node->valid = false;
rtw_list_delete(&acl_node->list); rtw_list_delete(&acl_node->list);
acl->num--; acl->num--;
@ -1857,8 +1857,8 @@ int rtw_acl_add_sta(_adapter *adapter, const u8 *addr)
acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list);
list = get_next(list); list = get_next(list);
if (_rtw_memcmp(acl_node->addr, addr, ETH_ALEN)) { if (!memcmp(acl_node->addr, addr, ETH_ALEN)) {
if (acl_node->valid == true) { if (acl_node->valid ) {
existed = 1; existed = 1;
break; break;
} }
@ -1921,8 +1921,8 @@ int rtw_acl_remove_sta(_adapter *adapter, const u8 *addr)
acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list);
list = get_next(list); list = get_next(list);
if (is_baddr || _rtw_memcmp(acl_node->addr, addr, ETH_ALEN)) { if (is_baddr || !memcmp(acl_node->addr, addr, ETH_ALEN)) {
if (acl_node->valid == true) { if (acl_node->valid ) {
acl_node->valid = false; acl_node->valid = false;
rtw_list_delete(&acl_node->list); rtw_list_delete(&acl_node->list);
acl->num--; acl->num--;
@ -2124,7 +2124,7 @@ static u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
if (xmitframe_hiq_filter(pxmitframe) == true) if (xmitframe_hiq_filter(pxmitframe) )
pxmitframe->attrib.qsel = QSLT_HIGH;/*HIQ*/ pxmitframe->attrib.qsel = QSLT_HIGH;/*HIQ*/
rtw_hal_xmitframe_enqueue(padapter, pxmitframe); rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
@ -2145,7 +2145,7 @@ static u8 rtw_ap_bmc_frames_hdl(_adapter *padapter)
pstapriv->tim_bitmap &= ~BIT(0); pstapriv->tim_bitmap &= ~BIT(0);
pstapriv->sta_dz_bitmap &= ~BIT(0); pstapriv->sta_dz_bitmap &= ~BIT(0);
if (update_tim == true) { if (update_tim ) {
RTW_INFO("clear TIB\n"); RTW_INFO("clear TIB\n");
_update_beacon(padapter, _TIM_IE_, NULL, true, "bmc sleepq and HIQ empty"); _update_beacon(padapter, _TIM_IE_, NULL, true, "bmc sleepq and HIQ empty");
} }
@ -2219,7 +2219,7 @@ static void update_bcn_ext_capab_ie(_adapter *padapter)
rtw_remove_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_); rtw_remove_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_);
if ((pmlmepriv->ext_capab_ie_len > 0) && if ((pmlmepriv->ext_capab_ie_len > 0) &&
(_rtw_memcmp(pmlmepriv->ext_capab_ie_data, null_extcap_data, sizeof(null_extcap_data)) == false)) (!memcmp(pmlmepriv->ext_capab_ie_data, null_extcap_data, sizeof(null_extcap_data)) == false))
rtw_add_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_, pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len); rtw_add_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_, pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len);
} }
@ -2305,8 +2305,8 @@ static void update_bcn_htinfo_ie(_adapter *padapter)
/* for STA Channel Width/Secondary Channel Offset*/ /* for STA Channel Width/Secondary Channel Offset*/
if ((pmlmepriv->sw_to_20mhz == 0) && (pmlmeext->cur_channel <= 14)) { if ((pmlmepriv->sw_to_20mhz == 0) && (pmlmeext->cur_channel <= 14)) {
if ((pmlmepriv->num_sta_40mhz_intolerant > 0) || (pmlmepriv->ht_20mhz_width_req == true) if ((pmlmepriv->num_sta_40mhz_intolerant > 0) || (pmlmepriv->ht_20mhz_width_req )
|| (pmlmepriv->ht_intolerant_ch_reported == true) || (ATOMIC_READ(&pmlmepriv->olbc) == true)) { || (pmlmepriv->ht_intolerant_ch_reported ) || (ATOMIC_READ(&pmlmepriv->olbc) == true)) {
SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info, 0); SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info, 0);
SET_HT_OP_ELE_STA_CHL_WIDTH(pht_info, 0); SET_HT_OP_ELE_STA_CHL_WIDTH(pht_info, 0);
@ -2447,13 +2447,13 @@ static void update_bcn_vendor_spec_ie(_adapter *padapter, u8 *oui)
{ {
RTW_INFO("%s\n", __func__); RTW_INFO("%s\n", __func__);
if (_rtw_memcmp(RTW_WPA_OUI, oui, 4)) if (!memcmp(RTW_WPA_OUI, oui, 4))
update_bcn_wpa_ie(padapter); update_bcn_wpa_ie(padapter);
else if (_rtw_memcmp(WMM_OUI, oui, 4)) else if (!memcmp(WMM_OUI, oui, 4))
update_bcn_wmm_ie(padapter); update_bcn_wmm_ie(padapter);
else if (_rtw_memcmp(WPS_OUI, oui, 4)) else if (!memcmp(WPS_OUI, oui, 4))
update_bcn_wps_ie(padapter); update_bcn_wps_ie(padapter);
else if (_rtw_memcmp(P2P_OUI, oui, 4)) else if (!memcmp(P2P_OUI, oui, 4))
update_bcn_p2p_ie(padapter); update_bcn_p2p_ie(padapter);
else else
RTW_INFO("unknown OUI type!\n"); RTW_INFO("unknown OUI type!\n");
@ -2726,7 +2726,7 @@ int rtw_ht_operation_update(_adapter *padapter)
void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type) void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type)
{ {
/* update associcated stations cap. */ /* update associcated stations cap. */
if (updated == true) { if (updated ) {
unsigned long irqL; unsigned long irqL;
_list *phead, *plist; _list *phead, *plist;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
@ -2877,7 +2877,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
psta->no_ht_set = 1; psta->no_ht_set = 1;
pmlmepriv->num_sta_no_ht++; pmlmepriv->num_sta_no_ht++;
} }
if (pmlmepriv->htpriv.ht_option == true) { if (pmlmepriv->htpriv.ht_option ) {
RTW_INFO("%s STA " MAC_FMT RTW_INFO("%s STA " MAC_FMT
" - no HT, num of non-HT stations %d\n", " - no HT, num of non-HT stations %d\n",
__func__, MAC_ARG(psta->hwaddr), __func__, MAC_ARG(psta->hwaddr),
@ -2972,7 +2972,7 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
if (!psta) if (!psta)
return beacon_updated; return beacon_updated;
if (active == true) { if (active ) {
/* tear down Rx AMPDU */ /* tear down Rx AMPDU */
send_delba(padapter, 0, psta->hwaddr);/* recipient */ send_delba(padapter, 0, psta->hwaddr);/* recipient */
@ -3323,7 +3323,7 @@ void stop_ap_mode(_adapter *padapter)
rtw_free_mlme_priv_ie_data(pmlmepriv); rtw_free_mlme_priv_ie_data(pmlmepriv);
#ifdef CONFIG_SWTIMER_BASED_TXBCN #ifdef CONFIG_SWTIMER_BASED_TXBCN
if (pmlmeext->bstart_bss == true) { if (pmlmeext->bstart_bss ) {
_enter_critical_bh(&pdvobj->ap_if_q.lock, &irqL); _enter_critical_bh(&pdvobj->ap_if_q.lock, &irqL);
pdvobj->nr_ap_if--; pdvobj->nr_ap_if--;
if (pdvobj->nr_ap_if > 0) if (pdvobj->nr_ap_if > 0)
@ -3422,7 +3422,7 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw,
bss->Configuration.DSConfig = ch; bss->Configuration.DSConfig = ch;
/* band is changed, update ERP, support rate, ext support rate IE */ /* band is changed, update ERP, support rate, ext support rate IE */
if (change_band == true) if (change_band )
change_band_update_ie(adapter, bss, ch); change_band_update_ie(adapter, bss, ch);
} }
@ -3595,10 +3595,10 @@ choose_chbw:
if (!rtw_odm_dfs_domain_unknown(adapter)) { if (!rtw_odm_dfs_domain_unknown(adapter)) {
/* choose 5G DFS channel for debug */ /* choose 5G DFS channel for debug */
if (adapter_to_rfctl(adapter)->dbg_dfs_master_choose_dfs_ch_first if (adapter_to_rfctl(adapter)->dbg_dfs_master_choose_dfs_ch_first
&& rtw_choose_shortest_waiting_ch(adapter, req_bw, &dec_ch, &dec_bw, &dec_offset, RTW_CHF_2G | RTW_CHF_NON_DFS) == true) && rtw_choose_shortest_waiting_ch(adapter, req_bw, &dec_ch, &dec_bw, &dec_offset, RTW_CHF_2G | RTW_CHF_NON_DFS) )
RTW_INFO(FUNC_ADPT_FMT" choose 5G DFS channel for debug\n", FUNC_ADPT_ARG(adapter)); RTW_INFO(FUNC_ADPT_FMT" choose 5G DFS channel for debug\n", FUNC_ADPT_ARG(adapter));
else if (adapter_to_rfctl(adapter)->dfs_ch_sel_d_flags else if (adapter_to_rfctl(adapter)->dfs_ch_sel_d_flags
&& rtw_choose_shortest_waiting_ch(adapter, req_bw, &dec_ch, &dec_bw, &dec_offset, adapter_to_rfctl(adapter)->dfs_ch_sel_d_flags) == true) && rtw_choose_shortest_waiting_ch(adapter, req_bw, &dec_ch, &dec_bw, &dec_offset, adapter_to_rfctl(adapter)->dfs_ch_sel_d_flags) )
RTW_INFO(FUNC_ADPT_FMT" choose with dfs_ch_sel_d_flags:0x%02x for debug\n", FUNC_ADPT_ARG(adapter), adapter_to_rfctl(adapter)->dfs_ch_sel_d_flags); RTW_INFO(FUNC_ADPT_FMT" choose with dfs_ch_sel_d_flags:0x%02x for debug\n", FUNC_ADPT_ARG(adapter), adapter_to_rfctl(adapter)->dfs_ch_sel_d_flags);
else if (rtw_choose_shortest_waiting_ch(adapter, req_bw, &dec_ch, &dec_bw, &dec_offset, 0) == false) { else if (rtw_choose_shortest_waiting_ch(adapter, req_bw, &dec_ch, &dec_bw, &dec_offset, 0) == false) {
RTW_WARN(FUNC_ADPT_FMT" no available channel\n", FUNC_ADPT_ARG(adapter)); RTW_WARN(FUNC_ADPT_FMT" no available channel\n", FUNC_ADPT_ARG(adapter));
@ -3632,7 +3632,7 @@ update_bss_chbw:
|| mlmeext->cur_ch_offset != dec_offset) || mlmeext->cur_ch_offset != dec_offset)
changed = true; changed = true;
if (changed == true && rtw_linked_check(adapter) == true) { if (changed && rtw_linked_check(adapter) == true) {
#ifdef CONFIG_SPCT_CH_SWITCH #ifdef CONFIG_SPCT_CH_SWITCH
if (1) if (1)
rtw_ap_inform_ch_switch(adapter, dec_ch, dec_offset); rtw_ap_inform_ch_switch(adapter, dec_ch, dec_offset);
@ -3650,11 +3650,11 @@ update_bss_chbw:
RTW_INFO(FUNC_ADPT_FMT" dec: %u,%u,%u\n", FUNC_ADPT_ARG(adapter), dec_ch, dec_bw, dec_offset); RTW_INFO(FUNC_ADPT_FMT" dec: %u,%u,%u\n", FUNC_ADPT_ARG(adapter), dec_ch, dec_bw, dec_offset);
if (set_u_ch == true) { if (set_u_ch ) {
*ch = u_ch; *ch = u_ch;
*bw = u_bw; *bw = u_bw;
*offset = u_offset; *offset = u_offset;
} else if (set_dec_ch == true) { } else if (set_dec_ch ) {
*ch = dec_ch; *ch = dec_ch;
*bw = dec_bw; *bw = dec_bw;
*offset = dec_offset; *offset = dec_offset;
@ -3731,7 +3731,7 @@ void tx_beacon_handler(struct dvobj_priv *pdvobj)
padapter = NULL; padapter = NULL;
phead = get_list_head(&pdvobj->ap_if_q); phead = get_list_head(&pdvobj->ap_if_q);
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((!rtw_end_of_queue_search(phead, plist))) {
padapter = LIST_CONTAINOR(plist, struct _ADAPTER, list); padapter = LIST_CONTAINOR(plist, struct _ADAPTER, list);
plist = get_next(plist); plist = get_next(plist);

View file

@ -520,7 +520,7 @@ static void _sounding_update_min_period(PADAPTER adapter, u16 period, u8 leave)
info = GET_BEAMFORM_INFO(adapter); info = GET_BEAMFORM_INFO(adapter);
if (true == leave) { if (leave) {
/* /*
* When a BFee left, * When a BFee left,
* we need to find the latest min sounding period * we need to find the latest min sounding period
@ -764,7 +764,7 @@ static void _sounding_handler(PADAPTER adapter)
/* Reset sounding timeout flag for the new sounding */ /* Reset sounding timeout flag for the new sounding */
bfee->bSoundingTimeout = false; bfee->bSoundingTimeout = false;
if (true == bfee->bDeleteSounding) { if (bfee->bDeleteSounding) {
u8 res = false; u8 res = false;
rtw_bf_cmd(adapter, BEAMFORMING_CTRL_END_PERIOD, &res, 1, 0); rtw_bf_cmd(adapter, BEAMFORMING_CTRL_END_PERIOD, &res, 1, 0);
return; return;
@ -954,7 +954,7 @@ static struct beamformer_entry *_bfer_get_entry_by_addr(PADAPTER adapter, u8 *ra
bfer = &info->bfer_entry[i]; bfer = &info->bfer_entry[i];
if (bfer->used == false) if (bfer->used == false)
continue; continue;
if (_rtw_memcmp(ra, bfer->mac_addr, ETH_ALEN) == true) if (!memcmp(ra, bfer->mac_addr, ETH_ALEN) == true)
return bfer; return bfer;
} }
@ -1086,7 +1086,7 @@ static struct beamformee_entry *_bfee_get_entry_by_addr(PADAPTER adapter, u8 *ra
bfee = &info->bfee_entry[i]; bfee = &info->bfee_entry[i];
if (bfee->used == false) if (bfee->used == false)
continue; continue;
if (_rtw_memcmp(ra, bfee->mac_addr, ETH_ALEN) == true) if (!memcmp(ra, bfee->mac_addr, ETH_ALEN) == true)
return bfee; return bfee;
} }
@ -1204,7 +1204,7 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter,
info->beamformee_mu_cnt += 1; info->beamformee_mu_cnt += 1;
info->first_mu_bfee_index = _bfee_get_first_mu_entry_idx(adapter, NULL); info->first_mu_bfee_index = _bfee_get_first_mu_entry_idx(adapter, NULL);
if (true == info->bEnableSUTxBFWorkAround) { if (info->bEnableSUTxBFWorkAround) {
/* When the first MU BFee added, discard SU BFee bfee's capability */ /* When the first MU BFee added, discard SU BFee bfee's capability */
if ((info->beamformee_mu_cnt == 1) && (info->beamformee_su_cnt > 0)) { if ((info->beamformee_mu_cnt == 1) && (info->beamformee_su_cnt > 0)) {
if (info->TargetSUBFee) { if (info->TargetSUBFee) {
@ -1233,7 +1233,7 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter,
} else if (TEST_FLAG(bf_cap, BEAMFORMEE_CAP_VHT_SU|BEAMFORMEE_CAP_HT_EXPLICIT)) { } else if (TEST_FLAG(bf_cap, BEAMFORMEE_CAP_VHT_SU|BEAMFORMEE_CAP_HT_EXPLICIT)) {
info->beamformee_su_cnt += 1; info->beamformee_su_cnt += 1;
if (true == info->bEnableSUTxBFWorkAround) { if (info->bEnableSUTxBFWorkAround) {
/* Record the first SU BFee index. We only allow the first SU BFee to be sound */ /* Record the first SU BFee index. We only allow the first SU BFee to be sound */
if ((info->beamformee_su_cnt == 1) && (info->beamformee_mu_cnt == 0)) { if ((info->beamformee_su_cnt == 1) && (info->beamformee_mu_cnt == 0)) {
info->TargetSUBFee = bfee; info->TargetSUBFee = bfee;
@ -1273,7 +1273,7 @@ static void _bfee_remove_entry(PADAPTER adapter, struct beamformee_entry *entry)
info->beamformee_mu_cnt -= 1; info->beamformee_mu_cnt -= 1;
info->first_mu_bfee_index = _bfee_get_first_mu_entry_idx(adapter, entry); info->first_mu_bfee_index = _bfee_get_first_mu_entry_idx(adapter, entry);
if (true == info->bEnableSUTxBFWorkAround) { if (info->bEnableSUTxBFWorkAround) {
if ((info->beamformee_mu_cnt == 0) && (info->beamformee_su_cnt > 0)) { if ((info->beamformee_mu_cnt == 0) && (info->beamformee_su_cnt > 0)) {
idx = _bfee_get_first_su_entry_idx(adapter, NULL); idx = _bfee_get_first_su_entry_idx(adapter, NULL);
info->TargetSUBFee = &info->bfee_entry[idx]; info->TargetSUBFee = &info->bfee_entry[idx];
@ -1285,7 +1285,7 @@ static void _bfee_remove_entry(PADAPTER adapter, struct beamformee_entry *entry)
info->beamformee_su_cnt -= 1; info->beamformee_su_cnt -= 1;
/* When the target SU BFee leaves, disable workaround */ /* When the target SU BFee leaves, disable workaround */
if ((true == info->bEnableSUTxBFWorkAround) if ((info->bEnableSUTxBFWorkAround)
&& (entry == info->TargetSUBFee)) { && (entry == info->TargetSUBFee)) {
entry->bSuspendSUCap = true; entry->bSuspendSUCap = true;
info->TargetSUBFee = NULL; info->TargetSUBFee = NULL;
@ -1483,18 +1483,18 @@ static void _beamforming_sounding_down(PADAPTER adapter, u8 status)
* old sound down event happens in the new sounding period. * old sound down event happens in the new sounding period.
* 2015.12.10 * 2015.12.10
*/ */
if (true == bfee->bSoundingTimeout) { if (bfee->bSoundingTimeout) {
RTW_WARN("%s: The entry[%d] is bSoundingTimeout!\n", __func__, sounding->su_bfee_curidx); RTW_WARN("%s: The entry[%d] is bSoundingTimeout!\n", __func__, sounding->su_bfee_curidx);
bfee->bSoundingTimeout = false; bfee->bSoundingTimeout = false;
return; return;
} }
if (true == status) { if (status) {
/* success */ /* success */
bfee->LogStatusFailCnt = 0; bfee->LogStatusFailCnt = 0;
info->SetHalSoundownOnDemandCnt++; info->SetHalSoundownOnDemandCnt++;
rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_STATUS, &status); rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_STATUS, &status);
} else if (true == bfee->bDeleteSounding) { } else if (bfee->bDeleteSounding) {
RTW_WARN("%s: Delete entry[%d] sounding info!\n", __func__, sounding->su_bfee_curidx); RTW_WARN("%s: Delete entry[%d] sounding info!\n", __func__, sounding->su_bfee_curidx);
rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_STATUS, &status); rtw_hal_set_hwreg(adapter, HW_VAR_SOUNDING_STATUS, &status);
bfee->bDeleteSounding = false; bfee->bDeleteSounding = false;
@ -1626,7 +1626,7 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame)
} }
/* Update current CSI report info */ /* Update current CSI report info */
if ((true == info->bEnableSUTxBFWorkAround) if ((info->bEnableSUTxBFWorkAround)
&& (info->TargetSUBFee == bfee)) { && (info->TargetSUBFee == bfee)) {
if ((info->TargetCSIInfo.Nc != Nc) || (info->TargetCSIInfo.Nr != Nr) || if ((info->TargetCSIInfo.Nc != Nc) || (info->TargetCSIInfo.Nr != Nr) ||
(info->TargetCSIInfo.ChnlWidth != CH_W) || (info->TargetCSIInfo.Ng != Ng) || (info->TargetCSIInfo.ChnlWidth != CH_W) || (info->TargetCSIInfo.Ng != Ng) ||
@ -1945,7 +1945,7 @@ void rtw_bf_update_traffic(PADAPTER adapter)
set_timer = true; set_timer = true;
} }
} else { } else {
if (true == bfee->bApplySounding) { if (bfee->bApplySounding) {
bfee->bApplySounding = false; bfee->bApplySounding = false;
bfee->bDeleteSounding = true; bfee->bDeleteSounding = true;
bfee->SoundCnt = 0; bfee->SoundCnt = 0;
@ -1954,7 +1954,7 @@ void rtw_bf_update_traffic(PADAPTER adapter)
} }
} }
if (true == set_timer) { if (set_timer) {
if (SOUNDING_STATE_NONE == info->sounding_info.state) { if (SOUNDING_STATE_NONE == info->sounding_info.state) {
info->sounding_info.state = SOUNDING_STATE_INIT; info->sounding_info.state = SOUNDING_STATE_INIT;
_set_timer(&info->sounding_timer, 0); _set_timer(&info->sounding_timer, 0);
@ -1972,7 +1972,7 @@ struct beamforming_entry *beamforming_get_entry_by_addr(struct mlme_priv *pmlmep
for (i = 0; i < BEAMFORMING_ENTRY_NUM; i++) { for (i = 0; i < BEAMFORMING_ENTRY_NUM; i++) {
if (pBeamInfo->beamforming_entry[i].bUsed && if (pBeamInfo->beamforming_entry[i].bUsed &&
(_rtw_memcmp(ra, pBeamInfo->beamforming_entry[i].mac_addr, ETH_ALEN))) { (!memcmp(ra, pBeamInfo->beamforming_entry[i].mac_addr, ETH_ALEN))) {
*idx = i; *idx = i;
return &(pBeamInfo->beamforming_entry[i]); return &(pBeamInfo->beamforming_entry[i]);
} }
@ -2880,7 +2880,7 @@ u32 rtw_beamforming_get_report_frame(PADAPTER Adapter, union recv_frame *precv_
/*RTW_INFO("%s MacId %d offset=%d\n", __func__, pBeamformEntry->mac_id, offset);*/ /*RTW_INFO("%s MacId %d offset=%d\n", __func__, pBeamformEntry->mac_id, offset);*/
if (_rtw_memcmp(pBeamformEntry->PreCsiReport + offset, pframe + offset, frame_len - offset) == false) if (!memcmp(pBeamformEntry->PreCsiReport + offset, pframe + offset, frame_len - offset) == false)
pBeamformEntry->DefaultCsiCnt = 0; pBeamformEntry->DefaultCsiCnt = 0;
else else
pBeamformEntry->DefaultCsiCnt++; pBeamformEntry->DefaultCsiCnt++;

View file

@ -106,7 +106,7 @@ void rtw_btcoex_ConnectNotify(PADAPTER padapter, u8 action)
return; return;
#ifdef DBG_CONFIG_ERROR_RESET #ifdef DBG_CONFIG_ERROR_RESET
if (true == rtw_hal_sreset_inprogress(padapter)) { if (rtw_hal_sreset_inprogress(padapter)) {
RTW_INFO(FUNC_ADPT_FMT ": [BTCoex] under reset, skip notify!\n", RTW_INFO(FUNC_ADPT_FMT ": [BTCoex] under reset, skip notify!\n",
FUNC_ADPT_ARG(padapter)); FUNC_ADPT_ARG(padapter));
return; return;
@ -132,7 +132,7 @@ void rtw_btcoex_MediaStatusNotify(PADAPTER padapter, u8 mediaStatus)
return; return;
#ifdef DBG_CONFIG_ERROR_RESET #ifdef DBG_CONFIG_ERROR_RESET
if (true == rtw_hal_sreset_inprogress(padapter)) { if (rtw_hal_sreset_inprogress(padapter)) {
RTW_INFO(FUNC_ADPT_FMT ": [BTCoex] under reset, skip notify!\n", RTW_INFO(FUNC_ADPT_FMT ": [BTCoex] under reset, skip notify!\n",
FUNC_ADPT_ARG(padapter)); FUNC_ADPT_ARG(padapter));
return; return;
@ -296,7 +296,7 @@ u32 rtw_btcoex_GetAMPDUSize(PADAPTER padapter)
void rtw_btcoex_SetManualControl(PADAPTER padapter, u8 manual) void rtw_btcoex_SetManualControl(PADAPTER padapter, u8 manual)
{ {
if (true == manual) if (manual)
hal_btcoex_SetManualControl(padapter, true); hal_btcoex_SetManualControl(padapter, true);
else else
hal_btcoex_SetManualControl(padapter, false); hal_btcoex_SetManualControl(padapter, false);
@ -1213,21 +1213,21 @@ u16 rtw_btcoex_parse_recv_data(u8 *msg, u8 msg_size)
u8 cmp_msg6[32] = invite_rsp; u8 cmp_msg6[32] = invite_rsp;
u8 res = OTHER; u8 res = OTHER;
if (_rtw_memcmp(cmp_msg1, msg, msg_size) == true) { if (!memcmp(cmp_msg1, msg, msg_size) == true) {
/*RTW_INFO("%s, msg:%s\n",__func__,msg);*/ /*RTW_INFO("%s, msg:%s\n",__func__,msg);*/
res = RX_ATTEND_ACK; res = RX_ATTEND_ACK;
} else if (_rtw_memcmp(cmp_msg2, msg, msg_size) == true) { } else if (!memcmp(cmp_msg2, msg, msg_size) == true) {
/*RTW_INFO("%s, msg:%s\n",__func__,msg);*/ /*RTW_INFO("%s, msg:%s\n",__func__,msg);*/
res = RX_LEAVE_ACK; res = RX_LEAVE_ACK;
} else if (_rtw_memcmp(cmp_msg3, msg, msg_size) == true) { } else if (!memcmp(cmp_msg3, msg, msg_size) == true) {
/*RTW_INFO("%s, msg:%s\n",__func__,msg);*/ /*RTW_INFO("%s, msg:%s\n",__func__,msg);*/
res = RX_BT_LEAVE; res = RX_BT_LEAVE;
} else if (_rtw_memcmp(cmp_msg4, msg, msg_size) == true) { } else if (!memcmp(cmp_msg4, msg, msg_size) == true) {
/*RTW_INFO("%s, msg:%s\n",__func__,msg);*/ /*RTW_INFO("%s, msg:%s\n",__func__,msg);*/
res = RX_INVITE_REQ; res = RX_INVITE_REQ;
} else if (_rtw_memcmp(cmp_msg5, msg, msg_size) == true) } else if (!memcmp(cmp_msg5, msg, msg_size) == true)
res = RX_ATTEND_REQ; res = RX_ATTEND_REQ;
else if (_rtw_memcmp(cmp_msg6, msg, msg_size) == true) else if (!memcmp(cmp_msg6, msg, msg_size) == true)
res = RX_INVITE_RSP; res = RX_INVITE_RSP;
else { else {
/*RTW_INFO("%s, %s\n", __func__, msg);*/ /*RTW_INFO("%s, %s\n", __func__, msg);*/
@ -1322,7 +1322,7 @@ void rtw_btcoex_recvmsgbysocket(void *data)
break; break;
default: default:
if (true == pcoex_info->BT_attend) if (pcoex_info->BT_attend)
rtw_btcoex_parse_hci_cmd(pbtcoexadapter, recv_data, recv_length); rtw_btcoex_parse_hci_cmd(pbtcoexadapter, recv_data, recv_length);
else else
RTW_INFO("ERROR!! BT is UP\n"); RTW_INFO("ERROR!! BT is UP\n");
@ -1466,7 +1466,7 @@ void rtw_btcoex_close_kernel_socket(_adapter *padapter)
RTW_INFO("release kernel socket\n"); RTW_INFO("release kernel socket\n");
sock_release(pcoex_info->udpsock); sock_release(pcoex_info->udpsock);
pcoex_info->sock_open &= ~(KERNEL_SOCKET_OK); pcoex_info->sock_open &= ~(KERNEL_SOCKET_OK);
if (true == pcoex_info->BT_attend) if (pcoex_info->BT_attend)
pcoex_info->BT_attend = false; pcoex_info->BT_attend = false;
RTW_INFO("sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend); RTW_INFO("sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
@ -1507,8 +1507,8 @@ void rtw_btcoex_close_socket(_adapter *padapter)
RTW_INFO("%s--coex_info->is_exist: %s, pcoex_info->BT_attend:%s\n" RTW_INFO("%s--coex_info->is_exist: %s, pcoex_info->BT_attend:%s\n"
, __func__, pcoex_info->is_exist == true ? "true" : "false", pcoex_info->BT_attend == true ? "true" : "false"); , __func__, pcoex_info->is_exist == true ? "true" : "false", pcoex_info->BT_attend == true ? "true" : "false");
if (true == pcoex_info->is_exist) { if (pcoex_info->is_exist) {
if (true == pcoex_info->BT_attend) { if (pcoex_info->BT_attend) {
/*inform BT wifi leave*/ /*inform BT wifi leave*/
rtw_btcoex_sendmsgbysocket(padapter, wifi_leave, sizeof(wifi_leave), false); rtw_btcoex_sendmsgbysocket(padapter, wifi_leave, sizeof(wifi_leave), false);
msleep(50); msleep(50);

View file

@ -2963,7 +2963,7 @@ u8 rtw_antenna_select_cmd(_adapter *padapter, u8 antenna, u8 enqueue)
return _FAIL; return _FAIL;
} }
if (true == enqueue) { if (enqueue) {
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (ph2c == NULL) { if (ph2c == NULL) {
res = _FAIL; res = _FAIL;

View file

@ -691,9 +691,9 @@ int proc_get_rx_stat(struct seq_file *m, void *v)
if (pstats == NULL) if (pstats == NULL)
continue; continue;
if ((_rtw_memcmp(psta->hwaddr, bc_addr, 6) != true) if ((memcmp(psta->hwaddr, bc_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, null_addr, 6) != true) && (memcmp(psta->hwaddr, null_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, adapter_mac_addr(adapter), 6) != true)) { && (memcmp(psta->hwaddr, adapter_mac_addr(adapter), 6))) {
RTW_PRINT_SEL(m, "MAC :\t\t"MAC_FMT "\n", MAC_ARG(psta->hwaddr)); RTW_PRINT_SEL(m, "MAC :\t\t"MAC_FMT "\n", MAC_ARG(psta->hwaddr));
RTW_PRINT_SEL(m, "data_rx_cnt :\t%llu\n", pstats->rx_data_pkts - pstats->rx_data_last_pkts); RTW_PRINT_SEL(m, "data_rx_cnt :\t%llu\n", pstats->rx_data_pkts - pstats->rx_data_last_pkts);
pstats->rx_data_last_pkts = pstats->rx_data_pkts; pstats->rx_data_last_pkts = pstats->rx_data_pkts;
@ -737,9 +737,9 @@ int proc_get_tx_stat(struct seq_file *m, void *v)
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
plist = get_next(plist); plist = get_next(plist);
if ((_rtw_memcmp(psta->hwaddr, bc_addr, 6) != true) if ((memcmp(psta->hwaddr, bc_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, null_addr, 6) != true) && (memcmp(psta->hwaddr, null_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, adapter_mac_addr(adapter), 6) != true)) { && (memcmp(psta->hwaddr, adapter_mac_addr(adapter), 6))) {
sta_rec[macid_rec_idx++] = psta; sta_rec[macid_rec_idx++] = psta;
} }
} }
@ -3494,7 +3494,7 @@ int proc_get_p2p_wowlan_info(struct seq_file *m, void *v)
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev); _adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
struct p2p_wowlan_info peerinfo = pwdinfo->p2p_wow_info; struct p2p_wowlan_info peerinfo = pwdinfo->p2p_wow_info;
if (true == peerinfo.is_trigger) { if (peerinfo.is_trigger) {
RTW_PRINT_SEL(m, "is_trigger: true\n"); RTW_PRINT_SEL(m, "is_trigger: true\n");
switch (peerinfo.wowlan_recv_frame_type) { switch (peerinfo.wowlan_recv_frame_type) {
case P2P_WOWLAN_RECV_NEGO_REQ: case P2P_WOWLAN_RECV_NEGO_REQ:
@ -4177,7 +4177,7 @@ ssize_t proc_set_tx_sa_query(struct file *file, const char __user *buffer, size_
for (index = 0; index < macid_ctl->num && index < NUM_STA; index++) { for (index = 0; index < macid_ctl->num && index < NUM_STA; index++) {
if (rtw_macid_is_used(macid_ctl, index) && !rtw_macid_is_bmc(macid_ctl, index)) { if (rtw_macid_is_used(macid_ctl, index) && !rtw_macid_is_bmc(macid_ctl, index)) {
if (!_rtw_memcmp(get_my_bssid(&(pmlmeinfo->network)), &mac_addr[index][0], ETH_ALEN) if (memcmp(get_my_bssid(&(pmlmeinfo->network)), &mac_addr[index][0], ETH_ALEN)
&& !IS_MCAST(&mac_addr[index][0])) { && !IS_MCAST(&mac_addr[index][0])) {
issue_action_SA_Query(padapter, &mac_addr[index][0], 0, 0, (u8)key_type); issue_action_SA_Query(padapter, &mac_addr[index][0], 0, 0, (u8)key_type);
RTW_INFO("STA[%u]:"MAC_FMT"\n", index , MAC_ARG(&mac_addr[index][0])); RTW_INFO("STA[%u]:"MAC_FMT"\n", index , MAC_ARG(&mac_addr[index][0]));
@ -4265,7 +4265,7 @@ ssize_t proc_set_tx_deauth(struct file *file, const char __user *buffer, size_t
for (index = 0; index < macid_ctl->num && index < NUM_STA; index++) { for (index = 0; index < macid_ctl->num && index < NUM_STA; index++) {
if (rtw_macid_is_used(macid_ctl, index) && !rtw_macid_is_bmc(macid_ctl, index)) { if (rtw_macid_is_used(macid_ctl, index) && !rtw_macid_is_bmc(macid_ctl, index)) {
if (!_rtw_memcmp(get_my_bssid(&(pmlmeinfo->network)), &mac_addr[index][0], ETH_ALEN)) { if (memcmp(get_my_bssid(&(pmlmeinfo->network)), &mac_addr[index][0], ETH_ALEN)) {
if (key_type != 3) if (key_type != 3)
issue_deauth_11w(padapter, &mac_addr[index][0], 0, (u8)key_type); issue_deauth_11w(padapter, &mac_addr[index][0], 0, (u8)key_type);

View file

@ -566,7 +566,7 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 *
if (start_addr > real_content_len) if (start_addr > real_content_len)
return _FAIL; return _FAIL;
if (true == bWrite) { if (bWrite) {
if ((start_addr + cnts) > max_available_size) if ((start_addr + cnts) > max_available_size)
return _FAIL; return _FAIL;
rw8 = &efuse_write8; rw8 = &efuse_write8;

View file

@ -167,14 +167,14 @@ uint rtw_is_cckratesonly_included(u8 *rate)
int rtw_check_network_type(unsigned char *rate, int ratelen, int channel) int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
{ {
if (channel > 14) { if (channel > 14) {
if ((rtw_is_cckrates_included(rate)) == true) if ((rtw_is_cckrates_included(rate)))
return WIRELESS_INVALID; return WIRELESS_INVALID;
else else
return WIRELESS_11A; return WIRELESS_11A;
} else { /* could be pure B, pure G, or B/G */ } else { /* could be pure B, pure G, or B/G */
if ((rtw_is_cckratesonly_included(rate)) == true) if ((rtw_is_cckratesonly_included(rate)))
return WIRELESS_11B; return WIRELESS_11B;
else if ((rtw_is_cckrates_included(rate)) == true) else if ((rtw_is_cckrates_included(rate)))
return WIRELESS_11BG; return WIRELESS_11BG;
else else
return WIRELESS_11G; return WIRELESS_11G;
@ -322,7 +322,7 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
while (cnt < in_len) { while (cnt < in_len) {
if (eid == in_ie[cnt] if (eid == in_ie[cnt]
&& (!oui || _rtw_memcmp(&in_ie[cnt + 2], oui, oui_len) == true)) { && (!oui || !memcmp(&in_ie[cnt + 2], oui, oui_len))) {
target_ie = &in_ie[cnt]; target_ie = &in_ie[cnt];
if (ie) if (ie)
@ -500,7 +500,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
/* HT Cap. */ /* HT Cap. */
if (((pregistrypriv->wireless_mode & WIRELESS_11_5N) || (pregistrypriv->wireless_mode & WIRELESS_11_24N)) if (((pregistrypriv->wireless_mode & WIRELESS_11_5N) || (pregistrypriv->wireless_mode & WIRELESS_11_24N))
&& (pregistrypriv->ht_enable == true)) { && (pregistrypriv->ht_enable)) {
/* todo: */ /* todo: */
} }
@ -520,7 +520,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new); pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
if (pbuf) { if (pbuf) {
/* check if oui matches... */ /* check if oui matches... */
if (_rtw_memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)) == false) if (memcmp((pbuf + 2), wpa_oui_type, sizeof(wpa_oui_type)))
goto check_next_ie; goto check_next_ie;
/* check version... */ /* check version... */
_rtw_memcpy((u8 *)&leval16, (pbuf + 6), sizeof(val16)); _rtw_memcpy((u8 *)&leval16, (pbuf + 6), sizeof(val16));
@ -564,15 +564,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 (_rtw_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 (_rtw_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 (_rtw_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 (_rtw_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 (_rtw_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;
@ -580,15 +580,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 (_rtw_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 (_rtw_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 (_rtw_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 (_rtw_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 (_rtw_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;
@ -609,7 +609,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)) ||
(_rtw_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;
@ -657,7 +657,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 (_rtw_memcmp(pos, SUITE_1X, 4) == 1) { if (!memcmp(pos, SUITE_1X, 4)) {
*is_8021x = 1; *is_8021x = 1;
} }
} }
@ -725,7 +725,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 (_rtw_memcmp(pos, SUITE_1X, 4) == 1) { if (!memcmp(pos, SUITE_1X, 4)) {
*is_8021x = 1; *is_8021x = 1;
} }
} }
@ -757,8 +757,8 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
authmode = in_ie[cnt]; authmode = in_ie[cnt];
/* if(authmode==_WAPI_IE_) */ /* if(authmode==_WAPI_IE_) */
if (authmode == _WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt + 6], wapi_oui1, 4) == true || if (authmode == _WAPI_IE_ && (!memcmp(&in_ie[cnt + 6], wapi_oui1, 4) ||
_rtw_memcmp(&in_ie[cnt + 6], wapi_oui2, 4) == true)) { !memcmp(&in_ie[cnt + 6], wapi_oui2, 4))) {
if (wapi_ie) if (wapi_ie)
_rtw_memcpy(wapi_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); _rtw_memcpy(wapi_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
@ -796,7 +796,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
while (cnt < in_len) { while (cnt < in_len) {
authmode = in_ie[cnt]; authmode = in_ie[cnt];
if ((authmode == _WPA_IE_ID_) && (_rtw_memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4) == true)) { if ((authmode == _WPA_IE_ID_) && (!memcmp(&in_ie[cnt + 2], &wpa_oui[0], 4))) {
if (wpa_ie) if (wpa_ie)
_rtw_memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); _rtw_memcpy(wpa_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
@ -833,7 +833,7 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
eid = ie_ptr[0]; eid = ie_ptr[0];
if ((eid == _WPA_IE_ID_) && (_rtw_memcmp(&ie_ptr[2], wps_oui, 4) == true)) { if ((eid == _WPA_IE_ID_) && (!memcmp(&ie_ptr[2], wps_oui, 4))) {
/* RTW_INFO("==> found WPS_IE.....\n"); */ /* RTW_INFO("==> found WPS_IE.....\n"); */
*wps_ielen = ie_ptr[1] + 2; *wps_ielen = ie_ptr[1] + 2;
match = true; match = true;
@ -898,7 +898,7 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
return NULL; return NULL;
} }
if (eid == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(&in_ie[cnt + 2], wps_oui, 4) == true) { if (eid == WLAN_EID_VENDOR_SPECIFIC && !memcmp(&in_ie[cnt + 2], wps_oui, 4)) {
wpsie_ptr = in_ie + cnt; wpsie_ptr = in_ie + cnt;
if (wps_ie) if (wps_ie)
@ -936,7 +936,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_) ||
(_rtw_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) */
@ -1333,12 +1333,12 @@ u8 rtw_check_invalid_mac_address(u8 *mac_addr, u8 check_local_bit)
u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
u8 res = false; u8 res = false;
if (_rtw_memcmp(mac_addr, null_mac_addr, ETH_ALEN)) { if (!memcmp(mac_addr, null_mac_addr, ETH_ALEN)) {
res = true; res = true;
goto func_exit; goto func_exit;
} }
if (_rtw_memcmp(mac_addr, multi_mac_addr, ETH_ALEN)) { if (!memcmp(mac_addr, multi_mac_addr, ETH_ALEN)) {
res = true; res = true;
goto func_exit; goto func_exit;
} }
@ -1348,7 +1348,7 @@ u8 rtw_check_invalid_mac_address(u8 *mac_addr, u8 check_local_bit)
goto func_exit; goto func_exit;
} }
if (check_local_bit == true) { if (check_local_bit) {
if (mac_addr[0] & BIT1) { if (mac_addr[0] & BIT1) {
res = true; res = true;
goto func_exit; goto func_exit;
@ -1397,7 +1397,7 @@ void rtw_macaddr_cfg(u8 *out, const u8 *hw_mac_addr)
} }
err_chk: err_chk:
if (rtw_check_invalid_mac_address(mac, true) == true) { if (rtw_check_invalid_mac_address(mac, true)) {
#if DEFAULT_RANDOM_MACADDR #if DEFAULT_RANDOM_MACADDR
RTW_ERR("invalid mac addr:"MAC_FMT", assign random MAC\n", MAC_ARG(mac)); RTW_ERR("invalid mac addr:"MAC_FMT", assign random MAC\n", MAC_ARG(mac));
*((u32 *)(&mac[2])) = rtw_random32(); *((u32 *)(&mac[2])) = rtw_random32();
@ -1675,7 +1675,7 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len)
while (i < in_len) { while (i < in_len) {
pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i); pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i);
if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4)) { if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && !memcmp(pIE->data, OUI, 4)) {
len += pIE->Length - 4; /* 4 is P2P OUI length, don't count it in this loop */ len += pIE->Length - 4; /* 4 is P2P OUI length, don't count it in this loop */
} }
@ -1709,7 +1709,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie)
pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i); pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i);
/* Take out the rest of P2P OUIs */ /* Take out the rest of P2P OUIs */
if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4)) { if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && !memcmp(pIE->data, OUI, 4)) {
_rtw_memcpy(merge_ie, pIE->data + 4, pIE->Length - 4); _rtw_memcpy(merge_ie, pIE->data + 4, pIE->Length - 4);
len += pIE->Length - 4; len += pIE->Length - 4;
merge_ie += pIE->Length - 4; merge_ie += pIE->Length - 4;
@ -1786,7 +1786,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
return NULL; return NULL;
} }
if (eid == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(&in_ie[cnt + 2], p2p_oui, 4) == true) { if (eid == WLAN_EID_VENDOR_SPECIFIC && !memcmp(&in_ie[cnt + 2], p2p_oui, 4)) {
p2p_ie_ptr = in_ie + cnt; p2p_ie_ptr = in_ie + cnt;
if (p2p_ie) if (p2p_ie)
@ -1826,7 +1826,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id , u8 *buf_att
if (!p2p_ie if (!p2p_ie
|| p2p_ielen <= 6 || p2p_ielen <= 6
|| (p2p_ie[0] != WLAN_EID_VENDOR_SPECIFIC) || (p2p_ie[0] != WLAN_EID_VENDOR_SPECIFIC)
|| (_rtw_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) */
@ -2130,7 +2130,7 @@ u8 *rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
return NULL; return NULL;
} }
if (eid == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(&in_ie[cnt + 2], wfd_oui, 4) == true) { if (eid == WLAN_EID_VENDOR_SPECIFIC && !memcmp(&in_ie[cnt + 2], wfd_oui, 4)) {
wfd_ie_ptr = in_ie + cnt; wfd_ie_ptr = in_ie + cnt;
if (wfd_ie) if (wfd_ie)
@ -2170,7 +2170,7 @@ u8 *rtw_get_wfd_attr(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id, u8 *buf_attr
if (!wfd_ie if (!wfd_ie
|| wfd_ielen <= 6 || wfd_ielen <= 6
|| (wfd_ie[0] != WLAN_EID_VENDOR_SPECIFIC) || (wfd_ie[0] != WLAN_EID_VENDOR_SPECIFIC)
|| (_rtw_memcmp(wfd_ie + 2, wfd_oui, 4) != true)) || (memcmp(wfd_ie + 2, wfd_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) */

View file

@ -90,7 +90,7 @@ u8 rtw_do_join(_adapter *padapter)
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
if (_rtw_queue_empty(queue) == true) { if (_rtw_queue_empty(queue) ) {
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
@ -119,7 +119,7 @@ u8 rtw_do_join(_adapter *padapter)
pmlmepriv->to_join = false; pmlmepriv->to_join = false;
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
} else { } else {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ) {
/* submit createbss_cmd to change to a ADHOC_MASTER */ /* submit createbss_cmd to change to a ADHOC_MASTER */
/* pmlmepriv->lock has been acquired by caller... */ /* pmlmepriv->lock has been acquired by caller... */
@ -191,26 +191,26 @@ u8 rtw_set_802_11_bssid(_adapter *padapter, u8 *bssid)
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
RTW_INFO("Set BSSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv)); RTW_INFO("Set BSSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) )
goto handle_tkip_countermeasure; goto handle_tkip_countermeasure;
else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) )
goto release_mlme_lock; goto release_mlme_lock;
if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) ) {
if (_rtw_memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN) == true) { if (!memcmp(&pmlmepriv->cur_network.network.MacAddress, bssid, ETH_ALEN) ) {
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)
goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
} else { } else {
rtw_disassoc_cmd(padapter, 0, true); rtw_disassoc_cmd(padapter, 0, true);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) )
rtw_indicate_disconnect(padapter, 0, false); rtw_indicate_disconnect(padapter, 0, false);
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) )) {
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE); _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
} }
@ -227,7 +227,7 @@ handle_tkip_countermeasure:
_rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); _rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
pmlmepriv->assoc_by_bssid = true; pmlmepriv->assoc_by_bssid = true;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) )
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
else else
status = rtw_do_join(padapter); status = rtw_do_join(padapter);
@ -260,27 +260,27 @@ u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid)
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
RTW_INFO("Set SSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv)); RTW_INFO("Set SSID under fw_state=0x%08x\n", get_fwstate(pmlmepriv));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) )
goto handle_tkip_countermeasure; goto handle_tkip_countermeasure;
else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) )
goto release_mlme_lock; goto release_mlme_lock;
if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) ) {
if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) && if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) &&
(_rtw_memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength) == true)) { (!memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength) )) {
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) { if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) {
if (rtw_is_same_ibss(padapter, pnetwork) == false) { if (rtw_is_same_ibss(padapter, pnetwork) == false) {
/* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
rtw_disassoc_cmd(padapter, 0, true); rtw_disassoc_cmd(padapter, 0, true);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) )
rtw_indicate_disconnect(padapter, 0, false); rtw_indicate_disconnect(padapter, 0, false);
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ) {
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE); _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
} }
@ -296,12 +296,12 @@ u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid)
rtw_disassoc_cmd(padapter, 0, true); rtw_disassoc_cmd(padapter, 0, true);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) )
rtw_indicate_disconnect(padapter, 0, false); rtw_indicate_disconnect(padapter, 0, false);
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ) {
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE); _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
} }
@ -322,7 +322,7 @@ handle_tkip_countermeasure:
_rtw_memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(NDIS_802_11_SSID));
pmlmepriv->assoc_by_bssid = false; pmlmepriv->assoc_by_bssid = false;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) )
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
else else
status = rtw_do_join(padapter); status = rtw_do_join(padapter);
@ -368,9 +368,9 @@ u8 rtw_set_802_11_connect(_adapter *padapter, u8 *bssid, NDIS_802_11_SSID *ssid)
RTW_PRINT(FUNC_ADPT_FMT" fw_state=0x%08x\n", RTW_PRINT(FUNC_ADPT_FMT" fw_state=0x%08x\n",
FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv)); FUNC_ADPT_ARG(padapter), get_fwstate(pmlmepriv));
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) )
goto handle_tkip_countermeasure; goto handle_tkip_countermeasure;
else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) )
goto release_mlme_lock; goto release_mlme_lock;
handle_tkip_countermeasure: handle_tkip_countermeasure:
@ -390,7 +390,7 @@ handle_tkip_countermeasure:
} else } else
pmlmepriv->assoc_by_bssid = false; pmlmepriv->assoc_by_bssid = false;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) )
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
else else
status = rtw_do_join(padapter); status = rtw_do_join(padapter);
@ -426,15 +426,15 @@ u8 rtw_set_802_11_infrastructure_mode(_adapter *padapter,
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || (*pold_state == Ndis802_11IBSS)) if ((check_fwstate(pmlmepriv, _FW_LINKED) ) || (*pold_state == Ndis802_11IBSS))
rtw_disassoc_cmd(padapter, 0, true); rtw_disassoc_cmd(padapter, 0, true);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || if ((check_fwstate(pmlmepriv, _FW_LINKED) ) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ))
rtw_free_assoc_resources(padapter, 1); rtw_free_assoc_resources(padapter, 1);
if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED) ) {
rtw_indicate_disconnect(padapter, 0, false); /*will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not*/ rtw_indicate_disconnect(padapter, 0, false); /*will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not*/
} }
} }
@ -487,7 +487,7 @@ u8 rtw_set_802_11_disassociate(_adapter *padapter)
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED) ) {
rtw_disassoc_cmd(padapter, 0, true); rtw_disassoc_cmd(padapter, 0, true);
rtw_indicate_disconnect(padapter, 0, false); rtw_indicate_disconnect(padapter, 0, false);
@ -661,7 +661,7 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key)
} }
/* check BSSID */ /* check BSSID */
if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == true) { if (IS_MAC_ADDRESS_BROADCAST(key->BSSID) ) {
ret = false; ret = false;
goto exit; goto exit;
@ -721,7 +721,7 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key)
} }
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) == true) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == false)) { if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) ) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == false)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
@ -748,7 +748,7 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key)
if (key->KeyIndex & 0x8000000) /* error ??? 0x8000_0000 */ if (key->KeyIndex & 0x8000000) /* error ??? 0x8000_0000 */
bgrouptkey = true; bgrouptkey = true;
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) == true) && (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == true)) if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE) ) && (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == true))
bgrouptkey = true; bgrouptkey = true;
bgroup = true; bgroup = true;
@ -781,7 +781,7 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key)
if (key->KeyIndex & 0x20000000) { if (key->KeyIndex & 0x20000000) {
/* SetRSC */ /* SetRSC */
if (bgroup == true) { if (bgroup ) {
NDIS_802_11_KEY_RSC keysrc = key->KeyRSC & 0x00FFFFFFFFFFFFULL; NDIS_802_11_KEY_RSC keysrc = key->KeyRSC & 0x00FFFFFFFFFFFFULL;
_rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8); _rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
} else { } else {
@ -793,10 +793,10 @@ u8 rtw_set_802_11_add_key(_adapter *padapter, NDIS_802_11_KEY *key)
/* Indicate this key idx is used for TX */ /* Indicate this key idx is used for TX */
/* Save the key in KeyMaterial */ /* Save the key in KeyMaterial */
if (bgroup == true) { /* Group transmit key */ if (bgroup ) { /* Group transmit key */
int res; int res;
if (bgrouptkey == true) if (bgrouptkey )
padapter->securitypriv.dot118021XGrpKeyid = (u8)key->KeyIndex; padapter->securitypriv.dot118021XGrpKeyid = (u8)key->KeyIndex;
if ((key->KeyIndex & 0x3) == 0) { if ((key->KeyIndex & 0x3) == 0) {
@ -894,7 +894,7 @@ u8 rtw_set_802_11_remove_key(_adapter *padapter, NDIS_802_11_REMOVE_KEY *key)
goto exit; goto exit;
} }
if (bgroup == true) { if (bgroup ) {
encryptionalgo = padapter->securitypriv.dot118021XGrpPrivacy; encryptionalgo = padapter->securitypriv.dot118021XGrpPrivacy;
/* clear group key by index */ /* clear group key by index */
/* NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN); */ /* NdisZeroMemory(Adapter->MgntInfo.SecurityInfo.KeyBuf[keyIndex], MAX_WEP_KEY_LEN); */
@ -946,7 +946,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
#ifdef CONFIG_MP_INCLUDED #ifdef CONFIG_MP_INCLUDED
if (adapter->registrypriv.mp_mode == 1) { if (adapter->registrypriv.mp_mode == 1) {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE) )
return 0; return 0;
} }
#endif #endif

View file

@ -345,7 +345,7 @@ static u8 _rtw_mi_process(_adapter *padapter, bool exclude_self,
continue; continue;
if (ops_func) if (ops_func)
if (true == ops_func(iface, data)) if (ops_func(iface, data))
ret++; ret++;
} }
} }
@ -749,7 +749,7 @@ static u8 _rtw_mi_check_fwstate(_adapter *padapter, void *data)
if ((state == WIFI_FW_NULL_STATE) && if ((state == WIFI_FW_NULL_STATE) &&
(padapter->mlmepriv.fw_state == WIFI_FW_NULL_STATE)) (padapter->mlmepriv.fw_state == WIFI_FW_NULL_STATE))
ret = true; ret = true;
else if (true == check_fwstate(&padapter->mlmepriv, state)) else if (check_fwstate(&padapter->mlmepriv, state))
ret = true; ret = true;
#ifdef DBG_DUMP_FW_STATE #ifdef DBG_DUMP_FW_STATE
if (ret) if (ret)
@ -1034,7 +1034,7 @@ _adapter *rtw_get_iface_by_macddr(_adapter *padapter, u8 *mac_addr)
for (i = 0; i < dvobj->iface_nums; i++) { for (i = 0; i < dvobj->iface_nums; i++) {
iface = dvobj->padapters[i]; iface = dvobj->padapters[i];
if ((iface) && (_rtw_memcmp(mac_addr, adapter_mac_addr(iface), ETH_ALEN))) { if ((iface) && (!memcmp(mac_addr, adapter_mac_addr(iface), ETH_ALEN))) {
bmatch = true; bmatch = true;
break; break;
} }
@ -1105,10 +1105,10 @@ static void rtw_dbg_skb_process(_adapter *padapter, union recv_frame *precvframe
if (precvframe->u.hdr.len != pcloneframe->u.hdr.len) if (precvframe->u.hdr.len != pcloneframe->u.hdr.len)
RTW_INFO("%s [WARN] recv_frame length(%d:%d) compare failed\n", __func__, precvframe->u.hdr.len, pcloneframe->u.hdr.len); RTW_INFO("%s [WARN] recv_frame length(%d:%d) compare failed\n", __func__, precvframe->u.hdr.len, pcloneframe->u.hdr.len);
if (_rtw_memcmp(&precvframe->u.hdr.attrib, &pcloneframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib)) == false) if (!memcmp(&precvframe->u.hdr.attrib, &pcloneframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib)) == false)
RTW_INFO("%s [WARN] recv_frame attrib compare failed\n", __func__); RTW_INFO("%s [WARN] recv_frame attrib compare failed\n", __func__);
if (_rtw_memcmp(precvframe->u.hdr.rx_data, pcloneframe->u.hdr.rx_data, precvframe->u.hdr.len) == false) if (!memcmp(precvframe->u.hdr.rx_data, pcloneframe->u.hdr.rx_data, precvframe->u.hdr.len) == false)
RTW_INFO("%s [WARN] recv_frame rx_data compare failed\n", __func__); RTW_INFO("%s [WARN] recv_frame rx_data compare failed\n", __func__);
} }

View file

@ -181,7 +181,7 @@ int rtw_mlme_update_wfd_ie_data(struct mlme_priv *mlme, u8 type, u8 *ie, u32 ie_
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST)) if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
goto success; goto success;
if (wfd_info->wfd_enable == true) if (wfd_info->wfd_enable)
goto success; /* WFD IE is build by self */ goto success; /* WFD IE is build by self */
if (!ie && !ie_len) if (!ie && !ie_len)
@ -313,7 +313,7 @@ struct wlan_network *_rtw_dequeue_network(_queue *queue)
_enter_critical_bh(&queue->lock, &irqL); _enter_critical_bh(&queue->lock, &irqL);
if (_rtw_queue_empty(queue) == true) if (_rtw_queue_empty(queue))
pnetwork = NULL; pnetwork = NULL;
@ -341,7 +341,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv) /* (_queue
_enter_critical_bh(&free_queue->lock, &irqL); _enter_critical_bh(&free_queue->lock, &irqL);
if (_rtw_queue_empty(free_queue) == true) { if (_rtw_queue_empty(free_queue)) {
pnetwork = NULL; pnetwork = NULL;
goto exit; goto exit;
} }
@ -377,11 +377,11 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv , struct wlan_network *pnetwo
if (pnetwork == NULL) if (pnetwork == NULL)
goto exit; goto exit;
if (pnetwork->fixed == true) if (pnetwork->fixed)
goto exit; goto exit;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)))
lifetime = 1; lifetime = 1;
if (!isfreeall) { if (!isfreeall) {
@ -416,7 +416,7 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *
if (pnetwork == NULL) if (pnetwork == NULL)
goto exit; goto exit;
if (pnetwork->fixed == true) if (pnetwork->fixed)
goto exit; goto exit;
/* _enter_critical(&free_queue->lock, &irqL); */ /* _enter_critical(&free_queue->lock, &irqL); */
@ -448,7 +448,7 @@ struct wlan_network *_rtw_find_network(_queue *scanned_queue, u8 *addr)
u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; u8 zero_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
if (_rtw_memcmp(zero_addr, addr, ETH_ALEN)) { if (!memcmp(zero_addr, addr, ETH_ALEN)) {
pnetwork = NULL; pnetwork = NULL;
goto exit; goto exit;
} }
@ -461,7 +461,7 @@ struct wlan_network *_rtw_find_network(_queue *scanned_queue, u8 *addr)
while (plist != phead) { while (plist != phead) {
pnetwork = LIST_CONTAINOR(plist, struct wlan_network , list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network , list);
if (_rtw_memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN) == true) if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN))
break; break;
plist = get_next(plist); plist = get_next(plist);
@ -652,7 +652,7 @@ int rtw_is_same_ibss(_adapter *adapter, struct wlan_network *pnetwork)
inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b) inline int is_same_ess(WLAN_BSSID_EX *a, WLAN_BSSID_EX *b)
{ {
return (a->Ssid.SsidLength == b->Ssid.SsidLength) return (a->Ssid.SsidLength == b->Ssid.SsidLength)
&& _rtw_memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength) == true; && !memcmp(a->Ssid.Ssid, b->Ssid.Ssid, a->Ssid.SsidLength);
} }
int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature) int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature)
@ -670,15 +670,15 @@ int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature)
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if ((feature == 1) && /* 1: P2P supported */ if ((feature == 1) && /* 1: P2P supported */
(_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN) == true) (!memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN))
) )
return true; return true;
#endif #endif
return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) && return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) &&
/* (src->Configuration.DSConfig == dst->Configuration.DSConfig) && */ /* (src->Configuration.DSConfig == dst->Configuration.DSConfig) && */
((_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) == true) && ((!memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN))) &&
((_rtw_memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == true) && ((!memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength))) &&
((s_cap & WLAN_CAPABILITY_IBSS) == ((s_cap & WLAN_CAPABILITY_IBSS) ==
(d_cap & WLAN_CAPABILITY_IBSS)) && (d_cap & WLAN_CAPABILITY_IBSS)) &&
((s_cap & WLAN_CAPABILITY_BSS) == ((s_cap & WLAN_CAPABILITY_BSS) ==
@ -737,7 +737,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(_queue *scanned_queue)
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist))
break; break;
pwlan = LIST_CONTAINOR(plist, struct wlan_network, list); pwlan = LIST_CONTAINOR(plist, struct wlan_network, list);
@ -837,7 +837,7 @@ static void update_current_network(_adapter *adapter, WLAN_BSSID_EX *pnetwork)
&(pmlmepriv->cur_network.network), &(pmlmepriv->cur_network.network),
&(pmlmepriv->cur_network.network)); &(pmlmepriv->cur_network.network));
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) && (is_same_network(&(pmlmepriv->cur_network.network), pnetwork, 0))) { if ((check_fwstate(pmlmepriv, _FW_LINKED)) && (is_same_network(&(pmlmepriv->cur_network.network), pnetwork, 0))) {
update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, true); update_network(&(pmlmepriv->cur_network.network), pnetwork, adapter, true);
rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(NDIS_802_11_FIXED_IEs), rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(NDIS_802_11_FIXED_IEs),
pmlmepriv->cur_network.network.IELength); pmlmepriv->cur_network.network.IELength);
@ -880,7 +880,7 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target)
#endif #endif
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist))
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
@ -889,7 +889,7 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target)
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) &&
(_rtw_memcmp(pnetwork->network.MacAddress, target->MacAddress, ETH_ALEN) == true)) { (!memcmp(pnetwork->network.MacAddress, target->MacAddress, ETH_ALEN))) {
target_find = 1; target_find = 1;
break; break;
} }
@ -916,7 +916,7 @@ void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target)
* with this beacon's information */ * with this beacon's information */
/* if (rtw_end_of_queue_search(phead,plist)== true) { */ /* if (rtw_end_of_queue_search(phead,plist)== true) { */
if (!target_find) { if (!target_find) {
if (_rtw_queue_empty(&(pmlmepriv->free_bss_pool)) == true) { if (_rtw_queue_empty(&(pmlmepriv->free_bss_pool))) {
/* If there are no more slots, expire the oldest */ /* If there are no more slots, expire the oldest */
/* list_del_init(&oldest->list); */ /* list_del_init(&oldest->list); */
pnetwork = oldest; pnetwork = oldest;
@ -1069,7 +1069,7 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork)
bselected = false; bselected = false;
} }
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode) if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode)
bselected = false; bselected = false;
} }
@ -1105,8 +1105,8 @@ void rtw_survey_event_callback(_adapter *adapter, u8 *pbuf)
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
/* update IBSS_network 's timestamp */ /* update IBSS_network 's timestamp */
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) { if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
if (_rtw_memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) { if (!memcmp(&(pmlmepriv->cur_network.network.MacAddress), pnetwork->MacAddress, ETH_ALEN)) {
struct wlan_network *ibss_wlan = NULL; struct wlan_network *ibss_wlan = NULL;
unsigned long irqL; unsigned long irqL;
@ -1176,8 +1176,8 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
rtw_set_signal_stat_timer(&adapter->recvpriv); rtw_set_signal_stat_timer(&adapter->recvpriv);
#endif #endif
if (pmlmepriv->to_join == true) { if (pmlmepriv->to_join) {
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) { if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == false) { if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
set_fwstate(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
@ -1266,7 +1266,7 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
_exit_critical_bh(&pmlmepriv->lock, &irqL); _exit_critical_bh(&pmlmepriv->lock, &irqL);
#ifdef CONFIG_P2P_PS #ifdef CONFIG_P2P_PS
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0); p2p_ps_wk_cmd(adapter, P2P_PS_SCAN_DONE, 0);
#endif /* CONFIG_P2P_PS */ #endif /* CONFIG_P2P_PS */
@ -1371,7 +1371,7 @@ void rtw_free_assoc_resources(_adapter *adapter, int lock_scanned_queue)
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress); psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (ptdlsinfo->link_established == true) { if (ptdlsinfo->link_established) {
rtw_tdls_cmd(adapter, NULL, TDLS_RS_RCR); rtw_tdls_cmd(adapter, NULL, TDLS_RS_RCR);
rtw_reset_tdls_info(adapter); rtw_reset_tdls_info(adapter);
rtw_free_all_stainfo(adapter); rtw_free_all_stainfo(adapter);
@ -1604,7 +1604,7 @@ static u32 _rtw_wait_scan_done(_adapter *adapter, u8 abort, u32 timeout_ms)
rtw_msleep_os(20); rtw_msleep_os(20);
} }
if (true == abort) { if (abort) {
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
if (!RTW_CANNOT_RUN(adapter)) if (!RTW_CANNOT_RUN(adapter))
RTW_INFO(FUNC_NDEV_FMT"waiting for scan_abort time out!\n", FUNC_NDEV_ARG(adapter->pnetdev)); RTW_INFO(FUNC_NDEV_FMT"waiting for scan_abort time out!\n", FUNC_NDEV_ARG(adapter->pnetdev));
@ -1855,7 +1855,7 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
rtw_get_encrypt_decrypt_from_registrypriv(adapter); rtw_get_encrypt_decrypt_from_registrypriv(adapter);
the_same_macaddr = _rtw_memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN); the_same_macaddr = !memcmp(pnetwork->network.MacAddress, cur_network->network.MacAddress, ETH_ALEN);
pnetwork->network.Length = get_WLAN_BSSID_EX_sz(&pnetwork->network); pnetwork->network.Length = get_WLAN_BSSID_EX_sz(&pnetwork->network);
if (pnetwork->network.Length > sizeof(WLAN_BSSID_EX)) if (pnetwork->network.Length > sizeof(WLAN_BSSID_EX))
@ -1873,7 +1873,7 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
/* s1. find ptarget_wlan */ /* s1. find ptarget_wlan */
if (check_fwstate(pmlmepriv, _FW_LINKED)) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
if (the_same_macaddr == true) if (the_same_macaddr)
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
else { else {
pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
@ -1888,7 +1888,7 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
} }
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress); ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.MacAddress);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
if (ptarget_wlan) if (ptarget_wlan)
ptarget_wlan->fixed = true; ptarget_wlan->fixed = true;
} }
@ -1896,7 +1896,7 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
} else { } else {
ptarget_wlan = _rtw_find_same_network(&pmlmepriv->scanned_queue, pnetwork); ptarget_wlan = _rtw_find_same_network(&pmlmepriv->scanned_queue, pnetwork);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
if (ptarget_wlan) if (ptarget_wlan)
ptarget_wlan->fixed = true; ptarget_wlan->fixed = true;
} }
@ -1913,7 +1913,7 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
/* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */ /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork); ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
if (ptarget_sta == NULL) { if (ptarget_sta == NULL) {
RTW_ERR("Can't update stainfo when joinbss_event callback\n"); RTW_ERR("Can't update stainfo when joinbss_event callback\n");
@ -1945,7 +1945,7 @@ void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf)
/* rtw_free_assoc_resources(adapter, 1); */ /* rtw_free_assoc_resources(adapter, 1); */
if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == true) { if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) {
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
} }
@ -2199,8 +2199,8 @@ void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf)
_enter_critical_bh(&pmlmepriv->lock, &irqL); _enter_critical_bh(&pmlmepriv->lock, &irqL);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) { (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) {
if (adapter->stapriv.asoc_sta_count == 2) { if (adapter->stapriv.asoc_sta_count == 2) {
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress); ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.MacAddress);
@ -2438,7 +2438,7 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
roam = true; roam = true;
#endif /* CONFIG_INTEL_WIDI */ #endif /* CONFIG_INTEL_WIDI */
if (roam == true) { if (roam) {
if (rtw_to_roam(adapter) > 0) if (rtw_to_roam(adapter) > 0)
rtw_dec_to_roam(adapter); /* this stadel_event is caused by roaming, decrease to_roam */ rtw_dec_to_roam(adapter); /* this stadel_event is caused by roaming, decrease to_roam */
else if (rtw_to_roam(adapter) == 0) else if (rtw_to_roam(adapter) == 0)
@ -2655,7 +2655,7 @@ void rtw_mlme_reset_auto_scan_int(_adapter *adapter, u8 *reason)
rtw_mi_get_ch_setting_union(adapter, &u_ch, NULL, NULL); rtw_mi_get_ch_setting_union(adapter, &u_ch, NULL, NULL);
if (hal_chk_bw_cap(adapter, BW_CAP_40M) if (hal_chk_bw_cap(adapter, BW_CAP_40M)
&& is_client_associated_to_ap(adapter) == true && is_client_associated_to_ap(adapter)
&& u_ch >= 1 && u_ch <= 14 && u_ch >= 1 && u_ch <= 14
&& adapter->registrypriv.wifi_spec && adapter->registrypriv.wifi_spec
/* TODO: AP Connected is 40MHz capability? */ /* TODO: AP Connected is 40MHz capability? */
@ -2702,7 +2702,7 @@ void rtw_drv_scan_by_self(_adapter *padapter, u8 reason)
if (rtw_mi_busy_traffic_check(padapter, false)) { if (rtw_mi_busy_traffic_check(padapter, false)) {
#ifdef CONFIG_LAYER2_ROAMING #ifdef CONFIG_LAYER2_ROAMING
if (rtw_chk_roam_flags(padapter, RTW_ROAM_ACTIVE) && pmlmepriv->need_to_roam == true) { if (rtw_chk_roam_flags(padapter, RTW_ROAM_ACTIVE) && pmlmepriv->need_to_roam) {
RTW_INFO("need to roam, don't care BusyTraffic\n"); RTW_INFO("need to roam, don't care BusyTraffic\n");
} else } else
#endif #endif
@ -2715,7 +2715,7 @@ void rtw_drv_scan_by_self(_adapter *padapter, u8 reason)
RTW_INFO(FUNC_ADPT_FMT" WIFI_AP_STATE && WIFI_UNDER_WPS\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" WIFI_AP_STATE && WIFI_UNDER_WPS\n", FUNC_ADPT_ARG(padapter));
goto exit; goto exit;
} }
if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING)) == true) { if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING))) {
RTW_INFO(FUNC_ADPT_FMT" _FW_UNDER_SURVEY|_FW_UNDER_LINKING\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" _FW_UNDER_SURVEY|_FW_UNDER_LINKING\n", FUNC_ADPT_ARG(padapter));
goto exit; goto exit;
} }
@ -2753,7 +2753,7 @@ static void rtw_auto_scan_handler(_adapter *padapter)
#endif #endif
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (padapter->tdlsinfo.link_established == true) if (padapter->tdlsinfo.link_established)
goto exit; goto exit;
#endif #endif
@ -2771,7 +2771,7 @@ static u8 is_drv_in_lps(_adapter *adapter)
u8 is_in_lps = false; u8 is_in_lps = false;
#ifdef CONFIG_LPS_LCLK_WD_TIMER /* to avoid leaving lps 32k frequently*/ #ifdef CONFIG_LPS_LCLK_WD_TIMER /* to avoid leaving lps 32k frequently*/
if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode == true) if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode)
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
&& (rtw_btcoex_IsBtControlLps(adapter) == false) && (rtw_btcoex_IsBtControlLps(adapter) == false)
#endif #endif
@ -2786,7 +2786,7 @@ void rtw_iface_dynamic_check_timer_handler(_adapter *adapter)
struct mlme_priv *pmlmepriv = &adapter->mlmepriv; struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
#endif /* CONFIG_AP_MODE */ #endif /* CONFIG_AP_MODE */
if (adapter->net_closed == true) if (adapter->net_closed)
return; return;
#ifdef CONFIG_LPS_LCLK_WD_TIMER /* to avoid leaving lps 32k frequently*/ #ifdef CONFIG_LPS_LCLK_WD_TIMER /* to avoid leaving lps 32k frequently*/
if (is_drv_in_lps(adapter)) { if (is_drv_in_lps(adapter)) {
@ -2809,7 +2809,7 @@ void rtw_iface_dynamic_check_timer_handler(_adapter *adapter)
#ifndef CONFIG_ACTIVE_KEEP_ALIVE_CHECK #ifndef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
expire_timeout_chk(adapter); expire_timeout_chk(adapter);
#endif #endif
#endif /* !CONFIG_ACTIVE_KEEP_ALIVE_CHECK */ #endif /* !CONFIG_ACTIVE_KEEP_ALIVE_CHECK */
@ -2825,7 +2825,7 @@ void rtw_iface_dynamic_check_timer_handler(_adapter *adapter)
#else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ #else /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (rcu_dereference(adapter->pnetdev->rx_handler_data) if (rcu_dereference(adapter->pnetdev->rx_handler_data)
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ #endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
&& (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) == true)) { && (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE))) {
/* expire NAT2.5 entry */ /* expire NAT2.5 entry */
nat25_db_expire(adapter); nat25_db_expire(adapter);
@ -2967,7 +2967,7 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
if (rtw_chk_ft_flags(adapter, RTW_FT_SUPPORTED)) { if (rtw_chk_ft_flags(adapter, RTW_FT_SUPPORTED)) {
ptmp = rtw_get_ie(&competitor->network.IEs[12], _MDIE_, &mdie_len, competitor->network.IELength-12); ptmp = rtw_get_ie(&competitor->network.IEs[12], _MDIE_, &mdie_len, competitor->network.IELength-12);
if (ptmp) { if (ptmp) {
if (!_rtw_memcmp(&pftpriv->mdid, ptmp+2, 2)) if (memcmp(&pftpriv->mdid, ptmp+2, 2))
goto exit; goto exit;
/*The candidate don't support over-the-DS*/ /*The candidate don't support over-the-DS*/
@ -2995,7 +2995,7 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
/* got specific addr to roam */ /* got specific addr to roam */
if (!is_zero_mac_addr(mlme->roam_tgt_addr)) { if (!is_zero_mac_addr(mlme->roam_tgt_addr)) {
if (_rtw_memcmp(mlme->roam_tgt_addr, competitor->network.MacAddress, ETH_ALEN) == true) if (!memcmp(mlme->roam_tgt_addr, competitor->network.MacAddress, ETH_ALEN))
goto update; goto update;
else else
goto exit; goto exit;
@ -3071,7 +3071,7 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
mlme->roam_network = candidate; mlme->roam_network = candidate;
if (_rtw_memcmp(candidate->network.MacAddress, mlme->roam_tgt_addr, ETH_ALEN) == true) if (!memcmp(candidate->network.MacAddress, mlme->roam_tgt_addr, ETH_ALEN))
memset(mlme->roam_tgt_addr, 0, ETH_ALEN); memset(mlme->roam_tgt_addr, 0, ETH_ALEN);
} }
@ -3096,15 +3096,15 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
/* check bssid, if needed */ /* check bssid, if needed */
if (mlme->assoc_by_bssid == true) { if (mlme->assoc_by_bssid) {
if (_rtw_memcmp(competitor->network.MacAddress, mlme->assoc_bssid, ETH_ALEN) == false) if (!memcmp(competitor->network.MacAddress, mlme->assoc_bssid, ETH_ALEN) == false)
goto exit; goto exit;
} }
/* check ssid, if needed */ /* check ssid, if needed */
if (mlme->assoc_ssid.Ssid[0] && mlme->assoc_ssid.SsidLength) { if (mlme->assoc_ssid.Ssid[0] && mlme->assoc_ssid.SsidLength) {
if (competitor->network.Ssid.SsidLength != mlme->assoc_ssid.SsidLength if (competitor->network.Ssid.SsidLength != mlme->assoc_ssid.SsidLength
|| _rtw_memcmp(competitor->network.Ssid.Ssid, mlme->assoc_ssid.Ssid, mlme->assoc_ssid.SsidLength) == false || !memcmp(competitor->network.Ssid.Ssid, mlme->assoc_ssid.Ssid, mlme->assoc_ssid.SsidLength) == false
) )
goto exit; goto exit;
} }
@ -3219,7 +3219,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
candidate_exist: candidate_exist:
/* check for situation of _FW_LINKED */ /* check for situation of _FW_LINKED */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
RTW_INFO("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__); RTW_INFO("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__);
rtw_disassoc_cmd(adapter, 0, true); rtw_disassoc_cmd(adapter, 0, true);
@ -3229,7 +3229,7 @@ candidate_exist:
#ifdef CONFIG_ANTENNA_DIVERSITY #ifdef CONFIG_ANTENNA_DIVERSITY
rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv)); rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv));
if (true == bSupportAntDiv) { if (bSupportAntDiv) {
u8 CurrentAntenna; u8 CurrentAntenna;
rtw_hal_get_odm_var(adapter, HAL_ODM_ANTDIV_SELECT, &(CurrentAntenna), NULL); rtw_hal_get_odm_var(adapter, HAL_ODM_ANTDIV_SELECT, &(CurrentAntenna), NULL);
RTW_INFO("#### Opt_Ant_(%s) , cur_Ant(%s)\n", RTW_INFO("#### Opt_Ant_(%s) , cur_Ant(%s)\n",
@ -3427,7 +3427,7 @@ static int SecIsInPMKIDList(_adapter *Adapter, u8 *bssid)
do { do {
if ((psecuritypriv->PMKIDList[i].bUsed) && if ((psecuritypriv->PMKIDList[i].bUsed) &&
(_rtw_memcmp(psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN) == true)) (!memcmp(psecuritypriv->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
break; break;
else { else {
i++; i++;
@ -3461,7 +3461,7 @@ static int rtw_append_pmkid(_adapter *adapter, int iEntry, u8 *ie, uint ie_len)
if (ie[13] > 20) { if (ie[13] > 20) {
int i; int i;
u16 pmkid_cnt = RTW_GET_LE16(ie + 14 + 20); u16 pmkid_cnt = RTW_GET_LE16(ie + 14 + 20);
if (pmkid_cnt == 1 && _rtw_memcmp(ie + 14 + 20 + 2, &sec->PMKIDList[iEntry].PMKID, 16)) { if (pmkid_cnt == 1 && !memcmp(ie + 14 + 20 + 2, &sec->PMKIDList[iEntry].PMKID, 16)) {
RTW_INFO(FUNC_ADPT_FMT" has carried the same PMKID:"KEY_FMT"\n" RTW_INFO(FUNC_ADPT_FMT" has carried the same PMKID:"KEY_FMT"\n"
, FUNC_ADPT_ARG(adapter), KEY_ARG(&sec->PMKIDList[iEntry].PMKID)); , FUNC_ADPT_ARG(adapter), KEY_ARG(&sec->PMKIDList[iEntry].PMKID));
goto exit; goto exit;
@ -4130,12 +4130,12 @@ void rtw_issue_addbareq_cmd_tdls(_adapter *padapter, struct xmit_frame *pxmitfra
priority = pattrib->priority; priority = pattrib->priority;
if (pattrib->direct_link == true) { if (pattrib->direct_link) {
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst);
if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) { if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) {
phtpriv = &ptdls_sta->htpriv; phtpriv = &ptdls_sta->htpriv;
if ((phtpriv->ht_option == true) && (phtpriv->ampdu_enable == true)) { if ((phtpriv->ht_option) && (phtpriv->ampdu_enable == true)) {
issued = (phtpriv->agg_enable_bitmap >> priority) & 0x1; issued = (phtpriv->agg_enable_bitmap >> priority) & 0x1;
issued |= (phtpriv->candidate_tid_bitmap >> priority) & 0x1; issued |= (phtpriv->candidate_tid_bitmap >> priority) & 0x1;
@ -4188,7 +4188,7 @@ void rtw_issue_addbareq_cmd(_adapter *padapter, struct xmit_frame *pxmitframe)
phtpriv = &psta->htpriv; phtpriv = &psta->htpriv;
if ((phtpriv->ht_option == true) && (phtpriv->ampdu_enable == true)) { if ((phtpriv->ht_option) && (phtpriv->ampdu_enable == true)) {
issued = (phtpriv->agg_enable_bitmap >> priority) & 0x1; issued = (phtpriv->agg_enable_bitmap >> priority) & 0x1;
issued |= (phtpriv->candidate_tid_bitmap >> priority) & 0x1; issued |= (phtpriv->candidate_tid_bitmap >> priority) & 0x1;
@ -4216,7 +4216,7 @@ void rtw_append_exented_cap(_adapter *padapter, u8 *out_ie, uint *pout_len)
in the Extended Capabilities element, then the STA is not required to in the Extended Capabilities element, then the STA is not required to
transmit the Extended Capabilities element. transmit the Extended Capabilities element.
*/ */
if (false == _rtw_memcmp(cap_content, null_content, 8)) if (false == !memcmp(cap_content, null_content, 8))
pframe = rtw_set_ie(out_ie + *pout_len, EID_EXTCapability, 8, cap_content , pout_len); pframe = rtw_set_ie(out_ie + *pout_len, EID_EXTCapability, 8, cap_content , pout_len);
} }
@ -4319,13 +4319,13 @@ bool rtw_adjust_chbw(_adapter *adapter, u8 req_ch, u8 *req_bw, u8 *req_offset)
sint rtw_linked_check(_adapter *padapter) sint rtw_linked_check(_adapter *padapter)
{ {
if ((check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) || if ((check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE)) ||
(check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE) == true)) { (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE))) {
if (padapter->stapriv.asoc_sta_count > 2) if (padapter->stapriv.asoc_sta_count > 2)
return true; return true;
} else { } else {
/* Station mode */ /* Station mode */
if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == true) if (check_fwstate(&padapter->mlmepriv, _FW_LINKED))
return true; return true;
} }
return false; return false;
@ -4336,7 +4336,7 @@ u8 rtw_is_adapter_up(_adapter *padapter)
return false; return false;
if (RTW_CANNOT_RUN(padapter)) { if (RTW_CANNOT_RUN(padapter)) {
RTW_INFO(FUNC_ADPT_FMT "-(bSurpriseRemoved == true) || ( bDriverStopped == true)\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT "-(bSurpriseRemoved) || ( bDriverStopped == true)\n", FUNC_ADPT_ARG(padapter));
return false; return false;
} }

View file

@ -1179,7 +1179,7 @@ static u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *
Index2G = RTW_ChannelPlanMap[ChannelPlan].Index2G; Index2G = RTW_ChannelPlanMap[ChannelPlan].Index2G;
for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan2G[Index2G]); index++) { for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan2G[Index2G]); index++) {
if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan2G[Index2G], index)) == true) if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan2G[Index2G], index)))
continue; continue;
channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan2G[Index2G], index); channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan2G[Index2G], index);
@ -1216,7 +1216,7 @@ static u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *
Index5G = RTW_ChannelPlanMap[ChannelPlan].Index5G; Index5G = RTW_ChannelPlanMap[ChannelPlan].Index5G;
for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan5G[Index5G]); index++) { for (index = 0; index < CH_LIST_LEN(RTW_ChannelPlan5G[Index5G]); index++) {
if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan5G[Index5G], index)) == true) if (rtw_regsty_is_excl_chs(regsty, CH_LIST_CH(RTW_ChannelPlan5G[Index5G], index)))
continue; continue;
#ifdef CONFIG_DFS #ifdef CONFIG_DFS
channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan5G[Index5G], index); channel_set[chanset_size].ChannelNum = CH_LIST_CH(RTW_ChannelPlan5G[Index5G], index);
@ -1347,8 +1347,8 @@ static void _mgt_dispatcher(_adapter *padapter, struct mlme_handler *ptable, uni
if (ptable->func) { if (ptable->func) {
/* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
if (!_rtw_memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN) && if (memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN) &&
!_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
return; return;
ptable->func(padapter, precv_frame); ptable->func(padapter, precv_frame);
@ -1374,8 +1374,8 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
} }
/* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
if (!_rtw_memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN) && if (memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN) &&
!_rtw_memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
return; return;
ptable = mlme_sta_tbl; ptable = mlme_sta_tbl;
@ -1412,7 +1412,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
switch (get_frame_sub_type(pframe)) { switch (get_frame_sub_type(pframe)) {
case WIFI_AUTH: case WIFI_AUTH:
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
ptable->func = &OnAuth; ptable->func = &OnAuth;
else else
ptable->func = &OnAuthClient; ptable->func = &OnAuthClient;
@ -1421,12 +1421,12 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
case WIFI_REASSOCREQ: case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame); _mgt_dispatcher(padapter, ptable, precv_frame);
#ifdef CONFIG_HOSTAPD_MLME #ifdef CONFIG_HOSTAPD_MLME
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
rtw_hostapd_mlme_rx(padapter, precv_frame); rtw_hostapd_mlme_rx(padapter, precv_frame);
#endif #endif
break; break;
case WIFI_PROBEREQ: case WIFI_PROBEREQ:
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
#ifdef CONFIG_HOSTAPD_MLME #ifdef CONFIG_HOSTAPD_MLME
rtw_hostapd_mlme_rx(padapter, precv_frame); rtw_hostapd_mlme_rx(padapter, precv_frame);
#else #else
@ -1439,12 +1439,12 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
_mgt_dispatcher(padapter, ptable, precv_frame); _mgt_dispatcher(padapter, ptable, precv_frame);
break; break;
case WIFI_ACTION: case WIFI_ACTION:
/* if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) */ /* if(check_fwstate(pmlmepriv, WIFI_AP_STATE)) */
_mgt_dispatcher(padapter, ptable, precv_frame); _mgt_dispatcher(padapter, ptable, precv_frame);
break; break;
default: default:
_mgt_dispatcher(padapter, ptable, precv_frame); _mgt_dispatcher(padapter, ptable, precv_frame);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
rtw_hostapd_mlme_rx(padapter, precv_frame); rtw_hostapd_mlme_rx(padapter, precv_frame);
break; break;
} }
@ -1491,7 +1491,7 @@ static u32 p2p_listen_state_process(_adapter *padapter, unsigned char *da)
response = false; response = false;
} }
if (response == true) if (response)
issue_probersp_p2p(padapter, da); issue_probersp_p2p(padapter, da);
return _SUCCESS; return _SUCCESS;
@ -1534,7 +1534,7 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame)
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if ((pwdinfo->driver_interface == DRIVER_CFG80211) if ((pwdinfo->driver_interface == DRIVER_CFG80211)
&& !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) && !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)
&& (GET_CFG80211_REPORT_MGMT(adapter_wdev_data(padapter), IEEE80211_STYPE_PROBE_REQ) == true) && (GET_CFG80211_REPORT_MGMT(adapter_wdev_data(padapter), IEEE80211_STYPE_PROBE_REQ))
) { ) {
rtw_cfg80211_rx_probe_request(padapter, precv_frame); rtw_cfg80211_rx_probe_request(padapter, precv_frame);
return _SUCCESS; return _SUCCESS;
@ -1563,7 +1563,7 @@ unsigned int OnProbeReq(_adapter *padapter, union recv_frame *precv_frame)
if (wifi_test_chk_rate == 1) { if (wifi_test_chk_rate == 1) {
is_valid_p2p_probereq = process_probe_req_p2p_ie(pwdinfo, pframe, len); is_valid_p2p_probereq = process_probe_req_p2p_ie(pwdinfo, pframe, len);
if (is_valid_p2p_probereq == true) { if (is_valid_p2p_probereq) {
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE)) { if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE)) {
/* FIXME */ /* FIXME */
if (padapter->wdinfo.driver_interface == DRIVER_WEXT) if (padapter->wdinfo.driver_interface == DRIVER_WEXT)
@ -1601,7 +1601,7 @@ _continue:
NULL, &wps_ielen); NULL, &wps_ielen);
if (wps_ie) if (wps_ie)
target_ie = rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_MANUFACTURER, NULL, &target_ielen); target_ie = rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_MANUFACTURER, NULL, &target_ielen);
if ((target_ie && (target_ielen == 4)) && (true == _rtw_memcmp((void *)target_ie, "Ozmo", 4))) { if ((target_ie && (target_ielen == 4)) && (!memcmp((void *)target_ie, "Ozmo", 4))) {
/* psta->flag_atmel_rc = 1; */ /* psta->flag_atmel_rc = 1; */
unsigned char *sa_addr = get_sa(pframe); unsigned char *sa_addr = get_sa(pframe);
RTW_INFO("%s: Find Ozmo RC -- %02x:%02x:%02x:%02x:%02x:%02x \n\n", RTW_INFO("%s: Find Ozmo RC -- %02x:%02x:%02x:%02x:%02x:%02x \n\n",
@ -1612,8 +1612,8 @@ _continue:
#ifdef CONFIG_AUTO_AP_MODE #ifdef CONFIG_AUTO_AP_MODE
if (check_fwstate(pmlmepriv, _FW_LINKED) == true && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
pmlmepriv->cur_network.join_res == true) { pmlmepriv->cur_network.join_res) {
unsigned long irqL; unsigned long irqL;
struct sta_info *psta; struct sta_info *psta;
u8 *mac_addr, *peer_addr; u8 *mac_addr, *peer_addr;
@ -1627,10 +1627,10 @@ _continue:
if (!p || ielen != 14) if (!p || ielen != 14)
goto _non_rc_device; goto _non_rc_device;
if (!_rtw_memcmp(p + 2, RC_OUI, sizeof(RC_OUI))) if (memcmp(p + 2, RC_OUI, sizeof(RC_OUI)))
goto _non_rc_device; goto _non_rc_device;
if (!_rtw_memcmp(p + 6, get_sa(pframe), ETH_ALEN)) { if (memcmp(p + 6, get_sa(pframe), ETH_ALEN)) {
RTW_INFO("%s, do rc pairing ("MAC_FMT"), but mac addr mismatch!("MAC_FMT")\n", __func__, RTW_INFO("%s, do rc pairing ("MAC_FMT"), but mac addr mismatch!("MAC_FMT")\n", __func__,
MAC_ARG(get_sa(pframe)), MAC_ARG(p + 6)); MAC_ARG(get_sa(pframe)), MAC_ARG(p + 6));
@ -1735,17 +1735,17 @@ _non_rc_device:
/* check (wildcard) SSID */ /* check (wildcard) SSID */
if (p != NULL) { if (p != NULL) {
if (is_valid_p2p_probereq == true) if (is_valid_p2p_probereq)
goto _issue_probersp; goto _issue_probersp;
if ((ielen != 0 && false == _rtw_memcmp((void *)(p + 2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) if ((ielen != 0 && false == !memcmp((void *)(p + 2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength))
|| (ielen == 0 && pmlmeinfo->hidden_ssid_mode) || (ielen == 0 && pmlmeinfo->hidden_ssid_mode)
) )
return _SUCCESS; return _SUCCESS;
_issue_probersp: _issue_probersp:
if (((check_fwstate(pmlmepriv, _FW_LINKED) == true && if (((check_fwstate(pmlmepriv, _FW_LINKED) &&
pmlmepriv->cur_network.join_res == true)) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { pmlmepriv->cur_network.join_res)) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
/* RTW_INFO("+issue_probersp during ap mode\n"); */ /* RTW_INFO("+issue_probersp during ap mode\n"); */
issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq);
} }
@ -1770,8 +1770,8 @@ unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame)
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) {
if (true == pwdinfo->tx_prov_disc_info.benable) { if (pwdinfo->tx_prov_disc_info.benable) {
if (_rtw_memcmp(pwdinfo->tx_prov_disc_info.peerIFAddr, get_addr2_ptr(pframe), ETH_ALEN)) { if (!memcmp(pwdinfo->tx_prov_disc_info.peerIFAddr, get_addr2_ptr(pframe), ETH_ALEN)) {
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT)) { if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT)) {
pwdinfo->tx_prov_disc_info.benable = false; pwdinfo->tx_prov_disc_info.benable = false;
issue_p2p_provision_request(padapter, issue_p2p_provision_request(padapter,
@ -1789,17 +1789,17 @@ unsigned int OnProbeRsp(_adapter *padapter, union recv_frame *precv_frame)
} }
return _SUCCESS; return _SUCCESS;
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
if (true == pwdinfo->nego_req_info.benable) { if (pwdinfo->nego_req_info.benable) {
RTW_INFO("[%s] P2P State is GONEGO ING!\n", __func__); RTW_INFO("[%s] P2P State is GONEGO ING!\n", __func__);
if (_rtw_memcmp(pwdinfo->nego_req_info.peerDevAddr, get_addr2_ptr(pframe), ETH_ALEN)) { if (!memcmp(pwdinfo->nego_req_info.peerDevAddr, get_addr2_ptr(pframe), ETH_ALEN)) {
pwdinfo->nego_req_info.benable = false; pwdinfo->nego_req_info.benable = false;
issue_p2p_GO_request(padapter, pwdinfo->nego_req_info.peerDevAddr); issue_p2p_GO_request(padapter, pwdinfo->nego_req_info.peerDevAddr);
} }
} }
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ)) { } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ)) {
if (true == pwdinfo->invitereq_info.benable) { if (pwdinfo->invitereq_info.benable) {
RTW_INFO("[%s] P2P_STATE_TX_INVITE_REQ!\n", __func__); RTW_INFO("[%s] P2P_STATE_TX_INVITE_REQ!\n", __func__);
if (_rtw_memcmp(pwdinfo->invitereq_info.peer_macaddr, get_addr2_ptr(pframe), ETH_ALEN)) { if (!memcmp(pwdinfo->invitereq_info.peer_macaddr, get_addr2_ptr(pframe), ETH_ALEN)) {
pwdinfo->invitereq_info.benable = false; pwdinfo->invitereq_info.benable = false;
issue_p2p_invitation_request(padapter, pwdinfo->invitereq_info.peer_macaddr); issue_p2p_invitation_request(padapter, pwdinfo->invitereq_info.peer_macaddr);
} }
@ -1830,7 +1830,7 @@ static void rtw_check_legacy_ap(_adapter *padapter, u8 *pframe, u32 len)
return; return;
if (pmlmeext->bstart_bss == true) { if (pmlmeext->bstart_bss) {
int left; int left;
u16 capability; u16 capability;
unsigned char *pos; unsigned char *pos;
@ -1904,7 +1904,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame)
rtw_check_legacy_ap(padapter, pframe, len); rtw_check_legacy_ap(padapter, pframe, len);
if (_rtw_memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) { if (!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) {
if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
/* we should update current network before auth, or some IE is wrong */ /* we should update current network before auth, or some IE is wrong */
pbss = (WLAN_BSSID_EX *)rtw_malloc(sizeof(WLAN_BSSID_EX)); pbss = (WLAN_BSSID_EX *)rtw_malloc(sizeof(WLAN_BSSID_EX));
@ -1916,7 +1916,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame)
rtw_get_bcn_info(&(pmlmepriv->cur_network)); rtw_get_bcn_info(&(pmlmepriv->cur_network));
/* update bcn keys */ /* update bcn keys */
if (rtw_get_bcn_keys(padapter, pframe, len, &recv_beacon) == true) { if (rtw_get_bcn_keys(padapter, pframe, len, &recv_beacon)) {
RTW_INFO("%s: beacon keys ready\n", __func__); RTW_INFO("%s: beacon keys ready\n", __func__);
_rtw_memcpy(&pmlmepriv->cur_beacon_keys, _rtw_memcpy(&pmlmepriv->cur_beacon_keys,
&recv_beacon, sizeof(recv_beacon)); &recv_beacon, sizeof(recv_beacon));
@ -1999,9 +1999,9 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame)
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
if (rtw_tdls_is_chsw_allowed(padapter) == true) { if (rtw_tdls_is_chsw_allowed(padapter)) {
/* Send TDLS Channel Switch Request when receiving Beacon */ /* Send TDLS Channel Switch Request when receiving Beacon */
if ((padapter->tdlsinfo.chsw_info.ch_sw_state & TDLS_CH_SW_INITIATOR_STATE) && (ATOMIC_READ(&pchsw_info->chsw_on) == true) if ((padapter->tdlsinfo.chsw_info.ch_sw_state & TDLS_CH_SW_INITIATOR_STATE) && (ATOMIC_READ(&pchsw_info->chsw_on))
&& (pmlmeext->cur_channel == rtw_get_oper_ch(padapter))) { && (pmlmeext->cur_channel == rtw_get_oper_ch(padapter))) {
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, padapter->tdlsinfo.chsw_info.addr); ptdls_sta = rtw_get_stainfo(&padapter->stapriv, padapter->tdlsinfo.chsw_info.addr);
if (ptdls_sta != NULL) { if (ptdls_sta != NULL) {
@ -2261,7 +2261,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame)
goto auth_fail; goto auth_fail;
} }
if (_rtw_memcmp((void *)(p + 2), pstat->chg_txt, 128)) { if (!memcmp((void *)(p + 2), pstat->chg_txt, 128)) {
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
if (pstat->bpairwise_key_installed != true && !(pstat->state & WIFI_FW_ASSOC_SUCCESS)) if (pstat->bpairwise_key_installed != true && !(pstat->state & WIFI_FW_ASSOC_SUCCESS))
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
@ -2336,7 +2336,7 @@ unsigned int OnAuthClient(_adapter *padapter, union recv_frame *precv_frame)
RTW_INFO("%s\n", __func__); RTW_INFO("%s\n", __func__);
/* check A1 matches or not */ /* check A1 matches or not */
if (!_rtw_memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN)) if (memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN))
return _SUCCESS; return _SUCCESS;
if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE))
@ -2542,7 +2542,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame)
status = _STATS_FAILURE_; status = _STATS_FAILURE_;
else { else {
/* check if ssid match */ /* check if ssid match */
if (!_rtw_memcmp((void *)(p + 2), cur->Ssid.Ssid, cur->Ssid.SsidLength)) if (memcmp((void *)(p + 2), cur->Ssid.Ssid, cur->Ssid.SsidLength))
status = _STATS_FAILURE_; status = _STATS_FAILURE_;
if (ie_len != cur->Ssid.SsidLength) if (ie_len != cur->Ssid.SsidLength)
@ -2705,7 +2705,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame)
for (;;) { for (;;) {
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, pkt_len - WLAN_HDR_A3_LEN - ie_offset);
if (p != NULL) { if (p != NULL) {
if (_rtw_memcmp(p + 2, WMM_IE, 6)) { if (!memcmp(p + 2, WMM_IE, 6)) {
pstat->flags |= WLAN_STA_WME; pstat->flags |= WLAN_STA_WME;
@ -2896,7 +2896,7 @@ bypass_ht_chk:
sta_info_update(padapter, pstat); sta_info_update(padapter, pstat);
} }
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
if (pstat->bpairwise_key_installed == true) if (pstat->bpairwise_key_installed)
status = _STATS_REFUSED_TEMPORARILY_; status = _STATS_REFUSED_TEMPORARILY_;
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
/* .2 issue assoc rsp before notify station join event. */ /* .2 issue assoc rsp before notify station join event. */
@ -2928,7 +2928,7 @@ bypass_ht_chk:
report_add_sta_event(padapter, pstat->hwaddr); report_add_sta_event(padapter, pstat->hwaddr);
} }
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
if (pstat->bpairwise_key_installed == true && padapter->securitypriv.binstallBIPkey == true) { if (pstat->bpairwise_key_installed && padapter->securitypriv.binstallBIPkey == true) {
RTW_INFO(MAC_FMT"\n", MAC_ARG(pstat->hwaddr)); RTW_INFO(MAC_FMT"\n", MAC_ARG(pstat->hwaddr));
issue_action_SA_Query(padapter, pstat->hwaddr, 0, 0, IEEE80211W_RIGHT_KEY); issue_action_SA_Query(padapter, pstat->hwaddr, 0, 0, IEEE80211W_RIGHT_KEY);
} }
@ -2981,7 +2981,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame)
RTW_INFO("%s\n", __func__); RTW_INFO("%s\n", __func__);
/* check A1 matches or not */ /* check A1 matches or not */
if (!_rtw_memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN)) if (memcmp(adapter_mac_addr(padapter), get_da(pframe), ETH_ALEN))
return _SUCCESS; return _SUCCESS;
if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE))) if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE)))
@ -3018,10 +3018,10 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */ if (!memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */
WMM_param_handler(padapter, pIE); WMM_param_handler(padapter, pIE);
#if defined(CONFIG_P2P) && defined(CONFIG_WFD) #if defined(CONFIG_P2P) && defined(CONFIG_WFD)
else if (_rtw_memcmp(pIE->data, WFD_OUI, 4)) /* WFD */ else if (!memcmp(pIE->data, WFD_OUI, 4)) /* WFD */
rtw_process_wfd_ie(padapter, (u8 *)pIE, pIE->Length, __func__); rtw_process_wfd_ie(padapter, (u8 *)pIE, pIE->Length, __func__);
#endif #endif
break; break;
@ -3045,9 +3045,9 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame)
break; break;
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
case _EXT_CAP_IE_: case _EXT_CAP_IE_:
if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == true) if (check_ap_tdls_prohibited(pIE->data, pIE->Length))
padapter->tdlsinfo.ap_prohibited = true; padapter->tdlsinfo.ap_prohibited = true;
if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == true) if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length))
padapter->tdlsinfo.ch_switch_prohibited = true; padapter->tdlsinfo.ch_switch_prohibited = true;
break; break;
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
@ -3091,7 +3091,7 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame)
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
/* check A3 */ /* check A3 */
if (!(_rtw_memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
return _SUCCESS; return _SUCCESS;
RTW_INFO(FUNC_ADPT_FMT" - Start to Disconnect\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" - Start to Disconnect\n", FUNC_ADPT_ARG(padapter));
@ -3108,7 +3108,7 @@ unsigned int OnDeAuth(_adapter *padapter, union recv_frame *precv_frame)
rtw_lock_rx_suspend_timeout(8000); rtw_lock_rx_suspend_timeout(8000);
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
unsigned long irqL; unsigned long irqL;
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -3181,7 +3181,7 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame)
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
/* check A3 */ /* check A3 */
if (!(_rtw_memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
return _SUCCESS; return _SUCCESS;
RTW_INFO(FUNC_ADPT_FMT" - Start to Disconnect\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" - Start to Disconnect\n", FUNC_ADPT_ARG(padapter));
@ -3198,7 +3198,7 @@ unsigned int OnDisassoc(_adapter *padapter, union recv_frame *precv_frame)
rtw_lock_rx_suspend_timeout(8000); rtw_lock_rx_suspend_timeout(8000);
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
unsigned long irqL; unsigned long irqL;
struct sta_info *psta; struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -3412,7 +3412,7 @@ u8 rtw_rx_ampdu_size(_adapter *adapter)
} }
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(adapter) == true) { if (rtw_btcoex_IsBTCoexCtrlAMPDUSize(adapter)) {
size = rtw_btcoex_GetAMPDUSize(adapter); size = rtw_btcoex_GetAMPDUSize(adapter);
goto exit; goto exit;
} }
@ -3475,7 +3475,7 @@ bool rtw_rx_ampdu_is_accept(_adapter *adapter)
} }
#ifdef CONFIG_BT_COEXIST #ifdef CONFIG_BT_COEXIST
if (rtw_btcoex_IsBTCoexRejectAMPDU(adapter) == true) { if (rtw_btcoex_IsBTCoexRejectAMPDU(adapter)) {
accept = false; accept = false;
goto exit; goto exit;
} }
@ -3706,7 +3706,7 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame)
RTW_INFO("%s\n", __func__); RTW_INFO("%s\n", __func__);
/* check RA matches or not */ /* check RA matches or not */
if (!_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN)) if (memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN))
return _SUCCESS; return _SUCCESS;
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
@ -3725,8 +3725,8 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame)
if (category == RTW_WLAN_CATEGORY_BACK) { /* representing Block Ack */ if (category == RTW_WLAN_CATEGORY_BACK) { /* representing Block Ack */
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if ((psta->tdls_sta_state & TDLS_LINKED_STATE) && if ((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
(psta->htpriv.ht_option == true) && (psta->htpriv.ht_option) &&
(psta->htpriv.ampdu_enable == true)) (psta->htpriv.ampdu_enable))
RTW_INFO("Recv [%s] from direc link\n", __func__); RTW_INFO("Recv [%s] from direc link\n", __func__);
else else
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
@ -4351,7 +4351,7 @@ static void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body,
/* Commented by Kurt 20120113 */ /* Commented by Kurt 20120113 */
/* If some device wants to do p2p handshake without sending prov_disc_req */ /* If some device wants to do p2p handshake without sending prov_disc_req */
/* We have to get peer_req_cm from here. */ /* We have to get peer_req_cm from here. */
if (_rtw_memcmp(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3)) { if (!memcmp(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3)) {
if (wps_devicepassword_id == WPS_DPID_USER_SPEC) if (wps_devicepassword_id == WPS_DPID_USER_SPEC)
_rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "dis", 3); _rtw_memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "dis", 3);
else if (wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC) else if (wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC)
@ -5034,7 +5034,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr)
/* Channel Number */ /* Channel Number */
p2pie[p2pielen++] = pwdinfo->invitereq_info.operating_ch; /* operating channel number */ p2pie[p2pielen++] = pwdinfo->invitereq_info.operating_ch; /* operating channel number */
if (_rtw_memcmp(adapter_mac_addr(padapter), pwdinfo->invitereq_info.go_bssid, ETH_ALEN)) { if (!memcmp(adapter_mac_addr(padapter), pwdinfo->invitereq_info.go_bssid, ETH_ALEN)) {
/* P2P Group BSSID */ /* P2P Group BSSID */
/* Type: */ /* Type: */
p2pie[p2pielen++] = P2P_ATTR_GROUP_BSSID; p2pie[p2pielen++] = P2P_ATTR_GROUP_BSSID;
@ -5589,7 +5589,7 @@ static u8 is_matched_in_profilelist(u8 *peermacaddr, struct profile_info *profil
for (i = 0; i < P2P_MAX_PERSISTENT_GROUP_NUM; i++, profileinfo++) { for (i = 0; i < P2P_MAX_PERSISTENT_GROUP_NUM; i++, profileinfo++) {
RTW_INFO("[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __func__, RTW_INFO("[%s] profileinfo_mac = %.2X %.2X %.2X %.2X %.2X %.2X\n", __func__,
profileinfo->peermac[0], profileinfo->peermac[1], profileinfo->peermac[2], profileinfo->peermac[3], profileinfo->peermac[4], profileinfo->peermac[5]); profileinfo->peermac[0], profileinfo->peermac[1], profileinfo->peermac[2], profileinfo->peermac[3], profileinfo->peermac[4], profileinfo->peermac[5]);
if (_rtw_memcmp(peermacaddr, profileinfo->peermac, ETH_ALEN)) { if (!memcmp(peermacaddr, profileinfo->peermac, ETH_ALEN)) {
match_result = 1; match_result = 1;
RTW_INFO("[%s] Match!\n", __func__); RTW_INFO("[%s] Match!\n", __func__);
break; break;
@ -5733,7 +5733,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da)
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
/* Commented by Kurt */ /* Commented by Kurt */
/* Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. */ /* Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. */
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false if (!memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false
|| pmlmepriv->num_p2p_sdt != 0) { || pmlmepriv->num_p2p_sdt != 0) {
/* Sec dev type */ /* Sec dev type */
*(__be16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_SEC_DEV_TYPE_LIST); *(__be16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_SEC_DEV_TYPE_LIST);
@ -5755,7 +5755,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da)
*(__be16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_PDT_SCID_WIDI_CONSUMER_SINK); *(__be16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_PDT_SCID_WIDI_CONSUMER_SINK);
wpsielen += 2; wpsielen += 2;
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false) { if (!memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false) {
/* Vendor Extension */ /* Vendor Extension */
_rtw_memcpy(wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN); _rtw_memcpy(wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN);
wpsielen += L2SDTA_SERVICE_VE_LEN; wpsielen += L2SDTA_SERVICE_VE_LEN;
@ -6386,7 +6386,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
/* Commented by Kurt 20120113 */ /* Commented by Kurt 20120113 */
/* Get peer_dev_addr here if peer doesn't issue prov_disc frame. */ /* Get peer_dev_addr here if peer doesn't issue prov_disc frame. */
if (_rtw_memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN)) if (!memcmp(pwdinfo->rx_prov_disc_info.peerDevAddr, empty_addr, ETH_ALEN))
_rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, get_addr2_ptr(pframe), ETH_ALEN); _rtw_memcpy(pwdinfo->rx_prov_disc_info.peerDevAddr, get_addr2_ptr(pframe), ETH_ALEN);
result = process_p2p_group_negotation_req(pwdinfo, frame_body, len); result = process_p2p_group_negotation_req(pwdinfo, frame_body, len);
@ -6508,7 +6508,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
memset(&group_id, 0x00, sizeof(struct group_id_info)); memset(&group_id, 0x00, sizeof(struct group_id_info));
rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen); rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen);
if (attr_contentlen) { if (attr_contentlen) {
if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) { if (!memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) {
/* The p2p device sending this p2p invitation request wants this Wi-Fi device to be the persistent GO. */ /* The p2p device sending this p2p invitation request wants this Wi-Fi device to be the persistent GO. */
rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_GO); rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_GO);
rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO); rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO);
@ -6567,7 +6567,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
memset(&group_id, 0x00, sizeof(struct group_id_info)); memset(&group_id, 0x00, sizeof(struct group_id_info));
rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen); rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen);
if (attr_contentlen) { if (attr_contentlen) {
if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) { if (!memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) {
/* In this case, the GO can't be myself. */ /* In this case, the GO can't be myself. */
rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_DISMATCH); rtw_p2p_set_state(pwdinfo, P2P_STATE_RECV_INVITE_REQ_DISMATCH);
status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE; status_code = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
@ -6623,7 +6623,7 @@ static unsigned int on_action_public_p2p(union recv_frame *precv_frame)
pwdinfo->invitereq_info.benable = false; pwdinfo->invitereq_info.benable = false;
if (attr_content == P2P_STATUS_SUCCESS) { if (attr_content == P2P_STATUS_SUCCESS) {
if (_rtw_memcmp(pwdinfo->invitereq_info.go_bssid, adapter_mac_addr(padapter), ETH_ALEN)) if (!memcmp(pwdinfo->invitereq_info.go_bssid, adapter_mac_addr(padapter), ETH_ALEN))
rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO); rtw_p2p_set_role(pwdinfo, P2P_ROLE_GO);
else else
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT); rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
@ -6710,7 +6710,7 @@ static unsigned int on_action_public_vendor(union recv_frame *precv_frame)
uint frame_len = precv_frame->u.hdr.len; uint frame_len = precv_frame->u.hdr.len;
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
if (_rtw_memcmp(frame_body + 2, P2P_OUI, 4) == true) { if (!memcmp(frame_body + 2, P2P_OUI, 4)) {
if (rtw_action_public_decache(precv_frame, 7) == _FAIL) if (rtw_action_public_decache(precv_frame, 7) == _FAIL)
goto exit; goto exit;
@ -6760,7 +6760,7 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame)
u8 category, action; u8 category, action;
/* check RA matches or not */ /* check RA matches or not */
if (!_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN)) if (memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN))
goto exit; goto exit;
category = frame_body[0]; category = frame_body[0];
@ -6772,7 +6772,7 @@ unsigned int on_action_public(_adapter *padapter, union recv_frame *precv_frame)
case ACT_PUBLIC_BSSCOEXIST: case ACT_PUBLIC_BSSCOEXIST:
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
/*20/40 BSS Coexistence Management frame is a Public Action frame*/ /*20/40 BSS Coexistence Management frame is a Public Action frame*/
if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
rtw_process_public_act_bsscoex(padapter, pframe, frame_len); rtw_process_public_act_bsscoex(padapter, pframe, frame_len);
#endif /*CONFIG_AP_MODE*/ #endif /*CONFIG_AP_MODE*/
break; break;
@ -6824,7 +6824,7 @@ unsigned int OnAction_ft(_adapter *padapter, union recv_frame *precv_frame)
switch (action_code) { switch (action_code) {
case RTW_WLAN_ACTION_FT_RESPONSE: case RTW_WLAN_ACTION_FT_RESPONSE:
RTW_INFO("FT: %s RTW_WLAN_ACTION_FT_RESPONSE\n", __func__); RTW_INFO("FT: %s RTW_WLAN_ACTION_FT_RESPONSE\n", __func__);
if (!_rtw_memcmp(adapter_mac_addr(padapter), &pframe_body[2], ETH_ALEN)) { if (memcmp(adapter_mac_addr(padapter), &pframe_body[2], ETH_ALEN)) {
RTW_ERR("FT: Unmatched STA MAC Address "MAC_FMT"\n", MAC_ARG(&pframe_body[2])); RTW_ERR("FT: Unmatched STA MAC Address "MAC_FMT"\n", MAC_ARG(&pframe_body[2]));
goto exit; goto exit;
} }
@ -6842,7 +6842,7 @@ unsigned int OnAction_ft(_adapter *padapter, union recv_frame *precv_frame)
pie = rtw_get_ie(pframe_body, _MDIE_, &ft_ie_len, frame_len); pie = rtw_get_ie(pframe_body, _MDIE_, &ft_ie_len, frame_len);
if (pie) { if (pie) {
if (!_rtw_memcmp(&pftpriv->mdid, pie+2, 2)) { if (memcmp(&pftpriv->mdid, pie+2, 2)) {
RTW_ERR("FT: Invalid MDID\n"); RTW_ERR("FT: Invalid MDID\n");
goto exit; goto exit;
} }
@ -6881,7 +6881,7 @@ unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame)
u8 category, action; u8 category, action;
/* check RA matches or not */ /* check RA matches or not */
if (!_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN)) if (memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN))
goto exit; goto exit;
category = frame_body[0]; category = frame_body[0];
@ -6892,7 +6892,7 @@ unsigned int OnAction_ht(_adapter *padapter, union recv_frame *precv_frame)
switch (action) { switch (action) {
case RTW_WLAN_ACTION_HT_SM_PS: case RTW_WLAN_ACTION_HT_SM_PS:
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
rtw_process_ht_action_smps(padapter, get_addr2_ptr(pframe), frame_body[2]); rtw_process_ht_action_smps(padapter, get_addr2_ptr(pframe), frame_body[2]);
#endif /*CONFIG_AP_MODE*/ #endif /*CONFIG_AP_MODE*/
break; break;
@ -6976,7 +6976,7 @@ unsigned int OnAction_p2p(_adapter *padapter, union recv_frame *precv_frame)
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
/* check RA matches or not */ /* check RA matches or not */
if (!_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN)) if (memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(pframe), ETH_ALEN))
return _SUCCESS; return _SUCCESS;
frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr)); frame_body = (unsigned char *)(pframe + sizeof(struct rtw_ieee80211_hdr_3addr));
@ -8250,7 +8250,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status
pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&le_val16, &(pattrib->pktlen)); pframe = rtw_set_fixed_ie(pframe, _STATUS_CODE_, (unsigned char *)&le_val16, &(pattrib->pktlen));
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
if (is_ft_roaming == true) { if (is_ft_roaming) {
pie = rtw_get_ie(pftpriv->updated_ft_ies, EID_WPA2, &ft_ie_len, pftpriv->updated_ft_ies_len); pie = rtw_get_ie(pftpriv->updated_ft_ies, EID_WPA2, &ft_ie_len, pftpriv->updated_ft_ies_len);
if (pie) if (pie)
pframe = rtw_set_ie(pframe, EID_WPA2, ft_ie_len, pie+2, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_WPA2, ft_ie_len, pie+2, &(pattrib->pktlen));
@ -8428,7 +8428,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p
for (pbuf = ie + _BEACON_IE_OFFSET_; ; pbuf += (ie_len + 2)) { for (pbuf = ie + _BEACON_IE_OFFSET_; ; pbuf += (ie_len + 2)) {
pbuf = rtw_get_ie(pbuf, _VENDOR_SPECIFIC_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); pbuf = rtw_get_ie(pbuf, _VENDOR_SPECIFIC_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
if (pbuf && _rtw_memcmp(pbuf + 2, WMM_PARA_IE, 6)) { if (pbuf && !memcmp(pbuf + 2, WMM_PARA_IE, 6)) {
_rtw_memcpy(pframe, pbuf, ie_len + 2); _rtw_memcpy(pframe, pbuf, ie_len + 2);
pframe += (ie_len + 2); pframe += (ie_len + 2);
pattrib->pktlen += (ie_len + 2); pattrib->pktlen += (ie_len + 2);
@ -8455,7 +8455,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p
} }
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && (pstat->is_p2p_device == true)) { if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO) && (pstat->is_p2p_device)) {
u32 len; u32 len;
if (padapter->wdinfo.driver_interface == DRIVER_CFG80211) { if (padapter->wdinfo.driver_interface == DRIVER_CFG80211) {
@ -8555,7 +8555,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
pmlmeext->mgnt_seq++; pmlmeext->mgnt_seq++;
if (is_reassoc == true) if (is_reassoc)
set_frame_sub_type(pframe, WIFI_REASSOCREQ); set_frame_sub_type(pframe, WIFI_REASSOCREQ);
else else
set_frame_sub_type(pframe, WIFI_ASSOCREQ); set_frame_sub_type(pframe, WIFI_ASSOCREQ);
@ -8584,7 +8584,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
pattrib->pktlen += 2; pattrib->pktlen += 2;
/*Construct Current AP Field for Reassoc-Req only*/ /*Construct Current AP Field for Reassoc-Req only*/
if (is_reassoc == true) { if (is_reassoc) {
_rtw_memcpy(pframe, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN); _rtw_memcpy(pframe, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
pframe += ETH_ALEN; pframe += ETH_ALEN;
pattrib->pktlen += ETH_ALEN; pattrib->pktlen += ETH_ALEN;
@ -8685,11 +8685,11 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) || if ((!memcmp(pIE->data, RTW_WPA_OUI, 4)) ||
(_rtw_memcmp(pIE->data, WMM_OUI, 4)) || (!memcmp(pIE->data, WMM_OUI, 4)) ||
(_rtw_memcmp(pIE->data, WPS_OUI, 4))) { (!memcmp(pIE->data, WPS_OUI, 4))) {
vs_ie_length = pIE->Length; vs_ie_length = pIE->Length;
if ((!padapter->registrypriv.wifi_spec) && (_rtw_memcmp(pIE->data, WPS_OUI, 4))) { if ((!padapter->registrypriv.wifi_spec) && (!memcmp(pIE->data, WPS_OUI, 4))) {
/* Commented by Kurt 20110629 */ /* Commented by Kurt 20110629 */
/* In some older APs, WPS handshake */ /* In some older APs, WPS handshake */
/* would be fail if we append vender extensions informations to AP */ /* would be fail if we append vender extensions informations to AP */
@ -8703,7 +8703,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
case EID_WPA2: case EID_WPA2:
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
if ((is_reassoc == true) && (rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED)) { if ((is_reassoc) && (rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED)) {
pie = rtw_get_ie(pftpriv->updated_ft_ies, EID_WPA2, &ft_ie_len, pftpriv->updated_ft_ies_len); pie = rtw_get_ie(pftpriv->updated_ft_ies, EID_WPA2, &ft_ie_len, pftpriv->updated_ft_ies_len);
if (pie) if (pie)
pframe = rtw_set_ie(pframe, EID_WPA2, ft_ie_len, pie+2, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_WPA2, ft_ie_len, pie+2, &(pattrib->pktlen));
@ -8712,7 +8712,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen));
break; break;
case EID_HTCapability: case EID_HTCapability:
if (padapter->mlmepriv.htpriv.ht_option == true) { if (padapter->mlmepriv.htpriv.ht_option) {
if (!(is_ap_in_tkip(padapter))) { if (!(is_ap_in_tkip(padapter))) {
_rtw_memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element)); _rtw_memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element));
pframe = rtw_set_ie(pframe, EID_HTCapability, pIE->Length , (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_HTCapability, pIE->Length , (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen));
@ -8721,7 +8721,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
break; break;
case EID_EXTCapability: case EID_EXTCapability:
if (padapter->mlmepriv.htpriv.ht_option == true) if (padapter->mlmepriv.htpriv.ht_option)
pframe = rtw_set_ie(pframe, EID_EXTCapability, pIE->Length, pIE->data, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, EID_EXTCapability, pIE->Length, pIE->data, &(pattrib->pktlen));
break; break;
default: default:
@ -8899,7 +8899,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc)
pframe = rtw_set_ie(pframe, _MDIE_, 3, mdieval, &(pattrib->pktlen)); pframe = rtw_set_ie(pframe, _MDIE_, 3, mdieval, &(pattrib->pktlen));
} }
if (is_reassoc == true) { if (is_reassoc) {
if ((rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED)) { if ((rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED)) {
u8 is_ft_roaming_with_rsn_ie = true; u8 is_ft_roaming_with_rsn_ie = true;
@ -9912,7 +9912,7 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter)
if ((pmlmepriv->num_FortyMHzIntolerant == 0) || (pmlmepriv->num_sta_no_ht == 0)) if ((pmlmepriv->num_FortyMHzIntolerant == 0) || (pmlmepriv->num_sta_no_ht == 0))
return; return;
if (true == pmlmeinfo->bwmode_updated) if (pmlmeinfo->bwmode_updated)
return; return;
if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter))) if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter)))
@ -9981,7 +9981,7 @@ static void issue_action_BSSCoexistPacket(_adapter *padapter)
u8 *p; u8 *p;
WLAN_BSSID_EX *pbss_network; WLAN_BSSID_EX *pbss_network;
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist))
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
@ -10202,7 +10202,7 @@ static unsigned int _send_delba_sta_tid(_adapter *adapter, u8 initiator, struct
if (initiator == 0) { if (initiator == 0) {
/* recipient */ /* recipient */
if (force || sta->recvreorder_ctrl[tid].enable == true) { if (force || sta->recvreorder_ctrl[tid].enable) {
u8 ampdu_size_bak = sta->recvreorder_ctrl[tid].ampdu_size; u8 ampdu_size_bak = sta->recvreorder_ctrl[tid].ampdu_size;
sta->recvreorder_ctrl[tid].enable = false; sta->recvreorder_ctrl[tid].enable = false;
@ -10636,7 +10636,7 @@ void start_clnt_join(_adapter *padapter)
update_capinfo(padapter, caps); update_capinfo(padapter, caps);
/* check if sta is ASIX peer and fix IOT issue if it is. */ /* check if sta is ASIX peer and fix IOT issue if it is. */
if (_rtw_memcmp(get_my_bssid(&pmlmeinfo->network) , ASIX_ID , 3)) { if (!memcmp(get_my_bssid(&pmlmeinfo->network) , ASIX_ID , 3)) {
u8 iot_flag = true; u8 iot_flag = true;
rtw_hal_set_hwreg(padapter, HW_VAR_ASIX_IOT, (u8 *)(&iot_flag)); rtw_hal_set_hwreg(padapter, HW_VAR_ASIX_IOT, (u8 *)(&iot_flag));
} }
@ -10677,8 +10677,8 @@ void start_clnt_join(_adapter *padapter)
scanned = LIST_CONTAINOR(pos, struct wlan_network, list); scanned = LIST_CONTAINOR(pos, struct wlan_network, list);
if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true if (!memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID))
&& _rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == true && !memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS))
) { ) {
ie_offset = (scanned->network.Reserved[0] == 2 ? 0 : 12); ie_offset = (scanned->network.Reserved[0] == 2 ? 0 : 12);
if (rtw_get_p2p_ie(scanned->network.IEs + ie_offset, scanned->network.IELength - ie_offset, NULL, NULL)) if (rtw_get_p2p_ie(scanned->network.IEs + ie_offset, scanned->network.IELength - ie_offset, NULL, NULL))
@ -10797,7 +10797,7 @@ unsigned int receive_disconnect(_adapter *padapter, unsigned char *MacAddr, unsi
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
if (!(_rtw_memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) if (!(!memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
return _SUCCESS; return _SUCCESS;
RTW_INFO("%s\n", __func__); RTW_INFO("%s\n", __func__);
@ -11424,7 +11424,7 @@ bool rtw_port_switch_chk(_adapter *adapter)
#ifdef CONFIG_WOWLAN #ifdef CONFIG_WOWLAN
/* WOWLAN interface(primary, for now) should be port0 */ /* WOWLAN interface(primary, for now) should be port0 */
if (pwrctl->wowlan_mode == true) { if (pwrctl->wowlan_mode) {
if (!is_primary_adapter(if_port0)) { if (!is_primary_adapter(if_port0)) {
RTW_INFO("%s "ADPT_FMT" enable WOWLAN\n", __func__, ADPT_ARG(if_port1)); RTW_INFO("%s "ADPT_FMT" enable WOWLAN\n", __func__, ADPT_ARG(if_port1));
switch_needed = true; switch_needed = true;
@ -11558,7 +11558,7 @@ static void rtw_mlmeext_disconnect(_adapter *padapter)
Set_MSR(padapter, _HW_STATE_STATION_); Set_MSR(padapter, _HW_STATE_STATION_);
/* check if sta is ASIX peer and fix IOT issue if it is. */ /* check if sta is ASIX peer and fix IOT issue if it is. */
if (_rtw_memcmp(get_my_bssid(&pmlmeinfo->network) , ASIX_ID , 3)) { if (!memcmp(get_my_bssid(&pmlmeinfo->network) , ASIX_ID , 3)) {
u8 iot_flag = false; u8 iot_flag = false;
rtw_hal_set_hwreg(padapter, HW_VAR_ASIX_IOT, (u8 *)(&iot_flag)); rtw_hal_set_hwreg(padapter, HW_VAR_ASIX_IOT, (u8 *)(&iot_flag));
} }
@ -11570,7 +11570,7 @@ static void rtw_mlmeext_disconnect(_adapter *padapter)
#endif /* CONFIG_MCC_MODE */ #endif /* CONFIG_MCC_MODE */
if (state_backup == WIFI_FW_STATION_STATE) { if (state_backup == WIFI_FW_STATION_STATE) {
if (rtw_port_switch_chk(padapter) == true) { if (rtw_port_switch_chk(padapter)) {
rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL);
#ifdef CONFIG_LPS #ifdef CONFIG_LPS
{ {
@ -11701,7 +11701,7 @@ void mlmeext_joinbss_event_callback(_adapter *padapter, int join_res)
rtw_sec_restore_wep_key(padapter); rtw_sec_restore_wep_key(padapter);
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
if (rtw_port_switch_chk(padapter) == true) if (rtw_port_switch_chk(padapter))
rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL);
join_type = 2; join_type = 2;
@ -11863,7 +11863,7 @@ static void rtw_delba_check(_adapter *padapter, struct sta_info *psta, u8 from_t
for (i = 0; i < TID_NUM ; i++) { for (i = 0; i < TID_NUM ; i++) {
if ((psta->recvreorder_ctrl[i].enable) && if ((psta->recvreorder_ctrl[i].enable) &&
(sta_rx_data_qos_pkts(psta, i) == sta_last_rx_data_qos_pkts(psta, i)) ) { (sta_rx_data_qos_pkts(psta, i) == sta_last_rx_data_qos_pkts(psta, i)) ) {
if (true == rtw_inc_and_chk_continual_no_rx_packet(psta, i)) { if (rtw_inc_and_chk_continual_no_rx_packet(psta, i)) {
/* send a DELBA frame to the peer STA with the Reason Code field set to TIMEOUT */ /* send a DELBA frame to the peer STA with the Reason Code field set to TIMEOUT */
if (!from_timer) if (!from_timer)
ret = issue_del_ba_ex(padapter, psta->hwaddr, i, 39, 0, 3, 1); ret = issue_del_ba_ex(padapter, psta->hwaddr, i, 39, 0, 3, 1);
@ -11994,7 +11994,7 @@ void linked_status_chk_tdls(_adapter *padapter)
memset(checkalive, 0x00, sizeof(checkalive)); memset(checkalive, 0x00, sizeof(checkalive));
memset(teardown, 0x00, sizeof(teardown)); memset(teardown, 0x00, sizeof(teardown));
if ((padapter->tdlsinfo.link_established == true)) { if ((padapter->tdlsinfo.link_established)) {
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for (i = 0; i < NUM_STA; i++) { for (i = 0; i < NUM_STA; i++) {
phead = &(pstapriv->sta_hash[i]); phead = &(pstapriv->sta_hash[i]);
@ -12030,7 +12030,7 @@ void linked_status_chk_tdls(_adapter *padapter)
} }
} }
if (tdls_sta_max == true) if (tdls_sta_max)
break; break;
} }
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
@ -12073,7 +12073,7 @@ void linked_status_chk(_adapter *padapter, u8 from_timer)
struct recv_priv *precvpriv = &padapter->recvpriv; struct recv_priv *precvpriv = &padapter->recvpriv;
#endif #endif
if (padapter->registrypriv.mp_mode == true) if (padapter->registrypriv.mp_mode)
return; return;
if (is_client_associated_to_ap(padapter)) { if (is_client_associated_to_ap(padapter)) {
@ -12140,7 +12140,7 @@ void linked_status_chk(_adapter *padapter, u8 from_timer)
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
if (ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on) == true) if (ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on))
return; return;
#endif /* CONFIG_TDLS_CH_SW */ #endif /* CONFIG_TDLS_CH_SW */
@ -12410,7 +12410,7 @@ void addba_timer_hdl(struct sta_info *psta)
phtpriv = &psta->htpriv; phtpriv = &psta->htpriv;
if ((phtpriv->ht_option == true) && (phtpriv->ampdu_enable == true)) { if ((phtpriv->ht_option) && (phtpriv->ampdu_enable == true)) {
if (phtpriv->candidate_tid_bitmap) if (phtpriv->candidate_tid_bitmap)
phtpriv->candidate_tid_bitmap = 0x0; phtpriv->candidate_tid_bitmap = 0x0;
@ -12492,10 +12492,10 @@ void sa_query_timer_hdl(struct sta_info *psta)
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true && if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
check_fwstate(pmlmepriv, _FW_LINKED) == true) check_fwstate(pmlmepriv, _FW_LINKED))
clnt_sa_query_timeout(padapter); clnt_sa_query_timeout(padapter);
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
report_sta_timeout_event(padapter, psta->hwaddr, WLAN_REASON_PREV_AUTH_NOT_VALID); report_sta_timeout_event(padapter, psta->hwaddr, WLAN_REASON_PREV_AUTH_NOT_VALID);
} }
@ -12835,7 +12835,7 @@ u8 setopmode_hdl(_adapter *padapter, u8 *pbuf)
rtw_auto_ap_start_beacon(padapter); rtw_auto_ap_start_beacon(padapter);
#endif #endif
if (rtw_port_switch_chk(padapter) == true) { if (rtw_port_switch_chk(padapter)) {
rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_PORT_SWITCH, NULL);
if (psetop->mode == Ndis802_11APMode) if (psetop->mode == Ndis802_11APMode)
@ -13011,7 +13011,7 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: /* Get WMM IE. */ case _VENDOR_SPECIFIC_IE_: /* Get WMM IE. */
if (_rtw_memcmp(pIE->data, WMM_OUI, 4)) if (!memcmp(pIE->data, WMM_OUI, 4))
WMM_param_handler(padapter, pIE); WMM_param_handler(padapter, pIE);
break; break;
case _HT_CAPABILITY_IE_: /* Get HT Cap IE. */ case _HT_CAPABILITY_IE_: /* Get HT Cap IE. */
@ -13080,7 +13080,7 @@ u8 disconnect_hdl(_adapter *padapter, unsigned char *pbuf)
} }
#ifdef CONFIG_DFS #ifdef CONFIG_DFS
if (padapter->mlmepriv.handle_dfs == true) if (padapter->mlmepriv.handle_dfs)
padapter->mlmepriv.handle_dfs = false; padapter->mlmepriv.handle_dfs = false;
#endif /* CONFIG_DFS */ #endif /* CONFIG_DFS */
@ -13130,7 +13130,7 @@ static bool scan_abort_hdl(_adapter *adapter)
#endif #endif
bool ret = false; bool ret = false;
if (pmlmeext->scan_abort == true) { if (pmlmeext->scan_abort) {
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (!rtw_p2p_chk_state(&adapter->wdinfo, P2P_STATE_NONE)) { if (!rtw_p2p_chk_state(&adapter->wdinfo, P2P_STATE_NONE)) {
rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX); rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_MAX);
@ -13211,18 +13211,18 @@ static u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u
/* max_allow_ch by conditions*/ /* max_allow_ch by conditions*/
#if RTW_SCAN_SPARSE_MIRACAST #if RTW_SCAN_SPARSE_MIRACAST
if (miracast_enabled == true && busy_traffic == true) if (miracast_enabled && busy_traffic == true)
max_allow_ch = rtw_min(max_allow_ch, RTW_SCAN_SPARSE_CH_NUM_MIRACAST); max_allow_ch = rtw_min(max_allow_ch, RTW_SCAN_SPARSE_CH_NUM_MIRACAST);
#endif #endif
#if RTW_SCAN_SPARSE_BG #if RTW_SCAN_SPARSE_BG
if (bg_scan == true) if (bg_scan)
max_allow_ch = rtw_min(max_allow_ch, RTW_SCAN_SPARSE_CH_NUM_BG); max_allow_ch = rtw_min(max_allow_ch, RTW_SCAN_SPARSE_CH_NUM_BG);
#endif #endif
#if defined(CONFIG_LAYER2_ROAMING) && defined(RTW_SCAN_SPARSE_ROAMING_ACTIVE) #if defined(CONFIG_LAYER2_ROAMING) && defined(RTW_SCAN_SPARSE_ROAMING_ACTIVE)
if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) { if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
if (busy_traffic == true && adapter->mlmepriv.need_to_roam == true) if (busy_traffic && adapter->mlmepriv.need_to_roam == true)
max_allow_ch = rtw_min(max_allow_ch, RTW_SCAN_SPARSE_CH_NUM_ROAMING_ACTIVE); max_allow_ch = rtw_min(max_allow_ch, RTW_SCAN_SPARSE_CH_NUM_ROAMING_ACTIVE);
} }
#endif #endif
@ -13304,8 +13304,8 @@ static int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel
if (j == 0) { if (j == 0) {
for (i = 0; i < pmlmeext->max_chan_nums; i++) { for (i = 0; i < pmlmeext->max_chan_nums; i++) {
chan = pmlmeext->channel_set[i].ChannelNum; chan = pmlmeext->channel_set[i].ChannelNum;
if (rtw_mlme_band_check(padapter, chan) == true) { if (rtw_mlme_band_check(padapter, chan)) {
if (rtw_mlme_ignore_chan(padapter, chan) == true) if (rtw_mlme_ignore_chan(padapter, chan))
continue; continue;
if (0) if (0)
@ -13658,7 +13658,7 @@ static void sitesurvey_set_igi(_adapter *adapter)
case SCAN_ENTER: case SCAN_ENTER:
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (adapter_wdev_data(adapter)->p2p_enabled == true && pwdinfo->driver_interface == DRIVER_CFG80211) if (adapter_wdev_data(adapter)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211)
igi = 0x30; igi = 0x30;
else else
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
@ -13869,7 +13869,7 @@ operation_by_state:
site_survey(padapter, scan_ch, scan_type); site_survey(padapter, scan_ch, scan_type);
#if defined(CONFIG_ATMEL_RC_PATCH) #if defined(CONFIG_ATMEL_RC_PATCH)
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
scan_ms = 20; scan_ms = 20;
else else
scan_ms = 40; scan_ms = 40;
@ -14149,7 +14149,7 @@ u8 setkey_hdl(_adapter *padapter, u8 *pbuf)
} }
/* cam entry searched is pairwise key */ /* cam entry searched is pairwise key */
if (used == true && rtw_camid_is_gk(padapter, cam_id) == false) { if (used && rtw_camid_is_gk(padapter, cam_id) == false) {
s16 camid_clr; s16 camid_clr;
RTW_PRINT(FUNC_ADPT_FMT" group key with "MAC_FMT" id:%u the same key id as pairwise key\n" RTW_PRINT(FUNC_ADPT_FMT" group key with "MAC_FMT" id:%u the same key id as pairwise key\n"
@ -14281,7 +14281,7 @@ u8 set_stakey_hdl(_adapter *padapter, u8 *pbuf)
goto exit; goto exit;
/* cam entry searched is group key */ /* cam entry searched is group key */
if (used == true && rtw_camid_is_gk(padapter, cam_id) == true) { if (used && rtw_camid_is_gk(padapter, cam_id) == true) {
s16 camid_clr; s16 camid_clr;
RTW_PRINT(FUNC_ADPT_FMT" pairwise key with "MAC_FMT" id:%u the same key id as group key\n" RTW_PRINT(FUNC_ADPT_FMT" pairwise key with "MAC_FMT" id:%u the same key id as group key\n"
@ -14340,8 +14340,8 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf)
} }
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
else if ((psta->tdls_sta_state & TDLS_LINKED_STATE) && else if ((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
(psta->htpriv.ht_option == true) && (psta->htpriv.ht_option) &&
(psta->htpriv.ampdu_enable == true)) { (psta->htpriv.ampdu_enable)) {
issue_addba_req(padapter, pparm->addr, (u8)pparm->tid); issue_addba_req(padapter, pparm->addr, (u8)pparm->tid);
_set_timer(&psta->addba_retry_timer, ADDBA_TO); _set_timer(&psta->addba_retry_timer, ADDBA_TO);
} }
@ -14569,7 +14569,7 @@ u8 chk_bmc_sleepq_hdl(_adapter *padapter, unsigned char *pbuf)
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
if (xmitframe_hiq_filter(pxmitframe) == true) if (xmitframe_hiq_filter(pxmitframe))
pxmitframe->attrib.qsel = QSLT_HIGH;/* HIQ */ pxmitframe->attrib.qsel = QSLT_HIGH;/* HIQ */
rtw_hal_xmitframe_enqueue(padapter, pxmitframe); rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
@ -14825,7 +14825,7 @@ int rtw_chk_start_clnt_join(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset)
goto exit; goto exit;
#endif #endif
if (chbw_allow == true) { if (chbw_allow) {
rtw_sync_chbw(&cur_ch, &cur_bw, &cur_ch_offset, &u_ch, &u_bw, &u_offset); rtw_sync_chbw(&cur_ch, &cur_bw, &cur_ch_offset, &u_ch, &u_bw, &u_offset);
rtw_warn_on(cur_ch != pmlmeext->cur_channel); rtw_warn_on(cur_ch != pmlmeext->cur_channel);
rtw_warn_on(cur_bw != pmlmeext->cur_bwmode); rtw_warn_on(cur_bw != pmlmeext->cur_bwmode);
@ -14862,7 +14862,7 @@ int rtw_chk_start_clnt_join(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset)
goto exit; goto exit;
connect_allow_hdl: connect_allow_hdl:
/* connect_allow == true */ /* connect_allow */
#ifdef CONFIG_DFS_MASTER #ifdef CONFIG_DFS_MASTER
rtw_dfs_master_status_apply(adapter, MLME_STA_CONNECTING); rtw_dfs_master_status_apply(adapter, MLME_STA_CONNECTING);
@ -14907,14 +14907,14 @@ connect_allow_hdl:
exit: exit:
if (connect_allow == true) { if (connect_allow) {
RTW_INFO(FUNC_ADPT_FMT" union: %u,%u,%u\n", FUNC_ADPT_ARG(adapter), u_ch, u_bw, u_offset); RTW_INFO(FUNC_ADPT_FMT" union: %u,%u,%u\n", FUNC_ADPT_ARG(adapter), u_ch, u_bw, u_offset);
*ch = u_ch; *ch = u_ch;
*bw = u_bw; *bw = u_bw;
*offset = u_offset; *offset = u_offset;
} }
return connect_allow == true ? _SUCCESS : _FAIL; return connect_allow ? _SUCCESS : _FAIL;
} }
@ -15050,7 +15050,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf)
TDLSoption = (struct TDLSoption_param *)pbuf; TDLSoption = (struct TDLSoption_param *)pbuf;
option = TDLSoption->option; option = TDLSoption->option;
if (!_rtw_memcmp(TDLSoption->addr, zaddr, ETH_ALEN)) { if (memcmp(TDLSoption->addr, zaddr, ETH_ALEN)) {
ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), TDLSoption->addr); ptdls_sta = rtw_get_stainfo(&(padapter->stapriv), TDLSoption->addr);
if (ptdls_sta == NULL) if (ptdls_sta == NULL)
return H2C_REJECTED; return H2C_REJECTED;
@ -15221,7 +15221,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf)
break; break;
case TDLS_TEARDOWN_STA_LOCALLY: case TDLS_TEARDOWN_STA_LOCALLY:
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
if (_rtw_memcmp(TDLSoption->addr, pchsw_info->addr, ETH_ALEN) == true) { if (!memcmp(TDLSoption->addr, pchsw_info->addr, ETH_ALEN)) {
pchsw_info->ch_sw_state &= ~(TDLS_CH_SW_INITIATOR_STATE | pchsw_info->ch_sw_state &= ~(TDLS_CH_SW_INITIATOR_STATE |
TDLS_CH_SWITCH_ON_STATE | TDLS_CH_SWITCH_ON_STATE |
TDLS_PEER_AT_OFF_STATE); TDLS_PEER_AT_OFF_STATE);

View file

@ -592,7 +592,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -704,7 +704,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -777,7 +777,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
/* WFD device information */ /* WFD device information */
/* WFD primary sink + available for WFD session + WiFi Direct mode */ /* WFD primary sink + available for WFD session + WiFi Direct mode */
if (true == pwdinfo->session_available) { if (pwdinfo->session_available) {
if (P2P_ROLE_GO == pwdinfo->role) { if (P2P_ROLE_GO == pwdinfo->role) {
if (is_any_client_associated(pwdinfo->padapter)) { if (is_any_client_associated(pwdinfo->padapter)) {
if (pwdinfo->wfd_tdls_enable) { if (pwdinfo->wfd_tdls_enable) {
@ -839,7 +839,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -993,7 +993,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1092,7 +1092,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1191,7 +1191,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1290,7 +1290,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1390,7 +1390,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1490,7 +1490,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1603,7 +1603,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1716,7 +1716,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1816,7 +1816,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* Value: */ /* Value: */
/* Associated BSSID */ /* Associated BSSID */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
_rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
else else
memset(wfdie + wfdielen, 0x00, ETH_ALEN); memset(wfdie + wfdielen, 0x00, ETH_ALEN);
@ -1860,7 +1860,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 }; u8 zero_array_check[L2SDTA_SERVICE_VE_LEN] = { 0x00 };
u8 widi_version = 0, i = 0; u8 widi_version = 0, i = 0;
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false) if (!memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false)
widi_version = 35; widi_version = 35;
else if (pmlmepriv->num_p2p_sdt != 0) else if (pmlmepriv->num_p2p_sdt != 0)
widi_version = 40; widi_version = 40;
@ -2282,7 +2282,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) { if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
p2pie = rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen); p2pie = rtw_get_p2p_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen);
if (p2pie) { if (p2pie) {
if ((p != NULL) && _rtw_memcmp((void *)(p + 2), (void *) pwdinfo->p2p_wildcard_ssid , 7)) { if ((p != NULL) && !memcmp((void *)(p + 2), (void *) pwdinfo->p2p_wildcard_ssid , 7)) {
/* todo: */ /* todo: */
/* Check Requested Device Type attributes in WSC IE. */ /* Check Requested Device Type attributes in WSC IE. */
/* Check Device ID attribute in P2P IE */ /* Check Device ID attribute in P2P IE */
@ -2435,8 +2435,8 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
u32 attr_contentlen = 0; u32 attr_contentlen = 0;
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) {
if (_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) && if (!memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) &&
_rtw_memcmp(pwdinfo->p2p_group_ssid, groupid + ETH_ALEN, pwdinfo->p2p_group_ssid_len)) { !memcmp(pwdinfo->p2p_group_ssid, groupid + ETH_ALEN, pwdinfo->p2p_group_ssid_len)) {
attr_contentlen = 0; attr_contentlen = 0;
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) {
unsigned long irqL; unsigned long irqL;
@ -2453,7 +2453,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
plist = get_next(plist); plist = get_next(plist);
if (psta->is_p2p_device && (psta->dev_cap & P2P_DEVCAP_CLIENT_DISCOVERABILITY) && if (psta->is_p2p_device && (psta->dev_cap & P2P_DEVCAP_CLIENT_DISCOVERABILITY) &&
_rtw_memcmp(psta->dev_addr, dev_addr, ETH_ALEN)) { !memcmp(psta->dev_addr, dev_addr, ETH_ALEN)) {
/* _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); */ /* _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); */
/* issue GO Discoverability Request */ /* issue GO Discoverability Request */
@ -2613,7 +2613,7 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
/* Commented by Kurt 20120113 */ /* Commented by Kurt 20120113 */
/* If some device wants to do p2p handshake without sending prov_disc_req */ /* If some device wants to do p2p handshake without sending prov_disc_req */
/* We have to get peer_req_cm from here. */ /* We have to get peer_req_cm from here. */
if (_rtw_memcmp(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3)) { if (!memcmp(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3)) {
rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8 *) &be_tmp, &wps_devicepassword_id_len); rtw_get_wps_attr_content(wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8 *) &be_tmp, &wps_devicepassword_id_len);
wps_devicepassword_id = be16_to_cpu(be_tmp); wps_devicepassword_id = be16_to_cpu(be_tmp);
@ -3244,13 +3244,13 @@ void p2p_concurrent_handler(_adapter *padapter)
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
issue_probereq_p2p(padapter, NULL); issue_probereq_p2p(padapter, NULL);
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == true) { } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable) {
val8 = 1; val8 = 1;
set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20); set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20);
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8)); rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
issue_probereq_p2p(padapter, NULL); issue_probereq_p2p(padapter, NULL);
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ) && pwdinfo->invitereq_info.benable == true) { } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ) && pwdinfo->invitereq_info.benable) {
/* /*
val8 = 1; val8 = 1;
set_channel_bwmode(padapter, , HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20); set_channel_bwmode(padapter, , HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20);
@ -3616,7 +3616,7 @@ static u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
if (category == RTW_WLAN_CATEGORY_PUBLIC) { if (category == RTW_WLAN_CATEGORY_PUBLIC) {
action = frame_body[1]; action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR if (action == ACT_PUBLIC_VENDOR
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == true && !memcmp(frame_body + 2, P2P_OUI, 4)
) { ) {
OUI_Subtype = frame_body[6]; OUI_Subtype = frame_body[6];
dialogToken = frame_body[7]; dialogToken = frame_body[7];
@ -3697,7 +3697,7 @@ static bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
if (category == RTW_WLAN_CATEGORY_PUBLIC) { if (category == RTW_WLAN_CATEGORY_PUBLIC) {
action = frame_body[1]; action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR if (action == ACT_PUBLIC_VENDOR
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == true && !memcmp(frame_body + 2, P2P_OUI, 4)
) { ) {
OUI_Subtype = frame_body[6]; OUI_Subtype = frame_body[6];
@ -3744,7 +3744,7 @@ void rtw_xframe_chk_wfd_ie(struct xmit_frame *xframe)
del = 1; del = 1;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (true == wdinfo->wfd_info->wfd_enable) if (wdinfo->wfd_info->wfd_enable)
#endif #endif
del = build = 1; del = build = 1;
@ -3842,7 +3842,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (category == RTW_WLAN_CATEGORY_PUBLIC) { if (category == RTW_WLAN_CATEGORY_PUBLIC) {
action = frame_body[1]; action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR if (action == ACT_PUBLIC_VENDOR
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == true && !memcmp(frame_body + 2, P2P_OUI, 4)
) { ) {
OUI_Subtype = frame_body[6]; OUI_Subtype = frame_body[6];
dialogToken = frame_body[7]; dialogToken = frame_body[7];
@ -3906,7 +3906,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
RTW_INFO("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s" RTW_INFO("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s"
, (tx == true) ? "Tx" : "Rx" , dialogToken , (intent >> 1) , intent & 0x1 ? "+" : "-" , listen_ch , op_ch , ch_list_buf); , (tx) ? "Tx" : "Rx" , dialogToken , (intent >> 1) , intent & 0x1 ? "+" : "-" , listen_ch , op_ch , ch_list_buf);
if (iaddr) if (iaddr)
_RTW_INFO(", iaddr:"MAC_FMT, MAC_ARG(iaddr)); _RTW_INFO(", iaddr:"MAC_FMT, MAC_ARG(iaddr));
_RTW_INFO("\n"); _RTW_INFO("\n");
@ -3948,7 +3948,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
iaddr = cont; iaddr = cont;
if (nego_info->token == dialogToken && nego_info->state == 0 if (nego_info->token == dialogToken && nego_info->state == 0
&& _rtw_memcmp(nego_info->peer_mac, tx ? GetAddr1Ptr(buf) : get_addr2_ptr(buf), ETH_ALEN) == true && !memcmp(nego_info->peer_mac, tx ? GetAddr1Ptr(buf) : get_addr2_ptr(buf), ETH_ALEN)
) { ) {
if (iaddr) if (iaddr)
_rtw_memcpy(tx ? nego_info->iface_addr : nego_info->peer_iface_addr, iaddr, ETH_ALEN); _rtw_memcpy(tx ? nego_info->iface_addr : nego_info->peer_iface_addr, iaddr, ETH_ALEN);
@ -3962,7 +3962,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
RTW_INFO("RTW_%s:P2P_GO_NEGO_RESP, dialogToken=%d, intent:%u%s, status:%d, op_ch:%d, ch_list:%s" RTW_INFO("RTW_%s:P2P_GO_NEGO_RESP, dialogToken=%d, intent:%u%s, status:%d, op_ch:%d, ch_list:%s"
, (tx == true) ? "Tx" : "Rx", dialogToken, (intent >> 1), intent & 0x1 ? "+" : "-", status, op_ch, ch_list_buf); , (tx) ? "Tx" : "Rx", dialogToken, (intent >> 1), intent & 0x1 ? "+" : "-", status, op_ch, ch_list_buf);
if (iaddr) if (iaddr)
_RTW_INFO(", iaddr:"MAC_FMT, MAC_ARG(iaddr)); _RTW_INFO(", iaddr:"MAC_FMT, MAC_ARG(iaddr));
_RTW_INFO("\n"); _RTW_INFO("\n");
@ -4000,7 +4000,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
status = *cont; status = *cont;
if (nego_info->token == dialogToken && nego_info->state == 1 if (nego_info->token == dialogToken && nego_info->state == 1
&& _rtw_memcmp(nego_info->peer_mac, tx ? GetAddr1Ptr(buf) : get_addr2_ptr(buf), ETH_ALEN) == true && !memcmp(nego_info->peer_mac, tx ? GetAddr1Ptr(buf) : get_addr2_ptr(buf), ETH_ALEN)
) { ) {
nego_info->status = (status == -1) ? 0xff : status; nego_info->status = (status == -1) ? 0xff : status;
nego_info->conf_op_ch = (op_ch == -1) ? 0 : op_ch; nego_info->conf_op_ch = (op_ch == -1) ? 0 : op_ch;
@ -4016,7 +4016,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
RTW_INFO("RTW_%s:P2P_GO_NEGO_CONF, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s\n" RTW_INFO("RTW_%s:P2P_GO_NEGO_CONF, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s\n"
, (tx == true) ? "Tx" : "Rx", dialogToken, status, op_ch, ch_list_buf); , (tx) ? "Tx" : "Rx", dialogToken, status, op_ch, ch_list_buf);
if (!tx) { if (!tx) {
} }
@ -4059,7 +4059,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
RTW_INFO("RTW_%s:P2P_INVIT_REQ, dialogToken=%d, flags:0x%02x, op_ch:%d, ch_list:%s" RTW_INFO("RTW_%s:P2P_INVIT_REQ, dialogToken=%d, flags:0x%02x, op_ch:%d, ch_list:%s"
, (tx == true) ? "Tx" : "Rx", dialogToken, flags, op_ch, ch_list_buf); , (tx) ? "Tx" : "Rx", dialogToken, flags, op_ch, ch_list_buf);
if (gbssid) if (gbssid)
_RTW_INFO(", gbssid:"MAC_FMT, MAC_ARG(gbssid)); _RTW_INFO(", gbssid:"MAC_FMT, MAC_ARG(gbssid));
_RTW_INFO("\n"); _RTW_INFO("\n");
@ -4108,7 +4108,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
gbssid = cont; gbssid = cont;
if (invit_info->token == dialogToken && invit_info->state == 0 if (invit_info->token == dialogToken && invit_info->state == 0
&& _rtw_memcmp(invit_info->peer_mac, tx ? GetAddr1Ptr(buf) : get_addr2_ptr(buf), ETH_ALEN) == true && !memcmp(invit_info->peer_mac, tx ? GetAddr1Ptr(buf) : get_addr2_ptr(buf), ETH_ALEN)
) { ) {
invit_info->status = (status == -1) ? 0xff : status; invit_info->status = (status == -1) ? 0xff : status;
invit_info->rsp_op_ch = op_ch; invit_info->rsp_op_ch = op_ch;
@ -4118,7 +4118,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128); dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
RTW_INFO("RTW_%s:P2P_INVIT_RESP, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s" RTW_INFO("RTW_%s:P2P_INVIT_RESP, dialogToken=%d, status:%d, op_ch:%d, ch_list:%s"
, (tx == true) ? "Tx" : "Rx", dialogToken, status, op_ch, ch_list_buf); , (tx) ? "Tx" : "Rx", dialogToken, status, op_ch, ch_list_buf);
if (gbssid) if (gbssid)
_RTW_INFO(", gbssid:"MAC_FMT, MAC_ARG(gbssid)); _RTW_INFO(", gbssid:"MAC_FMT, MAC_ARG(gbssid));
_RTW_INFO("\n"); _RTW_INFO("\n");
@ -4129,11 +4129,11 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
break; break;
} }
case P2P_DEVDISC_REQ: case P2P_DEVDISC_REQ:
RTW_INFO("RTW_%s:P2P_DEVDISC_REQ, dialogToken=%d\n", (tx == true) ? "Tx" : "Rx", dialogToken); RTW_INFO("RTW_%s:P2P_DEVDISC_REQ, dialogToken=%d\n", (tx) ? "Tx" : "Rx", dialogToken);
break; break;
case P2P_DEVDISC_RESP: case P2P_DEVDISC_RESP:
cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len); cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len);
RTW_INFO("RTW_%s:P2P_DEVDISC_RESP, dialogToken=%d, status:%d\n", (tx == true) ? "Tx" : "Rx", dialogToken, cont ? *cont : -1); RTW_INFO("RTW_%s:P2P_DEVDISC_RESP, dialogToken=%d, status:%d\n", (tx) ? "Tx" : "Rx", dialogToken, cont ? *cont : -1);
break; break;
case P2P_PROVISION_DISC_REQ: { case P2P_PROVISION_DISC_REQ: {
size_t frame_body_len = len - sizeof(struct rtw_ieee80211_hdr_3addr); size_t frame_body_len = len - sizeof(struct rtw_ieee80211_hdr_3addr);
@ -4141,7 +4141,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
uint p2p_ielen = 0; uint p2p_ielen = 0;
uint contentlen = 0; uint contentlen = 0;
RTW_INFO("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx == true) ? "Tx" : "Rx", dialogToken); RTW_INFO("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx) ? "Tx" : "Rx", dialogToken);
/* if(tx) */ /* if(tx) */
{ {
@ -4164,10 +4164,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
} }
break; break;
case P2P_PROVISION_DISC_RESP: case P2P_PROVISION_DISC_RESP:
RTW_INFO("RTW_%s:P2P_PROVISION_DISC_RESP, dialogToken=%d\n", (tx == true) ? "Tx" : "Rx", dialogToken); RTW_INFO("RTW_%s:P2P_PROVISION_DISC_RESP, dialogToken=%d\n", (tx) ? "Tx" : "Rx", dialogToken);
break; break;
default: default:
RTW_INFO("RTW_%s:OUI_Subtype=%d, dialogToken=%d\n", (tx == true) ? "Tx" : "Rx", OUI_Subtype, dialogToken); RTW_INFO("RTW_%s:OUI_Subtype=%d, dialogToken=%d\n", (tx) ? "Tx" : "Rx", OUI_Subtype, dialogToken);
break; break;
} }
@ -4186,24 +4186,24 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
switch (OUI_Subtype) { switch (OUI_Subtype) {
case P2P_NOTICE_OF_ABSENCE: case P2P_NOTICE_OF_ABSENCE:
RTW_INFO("RTW_%s:P2P_NOTICE_OF_ABSENCE, dialogToken=%d\n", (tx == true) ? "TX" : "RX", dialogToken); RTW_INFO("RTW_%s:P2P_NOTICE_OF_ABSENCE, dialogToken=%d\n", (tx) ? "TX" : "RX", dialogToken);
break; break;
case P2P_PRESENCE_REQUEST: case P2P_PRESENCE_REQUEST:
RTW_INFO("RTW_%s:P2P_PRESENCE_REQUEST, dialogToken=%d\n", (tx == true) ? "TX" : "RX", dialogToken); RTW_INFO("RTW_%s:P2P_PRESENCE_REQUEST, dialogToken=%d\n", (tx) ? "TX" : "RX", dialogToken);
break; break;
case P2P_PRESENCE_RESPONSE: case P2P_PRESENCE_RESPONSE:
RTW_INFO("RTW_%s:P2P_PRESENCE_RESPONSE, dialogToken=%d\n", (tx == true) ? "TX" : "RX", dialogToken); RTW_INFO("RTW_%s:P2P_PRESENCE_RESPONSE, dialogToken=%d\n", (tx) ? "TX" : "RX", dialogToken);
break; break;
case P2P_GO_DISC_REQUEST: case P2P_GO_DISC_REQUEST:
RTW_INFO("RTW_%s:P2P_GO_DISC_REQUEST, dialogToken=%d\n", (tx == true) ? "TX" : "RX", dialogToken); RTW_INFO("RTW_%s:P2P_GO_DISC_REQUEST, dialogToken=%d\n", (tx) ? "TX" : "RX", dialogToken);
break; break;
default: default:
RTW_INFO("RTW_%s:OUI_Subtype=%d, dialogToken=%d\n", (tx == true) ? "TX" : "RX", OUI_Subtype, dialogToken); RTW_INFO("RTW_%s:OUI_Subtype=%d, dialogToken=%d\n", (tx) ? "TX" : "RX", OUI_Subtype, dialogToken);
break; break;
} }
} else } else
RTW_INFO("RTW_%s:action frame category=%d\n", (tx == true) ? "TX" : "RX", category); RTW_INFO("RTW_%s:action frame category=%d\n", (tx) ? "TX" : "RX", category);
return is_p2p_frame; return is_p2p_frame;
} }
@ -4397,7 +4397,7 @@ void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
if (pwdinfo->opp_ps == 1) { if (pwdinfo->opp_ps == 1) {
pwdinfo->p2p_ps_mode = P2P_PS_CTWINDOW; pwdinfo->p2p_ps_mode = P2P_PS_CTWINDOW;
/* driver should wait LPS for entering CTWindow */ /* driver should wait LPS for entering CTWindow */
if (adapter_to_pwrctl(padapter)->bFwCurrentInPSMode == true) if (adapter_to_pwrctl(padapter)->bFwCurrentInPSMode)
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1); p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1);
} else if (pwdinfo->noa_num > 0) { } else if (pwdinfo->noa_num > 0) {
pwdinfo->p2p_ps_mode = P2P_PS_NOA; pwdinfo->p2p_ps_mode = P2P_PS_NOA;
@ -4414,7 +4414,7 @@ void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
} }
if (find_p2p == true) { if (find_p2p) {
if ((pwdinfo->p2p_ps_mode > P2P_PS_NONE) && (find_p2p_ps == false)) if ((pwdinfo->p2p_ps_mode > P2P_PS_NONE) && (find_p2p_ps == false))
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1); p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
} }
@ -4439,7 +4439,7 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state)
pwdinfo->opp_ps = 0; pwdinfo->opp_ps = 0;
pwdinfo->noa_num = 0; pwdinfo->noa_num = 0;
pwdinfo->p2p_ps_mode = P2P_PS_NONE; pwdinfo->p2p_ps_mode = P2P_PS_NONE;
if (pwrpriv->bFwCurrentInPSMode == true) { if (pwrpriv->bFwCurrentInPSMode) {
if (pwrpriv->smart_ps == 0) { if (pwrpriv->smart_ps == 0) {
pwrpriv->smart_ps = 2; pwrpriv->smart_ps = 2;
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&(pwrpriv->pwr_mode))); rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&(pwrpriv->pwr_mode)));
@ -4631,16 +4631,16 @@ static void pre_tx_scan_timer_process(struct timer_list *t)
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) {
if (true == pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */ if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */
p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK); p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK);
/* issue_probereq_p2p(adapter, NULL); */ /* issue_probereq_p2p(adapter, NULL); */
/* _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); */ /* _set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT ); */
} }
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
if (true == pwdinfo->nego_req_info.benable) if (pwdinfo->nego_req_info.benable)
p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_NEGOREQ_PROCESS_WK); p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_NEGOREQ_PROCESS_WK);
} else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ)) { } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ)) {
if (true == pwdinfo->invitereq_info.benable) if (pwdinfo->invitereq_info.benable)
p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_INVITEREQ_PROCESS_WK); p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_INVITEREQ_PROCESS_WK);
} else } else
RTW_INFO("[%s] p2p_state is %d, ignore!!\n", __func__, rtw_p2p_state(pwdinfo)); RTW_INFO("[%s] p2p_state is %d, ignore!!\n", __func__, rtw_p2p_state(pwdinfo));
@ -4757,7 +4757,7 @@ inline void rtw_wfd_set_ctrl_port(_adapter *adapter, u16 port)
struct wifi_display_info *wfdinfo = &adapter->wfd_info; struct wifi_display_info *wfdinfo = &adapter->wfd_info;
wfdinfo->init_rtsp_ctrlport = port; wfdinfo->init_rtsp_ctrlport = port;
if (wfdinfo->wfd_enable == true) if (wfdinfo->wfd_enable)
wfdinfo->rtsp_ctrlport = port; wfdinfo->rtsp_ctrlport = port;
if (adapter->wdinfo.wfd_tdls_enable == 1) if (adapter->wdinfo.wfd_tdls_enable == 1)
wfdinfo->tdls_rtsp_ctrlport = port; wfdinfo->tdls_rtsp_ctrlport = port;
@ -4788,7 +4788,7 @@ u32 rtw_append_beacon_wfd_ie(_adapter *adapter, u8 *pbuf)
goto exit; goto exit;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (true == wdinfo->wfd_info->wfd_enable) if (wdinfo->wfd_info->wfd_enable)
#endif #endif
build_ie_by_self = 1; build_ie_by_self = 1;
@ -4816,7 +4816,7 @@ u32 rtw_append_probe_req_wfd_ie(_adapter *adapter, u8 *pbuf)
goto exit; goto exit;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (true == wdinfo->wfd_info->wfd_enable) if (wdinfo->wfd_info->wfd_enable)
#endif #endif
build_ie_by_self = 1; build_ie_by_self = 1;
@ -4844,7 +4844,7 @@ u32 rtw_append_probe_resp_wfd_ie(_adapter *adapter, u8 *pbuf)
goto exit; goto exit;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (true == wdinfo->wfd_info->wfd_enable) if (wdinfo->wfd_info->wfd_enable)
#endif #endif
build_ie_by_self = 1; build_ie_by_self = 1;
@ -4872,7 +4872,7 @@ u32 rtw_append_assoc_req_wfd_ie(_adapter *adapter, u8 *pbuf)
goto exit; goto exit;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (true == wdinfo->wfd_info->wfd_enable) if (wdinfo->wfd_info->wfd_enable)
#endif #endif
build_ie_by_self = 1; build_ie_by_self = 1;
@ -4900,7 +4900,7 @@ u32 rtw_append_assoc_resp_wfd_ie(_adapter *adapter, u8 *pbuf)
goto exit; goto exit;
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
if (true == wdinfo->wfd_info->wfd_enable) if (wdinfo->wfd_info->wfd_enable)
#endif #endif
build_ie_by_self = 1; build_ie_by_self = 1;
@ -5295,7 +5295,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
} else if (role == P2P_ROLE_DISABLE) { } else if (role == P2P_ROLE_DISABLE) {
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.p2p_reject_disable == true) if (padapter->mlmepriv.p2p_reject_disable)
return ret; return ret;
#endif /* CONFIG_INTEL_WIDI */ #endif /* CONFIG_INTEL_WIDI */

View file

@ -357,7 +357,7 @@ void rtw_ps_processor(_adapter *padapter)
pwrpriv->ps_flag = true; pwrpriv->ps_flag = true;
#if defined(CONFIG_BT_COEXIST) && defined (CONFIG_AUTOSUSPEND) #if defined(CONFIG_BT_COEXIST) && defined (CONFIG_AUTOSUSPEND)
if (true == pwrpriv->bInternalAutoSuspend) if (pwrpriv->bInternalAutoSuspend)
RTW_INFO("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n", __func__, pwrpriv->bInternalAutoSuspend); RTW_INFO("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n", __func__, pwrpriv->bInternalAutoSuspend);
else { else {
pwrpriv->change_rfpwrstate = rf_off; pwrpriv->change_rfpwrstate = rf_off;
@ -600,14 +600,14 @@ static u8 PS_RDY_CHECK(_adapter *padapter)
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN) #if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
if (true == pwrpriv->bInSuspend && pwrpriv->wowlan_mode) if (pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
return true; return true;
else if (true == pwrpriv->bInSuspend && pwrpriv->wowlan_ap_mode) else if (pwrpriv->bInSuspend && pwrpriv->wowlan_ap_mode)
return true; return true;
else if (true == pwrpriv->bInSuspend) else if (pwrpriv->bInSuspend)
return false; return false;
#else #else
if (true == pwrpriv->bInSuspend) if (pwrpriv->bInSuspend)
return false; return false;
#endif #endif
@ -905,7 +905,7 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
&& (rtw_btcoex_IsLpsOn(padapter) == true)) && (rtw_btcoex_IsLpsOn(padapter) == true))
#endif #endif
#ifdef CONFIG_P2P_WOWLAN #ifdef CONFIG_P2P_WOWLAN
|| (true == pwrpriv->wowlan_p2p_mode) || (pwrpriv->wowlan_p2p_mode)
#endif /* CONFIG_P2P_WOWLAN */ #endif /* CONFIG_P2P_WOWLAN */
) { ) {
u8 pslv; u8 pslv;
@ -997,7 +997,7 @@ s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms)
start_time = rtw_get_current_time(); start_time = rtw_get_current_time();
while (1) { while (1) {
rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake); rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake);
if (true == bAwake) if (bAwake)
break; break;
if (rtw_is_surprise_removed(padapter)) { if (rtw_is_surprise_removed(padapter)) {
@ -1330,7 +1330,7 @@ void LPS_Leave_check(
_exit_pwrlock(&pwrpriv->lock); _exit_pwrlock(&pwrpriv->lock);
if (true == bReady) if (bReady)
break; break;
if (rtw_get_passing_time_ms(start_time) > 100) { if (rtw_get_passing_time_ms(start_time) > 100) {
@ -2307,7 +2307,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
} }
/* System suspend is not allowed to wakeup */ /* System suspend is not allowed to wakeup */
if ((pwrpriv->bInternalAutoSuspend == false) && (true == pwrpriv->bInSuspend)) { if ((pwrpriv->bInternalAutoSuspend == false) && (pwrpriv->bInSuspend)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
@ -2321,7 +2321,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
/* I think this should be check in IPS, LPS, autosuspend functions... */ /* I think this should be check in IPS, LPS, autosuspend functions... */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
#if defined(CONFIG_BT_COEXIST) && defined (CONFIG_AUTOSUSPEND) #if defined(CONFIG_BT_COEXIST) && defined (CONFIG_AUTOSUSPEND)
if (true == pwrpriv->bInternalAutoSuspend) { if (pwrpriv->bInternalAutoSuspend) {
if (0 == pwrpriv->autopm_cnt) { if (0 == pwrpriv->autopm_cnt) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33))
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0) if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)

View file

@ -214,7 +214,7 @@ union recv_frame *_rtw_alloc_recvframe(_queue *pfree_recv_queue)
_adapter *padapter; _adapter *padapter;
struct recv_priv *precvpriv; struct recv_priv *precvpriv;
if (_rtw_queue_empty(pfree_recv_queue) == true) if (_rtw_queue_empty(pfree_recv_queue))
precvframe = NULL; precvframe = NULL;
else { else {
phead = get_list_head(pfree_recv_queue); phead = get_list_head(pfree_recv_queue);
@ -429,7 +429,7 @@ struct recv_buf *rtw_dequeue_recvbuf(_queue *queue)
_enter_critical_ex(&queue->lock, &irqL); _enter_critical_ex(&queue->lock, &irqL);
if (_rtw_queue_empty(queue) == true) if (_rtw_queue_empty(queue))
precvbuf = NULL; precvbuf = NULL;
else { else {
phead = get_list_head(queue); phead = get_list_head(queue);
@ -508,16 +508,16 @@ sint recvframe_chkmic(_adapter *adapter, union recv_frame *precvframe)
} }
if (bmic_err == true) { if (bmic_err) {
/* double check key_index for some timing issue , */ /* double check key_index for some timing issue , */
/* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */ /* cannot compare with psecuritypriv->dot118021XGrpKeyid also cause timing issue */
if ((IS_MCAST(prxattrib->ra) == true) && (prxattrib->key_index != pmlmeinfo->key_index)) if ((IS_MCAST(prxattrib->ra)) && (prxattrib->key_index != pmlmeinfo->key_index))
brpt_micerror = false; brpt_micerror = false;
if ((prxattrib->bdecrypted == true) && (brpt_micerror == true)) { if ((prxattrib->bdecrypted) && (brpt_micerror == true)) {
rtw_handle_tkip_mic_err(adapter, stainfo, (u8)IS_MCAST(prxattrib->ra)); rtw_handle_tkip_mic_err(adapter, stainfo, (u8)IS_MCAST(prxattrib->ra));
RTW_INFO(" mic error :prxattrib->bdecrypted=%d\n", prxattrib->bdecrypted); RTW_INFO(" mic error :prxattrib->bdecrypted=%d\n", prxattrib->bdecrypted);
} else { } else {
@ -528,7 +528,7 @@ sint recvframe_chkmic(_adapter *adapter, union recv_frame *precvframe)
} else { } else {
/* mic checked ok */ /* mic checked ok */
if ((psecuritypriv->bcheck_grpkey == false) && (IS_MCAST(prxattrib->ra) == true)) { if ((psecuritypriv->bcheck_grpkey == false) && (IS_MCAST(prxattrib->ra))) {
psecuritypriv->bcheck_grpkey = true; psecuritypriv->bcheck_grpkey = true;
} }
} }
@ -583,7 +583,7 @@ union recv_frame *decryptor(_adapter *padapter, union recv_frame *precv_frame)
} }
} }
if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt == true))) { if ((prxattrib->encrypt > 0) && ((prxattrib->bdecrypted == 0) || (psecuritypriv->sw_decrypt))) {
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
if (!IS_MCAST(prxattrib->ra)) /* bc/mc packets use sw decryption for concurrent mode */ if (!IS_MCAST(prxattrib->ra)) /* bc/mc packets use sw decryption for concurrent mode */
@ -815,7 +815,7 @@ static sint recv_bcast_pn_decache(union recv_frame *precv_frame)
u8 key_id; u8 key_id;
if ((pattrib->encrypt == _AES_) && if ((pattrib->encrypt == _AES_) &&
(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)) { (check_fwstate(pmlmepriv, WIFI_STATION_STATE))) {
tmp_iv_hdr = le64_to_cpu(*(__le64*)(pdata + pattrib->hdrlen)); tmp_iv_hdr = le64_to_cpu(*(__le64*)(pdata + pattrib->hdrlen));
key_id = CCMPH_2_KEYID(tmp_iv_hdr); key_id = CCMPH_2_KEYID(tmp_iv_hdr);
@ -1008,7 +1008,7 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame)
#ifdef CONFIG_WFD #ifdef CONFIG_WFD
/* First byte of WFA OUI */ /* First byte of WFA OUI */
case 0x50: case 0x50:
if (_rtw_memcmp(WFA_OUI, paction, 3)) { if (!memcmp(WFA_OUI, paction, 3)) {
/* Probe request frame */ /* Probe request frame */
if (*(paction + 3) == 0x04) { if (*(paction + 3) == 0x04) {
/* WFDTDLS: for sigma test, do not setup direct link automatically */ /* WFDTDLS: for sigma test, do not setup direct link automatically */
@ -1125,59 +1125,59 @@ sint sta2sta_data_frame(
/* RTW_INFO("[%s] %d, seqnum:%d\n", __func__, __LINE__, pattrib->seq_num); */ /* RTW_INFO("[%s] %d, seqnum:%d\n", __func__, __LINE__, pattrib->seq_num); */
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
/* filter packets that SA is myself or multicast or broadcast */ /* filter packets that SA is myself or multicast or broadcast */
if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) { if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
if (_rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
_rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
(!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
sta_addr = pattrib->src; sta_addr = pattrib->src;
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
/* direct link data transfer */ /* direct link data transfer */
if (ptdlsinfo->link_established == true) { if (ptdlsinfo->link_established) {
ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src); ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src);
if (ptdls_sta == NULL) { if (ptdls_sta == NULL) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} else if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) { } else if (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) {
/* filter packets that SA is myself or multicast or broadcast */ /* filter packets that SA is myself or multicast or broadcast */
if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
/* da should be for me */ /* da should be for me */
if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) { if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
/* check BSSID */ /* check BSSID */
if (_rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
_rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
(!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
#ifdef CONFIG_TDLS_CH_SW #ifdef CONFIG_TDLS_CH_SW
if (ATOMIC_READ(&pchsw_info->chsw_on) == true) { if (ATOMIC_READ(&pchsw_info->chsw_on)) {
if (adapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(adapter)) { if (adapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(adapter)) {
pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE; pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE;
if (!(pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE)) if (!(pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE))
@ -1208,7 +1208,7 @@ sint sta2sta_data_frame(
} }
/* receive some of all TDLS management frames, process it at ON_TDLS */ /* receive some of all TDLS management frames, process it at ON_TDLS */
if (_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2)) { if (!memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2)) {
ret = OnTDLS(adapter, precv_frame); ret = OnTDLS(adapter, precv_frame);
goto exit; goto exit;
} }
@ -1226,7 +1226,7 @@ sint sta2sta_data_frame(
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
{ {
/* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */ /* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */
if (!_rtw_memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) { if (memcmp(pattrib->bssid, pattrib->src, ETH_ALEN)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
@ -1234,7 +1234,7 @@ sint sta2sta_data_frame(
sta_addr = pattrib->bssid; sta_addr = pattrib->bssid;
} }
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) { if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */
if (!IS_MCAST(pattrib->bssid)) { if (!IS_MCAST(pattrib->bssid)) {
@ -1243,7 +1243,7 @@ sint sta2sta_data_frame(
} }
} else { /* not mc-frame */ } else { /* not mc-frame */
/* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */ /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */
if (!_rtw_memcmp(pattrib->bssid, pattrib->dst, ETH_ALEN)) { if (memcmp(pattrib->bssid, pattrib->dst, ETH_ALEN)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
@ -1251,7 +1251,7 @@ sint sta2sta_data_frame(
sta_addr = pattrib->src; sta_addr = pattrib->src;
} }
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
_rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->src, get_addr2_ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->src, get_addr2_ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
@ -1277,7 +1277,7 @@ sint sta2sta_data_frame(
if (*psta == NULL) { if (*psta == NULL) {
#ifdef CONFIG_MP_INCLUDED #ifdef CONFIG_MP_INCLUDED
if (adapter->registrypriv.mp_mode == 1) { if (adapter->registrypriv.mp_mode == 1) {
if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
adapter->mppriv.rx_pktloss++; adapter->mppriv.rx_pktloss++;
} }
#endif #endif
@ -1309,13 +1309,13 @@ sint ap2sta_data_frame(
sint bmcast = IS_MCAST(pattrib->dst); sint bmcast = IS_MCAST(pattrib->dst);
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE))
&& (check_fwstate(pmlmepriv, _FW_LINKED) == true && (check_fwstate(pmlmepriv, _FW_LINKED)
|| check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) || check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
) { ) {
/* filter packets that SA is myself or multicast or broadcast */ /* filter packets that SA is myself or multicast or broadcast */
if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
#ifdef DBG_RX_DROP_FRAME #ifdef DBG_RX_DROP_FRAME
RTW_INFO("DBG_RX_DROP_FRAME %s SA="MAC_FMT", myhwaddr="MAC_FMT"\n", RTW_INFO("DBG_RX_DROP_FRAME %s SA="MAC_FMT", myhwaddr="MAC_FMT"\n",
__func__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr)); __func__, MAC_ARG(pattrib->src), MAC_ARG(myhwaddr));
@ -1325,7 +1325,7 @@ sint ap2sta_data_frame(
} }
/* da should be for me */ /* da should be for me */
if ((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) { if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast)) {
#ifdef DBG_RX_DROP_FRAME #ifdef DBG_RX_DROP_FRAME
RTW_INFO("DBG_RX_DROP_FRAME %s DA="MAC_FMT"\n", __func__, MAC_ARG(pattrib->dst)); RTW_INFO("DBG_RX_DROP_FRAME %s DA="MAC_FMT"\n", __func__, MAC_ARG(pattrib->dst));
#endif #endif
@ -1335,9 +1335,9 @@ sint ap2sta_data_frame(
/* check BSSID */ /* check BSSID */
if (_rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
_rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
(!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) {
#ifdef DBG_RX_DROP_FRAME #ifdef DBG_RX_DROP_FRAME
RTW_INFO("DBG_RX_DROP_FRAME %s BSSID="MAC_FMT", mybssid="MAC_FMT"\n", RTW_INFO("DBG_RX_DROP_FRAME %s BSSID="MAC_FMT", mybssid="MAC_FMT"\n",
__func__, MAC_ARG(pattrib->bssid), MAC_ARG(mybssid)); __func__, MAC_ARG(pattrib->bssid), MAC_ARG(mybssid));
@ -1376,8 +1376,8 @@ sint ap2sta_data_frame(
goto exit; goto exit;
} }
} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { (check_fwstate(pmlmepriv, _FW_LINKED))) {
_rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->src, get_addr2_ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->src, get_addr2_ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
@ -1395,12 +1395,12 @@ sint ap2sta_data_frame(
} }
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* Special case */ /* Special case */
ret = RTW_RX_HANDLED; ret = RTW_RX_HANDLED;
goto exit; goto exit;
} else { } else {
if (_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN) && (!bmcast)) { if (!memcmp(myhwaddr, pattrib->dst, ETH_ALEN) && (!bmcast)) {
*psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */ *psta = rtw_get_stainfo(pstapriv, pattrib->bssid); /* get sta_info */
if (*psta == NULL) { if (*psta == NULL) {
@ -1449,9 +1449,9 @@ sint sta2ap_data_frame(
sint ret = _SUCCESS; sint ret = _SUCCESS;
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR */ /* For AP mode, RA=BSSID, TX=STA(SRC_ADDR), A3=DST_ADDR */
if (!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) { if (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) {
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
@ -1488,8 +1488,8 @@ bypass_deauth7:
ret = RTW_RX_HANDLED; ret = RTW_RX_HANDLED;
goto exit; goto exit;
} }
} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && } else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { (check_fwstate(pmlmepriv, _FW_LINKED))) {
/* RTW_INFO("%s ,in WIFI_MP_STATE\n",__func__); */ /* RTW_INFO("%s ,in WIFI_MP_STATE\n",__func__); */
_rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
_rtw_memcpy(pattrib->src, get_addr2_ptr(ptr), ETH_ALEN); _rtw_memcpy(pattrib->src, get_addr2_ptr(ptr), ETH_ALEN);
@ -1509,7 +1509,7 @@ bypass_deauth7:
} else { } else {
u8 *myhwaddr = adapter_mac_addr(adapter); u8 *myhwaddr = adapter_mac_addr(adapter);
if (!_rtw_memcmp(pattrib->ra, myhwaddr, ETH_ALEN)) { if (memcmp(pattrib->ra, myhwaddr, ETH_ALEN)) {
ret = RTW_RX_HANDLED; ret = RTW_RX_HANDLED;
goto exit; goto exit;
} }
@ -1541,7 +1541,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
return _FAIL; return _FAIL;
/* receive the frames that ra(a1) is my address */ /* receive the frames that ra(a1) is my address */
if (!_rtw_memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN)) if (memcmp(GetAddr1Ptr(pframe), adapter_mac_addr(padapter), ETH_ALEN))
return _FAIL; return _FAIL;
psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe)); psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe));
@ -1689,7 +1689,7 @@ static sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_
else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBEREQ) else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBEREQ)
psta->sta_stats.rx_probereq_pkts++; psta->sta_stats.rx_probereq_pkts++;
else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) { else if (get_frame_sub_type(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) {
if (_rtw_memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN) == true) if (!memcmp(adapter_mac_addr(padapter), GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN))
psta->sta_stats.rx_probersp_pkts++; psta->sta_stats.rx_probersp_pkts++;
else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)) else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data))
|| is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data))) || is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
@ -1701,7 +1701,7 @@ static sint validate_recv_mgnt_frame(PADAPTER padapter, union recv_frame *precv_
} }
#ifdef CONFIG_INTEL_PROXIM #ifdef CONFIG_INTEL_PROXIM
if (padapter->proximity.proxim_on == true) { if (padapter->proximity.proxim_on) {
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib; struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
struct recv_stat *prxstat = (struct recv_stat *) precv_frame->u.hdr.rx_head ; struct recv_stat *prxstat = (struct recv_stat *) precv_frame->u.hdr.rx_head ;
u8 *pda, *psa, *pbssid, *ptr; u8 *pda, *psa, *pbssid, *ptr;
@ -1926,7 +1926,7 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram
type = GetFrameType(ptr); type = GetFrameType(ptr);
subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */ subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */
if (adapter->securitypriv.binstallBIPkey == true) { if (adapter->securitypriv.binstallBIPkey) {
/* unicast management frame decrypt */ /* unicast management frame decrypt */
if (pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) && if (pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) { (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) {
@ -1978,7 +1978,7 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram
else { else {
psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(ptr)); psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(ptr));
if (subtype == WIFI_ACTION && psta && psta->bpairwise_key_installed == true) { if (subtype == WIFI_ACTION && psta && psta->bpairwise_key_installed) {
/* according 802.11-2012 standard, these five types are not robust types */ /* according 802.11-2012 standard, these five types are not robust types */
if (ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_PUBLIC && if (ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_PUBLIC &&
ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_HT && ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_HT &&
@ -2233,11 +2233,11 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE; psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE;
/* convert hdr + possible LLC headers into Ethernet header */ /* convert hdr + possible LLC headers into Ethernet header */
/* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */ /* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */
if ((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) && if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) && (!memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) &&
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2) == false)) || (!memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2) == false)) ||
/* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */ /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */
_rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)) { !memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
bsnaphdr = true; bsnaphdr = true;
} else { } else {
@ -2285,7 +2285,7 @@ sint wlanhdr_to_ethhdr(union recv_frame *precvframe)
} }
#endif /* CONFIG_AUTO_AP_MODE */ #endif /* CONFIG_AUTO_AP_MODE */
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) { if ((check_fwstate(pmlmepriv, WIFI_MP_STATE))) {
ptr += rmv_len ; ptr += rmv_len ;
*ptr = 0x87; *ptr = 0x87;
*(ptr + 1) = 0x12; *(ptr + 1) = 0x12;
@ -2731,7 +2731,7 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
plist = get_next(phead); plist = get_next(phead);
/* Handling some condition for forced indicate case. */ /* Handling some condition for forced indicate case. */
if (bforced == true) { if (bforced) {
pdbgpriv->dbg_rx_ampdu_forced_indicate_count++; pdbgpriv->dbg_rx_ampdu_forced_indicate_count++;
if (rtw_is_list_empty(phead)) { if (rtw_is_list_empty(phead)) {
/* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */ /* _exit_critical_ex(&ppending_recvframe_queue->lock, &irql); */
@ -2925,7 +2925,7 @@ static int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prfram
/* */ /* */
/* recv_indicatepkts_in_order(padapter, preorder_ctrl, true); */ /* recv_indicatepkts_in_order(padapter, preorder_ctrl, true); */
if (recv_indicatepkts_in_order(padapter, preorder_ctrl, false) == true) { if (recv_indicatepkts_in_order(padapter, preorder_ctrl, false)) {
if (!preorder_ctrl->bReorderWaiting) { if (!preorder_ctrl->bReorderWaiting) {
preorder_ctrl->bReorderWaiting = true; preorder_ctrl->bReorderWaiting = true;
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
@ -2968,7 +2968,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
if (preorder_ctrl) if (preorder_ctrl)
preorder_ctrl->bReorderWaiting = false; preorder_ctrl->bReorderWaiting = false;
if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) == true) if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true))
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME); _set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql); _exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
@ -2990,12 +2990,12 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
DBG_COUNTER(padapter->rx_logs.core_rx_post_indicate); DBG_COUNTER(padapter->rx_logs.core_rx_post_indicate);
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if ((phtpriv->ht_option == true) || if ((phtpriv->ht_option) ||
((psta->tdls_sta_state & TDLS_LINKED_STATE) && ((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
(psta->htpriv.ht_option == true) && (psta->htpriv.ht_option) &&
(psta->htpriv.ampdu_enable == true))) /* B/G/N Mode */ (psta->htpriv.ampdu_enable))) /* B/G/N Mode */
#else #else
if (phtpriv->ht_option == true) /* B/G/N Mode */ if (phtpriv->ht_option) /* B/G/N Mode */
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
{ {
/* prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; */ /* prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; */
@ -3048,12 +3048,12 @@ static int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_fra
pmptx = &pmppriv->tx; pmptx = &pmppriv->tx;
if (pmppriv->bloopback) { if (pmppriv->bloopback) {
if (_rtw_memcmp(ptr + 24, pmptx->buf + 24, precv_frame->u.hdr.len - 24) == false) { if (!memcmp(ptr + 24, pmptx->buf + 24, precv_frame->u.hdr.len - 24) == false) {
RTW_INFO("Compare payload content Fail !!!\n"); RTW_INFO("Compare payload content Fail !!!\n");
ret = _FAIL; ret = _FAIL;
} }
} }
if (pmppriv->bSetRxBssid == true) { if (pmppriv->bSetRxBssid) {
sa = get_addr2_ptr(ptr); sa = get_addr2_ptr(ptr);
da = GetAddr1Ptr(ptr); da = GetAddr1Ptr(ptr);
@ -3061,7 +3061,7 @@ static int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_fra
type = GetFrameType(ptr); type = GetFrameType(ptr);
subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */ subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */
if (_rtw_memcmp(bs, adapter->mppriv.network_macaddr, ETH_ALEN) == false) if (!memcmp(bs, adapter->mppriv.network_macaddr, ETH_ALEN) == false)
ret = _FAIL; ret = _FAIL;
RTW_DBG("############ type:0x%02x subtype:0x%02x #################\n", type, subtype); RTW_DBG("############ type:0x%02x subtype:0x%02x #################\n", type, subtype);
@ -3073,7 +3073,7 @@ static int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_fra
if (!adapter->mppriv.bmac_filter) if (!adapter->mppriv.bmac_filter)
return ret; return ret;
if (_rtw_memcmp(get_addr2_ptr(ptr), adapter->mppriv.mac_filter, ETH_ALEN) == false) if (!memcmp(get_addr2_ptr(ptr), adapter->mppriv.mac_filter, ETH_ALEN) == false)
ret = _FAIL; ret = _FAIL;
return ret; return ret;
@ -3105,11 +3105,11 @@ static sint MPwlanhdr_to_ethhdr(union recv_frame *precvframe)
psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE; psnap_type = ptr + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE;
/* convert hdr + possible LLC headers into Ethernet header */ /* convert hdr + possible LLC headers into Ethernet header */
/* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */ /* eth_type = (psnap_type[0] << 8) | psnap_type[1]; */
if ((_rtw_memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) && if ((!memcmp(psnap, rtw_rfc1042_header, SNAP_SIZE) &&
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) && (!memcmp(psnap_type, SNAP_ETH_TYPE_IPX, 2) == false) &&
(_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2) == false)) || (!memcmp(psnap_type, SNAP_ETH_TYPE_APPLETALK_AARP, 2) == false)) ||
/* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */ /* eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || */
_rtw_memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)) { !memcmp(psnap, rtw_bridge_tunnel_header, SNAP_SIZE)) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
bsnaphdr = true; bsnaphdr = true;
} else { } else {
@ -3138,11 +3138,11 @@ static sint MPwlanhdr_to_ethhdr(union recv_frame *precvframe)
be_tmp = htons(le16_to_cpu(pattrib->seq_num)); be_tmp = htons(le16_to_cpu(pattrib->seq_num));
/* RTW_INFO("wlan seq = %d ,seq_num =%x\n",len,pattrib->seq_num); */ /* RTW_INFO("wlan seq = %d ,seq_num =%x\n",len,pattrib->seq_num); */
_rtw_memcpy(ptr + 12, &be_tmp, 2); _rtw_memcpy(ptr + 12, &be_tmp, 2);
if (adapter->mppriv.bRTWSmbCfg == true) { if (adapter->mppriv.bRTWSmbCfg) {
/* if(_rtw_memcmp(mcastheadermac, pattrib->dst, 3) == true) */ /* SimpleConfig Dest. */ /* if(!memcmp(mcastheadermac, pattrib->dst, 3)) */ /* SimpleConfig Dest. */
/* _rtw_memcpy(ptr+ETH_ALEN, pattrib->bssid, ETH_ALEN); */ /* _rtw_memcpy(ptr+ETH_ALEN, pattrib->bssid, ETH_ALEN); */
if (_rtw_memcmp(mcastheadermac, pattrib->bssid, 3) == true) /* SimpleConfig Dest. */ if (!memcmp(mcastheadermac, pattrib->bssid, 3)) /* SimpleConfig Dest. */
_rtw_memcpy(ptr, pattrib->bssid, ETH_ALEN); _rtw_memcpy(ptr, pattrib->bssid, ETH_ALEN);
} }
@ -3169,7 +3169,7 @@ static int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
DBG_COUNTER(padapter->rx_logs.core_rx_pre); DBG_COUNTER(padapter->rx_logs.core_rx_pre);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true)) { /* &&(padapter->mppriv.check_mp_pkt == 0)) */ if ((check_fwstate(pmlmepriv, _FW_LINKED))) { /* &&(padapter->mppriv.check_mp_pkt == 0)) */
if (pattrib->crc_err == 1) if (pattrib->crc_err == 1)
padapter->mppriv.rx_crcerrpktcount++; padapter->mppriv.rx_crcerrpktcount++;
else { else {
@ -3605,7 +3605,7 @@ static int recv_func_prehandle(_adapter *padapter, union recv_frame *rframe)
#endif #endif
#ifdef CONFIG_MP_INCLUDED #ifdef CONFIG_MP_INCLUDED
if (padapter->registrypriv.mp_mode == 1 || padapter->mppriv.bRTWSmbCfg == true) { if (padapter->registrypriv.mp_mode == 1 || padapter->mppriv.bRTWSmbCfg) {
mp_recv_frame(padapter, rframe); mp_recv_frame(padapter, rframe);
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
@ -3664,7 +3664,7 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
psnap_type = get_recvframe_data(orig_prframe) + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE; psnap_type = get_recvframe_data(orig_prframe) + pattrib->hdrlen + pattrib->iv_len + SNAP_SIZE;
pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
if ((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) && if ((!memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) &&
((*pcategory == RTW_WLAN_CATEGORY_TDLS) || (*pcategory == RTW_WLAN_CATEGORY_P2P))) { ((*pcategory == RTW_WLAN_CATEGORY_TDLS) || (*pcategory == RTW_WLAN_CATEGORY_P2P))) {
ret = OnTDLS(padapter, prframe); ret = OnTDLS(padapter, prframe);
if (ret == _FAIL) if (ret == _FAIL)
@ -3758,7 +3758,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe)
/* check if need to enqueue into uc_swdec_pending_queue*/ /* check if need to enqueue into uc_swdec_pending_queue*/
if (check_fwstate(mlmepriv, WIFI_STATION_STATE) && if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
!IS_MCAST(prxattrib->ra) && prxattrib->encrypt > 0 && !IS_MCAST(prxattrib->ra) && prxattrib->encrypt > 0 &&
(prxattrib->bdecrypted == 0 || psecuritypriv->sw_decrypt == true) && (prxattrib->bdecrypted == 0 || psecuritypriv->sw_decrypt) &&
psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK && psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPAPSK &&
!psecuritypriv->busetkipkey) { !psecuritypriv->busetkipkey) {
DBG_COUNTER(padapter->rx_logs.core_rx_enqueue); DBG_COUNTER(padapter->rx_logs.core_rx_enqueue);
@ -3867,13 +3867,13 @@ void rtw_signal_stat_timer_hdl(struct timer_list *t)
goto set_timer; goto set_timer;
} }
if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == true if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY)
|| check_fwstate(&adapter->mlmepriv, _FW_LINKED) == false || check_fwstate(&adapter->mlmepriv, _FW_LINKED) == false
) )
goto set_timer; goto set_timer;
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
if (rtw_mi_buddy_check_fwstate(adapter, _FW_UNDER_SURVEY) == true) if (rtw_mi_buddy_check_fwstate(adapter, _FW_UNDER_SURVEY))
goto set_timer; goto set_timer;
#endif #endif
@ -4070,13 +4070,13 @@ void rx_query_phy_status(
pkt_info.is_packet_match_bssid = (!IsFrameTypeCtrl(wlanhdr)) pkt_info.is_packet_match_bssid = (!IsFrameTypeCtrl(wlanhdr))
&& (!pattrib->icv_err) && (!pattrib->crc_err) && (!pattrib->icv_err) && (!pattrib->crc_err)
&& _rtw_memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN); && !memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN);
pkt_info.is_to_self = (!pattrib->icv_err) && (!pattrib->crc_err) pkt_info.is_to_self = (!pattrib->icv_err) && (!pattrib->crc_err)
&& _rtw_memcmp(get_ra(wlanhdr), adapter_mac_addr(padapter), ETH_ALEN); && !memcmp(get_ra(wlanhdr), adapter_mac_addr(padapter), ETH_ALEN);
pkt_info.is_packet_to_self = pkt_info.is_packet_match_bssid pkt_info.is_packet_to_self = pkt_info.is_packet_match_bssid
&& _rtw_memcmp(get_ra(wlanhdr), adapter_mac_addr(padapter), ETH_ALEN); && !memcmp(get_ra(wlanhdr), adapter_mac_addr(padapter), ETH_ALEN);
pkt_info.is_packet_beacon = pkt_info.is_packet_match_bssid pkt_info.is_packet_beacon = pkt_info.is_packet_match_bssid
&& (get_frame_sub_type(wlanhdr) == WIFI_BEACON); && (get_frame_sub_type(wlanhdr) == WIFI_BEACON);
@ -4085,7 +4085,7 @@ void rx_query_phy_status(
pkt_info.station_id = 0xFF; pkt_info.station_id = 0xFF;
if (_rtw_memcmp(adapter_mac_addr(padapter), sa, ETH_ALEN) == true) { if (!memcmp(adapter_mac_addr(padapter), sa, ETH_ALEN)) {
static u32 start_time = 0; static u32 start_time = 0;
if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) { if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) {
@ -4111,7 +4111,7 @@ void rx_query_phy_status(
{ {
precvframe->u.hdr.psta = NULL; precvframe->u.hdr.psta = NULL;
if (pkt_info.is_packet_match_bssid if (pkt_info.is_packet_match_bssid
&& (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) && (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
) { ) {
if (psta) { if (psta) {
precvframe->u.hdr.psta = psta; precvframe->u.hdr.psta = psta;

View file

@ -2070,7 +2070,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *precvframe)
goto BIP_exit; goto BIP_exit;
/* MIC field should be last 8 bytes of packet (packet without FCS) */ /* MIC field should be last 8 bytes of packet (packet without FCS) */
if (_rtw_memcmp(mic, pframe + pattrib->pkt_len - 8, 8)) { if (!memcmp(mic, pframe + pattrib->pkt_len - 8, 8)) {
pmlmeext->mgnt_80211w_IPN_rx = temp_ipn; pmlmeext->mgnt_80211w_IPN_rx = temp_ipn;
res = _SUCCESS; res = _SUCCESS;
} else } else

View file

@ -859,7 +859,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN)) == true) { if ((!memcmp(psta->hwaddr, addr, ETH_ALEN)) == true) {
/* if found the matched address */ /* if found the matched address */
break; break;
} }
@ -946,7 +946,7 @@ u8 rtw_access_ctrl(_adapter *adapter, u8 *mac_addr)
acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list); acl_node = LIST_CONTAINOR(list, struct rtw_wlan_acl_node, list);
list = get_next(list); list = get_next(list);
if (_rtw_memcmp(acl_node->addr, mac_addr, ETH_ALEN)) { if (!memcmp(acl_node->addr, mac_addr, ETH_ALEN)) {
if (acl_node->valid == true) { if (acl_node->valid == true) {
match = true; match = true;
break; break;
@ -993,7 +993,7 @@ bool rtw_is_pre_link_sta(struct sta_priv *stapriv, u8 *addr)
_enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL); _enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL);
for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) { for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) {
if (pre_link_sta_ctl->node[i].valid == true if (pre_link_sta_ctl->node[i].valid == true
&& _rtw_memcmp(pre_link_sta_ctl->node[i].addr, addr, ETH_ALEN) == true && !memcmp(pre_link_sta_ctl->node[i].addr, addr, ETH_ALEN) == true
) { ) {
exist = true; exist = true;
break; break;
@ -1023,7 +1023,7 @@ struct sta_info *rtw_pre_link_sta_add(struct sta_priv *stapriv, u8 *hwaddr)
_enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL); _enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL);
for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) { for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) {
if (pre_link_sta_ctl->node[i].valid == true if (pre_link_sta_ctl->node[i].valid == true
&& _rtw_memcmp(pre_link_sta_ctl->node[i].addr, hwaddr, ETH_ALEN) == true && !memcmp(pre_link_sta_ctl->node[i].addr, hwaddr, ETH_ALEN) == true
) { ) {
node = &pre_link_sta_ctl->node[i]; node = &pre_link_sta_ctl->node[i];
exist = true; exist = true;
@ -1076,7 +1076,7 @@ void rtw_pre_link_sta_del(struct sta_priv *stapriv, u8 *hwaddr)
_enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL); _enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL);
for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) { for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) {
if (pre_link_sta_ctl->node[i].valid == true if (pre_link_sta_ctl->node[i].valid == true
&& _rtw_memcmp(pre_link_sta_ctl->node[i].addr, hwaddr, ETH_ALEN) == true && !memcmp(pre_link_sta_ctl->node[i].addr, hwaddr, ETH_ALEN) == true
) { ) {
node = &pre_link_sta_ctl->node[i]; node = &pre_link_sta_ctl->node[i];
exist = true; exist = true;

View file

@ -746,7 +746,7 @@ u8 *rtw_tdls_set_wmm_params(_adapter *padapter, u8 *pframe, struct pkt_attrib *p
if (&pmlmeinfo->WMM_param) { if (&pmlmeinfo->WMM_param) {
_rtw_memcpy(wmm_param_ele, WMM_PARA_OUI, 6); _rtw_memcpy(wmm_param_ele, WMM_PARA_OUI, 6);
if (_rtw_memcmp(&pmlmeinfo->WMM_param, &wmm_param_ele[6], 18) == true) if (!memcmp(&pmlmeinfo->WMM_param, &wmm_param_ele[6], 18) == true)
/* Use default WMM Param */ /* Use default WMM Param */
_rtw_memcpy(wmm_param_ele + 6, (u8 *)&TDLS_WMM_PARAM_IE, sizeof(TDLS_WMM_PARAM_IE)); _rtw_memcpy(wmm_param_ele + 6, (u8 *)&TDLS_WMM_PARAM_IE, sizeof(TDLS_WMM_PARAM_IE));
else else
@ -1436,7 +1436,7 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame)
if (ptdls_sta != NULL) { if (ptdls_sta != NULL) {
/* Record the tdls sta with lowest signal strength */ /* Record the tdls sta with lowest signal strength */
if (ptdlsinfo->sta_maximum == true && ptdls_sta->alive_count >= 1) { if (ptdlsinfo->sta_maximum == true && ptdls_sta->alive_count >= 1) {
if (_rtw_memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN)) { if (!memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN)) {
_rtw_memcpy(ptdlsinfo->ss_record.macaddr, psa, ETH_ALEN); _rtw_memcpy(ptdlsinfo->ss_record.macaddr, psa, ETH_ALEN);
ptdlsinfo->ss_record.RxPWDBAll = pattrib->phy_info.RxPWDBAll; ptdlsinfo->ss_record.RxPWDBAll = pattrib->phy_info.RxPWDBAll;
} else { } else {
@ -1448,7 +1448,7 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame)
} }
} else { } else {
if (ptdlsinfo->sta_maximum == true) { if (ptdlsinfo->sta_maximum == true) {
if (_rtw_memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN)) { if (!memcmp(ptdlsinfo->ss_record.macaddr, empty_addr, ETH_ALEN)) {
/* All traffics are busy, do not set up another direct link. */ /* All traffics are busy, do not set up another direct link. */
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
@ -1581,7 +1581,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame)
_rtw_memcpy(ptdls_sta->TDLS_RSNIE, pIE->data, pIE->Length); _rtw_memcpy(ptdls_sta->TDLS_RSNIE, pIE->data, pIE->Length);
pairwise_count = *(u16 *)(ppairwise_cipher - 2); pairwise_count = *(u16 *)(ppairwise_cipher - 2);
for (k = 0; k < pairwise_count; k++) { for (k = 0; k < pairwise_count; k++) {
if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == true) if (!memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == true)
ccmp_included = 1; ccmp_included = 1;
} }
@ -1609,7 +1609,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame)
case EID_BSSCoexistence: case EID_BSSCoexistence:
break; break;
case _LINK_ID_IE_: case _LINK_ID_IE_:
if (_rtw_memcmp(get_bssid(pmlmepriv), pIE->data, 6) == false) if (!memcmp(get_bssid(pmlmepriv), pIE->data, 6) == false)
txmgmt.status_code = _STATS_NOT_IN_SAME_BSS_; txmgmt.status_code = _STATS_NOT_IN_SAME_BSS_;
break; break;
default: default:
@ -1759,13 +1759,13 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame)
ppairwise_cipher = prsnie + 10; ppairwise_cipher = prsnie + 10;
_rtw_memcpy(&pairwise_count, (u16 *)(ppairwise_cipher - 2), 2); _rtw_memcpy(&pairwise_count, (u16 *)(ppairwise_cipher - 2), 2);
for (k = 0; k < pairwise_count; k++) { for (k = 0; k < pairwise_count; k++) {
if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == true) if (!memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == true)
verify_ccmp = 1; verify_ccmp = 1;
} }
case _EXT_CAP_IE_: case _EXT_CAP_IE_:
break; break;
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if (_rtw_memcmp((u8 *)pIE + 2, WMM_INFO_OUI, 6) == true) { if (!memcmp((u8 *)pIE + 2, WMM_INFO_OUI, 6) == true) {
/* WMM Info ID and OUI */ /* WMM Info ID and OUI */
if ((pregistrypriv->wmm_enable == true) || (padapter->mlmepriv.htpriv.ht_option == true)) if ((pregistrypriv->wmm_enable == true) || (padapter->mlmepriv.htpriv.ht_option == true))
ptdls_sta->qos_option = true; ptdls_sta->qos_option = true;
@ -1912,7 +1912,7 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame)
prsnie = (u8 *)pIE; prsnie = (u8 *)pIE;
break; break;
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if (_rtw_memcmp((u8 *)pIE + 2, WMM_PARA_OUI, 6) == true) { if (!memcmp((u8 *)pIE + 2, WMM_PARA_OUI, 6) == true) {
/* WMM Parameter ID and OUI */ /* WMM Parameter ID and OUI */
ptdls_sta->qos_option = true; ptdls_sta->qos_option = true;
} }
@ -2012,7 +2012,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame)
if (psta_ap == NULL) if (psta_ap == NULL)
goto exit; goto exit;
dst = pIE->data + 12; dst = pIE->data + 12;
if (MacAddr_isBcst(dst) == false && (_rtw_memcmp(adapter_mac_addr(padapter), dst, 6) == false)) if (MacAddr_isBcst(dst) == false && (!memcmp(adapter_mac_addr(padapter), dst, 6) == false))
goto exit; goto exit;
break; break;
default: default:
@ -2260,7 +2260,7 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame)
txmgmt.status_code = 0; txmgmt.status_code = 0;
_rtw_memcpy(txmgmt.peer, psa, ETH_ALEN); _rtw_memcpy(txmgmt.peer, psa, ETH_ALEN);
if (_rtw_memcmp(pchsw_info->addr, zaddr, ETH_ALEN) == true) if (!memcmp(pchsw_info->addr, zaddr, ETH_ALEN) == true)
_rtw_memcpy(pchsw_info->addr, ptdls_sta->hwaddr, ETH_ALEN); _rtw_memcpy(pchsw_info->addr, ptdls_sta->hwaddr, ETH_ALEN);
if (ATOMIC_READ(&pchsw_info->chsw_on) == false) if (ATOMIC_READ(&pchsw_info->chsw_on) == false)

View file

@ -241,9 +241,9 @@ u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen)
if (pmlmeinfo->HT_enable) if (pmlmeinfo->HT_enable)
network_type = WIRELESS_11_24N; network_type = WIRELESS_11_24N;
if ((cckratesonly_included(rate, ratelen)) == true) if ((cckratesonly_included(rate, ratelen)))
network_type |= WIRELESS_11B; network_type |= WIRELESS_11B;
else if ((cckrates_included(rate, ratelen)) == true) else if ((cckrates_included(rate, ratelen)))
network_type |= WIRELESS_11BG; network_type |= WIRELESS_11BG;
else else
network_type |= WIRELESS_11G; network_type |= WIRELESS_11G;
@ -355,7 +355,7 @@ unsigned int ratetbl2rateset(_adapter *padapter, unsigned char *rateset)
default: default:
rate = ratetbl_val_2wifirate(rate); rate = ratetbl_val_2wifirate(rate);
if (is_basicrate(padapter, rate) == true) if (is_basicrate(padapter, rate))
rate |= IEEE80211_BASIC_RATE_MASK; rate |= IEEE80211_BASIC_RATE_MASK;
rateset[len] = rate; rateset[len] = rate;
@ -727,7 +727,7 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char
rtw_hal_get_hwreg(padapter, HW_VAR_CH_SW_NEED_TO_TAKE_CARE_IQK_INFO, &take_care_iqk); rtw_hal_get_hwreg(padapter, HW_VAR_CH_SW_NEED_TO_TAKE_CARE_IQK_INFO, &take_care_iqk);
rtw_hal_get_hwreg(padapter, HW_VAR_DO_IQK, &do_iqk); rtw_hal_get_hwreg(padapter, HW_VAR_DO_IQK, &do_iqk);
if ((take_care_iqk == true) && (do_iqk == true)) if ((take_care_iqk) && (do_iqk == true))
iqk_info_backup = true; iqk_info_backup = true;
} }
#endif #endif
@ -735,7 +735,7 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char
rtw_hal_set_chnl_bw(padapter, center_ch, bwmode, channel_offset, chnl_offset80); /* set center channel */ rtw_hal_set_chnl_bw(padapter, center_ch, bwmode, channel_offset, chnl_offset80); /* set center channel */
#if (defined(CONFIG_TDLS) && defined(CONFIG_TDLS_CH_SW)) || defined(CONFIG_MCC_MODE) #if (defined(CONFIG_TDLS) && defined(CONFIG_TDLS_CH_SW)) || defined(CONFIG_MCC_MODE)
if (iqk_info_backup == true) if (iqk_info_backup)
rtw_hal_ch_sw_iqk_info_backup(padapter); rtw_hal_ch_sw_iqk_info_backup(padapter);
#endif #endif
@ -1192,7 +1192,7 @@ static bool cam_cache_chk(_adapter *adapter, u8 id, u8 *addr, s16 kid, s8 gk)
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
bool ret = false; bool ret = false;
if (addr && _rtw_memcmp(dvobj->cam_cache[id].mac, addr, ETH_ALEN) == false) if (addr && !memcmp(dvobj->cam_cache[id].mac, addr, ETH_ALEN) == false)
goto exit; goto exit;
if (kid >= 0 && kid != (dvobj->cam_cache[id].ctrl & 0x03)) if (kid >= 0 && kid != (dvobj->cam_cache[id].ctrl & 0x03))
goto exit; goto exit;
@ -1261,7 +1261,7 @@ static s16 rtw_get_camid(_adapter *adapter, struct sta_info *sta, u8 *addr, s16
} }
/* find cam entry which has the same addr, kid (, gk bit) */ /* find cam entry which has the same addr, kid (, gk bit) */
if (_rtw_camctl_chk_cap(adapter, SEC_CAP_CHK_BMC) == true) if (_rtw_camctl_chk_cap(adapter, SEC_CAP_CHK_BMC))
i = _rtw_camid_search(adapter, addr, kid, sta ? false : true); i = _rtw_camid_search(adapter, addr, kid, sta ? false : true);
else else
i = _rtw_camid_search(adapter, addr, kid, -1); i = _rtw_camid_search(adapter, addr, kid, -1);
@ -1500,7 +1500,7 @@ void flush_all_cam_entry(_adapter *padapter)
} else } else
rtw_clearstakey_cmd(padapter, psta, false); rtw_clearstakey_cmd(padapter, psta, false);
} }
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
int cam_id = -1; int cam_id = -1;
u8 *addr = adapter_mac_addr(padapter); u8 *addr = adapter_mac_addr(padapter);
@ -1565,7 +1565,7 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
return false; return false;
} }
if (_rtw_memcmp(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element))) if (!memcmp(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)))
return false; return false;
else else
_rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)); _rtw_memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
@ -1789,7 +1789,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
pmlmeinfo->bwmode_updated = false; pmlmeinfo->bwmode_updated = false;
if (true == pmlmeinfo->bwmode_updated) { if (pmlmeinfo->bwmode_updated) {
struct sta_info *psta; struct sta_info *psta;
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -2272,7 +2272,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
return _FAIL; return _FAIL;
} }
if (_rtw_memcmp(cur_network->network.MacAddress, pbssid, 6) == false) { if (!memcmp(cur_network->network.MacAddress, pbssid, 6) == false) {
RTW_WARN("Oops: rtw_check_network_encrypt linked but recv other bssid bcn\n" MAC_FMT MAC_FMT, RTW_WARN("Oops: rtw_check_network_encrypt linked but recv other bssid bcn\n" MAC_FMT MAC_FMT,
MAC_ARG(pbssid), MAC_ARG(cur_network->network.MacAddress)); MAC_ARG(pbssid), MAC_ARG(cur_network->network.MacAddress));
return true; return true;
@ -2288,10 +2288,10 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
recv_beacon.ssid_len = pmlmepriv->cur_beacon_keys.ssid_len; recv_beacon.ssid_len = pmlmepriv->cur_beacon_keys.ssid_len;
} }
if (_rtw_memcmp(&recv_beacon, &pmlmepriv->cur_beacon_keys, sizeof(recv_beacon)) == true) if (!memcmp(&recv_beacon, &pmlmepriv->cur_beacon_keys, sizeof(recv_beacon)))
pmlmepriv->new_beacon_cnts = 0; pmlmepriv->new_beacon_cnts = 0;
else if ((pmlmepriv->new_beacon_cnts == 0) || else if ((pmlmepriv->new_beacon_cnts == 0) ||
_rtw_memcmp(&recv_beacon, &pmlmepriv->new_beacon_keys, sizeof(recv_beacon)) == false) { !memcmp(&recv_beacon, &pmlmepriv->new_beacon_keys, sizeof(recv_beacon)) == false) {
RTW_DBG("%s: start new beacon (seq=%d)\n", __func__, GetSequence(pframe)); RTW_DBG("%s: start new beacon (seq=%d)\n", __func__, GetSequence(pframe));
if (pmlmepriv->new_beacon_cnts == 0) { if (pmlmepriv->new_beacon_cnts == 0) {
@ -2314,7 +2314,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
/* check bw mode change only? */ /* check bw mode change only? */
pmlmepriv->cur_beacon_keys.ht_cap_info = recv_beacon.ht_cap_info; pmlmepriv->cur_beacon_keys.ht_cap_info = recv_beacon.ht_cap_info;
pmlmepriv->cur_beacon_keys.ht_info_infos_0_sco = recv_beacon.ht_info_infos_0_sco; pmlmepriv->cur_beacon_keys.ht_info_infos_0_sco = recv_beacon.ht_info_infos_0_sco;
if (_rtw_memcmp(&recv_beacon, &pmlmepriv->cur_beacon_keys, if (!memcmp(&recv_beacon, &pmlmepriv->cur_beacon_keys,
sizeof(recv_beacon)) == false) { sizeof(recv_beacon)) == false) {
/* beacon is changed, have to do disconnect/connect */ /* beacon is changed, have to do disconnect/connect */
RTW_WARN("%s: new beacon occur!!\n", __func__); RTW_WARN("%s: new beacon occur!!\n", __func__);
@ -2361,7 +2361,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
/* to update WMM paramter set while receiving beacon */ /* to update WMM paramter set while receiving beacon */
if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */ if (!memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */
if (WMM_param_handler(padapter, pIE)) if (WMM_param_handler(padapter, pIE))
report_wmm_edca_update(padapter); report_wmm_edca_update(padapter);
break; break;
@ -2376,9 +2376,9 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
case _EXT_CAP_IE_: case _EXT_CAP_IE_:
if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == true) if (check_ap_tdls_prohibited(pIE->data, pIE->Length))
ptdlsinfo->ap_prohibited = true; ptdlsinfo->ap_prohibited = true;
if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == true) if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length))
ptdlsinfo->ch_switch_prohibited = true; ptdlsinfo->ch_switch_prohibited = true;
break; break;
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
@ -2398,7 +2398,7 @@ void process_csa_ie(_adapter *padapter, u8 *pframe, uint pkt_len)
PNDIS_802_11_VARIABLE_IEs pIE; PNDIS_802_11_VARIABLE_IEs pIE;
u8 new_ch_no = 0; u8 new_ch_no = 0;
if (padapter->mlmepriv.handle_dfs == true) if (padapter->mlmepriv.handle_dfs)
return; return;
len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN); len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN);
@ -2435,12 +2435,12 @@ unsigned int is_ap_in_tkip(_adapter *padapter)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) && (_rtw_memcmp((pIE->data + 12), WPA_TKIP_CIPHER, 4))) if ((!memcmp(pIE->data, RTW_WPA_OUI, 4)) && (!memcmp((pIE->data + 12), WPA_TKIP_CIPHER, 4)))
return true; return true;
break; break;
case _RSN_IE_2_: case _RSN_IE_2_:
if (_rtw_memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4)) if (!memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
return true; return true;
default: default:
@ -2469,15 +2469,15 @@ unsigned int should_forbid_n_rate(_adapter *padapter)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if (_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4) && if (!memcmp(pIE->data, RTW_WPA_OUI, 4) &&
((_rtw_memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP, 4)) || ((!memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP, 4)) ||
(_rtw_memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP, 4)))) (!memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP, 4))))
return false; return false;
break; break;
case _RSN_IE_2_: case _RSN_IE_2_:
if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) || if ((!memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) ||
(_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4))) (!memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
return false; return false;
default: default:
@ -2508,7 +2508,7 @@ unsigned int is_ap_in_wep(_adapter *padapter)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if (_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) if (!memcmp(pIE->data, RTW_WPA_OUI, 4))
return false; return false;
break; break;
@ -2705,24 +2705,24 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
switch (pIE->ElementID) { switch (pIE->ElementID) {
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if ((_rtw_memcmp(pIE->data, ATHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ATHEROS_OUI2, 3))) { if ((!memcmp(pIE->data, ATHEROS_OUI1, 3)) || (!memcmp(pIE->data, ATHEROS_OUI2, 3))) {
RTW_INFO("link to Artheros AP\n"); RTW_INFO("link to Artheros AP\n");
return HT_IOT_PEER_ATHEROS; return HT_IOT_PEER_ATHEROS;
} else if ((_rtw_memcmp(pIE->data, BROADCOM_OUI1, 3)) } else if ((!memcmp(pIE->data, BROADCOM_OUI1, 3))
|| (_rtw_memcmp(pIE->data, BROADCOM_OUI2, 3)) || (!memcmp(pIE->data, BROADCOM_OUI2, 3))
|| (_rtw_memcmp(pIE->data, BROADCOM_OUI3, 3))) { || (!memcmp(pIE->data, BROADCOM_OUI3, 3))) {
RTW_INFO("link to Broadcom AP\n"); RTW_INFO("link to Broadcom AP\n");
return HT_IOT_PEER_BROADCOM; return HT_IOT_PEER_BROADCOM;
} else if (_rtw_memcmp(pIE->data, MARVELL_OUI, 3)) { } else if (!memcmp(pIE->data, MARVELL_OUI, 3)) {
RTW_INFO("link to Marvell AP\n"); RTW_INFO("link to Marvell AP\n");
return HT_IOT_PEER_MARVELL; return HT_IOT_PEER_MARVELL;
} else if (_rtw_memcmp(pIE->data, RALINK_OUI, 3)) { } else if (!memcmp(pIE->data, RALINK_OUI, 3)) {
RTW_INFO("link to Ralink AP\n"); RTW_INFO("link to Ralink AP\n");
return HT_IOT_PEER_RALINK; return HT_IOT_PEER_RALINK;
} else if (_rtw_memcmp(pIE->data, CISCO_OUI, 3)) { } else if (!memcmp(pIE->data, CISCO_OUI, 3)) {
RTW_INFO("link to Cisco AP\n"); RTW_INFO("link to Cisco AP\n");
return HT_IOT_PEER_CISCO; return HT_IOT_PEER_CISCO;
} else if (_rtw_memcmp(pIE->data, REALTEK_OUI, 3)) { } else if (!memcmp(pIE->data, REALTEK_OUI, 3)) {
u32 Vender = HT_IOT_PEER_REALTEK; u32 Vender = HT_IOT_PEER_REALTEK;
if (pIE->Length >= 5) { if (pIE->Length >= 5) {
@ -2753,7 +2753,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
RTW_INFO("link to Realtek AP\n"); RTW_INFO("link to Realtek AP\n");
return Vender; return Vender;
} else if (_rtw_memcmp(pIE->data, AIRGOCAP_OUI, 3)) { } else if (!memcmp(pIE->data, AIRGOCAP_OUI, 3)) {
RTW_INFO("link to Airgo Cap\n"); RTW_INFO("link to Airgo Cap\n");
return HT_IOT_PEER_AIRGO; return HT_IOT_PEER_AIRGO;
} else } else
@ -2859,9 +2859,9 @@ void update_wireless_mode(_adapter *padapter)
else if (pmlmeinfo->HT_enable) else if (pmlmeinfo->HT_enable)
network_type = WIRELESS_11_24N; network_type = WIRELESS_11_24N;
if ((cckratesonly_included(rate, ratelen)) == true) if ((cckratesonly_included(rate, ratelen)))
network_type |= WIRELESS_11B; network_type |= WIRELESS_11B;
else if ((cckrates_included(rate, ratelen)) == true) else if ((cckrates_included(rate, ratelen)))
network_type |= WIRELESS_11BG; network_type |= WIRELESS_11BG;
else else
network_type |= WIRELESS_11G; network_type |= WIRELESS_11G;
@ -2966,7 +2966,7 @@ void process_addba_req(_adapter *padapter, u8 *paddba_req, u8 *addr)
accept = rtw_rx_ampdu_is_accept(padapter); accept = rtw_rx_ampdu_is_accept(padapter);
size = rtw_rx_ampdu_size(padapter); size = rtw_rx_ampdu_size(padapter);
if (accept == true) if (accept)
rtw_addbarsp_cmd(padapter, addr, tid, 0, size, start_seq); rtw_addbarsp_cmd(padapter, addr, tid, 0, size, start_seq);
else else
rtw_addbarsp_cmd(padapter, addr, tid, 37, size, start_seq); /* reject ADDBA Req */ rtw_addbarsp_cmd(padapter, addr, tid, 37, size, start_seq); /* reject ADDBA Req */
@ -3040,7 +3040,7 @@ void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
*/ */
/* dump for adaptive_early_32k */ /* dump for adaptive_early_32k */
if (pmlmeext->bcn_cnt > 100 && (pmlmeext->adaptive_tsf_done == true)) { if (pmlmeext->bcn_cnt > 100 && (pmlmeext->adaptive_tsf_done)) {
u8 ratio_20_delay, ratio_80_delay; u8 ratio_20_delay, ratio_80_delay;
u8 DrvBcnEarly, DrvBcnTimeOut; u8 DrvBcnEarly, DrvBcnTimeOut;
@ -3240,12 +3240,12 @@ void rtw_alloc_macid(_adapter *padapter, struct sta_info *psta)
u8 last_id = 0; u8 last_id = 0;
u8 is_bc_sta = false; u8 is_bc_sta = false;
if (_rtw_memcmp(psta->hwaddr, adapter_mac_addr(padapter), ETH_ALEN)) { if (!memcmp(psta->hwaddr, adapter_mac_addr(padapter), ETH_ALEN)) {
psta->mac_id = macid_ctl->num; psta->mac_id = macid_ctl->num;
return; return;
} }
if (_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) { if (!memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) {
is_bc_sta = true; is_bc_sta = true;
rtw_iface_bcmc_id_set(padapter, INVALID_SEC_MAC_CAM_ID); /*init default value*/ rtw_iface_bcmc_id_set(padapter, INVALID_SEC_MAC_CAM_ID); /*init default value*/
} }
@ -3356,10 +3356,10 @@ void rtw_release_macid(_adapter *padapter, struct sta_info *psta)
struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj); struct macid_ctl_t *macid_ctl = dvobj_to_macidctl(dvobj);
u8 is_bc_sta = false; u8 is_bc_sta = false;
if (_rtw_memcmp(psta->hwaddr, adapter_mac_addr(padapter), ETH_ALEN)) if (!memcmp(psta->hwaddr, adapter_mac_addr(padapter), ETH_ALEN))
return; return;
if (_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) if (!memcmp(psta->hwaddr, bc_addr, ETH_ALEN))
is_bc_sta = true; is_bc_sta = true;
#ifdef CONFIG_SHARED_BMC_MACID #ifdef CONFIG_SHARED_BMC_MACID
@ -3546,7 +3546,7 @@ _adapter *dvobj_get_adapter_by_addr(struct dvobj_priv *dvobj, u8 *addr)
int i; int i;
for (i = 0; i < dvobj->iface_nums; i++) { for (i = 0; i < dvobj->iface_nums; i++) {
if (_rtw_memcmp(dvobj->padapters[i]->mac_addr, addr, ETH_ALEN) == true) if (!memcmp(dvobj->padapters[i]->mac_addr, addr, ETH_ALEN))
break; break;
} }

View file

@ -598,7 +598,7 @@ void rtw_update_tx_rate_bmp(struct dvobj_priv *dvobj)
} }
/* TODO: per rfpath and rate section handling? */ /* TODO: per rfpath and rate section handling? */
if (update_ht_rs == true || update_vht_rs == true) if (update_ht_rs || update_vht_rs == true)
rtw_hal_set_tx_power_level(dvobj_get_primary_adapter(dvobj), hal_data->current_channel); rtw_hal_set_tx_power_level(dvobj_get_primary_adapter(dvobj), hal_data->current_channel);
} }
} }
@ -756,7 +756,7 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf
} else { } else {
while (true) { while (true) {
/* IOT action */ /* IOT action */
if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en == true) && if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en) &&
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
pattrib->vcs_mode = CTS_TO_SELF; pattrib->vcs_mode = CTS_TO_SELF;
break; break;
@ -791,7 +791,7 @@ static void update_attrib_vcs_info(_adapter *padapter, struct xmit_frame *pxmitf
/* to do list: check MIMO power save condition. */ /* to do list: check MIMO power save condition. */
/* check AMPDU aggregation for TXOP */ /* check AMPDU aggregation for TXOP */
if ((pattrib->ampdu_en == true)) { if ((pattrib->ampdu_en)) {
pattrib->vcs_mode = RTS_CTS; pattrib->vcs_mode = RTS_CTS;
break; break;
} }
@ -848,7 +848,7 @@ static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattri
if (pattrib->ht_en && psta->htpriv.ampdu_enable) { if (pattrib->ht_en && psta->htpriv.ampdu_enable) {
if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) { if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) {
pattrib->ampdu_en = true; pattrib->ampdu_en = true;
if (psta->htpriv.tx_amsdu_enable == true) if (psta->htpriv.tx_amsdu_enable)
pattrib->amsdu_ampdu_en = true; pattrib->amsdu_ampdu_en = true;
else else
pattrib->amsdu_ampdu_en = false; pattrib->amsdu_ampdu_en = false;
@ -861,7 +861,7 @@ static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattri
/* } */ /* } */
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (pattrib->direct_link == true) { if (pattrib->direct_link) {
psta = pattrib->ptdls_sta; psta = pattrib->ptdls_sta;
pattrib->raid = psta->raid; pattrib->raid = psta->raid;
@ -892,13 +892,13 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
memset(pattrib->dot11tkiptxmickey.skey, 0, 16); memset(pattrib->dot11tkiptxmickey.skey, 0, 16);
pattrib->mac_id = psta->mac_id; pattrib->mac_id = psta->mac_id;
if (psta->ieee8021x_blocked == true) { if (psta->ieee8021x_blocked) {
pattrib->encrypt = 0; pattrib->encrypt = 0;
if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) { if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false)) {
#ifdef DBG_TX_DROP_FRAME #ifdef DBG_TX_DROP_FRAME
RTW_INFO("DBG_TX_DROP_FRAME %s psta->ieee8021x_blocked == true, pattrib->ether_type(%04x) != 0x888e\n", __func__, pattrib->ether_type); RTW_INFO("DBG_TX_DROP_FRAME %s psta->ieee8021x_blocked, pattrib->ether_type(%04x) != 0x888e\n", __func__, pattrib->ether_type);
#endif #endif
res = _FAIL; res = _FAIL;
goto exit; goto exit;
@ -935,7 +935,7 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
} }
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (pattrib->direct_link == true) { if (pattrib->direct_link) {
if (pattrib->encrypt > 0) if (pattrib->encrypt > 0)
pattrib->encrypt = _AES_; pattrib->encrypt = _AES_;
} }
@ -999,7 +999,7 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
_rtw_memcpy(pattrib->dot118021x_UncstKey.skey, psta->dot118021x_UncstKey.skey, 16); _rtw_memcpy(pattrib->dot118021x_UncstKey.skey, psta->dot118021x_UncstKey.skey, 16);
if (pattrib->encrypt && if (pattrib->encrypt &&
((padapter->securitypriv.sw_encrypt == true) || (psecuritypriv->hw_decrypted == false))) { ((padapter->securitypriv.sw_encrypt) || (psecuritypriv->hw_decrypted == false))) {
pattrib->bswenc = true; pattrib->bswenc = true;
} else { } else {
pattrib->bswenc = false; pattrib->bswenc = false;
@ -1086,7 +1086,7 @@ u8 rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib)
pattrib->ptdls_sta = NULL; pattrib->ptdls_sta = NULL;
pattrib->direct_link = false; pattrib->direct_link = false;
if (padapter->tdlsinfo.link_established == true) { if (padapter->tdlsinfo.link_established) {
pattrib->ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst); pattrib->ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst);
if ((pattrib->ptdls_sta != NULL) && if ((pattrib->ptdls_sta != NULL) &&
(pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) && (pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) &&
@ -1184,14 +1184,14 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
_rtw_memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN); _rtw_memcpy(pattrib->dst, &etherhdr.h_dest, ETH_ALEN);
_rtw_memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN); _rtw_memcpy(pattrib->src, &etherhdr.h_source, ETH_ALEN);
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pattrib->ta, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pattrib->ta, adapter_mac_addr(padapter), ETH_ALEN);
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_adhoc); DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_adhoc);
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (rtw_check_tdls_established(padapter, pattrib) == true) if (rtw_check_tdls_established(padapter, pattrib))
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); /* For TDLS direct link Tx, set ra to be same to dst */ _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); /* For TDLS direct link Tx, set ra to be same to dst */
else else
#endif #endif
@ -1225,7 +1225,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
#endif #endif
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true && !(psta->state & _FW_LINKED)) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && !(psta->state & _FW_LINKED)) {
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_ap_link); DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_ap_link);
res = _FAIL; res = _FAIL;
goto exit; goto exit;
@ -1277,13 +1277,13 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
} }
} else if (GET_IPV4_PROTOCOL(ip) == 0x06 /* TCP */ } else if (GET_IPV4_PROTOCOL(ip) == 0x06 /* TCP */
&& rtw_st_ctl_chk_reg_s_proto(&psta->st_ctl, 0x06) == true && rtw_st_ctl_chk_reg_s_proto(&psta->st_ctl, 0x06)
) { ) {
u8 tcp[20]; u8 tcp[20];
_rtw_pktfile_read(&pktfile, tcp, 20); _rtw_pktfile_read(&pktfile, tcp, 20);
if (rtw_st_ctl_chk_reg_rule(&psta->st_ctl, padapter, IPV4_SRC(ip), TCP_SRC(tcp), IPV4_DST(ip), TCP_DST(tcp)) == true) { if (rtw_st_ctl_chk_reg_rule(&psta->st_ctl, padapter, IPV4_SRC(ip), TCP_SRC(tcp), IPV4_DST(ip), TCP_DST(tcp))) {
if (GET_TCP_SYN(tcp) && GET_TCP_ACK(tcp)) { if (GET_TCP_SYN(tcp) && GET_TCP_ACK(tcp)) {
session_tracker_add_cmd(padapter, psta session_tracker_add_cmd(padapter, psta
, IPV4_SRC(ip), TCP_SRC(tcp) , IPV4_SRC(ip), TCP_SRC(tcp)
@ -1361,7 +1361,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
set_qos(&pktfile, pattrib); set_qos(&pktfile, pattrib);
} else { } else {
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (pattrib->direct_link == true) { if (pattrib->direct_link) {
if (pattrib->qos_en) if (pattrib->qos_en)
set_qos(&pktfile, pattrib); set_qos(&pktfile, pattrib);
} else } else
@ -1442,7 +1442,7 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe)
pframe = pxmitframe->buf_addr + hw_hdr_offset; pframe = pxmitframe->buf_addr + hw_hdr_offset;
if (bmcst) { if (bmcst) {
if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16) == true) { if (!memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16)) {
/* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */
/* rtw_msleep_os(10); */ /* rtw_msleep_os(10); */
return _FAIL; return _FAIL;
@ -1450,7 +1450,7 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe)
/* start to calculate the mic code */ /* start to calculate the mic code */
rtw_secmicsetkey(&micdata, psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey); rtw_secmicsetkey(&micdata, psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey);
} else { } else {
if (_rtw_memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16) == true) { if (!memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16)) {
/* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */
/* rtw_msleep_os(10); */ /* rtw_msleep_os(10); */
return _FAIL; return _FAIL;
@ -1589,9 +1589,9 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
set_frame_sub_type(fctrl, pattrib->subtype); set_frame_sub_type(fctrl, pattrib->subtype);
if (pattrib->subtype & WIFI_DATA_TYPE) { if (pattrib->subtype & WIFI_DATA_TYPE) {
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)) { if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE))) {
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (pattrib->direct_link == true) { if (pattrib->direct_link) {
/* TDLS data transfer, ToDS=0, FrDs=0 */ /* TDLS data transfer, ToDS=0, FrDs=0 */
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
@ -1613,7 +1613,7 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
if (pqospriv->qos_option) if (pqospriv->qos_option)
qos_option = true; qos_option = true;
} }
} else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)) { } else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE))) {
/* to_ds = 0, fr_ds = 1; */ /* to_ds = 0, fr_ds = 1; */
SetFrDs(fctrl); SetFrDs(fctrl);
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
@ -1622,8 +1622,8 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
if (pattrib->qos_en) if (pattrib->qos_en)
qos_option = true; qos_option = true;
} else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || } else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
@ -1684,7 +1684,7 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
SetSeqNum(hdr, pattrib->seqnum); SetSeqNum(hdr, pattrib->seqnum);
/* re-check if enable ampdu by BA_starting_seqctrl */ /* re-check if enable ampdu by BA_starting_seqctrl */
if (pattrib->ampdu_en == true) { if (pattrib->ampdu_en) {
u16 tx_seq; u16 tx_seq;
tx_seq = psta->BA_starting_seqctrl[pattrib->priority & 0x0f]; tx_seq = psta->BA_starting_seqctrl[pattrib->priority & 0x0f];
@ -2414,7 +2414,7 @@ s32 rtw_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame *pxm
frg_inx++; frg_inx++;
if (bmcst || (rtw_endofpktfile(&pktfile) == true)) { if (bmcst || (rtw_endofpktfile(&pktfile))) {
pattrib->nr_frags = frg_inx; pattrib->nr_frags = frg_inx;
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) + pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + ((pattrib->nr_frags == 1) ? llc_sz : 0) +
@ -2812,7 +2812,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
_enter_critical(&pfree_queue->lock, &irqL); _enter_critical(&pfree_queue->lock, &irqL);
if (_rtw_queue_empty(pfree_queue) == true) if (_rtw_queue_empty(pfree_queue))
pxmitbuf = NULL; pxmitbuf = NULL;
else { else {
@ -2879,7 +2879,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
_enter_critical(&pfree_xmitbuf_queue->lock, &irqL); _enter_critical(&pfree_xmitbuf_queue->lock, &irqL);
if (_rtw_queue_empty(pfree_xmitbuf_queue) == true) if (_rtw_queue_empty(pfree_xmitbuf_queue))
pxmitbuf = NULL; pxmitbuf = NULL;
else { else {
@ -3007,7 +3007,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* (_queue *p
_enter_critical_bh(&pfree_xmit_queue->lock, &irqL); _enter_critical_bh(&pfree_xmit_queue->lock, &irqL);
if (_rtw_queue_empty(pfree_xmit_queue) == true) { if (_rtw_queue_empty(pfree_xmit_queue)) {
pxframe = NULL; pxframe = NULL;
} else { } else {
phead = get_list_head(pfree_xmit_queue); phead = get_list_head(pfree_xmit_queue);
@ -3036,7 +3036,7 @@ struct xmit_frame *rtw_alloc_xmitframe_ext(struct xmit_priv *pxmitpriv)
_enter_critical_bh(&queue->lock, &irqL); _enter_critical_bh(&queue->lock, &irqL);
if (_rtw_queue_empty(queue) == true) { if (_rtw_queue_empty(queue)) {
pxframe = NULL; pxframe = NULL;
} else { } else {
phead = get_list_head(queue); phead = get_list_head(queue);
@ -3524,7 +3524,7 @@ static int rtw_br_client_tx(_adapter *padapter, struct sk_buff **pskb)
struct sk_buff *skb = *pskb; struct sk_buff *skb = *pskb;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
unsigned long irqL; unsigned long irqL;
/* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) */ /* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) */
{ {
int res, is_vlan_tag = 0, i, do_nat25 = 1; int res, is_vlan_tag = 0, i, do_nat25 = 1;
unsigned short vlan_hdr = 0; unsigned short vlan_hdr = 0;
@ -3722,7 +3722,7 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib)
qsel = pattrib->priority; qsel = pattrib->priority;
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
/* if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) /* if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
* qsel = 7; */ * qsel = 7; */
#endif #endif
@ -3944,7 +3944,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt)
rcu_read_unlock(); rcu_read_unlock();
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ #endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (br_port && check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) == true) { if (br_port && check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE)) {
res = rtw_br_client_tx(padapter, ppkt); res = rtw_br_client_tx(padapter, ppkt);
if (res == -1) { if (res == -1) {
rtw_free_xmitframe(pxmitpriv, pxmitframe); rtw_free_xmitframe(pxmitpriv, pxmitframe);
@ -3986,7 +3986,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt)
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
_enter_critical_bh(&pxmitpriv->lock, &irqL0); _enter_critical_bh(&pxmitpriv->lock, &irqL0);
if (xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe) == true) { if (xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe)) {
_exit_critical_bh(&pxmitpriv->lock, &irqL0); _exit_critical_bh(&pxmitpriv->lock, &irqL0);
DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue); DBG_COUNTER(padapter->tx_logs.core_tx_ap_enqueue);
return 1; return 1;
@ -4124,7 +4124,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
bool update_tim = false; bool update_tim = false;
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (padapter->tdlsinfo.link_established == true) if (padapter->tdlsinfo.link_established)
ret = xmitframe_enqueue_for_tdls_sleeping_sta(padapter, pxmitframe); ret = xmitframe_enqueue_for_tdls_sleeping_sta(padapter, pxmitframe);
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
@ -4167,7 +4167,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
/* RTW_INFO("directly xmit pspoll_triggered packet\n"); */ /* RTW_INFO("directly xmit pspoll_triggered packet\n"); */
/* pattrib->triggered=0; */ /* pattrib->triggered=0; */
if (bmcst && xmitframe_hiq_filter(pxmitframe) == true) if (bmcst && xmitframe_hiq_filter(pxmitframe))
pattrib->qsel = QSLT_HIGH;/* HIQ */ pattrib->qsel = QSLT_HIGH;/* HIQ */
return ret; return ret;
@ -4194,7 +4194,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
pstapriv->sta_dz_bitmap |= BIT(0); pstapriv->sta_dz_bitmap |= BIT(0);
/* RTW_INFO("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ /* RTW_INFO("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */
if (update_tim == true) { if (update_tim) {
if (is_broadcast_mac_addr(pattrib->ra)) if (is_broadcast_mac_addr(pattrib->ra))
_update_beacon(padapter, _TIM_IE_, NULL, true, "buffer BC"); _update_beacon(padapter, _TIM_IE_, NULL, true, "buffer BC");
else else
@ -4261,7 +4261,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
/* RTW_INFO("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */ /* RTW_INFO("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */
if (update_tim == true) { if (update_tim) {
/* RTW_INFO("sleepq_len==1, update BCNTIM\n"); */ /* RTW_INFO("sleepq_len==1, update BCNTIM\n"); */
/* upate BCN for TIM IE */ /* upate BCN for TIM IE */
_update_beacon(padapter, _TIM_IE_, NULL, true, "buffer UC"); _update_beacon(padapter, _TIM_IE_, NULL, true, "buffer UC");
@ -4312,7 +4312,7 @@ static void dequeue_xmitframes_to_sleeping_queue(_adapter *padapter, struct sta_
ret = xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe); ret = xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe);
if (true == ret) { if (ret) {
ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index)); ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index));
ptxservq->qcnt--; ptxservq->qcnt--;
@ -4441,7 +4441,7 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta)
/* /*
_exit_critical_bh(&psta->sleep_q.lock, &irqL); _exit_critical_bh(&psta->sleep_q.lock, &irqL);
if(rtw_hal_xmit(padapter, pxmitframe) == true) if(rtw_hal_xmit(padapter, pxmitframe))
{ {
rtw_os_xmit_complete(padapter, pxmitframe); rtw_os_xmit_complete(padapter, pxmitframe);
} }
@ -4507,7 +4507,7 @@ void wakeup_sta_to_xmit(_adapter *padapter, struct sta_info *psta)
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
/* /*
_exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL); _exit_critical_bh(&psta_bmc->sleep_q.lock, &irqL);
if(rtw_hal_xmit(padapter, pxmitframe) == true) if(rtw_hal_xmit(padapter, pxmitframe))
{ {
rtw_os_xmit_complete(padapter, pxmitframe); rtw_os_xmit_complete(padapter, pxmitframe);
} }
@ -4781,7 +4781,7 @@ struct xmit_buf *select_and_dequeue_pending_xmitbuf(_adapter *padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct xmit_buf *pxmitbuf = NULL; struct xmit_buf *pxmitbuf = NULL;
if (rtw_xmit_ac_blocked(padapter) == true) if (rtw_xmit_ac_blocked(padapter))
pxmitbuf = dequeue_pending_xmitbuf_under_survey(pxmitpriv); pxmitbuf = dequeue_pending_xmitbuf_under_survey(pxmitpriv);
else { else {
pxmitbuf = dequeue_pending_xmitbuf_ext(pxmitpriv); pxmitbuf = dequeue_pending_xmitbuf_ext(pxmitpriv);

View file

@ -503,12 +503,12 @@ static u32 _halbtcoutsrc_GetWifiLinkStatus(PADAPTER padapter)
if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE) == true) {
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
if (true == bp2p) if (bp2p)
portConnectedStatus |= WIFI_P2P_GO_CONNECTED; portConnectedStatus |= WIFI_P2P_GO_CONNECTED;
else else
portConnectedStatus |= WIFI_AP_CONNECTED; portConnectedStatus |= WIFI_AP_CONNECTED;
} else { } else {
if (true == bp2p) if (bp2p)
portConnectedStatus |= WIFI_P2P_GC_CONNECTED; portConnectedStatus |= WIFI_P2P_GC_CONNECTED;
else else
portConnectedStatus |= WIFI_STA_CONNECTED; portConnectedStatus |= WIFI_STA_CONNECTED;
@ -1234,7 +1234,7 @@ u8 halbtcoutsrc_UnderIps(PBTC_COEXIST pBtCoexist)
pwrpriv = &padapter->dvobj->pwrctl_priv; pwrpriv = &padapter->dvobj->pwrctl_priv;
bMacPwrCtrlOn = false; bMacPwrCtrlOn = false;
if ((true == pwrpriv->bips_processing) if ((pwrpriv->bips_processing)
&& (IPS_NONE != pwrpriv->ips_mode_req) && (IPS_NONE != pwrpriv->ips_mode_req)
) )
return true; return true;

View file

@ -1772,7 +1772,7 @@ s32 rtw_hal_customer_str_write(_adapter *adapter, const u8 *cs)
_enter_critical_mutex(&dvobj->customer_str_mutex, NULL); _enter_critical_mutex(&dvobj->customer_str_mutex, NULL);
dvobj->customer_str_sctx = NULL; dvobj->customer_str_sctx = NULL;
if (sctx.status == RTW_SCTX_DONE_SUCCESS) { if (sctx.status == RTW_SCTX_DONE_SUCCESS) {
if (_rtw_memcmp(cs, dvobj->customer_str, RTW_CUSTOMER_STR_LEN) != true) { if (memcmp(cs, dvobj->customer_str, RTW_CUSTOMER_STR_LEN)) {
RTW_WARN("%s read back check fail\n", __func__); RTW_WARN("%s read back check fail\n", __func__);
RTW_INFO_DUMP("write req: ", cs, RTW_CUSTOMER_STR_LEN); RTW_INFO_DUMP("write req: ", cs, RTW_CUSTOMER_STR_LEN);
RTW_INFO_DUMP("read back: ", dvobj->customer_str, RTW_CUSTOMER_STR_LEN); RTW_INFO_DUMP("read back: ", dvobj->customer_str, RTW_CUSTOMER_STR_LEN);
@ -2084,7 +2084,7 @@ static u8 _rtw_mbid_cam_search_by_macaddr(_adapter *adapter, u8 *mac_addr)
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
for (i = 0; i < TOTAL_MBID_CAM_NUM; i++) { for (i = 0; i < TOTAL_MBID_CAM_NUM; i++) {
if (mac_addr && _rtw_memcmp(dvobj->mbid_cam_cache[i].mac_addr, mac_addr, ETH_ALEN) == true) { if (mac_addr && !memcmp(dvobj->mbid_cam_cache[i].mac_addr, mac_addr, ETH_ALEN) == true) {
cam_id = i; cam_id = i;
break; break;
} }
@ -3248,7 +3248,7 @@ static u8 rtw_hal_pause_rx_dma(_adapter *adapter)
do { do {
if ((rtw_read32(adapter, REG_RXPKT_NUM) & RXDMA_IDLE)) { if ((rtw_read32(adapter, REG_RXPKT_NUM) & RXDMA_IDLE)) {
/* stop interface before leave */ /* stop interface before leave */
if (true == hal->usb_intf_start) { if (hal->usb_intf_start) {
rtw_intf_stop(adapter); rtw_intf_stop(adapter);
RTW_ENABLE_FUNC(adapter, DF_RX_BIT); RTW_ENABLE_FUNC(adapter, DF_RX_BIT);
RTW_ENABLE_FUNC(adapter, DF_TX_BIT); RTW_ENABLE_FUNC(adapter, DF_TX_BIT);
@ -3807,7 +3807,7 @@ static u8 rtw_hal_set_remote_wake_ctrl_cmd(_adapter *adapter, u8 enable)
#endif #endif
#ifdef CONFIG_P2P_WOWLAN #ifdef CONFIG_P2P_WOWLAN
if (true == ppwrpriv->wowlan_p2p_mode) { if (ppwrpriv->wowlan_p2p_mode) {
RTW_INFO("P2P OFFLOAD ENABLE\n"); RTW_INFO("P2P OFFLOAD ENABLE\n");
SET_H2CCMD_REMOTE_WAKE_CTRL_P2P_OFFLAD_EN(u1H2CRemoteWakeCtrlParm, 1); SET_H2CCMD_REMOTE_WAKE_CTRL_P2P_OFFLAD_EN(u1H2CRemoteWakeCtrlParm, 1);
} else { } else {
@ -4575,7 +4575,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
/* Commented by Kurt */ /* Commented by Kurt */
/* Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. */ /* Appended WiDi info. only if we did issued_probereq_widi(), and then we saved ven. ext. in pmlmepriv->sa_ext. */
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false if (!memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false
|| pmlmepriv->num_p2p_sdt != 0) { || pmlmepriv->num_p2p_sdt != 0) {
/* Sec dev type */ /* Sec dev type */
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_SEC_DEV_TYPE_LIST); *(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_ATTR_SEC_DEV_TYPE_LIST);
@ -4597,7 +4597,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p
*(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_PDT_SCID_WIDI_CONSUMER_SINK); *(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_PDT_SCID_WIDI_CONSUMER_SINK);
wpsielen += 2; wpsielen += 2;
if (_rtw_memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false) { if (!memcmp(pmlmepriv->sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN) == false) {
/* Vendor Extension */ /* Vendor Extension */
_rtw_memcpy(wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN); _rtw_memcpy(wpsie + wpsielen, pmlmepriv->sa_ext, L2SDTA_SERVICE_VE_LEN);
wpsielen += L2SDTA_SERVICE_VE_LEN; wpsielen += L2SDTA_SERVICE_VE_LEN;
@ -5697,9 +5697,9 @@ static void rtw_hal_append_tkip_mic(PADAPTER padapter,
psta = rtw_get_stainfo(&padapter->stapriv, psta = rtw_get_stainfo(&padapter->stapriv,
get_my_bssid(&(pmlmeinfo->network))); get_my_bssid(&(pmlmeinfo->network)));
if (psta != NULL) { if (psta != NULL) {
res = _rtw_memcmp(&psta->dot11tkiptxmickey.skey[0], res = !memcmp(&psta->dot11tkiptxmickey.skey[0],
null_key, 16); null_key, 16);
if (res == true) if (res)
RTW_INFO("%s(): STA dot11tkiptxmickey==0\n", __func__); RTW_INFO("%s(): STA dot11tkiptxmickey==0\n", __func__);
rtw_secmicsetkey(&micdata, &psta->dot11tkiptxmickey.skey[0]); rtw_secmicsetkey(&micdata, &psta->dot11tkiptxmickey.skey[0]);
} }
@ -7911,7 +7911,7 @@ void rtw_hal_set_fw_rsvd_page(_adapter *adapter, bool finished)
#endif /* CONFIG_WOWLAN */ #endif /* CONFIG_WOWLAN */
#ifdef CONFIG_P2P_WOWLAN #ifdef CONFIG_P2P_WOWLAN
if (true == pwrctl->wowlan_p2p_mode) { if (pwrctl->wowlan_p2p_mode) {
rtw_hal_set_p2p_wow_fw_rsvd_page(adapter, ReservedPagePacket, rtw_hal_set_p2p_wow_fw_rsvd_page(adapter, ReservedPagePacket,
BufIndex, TxDescLen, PageSize, BufIndex, TxDescLen, PageSize,
&TotalPageNum, &TotalPacketLen, &RsvdPageLoc); &TotalPageNum, &TotalPacketLen, &RsvdPageLoc);
@ -7985,7 +7985,7 @@ download_page:
#endif /* CONFIG_PNO_SUPPORT */ #endif /* CONFIG_PNO_SUPPORT */
} }
#ifdef CONFIG_P2P_WOWLAN #ifdef CONFIG_P2P_WOWLAN
if (true == pwrctl->wowlan_p2p_mode) if (pwrctl->wowlan_p2p_mode)
rtw_hal_set_FwP2PRsvdPage_cmd(adapter, &RsvdPageLoc); rtw_hal_set_FwP2PRsvdPage_cmd(adapter, &RsvdPageLoc);
#endif /* CONFIG_P2P_WOWLAN */ #endif /* CONFIG_P2P_WOWLAN */
return; return;
@ -9019,9 +9019,9 @@ void rtw_dump_rx_dframe_info(_adapter *padapter, void *sel)
if (psta) { if (psta) {
psta_dframe_info = &psta->sta_dframe_info; psta_dframe_info = &psta->sta_dframe_info;
if ((_rtw_memcmp(psta->hwaddr, bc_addr, 6) != true) if ((memcmp(psta->hwaddr, bc_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, null_addr, 6) != true) && (memcmp(psta->hwaddr, null_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, adapter_mac_addr(padapter), 6) != true)) { && (memcmp(psta->hwaddr, adapter_mac_addr(padapter), 6))) {
isCCKrate = (psta_dframe_info->sta_data_rate <= DESC_RATE11M) ? true : false; isCCKrate = (psta_dframe_info->sta_data_rate <= DESC_RATE11M) ? true : false;
@ -9114,7 +9114,7 @@ void rtw_store_phy_info(_adapter *padapter, union recv_frame *prframe)
if (psta) { if (psta) {
psta_dframe_info = &psta->sta_dframe_info; psta_dframe_info = &psta->sta_dframe_info;
/*RTW_INFO("=>%s psta->hwaddr="MAC_FMT" !\n", __func__, MAC_ARG(psta->hwaddr));*/ /*RTW_INFO("=>%s psta->hwaddr="MAC_FMT" !\n", __func__, MAC_ARG(psta->hwaddr));*/
if ((_rtw_memcmp(psta->hwaddr, bc_addr, ETH_ALEN) != true) || (padapter->registrypriv.mp_mode == 1)) { if ((memcmp(psta->hwaddr, bc_addr, ETH_ALEN)) || (padapter->registrypriv.mp_mode == 1)) {
psta_dframe_info->sta_data_rate = pattrib->data_rate; psta_dframe_info->sta_data_rate = pattrib->data_rate;
psta_dframe_info->sta_sgi = pattrib->sgi; psta_dframe_info->sta_sgi = pattrib->sgi;
psta_dframe_info->sta_bw_mode = pattrib->bw; psta_dframe_info->sta_bw_mode = pattrib->bw;
@ -10099,7 +10099,7 @@ void update_IOT_info(_adapter *padapter)
#ifdef CONFIG_AUTO_CHNL_SEL_NHM #ifdef CONFIG_AUTO_CHNL_SEL_NHM
void rtw_acs_start(_adapter *padapter, bool bStart) void rtw_acs_start(_adapter *padapter, bool bStart)
{ {
if (true == bStart) { if (bStart) {
ACS_OP acs_op = ACS_INIT; ACS_OP acs_op = ACS_INIT;
rtw_hal_set_odm_var(padapter, HAL_ODM_AUTO_CHNL_SEL, &acs_op, true); rtw_hal_set_odm_var(padapter, HAL_ODM_AUTO_CHNL_SEL, &acs_op, true);
@ -10513,37 +10513,37 @@ static void rtw_dump_phy_cap_by_hal(void *sel, _adapter *adapter)
/* STBC */ /* STBC */
rtw_hal_get_def_var(adapter, HAL_DEF_TX_STBC, (u8 *)&phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_TX_STBC, (u8 *)&phy_cap);
RTW_PRINT_SEL(sel, "[HAL] STBC Tx : %s\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] STBC Tx : %s\n", (phy_cap) ? "Supported" : "N/A");
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_RX_STBC, (u8 *)&phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_RX_STBC, (u8 *)&phy_cap);
RTW_PRINT_SEL(sel, "[HAL] STBC Rx : %s\n\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] STBC Rx : %s\n\n", (phy_cap) ? "Supported" : "N/A");
/* LDPC support */ /* LDPC support */
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_TX_LDPC, (u8 *)&phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_TX_LDPC, (u8 *)&phy_cap);
RTW_PRINT_SEL(sel, "[HAL] LDPC Tx : %s\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] LDPC Tx : %s\n", (phy_cap) ? "Supported" : "N/A");
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_RX_LDPC, (u8 *)&phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_RX_LDPC, (u8 *)&phy_cap);
RTW_PRINT_SEL(sel, "[HAL] LDPC Rx : %s\n\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] LDPC Rx : %s\n\n", (phy_cap) ? "Supported" : "N/A");
#ifdef CONFIG_BEAMFORMING #ifdef CONFIG_BEAMFORMING
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&phy_cap);
RTW_PRINT_SEL(sel, "[HAL] Beamformer: %s\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] Beamformer: %s\n", (phy_cap) ? "Supported" : "N/A");
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&phy_cap);
RTW_PRINT_SEL(sel, "[HAL] Beamformee: %s\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] Beamformee: %s\n", (phy_cap) ? "Supported" : "N/A");
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_VHT_MU_BEAMFORMER, &phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_VHT_MU_BEAMFORMER, &phy_cap);
RTW_PRINT_SEL(sel, "[HAL] VHT MU Beamformer: %s\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] VHT MU Beamformer: %s\n", (phy_cap) ? "Supported" : "N/A");
phy_cap = false; phy_cap = false;
rtw_hal_get_def_var(adapter, HAL_DEF_VHT_MU_BEAMFORMEE, &phy_cap); rtw_hal_get_def_var(adapter, HAL_DEF_VHT_MU_BEAMFORMEE, &phy_cap);
RTW_PRINT_SEL(sel, "[HAL] VHT MU Beamformee: %s\n", (true == phy_cap) ? "Supported" : "N/A"); RTW_PRINT_SEL(sel, "[HAL] VHT MU Beamformee: %s\n", (phy_cap) ? "Supported" : "N/A");
#endif #endif
} }
#endif #endif

View file

@ -216,7 +216,7 @@ s32 odm_compare_memory(
u32 length u32 length
) )
{ {
return _rtw_memcmp(p_buf1, p_buf2, length); return !memcmp(p_buf1, p_buf2, length);
} }
/* /*

View file

@ -1599,7 +1599,7 @@ odm_refresh_rate_adaptive_mask_ce(
/**/ /**/
} }
#else #else
if (true == odm_ra_state_check(p_dm_odm, p_entry->rssi_stat.undecorated_smoothed_pwdb, false, &p_entry->rssi_level)) { if (odm_ra_state_check(p_dm_odm, p_entry->rssi_stat.undecorated_smoothed_pwdb, false, &p_entry->rssi_level)) {
ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", p_entry->rssi_stat.undecorated_smoothed_pwdb, p_entry->rssi_level)); ODM_RT_TRACE(p_dm_odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", p_entry->rssi_stat.undecorated_smoothed_pwdb, p_entry->rssi_level));
/* printk("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.undecorated_smoothed_pwdb, pstat->rssi_level); */ /* printk("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.undecorated_smoothed_pwdb, pstat->rssi_level); */
rtw_hal_update_ra_mask(p_entry, p_entry->rssi_level, false); rtw_hal_update_ra_mask(p_entry, p_entry->rssi_level, false);

View file

@ -79,7 +79,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter)
if (tmp1byte & HAL_8188E_HW_GPIO_WPS_BIT) if (tmp1byte & HAL_8188E_HW_GPIO_WPS_BIT)
bPbcPressed = true; bPbcPressed = true;
if (true == bPbcPressed) { if (bPbcPressed) {
/* Here we only set bPbcPressed to true */ /* Here we only set bPbcPressed to true */
/* After trigger PBC, the variable will be set to false */ /* After trigger PBC, the variable will be set to false */
RTW_INFO("CheckPbcGPIO - PBC is pressed\n"); RTW_INFO("CheckPbcGPIO - PBC is pressed\n");

View file

@ -1335,7 +1335,7 @@ ReadEFuseByIC(
exit: exit:
#ifdef DBG_IOL_READ_EFUSE_MAP #ifdef DBG_IOL_READ_EFUSE_MAP
if (_rtw_memcmp(logical_map, pHalData->efuse_eeprom_data, 0x130) == false) { if (!memcmp(logical_map, pHalData->efuse_eeprom_data, 0x130) == false) {
int i; int i;
RTW_INFO("%s compare first 0x130 byte fail\n", __func__); RTW_INFO("%s compare first 0x130 byte fail\n", __func__);
for (i = 0; i < 512; i++) { for (i = 0; i < 512; i++) {

View file

@ -105,7 +105,7 @@ void rtl8188e_fill_fake_txdesc(
ptxdesc->txdw3 |= cpu_to_le32((8 << 28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */ ptxdesc->txdw3 |= cpu_to_le32((8 << 28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */
} }
if (true == IsBTQosNull) { if (IsBTQosNull) {
ptxdesc->txdw2 |= cpu_to_le32(BIT(23)); /* BT NULL */ ptxdesc->txdw2 |= cpu_to_le32(BIT(23)); /* BT NULL */
} }
@ -115,7 +115,7 @@ void rtl8188e_fill_fake_txdesc(
/* */ /* */
/* Encrypt the data frame if under security mode excepct null data. Suggested by CCW. */ /* Encrypt the data frame if under security mode excepct null data. Suggested by CCW. */
/* */ /* */
if (true == bDataFrame) { if (bDataFrame) {
u32 EncAlg; u32 EncAlg;
EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm; EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm;

View file

@ -375,7 +375,7 @@ static int rtw_cfg80211_clear_wps_sr_of_non_target_bss(_adapter *padapter, struc
u8 *wpsie = NULL; u8 *wpsie = NULL;
if (pssid->SsidLength == req_ssid->ssid_len if (pssid->SsidLength == req_ssid->ssid_len
&& _rtw_memcmp(pssid->Ssid, req_ssid->ssid, req_ssid->ssid_len) == true) && !memcmp(pssid->Ssid, req_ssid->ssid, req_ssid->ssid_len) )
goto exit; goto exit;
wpsie = rtw_get_wps_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_ wpsie = rtw_get_wps_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_
@ -461,7 +461,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net
notify_ielen = pnetwork->network.IELength - _FIXED_IE_LENGTH_; notify_ielen = pnetwork->network.IELength - _FIXED_IE_LENGTH_;
/* We've set wiphy's signal_type as CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm) */ /* We've set wiphy's signal_type as CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm) */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) {
notify_signal = 100 * translate_percentage_to_dbm(padapter->recvpriv.signal_strength); /* dbm */ notify_signal = 100 * translate_percentage_to_dbm(padapter->recvpriv.signal_strength); /* dbm */
} else { } else {
@ -598,7 +598,7 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter)
WLAN_BSSID_EX *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network); WLAN_BSSID_EX *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network);
struct wlan_network *scanned = pmlmepriv->cur_network_scanned; struct wlan_network *scanned = pmlmepriv->cur_network_scanned;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ) {
_rtw_memcpy(&cur_network->network, pnetwork, sizeof(WLAN_BSSID_EX)); _rtw_memcpy(&cur_network->network, pnetwork, sizeof(WLAN_BSSID_EX));
if (cur_network) { if (cur_network) {
@ -614,8 +614,8 @@ void rtw_cfg80211_ibss_indicate_connect(_adapter *padapter)
if (scanned == NULL) if (scanned == NULL)
rtw_warn_on(1); rtw_warn_on(1);
if (_rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true if (!memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID))
&& _rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == true && !memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS))
) { ) {
if (!rtw_cfg80211_inform_bss(padapter, scanned)) if (!rtw_cfg80211_inform_bss(padapter, scanned))
RTW_INFO(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter));
@ -658,7 +658,7 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
) )
return; return;
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE) )
return; return;
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
@ -685,8 +685,8 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
goto check_bss; goto check_bss;
} }
if (_rtw_memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS)) == true if (!memcmp(scanned->network.MacAddress, pnetwork->MacAddress, sizeof(NDIS_802_11_MAC_ADDRESS))
&& _rtw_memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID)) == true && !memcmp(&(scanned->network.Ssid), &(pnetwork->Ssid), sizeof(NDIS_802_11_SSID))
) { ) {
if (!rtw_cfg80211_inform_bss(padapter, scanned)) if (!rtw_cfg80211_inform_bss(padapter, scanned))
RTW_INFO(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" inform fail !!\n", FUNC_ADPT_ARG(padapter));
@ -786,7 +786,7 @@ void rtw_cfg80211_indicate_disconnect(_adapter *padapter, u16 reason, u8 locally
) )
return; return;
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE) )
return; return;
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
@ -1192,7 +1192,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
/* RTW_INFO("%s, : dot11AuthAlgrthm == dot11AuthAlgrthm_8021X\n", __func__); */ /* RTW_INFO("%s, : dot11AuthAlgrthm == dot11AuthAlgrthm_8021X\n", __func__); */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) == true) { /* sta mode */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) ) { /* sta mode */
#ifdef CONFIG_RTW_80211R #ifdef CONFIG_RTW_80211R
if ((rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED)) if ((rtw_to_roam(padapter) > 0) && rtw_chk_ft_flags(padapter, RTW_FT_SUPPORTED))
psta = rtw_get_stainfo(pstapriv, pmlmepriv->assoc_bssid); psta = rtw_get_stainfo(pstapriv, pmlmepriv->assoc_bssid);
@ -1303,7 +1303,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
if (param->u.crypt.set_tx == 1) { if (param->u.crypt.set_tx == 1) {
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if (_rtw_memcmp(pWapiSta->PeerMacAddr, param->sta_addr, 6)) { if (!memcmp(pWapiSta->PeerMacAddr, param->sta_addr, 6)) {
_rtw_memcpy(pWapiSta->lastTxUnicastPN, WapiASUEPNInitialValueSrc, 16); _rtw_memcpy(pWapiSta->lastTxUnicastPN, WapiASUEPNInitialValueSrc, 16);
pWapiSta->wapiUsk.bSet = true; pWapiSta->wapiUsk.bSet = true;
@ -1328,7 +1328,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
} }
} else { } else {
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if (_rtw_memcmp(pWapiSta->PeerMacAddr, get_bssid(pmlmepriv), 6)) { if (!memcmp(pWapiSta->PeerMacAddr, get_bssid(pmlmepriv), 6)) {
pWapiSta->wapiMsk.bSet = true; pWapiSta->wapiMsk.bSet = true;
_rtw_memcpy(pWapiSta->wapiMsk.dataKey, param->u.crypt.key, 16); _rtw_memcpy(pWapiSta->wapiMsk.dataKey, param->u.crypt.key, 16);
_rtw_memcpy(pWapiSta->wapiMsk.micKey, param->u.crypt.key + 16, 16); _rtw_memcpy(pWapiSta->wapiMsk.micKey, param->u.crypt.key + 16, 16);
@ -1460,7 +1460,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
_rtw_memcpy(param->u.crypt.key, (u8 *)params->key, params->key_len); _rtw_memcpy(param->u.crypt.key, (u8 *)params->key, params->key_len);
} }
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) ) {
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
if (rtw_tdls_is_driver_setup(padapter) == false && mac_addr) { if (rtw_tdls_is_driver_setup(padapter) == false && mac_addr) {
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, (void *)mac_addr); ptdls_sta = rtw_get_stainfo(&padapter->stapriv, (void *)mac_addr);
@ -1473,15 +1473,15 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
ret = rtw_cfg80211_set_encryption(ndev, param, param_len); ret = rtw_cfg80211_set_encryption(ndev, param, param_len);
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) ) {
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
if (mac_addr) if (mac_addr)
_rtw_memcpy(param->sta_addr, (void *)mac_addr, ETH_ALEN); _rtw_memcpy(param->sta_addr, (void *)mac_addr, ETH_ALEN);
ret = rtw_cfg80211_ap_set_encryption(ndev, param, param_len); ret = rtw_cfg80211_ap_set_encryption(ndev, param, param_len);
#endif #endif
} else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)
|| check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)
) { ) {
/* RTW_INFO("@@@@@@@@@@ fw_state=0x%x, iftype=%d\n", pmlmepriv->fw_state, rtw_wdev->iftype); */ /* RTW_INFO("@@@@@@@@@@ fw_state=0x%x, iftype=%d\n", pmlmepriv->fw_state, rtw_wdev->iftype); */
ret = rtw_cfg80211_set_encryption(ndev, param, param_len); ret = rtw_cfg80211_set_encryption(ndev, param, param_len);
@ -1651,7 +1651,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
) { ) {
struct wlan_network *cur_network = &(pmlmepriv->cur_network); struct wlan_network *cur_network = &(pmlmepriv->cur_network);
if (_rtw_memcmp((u8 *)mac, cur_network->network.MacAddress, ETH_ALEN) == false) { if (!memcmp((u8 *)mac, cur_network->network.MacAddress, ETH_ALEN) == false) {
RTW_INFO("%s, mismatch bssid="MAC_FMT"\n", __func__, MAC_ARG(cur_network->network.MacAddress)); RTW_INFO("%s, mismatch bssid="MAC_FMT"\n", __func__, MAC_ARG(cur_network->network.MacAddress));
ret = -ENOENT; ret = -ENOENT;
goto exit; goto exit;
@ -1712,7 +1712,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
RTW_INFO(FUNC_NDEV_FMT" type=%d, hw_port:%d\n", FUNC_NDEV_ARG(ndev), type, padapter->hw_port); RTW_INFO(FUNC_NDEV_FMT" type=%d, hw_port:%d\n", FUNC_NDEV_ARG(ndev), type, padapter->hw_port);
if (adapter_to_dvobj(padapter)->processing_dev_remove == true) { if (adapter_to_dvobj(padapter)->processing_dev_remove ) {
ret = -EPERM; ret = -EPERM;
goto exit; goto exit;
} }
@ -1771,7 +1771,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (change && pwdinfo->driver_interface == DRIVER_CFG80211) { if (change && pwdinfo->driver_interface == DRIVER_CFG80211) {
if (is_p2p == true) if (is_p2p )
rtw_p2p_enable(padapter, P2P_ROLE_CLIENT); rtw_p2p_enable(padapter, P2P_ROLE_CLIENT);
#if !RTW_P2P_GROUP_INTERFACE #if !RTW_P2P_GROUP_INTERFACE
else if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT) else if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_CLIENT)
@ -1795,7 +1795,7 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (change && pwdinfo->driver_interface == DRIVER_CFG80211) { if (change && pwdinfo->driver_interface == DRIVER_CFG80211) {
if (is_p2p == true) if (is_p2p )
rtw_p2p_enable(padapter, P2P_ROLE_GO); rtw_p2p_enable(padapter, P2P_ROLE_GO);
#if !RTW_P2P_GROUP_INTERFACE #if !RTW_P2P_GROUP_INTERFACE
else if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { else if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {
@ -1983,15 +1983,15 @@ static void _rtw_cfg80211_surveydone_event_callback(_adapter *padapter, struct c
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
/* report network only if the current channel set contains the channel to which this network belongs */ /* report network only if the current channel set contains the channel to which this network belongs */
if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0 if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0
&& rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig) == true && rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig)
&& true == rtw_validate_ssid(&(pnetwork->network.Ssid)) && rtw_validate_ssid(&(pnetwork->network.Ssid))
) { ) {
if (target_wps_scan) if (target_wps_scan)
rtw_cfg80211_clear_wps_sr_of_non_target_bss(padapter, pnetwork, &target_ssid); rtw_cfg80211_clear_wps_sr_of_non_target_bss(padapter, pnetwork, &target_ssid);
@ -2150,7 +2150,7 @@ u8 rtw_cfg80211_scan_via_buddy(_adapter *padapter, struct cfg80211_scan_request
_exit_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL); _exit_critical_bh(&buddy_wdev_priv->scan_req_lock, &irqL);
_exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); _exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL);
if (ret == true) if (ret )
goto exit; goto exit;
} }
@ -2181,14 +2181,14 @@ void rtw_cfg80211_indicate_scan_done_for_buddy(_adapter *padapter, bool bscan_ab
indicate_buddy_scan = false; indicate_buddy_scan = false;
_enter_critical_bh(&wdev_priv->scan_req_lock, &irqL); _enter_critical_bh(&wdev_priv->scan_req_lock, &irqL);
if (wdev_priv->scan_request && mlmepriv->scanning_via_buddy_intf == true) { if (wdev_priv->scan_request && mlmepriv->scanning_via_buddy_intf ) {
mlmepriv->scanning_via_buddy_intf = false; mlmepriv->scanning_via_buddy_intf = false;
clr_fwstate(mlmepriv, _FW_UNDER_SURVEY); clr_fwstate(mlmepriv, _FW_UNDER_SURVEY);
indicate_buddy_scan = true; indicate_buddy_scan = true;
} }
_exit_critical_bh(&wdev_priv->scan_req_lock, &irqL); _exit_critical_bh(&wdev_priv->scan_req_lock, &irqL);
if (indicate_buddy_scan == true) { if (indicate_buddy_scan ) {
rtw_cfg80211_surveydone_event_callback(iface); rtw_cfg80211_surveydone_event_callback(iface);
rtw_indicate_scan_done(iface, bscan_aborted); rtw_indicate_scan_done(iface, bscan_aborted);
} }
@ -2269,7 +2269,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
} }
#endif #endif
if (adapter_wdev_data(padapter)->block_scan == true) { if (adapter_wdev_data(padapter)->block_scan ) {
RTW_INFO(FUNC_ADPT_FMT" wdev_priv.block_scan is set\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" wdev_priv.block_scan is set\n", FUNC_ADPT_ARG(padapter));
need_indicate_scan_done = true; need_indicate_scan_done = true;
goto check_need_indicate_scan_done; goto check_need_indicate_scan_done;
@ -2285,7 +2285,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (pwdinfo->driver_interface == DRIVER_CFG80211) { if (pwdinfo->driver_interface == DRIVER_CFG80211) {
if (ssids->ssid != NULL if (ssids->ssid != NULL
&& _rtw_memcmp(ssids->ssid, "DIRECT-", 7) && !memcmp(ssids->ssid, "DIRECT-", 7)
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL) && rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
) { ) {
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
@ -2318,13 +2318,13 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
} }
/* check fw state*/ /* check fw state*/
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE) ) {
#ifdef CONFIG_DEBUG_CFG80211 #ifdef CONFIG_DEBUG_CFG80211
RTW_INFO(FUNC_ADPT_FMT" under WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter)); RTW_INFO(FUNC_ADPT_FMT" under WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter));
#endif #endif
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS | _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true) { if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS | _FW_UNDER_SURVEY | _FW_UNDER_LINKING) ) {
RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state); RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state);
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS))
@ -2335,11 +2335,11 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
} }
} }
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ) {
RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state); RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state);
need_indicate_scan_done = true; need_indicate_scan_done = true;
goto check_need_indicate_scan_done; goto check_need_indicate_scan_done;
} else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { } else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) ) {
RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state); RTW_INFO("%s, fwstate=0x%x\n", __func__, pmlmepriv->fw_state);
ret = -EBUSY; ret = -EBUSY;
goto check_need_indicate_scan_done; goto check_need_indicate_scan_done;
@ -2427,7 +2427,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
_exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL); _exit_critical_bh(&pwdev_priv->scan_req_lock, &irqL);
check_need_indicate_scan_done: check_need_indicate_scan_done:
if (true == need_indicate_scan_done) { if (need_indicate_scan_done) {
#if (KERNEL_VERSION(4, 7, 0) <= LINUX_VERSION_CODE) #if (KERNEL_VERSION(4, 7, 0) <= LINUX_VERSION_CODE)
struct cfg80211_scan_info info; struct cfg80211_scan_info info;
@ -2443,7 +2443,7 @@ check_need_indicate_scan_done:
} }
cancel_ps_deny: cancel_ps_deny:
if (ps_denied == true) if (ps_denied )
rtw_ps_deny_cancel(padapter, PS_DENY_SCAN); rtw_ps_deny_cancel(padapter, PS_DENY_SCAN);
exit: exit:
@ -2804,7 +2804,7 @@ static int rtw_cfg80211_set_wpa_ie(_adapter *padapter, u8 *pie, size_t ielen)
|| padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_
|| padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
/* WPS open need to enable multicast */ /* WPS open need to enable multicast */
/* || check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */ /* || check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) ) */
rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr); rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);
@ -2967,7 +2967,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
sme->privacy, sme->key, sme->key_len, sme->key_idx, sme->auth_type); sme->privacy, sme->key, sme->key_len, sme->key_idx, sme->auth_type);
if (adapter_wdev_data(padapter)->block == true) { if (adapter_wdev_data(padapter)->block ) {
ret = -EBUSY; ret = -EBUSY;
RTW_INFO("%s wdev_priv.block is set\n", __func__); RTW_INFO("%s wdev_priv.block is set\n", __func__);
goto exit; goto exit;
@ -3009,7 +3009,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
goto cancel_ps_deny; goto cancel_ps_deny;
} }
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) ) {
ret = -EBUSY; ret = -EBUSY;
RTW_INFO("%s, fw_state=0x%x, goto exit\n", __func__, pmlmepriv->fw_state); RTW_INFO("%s, fw_state=0x%x, goto exit\n", __func__, pmlmepriv->fw_state);
goto cancel_ps_deny; goto cancel_ps_deny;
@ -3284,7 +3284,7 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
RTW_INFO(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev) RTW_INFO(FUNC_NDEV_FMT" "MAC_FMT" "KEY_FMT"\n", FUNC_NDEV_ARG(ndev)
, MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid)); , MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid));
if (_rtw_memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN) == true) if (!memcmp((u8 *)pmksa->bssid, strZeroMacAddress, ETH_ALEN) )
return -EINVAL; return -EINVAL;
if (check_fwstate(mlme, _FW_LINKED) == false) { if (check_fwstate(mlme, _FW_LINKED) == false) {
@ -3296,7 +3296,7 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
/* overwrite PMKID */ /* overwrite PMKID */
for (index = 0 ; index < NUM_PMKID_CACHE; index++) { for (index = 0 ; index < NUM_PMKID_CACHE; index++) {
if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) == true) { if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) ) {
/* BSSID is matched, the same AP => rewrite with new PMKID. */ /* BSSID is matched, the same AP => rewrite with new PMKID. */
RTW_INFO(FUNC_NDEV_FMT" BSSID exists in the PMKList.\n", FUNC_NDEV_ARG(ndev)); RTW_INFO(FUNC_NDEV_FMT" BSSID exists in the PMKList.\n", FUNC_NDEV_ARG(ndev));
@ -3337,7 +3337,7 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy,
, MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid)); , MAC_ARG(pmksa->bssid), KEY_ARG(pmksa->pmkid));
for (index = 0 ; index < NUM_PMKID_CACHE; index++) { for (index = 0 ; index < NUM_PMKID_CACHE; index++) {
if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) == true) { if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) ) {
/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN); memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN);
memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN); memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN);
@ -3979,7 +3979,7 @@ static int rtw_add_beacon(_adapter *adapter, const u8 *head, size_t head_len, co
if (rtw_check_beacon_data(adapter, pbuf, len) == _SUCCESS) { if (rtw_check_beacon_data(adapter, pbuf, len) == _SUCCESS) {
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
/* check p2p if enable */ /* check p2p if enable */
if (got_p2p_ie == true) { if (got_p2p_ie ) {
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
struct wifidirect_info *pwdinfo = &(adapter->wdinfo); struct wifidirect_info *pwdinfo = &(adapter->wdinfo);
pwdinfo->operating_channel = pmlmeext->cur_channel; pwdinfo->operating_channel = pmlmeext->cur_channel;
@ -4226,7 +4226,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
plist = get_next(plist); plist = get_next(plist);
if (_rtw_memcmp((u8 *)target_mac, psta->hwaddr, ETH_ALEN)) { if (!memcmp((u8 *)target_mac, psta->hwaddr, ETH_ALEN)) {
if (psta->dot8021xalg == 1 && psta->bpairwise_key_installed == false) if (psta->dot8021xalg == 1 && psta->bpairwise_key_installed == false)
RTW_INFO("%s, sta's dot8021xalg = 1 and key_installed = false\n", __func__); RTW_INFO("%s, sta's dot8021xalg = 1 and key_installed = false\n", __func__);
else { else {
@ -4236,7 +4236,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
pstapriv->asoc_list_cnt--; pstapriv->asoc_list_cnt--;
/* _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); */ /* _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); */
if (check_fwstate(pmlmepriv, (WIFI_AP_STATE)) == true) if (check_fwstate(pmlmepriv, (WIFI_AP_STATE)) )
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_PREV_AUTH_NOT_VALID, true); updated = ap_free_sta(padapter, psta, true, WLAN_REASON_PREV_AUTH_NOT_VALID, true);
else else
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING, true); updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING, true);
@ -5015,7 +5015,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
rtw_mi_buddy_scan_abort(padapter, true); rtw_mi_buddy_scan_abort(padapter, true);
#endif /*CONFIG_CONCURRENT_MODE*/ #endif /*CONFIG_CONCURRENT_MODE*/
if (rtw_cfg80211_get_is_roch(padapter) == true) { if (rtw_cfg80211_get_is_roch(padapter) ) {
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer); _cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);
p2p_cancel_roch_cmd(padapter, 0, NULL, RTW_CMDF_WAIT_ACK); p2p_cancel_roch_cmd(padapter, 0, NULL, RTW_CMDF_WAIT_ACK);
} }
@ -5044,7 +5044,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
for (i = 0; i < dvobj->iface_nums; i++) { for (i = 0; i < dvobj->iface_nums; i++) {
iface = dvobj->padapters[i]; iface = dvobj->padapters[i];
if (check_fwstate(&iface->mlmepriv, _FW_UNDER_LINKING | WIFI_UNDER_WPS) == true) { if (check_fwstate(&iface->mlmepriv, _FW_UNDER_LINKING | WIFI_UNDER_WPS) ) {
RTW_INFO(ADPT_FMT"- _FW_UNDER_LINKING |WIFI_UNDER_WPS (mlme state:0x%x)\n", ADPT_ARG(iface), get_fwstate(&iface->mlmepriv)); RTW_INFO(ADPT_FMT"- _FW_UNDER_LINKING |WIFI_UNDER_WPS (mlme state:0x%x)\n", ADPT_ARG(iface), get_fwstate(&iface->mlmepriv));
remain_ch = iface->mlmeextpriv.cur_channel; remain_ch = iface->mlmeextpriv.cur_channel;
} }
@ -5099,7 +5099,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy,
ready_on_channel = true; ready_on_channel = true;
} }
if (ready_on_channel == true) { if (ready_on_channel ) {
#ifndef RTW_SINGLE_WIPHY #ifndef RTW_SINGLE_WIPHY
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED))
#endif #endif
@ -5172,7 +5172,7 @@ static s32 cfg80211_rtw_cancel_remain_on_channel(struct wiphy *wiphy,
, FUNC_ADPT_ARG(padapter), wdev == wiphy_to_pd_wdev(wiphy) ? " PD" : "" , FUNC_ADPT_ARG(padapter), wdev == wiphy_to_pd_wdev(wiphy) ? " PD" : ""
, cookie); , cookie);
if (rtw_cfg80211_get_is_roch(padapter) == true) { if (rtw_cfg80211_get_is_roch(padapter) ) {
_cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer); _cancel_timer_ex(&padapter->cfg80211_wdinfo.remain_on_ch_timer);
p2p_cancel_roch_cmd(padapter, cookie, wdev, RTW_CMDF_WAIT_ACK); p2p_cancel_roch_cmd(padapter, cookie, wdev, RTW_CMDF_WAIT_ACK);
} }
@ -5225,7 +5225,7 @@ inline int rtw_cfg80211_is_p2p_scan(_adapter *adapter)
&& wdev_data->scan_request->ssids && wdev_data->scan_request->ssids
&& wdev_data->scan_request->ie && wdev_data->scan_request->ie
) { ) {
if (_rtw_memcmp(wdev_data->scan_request->ssids->ssid, "DIRECT-", 7) if (!memcmp(wdev_data->scan_request->ssids->ssid, "DIRECT-", 7)
&& rtw_get_p2p_ie((u8 *)wdev_data->scan_request->ie, wdev_data->scan_request->ie_len, NULL, NULL)) && rtw_get_p2p_ie((u8 *)wdev_data->scan_request->ie, wdev_data->scan_request->ie_len, NULL, NULL))
is_p2p_scan = 1; is_p2p_scan = 1;
} }
@ -5331,7 +5331,7 @@ inline int rtw_cfg80211_redirect_pd_wdev(struct wiphy *wiphy, u8 *ra, struct wir
struct wireless_dev *pd_wdev = wiphy_to_pd_wdev(wiphy); struct wireless_dev *pd_wdev = wiphy_to_pd_wdev(wiphy);
if (pd_wdev && pd_wdev != *wdev if (pd_wdev && pd_wdev != *wdev
&& _rtw_memcmp(wdev_address(pd_wdev), ra, ETH_ALEN) == true && !memcmp(wdev_address(pd_wdev), ra, ETH_ALEN)
) { ) {
*wdev = pd_wdev; *wdev = pd_wdev;
return 1; return 1;
@ -5402,7 +5402,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const
#endif #endif
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (rtw_cfg80211_get_is_roch(padapter) == true) { if (rtw_cfg80211_get_is_roch(padapter) ) {
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
RTW_INFO("%s, extend ro ch time\n", __func__); RTW_INFO("%s, extend ro ch time\n", __func__);
@ -5940,7 +5940,7 @@ static int cfg80211_rtw_tdls_oper(struct wiphy *wiphy,
case NL80211_TDLS_SETUP: case NL80211_TDLS_SETUP:
#ifdef CONFIG_WFD #ifdef CONFIG_WFD
if (_AES_ != padapter->securitypriv.dot11PrivacyAlgrthm) { if (_AES_ != padapter->securitypriv.dot11PrivacyAlgrthm) {
if (padapter->wdinfo.wfd_tdls_weaksec == true) if (padapter->wdinfo.wfd_tdls_weaksec )
issue_tdls_setup_req(padapter, &txmgmt, true); issue_tdls_setup_req(padapter, &txmgmt, true);
else else
RTW_INFO("[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __func__); RTW_INFO("[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __func__);
@ -5994,9 +5994,9 @@ static int cfg80211_rtw_sched_scan_start(struct wiphy *wiphy,
return -EIO; return -EIO;
} }
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true || if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ||
check_fwstate(pmlmepriv, _FW_LINKED) == true || check_fwstate(pmlmepriv, _FW_LINKED) ||
check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) { check_fwstate(pmlmepriv, _FW_UNDER_LINKING) ) {
RTW_INFO("%s: device is busy.\n", __func__); RTW_INFO("%s: device is busy.\n", __func__);
rtw_scan_abort(padapter); rtw_scan_abort(padapter);
} }
@ -6706,7 +6706,7 @@ static void cfg80211_rtw_rfkill_poll(struct wiphy *wiphy)
padapter = wiphy_to_adapter(wiphy); padapter = wiphy_to_adapter(wiphy);
if (adapter_to_dvobj(padapter)->processing_dev_remove == true) { if (adapter_to_dvobj(padapter)->processing_dev_remove ) {
/*RTW_INFO("cfg80211_rtw_rfkill_poll: device is removed!\n");*/ /*RTW_INFO("cfg80211_rtw_rfkill_poll: device is removed!\n");*/
return; return;
} }

View file

@ -229,7 +229,7 @@ void rtw_indicate_wx_assoc_event(_adapter *padapter)
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
_rtw_memcpy(wrqu.ap_addr.sa_data, pnetwork->MacAddress, ETH_ALEN); _rtw_memcpy(wrqu.ap_addr.sa_data, pnetwork->MacAddress, ETH_ALEN);
else else
_rtw_memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN); _rtw_memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN);
@ -308,7 +308,7 @@ static int search_p2p_wfd_ie(_adapter *padapter,
/* If not, the driver should ignore this AP and go to the next AP. */ /* If not, the driver should ignore this AP and go to the next AP. */
/* Verifying the SSID */ /* Verifying the SSID */
if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN)) { if (!memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN)) {
u32 p2pielen = 0; u32 p2pielen = 0;
/* Verifying the P2P IE */ /* Verifying the P2P IE */
@ -449,24 +449,24 @@ static inline char *iwe_stream_protocol_process(_adapter *padapter,
/* Add the protocol name */ /* Add the protocol name */
iwe->cmd = SIOCGIWNAME; iwe->cmd = SIOCGIWNAME;
if ((rtw_is_cckratesonly_included((u8 *)&pnetwork->network.SupportedRates)) == true) { if ((rtw_is_cckratesonly_included((u8 *)&pnetwork->network.SupportedRates))) {
if (ht_cap == true) if (ht_cap )
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bn"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bn");
else else
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11b"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11b");
} else if ((rtw_is_cckrates_included((u8 *)&pnetwork->network.SupportedRates)) == true) { } else if ((rtw_is_cckrates_included((u8 *)&pnetwork->network.SupportedRates))) {
if (ht_cap == true) if (ht_cap )
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bgn"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bgn");
else else
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bg"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11bg");
} else { } else {
if (pnetwork->network.Configuration.DSConfig > 14) { if (pnetwork->network.Configuration.DSConfig > 14) {
if (ht_cap == true) if (ht_cap )
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11an"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11an");
else else
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11a"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11a");
} else { } else {
if (ht_cap == true) if (ht_cap )
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11gn"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11gn");
else else
snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11g"); snprintf(iwe->u.name, IFNAMSIZ, "IEEE 802.11g");
@ -512,7 +512,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter,
"%d%s ", rate >> 1, (rate & 1) ? ".5" : ""); "%d%s ", rate >> 1, (rate & 1) ? ".5" : "");
i++; i++;
} }
if (ht_cap == true) { if (ht_cap ) {
if (mcs_rate & 0x8000) /* MCS15 */ if (mcs_rate & 0x8000) /* MCS15 */
max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) : ((short_GI) ? 144 : 130); max_rate = (bw_40MHz) ? ((short_GI) ? 300 : 270) : ((short_GI) ? 144 : 130);
@ -697,7 +697,7 @@ static inline char *iwe_stream_rssi_process(_adapter *padapter,
#endif #endif
; ;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) { is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network, 0)) {
ss = padapter->recvpriv.signal_strength; ss = padapter->recvpriv.signal_strength;
sq = padapter->recvpriv.signal_qual; sq = padapter->recvpriv.signal_qual;
@ -924,7 +924,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
struct sta_info *psta, *pbcmc_sta; struct sta_info *psta, *pbcmc_sta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) == true) { /* sta mode */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_MP_STATE) ) { /* sta mode */
psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
if (psta == NULL) { if (psta == NULL) {
/* DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail\n")); */ /* DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail\n")); */
@ -1026,7 +1026,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
if (param->u.crypt.set_tx == 1) { if (param->u.crypt.set_tx == 1) {
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if (_rtw_memcmp(pWapiSta->PeerMacAddr, param->sta_addr, 6)) { if (!memcmp(pWapiSta->PeerMacAddr, param->sta_addr, 6)) {
_rtw_memcpy(pWapiSta->lastTxUnicastPN, WapiASUEPNInitialValueSrc, 16); _rtw_memcpy(pWapiSta->lastTxUnicastPN, WapiASUEPNInitialValueSrc, 16);
pWapiSta->wapiUsk.bSet = true; pWapiSta->wapiUsk.bSet = true;
@ -1051,7 +1051,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
} }
} else { } else {
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if (_rtw_memcmp(pWapiSta->PeerMacAddr, get_bssid(pmlmepriv), 6)) { if (!memcmp(pWapiSta->PeerMacAddr, get_bssid(pmlmepriv), 6)) {
pWapiSta->wapiMsk.bSet = true; pWapiSta->wapiMsk.bSet = true;
_rtw_memcpy(pWapiSta->wapiMsk.dataKey, param->u.crypt.key, 16); _rtw_memcpy(pWapiSta->wapiMsk.dataKey, param->u.crypt.key, 16);
_rtw_memcpy(pWapiSta->wapiMsk.micKey, param->u.crypt.key + 16, 16); _rtw_memcpy(pWapiSta->wapiMsk.micKey, param->u.crypt.key + 16, 16);
@ -1196,7 +1196,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen)
while (cnt < ielen) { while (cnt < ielen) {
eid = buf[cnt]; eid = buf[cnt];
if ((eid == _VENDOR_SPECIFIC_IE_) && (_rtw_memcmp(&buf[cnt + 2], wps_oui, 4) == true)) { if ((eid == _VENDOR_SPECIFIC_IE_) && (!memcmp(&buf[cnt + 2], wps_oui, 4) )) {
RTW_INFO("SET WPS_IE\n"); RTW_INFO("SET WPS_IE\n");
padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN; padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN;
@ -1224,7 +1224,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen)
|| padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_
|| padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
/* WPS open need to enable multicast /* WPS open need to enable multicast
* || check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */ * || check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) ) */
rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr); rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);
@ -1251,7 +1251,7 @@ static int rtw_wx_get_name(struct net_device *dev,
if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) ) {
/* parsing HT_CAP_IE */ /* parsing HT_CAP_IE */
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength - 12); p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength - 12);
if (p && ht_ielen > 0) if (p && ht_ielen > 0)
@ -1259,24 +1259,24 @@ static int rtw_wx_get_name(struct net_device *dev,
prates = &pcur_bss->SupportedRates; prates = &pcur_bss->SupportedRates;
if (rtw_is_cckratesonly_included((u8 *)prates) == true) { if (rtw_is_cckratesonly_included((u8 *)prates) ) {
if (ht_cap == true) if (ht_cap )
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11bn"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11bn");
else else
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11b"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11b");
} else if ((rtw_is_cckrates_included((u8 *)prates)) == true) { } else if ((rtw_is_cckrates_included((u8 *)prates)) ) {
if (ht_cap == true) if (ht_cap )
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11bgn"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11bgn");
else else
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11bg"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11bg");
} else { } else {
if (pcur_bss->Configuration.DSConfig > 14) { if (pcur_bss->Configuration.DSConfig > 14) {
if (ht_cap == true) if (ht_cap )
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11an"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11an");
else else
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11a"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11a");
} else { } else {
if (ht_cap == true) if (ht_cap )
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11gn"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11gn");
else else
snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11g"); snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11g");
@ -1360,7 +1360,7 @@ static int rtw_wx_get_freq(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
WLAN_BSSID_EX *pcur_bss = &pmlmepriv->cur_network.network; WLAN_BSSID_EX *pcur_bss = &pmlmepriv->cur_network.network;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true && check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) != true) { if (check_fwstate(pmlmepriv, _FW_LINKED) && check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) != true) {
wrqu->freq.m = rtw_ch2freq(pcur_bss->Configuration.DSConfig) * 100000; wrqu->freq.m = rtw_ch2freq(pcur_bss->Configuration.DSConfig) * 100000;
wrqu->freq.e = 1; wrqu->freq.e = 1;
@ -1458,7 +1458,7 @@ static int rtw_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
rtw_setopmode_cmd(padapter, networkType, true); rtw_setopmode_cmd(padapter, networkType, true);
if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) )
rtw_indicate_connect(padapter); rtw_indicate_connect(padapter);
exit: exit:
@ -1476,15 +1476,15 @@ static int rtw_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) )
wrqu->mode = IW_MODE_INFRA; wrqu->mode = IW_MODE_INFRA;
else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ))
wrqu->mode = IW_MODE_ADHOC; wrqu->mode = IW_MODE_ADHOC;
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) )
wrqu->mode = IW_MODE_MASTER; wrqu->mode = IW_MODE_MASTER;
else if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) == true) else if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) )
wrqu->mode = IW_MODE_MONITOR; wrqu->mode = IW_MODE_MONITOR;
else else
wrqu->mode = IW_MODE_AUTO; wrqu->mode = IW_MODE_AUTO;
@ -1511,7 +1511,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
_rtw_memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); _rtw_memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN);
if (pPMK->cmd == IW_PMKSA_ADD) { if (pPMK->cmd == IW_PMKSA_ADD) {
RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
if (_rtw_memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true) if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) )
return intReturn ; return intReturn ;
else else
intReturn = true; intReturn = true;
@ -1519,7 +1519,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
/* overwrite PMKID */ /* overwrite PMKID */
for (j = 0 ; j < NUM_PMKID_CACHE; j++) { for (j = 0 ; j < NUM_PMKID_CACHE; j++) {
if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) == true) { if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ) {
/* BSSID is matched, the same AP => rewrite with new PMKID. */ /* BSSID is matched, the same AP => rewrite with new PMKID. */
RTW_INFO("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n"); RTW_INFO("[rtw_wx_set_pmkid] BSSID exists in the PMKList.\n");
@ -1549,7 +1549,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n"); RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_REMOVE!\n");
intReturn = true; intReturn = true;
for (j = 0 ; j < NUM_PMKID_CACHE; j++) { for (j = 0 ; j < NUM_PMKID_CACHE; j++) {
if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) == true) { if (!memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) ) {
/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */
memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN); memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN);
psecuritypriv->PMKIDList[j].bUsed = false; psecuritypriv->PMKIDList[j].bUsed = false;
@ -1577,7 +1577,7 @@ static int rtw_wx_get_sens(struct net_device *dev,
* 20110311 Commented by Jeff * 20110311 Commented by Jeff
* For rockchip platform's wpa_driver_wext_get_rssi * For rockchip platform's wpa_driver_wext_get_rssi
*/ */
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED) ) {
/* wrqu->sens.value=-padapter->recvpriv.signal_strength; */ /* wrqu->sens.value=-padapter->recvpriv.signal_strength; */
wrqu->sens.value = -padapter->recvpriv.rssi; wrqu->sens.value = -padapter->recvpriv.rssi;
/* RTW_INFO("%s: %d\n", __func__, wrqu->sens.value); */ /* RTW_INFO("%s: %d\n", __func__, wrqu->sens.value); */
@ -1780,7 +1780,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
*/ */
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
if (rtw_mi_buddy_check_fwstate(padapter, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true) { if (rtw_mi_buddy_check_fwstate(padapter, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) ) {
RTW_INFO("set bssid, but buddy_intf is under scanning or linking\n"); RTW_INFO("set bssid, but buddy_intf is under scanning or linking\n");
ret = -EINVAL; ret = -EINVAL;
@ -1813,7 +1813,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
while (1) { while (1) {
if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == true) { if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) ) {
break; break;
} }
@ -1825,7 +1825,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
src_bssid = temp->sa_data; src_bssid = temp->sa_data;
if ((_rtw_memcmp(dst_bssid, src_bssid, ETH_ALEN)) == true) { if ((!memcmp(dst_bssid, src_bssid, ETH_ALEN)) ) {
if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode)) { if (!rtw_set_802_11_infrastructure_mode(padapter, pnetwork->network.InfrastructureMode)) {
ret = -1; ret = -1;
_exit_critical_bh(&queue->lock, &irqL); _exit_critical_bh(&queue->lock, &irqL);
@ -1867,9 +1867,9 @@ static int rtw_wx_get_wap(struct net_device *dev,
if (((check_fwstate(pmlmepriv, _FW_LINKED)) == true) || if (((check_fwstate(pmlmepriv, _FW_LINKED)) ) ||
((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) || ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ) ||
((check_fwstate(pmlmepriv, WIFI_AP_STATE)) == true)) ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) ))
_rtw_memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN); _rtw_memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN);
else else
@ -1977,7 +1977,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
goto cancel_ps_deny; goto cancel_ps_deny;
} }
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) ) {
indicate_wx_scan_complete_event(padapter); indicate_wx_scan_complete_event(padapter);
goto cancel_ps_deny; goto cancel_ps_deny;
} }
@ -2023,7 +2023,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
#endif #endif
if (wrqu->data.length >= WEXT_CSCAN_HEADER_SIZE if (wrqu->data.length >= WEXT_CSCAN_HEADER_SIZE
&& _rtw_memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true && !memcmp(extra, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE)
) { ) {
int len = wrqu->data.length - WEXT_CSCAN_HEADER_SIZE; int len = wrqu->data.length - WEXT_CSCAN_HEADER_SIZE;
char *pos = extra + WEXT_CSCAN_HEADER_SIZE; char *pos = extra + WEXT_CSCAN_HEADER_SIZE;
@ -2164,7 +2164,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
#endif #endif
; ;
while (check_fwstate(pmlmepriv, wait_status) == true) while (check_fwstate(pmlmepriv, wait_status) )
return -EAGAIN; return -EAGAIN;
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
@ -2172,7 +2172,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
if ((stop - ev) < SCAN_ITEM_SIZE) { if ((stop - ev) < SCAN_ITEM_SIZE) {
@ -2184,8 +2184,8 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
/* report network only if the current channel set contains the channel to which this network belongs */ /* report network only if the current channel set contains the channel to which this network belongs */
if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0 if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0
&& rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig) == true && rtw_mlme_band_check(padapter, pnetwork->network.Configuration.DSConfig)
&& true == rtw_validate_ssid(&(pnetwork->network.Ssid)) && rtw_validate_ssid(&(pnetwork->network.Ssid))
) )
ev = translate_scan(padapter, a, pnetwork, ev, stop); ev = translate_scan(padapter, a, pnetwork, ev, stop);
@ -2304,7 +2304,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) == true) { if (rtw_end_of_queue_search(phead, pmlmepriv->pscanned) ) {
break; break;
} }
@ -2315,10 +2315,10 @@ static int rtw_wx_set_essid(struct net_device *dev,
dst_ssid = pnetwork->network.Ssid.Ssid; dst_ssid = pnetwork->network.Ssid.Ssid;
if ((_rtw_memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength) == true) && if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength) ) &&
(pnetwork->network.Ssid.SsidLength == ndis_ssid.SsidLength)) { (pnetwork->network.Ssid.SsidLength == ndis_ssid.SsidLength)) {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ) {
if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode) if (pnetwork->network.InfrastructureMode != pmlmepriv->cur_network.network.InfrastructureMode)
continue; continue;
} }
@ -2366,8 +2366,8 @@ static int rtw_wx_get_essid(struct net_device *dev,
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || if ((check_fwstate(pmlmepriv, _FW_LINKED) ) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) )) {
len = pcur_bss->Ssid.SsidLength; len = pcur_bss->Ssid.SsidLength;
wrqu->essid.length = len; wrqu->essid.length = len;
@ -3630,7 +3630,7 @@ static int rtw_get_ap_info(struct net_device *dev,
goto exit; goto exit;
} }
while ((check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING))) == true) { while ((check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING))) ) {
rtw_msleep_os(30); rtw_msleep_os(30);
cnt++; cnt++;
if (cnt > 100) if (cnt > 100)
@ -3656,7 +3656,7 @@ static int rtw_get_ap_info(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
@ -3670,7 +3670,7 @@ static int rtw_get_ap_info(struct net_device *dev,
} }
if (_rtw_memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true) { /* BSSID match, then check if supporting wpa/wpa2 */ if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) ) { /* BSSID match, then check if supporting wpa/wpa2 */
RTW_INFO("BSSID:" MAC_FMT "\n", MAC_ARG(bssid)); RTW_INFO("BSSID:" MAC_FMT "\n", MAC_ARG(bssid));
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12); pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength - 12);
@ -4226,11 +4226,11 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie; u8 *wpsie;
uint wpsie_len = 0; uint wpsie_len = 0;
@ -4355,11 +4355,11 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
/* Commented by Albert 2011/05/18 */ /* Commented by Albert 2011/05/18 */
/* Match the device address located in the P2P IE */ /* Match the device address located in the P2P IE */
/* This is for the case that the P2P device address is not the same as the P2P interface address. */ /* This is for the case that the P2P device address is not the same as the P2P interface address. */
@ -4441,11 +4441,11 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie; u8 *wpsie;
uint wpsie_len = 0; uint wpsie_len = 0;
@ -4516,11 +4516,11 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie; u8 *wpsie;
uint wpsie_len = 0; uint wpsie_len = 0;
@ -4586,11 +4586,11 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
/* Commented by Albert 20121226 */ /* Commented by Albert 20121226 */
/* Match the device address located in the P2P IE */ /* Match the device address located in the P2P IE */
/* This is for the case that the P2P device address is not the same as the P2P interface address. */ /* This is for the case that the P2P device address is not the same as the P2P interface address. */
@ -4667,7 +4667,7 @@ static int rtw_p2p_connect(struct net_device *dev,
} }
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ) {
RTW_INFO("[%s] WiFi is under survey!\n", __func__); RTW_INFO("[%s] WiFi is under survey!\n", __func__);
return ret; return ret;
} }
@ -4685,11 +4685,11 @@ static int rtw_p2p_connect(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
if (pnetwork->network.Configuration.DSConfig != 0) if (pnetwork->network.Configuration.DSConfig != 0)
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
else if (pwdinfo->nego_req_info.peer_ch != 0) else if (pwdinfo->nego_req_info.peer_ch != 0)
@ -4833,7 +4833,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
@ -4849,13 +4849,13 @@ static int rtw_p2p_invite_req(struct net_device *dev,
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
/* Handle the P2P Device ID attribute of Beacon first */ /* Handle the P2P Device ID attribute of Beacon first */
if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) { if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
} else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { } else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) {
/* Handle the P2P Device Info attribute of probe response */ /* Handle the P2P Device Info attribute of probe response */
if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) { if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
@ -5122,7 +5122,7 @@ static int rtw_p2p_set_pc(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
@ -5139,14 +5139,14 @@ static int rtw_p2p_set_pc(struct net_device *dev,
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
/* Handle the P2P Device ID attribute of Beacon first */ /* Handle the P2P Device ID attribute of Beacon first */
printk("[%s] P2P_ATTR_DEVICE_ID\n", __func__); printk("[%s] P2P_ATTR_DEVICE_ID\n", __func__);
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { if (!memcmp(attr_content, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
} else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { } else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) {
/* Handle the P2P Device Info attribute of probe response */ /* Handle the P2P Device Info attribute of probe response */
printk("[%s] P2P_ATTR_DEVICE_INFO\n", __func__); printk("[%s] P2P_ATTR_DEVICE_INFO\n", __func__);
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { if (!memcmp(attr_content, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
@ -5337,7 +5337,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
return ret; return ret;
} else { } else {
#ifdef CONFIG_INTEL_WIDI #ifdef CONFIG_INTEL_WIDI
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ) {
RTW_INFO("[%s] WiFi is under survey!\n", __func__); RTW_INFO("[%s] WiFi is under survey!\n", __func__);
return ret; return ret;
} }
@ -5355,13 +5355,13 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3) for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
peerMAC[jj] = key_2char2num(extra[kk], extra[kk + 1]); peerMAC[jj] = key_2char2num(extra[kk], extra[kk + 1]);
if (_rtw_memcmp(&extra[18], "display", 7)) if (!memcmp(&extra[18], "display", 7))
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_DISPLYA; pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_DISPLYA;
else if (_rtw_memcmp(&extra[18], "keypad", 7)) else if (!memcmp(&extra[18], "keypad", 7))
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_KEYPAD; pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_KEYPAD;
else if (_rtw_memcmp(&extra[18], "pbc", 3)) else if (!memcmp(&extra[18], "pbc", 3))
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_PUSH_BUTTON; pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_PUSH_BUTTON;
else if (_rtw_memcmp(&extra[18], "label", 5)) else if (!memcmp(&extra[18], "label", 5))
pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_LABEL; pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_LABEL;
else { else {
RTW_INFO("[%s] Unknown WPS config methodn", __func__); RTW_INFO("[%s] Unknown WPS config methodn", __func__);
@ -5374,7 +5374,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while (1) { while (1) {
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) )
break; break;
if (uintPeerChannel != 0) if (uintPeerChannel != 0)
@ -5394,13 +5394,13 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
/* Handle the P2P Device ID attribute of Beacon first */ /* Handle the P2P Device ID attribute of Beacon first */
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { if (!memcmp(attr_content, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
} else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) { } else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) {
/* Handle the P2P Device Info attribute of probe response */ /* Handle the P2P Device Info attribute of probe response */
if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) { if (!memcmp(attr_content, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
@ -5417,7 +5417,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
/* so we could only compare mac addr by 802.11 Source Address */ /* so we could only compare mac addr by 802.11 Source Address */
if (pmlmepriv->widi_state == INTEL_WIDI_STATE_WFD_CONNECTION if (pmlmepriv->widi_state == INTEL_WIDI_STATE_WFD_CONNECTION
&& uintPeerChannel == 0) { && uintPeerChannel == 0) {
if (_rtw_memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
} }
@ -5583,72 +5583,72 @@ static int rtw_p2p_set(struct net_device *dev,
RTW_INFO("[%s] extra = %s\n", __func__, extra); RTW_INFO("[%s] extra = %s\n", __func__, extra);
if (_rtw_memcmp(extra, "enable=", 7)) if (!memcmp(extra, "enable=", 7))
rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]);
else if (_rtw_memcmp(extra, "setDN=", 6)) { else if (!memcmp(extra, "setDN=", 6)) {
wrqu->data.length -= 6; wrqu->data.length -= 6;
rtw_p2p_setDN(dev, info, wrqu, &extra[6]); rtw_p2p_setDN(dev, info, wrqu, &extra[6]);
} else if (_rtw_memcmp(extra, "profilefound=", 13)) { } else if (!memcmp(extra, "profilefound=", 13)) {
wrqu->data.length -= 13; wrqu->data.length -= 13;
rtw_p2p_profilefound(dev, info, wrqu, &extra[13]); rtw_p2p_profilefound(dev, info, wrqu, &extra[13]);
} else if (_rtw_memcmp(extra, "prov_disc=", 10)) { } else if (!memcmp(extra, "prov_disc=", 10)) {
wrqu->data.length -= 10; wrqu->data.length -= 10;
rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]); rtw_p2p_prov_disc(dev, info, wrqu, &extra[10]);
} else if (_rtw_memcmp(extra, "nego=", 5)) { } else if (!memcmp(extra, "nego=", 5)) {
wrqu->data.length -= 5; wrqu->data.length -= 5;
rtw_p2p_connect(dev, info, wrqu, &extra[5]); rtw_p2p_connect(dev, info, wrqu, &extra[5]);
} else if (_rtw_memcmp(extra, "intent=", 7)) { } else if (!memcmp(extra, "intent=", 7)) {
/* Commented by Albert 2011/03/23 */ /* Commented by Albert 2011/03/23 */
/* The wrqu->data.length will include the null character */ /* The wrqu->data.length will include the null character */
/* So, we will decrease 7 + 1 */ /* So, we will decrease 7 + 1 */
wrqu->data.length -= 8; wrqu->data.length -= 8;
rtw_p2p_set_intent(dev, info, wrqu, &extra[7]); rtw_p2p_set_intent(dev, info, wrqu, &extra[7]);
} else if (_rtw_memcmp(extra, "ssid=", 5)) { } else if (!memcmp(extra, "ssid=", 5)) {
wrqu->data.length -= 5; wrqu->data.length -= 5;
rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]); rtw_p2p_set_go_nego_ssid(dev, info, wrqu, &extra[5]);
} else if (_rtw_memcmp(extra, "got_wpsinfo=", 12)) { } else if (!memcmp(extra, "got_wpsinfo=", 12)) {
wrqu->data.length -= 12; wrqu->data.length -= 12;
rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]); rtw_p2p_got_wpsinfo(dev, info, wrqu, &extra[12]);
} else if (_rtw_memcmp(extra, "listen_ch=", 10)) { } else if (!memcmp(extra, "listen_ch=", 10)) {
/* Commented by Albert 2011/05/24 */ /* Commented by Albert 2011/05/24 */
/* The wrqu->data.length will include the null character */ /* The wrqu->data.length will include the null character */
/* So, we will decrease (10 + 1) */ /* So, we will decrease (10 + 1) */
wrqu->data.length -= 11; wrqu->data.length -= 11;
rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]); rtw_p2p_set_listen_ch(dev, info, wrqu, &extra[10]);
} else if (_rtw_memcmp(extra, "op_ch=", 6)) { } else if (!memcmp(extra, "op_ch=", 6)) {
/* Commented by Albert 2011/05/24 */ /* Commented by Albert 2011/05/24 */
/* The wrqu->data.length will include the null character */ /* The wrqu->data.length will include the null character */
/* So, we will decrease (6 + 1) */ /* So, we will decrease (6 + 1) */
wrqu->data.length -= 7; wrqu->data.length -= 7;
rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]); rtw_p2p_set_op_ch(dev, info, wrqu, &extra[6]);
} else if (_rtw_memcmp(extra, "invite=", 7)) { } else if (!memcmp(extra, "invite=", 7)) {
wrqu->data.length -= 8; wrqu->data.length -= 8;
rtw_p2p_invite_req(dev, info, wrqu, &extra[7]); rtw_p2p_invite_req(dev, info, wrqu, &extra[7]);
} else if (_rtw_memcmp(extra, "persistent=", 11)) { } else if (!memcmp(extra, "persistent=", 11)) {
wrqu->data.length -= 11; wrqu->data.length -= 11;
rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]);
} else if (_rtw_memcmp(extra, "uuid=", 5)) { } else if (!memcmp(extra, "uuid=", 5)) {
wrqu->data.length -= 5; wrqu->data.length -= 5;
ret = rtw_p2p_set_wps_uuid(dev, info, wrqu, &extra[5]); ret = rtw_p2p_set_wps_uuid(dev, info, wrqu, &extra[5]);
} }
#ifdef CONFIG_WFD #ifdef CONFIG_WFD
if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) { if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) {
if (_rtw_memcmp(extra, "sa=", 3)) { if (!memcmp(extra, "sa=", 3)) {
/* sa: WFD Session Available information */ /* sa: WFD Session Available information */
wrqu->data.length -= 3; wrqu->data.length -= 3;
rtw_p2p_set_sa(dev, info, wrqu, &extra[3]); rtw_p2p_set_sa(dev, info, wrqu, &extra[3]);
} else if (_rtw_memcmp(extra, "pc=", 3)) { } else if (!memcmp(extra, "pc=", 3)) {
/* pc: WFD Preferred Connection */ /* pc: WFD Preferred Connection */
wrqu->data.length -= 3; wrqu->data.length -= 3;
rtw_p2p_set_pc(dev, info, wrqu, &extra[3]); rtw_p2p_set_pc(dev, info, wrqu, &extra[3]);
} else if (_rtw_memcmp(extra, "wfd_type=", 9)) { } else if (!memcmp(extra, "wfd_type=", 9)) {
wrqu->data.length -= 9; wrqu->data.length -= 9;
rtw_p2p_set_wfd_device_type(dev, info, wrqu, &extra[9]); rtw_p2p_set_wfd_device_type(dev, info, wrqu, &extra[9]);
} else if (_rtw_memcmp(extra, "wfd_enable=", 11)) { } else if (!memcmp(extra, "wfd_enable=", 11)) {
wrqu->data.length -= 11; wrqu->data.length -= 11;
rtw_p2p_set_wfd_enable(dev, info, wrqu, &extra[11]); rtw_p2p_set_wfd_enable(dev, info, wrqu, &extra[11]);
} else if (_rtw_memcmp(extra, "driver_iface=", 13)) { } else if (!memcmp(extra, "driver_iface=", 13)) {
wrqu->data.length -= 13; wrqu->data.length -= 13;
rtw_p2p_set_driver_iface(dev, info, wrqu, &extra[13]); rtw_p2p_set_driver_iface(dev, info, wrqu, &extra[13]);
} }
@ -5676,32 +5676,32 @@ static int rtw_p2p_get(struct net_device *dev,
if (padapter->bShowGetP2PState) if (padapter->bShowGetP2PState)
RTW_INFO("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer); RTW_INFO("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
if (_rtw_memcmp((__force void *)wrqu->data.pointer, "status", 6)) if (!memcmp((__force void *)wrqu->data.pointer, "status", 6))
rtw_p2p_get_status(dev, info, wrqu, extra); rtw_p2p_get_status(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "role", 4)) else if (!memcmp((__force void *)wrqu->data.pointer, "role", 4))
rtw_p2p_get_role(dev, info, wrqu, extra); rtw_p2p_get_role(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "peer_ifa", 8)) else if (!memcmp((__force void *)wrqu->data.pointer, "peer_ifa", 8))
rtw_p2p_get_peer_ifaddr(dev, info, wrqu, extra); rtw_p2p_get_peer_ifaddr(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "req_cm", 6)) else if (!memcmp((__force void *)wrqu->data.pointer, "req_cm", 6))
rtw_p2p_get_req_cm(dev, info, wrqu, extra); rtw_p2p_get_req_cm(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "peer_deva", 9)) { else if (!memcmp((__force void *)wrqu->data.pointer, "peer_deva", 9)) {
/* Get the P2P device address when receiving the provision discovery request frame. */ /* Get the P2P device address when receiving the provision discovery request frame. */
rtw_p2p_get_peer_devaddr(dev, info, wrqu, extra); rtw_p2p_get_peer_devaddr(dev, info, wrqu, extra);
} else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "group_id", 8)) } else if (!memcmp((__force void *)wrqu->data.pointer, "group_id", 8))
rtw_p2p_get_groupid(dev, info, wrqu, extra); rtw_p2p_get_groupid(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "inv_peer_deva", 13)) { else if (!memcmp((__force void *)wrqu->data.pointer, "inv_peer_deva", 13)) {
/* Get the P2P device address when receiving the P2P Invitation request frame. */ /* Get the P2P device address when receiving the P2P Invitation request frame. */
rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra); rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra);
} else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "op_ch", 5)) } else if (!memcmp((__force void *)wrqu->data.pointer, "op_ch", 5))
rtw_p2p_get_op_ch(dev, info, wrqu, extra); rtw_p2p_get_op_ch(dev, info, wrqu, extra);
#ifdef CONFIG_WFD #ifdef CONFIG_WFD
if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) { if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) {
if (_rtw_memcmp((__force void *)wrqu->data.pointer, "peer_port", 9)) if (!memcmp((__force void *)wrqu->data.pointer, "peer_port", 9))
rtw_p2p_get_peer_wfd_port(dev, info, wrqu, extra); rtw_p2p_get_peer_wfd_port(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "wfd_sa", 6)) else if (!memcmp((__force void *)wrqu->data.pointer, "wfd_sa", 6))
rtw_p2p_get_peer_wfd_session_available(dev, info, wrqu, extra); rtw_p2p_get_peer_wfd_session_available(dev, info, wrqu, extra);
else if (_rtw_memcmp((__force void *)wrqu->data.pointer, "wfd_pc", 6)) else if (!memcmp((__force void *)wrqu->data.pointer, "wfd_pc", 6))
rtw_p2p_get_peer_wfd_preferred_connection(dev, info, wrqu, extra); rtw_p2p_get_peer_wfd_preferred_connection(dev, info, wrqu, extra);
} }
#endif /* CONFIG_WFD */ #endif /* CONFIG_WFD */
@ -5736,15 +5736,15 @@ static int rtw_p2p_get2(struct net_device *dev,
RTW_INFO("[%s] buffer = %s\n", __func__, buffer); RTW_INFO("[%s] buffer = %s\n", __func__, buffer);
if (_rtw_memcmp(buffer, "wpsCM=", 6)) if (!memcmp(buffer, "wpsCM=", 6))
ret = rtw_p2p_get_wps_configmethod(dev, info, wrqu, extra, &buffer[6]); ret = rtw_p2p_get_wps_configmethod(dev, info, wrqu, extra, &buffer[6]);
else if (_rtw_memcmp(buffer, "devN=", 5)) else if (!memcmp(buffer, "devN=", 5))
ret = rtw_p2p_get_device_name(dev, info, wrqu, extra, &buffer[5]); ret = rtw_p2p_get_device_name(dev, info, wrqu, extra, &buffer[5]);
else if (_rtw_memcmp(buffer, "dev_type=", 9)) else if (!memcmp(buffer, "dev_type=", 9))
ret = rtw_p2p_get_device_type(dev, info, wrqu, extra, &buffer[9]); ret = rtw_p2p_get_device_type(dev, info, wrqu, extra, &buffer[9]);
else if (_rtw_memcmp(buffer, "go_devadd=", 10)) else if (!memcmp(buffer, "go_devadd=", 10))
ret = rtw_p2p_get_go_device_address(dev, info, wrqu, extra, &buffer[10]); ret = rtw_p2p_get_go_device_address(dev, info, wrqu, extra, &buffer[10]);
else if (_rtw_memcmp(buffer, "InvProc=", 8)) else if (!memcmp(buffer, "InvProc=", 8))
ret = rtw_p2p_get_invitation_procedure(dev, info, wrqu, extra, &buffer[8]); ret = rtw_p2p_get_invitation_procedure(dev, info, wrqu, extra, &buffer[8]);
else { else {
snprintf(extra, sizeof("Command not found."), "Command not found."); snprintf(extra, sizeof("Command not found."), "Command not found.");
@ -5829,7 +5829,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
if (0 != ret) if (0 != ret)
goto exit; goto exit;
if (_rtw_memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) { if (!memcmp(rereg_priv->old_ifname, "disable%d", 9) ) {
padapter->ledpriv.bRegUseLed = rereg_priv->old_bRegUseLed; padapter->ledpriv.bRegUseLed = rereg_priv->old_bRegUseLed;
rtw_hal_sw_led_init(padapter); rtw_hal_sw_led_init(padapter);
/* rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode); */ /* rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode); */
@ -5838,7 +5838,7 @@ static int rtw_rereg_nd_name(struct net_device *dev,
strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ); strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ);
rereg_priv->old_ifname[IFNAMSIZ - 1] = 0; rereg_priv->old_ifname[IFNAMSIZ - 1] = 0;
if (_rtw_memcmp(new_ifname, "disable%d", 9) == true) { if (!memcmp(new_ifname, "disable%d", 9) ) {
RTW_INFO("%s disable\n", __func__); RTW_INFO("%s disable\n", __func__);
/* free network queue for Android's timming issue */ /* free network queue for Android's timming issue */
@ -7768,7 +7768,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
u8 wps_oui[4] = {0x0, 0x50, 0xf2, 0x04}; u8 wps_oui[4] = {0x0, 0x50, 0xf2, 0x04};
if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
(_rtw_memcmp(&probereq_wpsie[2], wps_oui, 4) == true)) { (!memcmp(&probereq_wpsie[2], wps_oui, 4) )) {
cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len; cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;
if (pmlmepriv->wps_probe_req_ie) { if (pmlmepriv->wps_probe_req_ie) {
@ -7796,7 +7796,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
} }
if (len >= WEXT_CSCAN_HEADER_SIZE if (len >= WEXT_CSCAN_HEADER_SIZE
&& _rtw_memcmp(ext, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE) == true && !memcmp(ext, WEXT_CSCAN_HEADER, WEXT_CSCAN_HEADER_SIZE)
) { ) {
ret = rtw_wx_set_scan(dev, info, awrq, ext); ret = rtw_wx_set_scan(dev, info, awrq, ext);
goto FREE_EXT; goto FREE_EXT;
@ -7818,7 +7818,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_network *pcur_network = &pmlmepriv->cur_network; struct wlan_network *pcur_network = &pmlmepriv->cur_network;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) )
sprintf(ext, "%s rssi %d", pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi); sprintf(ext, "%s rssi %d", pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi);
else else
sprintf(ext, "OK"); sprintf(ext, "OK");
@ -7912,12 +7912,12 @@ static int rtw_wowlan_ctrl(struct net_device *dev,
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_scan_abort(padapter); rtw_scan_abort(padapter);
if (_rtw_memcmp(extra, "enable", 6)) if (!memcmp(extra, "enable", 6))
rtw_suspend_common(padapter); rtw_suspend_common(padapter);
else if (_rtw_memcmp(extra, "disable", 7)) { else if (!memcmp(extra, "disable", 7)) {
RTW_ENABLE_FUNC(padapter, DF_RX_BIT); RTW_ENABLE_FUNC(padapter, DF_RX_BIT);
RTW_ENABLE_FUNC(padapter, DF_TX_BIT); RTW_ENABLE_FUNC(padapter, DF_TX_BIT);
rtw_resume_common(padapter); rtw_resume_common(padapter);
@ -8002,7 +8002,7 @@ static int rtw_wowlan_set_pattern(struct net_device *dev,
&pwrpriv->patterns[index].len, &pwrpriv->patterns[index].len,
pwrpriv->patterns[index].mask); pwrpriv->patterns[index].mask);
if (ret == true) if (ret )
pwrpriv->wowlan_pattern_idx++; pwrpriv->wowlan_pattern_idx++;
} }
} else if (strncmp(input, "clean", 5) == 0) { } else if (strncmp(input, "clean", 5) == 0) {
@ -8044,12 +8044,12 @@ static int rtw_ap_wowlan_ctrl(struct net_device *dev,
goto _rtw_ap_wowlan_ctrl_exit_free; goto _rtw_ap_wowlan_ctrl_exit_free;
} }
if (_rtw_memcmp(extra, "enable", 6)) { if (!memcmp(extra, "enable", 6)) {
pwrctrlpriv->wowlan_ap_mode = true; pwrctrlpriv->wowlan_ap_mode = true;
rtw_suspend_common(padapter); rtw_suspend_common(padapter);
} else if (_rtw_memcmp(extra, "disable", 7)) { } else if (!memcmp(extra, "disable", 7)) {
RTW_ENABLE_FUNC(padapter, DF_RX_BIT); RTW_ENABLE_FUNC(padapter, DF_RX_BIT);
RTW_ENABLE_FUNC(padapter, DF_TX_BIT); RTW_ENABLE_FUNC(padapter, DF_TX_BIT);
rtw_resume_common(padapter); rtw_resume_common(padapter);
@ -8077,10 +8077,10 @@ static int rtw_pm_set(struct net_device *dev,
RTW_INFO("[%s] extra = %s\n", __func__, extra); RTW_INFO("[%s] extra = %s\n", __func__, extra);
if (_rtw_memcmp(extra, "lps=", 4)) { if (!memcmp(extra, "lps=", 4)) {
sscanf(extra + 4, "%u", &mode); sscanf(extra + 4, "%u", &mode);
ret = rtw_pm_set_lps(padapter, mode); ret = rtw_pm_set_lps(padapter, mode);
} else if (_rtw_memcmp(extra, "ips=", 4)) { } else if (!memcmp(extra, "ips=", 4)) {
sscanf(extra + 4, "%u", &mode); sscanf(extra + 4, "%u", &mode);
ret = rtw_pm_set_ips(padapter, mode); ret = rtw_pm_set_ips(padapter, mode);
} else } else
@ -8818,7 +8818,7 @@ static int rtw_mp_efuse_get(struct net_device *dev,
mask_len = sizeof(u8) * rtw_get_efuse_mask_arraylen(padapter); mask_len = sizeof(u8) * rtw_get_efuse_mask_arraylen(padapter);
rtw_efuse_mask_array(padapter, mask_buf); rtw_efuse_mask_array(padapter, mask_buf);
if (padapter->registrypriv.bFileMaskEfuse == true) if (padapter->registrypriv.bFileMaskEfuse )
_rtw_memcpy(mask_buf, maskfileBuffer, mask_len); _rtw_memcpy(mask_buf, maskfileBuffer, mask_len);
sprintf(extra, "\n"); sprintf(extra, "\n");
@ -8988,9 +8988,9 @@ static int rtw_mp_efuse_set(struct net_device *dev,
goto exit; goto exit;
} }
*extra = 0; *extra = 0;
RTW_INFO("%s: after rtw_efuse_map_write to _rtw_memcmp\n", __func__); RTW_INFO("%s: after rtw_efuse_map_write to !memcmp\n", __func__);
if (rtw_efuse_mask_map_read(padapter, addr, cnts, ShadowMapWiFi) == _SUCCESS) { if (rtw_efuse_mask_map_read(padapter, addr, cnts, ShadowMapWiFi) == _SUCCESS) {
if (_rtw_memcmp((void *)ShadowMapWiFi , (void *)setdata, cnts)) { if (!memcmp((void *)ShadowMapWiFi , (void *)setdata, cnts)) {
RTW_INFO("%s: WiFi write map afterf compare success\n", __func__); RTW_INFO("%s: WiFi write map afterf compare success\n", __func__);
sprintf(extra, "WiFi write map compare OK\n"); sprintf(extra, "WiFi write map compare OK\n");
err = 0; err = 0;
@ -9236,9 +9236,9 @@ static int rtw_mp_efuse_set(struct net_device *dev,
goto exit; goto exit;
} }
*extra = 0; *extra = 0;
RTW_INFO("%s: after rtw_BT_efuse_map_write to _rtw_memcmp\n", __func__); RTW_INFO("%s: after rtw_BT_efuse_map_write to !memcmp\n", __func__);
if ((rtw_BT_efuse_map_read(padapter, addr, cnts, ShadowMapBT) == _SUCCESS)) { if ((rtw_BT_efuse_map_read(padapter, addr, cnts, ShadowMapBT) == _SUCCESS)) {
if (_rtw_memcmp((void *)ShadowMapBT , (void *)setdata, cnts)) { if (!memcmp((void *)ShadowMapBT , (void *)setdata, cnts)) {
RTW_INFO("%s: BT write map compare OK BTStatus=0x%x\n", __func__, BTStatus); RTW_INFO("%s: BT write map compare OK BTStatus=0x%x\n", __func__, BTStatus);
sprintf(extra, "BT write map compare OK"); sprintf(extra, "BT write map compare OK");
err = 0; err = 0;
@ -9324,9 +9324,9 @@ static int rtw_mp_efuse_set(struct net_device *dev,
} }
printk("\n"); printk("\n");
err = -EFAULT; err = -EFAULT;
RTW_INFO("%s: rtw_BT_efuse_map_read _rtw_memcmp\n", __func__); RTW_INFO("%s: rtw_BT_efuse_map_read !memcmp\n", __func__);
if ((rtw_BT_efuse_map_read(padapter, 0x00, EFUSE_BT_MAX_MAP_LEN, pEfuseHal->fakeBTEfuseInitMap) == _SUCCESS)) { if ((rtw_BT_efuse_map_read(padapter, 0x00, EFUSE_BT_MAX_MAP_LEN, pEfuseHal->fakeBTEfuseInitMap) == _SUCCESS)) {
if (_rtw_memcmp((void *)pEfuseHal->fakeBTEfuseModifiedMap, (void *)pEfuseHal->fakeBTEfuseInitMap, EFUSE_BT_MAX_MAP_LEN)) { if (!memcmp((void *)pEfuseHal->fakeBTEfuseModifiedMap, (void *)pEfuseHal->fakeBTEfuseInitMap, EFUSE_BT_MAX_MAP_LEN)) {
sprintf(extra, "BT write map compare OK"); sprintf(extra, "BT write map compare OK");
RTW_INFO("%s: BT write map afterf compare success BTStatus=0x%x\n", __func__, BTStatus); RTW_INFO("%s: BT write map afterf compare success BTStatus=0x%x\n", __func__, BTStatus);
err = 0; err = 0;
@ -9357,7 +9357,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
} else if (strcmp(tmp[0], "wlfk2map") == 0) { } else if (strcmp(tmp[0], "wlfk2map") == 0) {
*extra = 0; *extra = 0;
if (padapter->registrypriv.bFileMaskEfuse != true && pmp_priv->bloadefusemap == true) { if (padapter->registrypriv.bFileMaskEfuse != true && pmp_priv->bloadefusemap ) {
RTW_INFO("%s: File eFuse mask file not to be loaded\n", __func__); RTW_INFO("%s: File eFuse mask file not to be loaded\n", __func__);
sprintf(extra, "Not load eFuse mask file yet, Please use the efuse_mask CMD.\n"); sprintf(extra, "Not load eFuse mask file yet, Please use the efuse_mask CMD.\n");
err = 0; err = 0;
@ -9375,7 +9375,7 @@ static int rtw_mp_efuse_set(struct net_device *dev,
} }
if (rtw_efuse_mask_map_read(padapter, 0x00, wifimaplen, ShadowMapWiFi) == _SUCCESS) { if (rtw_efuse_mask_map_read(padapter, 0x00, wifimaplen, ShadowMapWiFi) == _SUCCESS) {
if (_rtw_memcmp((void *)ShadowMapWiFi , (void *)pEfuseHal->fakeEfuseModifiedMap, cnts)) { if (!memcmp((void *)ShadowMapWiFi , (void *)pEfuseHal->fakeEfuseModifiedMap, cnts)) {
RTW_INFO("%s: WiFi write map afterf compare OK\n", __func__); RTW_INFO("%s: WiFi write map afterf compare OK\n", __func__);
sprintf(extra, "WiFi write map compare OK\n"); sprintf(extra, "WiFi write map compare OK\n");
err = 0; err = 0;
@ -9946,7 +9946,7 @@ static int rtw_priv_set(struct net_device *dev,
} }
if (RTW_CANNOT_RUN(padapter)) { if (RTW_CANNOT_RUN(padapter)) {
RTW_INFO("%s fail =>(bSurpriseRemoved == true) || ( bDriverStopped == true)\n", __func__); RTW_INFO("%s fail =>(bSurpriseRemoved ) || ( bDriverStopped == true)\n", __func__);
return -ENETDOWN; return -ENETDOWN;
} }
@ -10012,7 +10012,7 @@ static int rtw_priv_get(struct net_device *dev,
} }
if (RTW_CANNOT_RUN(padapter)) { if (RTW_CANNOT_RUN(padapter)) {
RTW_INFO("%s fail =>(padapter->bSurpriseRemoved == true) || ( padapter->bDriverStopped == true)\n", __func__); RTW_INFO("%s fail =>(padapter->bSurpriseRemoved ) || ( padapter->bDriverStopped == true)\n", __func__);
return -ENETDOWN; return -ENETDOWN;
} }
@ -10148,7 +10148,7 @@ static int rtw_tdls_enable(struct net_device *dev,
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for (index = 0; index < NUM_STA; index++) { for (index = 0; index < NUM_STA; index++) {
if (!_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) { if (memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN)) {
RTW_INFO("issue tear down to "MAC_FMT"\n", MAC_ARG(tdls_sta[index])); RTW_INFO("issue tear down to "MAC_FMT"\n", MAC_ARG(tdls_sta[index]));
txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_;
_rtw_memcpy(txmgmt.peer, tdls_sta[index], ETH_ALEN); _rtw_memcpy(txmgmt.peer, tdls_sta[index], ETH_ALEN);
@ -10311,7 +10311,7 @@ static int rtw_tdls_ch_switch(struct net_device *dev,
rtw_pm_set_lps(padapter, PS_MODE_ACTIVE); rtw_pm_set_lps(padapter, PS_MODE_ACTIVE);
rtw_hal_get_hwreg(padapter, HW_VAR_CH_SW_NEED_TO_TAKE_CARE_IQK_INFO, &take_care_iqk); rtw_hal_get_hwreg(padapter, HW_VAR_CH_SW_NEED_TO_TAKE_CARE_IQK_INFO, &take_care_iqk);
if (take_care_iqk == true) { if (take_care_iqk ) {
u8 central_chnl; u8 central_chnl;
u8 bw_mode; u8 bw_mode;
@ -10645,7 +10645,7 @@ static int rtw_tdls_dis_result(struct net_device *dev,
RTW_INFO("[%s]\n", __func__); RTW_INFO("[%s]\n", __func__);
if (ptdlsinfo->dev_discovered == true) { if (ptdlsinfo->dev_discovered ) {
sprintf(extra, "\n\nDis=1\n"); sprintf(extra, "\n\nDis=1\n");
ptdlsinfo->dev_discovered = false; ptdlsinfo->dev_discovered = false;
} }
@ -10844,61 +10844,61 @@ static int rtw_tdls(struct net_device *dev,
/* WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now! */ /* WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now! */
if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) { if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) {
if (_rtw_memcmp(extra, "wfdenable=", 10)) { if (!memcmp(extra, "wfdenable=", 10)) {
wrqu->data.length -= 10; wrqu->data.length -= 10;
rtw_wx_tdls_wfd_enable(dev, info, wrqu, &extra[10]); rtw_wx_tdls_wfd_enable(dev, info, wrqu, &extra[10]);
return ret; return ret;
} }
} }
if (_rtw_memcmp(extra, "weaksec=", 8)) { if (!memcmp(extra, "weaksec=", 8)) {
wrqu->data.length -= 8; wrqu->data.length -= 8;
rtw_tdls_weaksec(dev, info, wrqu, &extra[8]); rtw_tdls_weaksec(dev, info, wrqu, &extra[8]);
return ret; return ret;
} else if (_rtw_memcmp(extra, "tdlsenable=", 11)) { } else if (!memcmp(extra, "tdlsenable=", 11)) {
wrqu->data.length -= 11; wrqu->data.length -= 11;
rtw_tdls_enable(dev, info, wrqu, &extra[11]); rtw_tdls_enable(dev, info, wrqu, &extra[11]);
return ret; return ret;
} }
if (_rtw_memcmp(extra, "setup=", 6)) { if (!memcmp(extra, "setup=", 6)) {
wrqu->data.length -= 6; wrqu->data.length -= 6;
rtw_tdls_setup(dev, info, wrqu, &extra[6]); rtw_tdls_setup(dev, info, wrqu, &extra[6]);
} else if (_rtw_memcmp(extra, "tear=", 5)) { } else if (!memcmp(extra, "tear=", 5)) {
wrqu->data.length -= 5; wrqu->data.length -= 5;
rtw_tdls_teardown(dev, info, wrqu, &extra[5]); rtw_tdls_teardown(dev, info, wrqu, &extra[5]);
} else if (_rtw_memcmp(extra, "dis=", 4)) { } else if (!memcmp(extra, "dis=", 4)) {
wrqu->data.length -= 4; wrqu->data.length -= 4;
rtw_tdls_discovery(dev, info, wrqu, &extra[4]); rtw_tdls_discovery(dev, info, wrqu, &extra[4]);
} else if (_rtw_memcmp(extra, "swoff=", 6)) { } else if (!memcmp(extra, "swoff=", 6)) {
wrqu->data.length -= 6; wrqu->data.length -= 6;
rtw_tdls_ch_switch_off(dev, info, wrqu, &extra[6]); rtw_tdls_ch_switch_off(dev, info, wrqu, &extra[6]);
} else if (_rtw_memcmp(extra, "sw=", 3)) { } else if (!memcmp(extra, "sw=", 3)) {
wrqu->data.length -= 3; wrqu->data.length -= 3;
rtw_tdls_ch_switch(dev, info, wrqu, &extra[3]); rtw_tdls_ch_switch(dev, info, wrqu, &extra[3]);
} else if (_rtw_memcmp(extra, "dumpstack=", 10)) { } else if (!memcmp(extra, "dumpstack=", 10)) {
wrqu->data.length -= 10; wrqu->data.length -= 10;
rtw_tdls_dump_ch(dev, info, wrqu, &extra[10]); rtw_tdls_dump_ch(dev, info, wrqu, &extra[10]);
} else if (_rtw_memcmp(extra, "offchnum=", 9)) { } else if (!memcmp(extra, "offchnum=", 9)) {
wrqu->data.length -= 9; wrqu->data.length -= 9;
rtw_tdls_off_ch_num(dev, info, wrqu, &extra[9]); rtw_tdls_off_ch_num(dev, info, wrqu, &extra[9]);
} else if (_rtw_memcmp(extra, "choffset=", 9)) { } else if (!memcmp(extra, "choffset=", 9)) {
wrqu->data.length -= 9; wrqu->data.length -= 9;
rtw_tdls_ch_offset(dev, info, wrqu, &extra[9]); rtw_tdls_ch_offset(dev, info, wrqu, &extra[9]);
} else if (_rtw_memcmp(extra, "pson=", 5)) { } else if (!memcmp(extra, "pson=", 5)) {
wrqu->data.length -= 5; wrqu->data.length -= 5;
rtw_tdls_pson(dev, info, wrqu, &extra[5]); rtw_tdls_pson(dev, info, wrqu, &extra[5]);
} else if (_rtw_memcmp(extra, "psoff=", 6)) { } else if (!memcmp(extra, "psoff=", 6)) {
wrqu->data.length -= 6; wrqu->data.length -= 6;
rtw_tdls_psoff(dev, info, wrqu, &extra[6]); rtw_tdls_psoff(dev, info, wrqu, &extra[6]);
} }
#ifdef CONFIG_WFD #ifdef CONFIG_WFD
if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) { if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST)) {
if (_rtw_memcmp(extra, "setip=", 6)) { if (!memcmp(extra, "setip=", 6)) {
wrqu->data.length -= 6; wrqu->data.length -= 6;
rtw_tdls_setip(dev, info, wrqu, &extra[6]); rtw_tdls_setip(dev, info, wrqu, &extra[6]);
} else if (_rtw_memcmp(extra, "tprobe=", 6)) } else if (!memcmp(extra, "tprobe=", 6))
issue_tunneled_probe_req((_adapter *)rtw_netdev_priv(dev)); issue_tunneled_probe_req((_adapter *)rtw_netdev_priv(dev));
} }
#endif /* CONFIG_WFD */ #endif /* CONFIG_WFD */
@ -10919,18 +10919,18 @@ static int rtw_tdls_get(struct net_device *dev,
RTW_INFO("[%s] extra = %s\n", __func__, (char *) wrqu->data.pointer); RTW_INFO("[%s] extra = %s\n", __func__, (char *) wrqu->data.pointer);
if (_rtw_memcmp(wrqu->data.pointer, "ip", 2)) if (!memcmp(wrqu->data.pointer, "ip", 2))
rtw_tdls_getip(dev, info, wrqu, extra); rtw_tdls_getip(dev, info, wrqu, extra);
else if (_rtw_memcmp(wrqu->data.pointer, "port", 4)) else if (!memcmp(wrqu->data.pointer, "port", 4))
rtw_tdls_getport(dev, info, wrqu, extra); rtw_tdls_getport(dev, info, wrqu, extra);
/* WFDTDLS, for sigma test */ /* WFDTDLS, for sigma test */
else if (_rtw_memcmp(wrqu->data.pointer, "dis", 3)) else if (!memcmp(wrqu->data.pointer, "dis", 3))
rtw_tdls_dis_result(dev, info, wrqu, extra); rtw_tdls_dis_result(dev, info, wrqu, extra);
else if (_rtw_memcmp(wrqu->data.pointer, "status", 6)) else if (!memcmp(wrqu->data.pointer, "status", 6))
rtw_wfd_tdls_status(dev, info, wrqu, extra); rtw_wfd_tdls_status(dev, info, wrqu, extra);
else if (_rtw_memcmp(wrqu->data.pointer, "tdls_sta=", 9)) else if (!memcmp(wrqu->data.pointer, "tdls_sta=", 9))
rtw_tdls_getsta(dev, info, wrqu, extra); rtw_tdls_getsta(dev, info, wrqu, extra);
else if (_rtw_memcmp(wrqu->data.pointer, "best_ch", 7)) else if (!memcmp(wrqu->data.pointer, "best_ch", 7))
rtw_tdls_get_best_ch(dev, info, wrqu, extra); rtw_tdls_get_best_ch(dev, info, wrqu, extra);
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
@ -11297,7 +11297,7 @@ static u8 pktcmp(PADAPTER padapter, u8 *txbuf, u32 txsz, u8 *rxbuf, u32 rxsz)
__func__, txsz - TXDESC_SIZE, rxpktsize - fcssize); __func__, txsz - TXDESC_SIZE, rxpktsize - fcssize);
ret = false; ret = false;
} else { } else {
ret = _rtw_memcmp(txbuf + TXDESC_SIZE, \ ret = !memcmp(txbuf + TXDESC_SIZE, \
rxbuf + RXDESC_SIZE + drvinfosize, \ rxbuf + RXDESC_SIZE + drvinfosize, \
txsz - TXDESC_SIZE); txsz - TXDESC_SIZE);
if (ret == false) if (ret == false)
@ -11377,7 +11377,7 @@ thread_return lbk_thread(thread_context context)
_rtw_down_sema(&ploopback->sema); _rtw_down_sema(&ploopback->sema);
err = pktcmp(padapter, ploopback->txbuf, ploopback->txsize, ploopback->rxbuf, ploopback->rxsize); err = pktcmp(padapter, ploopback->txbuf, ploopback->txsize, ploopback->rxbuf, ploopback->rxsize);
if (err == true) if (err )
ok++; ok++;
else else
fail++; fail++;
@ -11393,7 +11393,7 @@ thread_return lbk_thread(thread_context context)
if (signal_pending(current)) if (signal_pending(current))
flush_signals(current); flush_signals(current);
if ((ploopback->bstop == true) || if ((ploopback->bstop ) ||
((ploopback->cnt != 0) && (ploopback->cnt == cnt))) { ((ploopback->cnt != 0) && (ploopback->cnt == cnt))) {
u32 ok_rate, fail_rate, all; u32 ok_rate, fail_rate, all;
all = cnt; all = cnt;

View file

@ -749,7 +749,7 @@ int rtw_mp_ctx(struct net_device *dev,
if (sscanf(extra, "pktlen=%d", &pktlen) > 0) if (sscanf(extra, "pktlen=%d", &pktlen) > 0)
RTW_INFO("pktlen= %d\n", pktlen); RTW_INFO("pktlen= %d\n", pktlen);
if (_rtw_memcmp(extra, "destmac=", 8)) { if (!memcmp(extra, "destmac=", 8)) {
wrqu->length -= 8; wrqu->length -= 8;
rtw_set_ctx_destAddr(dev, info, wrqu, &extra[8]); rtw_set_ctx_destAddr(dev, info, wrqu, &extra[8]);
sprintf(extra, "Set dest mac OK !\n"); sprintf(extra, "Set dest mac OK !\n");

View file

@ -2787,7 +2787,7 @@ int _netdev_open(struct net_device *pnetdev)
#endif /* CONFIG_BR_EXT */ #endif /* CONFIG_BR_EXT */
#ifdef CONFIG_BT_COEXIST_SOCKET_TRX #ifdef CONFIG_BT_COEXIST_SOCKET_TRX
if (is_primary_adapter(padapter) && (true == pHalData->EEPROMBluetoothCoexist)) { if (is_primary_adapter(padapter) && (pHalData->EEPROMBluetoothCoexist)) {
rtw_btcoex_init_socket(padapter); rtw_btcoex_init_socket(padapter);
padapter->coex_info.BtMgnt.ExtConfig.HCIExtensionVer = 0x04; padapter->coex_info.BtMgnt.ExtConfig.HCIExtensionVer = 0x04;
rtw_btcoex_SetHciVersion(padapter, 0x04); rtw_btcoex_SetHciVersion(padapter, 0x04);
@ -2964,7 +2964,7 @@ int pm_netdev_open(struct net_device *pnetdev, u8 bnormal)
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
if (true == bnormal) { if (bnormal) {
_enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); _enter_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
status = _netdev_open(pnetdev); status = _netdev_open(pnetdev);
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL); _exit_critical_mutex(&(adapter_to_dvobj(padapter)->hw_init_mutex), NULL);
@ -3051,7 +3051,7 @@ static int netdev_close(struct net_device *pnetdev)
rtw_wapi_disable_tx(padapter); rtw_wapi_disable_tx(padapter);
#endif #endif
#ifdef CONFIG_BT_COEXIST_SOCKET_TRX #ifdef CONFIG_BT_COEXIST_SOCKET_TRX
if (is_primary_adapter(padapter) && (true == pHalData->EEPROMBluetoothCoexist)) if (is_primary_adapter(padapter) && (pHalData->EEPROMBluetoothCoexist))
rtw_btcoex_close_socket(padapter); rtw_btcoex_close_socket(padapter);
else else
RTW_INFO("CONFIG_BT_COEXIST: VIRTUAL_ADAPTER\n"); RTW_INFO("CONFIG_BT_COEXIST: VIRTUAL_ADAPTER\n");
@ -3827,7 +3827,7 @@ int rtw_suspend_common(_adapter *padapter)
#ifdef CONFIG_P2P_WOWLAN #ifdef CONFIG_P2P_WOWLAN
if (!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE) || P2P_ROLE_DISABLE != padapter->wdinfo.role) if (!rtw_p2p_chk_state(&padapter->wdinfo, P2P_STATE_NONE) || P2P_ROLE_DISABLE != padapter->wdinfo.role)
pwrpriv->wowlan_p2p_mode = true; pwrpriv->wowlan_p2p_mode = true;
if (true == pwrpriv->wowlan_p2p_mode) if (pwrpriv->wowlan_p2p_mode)
pwrpriv->wowlan_mode |= pwrpriv->wowlan_p2p_mode; pwrpriv->wowlan_mode |= pwrpriv->wowlan_p2p_mode;
#endif /* CONFIG_P2P_WOWLAN */ #endif /* CONFIG_P2P_WOWLAN */

View file

@ -703,15 +703,6 @@ inline void _rtw_memmove(void *dst, const void *src, u32 sz)
memmove(dst, src, sz); memmove(dst, src, sz);
} }
int _rtw_memcmp(const void *dst, const void *src, u32 sz)
{
/* under Linux/GNU/GLibc, the return value of memcmp for two same mem. chunk is 0 */
if (!(memcmp(dst, src, sz)))
return true;
else
return false;
}
void _rtw_init_listhead(_list *list) void _rtw_init_listhead(_list *list)
{ {
INIT_LIST_HEAD(list); INIT_LIST_HEAD(list);

View file

@ -289,9 +289,9 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8
eth_type = RTW_GET_BE16(&sub_skb->data[6]); eth_type = RTW_GET_BE16(&sub_skb->data[6]);
if (sub_skb->len >= 8 && if (sub_skb->len >= 8 &&
((_rtw_memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) && ((!memcmp(sub_skb->data, rtw_rfc1042_header, SNAP_SIZE) &&
eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) || eth_type != ETH_P_AARP && eth_type != ETH_P_IPX) ||
_rtw_memcmp(sub_skb->data, rtw_bridge_tunnel_header, SNAP_SIZE))) { !memcmp(sub_skb->data, rtw_bridge_tunnel_header, SNAP_SIZE))) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */ /* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
skb_pull(sub_skb, SNAP_SIZE); skb_pull(sub_skb, SNAP_SIZE);
_rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN); _rtw_memcpy(skb_push(sub_skb, ETH_ALEN), pattrib->src, ETH_ALEN);
@ -338,7 +338,7 @@ static int napi_recv(_adapter *padapter, int budget)
rx_ok = true; rx_ok = true;
next: next:
if (rx_ok == true) { if (rx_ok ) {
work_done++; work_done++;
DBG_COUNTER(padapter->rx_logs.os_netif_ok); DBG_COUNTER(padapter->rx_logs.os_netif_ok);
} else { } else {
@ -383,7 +383,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri
/* Indicat the packets to upper layer */ /* Indicat the packets to upper layer */
if (pkt) { if (pkt) {
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE) ) {
_pkt *pskb2 = NULL; _pkt *pskb2 = NULL;
struct sta_info *psta = NULL; struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
@ -391,7 +391,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri
/* RTW_INFO("bmcast=%d\n", bmcast); */ /* RTW_INFO("bmcast=%d\n", bmcast); */
if (_rtw_memcmp(pattrib->dst, adapter_mac_addr(padapter), ETH_ALEN) == false) { if (!memcmp(pattrib->dst, adapter_mac_addr(padapter), ETH_ALEN) == false) {
/* RTW_INFO("not ap psta=%p, addr=%pM\n", psta, pattrib->dst); */ /* RTW_INFO("not ap psta=%p, addr=%pM\n", psta, pattrib->dst); */
if (bmcast) { if (bmcast) {
@ -438,7 +438,7 @@ void rtw_os_recv_indicate_pkt(_adapter *padapter, _pkt *pkt, struct rx_pkt_attri
#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */ #endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35)) */
if (br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) == true)) { if (br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) )) {
if (nat25_handle_frame(padapter, pkt) == -1) { if (nat25_handle_frame(padapter, pkt) == -1) {
/* priv->ext_stats.rx_data_drops++; */ /* priv->ext_stats.rx_data_drops++; */
/* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */ /* DEBUG_ERR("RX DROP: nat25_handle_frame fail!\n"); */
@ -734,11 +734,11 @@ int rtw_recv_indicatepkt(_adapter *padapter, union recv_frame *precv_frame)
u8 *ip = pkt->data + 14; u8 *ip = pkt->data + 14;
if (GET_IPV4_PROTOCOL(ip) == 0x06 /* TCP */ if (GET_IPV4_PROTOCOL(ip) == 0x06 /* TCP */
&& rtw_st_ctl_chk_reg_s_proto(&sta->st_ctl, 0x06) == true && rtw_st_ctl_chk_reg_s_proto(&sta->st_ctl, 0x06)
) { ) {
u8 *tcp = ip + GET_IPV4_IHL(ip) * 4; u8 *tcp = ip + GET_IPV4_IHL(ip) * 4;
if (rtw_st_ctl_chk_reg_rule(&sta->st_ctl, padapter, IPV4_DST(ip), TCP_DST(tcp), IPV4_SRC(ip), TCP_SRC(tcp)) == true) { if (rtw_st_ctl_chk_reg_rule(&sta->st_ctl, padapter, IPV4_DST(ip), TCP_DST(tcp), IPV4_SRC(ip), TCP_SRC(tcp)) ) {
if (GET_TCP_SYN(tcp) && GET_TCP_ACK(tcp)) { if (GET_TCP_SYN(tcp) && GET_TCP_ACK(tcp)) {
session_tracker_add_cmd(padapter, sta session_tracker_add_cmd(padapter, sta
, IPV4_DST(ip), TCP_DST(tcp) , IPV4_DST(ip), TCP_DST(tcp)

View file

@ -636,9 +636,9 @@ static int proc_get_tx_info_msg(struct seq_file *m, void *v)
plist = get_next(plist); plist = get_next(plist);
if ((_rtw_memcmp(psta->hwaddr, bc_addr, 6) != true) if ((memcmp(psta->hwaddr, bc_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, null_addr, 6) != true) && (memcmp(psta->hwaddr, null_addr, 6))
&& (_rtw_memcmp(psta->hwaddr, adapter_mac_addr(padapter), 6) != true)) { && (memcmp(psta->hwaddr, adapter_mac_addr(padapter), 6))) {
switch (psta->bw_mode) { switch (psta->bw_mode) {

View file

@ -704,7 +704,7 @@ static int rtw_resume_process(_adapter *padapter)
#endif /* kernel < 2.6.32 */ #endif /* kernel < 2.6.32 */
RTW_INFO("pwrpriv->bAutoResume (%x)\n", pwrpriv->bAutoResume); RTW_INFO("pwrpriv->bAutoResume (%x)\n", pwrpriv->bAutoResume);
if (true == pwrpriv->bAutoResume) { if (pwrpriv->bAutoResume) {
pwrpriv->bInternalAutoSuspend = false; pwrpriv->bInternalAutoSuspend = false;
pwrpriv->bAutoResume = false; pwrpriv->bAutoResume = false;
RTW_INFO("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n", pwrpriv->bAutoResume, pwrpriv->bInternalAutoSuspend); RTW_INFO("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n", pwrpriv->bAutoResume, pwrpriv->bInternalAutoSuspend);
@ -734,7 +734,7 @@ static int rtw_resume_process(_adapter *padapter)
#endif #endif
#ifdef CONFIG_BT_COEXIST /* for 8723as-vau */ #ifdef CONFIG_BT_COEXIST /* for 8723as-vau */
RTW_INFO("pwrpriv->bAutoResume (%x)\n", pwrpriv->bAutoResume); RTW_INFO("pwrpriv->bAutoResume (%x)\n", pwrpriv->bAutoResume);
if (true == pwrpriv->bAutoResume) { if (pwrpriv->bAutoResume) {
pwrpriv->bInternalAutoSuspend = false; pwrpriv->bInternalAutoSuspend = false;
pwrpriv->bAutoResume = false; pwrpriv->bAutoResume = false;
RTW_INFO("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n", pwrpriv->bAutoResume, pwrpriv->bInternalAutoSuspend); RTW_INFO("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n", pwrpriv->bAutoResume, pwrpriv->bInternalAutoSuspend);

View file

@ -374,9 +374,9 @@ int rtw_mlcst2unicst(_adapter *padapter, struct sk_buff *skb)
} }
/* avoid come from STA1 and send back STA1 */ /* avoid come from STA1 and send back STA1 */
if (_rtw_memcmp(psta->hwaddr, &skb->data[6], 6) == true if (!memcmp(psta->hwaddr, &skb->data[6], 6)
|| _rtw_memcmp(psta->hwaddr, null_addr, 6) == true || !memcmp(psta->hwaddr, null_addr, 6)
|| _rtw_memcmp(psta->hwaddr, bc_addr, 6) == true || !memcmp(psta->hwaddr, bc_addr, 6)
) { ) {
DBG_COUNTER(padapter->tx_logs.os_tx_m2u_ignore_self); DBG_COUNTER(padapter->tx_logs.os_tx_m2u_ignore_self);
continue; continue;
@ -441,7 +441,7 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
#ifdef CONFIG_TX_MCAST2UNI #ifdef CONFIG_TX_MCAST2UNI
if (!rtw_mc2u_disable if (!rtw_mc2u_disable
&& check_fwstate(pmlmepriv, WIFI_AP_STATE) == true && check_fwstate(pmlmepriv, WIFI_AP_STATE)
&& (IP_MCAST_MAC(pkt->data) && (IP_MCAST_MAC(pkt->data)
|| ICMPV6_MCAST_MAC(pkt->data) || ICMPV6_MCAST_MAC(pkt->data)
#ifdef CONFIG_TX_BCAST2UNI #ifdef CONFIG_TX_BCAST2UNI
@ -452,7 +452,7 @@ int _rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
) { ) {
if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME / 4)) { if (pxmitpriv->free_xmitframe_cnt > (NR_XMITFRAME / 4)) {
res = rtw_mlcst2unicst(padapter, pkt); res = rtw_mlcst2unicst(padapter, pkt);
if (res == true) if (res)
goto exit; goto exit;
} else { } else {
/* RTW_INFO("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt); */ /* RTW_INFO("Stop M2U(%d, %d)! ", pxmitpriv->free_xmitframe_cnt, pxmitpriv->free_xmitbuf_cnt); */
@ -489,7 +489,7 @@ int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
int ret = 0; int ret = 0;
if (pkt) { if (pkt) {
if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_MONITOR_STATE)) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
rtw_monitor_xmit_entry((struct sk_buff *)pkt, pnetdev); rtw_monitor_xmit_entry((struct sk_buff *)pkt, pnetdev);
#endif #endif