1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-11-22 13:34:47 +00:00

Merge pull request #85 from tdebrouw/roaming_fix

Bugfix: fix active roaming capability & improve roaming comments.
This commit is contained in:
Nick 2023-04-24 12:19:52 -05:00 committed by GitHub
commit 83d0da5eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 18 deletions

View File

@ -12799,14 +12799,15 @@ void linked_status_chk(_adapter *padapter, u8 from_timer)
#elif defined(CONFIG_LAYER2_ROAMING) #elif defined(CONFIG_LAYER2_ROAMING)
if (rtw_chk_roam_flags(padapter, RTW_ROAM_ACTIVE)) { if (rtw_chk_roam_flags(padapter, RTW_ROAM_ACTIVE)) {
RTW_INFO("signal_strength_data.avg_val = %d\n", precvpriv->signal_strength_data.avg_val); RTW_INFO("signal_strength_data.avg_val = %d\n", precvpriv->signal_strength_data.avg_val);
if ((precvpriv->signal_strength_data.avg_val < pmlmepriv->roam_rssi_threshold) if (precvpriv->signal_strength_data.avg_val < pmlmepriv->roam_rssi_threshold) {
&& (rtw_get_passing_time_ms(pmlmepriv->last_roaming) >= pmlmepriv->roam_scan_int*2000)) { if (rtw_get_passing_time_ms(pmlmepriv->last_roaming) >= pmlmepriv->roam_scan_int*2000) {
#ifdef CONFIG_RTW_80211K #ifdef CONFIG_RTW_80211K
rtw_roam_nb_discover(padapter, _FALSE); rtw_roam_nb_discover(padapter, _FALSE);
#endif #endif
pmlmepriv->need_to_roam = _TRUE; pmlmepriv->need_to_roam = _TRUE;
rtw_drv_scan_by_self(padapter, RTW_AUTO_SCAN_REASON_ROAM); rtw_drv_scan_by_self(padapter, RTW_AUTO_SCAN_REASON_ROAM);
pmlmepriv->last_roaming = rtw_get_current_time(); pmlmepriv->last_roaming = rtw_get_current_time();
}
} else } else
pmlmepriv->need_to_roam = _FALSE; pmlmepriv->need_to_roam = _FALSE;
} }

View File

@ -539,9 +539,9 @@ struct tdls_txmgmt {
/* used for mlme_priv.roam_flags */ /* used for mlme_priv.roam_flags */
enum { enum {
RTW_ROAM_ON_EXPIRED = BIT0, RTW_ROAM_ON_EXPIRED = BIT0, /* roam when AP is expired */
RTW_ROAM_ON_RESUME = BIT1, RTW_ROAM_ON_RESUME = BIT1, /* roam when device is resumed (after being suspended) */
RTW_ROAM_ACTIVE = BIT2, RTW_ROAM_ACTIVE = BIT2, /* active roam when current rssi (signal strength) is too low */
}; };
#define UNASOC_STA_SRC_RX_BMC 0 #define UNASOC_STA_SRC_RX_BMC 0
@ -568,22 +568,22 @@ struct unassoc_sta_info {
#endif #endif
struct mlme_priv { struct mlme_priv {
_lock lock; _lock lock;
sint fw_state; /* shall we protect this variable? maybe not necessarily... */ sint fw_state; /* shall we protect this variable? maybe not necessarily... */
u8 to_join; /* flag */ u8 to_join; /* flag */
u16 join_status; u16 join_status;
#ifdef CONFIG_LAYER2_ROAMING #ifdef CONFIG_LAYER2_ROAMING
u8 to_roam; /* roaming trying times */ u8 to_roam; /* internal counter for #roaming scans */
struct wlan_network *roam_network; /* the target of active roam */ struct wlan_network *roam_network; /* the target of active roam */
u8 roam_flags; u8 roam_flags; /* defines roam types - check enum above */
u8 roam_rssi_diff_th; /* rssi difference threshold for active scan candidate selection */ u8 roam_rssi_diff_th; /* during network scan/survey: the rssi difference between the current network and
u32 roam_scan_int; /* scan interval for active roam (Unit:2 second)*/ * the candidate network must be above this threshold to withhold the candidate */
u32 roam_scanr_exp_ms; /* scan result expire time in ms for roam */ u32 roam_scan_int; /* minimum interval (unit: 2 seconds) between roaming scans */
u32 roam_scanr_exp_ms; /* expire time in ms: only withhold candidate if last seen within expire time */
u8 roam_tgt_addr[ETH_ALEN]; /* request to roam to speicific target without other consideration */ u8 roam_tgt_addr[ETH_ALEN]; /* request to roam to speicific target without other consideration */
u8 roam_rssi_threshold; u8 roam_rssi_threshold; /* rssi (signal strength) must be below this threshold to start a roaming scan */
systime last_roaming; systime last_roaming; /* time of start of last roaming scan */
bool need_to_roam; bool need_to_roam; /* flag to check if roaming is (still) necessary */
#endif #endif
u32 defs_lmt_sta; u32 defs_lmt_sta;