If ROAM CMD (wpa_cli roam), do scan if bssid not found even in busy traffic

Bug 5578305

Change-Id: I92c794dee4c3a6a01589c05570eb227f0e2730dd
Signed-off-by: Shaofu <shaofu@realtek.com>
Signed-off-by: Narayana Reddy P <narayanr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3485372
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Shaofu
2025-11-07 06:59:03 +00:00
committed by mobile promotions
parent 56fe2c567d
commit 5f08e6dabd
4 changed files with 21 additions and 5 deletions

View File

@@ -116,6 +116,7 @@ u8 rtw_do_join(_adapter *padapter)
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == _FALSE
|| rtw_to_roam(padapter) > 0
|| (pmlmepriv->assoc_by_bssid && !is_zero_mac_addr(pmlmepriv->assoc_prev_bssid))
) {
u8 ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE);
@@ -178,6 +179,7 @@ u8 rtw_do_join(_adapter *padapter)
/* we try to issue sitesurvey firstly */
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == _FALSE
|| rtw_to_roam(padapter) > 0
|| (pmlmepriv->assoc_by_bssid && !is_zero_mac_addr(pmlmepriv->assoc_prev_bssid))
) {
u8 ssc_chk = rtw_sitesurvey_condition_check(padapter, _FALSE);
@@ -390,14 +392,13 @@ exit:
}
u8 rtw_set_802_11_connect(_adapter *padapter, const u8 *bssid, NDIS_802_11_SSID *ssid,
u16 ch, enum band_type band)
u16 ch, enum band_type band, const u8 *prev_bssid)
{
u8 status = _SUCCESS;
bool bssid_valid = _TRUE;
bool ssid_valid = _TRUE;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if (!ssid || rtw_validate_ssid(ssid) == _FALSE)
ssid_valid = _FALSE;
@@ -434,9 +435,15 @@ handle_tkip_countermeasure:
if (bssid && bssid_valid) {
_rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN);
if (prev_bssid)
_rtw_memcpy(&pmlmepriv->assoc_prev_bssid, prev_bssid, ETH_ALEN);
else
_rtw_memset(&pmlmepriv->assoc_prev_bssid, 0, ETH_ALEN);
pmlmepriv->assoc_by_bssid = _TRUE;
} else
} else {
_rtw_memset(&pmlmepriv->assoc_prev_bssid, 0, ETH_ALEN);
pmlmepriv->assoc_by_bssid = _FALSE;
}
pmlmepriv->assoc_ch = ch;
pmlmepriv->assoc_band = band;

View File

@@ -22,7 +22,7 @@ u8 rtw_set_802_11_disassociate(_adapter *padapter);
u8 rtw_set_802_11_infrastructure_mode(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype, u8 flags);
u8 rtw_set_802_11_ssid(_adapter *padapter, NDIS_802_11_SSID *ssid);
u8 rtw_set_802_11_connect(_adapter *padapter, const u8 *bssid, NDIS_802_11_SSID *ssid,
u16 ch, enum band_type band);
u16 ch, enum band_type band, const u8 *prev_bssid);
u8 rtw_validate_bssid(const u8 *bssid);
u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid);

View File

@@ -658,6 +658,7 @@ struct mlme_priv {
u8 assoc_bssid[6];
u16 assoc_ch; /* 0 reserved for no specific channel */
enum band_type assoc_band;
u8 assoc_prev_bssid[6];
struct wlan_network dev_cur_network;
struct wlan_network *cur_network_scanned;

View File

@@ -4469,6 +4469,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
u16 ch_hw_vlue = 0;
enum band_type ch_band = BAND_MAX;
const u8 *prev_bssid = NULL;
#if (RTW_CFG80211_BLOCK_STA_DISCON_EVENT & RTW_CFG80211_BLOCK_DISCON_WHEN_CONNECT)
rtw_wdev_set_not_indic_disco(pwdev_priv, 1);
@@ -4556,6 +4557,13 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
}
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
if (sme->prev_bssid) {
RTW_INFO("prev_bssid="MAC_FMT"\n", MAC_ARG(sme->prev_bssid));
prev_bssid = sme->prev_bssid;
}
#endif
ret = rtw_set_security(padapter, sme);
if (ret < 0)
goto exit;
@@ -4575,7 +4583,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
}
if (rtw_set_802_11_connect(padapter, bssid, &ndis_ssid,
ch_hw_vlue, ch_band) == _FALSE) {
ch_hw_vlue, ch_band, prev_bssid) == _FALSE) {
ret = -1;
goto exit;
}