On 10/23/2024 6:30 AM, Kalle Valo wrote: > From: Sriram R <quic_srirrama@xxxxxxxxxxx> > > Add helper functions for multi link peer addition and deletion. And add address > validation to ensure we are not creating link peers (belonging to different > clients) with same MLD address. To aid in this validation for faster lookup, > add a new list of ML peers to struct ath12k_hw::ml_peers and use the same for > parsing for the above address validation use cases. > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 > > Signed-off-by: Sriram R <quic_srirrama@xxxxxxxxxxx> > Signed-off-by: Harshitha Prem <quic_hprem@xxxxxxxxxxx> > Signed-off-by: Kalle Valo <quic_kvalo@xxxxxxxxxxx> > --- ... > +int ath12k_peer_mlo_create(struct ath12k_hw *ah, struct ieee80211_sta *sta) > +{ > + struct ath12k_sta *ahsta = ath12k_sta_to_ahsta(sta); > + struct ath12k_ml_peer *ml_peer; > + > + lockdep_assert_wiphy(ah->hw->wiphy); > + > + if (!sta->mlo) > + return -EINVAL; > + > + ml_peer = ath12k_ml_peer_find(ah, sta->addr); > + if (ml_peer) { > + ath12k_hw_warn(ah, "ML peer (%d) exists already, unable to add new entry for %pM", The Linux coding style says: Printing numbers in parentheses (%d) adds no value and should be avoided. > + ml_peer->id, sta->addr); > + return -EEXIST; > + }