Browse Source

qcacmn: Maintain peer assoc sent flag for MLO link peers

This change adds support to set flag to indicate peer assoc
sent to FW. On peer delete, using the flag, it excludes
the peer assoc command missing link in peer delete command

Change-Id: Icb559941598a797e7d437fbb90a94358f709a2b3
CRs-Fixed: 3504769
Srinivas Pitla 2 years ago
parent
commit
9beb7dfcab

+ 24 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_peer.h

@@ -205,6 +205,30 @@ bool wlan_mlo_peer_is_link_peer(struct wlan_mlo_peer_context *ml_peer,
  */
 void wlan_mlo_partner_peer_assoc_post(struct wlan_objmgr_peer *assoc_peer);
 
+/**
+ * wlan_mlo_link_peer_assoc_set() - Set Peer assoc sent flag
+ * @peer: Link peer
+ * @is_sent: indicates whether peer assoc is queued to FW
+ *
+ * This function updates that the Peer assoc commandis sent for the link peer
+ *
+ * Return: void
+ */
+void wlan_mlo_link_peer_assoc_set(struct wlan_objmgr_peer *peer, bool is_sent);
+
+/**
+ * wlan_mlo_peer_get_del_hw_bitmap() - Gets peer del hw bitmap for link peer
+ * @peer: Link peer
+ * @hw_link_id_bitmap: WMI peer delete HW link bitmap
+ *
+ * This function gets hw bitmap for peer delete command, which includes
+ * hw link id of partner links for which peer assoc was not sent to FW
+ *
+ * Return: void
+ */
+void wlan_mlo_peer_get_del_hw_bitmap(struct wlan_objmgr_peer *peer,
+				     uint32_t *hw_link_id_bitmap);
+
 /**
  * wlan_mlo_peer_deauth_init() - Initiate Deauth of MLO peer
  * @ml_peer: MLO peer

+ 2 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h

@@ -492,6 +492,7 @@ struct wlan_mlo_dev_context {
  * @is_primary: sets true if the peer is primary UMAC’s peer
  * @hw_link_id: HW Link id of peer
  * @assoc_rsp_buf: Assoc resp buffer
+ * @peer_assoc_sent: flag to indicate peer assoc sent to FW
  */
 struct wlan_mlo_link_peer_entry {
 	struct wlan_objmgr_peer *link_peer;
@@ -500,6 +501,7 @@ struct wlan_mlo_link_peer_entry {
 	bool is_primary;
 	uint8_t hw_link_id;
 	qdf_nbuf_t assoc_rsp_buf;
+	bool peer_assoc_sent;
 };
 
 /**

+ 64 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_peer.c

@@ -256,6 +256,8 @@ QDF_STATUS wlan_mlo_peer_is_assoc_done(struct wlan_mlo_peer_context *ml_peer)
 	return status;
 }
 
+qdf_export_symbol(wlan_mlo_peer_is_assoc_done);
+
 struct wlan_objmgr_peer *wlan_mlo_peer_get_assoc_peer(
 					struct wlan_mlo_peer_context *ml_peer)
 {
@@ -393,6 +395,68 @@ void wlan_mlo_partner_peer_assoc_post(struct wlan_objmgr_peer *assoc_peer)
 	}
 }
 
+void wlan_mlo_link_peer_assoc_set(struct wlan_objmgr_peer *peer, bool is_sent)
+{
+	struct wlan_mlo_peer_context *ml_peer;
+	struct wlan_mlo_link_peer_entry *peer_entry;
+	uint16_t i;
+
+	ml_peer = peer->mlo_peer_ctx;
+	if (!ml_peer)
+		return;
+
+	mlo_peer_lock_acquire(ml_peer);
+
+	for (i = 0; i < MAX_MLO_LINK_PEERS; i++) {
+		peer_entry = &ml_peer->peer_list[i];
+
+		if (!peer_entry->link_peer)
+			continue;
+
+		if (peer_entry->link_peer == peer) {
+			peer_entry->peer_assoc_sent = is_sent;
+			break;
+		}
+	}
+	mlo_peer_lock_release(ml_peer);
+}
+
+qdf_export_symbol(wlan_mlo_link_peer_assoc_set);
+
+void wlan_mlo_peer_get_del_hw_bitmap(struct wlan_objmgr_peer *peer,
+				     uint32_t *hw_link_id_bitmap)
+{
+	struct wlan_mlo_peer_context *ml_peer;
+	struct wlan_mlo_link_peer_entry *peer_entry;
+	uint16_t i;
+
+	ml_peer = peer->mlo_peer_ctx;
+	if (!ml_peer)
+		return;
+
+	mlo_peer_lock_acquire(ml_peer);
+
+	for (i = 0; i < MAX_MLO_LINK_PEERS; i++) {
+		peer_entry = &ml_peer->peer_list[i];
+
+		if (!peer_entry->link_peer)
+			continue;
+
+		if (peer_entry->link_peer == peer) {
+			/* Peer assoc is not sent, no need to send bitmap */
+			if (!peer_entry->peer_assoc_sent)
+				break;
+
+			continue;
+		}
+		if (!peer_entry->peer_assoc_sent)
+			*hw_link_id_bitmap |= 1 << peer_entry->hw_link_id;
+	}
+	mlo_peer_lock_release(ml_peer);
+}
+
+qdf_export_symbol(wlan_mlo_peer_get_del_hw_bitmap);
+
 void
 wlan_mlo_peer_deauth_init(struct wlan_mlo_peer_context *ml_peer,
 			  struct wlan_objmgr_peer *src_peer,