Commit 3f95106e authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: rtl8188eu: cleanup remaining comparsions to true

Cleanup remaining comparsions to true.
if (x == true) -> if (x)
if (x != true) -> if (!x)
if (!x == true) -> if (!x)
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16c44c57
...@@ -629,7 +629,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf) ...@@ -629,7 +629,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
} }
/* setting only at first time */ /* setting only at first time */
if (pmlmepriv->cur_network.join_res != true) { if (!pmlmepriv->cur_network.join_res) {
/* WEP Key will be set before this function, do not /* WEP Key will be set before this function, do not
* clear CAM. * clear CAM.
*/ */
...@@ -756,7 +756,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len) ...@@ -756,7 +756,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
DBG_88E("%s, len =%d\n", __func__, len); DBG_88E("%s, len =%d\n", __func__, len);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return _FAIL; return _FAIL;
if (len < 0 || len > MAX_IE_SZ) if (len < 0 || len > MAX_IE_SZ)
......
...@@ -240,7 +240,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, ...@@ -240,7 +240,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC);
...@@ -820,7 +820,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz) ...@@ -820,7 +820,7 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
pmlmepriv = &padapter->mlmepriv; pmlmepriv = &padapter->mlmepriv;
#ifdef CONFIG_88EU_AP_MODE #ifdef CONFIG_88EU_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
expire_timeout_chk(padapter); expire_timeout_chk(padapter);
#endif #endif
...@@ -836,13 +836,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type) ...@@ -836,13 +836,13 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 mstatus; u8 mstatus;
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))
return; return;
switch (lps_ctrl_type) { switch (lps_ctrl_type) {
case LPS_CTRL_SCAN: case LPS_CTRL_SCAN:
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
/* connect */ /* connect */
LPS_Leave(padapter); LPS_Leave(padapter);
} }
......
...@@ -315,8 +315,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst) ...@@ -315,8 +315,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst)
d_cap = le16_to_cpu(le_dcap); d_cap = le16_to_cpu(le_dcap);
return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) && return ((src->Ssid.SsidLength == dst->Ssid.SsidLength) &&
((!memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) == true) && (!memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) &&
((!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_ESS) == ((s_cap & WLAN_CAPABILITY_ESS) ==
...@@ -386,8 +386,8 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex ...@@ -386,8 +386,8 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
{ {
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
(is_same_network(&(pmlmepriv->cur_network.network), pnetwork))) { is_same_network(&pmlmepriv->cur_network.network, pnetwork)) {
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(struct ndis_802_11_fixed_ie), rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fixed_ie),
pmlmepriv->cur_network.network.ie_length); pmlmepriv->cur_network.network.ie_length);
...@@ -529,7 +529,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network * ...@@ -529,7 +529,7 @@ static int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *
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;
} }
...@@ -561,7 +561,7 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf) ...@@ -561,7 +561,7 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
/* 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 (!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;
...@@ -614,7 +614,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf) ...@@ -614,7 +614,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
rtw_set_signal_stat_timer(&adapter->recvpriv); rtw_set_signal_stat_timer(&adapter->recvpriv);
if (pmlmepriv->to_join) { 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)) { if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
set_fwstate(pmlmepriv, _FW_UNDER_LINKING); set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
...@@ -1005,14 +1005,14 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) ...@@ -1005,14 +1005,14 @@ void rtw_joinbss_event_prehandle(struct 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;
} }
} }
} else { } else {
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;
} }
...@@ -1028,7 +1028,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) ...@@ -1028,7 +1028,7 @@ void rtw_joinbss_event_prehandle(struct 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) { if (!ptarget_sta) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Can't update stainfo when joinbss_event callback\n"));
...@@ -1038,7 +1038,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) ...@@ -1038,7 +1038,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
} }
/* s4. indicate connect */ /* s4. indicate connect */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
rtw_indicate_connect(adapter); rtw_indicate_connect(adapter);
} else { } else {
/* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */ /* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */
...@@ -1063,7 +1063,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) ...@@ -1063,7 +1063,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
mod_timer(&pmlmepriv->assoc_timer, mod_timer(&pmlmepriv->assoc_timer,
jiffies + msecs_to_jiffies(1)); jiffies + msecs_to_jiffies(1));
if ((check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("fail! clear _FW_UNDER_LINKING ^^^fw_state=%x\n", get_fwstate(pmlmepriv))); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("fail! clear _FW_UNDER_LINKING ^^^fw_state=%x\n", get_fwstate(pmlmepriv)));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
} }
...@@ -1488,7 +1488,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) ...@@ -1488,7 +1488,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
} }
/* 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)) {
DBG_88E("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__); DBG_88E("%s: _FW_LINKED while ask_for_joinbss!!!\n", __func__);
rtw_disassoc_cmd(adapter, 0, true); rtw_disassoc_cmd(adapter, 0, true);
......
...@@ -650,8 +650,8 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame, ...@@ -650,8 +650,8 @@ int sta2sta_data_frame(struct adapter *adapter, struct recv_frame *precv_frame,
u8 *sta_addr = NULL; u8 *sta_addr = NULL;
bool mcast = is_multicast_ether_addr(pattrib->dst); bool mcast = is_multicast_ether_addr(pattrib->dst);
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 (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA==myself\n")); RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA==myself\n"));
...@@ -729,9 +729,9 @@ static int ap2sta_data_frame( ...@@ -729,9 +729,9 @@ static int ap2sta_data_frame(
u8 *myhwaddr = myid(&adapter->eeprompriv); u8 *myhwaddr = myid(&adapter->eeprompriv);
bool mcast = is_multicast_ether_addr(pattrib->dst); bool mcast = is_multicast_ether_addr(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))) { 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 (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) { if (!memcmp(myhwaddr, pattrib->src, ETH_ALEN)) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA==myself\n")); RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (" SA==myself\n"));
...@@ -817,7 +817,7 @@ static int sta2ap_data_frame(struct adapter *adapter, ...@@ -817,7 +817,7 @@ static int sta2ap_data_frame(struct adapter *adapter,
unsigned char *mybssid = get_bssid(pmlmepriv); unsigned char *mybssid = get_bssid(pmlmepriv);
int ret = _SUCCESS; int 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 (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) { if (memcmp(pattrib->bssid, mybssid, ETH_ALEN)) {
ret = _FAIL; ret = _FAIL;
...@@ -949,7 +949,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter, ...@@ -949,7 +949,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
spin_unlock_bh(&psta->sleep_q.lock); spin_unlock_bh(&psta->sleep_q.lock);
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);
spin_lock_bh(&psta->sleep_q.lock); spin_lock_bh(&psta->sleep_q.lock);
...@@ -1838,7 +1838,7 @@ void rtw_reordering_ctrl_timeout_handler(struct timer_list *t) ...@@ -1838,7 +1838,7 @@ void rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
spin_lock_bh(&ppending_recvframe_queue->lock); spin_lock_bh(&ppending_recvframe_queue->lock);
if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true) == true) if (recv_indicatepkts_in_order(padapter, preorder_ctrl, true))
mod_timer(&preorder_ctrl->reordering_ctrl_timer, mod_timer(&preorder_ctrl->reordering_ctrl_timer,
jiffies + msecs_to_jiffies(REORDER_WAIT_TIME)); jiffies + msecs_to_jiffies(REORDER_WAIT_TIME));
......
...@@ -429,7 +429,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -429,7 +429,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
while (phead != plist) { while (phead != plist) {
psta = container_of(plist, struct sta_info, hash_list); psta = container_of(plist, struct sta_info, hash_list);
if ((!memcmp(psta->hwaddr, addr, ETH_ALEN)) == true) { if (!memcmp(psta->hwaddr, addr, ETH_ALEN)) {
/* if found the matched address */ /* if found the matched address */
break; break;
} }
......
...@@ -190,7 +190,7 @@ static unsigned int ratetbl2rateset(struct adapter *padapter, unsigned char *rat ...@@ -190,7 +190,7 @@ static unsigned int ratetbl2rateset(struct adapter *padapter, unsigned char *rat
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;
......
...@@ -467,7 +467,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p ...@@ -467,7 +467,8 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra: %pM\n", (pattrib->ra))); RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra: %pM\n", (pattrib->ra)));
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)) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
...@@ -758,7 +759,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr ...@@ -758,7 +759,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
SetFrameSubType(fctrl, pattrib->subtype); SetFrameSubType(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)) {
/* to_ds = 1, fr_ds = 0; */ /* to_ds = 1, fr_ds = 0; */
/* Data transfer to AP */ /* Data transfer to AP */
SetToDs(fctrl); SetToDs(fctrl);
...@@ -1984,7 +1985,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst ...@@ -1984,7 +1985,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
pxmitframe->attrib.triggered = 1; pxmitframe->attrib.triggered = 1;
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);
if ((psta->sleepq_ac_len == 0) && (!psta->has_legacy_ac) && (wmmps_ac)) { if ((psta->sleepq_ac_len == 0) && (!psta->has_legacy_ac) && (wmmps_ac)) {
......
...@@ -285,7 +285,7 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state) ...@@ -285,7 +285,7 @@ static inline void _clr_fwstate_(struct mlme_priv *pmlmepriv, int state)
static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state) static inline void clr_fwstate(struct mlme_priv *pmlmepriv, int state)
{ {
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
if (check_fwstate(pmlmepriv, state) == true) if (check_fwstate(pmlmepriv, state))
pmlmepriv->fw_state ^= state; pmlmepriv->fw_state ^= state;
spin_unlock_bh(&pmlmepriv->lock); spin_unlock_bh(&pmlmepriv->lock);
} }
......
...@@ -296,7 +296,7 @@ static char *translate_scan(struct adapter *padapter, ...@@ -296,7 +296,7 @@ static char *translate_scan(struct adapter *padapter,
iwe.cmd = IWEVQUAL; iwe.cmd = IWEVQUAL;
iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID; iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true && if (check_fwstate(pmlmepriv, _FW_LINKED) &&
is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network)) { is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network)) {
ss = padapter->recvpriv.signal_strength; ss = padapter->recvpriv.signal_strength;
sq = padapter->recvpriv.signal_qual; sq = padapter->recvpriv.signal_qual;
...@@ -631,7 +631,7 @@ static int rtw_wx_get_name(struct net_device *dev, ...@@ -631,7 +631,7 @@ static int rtw_wx_get_name(struct net_device *dev,
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("cmd_code =%x\n", info->cmd)); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("cmd_code =%x\n", info->cmd));
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->ie_length-12); p = rtw_get_ie(&pcur_bss->ies[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->ie_length-12);
if (p && ht_ielen > 0) if (p && ht_ielen > 0)
...@@ -1024,9 +1024,9 @@ static int rtw_wx_get_wap(struct net_device *dev, ...@@ -1024,9 +1024,9 @@ static int rtw_wx_get_wap(struct net_device *dev,
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_wap\n")); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_wap\n"));
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))
memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN); memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN);
else else
eth_zero_addr(wrqu->ap_addr.sa_data); eth_zero_addr(wrqu->ap_addr.sa_data);
...@@ -1335,7 +1335,7 @@ static int rtw_wx_set_essid(struct net_device *dev, ...@@ -1335,7 +1335,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_,
("rtw_wx_set_essid: find match, set infra mode\n")); ("rtw_wx_set_essid: find match, set infra mode\n"));
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;
} }
...@@ -1691,7 +1691,7 @@ static int rtw_wx_get_enc(struct net_device *dev, ...@@ -1691,7 +1691,7 @@ static int rtw_wx_get_enc(struct net_device *dev,
struct iw_point *erq = &(wrqu->encoding); struct iw_point *erq = &(wrqu->encoding);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if (check_fwstate(pmlmepriv, _FW_LINKED) != true) { if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
if (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { if (!check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
erq->length = 0; erq->length = 0;
erq->flags |= IW_ENCODE_DISABLED; erq->flags |= IW_ENCODE_DISABLED;
...@@ -2425,7 +2425,7 @@ static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int ...@@ -2425,7 +2425,7 @@ static int rtw_set_beacon(struct net_device *dev, struct ieee_param *param, int
DBG_88E("%s, len =%d\n", __func__, len); DBG_88E("%s, len =%d\n", __func__, len);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2); memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
...@@ -2517,7 +2517,7 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param) ...@@ -2517,7 +2517,7 @@ static int rtw_del_sta(struct net_device *dev, struct ieee_param *param)
DBG_88E("rtw_del_sta =%pM\n", (param->sta_addr)); DBG_88E("rtw_del_sta =%pM\n", (param->sta_addr));
if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) if (!check_fwstate(pmlmepriv, _FW_LINKED | WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
if (is_broadcast_ether_addr(param->sta_addr)) if (is_broadcast_ether_addr(param->sta_addr))
...@@ -2553,7 +2553,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par ...@@ -2553,7 +2553,7 @@ static int rtw_ioctl_get_sta_data(struct net_device *dev, struct ieee_param *par
DBG_88E("rtw_ioctl_get_sta_info, sta_addr: %pM\n", (param_ex->sta_addr)); DBG_88E("rtw_ioctl_get_sta_info, sta_addr: %pM\n", (param_ex->sta_addr));
if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) if (!check_fwstate(pmlmepriv, _FW_LINKED | WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
if (is_broadcast_ether_addr(param_ex->sta_addr)) if (is_broadcast_ether_addr(param_ex->sta_addr))
...@@ -2607,7 +2607,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) ...@@ -2607,7 +2607,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param)
DBG_88E("rtw_get_sta_wpaie, sta_addr: %pM\n", (param->sta_addr)); DBG_88E("rtw_get_sta_wpaie, sta_addr: %pM\n", (param->sta_addr));
if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true) if (!check_fwstate(pmlmepriv, _FW_LINKED | WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
if (is_broadcast_ether_addr(param->sta_addr)) if (is_broadcast_ether_addr(param->sta_addr))
...@@ -2645,7 +2645,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, ...@@ -2645,7 +2645,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param,
DBG_88E("%s, len =%d\n", __func__, len); DBG_88E("%s, len =%d\n", __func__, len);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
ie_len = len-12-2;/* 12 = param header, 2:no packed */ ie_len = len-12-2;/* 12 = param header, 2:no packed */
...@@ -2680,7 +2680,7 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par ...@@ -2680,7 +2680,7 @@ static int rtw_set_wps_probe_resp(struct net_device *dev, struct ieee_param *par
DBG_88E("%s, len =%d\n", __func__, len); DBG_88E("%s, len =%d\n", __func__, len);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
ie_len = len-12-2;/* 12 = param header, 2:no packed */ ie_len = len-12-2;/* 12 = param header, 2:no packed */
...@@ -2710,7 +2710,7 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par ...@@ -2710,7 +2710,7 @@ static int rtw_set_wps_assoc_resp(struct net_device *dev, struct ieee_param *par
DBG_88E("%s, len =%d\n", __func__, len); DBG_88E("%s, len =%d\n", __func__, len);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
ie_len = len-12-2;/* 12 = param header, 2:no packed */ ie_len = len-12-2;/* 12 = param header, 2:no packed */
...@@ -2742,7 +2742,7 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param, ...@@ -2742,7 +2742,7 @@ static int rtw_set_hidden_ssid(struct net_device *dev, struct ieee_param *param,
u8 value; u8 value;
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
if (param->u.wpa_param.name != 0) /* dummy test... */ if (param->u.wpa_param.name != 0) /* dummy test... */
...@@ -2762,7 +2762,7 @@ static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *p ...@@ -2762,7 +2762,7 @@ static int rtw_ioctl_acl_remove_sta(struct net_device *dev, struct ieee_param *p
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
if (is_broadcast_ether_addr(param->sta_addr)) if (is_broadcast_ether_addr(param->sta_addr))
...@@ -2776,7 +2776,7 @@ static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *para ...@@ -2776,7 +2776,7 @@ static int rtw_ioctl_acl_add_sta(struct net_device *dev, struct ieee_param *para
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
if (is_broadcast_ether_addr(param->sta_addr)) if (is_broadcast_ether_addr(param->sta_addr))
...@@ -2791,7 +2791,7 @@ static int rtw_ioctl_set_macaddr_acl(struct net_device *dev, struct ieee_param * ...@@ -2791,7 +2791,7 @@ static int rtw_ioctl_set_macaddr_acl(struct net_device *dev, struct ieee_param *
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true) if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
return -EINVAL; return -EINVAL;
rtw_set_macaddr_acl(padapter, param->u.mlme.command); rtw_set_macaddr_acl(padapter, param->u.mlme.command);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment