From 017cc7d842ba3b30114c959d87d0c1fa1db9f606 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 13 Nov 2019 16:57:08 +0100 Subject: [PATCH] Fixed scan timeout interfering with normal scan --- core/rtw_cmd.c | 61 ++++++++------------------------------------------ 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 2205bf2..2984f9b 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -906,14 +906,14 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, struct sitesurvey_parm *pparm) u32 scan_timeout_ms; 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); mlme_set_scan_to_timer(pmlmepriv,scan_timeout_ms); - +#endif rtw_led_control(padapter, LED_CTL_SITE_SURVEY); } else _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); - return res; } @@ -949,7 +949,6 @@ u8 rtw_setdatarate_cmd(_adapter *padapter, u8 *rateset) res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: - return res; } @@ -960,7 +959,6 @@ u8 rtw_setbasicrate_cmd(_adapter *padapter, u8 *rateset) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { res = _FAIL; @@ -981,11 +979,9 @@ u8 rtw_setbasicrate_cmd(_adapter *padapter, u8 *rateset) res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: - return res; } - /* 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; */ u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { 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_); - psetphypara->modem = modem; psetphypara->rfchannel = ch; @@ -1162,7 +1156,6 @@ u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { res = _FAIL; @@ -1189,7 +1182,6 @@ u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval) exit: - return res; } @@ -1350,7 +1342,7 @@ static void rtw_ft_validate_akm_type(_adapter *padapter, /* It could be a non-FT connection */ rtw_ft_clr_flags(padapter, (RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN)); rtw_ft_reset_status(padapter); - } + } } #endif @@ -1397,7 +1389,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) /* for IEs is fix buf size */ t_len = sizeof(WLAN_BSSID_EX); - /* for hidden ap to set fw_state here */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) != _TRUE) { switch (ndis_network_mode) { @@ -1435,7 +1426,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) res = _FAIL; - 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); - pqospriv->qos_option = 0; if (pregistrypriv->wmm_enable) { -#ifdef CONFIG_WMMPS_STA +#ifdef CONFIG_WMMPS_STA 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); if (psecnetwork->IELength != tmp_len) { @@ -1563,7 +1552,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) exit: - return res; } @@ -1614,11 +1602,9 @@ u8 rtw_disassoc_cmd(_adapter *padapter, u32 deauth_timeout_ms, int flags) /* for exit: - return res; } - u8 rtw_stop_ap_cmd(_adapter *adapter, u8 flags) { #ifdef CONFIG_AP_MODE @@ -1643,7 +1629,7 @@ u8 rtw_stop_ap_cmd(_adapter *adapter, u8 flags) parm->type = 0; parm->size = 0; parm->pbuf = NULL; - + /* need enqueue, prepare cmd_obj and enqueue */ cmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(*cmdobj)); 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; u8 res = _SUCCESS; - psetstakey_para = (struct set_stakey_parm *)rtw_zmalloc(sizeof(struct set_stakey_parm)); if (psetstakey_para == NULL) { res = _FAIL; @@ -1792,7 +1777,6 @@ u8 rtw_setstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 key_type, bool } exit: - return res; } @@ -1852,7 +1836,6 @@ u8 rtw_clearstakey_cmd(_adapter *padapter, struct sta_info *sta, u8 enqueue) exit: - return res; } @@ -1963,7 +1946,6 @@ u8 rtw_setassocsta_cmd(_adapter *padapter, u8 *mac_addr) exit: - return res; } @@ -1975,7 +1957,6 @@ u8 rtw_addbareq_cmd(_adapter *padapter, u8 tid, u8 *addr) u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { res = _FAIL; @@ -2001,7 +1982,6 @@ u8 rtw_addbareq_cmd(_adapter *padapter, u8 tid, u8 *addr) exit: - 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; u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { res = _FAIL; @@ -2039,7 +2018,6 @@ u8 rtw_addbarsp_cmd(_adapter *padapter, u8 *addr, u16 tid, u8 status, u8 size, u exit: - return res; } /* 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; u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { 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)); - /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: - return res; } @@ -2145,7 +2120,6 @@ u8 rtw_dynamic_chk_wk_cmd(_adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - /* only primary padapter does this cmd */ 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; init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); - /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: - 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; u8 res = _SUCCESS; - RTW_INFO(FUNC_NDEV_FMT" ch:%u, bw:%u, ch_offset:%u\n", 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; u8 res = _SUCCESS; - /* check if allow software config */ if (swconfig && rtw_hal_is_disable_sw_channel_plan(adapter) == _TRUE) { res = _FAIL; @@ -2370,8 +2340,6 @@ u8 rtw_led_blink_cmd(_adapter *padapter, PVOID pLed) u8 res = _SUCCESS; - - pcmdobj = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (pcmdobj == NULL) { res = _FAIL; @@ -2392,7 +2360,6 @@ u8 rtw_led_blink_cmd(_adapter *padapter, PVOID pLed) exit: - return res; } @@ -2458,7 +2425,6 @@ u8 rtw_enable_hw_update_tsf_cmd(_adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj)); if (ph2c == NULL) { res = _FAIL; @@ -2978,7 +2944,7 @@ u8 _lps_chk_by_tp(_adapter *adapter, u8 from_timer) #endif static u8 _lps_chk_by_pkt_cnts(_adapter *padapter, u8 from_timer, u8 bBusyTraffic) -{ +{ struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 bEnterPS = _FALSE; @@ -3111,7 +3077,6 @@ u8 traffic_status_watchdog(_adapter *padapter, u8 from_timer) } BusyThreshold = BusyThresholdHigh; - /* */ /* 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 */ 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) && _FALSE != ATOMIC_READ(&pmlmepriv->olbc_ht)) { - + if (rtw_ht_operation_update(padapter) > 0) { update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); 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); #endif - } 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); */ u8 res = _SUCCESS; - /* if(!pwrctrlpriv->bLeisurePs) */ /* return res; */ @@ -3464,7 +3426,6 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter *padapter, u8 lps_ctrl_type, u8 enqueue) exit: - return res; } @@ -3626,7 +3587,6 @@ u8 rtw_rpt_timer_cfg_cmd(_adapter *padapter, u16 minRptTime) res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: - return res; } @@ -3683,7 +3643,6 @@ u8 rtw_antenna_select_cmd(_adapter *padapter, u8 antenna, u8 enqueue) antenna_select_wk_hdl(padapter, antenna); exit: - return res; } @@ -3779,7 +3738,6 @@ u8 p2p_protocol_wk_cmd(_adapter *padapter, int intCmdType) exit: - 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_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) { struct cmd_obj *cmdobj; @@ -3993,7 +3951,6 @@ u8 rtw_ps_cmd(_adapter *padapter) exit: - return res; }