diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 8cfe723..dacb452 100755 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -1562,8 +1562,6 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) } -#ifdef CONFIG_NATIVEAP_MLME - static void update_bcn_fixed_ie(struct adapter *padapter) { DBG_871X("%s\n", __FUNCTION__); @@ -2541,5 +2539,4 @@ void stop_ap_mode(struct adapter *padapter) } -#endif /* CONFIG_NATIVEAP_MLME */ #endif /* CONFIG_AP_MODE */ diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 3d66e43..b0c8538 100755 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -512,14 +512,11 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!")); /* DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ - if(*pold_state==Ndis802_11APMode) - { + if(*pold_state==Ndis802_11APMode) { /* change to other mode from Ndis802_11APMode */ cur_network->join_res = -1; -#ifdef CONFIG_NATIVEAP_MLME stop_ap_mode(padapter); -#endif } if((check_fwstate(pmlmepriv, _FW_LINKED)== true) ||(*pold_state==Ndis802_11IBSS)) @@ -541,28 +538,21 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter, _clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE); - switch(networktype) - { - case Ndis802_11IBSS: - set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); - break; - - case Ndis802_11Infrastructure: - set_fwstate(pmlmepriv, WIFI_STATION_STATE); - break; - - case Ndis802_11APMode: - set_fwstate(pmlmepriv, WIFI_AP_STATE); -#ifdef CONFIG_NATIVEAP_MLME - start_ap_mode(padapter); - /* rtw_indicate_connect(padapter); */ -#endif - - break; - - case Ndis802_11AutoUnknown: - case Ndis802_11InfrastructureMax: - break; + switch(networktype) { + case Ndis802_11IBSS: + set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); + break; + case Ndis802_11Infrastructure: + set_fwstate(pmlmepriv, WIFI_STATION_STATE); + break; + case Ndis802_11APMode: + set_fwstate(pmlmepriv, WIFI_AP_STATE); + start_ap_mode(padapter); + /* rtw_indicate_connect(padapter); */ + break; + case Ndis802_11AutoUnknown: + case Ndis802_11InfrastructureMax: + break; } /* SecClearAllKeys(adapter); */ diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 39af0db..907c807 100755 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -128,7 +128,7 @@ static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv) { -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) rtw_buf_free(&pmlmepriv->assoc_req, &pmlmepriv->assoc_req_len); rtw_buf_free(&pmlmepriv->assoc_rsp, &pmlmepriv->assoc_rsp_len); rtw_free_mlme_ie_data(&pmlmepriv->wps_beacon_ie, &pmlmepriv->wps_beacon_ie_len); @@ -1877,7 +1877,7 @@ static u8 search_max_mac_id(struct adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct sta_priv *pstapriv = &padapter->stapriv; -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) if(check_fwstate(pmlmepriv, WIFI_AP_STATE)){ for (aid = (pstapriv->max_num_sta); aid > 0; aid--) @@ -1941,7 +1941,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) if(rtw_access_ctrl(adapter, pstassoc->macaddr) == false) return; -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) if(check_fwstate(pmlmepriv, WIFI_AP_STATE)) { psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr); @@ -1984,7 +1984,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf) } goto exit; } -#endif /* defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ +#endif /* defined (CONFIG_AP_MODE) */ /* for AD-HOC mode */ psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr); diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index b17f4ce..a264035 100755 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -56,29 +56,6 @@ static struct mlme_handler mlme_sta_tbl[]={ {WIFI_ACTION, "OnAction", &OnAction}, }; -#ifdef _CONFIG_NATIVEAP_MLME_ -struct mlme_handler mlme_ap_tbl[]={ - {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, - {WIFI_ASSOCRSP, "OnAssocRsp", &OnAssocRsp}, - {WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq}, - {WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp}, - {WIFI_PROBEREQ, "OnProbeReq", &OnProbeReq}, - {WIFI_PROBERSP, "OnProbeRsp", &OnProbeRsp}, - - /*---------------------------------------------------------- - below 2 are reserved - -----------------------------------------------------------*/ - {0, "DoReserved", &DoReserved}, - {0, "DoReserved", &DoReserved}, - {WIFI_BEACON, "OnBeacon", &OnBeacon}, - {WIFI_ATIM, "OnATIM", &OnAtim}, - {WIFI_DISASSOC, "OnDisassoc", &OnDisassoc}, - {WIFI_AUTH, "OnAuth", &OnAuth}, - {WIFI_DEAUTH, "OnDeAuth", &OnDeAuth}, - {WIFI_ACTION, "OnAction", &OnAction}, -}; -#endif - static struct action_handler OnAction_tbl[]={ {RTW_WLAN_CATEGORY_SPECTRUM_MGMT, "ACTION_SPECTRUM_MGMT", on_action_spct}, {RTW_WLAN_CATEGORY_QOS, "ACTION_QOS", &OnAction_qos}, @@ -1313,9 +1290,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame) /* Now, we are going to issue_auth... */ pstat->auth_seq = seq + 1; -#ifdef CONFIG_NATIVEAP_MLME issue_auth(padapter, pstat, (unsigned short)(_STATS_SUCCESSFUL_)); -#endif if (pstat->state & WIFI_FW_AUTH_SUCCESS) pstat->auth_seq = 0; @@ -1333,9 +1308,7 @@ auth_fail: pstat->auth_seq = 2; memcpy(pstat->hwaddr, sa, 6); -#ifdef CONFIG_NATIVEAP_MLME issue_auth(padapter, pstat, (unsigned short)status); -#endif #endif return _FAIL; @@ -1959,7 +1932,6 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) /* now the station is qualified to join our BSS... */ if(pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_==status)) { -#ifdef CONFIG_NATIVEAP_MLME /* 1 bss_cap_update & sta_info_update */ bss_cap_update_on_sta_join(padapter, pstat); sta_info_update(padapter, pstat); @@ -1988,31 +1960,24 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) /* 3-(1) report sta add event */ report_add_sta_event(padapter, pstat->hwaddr, pstat->aid); - -#endif /* CONFIG_NATIVEAP_MLME */ } return _SUCCESS; asoc_class2_error: -#ifdef CONFIG_NATIVEAP_MLME issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status); -#endif return _FAIL; OnAssocReqFail: -#ifdef CONFIG_NATIVEAP_MLME pstat->aid = 0; if (frame_type == WIFI_ASSOCREQ) issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); else issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); -#endif - #endif /* CONFIG_AP_MODE */ @@ -5893,10 +5858,10 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) __le16 *fctrl; unsigned int rate_len; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) _irqL irqL; struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); -#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ +#endif /* if defined (CONFIG_AP_MODE) */ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); @@ -5913,9 +5878,9 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) DBG_871X("%s, alloc mgnt frame fail\n", __FUNCTION__); return; } -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ +#endif /* if defined (CONFIG_AP_MODE) */ /* update attribute */ pattrib = &pmgntframe->attrib; @@ -6162,11 +6127,11 @@ void issue_beacon(struct adapter *padapter, int timeout_ms) _issue_bcn: -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) pmlmepriv->update_bcn = false; _exit_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); -#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ +#endif /* if defined (CONFIG_AP_MODE) */ if ((pattrib->pktlen + TXDESC_SIZE) > 512) { @@ -6193,11 +6158,11 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p __le16 *fctrl; unsigned char *mac, *bssid; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) u8 *pwps_ie; uint wps_ielen; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; -#endif /* if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) */ +#endif /* if defined (CONFIG_AP_MODE) */ struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); @@ -6248,7 +6213,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p if(cur_network->IELength>MAX_IE_SZ) return; -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) { pwps_ie = rtw_get_wps_ie(cur_network->IEs+_FIXED_IE_LENGTH_, cur_network->IELength-_FIXED_IE_LENGTH_, NULL, &wps_ielen); @@ -6621,7 +6586,6 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short if(psta) { /* for AP mode */ -#ifdef CONFIG_NATIVEAP_MLME memcpy(pwlanhdr->addr1, psta->hwaddr, ETH_ALEN); memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN); memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN); @@ -6654,7 +6618,6 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short /* added challenging text... */ if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key==1)) pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); -#endif } else { __le32 le_tmp32; __le16 le_tmp16; @@ -10245,9 +10208,6 @@ u8 setopmode_hdl(struct adapter *padapter, u8 *pbuf) { pmlmeinfo->state = WIFI_FW_AP_STATE; type = _HW_STATE_AP_; -#ifdef CONFIG_NATIVEAP_MLME - /* start_ap_mode(padapter); */ -#endif } else if(psetop->mode == Ndis802_11Infrastructure) { diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 6f76af5..01a6b55 100755 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -65,14 +65,12 @@ void _rtw_init_stainfo(struct sta_info *psta) psta->bpairwise_key_installed = false; -#ifdef CONFIG_NATIVEAP_MLME psta->nonerp_set = 0; psta->no_short_slot_time_set = 0; psta->no_short_preamble_set = 0; psta->no_ht_gf_set = 0; psta->no_ht_set = 0; psta->ht_20mhz_set = 0; -#endif #ifdef CONFIG_TX_MCAST2UNI psta->under_exist_checking = 0; @@ -592,8 +590,6 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) psta->has_legacy_ac = 0; -#ifdef CONFIG_NATIVEAP_MLME - pstapriv->sta_dz_bitmap &=~BIT(psta->aid); pstapriv->tim_bitmap &=~BIT(psta->aid); @@ -605,8 +601,6 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) psta->aid = 0; } -#endif /* CONFIG_NATIVEAP_MLME */ - #ifdef CONFIG_TX_MCAST2UNI psta->under_exist_checking = 0; #endif /* CONFIG_TX_MCAST2UNI */ diff --git a/include/autoconf.h b/include/autoconf.h index 50e2d96..085bd0e 100755 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -99,10 +99,6 @@ #define CONFIG_INTERRUPT_BASED_TXBCN_BCN_OK_ERR #endif - #define CONFIG_NATIVEAP_MLME - #ifndef CONFIG_NATIVEAP_MLME - #define CONFIG_HOSTAPD_MLME - #endif #define CONFIG_FIND_BEST_CHANNEL //#define CONFIG_NO_WIRELESS_HANDLERS #endif diff --git a/include/rtw_ap.h b/include/rtw_ap.h index 7a6c404..c3eb3f6 100755 --- a/include/rtw_ap.h +++ b/include/rtw_ap.h @@ -27,14 +27,11 @@ #ifdef CONFIG_AP_MODE -//external function -extern void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *psta); -extern void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *psta); - +void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *psta); +void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *psta); void init_mlme_ap_info(struct adapter *padapter); void free_mlme_ap_info(struct adapter *padapter); -//void update_BCNTIM(struct adapter *padapter); void rtw_add_bcn_ie(struct adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len); void rtw_remove_bcn_ie(struct adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index); void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx); @@ -46,8 +43,6 @@ void rtw_ap_restore_network(struct adapter *padapter); void rtw_set_macaddr_acl(struct adapter *padapter, int mode); int rtw_acl_add_sta(struct adapter *padapter, u8 *addr); int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr); - -#ifdef CONFIG_NATIVEAP_MLME void associated_clients_update(struct adapter *padapter, u8 updated); void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta); u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta); @@ -58,8 +53,9 @@ int rtw_sta_flush(struct adapter *padapter); int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset); void start_ap_mode(struct adapter *padapter); void stop_ap_mode(struct adapter *padapter); -#endif + #endif //end of CONFIG_AP_MODE -#endif void update_bmc_sta(struct adapter *padapter); + +#endif diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index f90b5bd..b46ed98 100755 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -461,7 +461,7 @@ struct mlme_priv { u8 *wps_probe_req_ie; u32 wps_probe_req_ie_len; -#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#if defined (CONFIG_AP_MODE) /* Number of associated Non-ERP stations (i.e., stations using 802.11b * in 802.11g BSS) */ int num_sta_non_erp; @@ -519,7 +519,7 @@ struct mlme_priv { u8 update_bcn; -#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME) +#endif //#if defined (CONFIG_AP_MODE) #if defined(CONFIG_WFD) diff --git a/include/sta_info.h b/include/sta_info.h index 78affbb..5b42034 100755 --- a/include/sta_info.h +++ b/include/sta_info.h @@ -211,7 +211,6 @@ struct sta_info { u8 bpairwise_key_installed; -#ifdef CONFIG_NATIVEAP_MLME u8 wpa_ie[32]; u8 nonerp_set; @@ -220,7 +219,6 @@ struct sta_info { u8 no_ht_gf_set; u8 no_ht_set; u8 ht_20mhz_set; -#endif // CONFIG_NATIVEAP_MLME #ifdef CONFIG_ATMEL_RC_PATCH u8 flag_atmel_rc;