1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-22 21:34:37 +00:00

Fixed scan timeout interfering with normal scan

This commit is contained in:
kimocoder 2019-11-13 16:57:08 +01:00
parent 42cc12cc84
commit 017cc7d842

View File

@ -906,14 +906,14 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, struct sitesurvey_parm *pparm)
u32 scan_timeout_ms; u32 scan_timeout_ms;
pmlmepriv->scan_start_time = rtw_get_current_time(); pmlmepriv->scan_start_time = rtw_get_current_time();
#if 0 /* looking at other wlan drivers, they do not handle timeout. It is conflicting with long scans */
scan_timeout_ms = rtw_scan_timeout_decision(padapter); scan_timeout_ms = rtw_scan_timeout_decision(padapter);
mlme_set_scan_to_timer(pmlmepriv,scan_timeout_ms); mlme_set_scan_to_timer(pmlmepriv,scan_timeout_ms);
#endif
rtw_led_control(padapter, LED_CTL_SITE_SURVEY); rtw_led_control(padapter, LED_CTL_SITE_SURVEY);
} else } else
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
return res; return res;
} }
@ -949,7 +949,6 @@ u8 rtw_setdatarate_cmd(_adapter *padapter, u8 *rateset)
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
return res; return res;
} }
@ -960,7 +959,6 @@ u8 rtw_setbasicrate_cmd(_adapter *padapter, u8 *rateset)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -981,11 +979,9 @@ u8 rtw_setbasicrate_cmd(_adapter *padapter, u8 *rateset)
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
return res; return res;
} }
/* /*
unsigned char rtw_setphy_cmd(unsigned char *adapter) unsigned char rtw_setphy_cmd(unsigned char *adapter)
@ -1002,7 +998,6 @@ u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch)
* struct registry_priv* pregistry_priv = &padapter->registrypriv; */ * struct registry_priv* pregistry_priv = &padapter->registrypriv; */
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -1018,7 +1013,6 @@ u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch)
init_h2fwcmd_w_parm_no_rsp(ph2c, psetphypara, _SetPhy_CMD_); init_h2fwcmd_w_parm_no_rsp(ph2c, psetphypara, _SetPhy_CMD_);
psetphypara->modem = modem; psetphypara->modem = modem;
psetphypara->rfchannel = ch; psetphypara->rfchannel = ch;
@ -1162,7 +1156,6 @@ u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -1189,7 +1182,6 @@ u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
exit: exit:
return res; return res;
} }
@ -1350,7 +1342,7 @@ static void rtw_ft_validate_akm_type(_adapter *padapter,
/* It could be a non-FT connection */ /* It could be a non-FT connection */
rtw_ft_clr_flags(padapter, (RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN)); rtw_ft_clr_flags(padapter, (RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN));
rtw_ft_reset_status(padapter); rtw_ft_reset_status(padapter);
} }
} }
#endif #endif
@ -1397,7 +1389,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
/* for IEs is fix buf size */ /* for IEs is fix buf size */
t_len = sizeof(WLAN_BSSID_EX); t_len = sizeof(WLAN_BSSID_EX);
/* for hidden ap to set fw_state here */ /* for hidden ap to set fw_state here */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) != _TRUE) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) != _TRUE) {
switch (ndis_network_mode) { switch (ndis_network_mode) {
@ -1435,7 +1426,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} }
@ -1466,13 +1456,12 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
psecnetwork->IELength += rtw_restruct_sec_ie(padapter, psecnetwork->IEs + psecnetwork->IELength); psecnetwork->IELength += rtw_restruct_sec_ie(padapter, psecnetwork->IEs + psecnetwork->IELength);
pqospriv->qos_option = 0; pqospriv->qos_option = 0;
if (pregistrypriv->wmm_enable) { if (pregistrypriv->wmm_enable) {
#ifdef CONFIG_WMMPS_STA #ifdef CONFIG_WMMPS_STA
rtw_uapsd_use_default_setting(padapter); rtw_uapsd_use_default_setting(padapter);
#endif /* CONFIG_WMMPS_STA */ #endif /* CONFIG_WMMPS_STA */
tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength); tmp_len = rtw_restruct_wmm_ie(padapter, &pnetwork->network.IEs[0], &psecnetwork->IEs[0], pnetwork->network.IELength, psecnetwork->IELength);
if (psecnetwork->IELength != tmp_len) { if (psecnetwork->IELength != tmp_len) {
@ -1563,7 +1552,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
exit: exit:
return res; return res;
} }
@ -1614,11 +1602,9 @@ u8 rtw_disassoc_cmd(_adapter *padapter, u32 deauth_timeout_ms, int flags) /* for
exit: exit:
return res; return res;
} }
u8 rtw_stop_ap_cmd(_adapter *adapter, u8 flags) u8 rtw_stop_ap_cmd(_adapter *adapter, u8 flags)
{ {
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
@ -1643,7 +1629,7 @@ u8 rtw_stop_ap_cmd(_adapter *adapter, u8 flags)
parm->type = 0; parm->type = 0;
parm->size = 0; parm->size = 0;
parm->pbuf = NULL; parm->pbuf = NULL;
/* need enqueue, prepare cmd_obj and enqueue */ /* need enqueue, prepare cmd_obj and enqueue */
cmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(*cmdobj)); cmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(*cmdobj));
if (cmdobj == NULL) { if (cmdobj == NULL) {
@ -1737,7 +1723,6 @@ u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 key_type, bool
struct security_priv *psecuritypriv = &padapter->securitypriv; struct security_priv *psecuritypriv = &padapter->securitypriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm)); psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm));
if (psetstakey_para == NULL) { if (psetstakey_para == NULL) {
res = _FAIL; res = _FAIL;
@ -1792,7 +1777,6 @@ u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 key_type, bool
} }
exit: exit:
return res; return res;
} }
@ -1852,7 +1836,6 @@ u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue)
exit: exit:
return res; return res;
} }
@ -1963,7 +1946,6 @@ u8 rtw_setassocsta_cmd(_adapter *padapter, u8 *mac_addr)
exit: exit:
return res; return res;
} }
@ -1975,7 +1957,6 @@ u8 rtw_addbareq_cmd(_adapter *padapter, u8 tid, u8 *addr)
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -2001,7 +1982,6 @@ u8 rtw_addbareq_cmd(_adapter *padapter, u8 tid, u8 *addr)
exit: exit:
return res; return res;
} }
@ -2012,7 +1992,6 @@ u8 rtw_addbarsp_cmd(_adapter *padapter, u8 *addr, u16 tid, u8 status, u8 size, u
struct addBaRsp_parm *paddBaRsp_parm; struct addBaRsp_parm *paddBaRsp_parm;
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -2039,7 +2018,6 @@ u8 rtw_addbarsp_cmd(_adapter *padapter, u8 *addr, u16 tid, u8 status, u8 size, u
exit: exit:
return res; return res;
} }
/* add for CONFIG_IEEE80211W, none 11w can use it */ /* add for CONFIG_IEEE80211W, none 11w can use it */
@ -2050,7 +2028,6 @@ u8 rtw_reset_securitypriv_cmd(_adapter *padapter)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -2071,13 +2048,11 @@ u8 rtw_reset_securitypriv_cmd(_adapter *padapter)
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */ /* rtw_enqueue_cmd(pcmdpriv, ph2c); */
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
return res; return res;
} }
@ -2145,7 +2120,6 @@ u8 rtw_dynamic_chk_wk_cmd(_adapter *padapter)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
/* only primary padapter does this cmd */ /* only primary padapter does this cmd */
ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
@ -2167,13 +2141,11 @@ u8 rtw_dynamic_chk_wk_cmd(_adapter *padapter)
pdrvextra_cmd_parm->pbuf = NULL; pdrvextra_cmd_parm->pbuf = NULL;
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */ /* rtw_enqueue_cmd(pcmdpriv, ph2c); */
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
return res; return res;
} }
@ -2186,7 +2158,6 @@ u8 rtw_set_chbw_cmd(_adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 flags)
struct submit_ctx sctx; struct submit_ctx sctx;
u8 res = _SUCCESS; u8 res = _SUCCESS;
RTW_INFO(FUNC_NDEV_FMT" ch:%u, bw:%u, ch_offset:%u\n", RTW_INFO(FUNC_NDEV_FMT" ch:%u, bw:%u, ch_offset:%u\n",
FUNC_NDEV_ARG(padapter->pnetdev), ch, bw, ch_offset); FUNC_NDEV_ARG(padapter->pnetdev), ch, bw, ch_offset);
@ -2253,7 +2224,6 @@ u8 _rtw_set_chplan_cmd(_adapter *adapter, int flags, u8 chplan, const struct cou
struct submit_ctx sctx; struct submit_ctx sctx;
u8 res = _SUCCESS; u8 res = _SUCCESS;
/* check if allow software config */ /* check if allow software config */
if (swconfig && rtw_hal_is_disable_sw_channel_plan(adapter) == _TRUE) { if (swconfig && rtw_hal_is_disable_sw_channel_plan(adapter) == _TRUE) {
res = _FAIL; res = _FAIL;
@ -2370,8 +2340,6 @@ u8 rtw_led_blink_cmd(_adapter *padapter, PVOID pLed)
u8 res = _SUCCESS; u8 res = _SUCCESS;
pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmdobj == NULL) { if (pcmdobj == NULL) {
res = _FAIL; res = _FAIL;
@ -2392,7 +2360,6 @@ u8 rtw_led_blink_cmd(_adapter *padapter, PVOID pLed)
exit: exit:
return res; return res;
} }
@ -2458,7 +2425,6 @@ u8 rtw_enable_hw_update_tsf_cmd(_adapter *padapter)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS; u8 res = _SUCCESS;
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;
@ -2978,7 +2944,7 @@ u8 _lps_chk_by_tp(_adapter *adapter, u8 from_timer)
#endif #endif
static u8 _lps_chk_by_pkt_cnts(_adapter *padapter, u8 from_timer, u8 bBusyTraffic) static u8 _lps_chk_by_pkt_cnts(_adapter *padapter, u8 from_timer, u8 bBusyTraffic)
{ {
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
u8 bEnterPS = _FALSE; u8 bEnterPS = _FALSE;
@ -3111,7 +3077,6 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer)
} }
BusyThreshold = BusyThresholdHigh; BusyThreshold = BusyThresholdHigh;
/* */ /* */
/* Determine if our traffic is busy now */ /* Determine if our traffic is busy now */
/* */ /* */
@ -3220,7 +3185,6 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer)
} }
/* for 11n Logo 4.2.31/4.2.32 */ /* for 11n Logo 4.2.31/4.2.32 */
static void dynamic_update_bcn_check(_adapter *padapter) static void dynamic_update_bcn_check(_adapter *padapter)
{ {
@ -3259,7 +3223,7 @@ static void dynamic_update_bcn_check(_adapter *padapter)
if (_FALSE != ATOMIC_READ(&pmlmepriv->olbc) if (_FALSE != ATOMIC_READ(&pmlmepriv->olbc)
&& _FALSE != ATOMIC_READ(&pmlmepriv->olbc_ht)) { && _FALSE != ATOMIC_READ(&pmlmepriv->olbc_ht)) {
if (rtw_ht_operation_update(padapter) > 0) { if (rtw_ht_operation_update(padapter) > 0) {
update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE);
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE);
@ -3306,7 +3270,6 @@ void rtw_iface_dynamic_chk_wk_hdl(_adapter *padapter)
rtw_cfgvendor_rssi_monitor_evt(padapter); rtw_cfgvendor_rssi_monitor_evt(padapter);
#endif #endif
} }
void rtw_dynamic_chk_wk_hdl(_adapter *padapter) void rtw_dynamic_chk_wk_hdl(_adapter *padapter)
{ {
@ -3433,7 +3396,6 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter *padapter, u8 lps_ctrl_type, u8 enqueue)
/* struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); */ /* struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); */
u8 res = _SUCCESS; u8 res = _SUCCESS;
/* if(!pwrctrlpriv->bLeisurePs) */ /* if(!pwrctrlpriv->bLeisurePs) */
/* return res; */ /* return res; */
@ -3464,7 +3426,6 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter *padapter, u8 lps_ctrl_type, u8 enqueue)
exit: exit:
return res; return res;
} }
@ -3626,7 +3587,6 @@ u8 rtw_rpt_timer_cfg_cmd(_adapter *padapter, u16 minRptTime)
res = rtw_enqueue_cmd(pcmdpriv, ph2c); res = rtw_enqueue_cmd(pcmdpriv, ph2c);
exit: exit:
return res; return res;
} }
@ -3683,7 +3643,6 @@ u8 rtw_antenna_select_cmd(_adapter *padapter, u8 antenna, u8 enqueue)
antenna_select_wk_hdl(padapter, antenna); antenna_select_wk_hdl(padapter, antenna);
exit: exit:
return res; return res;
} }
@ -3779,7 +3738,6 @@ u8 p2p_protocol_wk_cmd(_adapter *padapter, int intCmdType)
exit: exit:
return res; return res;
} }
@ -3883,7 +3841,7 @@ inline u8 p2p_cancel_roch_cmd(_adapter *adapter, u64 cookie, struct wireless_dev
#endif /* CONFIG_IOCTL_CFG80211 */ #endif /* CONFIG_IOCTL_CFG80211 */
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#ifdef CONFIG_IOCTL_CFG80211 #ifdef CONFIG_IOCTL_CFG80211
inline u8 rtw_mgnt_tx_cmd(_adapter *adapter, u8 tx_ch, u8 no_cck, const u8 *buf, size_t len, int wait_ack, u8 flags) inline u8 rtw_mgnt_tx_cmd(_adapter *adapter, u8 tx_ch, u8 no_cck, const u8 *buf, size_t len, int wait_ack, u8 flags)
{ {
struct cmd_obj *cmdobj; struct cmd_obj *cmdobj;
@ -3993,7 +3951,6 @@ u8 rtw_ps_cmd(_adapter *padapter)
exit: exit:
return res; return res;
} }