qcacmn: Fix local_link_id assignment for link peers

Currently the local_link_id is assigned to each
link peer, during peer setup, with an incremental
number, based on the number of peer setup being
done for the link peers corresponding to the same MLD.

The above logic does not handle the link switch case,
where any particular link peer can be created and deleted
multiple times, thereby leading to 'n' number of peer
setups, each assigning an incremental number as the
local_link_id to the link peer. Due to this the local_link_id
value will exceed the MAX_MLO_LINKS ceiling value, and
when this local_link_id is used to set the frequency band
it leads to an out-of-bound array access.

In order to fix the above mentioned scenario, maintain
a mapping of link peer mac address to local_link_id inside
the txrx_peer (common for all link peers) and use this mapping
table to get the local_link_id. This will make sure that during
any link re-purpose, the link peer being setup will regain the
local_link_id which it was assigned during the first time it was
setup.

Change-Id: Ia78413efe328c81bab74b3a048214d3807b6c6c4
CRs-Fixed: 3658539
This commit is contained in:
Rakesh Pillai
2023-11-07 01:43:23 -08:00
committed by Ravindra Konda
父節點 74e7f3c660
當前提交 a7fe389b77
共有 3 個文件被更改,包括 62 次插入4 次删除

查看文件

@@ -5568,7 +5568,6 @@ dp_txrx_peer_reset_local_link_id(struct dp_txrx_peer *txrx_peer)
{
int i;
txrx_peer->local_link_id = 0;
for (i = 0; i <= DP_MAX_MLO_LINKS; i++)
txrx_peer->ll_band[i] = DP_BAND_INVALID;
}