qcacmn: Connect if pri_umac & assoc link are same

Some devices in WDS station mode have limitation when connected
in 3 LINK MLD association where the Primary umac selected and assoc
link should be same. Make sure to have a sanity check before
going for association in such cases.

If the primary umac and assoc links are set to be different then
the connection will be rejected.

Change-Id: If56461a140d4685ba279b1babe04709d919d1650
CRs-Fixed: 3443733
这个提交包含在:
Uraj Sasan
2023-03-23 18:24:34 +05:30
提交者 Madan Koyyalamudi
父节点 1598a12f5c
当前提交 ab8cf64ef0
修改 3 个文件,包含 89 行新增13 行删除

查看文件

@@ -164,6 +164,17 @@ bool ucfg_mlo_is_mld_connected(struct wlan_objmgr_vdev *vdev);
void ucfg_mlo_mld_clear_mlo_cap(struct wlan_objmgr_vdev *vdev);
#endif
#ifdef WLAN_MLO_MULTI_CHIP
/**
* mlo_get_central_umac_id - get central umac in 3 link topology
* @psoc_ids: pointer to psoc_ids
*
* Return: central umac if success, -1 all soc are adjacent to each other
*/
int8_t mlo_get_central_umac_id(uint8_t *psoc_ids);
#endif
/**
* wlan_mlo_get_tdls_link_vdev() - API to get tdls link vdev
* @vdev: vdev object

查看文件

@@ -455,25 +455,17 @@ static void mlo_peer_calculate_avg_rssi(
}
#ifdef WLAN_MLO_MULTI_CHIP
static QDF_STATUS mlo_set_3_link_primary_umac(
struct wlan_mlo_peer_context *ml_peer,
struct wlan_objmgr_vdev *link_vdevs[])
int8_t mlo_get_central_umac_id(
uint8_t *psoc_ids)
{
uint8_t prim_psoc_id, psoc_ids[MAX_MLO_CHIPS];
uint8_t prim_psoc_id = -1;
uint8_t adjacent = 0;
if (ml_peer->max_links != 3)
return QDF_STATUS_E_FAILURE;
/* Some 3 link RDPs have restriction on the primary umac.
* Only the link that is adjacent to both the links can be
* a primary umac.
* Note: it means umac migration is also restricted.
*/
psoc_ids[0] = wlan_vdev_get_psoc_id(link_vdevs[0]);
psoc_ids[1] = wlan_vdev_get_psoc_id(link_vdevs[1]);
psoc_ids[2] = wlan_vdev_get_psoc_id(link_vdevs[2]);
mlo_chip_adjacent(psoc_ids[0], psoc_ids[1], &adjacent);
if (!adjacent) {
prim_psoc_id = psoc_ids[2];
@@ -491,11 +483,38 @@ static QDF_STATUS mlo_set_3_link_primary_umac(
if (!adjacent)
prim_psoc_id = psoc_ids[0];
else
return QDF_STATUS_E_FAILURE;
return prim_psoc_id;
}
}
ml_peer->primary_umac_psoc_id = prim_psoc_id;
return prim_psoc_id;
}
static QDF_STATUS mlo_set_3_link_primary_umac(
struct wlan_mlo_peer_context *ml_peer,
struct wlan_objmgr_vdev *link_vdevs[])
{
uint8_t psoc_ids[WLAN_UMAC_MLO_MAX_VDEVS];
int8_t central_umac_id;
if (ml_peer->max_links != 3)
return QDF_STATUS_E_FAILURE;
/* Some 3 link RDPs have restriction on the primary umac.
* Only the link that is adjacent to both the links can be
* a primary umac.
* Note: it means umac migration is also restricted.
*/
psoc_ids[0] = wlan_vdev_get_psoc_id(link_vdevs[0]);
psoc_ids[1] = wlan_vdev_get_psoc_id(link_vdevs[1]);
psoc_ids[2] = wlan_vdev_get_psoc_id(link_vdevs[2]);
central_umac_id = mlo_get_central_umac_id(psoc_ids);
if (central_umac_id != -1)
ml_peer->primary_umac_psoc_id = central_umac_id;
else
return QDF_STATUS_E_FAILURE;
mlo_peer_assign_primary_umac(ml_peer,
&ml_peer->peer_list[0]);