qcacld-3.0: Cleanup current peers upon secondary STA roaming

The secondary STA is non-ML type by default, so driver doesn't
create mld/ml_dev_ctx for the vdev corresponds to secondary
interface which is wlan1.

But in current scenario there is a check in the peer cleanup
API which always expects ml_dev_ctx. when secondary STA(wlan1)
roams from one AP to other AP, driver doesn't cleanup the old
peer due to this check and results a peer leak.

Delete all peers even when secondary STA roaming which avoid
this issue.

Change-Id: Ib759b43949651894e7a2aeef5255e46b7c9fa254
CRs-Fixed: 3562495
This commit is contained in:
Vijay Patil 2023-07-19 18:10:51 +05:30 committed by Rahul Choudhary
parent 60cbf85341
commit 633a3750af

View File

@ -561,6 +561,33 @@ wma_send_roam_preauth_status(tp_wma_handle wma_handle,
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
/**
* wma_delete_bss_peer() Delete bss peer/s for Non ML interface
* @wma: Global WMA Handle
* @vdev_id: vdev id
*
* This function will perform cleanup of the peer corresponds
* to given vdev_id
*
* Return: QDF status
*/
static
QDF_STATUS wma_delete_bss_peer(tp_wma_handle wma,
uint8_t vdev_id)
{
tDeleteStaParams *del_sta_params;
del_sta_params = qdf_mem_malloc(sizeof(*del_sta_params));
if (!del_sta_params)
return QDF_STATUS_E_NOMEM;
del_sta_params->smesessionId = vdev_id;
wma_delete_sta(wma, del_sta_params);
wma_delete_bss(wma, vdev_id);
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_FEATURE_11BE_MLO
/**
* wma_delete_all_peers() - Delete all bss peer/s
@ -584,6 +611,7 @@ wma_delete_all_peers(tp_wma_handle wma,
tDeleteStaParams *del_sta_params;
QDF_STATUS status = QDF_STATUS_SUCCESS;
struct qdf_mac_addr bssid;
struct qdf_mac_addr *mld_addr;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
WLAN_MLME_OBJMGR_ID);
@ -594,6 +622,15 @@ wma_delete_all_peers(tp_wma_handle wma,
mlo_dev_ctx = vdev->mlo_dev_ctx;
if (!mlo_dev_ctx) {
mld_addr =
(struct qdf_mac_addr *)wlan_vdev_mlme_get_mldaddr(vdev);
/* It's not a ML interface*/
if (qdf_is_macaddr_zero(mld_addr)) {
mlme_debug("Non-ML STA vdev_id: %d", vdev_id);
status = wma_delete_bss_peer(wma, vdev_id);
goto end;
}
mlme_err("mlo_dev_ctx object is NULL for vdev %d", vdev_id);
status = QDF_STATUS_E_NULL_VALUE;
goto end;
@ -639,7 +676,7 @@ static inline QDF_STATUS
wma_delete_all_peers(tp_wma_handle wma,
uint8_t vdev_id)
{
return QDF_STATUS_E_FAILURE;
return wma_delete_bss_peer(wma, vdev_id);
}
#endif
/**