pmlmeext->sitesurvey_res.bss_cnt = 0;
pmlmeext->scan_abort = false;
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
pmlmeinfo->reauth_count = 0;
pmlmeinfo->reassoc_count = 0;
pmlmeinfo->link_count = 0;
return _SUCCESS;
}
- if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) &&
+ if (((pmlmeinfo->state & 0x03) == MSR_AP) &&
(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
psta = rtw_get_stainfo23a(pstapriv, mgmt->sa);
if (psta) {
pkt_len, psta);
}
}
- } else if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
+ } else if ((pmlmeinfo->state&0x03) == MSR_ADHOC) {
psta = rtw_get_stainfo23a(pstapriv, mgmt->sa);
if (psta) {
/* update WMM, ERP in the beacon */
u16 auth_mode, seq, algorithm;
int status, len = skb->len;
- if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) != MSR_AP)
return _FAIL;
DBG_8723A("+OnAuth23a\n");
uint pkt_len = skb->len;
int r;
- if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) != MSR_AP)
return _FAIL;
left = pkt_len - sizeof(struct ieee80211_hdr_3addr);
status = le16_to_cpu(pmgmt->u.assoc_resp.status_code);
if (status > 0) {
DBG_8723A("assoc reject, status code: %d\n", status);
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
res = -4;
goto report_assoc_result;
}
DBG_8723A("%s\n", __func__);
- if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state&0x03) != MSR_AP)
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
return _SUCCESS;
pframe = mgmt->u.beacon.variable;
pattrib->pktlen = offsetof(struct ieee80211_mgmt, u.beacon.variable);
- if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
+ if ((pmlmeinfo->state & 0x03) == MSR_AP) {
u8 *iebuf;
int buflen;
/* DBG_8723A("ie len =%d\n", cur_network->IELength); */
pframe = rtw_set_ie23a(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)
&cur_network->DSConfig, &pattrib->pktlen);
- /* if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */
+ /* if ((pmlmeinfo->state&0x03) == MSR_ADHOC) */
{
u8 erpinfo = 0;
u32 ATIMWindow;
/* below for ad-hoc mode */
#ifdef CONFIG_8723AU_AP_MODE
- if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
+ if ((pmlmeinfo->state & 0x03) == MSR_AP) {
pwps_ie = cfg80211_find_vendor_ie(WLAN_OUI_MICROSOFT,
WLAN_OUI_TYPE_MICROSOFT_WPS,
cur_network->IEs,
(unsigned char *)&cur_network->DSConfig,
&pattrib->pktlen);
- if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
+ if ((pmlmeinfo->state & 0x03) == MSR_ADHOC) {
u8 erpinfo = 0;
u32 ATIMWindow;
/* IBSS Parameter Set... */
pwlanhdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
IEEE80211_STYPE_NULLFUNC);
- if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state&0x03) == MSR_AP)
pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
- else if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+ else if ((pmlmeinfo->state&0x03) == MSR_INFRA)
pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_TODS);
if (power_mode)
pwlanhdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
IEEE80211_STYPE_QOS_NULLFUNC);
- if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state&0x03) == MSR_AP)
pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
- else if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+ else if ((pmlmeinfo->state&0x03) == MSR_INFRA)
pwlanhdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_TODS);
if (pattrib->mdata)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
u16 tid;
- if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state&0x03) != MSR_AP)
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
return _SUCCESS;
rtl8723a_SetBeaconRelatedRegisters(padapter);
- /* set msr to WIFI_FW_ADHOC_STATE */
- pmlmeinfo->state = WIFI_FW_ADHOC_STATE;
+ /* set msr to MSR_ADHOC */
+ pmlmeinfo->state = MSR_ADHOC;
rtl8723a_set_media_status(padapter, pmlmeinfo->state & 0x3);
/* issue beacon */
- if (send_beacon23a(padapter) == _FAIL)
- {
+ if (send_beacon23a(padapter) == _FAIL) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("issuing beacon frame fail....\n"));
report_join_res23a(padapter, -1);
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
- }
- else
- {
+ pmlmeinfo->state = MSR_NOLINK;
+ } else {
hw_var_set_bssid(padapter, padapter->registrypriv.dev_network.MacAddress);
hw_var_set_mlme_join(padapter, 0);
/* switch channel */
set_channel_bwmode23a(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
- rtl8723a_set_media_status(padapter, WIFI_FW_STATION_STATE);
+ rtl8723a_set_media_status(padapter, MSR_INFRA);
val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) ?
0xcc: 0xcf;
set_link_timer(pmlmeext, beacon_timeout);
mod_timer(&padapter->mlmepriv.assoc_timer, jiffies +
msecs_to_jiffies((REAUTH_TO * REAUTH_LIMIT) + (REASSOC_TO*REASSOC_LIMIT) + beacon_timeout));
- pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE;
+ pmlmeinfo->state = WIFI_FW_AUTH_NULL | MSR_INFRA;
} else if (caps & WLAN_CAPABILITY_IBSS) { /* adhoc client */
- rtl8723a_set_media_status(padapter, WIFI_FW_ADHOC_STATE);
+ rtl8723a_set_media_status(padapter, MSR_ADHOC);
rtl8723a_set_sec_cfg(padapter, 0xcf);
rtl8723a_SetBeaconRelatedRegisters(padapter);
- pmlmeinfo->state = WIFI_FW_ADHOC_STATE;
+ pmlmeinfo->state = MSR_ADHOC;
report_join_res23a(padapter, 1);
}
DBG_8723A("%s\n", __func__);
- if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+ if ((pmlmeinfo->state&0x03) == MSR_INFRA)
{
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)
{
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
report_del_sta_event23a(padapter, MacAddr, reason);
}
else if (pmlmeinfo->state & WIFI_FW_LINKING_STATE)
{
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
report_join_res23a(padapter, -2);
}
}
goto exit_mlmeext_joinbss_event_callback23a;
}
- if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)
+ if ((pmlmeinfo->state&0x03) == MSR_ADHOC)
{
/* for bc/mc */
psta_bmc = rtw_get_bcmc_stainfo23a(padapter);
hw_var_set_mlme_join(padapter, 2);
- if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) {
+ if ((pmlmeinfo->state&0x03) == MSR_INFRA) {
/* correcting TSF */
rtw_correct_TSF(padapter);
DBG_8723A("%s\n", __func__);
- if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
+ if ((pmlmeinfo->state & 0x03) == MSR_ADHOC) {
/* adhoc master or sta_count>1 */
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)
{
if (send_beacon23a(padapter) != _SUCCESS) {
pmlmeinfo->FW_sta_info[psta->mac_id].status = 0;
- pmlmeinfo->state ^= WIFI_FW_ADHOC_STATE;
+ pmlmeinfo->state ^= MSR_ADHOC;
return;
}
flush_all_cam_entry23a(padapter);
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
/* set MSR to no link state -> infra. mode */
- rtl8723a_set_media_status(padapter, _HW_STATE_STATION_);
+ rtl8723a_set_media_status(padapter, MSR_INFRA);
del_timer_sync(&pmlmeext->link_timer);
}
if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) {
DBG_8723A("link_timer_hdl:no beacon while connecting\n");
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
report_join_res23a(padapter, -3);
} else if (pmlmeinfo->state & WIFI_FW_AUTH_STATE) {
/* re-auth timer */
} else if (pmlmeinfo->state & WIFI_FW_ASSOC_STATE) {
/* re-assoc timer */
if (++pmlmeinfo->reassoc_count > REASSOC_LIMIT) {
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
report_join_res23a(padapter, -2);
return;
}
switch (psetop->mode) {
case NL80211_IFTYPE_P2P_GO:
case NL80211_IFTYPE_AP:
- pmlmeinfo->state = WIFI_FW_AP_STATE;
- type = _HW_STATE_AP_;
+ pmlmeinfo->state = MSR_AP;
+ type = MSR_AP;
break;
case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_STATION:
/* clear state */
pmlmeinfo->state &= ~(BIT(0)|BIT(1));
/* set to STATION_STATE */
- pmlmeinfo->state |= WIFI_FW_STATION_STATE;
- type = _HW_STATE_STATION_;
+ pmlmeinfo->state |= MSR_INFRA;
+ type = MSR_INFRA;
break;
case NL80211_IFTYPE_ADHOC:
- type = _HW_STATE_ADHOC_;
+ type = MSR_ADHOC;
break;
default:
- type = _HW_STATE_NOLINK_;
+ type = MSR_NOLINK;
break;
}
if (pparm->ifmode == NL80211_IFTYPE_AP ||
pparm->ifmode == NL80211_IFTYPE_P2P_GO) {
#ifdef CONFIG_8723AU_AP_MODE
- if (pmlmeinfo->state == WIFI_FW_AP_STATE) {
+ if (pmlmeinfo->state == MSR_AP) {
/* todo: */
return H2C_SUCCESS;
}
/* check already connecting to AP or not */
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {
- if (pmlmeinfo->state & WIFI_FW_STATION_STATE)
+ if (pmlmeinfo->state & MSR_INFRA)
issue_deauth_ex(padapter, pnetwork->MacAddress,
WLAN_REASON_DEAUTH_LEAVING, 5, 100);
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
/* clear CAM */
flush_all_cam_entry23a(padapter);
del_timer_sync(&pmlmeext->link_timer);
/* set MSR to nolink -> infra. mode */
- /* rtl8723a_set_media_status(padapter, _HW_STATE_NOLINK_); */
- rtl8723a_set_media_status(padapter, _HW_STATE_STATION_);
+ rtl8723a_set_media_status(padapter, MSR_INFRA);
hw_var_set_mlme_disconnect(padapter);
}
/* set_opmode_cmd(padapter, infra_client_with_mlme); */
- /* pmlmeinfo->state = WIFI_FW_NULL_STATE; */
+ /* pmlmeinfo->state = MSR_NOLINK; */
hw_var_set_mlme_disconnect(padapter);
hw_var_set_bssid(padapter, null_addr);
/* restore to initial setting. */
update_tx_basic_rate23a(padapter, padapter->registrypriv.wireless_mode);
- if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE ||
- (pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) == MSR_ADHOC ||
+ (pmlmeinfo->state & 0x03) == MSR_AP)
rtl8723a_set_bcn_func(padapter, 0); /* Stop BCN */
/* set MSR to no link state -> infra. mode */
- rtl8723a_set_media_status(padapter, _HW_STATE_STATION_);
+ rtl8723a_set_media_status(padapter, MSR_INFRA);
- pmlmeinfo->state = WIFI_FW_NULL_STATE;
+ pmlmeinfo->state = MSR_NOLINK;
/* switch to the 20M Hz mode after disconnect */
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20;
rtl8723a_set_initial_gain(padapter, initialgain);
/* set MSR to no link state */
- rtl8723a_set_media_status(padapter, _HW_STATE_NOLINK_);
+ rtl8723a_set_media_status(padapter, MSR_NOLINK);
rtl8723a_mlme_sitesurvey(padapter, 1);
DBG_8723A_LEVEL(_drv_always_, "set pairwise key to hw: alg:%d(WEP40-1 "
"WEP104-5 TKIP-2 AES-4) camid:%d\n",
pparm->algorithm, cam_id);
- if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
+ if ((pmlmeinfo->state & 0x03) == MSR_AP) {
struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv;
if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) &&
pmlmeinfo->HT_enable) ||
- (pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
+ (pmlmeinfo->state & 0x03) == MSR_AP) {
issue_action_BA23a(padapter, pparm->addr,
WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid);
mod_timer(&psta->addba_retry_timer,