Browse Source

qcacld-3.0: Pass mld address and assoc link info when creating bss peer

MLO sta needs mld mac and assoc link information to create bss peer
Get mld address and assoc link info from connection manager and pass
it to bss peer creation

Change-Id: Ie04d4eb01f1a039f068b32b6c53aa3e65c919518
CRs-Fixed: 2987483
bings 3 years ago
parent
commit
bebd7a8b45

+ 11 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h

@@ -123,10 +123,16 @@ struct cm_vdev_join_rsp {
  * struct cm_peer_create_req - bss peer create req
  * @vdev_id: vdev_id
  * @peer_mac: peer mac to create
+ * @mld_mac: peer mld mac
+ * @is_assoc_peer: is assoc peer or not
  */
 struct cm_peer_create_req {
 	uint8_t vdev_id;
 	struct qdf_mac_addr peer_mac;
+#ifdef WLAN_FEATURE_11BE_MLO
+	struct qdf_mac_addr mld_mac;
+	bool is_assoc_peer;
+#endif
 };
 
 /**
@@ -341,12 +347,16 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
  * request
  * @vdev: VDEV object
  * @peer_mac: Peer mac address
+ * @mld_mac: peer mld mac address
+ * @is_assoc_peer: is assoc peer or not
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS
 cm_send_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
-			    struct qdf_mac_addr *peer_mac);
+			    struct qdf_mac_addr *peer_mac,
+			    struct qdf_mac_addr *mld_mac,
+			    bool is_assoc_peer);
 
 /**
  * cm_csr_connect_rsp() - Connection manager ext connect resp indication

+ 30 - 2
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -1218,9 +1218,37 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	return status;
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * cm_set_peer_mld_info() - set mld_mac and is_assoc_peer flag
+ * @req: cm_peer_create_req
+ * @mld_mac: mld mac addr
+ * @is_assoc_peer: is assoc peer
+ *
+ * Return: void
+ */
+static void cm_set_peer_mld_info(struct cm_peer_create_req *req,
+				 struct qdf_mac_addr *mld_mac,
+				 bool is_assoc_peer)
+{
+	if (!req) {
+		qdf_copy_macaddr(&req->mld_mac, mld_mac);
+		req->is_assoc_peer = is_assoc_peer;
+	}
+}
+#else
+static void cm_set_peer_mld_info(struct cm_peer_create_req *req,
+				 struct qdf_mac_addr *mld_mac,
+				 bool is_assoc_peer)
+{
+}
+#endif
+
 QDF_STATUS
 cm_send_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
-			    struct qdf_mac_addr *peer_mac)
+			    struct qdf_mac_addr *peer_mac,
+			    struct qdf_mac_addr *mld_mac,
+			    bool is_assoc_peer)
 {
 	struct scheduler_msg msg;
 	QDF_STATUS status;
@@ -1237,7 +1265,7 @@ cm_send_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
 
 	req->vdev_id = wlan_vdev_get_id(vdev);
 	qdf_copy_macaddr(&req->peer_mac, peer_mac);
-
+	cm_set_peer_mld_info(req, mld_mac, is_assoc_peer);
 	msg.bodyptr = req;
 	msg.type = CM_BSS_PEER_CREATE_REQ;
 

+ 36 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -3895,10 +3895,43 @@ QDF_STATUS cm_process_disconnect_req(struct scheduler_msg *msg)
 	return status;
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * wma_get_mld_info_sta() - get peer_mld_addr and assoc peer flag for sta
+ * @req: cm_peer_create_req
+ * @peer_mld_addr: peer mld mac addr
+ * @is_assoc_peer: is assoc peer
+ *
+ * Return: void
+ */
+static void wma_get_mld_info_sta(struct cm_peer_create_req *req,
+				 uint8_t *peer_mld_addr,
+				 bool *is_assoc_peer)
+{
+	if (req) {
+		peer_mld_addr = req->mld_mac.bytes;
+		*is_assoc_peer = req->is_assoc_peer;
+	} else {
+		peer_mld_addr = NULL;
+		*is_assoc_peer = false;
+	}
+}
+#else
+static void wma_get_mld_info_sta(struct cm_peer_create_req *req,
+				 uint8_t *peer_mld_addr,
+				 bool *is_assoc_peer)
+{
+	peer_mld_addr = NULL;
+	*is_assoc_peer = false;
+}
+#endif
+
 QDF_STATUS cm_process_peer_create(struct scheduler_msg *msg)
 {
 	struct cm_peer_create_req *req;
 	QDF_STATUS status;
+	uint8_t *peer_mld_addr = NULL;
+	bool is_assoc_peer = false;
 
 	if (!msg || !msg->bodyptr) {
 		mlme_err("msg or msg->bodyptr is NULL");
@@ -3907,7 +3940,9 @@ QDF_STATUS cm_process_peer_create(struct scheduler_msg *msg)
 
 	req = msg->bodyptr;
 
-	status = wma_add_bss_peer_sta(req->vdev_id, req->peer_mac.bytes, true);
+	wma_get_mld_info_sta(req, peer_mld_addr, &is_assoc_peer);
+	status = wma_add_bss_peer_sta(req->vdev_id, req->peer_mac.bytes, true,
+				      peer_mld_addr, is_assoc_peer);
 
 	qdf_mem_free(req);
 

+ 12 - 1
core/mac/src/pe/lim/lim_utils.c

@@ -72,6 +72,9 @@
 #ifdef WLAN_FEATURE_11BE
 #include "wma_eht.h"
 #endif
+#ifdef WLAN_FEATURE_11BE_MLO
+#include <lim_mlo.h>
+#endif
 
 /** -------------------------------------------------------------
    \fn lim_delete_dialogue_token_list
@@ -8143,7 +8146,15 @@ void lim_update_sta_eht_capable(struct mac_context *mac,
 	else
 		add_sta_params->eht_capable = session_entry->eht_capable;
 
-	pe_debug("eht_capable: %d", add_sta_params->eht_capable);
+	if (add_sta_params->eht_capable) {
+		WLAN_ADDR_COPY(add_sta_params->mld_mac_addr, sta_ds->mld_addr);
+		add_sta_params->is_assoc_peer = lim_is_mlo_recv_assoc(sta_ds);
+	}
+
+	pe_debug("eht_capable: %d mld mac " QDF_MAC_ADDR_FMT " assoc peer %d",
+		 add_sta_params->eht_capable,
+		 QDF_MAC_ADDR_REF(add_sta_params->mld_mac_addr),
+		 add_sta_params->is_assoc_peer);
 }
 
 void lim_update_session_eht_capable_chan_switch(struct mac_context *mac,

+ 9 - 2
core/wma/inc/wma.h

@@ -1645,12 +1645,16 @@ QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr,
  * @peer_addr: peer mac address
  * @peer_type: peer type
  * @vdev_id: vdev id
+ * @peer_mld_addr: peer mld address
+ * @is_assoc_peer: is assoc peer or not
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS wma_create_peer(tp_wma_handle wma,
 			   uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
-			   u_int32_t peer_type, u_int8_t vdev_id);
+			   u_int32_t peer_type, u_int8_t vdev_id,
+			   uint8_t peer_mld_addr[QDF_MAC_ADDR_SIZE],
+			   bool is_assoc_peer);
 
 QDF_STATUS wma_peer_unmap_conf_cb(uint8_t vdev_id,
 				  uint32_t peer_id_cnt,
@@ -2391,11 +2395,14 @@ int wma_motion_det_base_line_host_event_handler(void *handle, u_int8_t *event,
  * @is_resp_required: Peer create response is expected from firmware.
  * This flag will be set to true for initial connection and false for
  * LFR2 case.
+ * @mld_mac: peer mld mac address
+ * @is_assoc_peer: is assoc peer or not
  *
  * Return: 0 on success, else error on failure
  */
 QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
-				bool is_resp_required);
+				bool is_resp_required, uint8_t *mld_mac,
+				bool is_assoc_peer);
 
 /**
  * wma_send_vdev_stop() - WMA api to send vdev stop to fw

+ 6 - 0
core/wma/inc/wma_if.h

@@ -170,6 +170,8 @@ struct sAniProbeRspStruct {
  * @eht_capable: is EHT capabale or not
  * @eht_config: EHT capability
  * @eht_op: EHT operation
+ * @mld_mac_addr: mld mac address
+ * @is_assoc_peer: is assoc peer or not
  *
  * This structure contains parameter required for
  * add sta request of upper layer.
@@ -256,6 +258,10 @@ typedef struct {
 	tDot11fIEeht_cap eht_config;
 	tDot11fIEeht_op eht_op;
 #endif
+#ifdef WLAN_FEATURE_11BE_MLO
+	uint8_t mld_mac_addr[QDF_MAC_ADDR_SIZE];
+	bool is_assoc_peer;
+#endif
 } tAddStaParams, *tpAddStaParams;
 
 /**

+ 73 - 14
core/wma/src/wma_dev_if.c

@@ -1789,13 +1789,17 @@ wma_increment_peer_count(tp_wma_handle wma, uint8_t vdev_id)
  * @peer_addr: peer mac addr
  * @peer_type: peer type
  * @vdev_id: vdev id
+ * @peer_mld_addr: peer mld addr
+ * @is_assoc_peer: is assoc peer or not
  *
  * Return: QDF status
  */
 static
 QDF_STATUS wma_add_peer(tp_wma_handle wma,
 			uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
-			uint32_t peer_type, uint8_t vdev_id)
+			uint32_t peer_type, uint8_t vdev_id,
+			uint8_t peer_mld_addr[QDF_MAC_ADDR_SIZE],
+			bool is_assoc_peer)
 {
 	struct peer_create_params param = {0};
 	void *dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
@@ -1840,6 +1844,14 @@ QDF_STATUS wma_add_peer(tp_wma_handle wma,
 	 * where the HTT peer map event is received before the peer object
 	 * is created in the data path
 	 */
+	if (peer_mld_addr &&
+	    !qdf_is_macaddr_zero((struct qdf_mac_addr *)peer_mld_addr)) {
+		wma_debug("peer " QDF_MAC_ADDR_FMT "is_assoc_peer%d mld mac " QDF_MAC_ADDR_FMT,
+			  QDF_MAC_ADDR_REF(peer_addr), is_assoc_peer,
+			  QDF_MAC_ADDR_REF(peer_mld_addr));
+		wlan_peer_mlme_set_mldaddr(obj_peer, peer_mld_addr);
+		wlan_peer_mlme_set_assoc_peer(obj_peer, is_assoc_peer);
+	}
 	status = cdp_peer_create(dp_soc, vdev_id, peer_addr);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		wma_err("Unable to attach peer "QDF_MAC_ADDR_FMT,
@@ -1889,15 +1901,17 @@ QDF_STATUS wma_add_peer(tp_wma_handle wma,
 
 QDF_STATUS wma_create_peer(tp_wma_handle wma,
 			   uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
-			   uint32_t peer_type, uint8_t vdev_id)
+			   uint32_t peer_type, uint8_t vdev_id,
+			   uint8_t peer_mld_addr[QDF_MAC_ADDR_SIZE],
+			   bool is_assoc_peer)
 {
 	void *dp_soc = cds_get_context(QDF_MODULE_ID_SOC);
 	QDF_STATUS status;
 
 	if (!dp_soc)
 		return QDF_STATUS_E_FAILURE;
-
-	status = wma_add_peer(wma, peer_addr, peer_type, vdev_id);
+	status = wma_add_peer(wma, peer_addr, peer_type, vdev_id,
+			      peer_mld_addr, is_assoc_peer);
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
 
@@ -1914,13 +1928,17 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma,
  * @peer_addr: peer mac address
  * @peer_type: peer type
  * @vdev_id: vdev id
+ * @mld_addr: peer mld address
+ * @is_assoc_peer: is assoc peer or not
  *
  * Return: QDF_STATUS
  */
 static QDF_STATUS
 wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 			     uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
-			     uint32_t peer_type, uint8_t vdev_id)
+			     uint32_t peer_type, uint8_t vdev_id,
+			     uint8_t mld_addr[QDF_MAC_ADDR_SIZE],
+			     bool is_assoc_peer)
 {
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 	struct wma_target_req *msg = NULL;
@@ -1941,7 +1959,8 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 		wlan_psoc_nif_fw_ext_cap_get(wma->psoc,
 					     WLAN_SOC_F_PEER_CREATE_RESP);
 	if (!is_tgt_peer_conf_supported) {
-		status = wma_create_peer(wma, peer_addr, peer_type, vdev_id);
+		status = wma_create_peer(wma, peer_addr, peer_type, vdev_id,
+					 mld_addr, is_assoc_peer);
 		goto end;
 	}
 
@@ -1952,7 +1971,8 @@ wma_create_sta_mode_bss_peer(tp_wma_handle wma,
 	wma_acquire_wakelock(&wma->wmi_cmd_rsp_wake_lock,
 			     WMA_PEER_CREATE_RESPONSE_TIMEOUT);
 
-	status = wma_add_peer(wma, peer_addr, peer_type, vdev_id);
+	status = wma_add_peer(wma, peer_addr, peer_type, vdev_id,
+			      mld_addr, is_assoc_peer);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		wma_release_wakelock(&wma->wmi_cmd_rsp_wake_lock);
 		goto end;
@@ -2490,7 +2510,8 @@ QDF_STATUS wma_vdev_self_peer_create(struct vdev_mlme_obj *vdev_mlme)
 		status = wma_create_peer(wma_handle,
 					 vdev->vdev_mlme.macaddr,
 					 WMI_PEER_TYPE_DEFAULT,
-					 wlan_vdev_get_id(vdev));
+					 wlan_vdev_get_id(vdev),
+					 NULL, false);
 		if (QDF_IS_STATUS_ERROR(status))
 			wma_err("Failed to create peer %d", status);
 	} else if (vdev_mlme->mgmt.generic.type == WMI_VDEV_TYPE_STA) {
@@ -3589,7 +3610,8 @@ QDF_STATUS wma_pre_vdev_start_setup(uint8_t vdev_id,
 		mac_addr = wlan_vdev_mlme_get_macaddr(iface->vdev);
 
 	status = wma_create_peer(wma, mac_addr,
-				 WMI_PEER_TYPE_DEFAULT, vdev_id);
+				 WMI_PEER_TYPE_DEFAULT, vdev_id,
+				 NULL, false);
 	if (status != QDF_STATUS_SUCCESS) {
 		wma_err("Failed to create peer");
 		return status;
@@ -3999,6 +4021,37 @@ send_resp:
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+/**
+ * wma_get_mld_info_ap() - get mld mac addr and assoc peer flag for ap
+ * @add_sta: tpAddStaParams
+ * @peer_mld_addr: peer mld mac addr
+ * @is_assoc_peer: is assoc peer or not
+ *
+ * Return: void
+ */
+static void wma_get_mld_info_ap(tpAddStaParams add_sta,
+				uint8_t *peer_mld_addr,
+				bool *is_assoc_peer)
+{
+	if (add_sta) {
+		peer_mld_addr = add_sta->mld_mac_addr;
+		*is_assoc_peer = add_sta->is_assoc_peer;
+	} else {
+		peer_mld_addr = NULL;
+		*is_assoc_peer = false;
+	}
+}
+#else
+static void wma_get_mld_info_ap(tpAddStaParams add_sta,
+				uint8_t *peer_mld_addr,
+				bool *is_assoc_peer)
+{
+	peer_mld_addr = NULL;
+	*is_assoc_peer = false;
+}
+#endif
+
 /**
  * wma_add_sta_req_ap_mode() - process add sta request in ap mode
  * @wma: wma handle
@@ -4020,6 +4073,8 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	uint16_t mcs_limit;
 	uint8_t *rate_pos;
 	struct mac_context *mac = wma->mac_context;
+	uint8_t *peer_mld_addr = NULL;
+	bool is_assoc_peer = false;
 
 	/* UMAC sends WMA_ADD_STA_REQ msg twice to WMA when the station
 	 * associates. First WMA_ADD_STA_REQ will have staType as
@@ -4059,8 +4114,10 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 
 	wma_delete_invalid_peer_entries(add_sta->smesessionId, add_sta->staMac);
 
+	wma_get_mld_info_ap(add_sta, peer_mld_addr, &is_assoc_peer);
 	status = wma_create_peer(wma, add_sta->staMac, WMI_PEER_TYPE_DEFAULT,
-				 add_sta->smesessionId);
+				 add_sta->smesessionId, peer_mld_addr,
+				 is_assoc_peer);
 	if (status != QDF_STATUS_SUCCESS) {
 		wma_err("Failed to create peer for "QDF_MAC_ADDR_FMT,
 			QDF_MAC_ADDR_REF(add_sta->staMac));
@@ -4227,7 +4284,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 
 		status = wma_create_peer(wma, add_sta->staMac,
 					 WMI_PEER_TYPE_TDLS,
-					 add_sta->smesessionId);
+					 add_sta->smesessionId, NULL, false);
 		if (status != QDF_STATUS_SUCCESS) {
 			wma_err("Failed to create peer for "QDF_MAC_ADDR_FMT,
 				QDF_MAC_ADDR_REF(add_sta->staMac));
@@ -5475,7 +5532,8 @@ QDF_STATUS wma_set_wlm_latency_level(void *wma_ptr,
 }
 
 QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
-				bool is_resp_required)
+				bool is_resp_required,
+				uint8_t *mld_mac, bool is_assoc_peer)
 {
 	tp_wma_handle wma;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
@@ -5487,10 +5545,11 @@ QDF_STATUS wma_add_bss_peer_sta(uint8_t vdev_id, uint8_t *bssid,
 	if (is_resp_required)
 		status = wma_create_sta_mode_bss_peer(wma, bssid,
 						      WMI_PEER_TYPE_DEFAULT,
-						      vdev_id);
+						      vdev_id, mld_mac,
+						      is_assoc_peer);
 	else
 		status = wma_create_peer(wma, bssid, WMI_PEER_TYPE_DEFAULT,
-					 vdev_id);
+					 vdev_id, mld_mac, is_assoc_peer);
 err:
 	return status;
 }

+ 2 - 1
core/wma/src/wma_nan_datapath.c

@@ -77,7 +77,8 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	}
 
 	status = wma_create_peer(wma, add_sta->staMac,
-				 WMI_PEER_TYPE_NAN_DATA, add_sta->smesessionId);
+				 WMI_PEER_TYPE_NAN_DATA, add_sta->smesessionId,
+				 NULL, false);
 	if (status != QDF_STATUS_SUCCESS) {
 		wma_err("Failed to create peer for "QDF_MAC_ADDR_FMT,
 			 QDF_MAC_ADDR_REF(add_sta->staMac));

+ 1 - 1
core/wma/src/wma_scan_roam.c

@@ -937,7 +937,7 @@ wma_roam_update_vdev(tp_wma_handle wma,
 	wma_delete_sta(wma, del_sta_params);
 	wma_delete_bss(wma, vdev_id);
 	wma_create_peer(wma, roam_synch_ind_ptr->bssid.bytes,
-			WMI_PEER_TYPE_DEFAULT, vdev_id);
+			WMI_PEER_TYPE_DEFAULT, vdev_id, NULL, false);
 
 	/* Update new peer's uc cipher */
 	uc_cipher = wlan_crypto_get_param(wma->interfaces[vdev_id].vdev,