Browse Source

qcacld-3.0: Add ucfg API to update link mac addr

After moving to the single-netdev-multiple-vdev model,
the dp_link mac address needs to be updated as a part
of dynamic mac address update.

Add an ucfg API to update link mac address.

Change-Id: I96d3230f958c15cb576c881c02e60bd3a4fb0379
CRs-Fixed: 3563523
Rakesh Pillai 1 year ago
parent
commit
315a53eaa9

+ 14 - 0
components/dp/dispatcher/inc/wlan_dp_ucfg_api.h

@@ -61,6 +61,20 @@ ucfg_dp_is_disconect_after_roam_fail(struct wlan_objmgr_psoc *psoc)
 }
 #endif
 
+/**
+ * ucfg_dp_update_link_mac_addr() - Update the dp_link mac address, during MLO
+ *				    link switch.
+ * @vdev: Objmgr vdev corresponding to the dp_link
+ * @new_mac_addr: New mac address of the dp_link
+ * @is_link_switch: Flag to indicate if the link mac addr update is as a part
+ *		    of MLO link switch.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_dp_update_link_mac_addr(struct wlan_objmgr_vdev *vdev,
+					struct qdf_mac_addr *new_mac_addr,
+					bool is_link_switch);
+
 /**
  * ucfg_dp_update_inf_mac() - update DP interface MAC address
  * @psoc: psoc handle

+ 21 - 0
components/dp/dispatcher/src/wlan_dp_ucfg_api.c

@@ -82,6 +82,27 @@ QDF_STATUS wlan_dp_set_vdev_direct_link_cfg(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
+QDF_STATUS ucfg_dp_update_link_mac_addr(struct wlan_objmgr_vdev *vdev,
+					struct qdf_mac_addr *new_mac_addr,
+					bool is_link_switch)
+{
+	struct wlan_dp_psoc_context *dp_ctx;
+	struct wlan_dp_link *dp_link;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	dp_ctx = dp_get_context();
+
+	dp_link = dp_get_vdev_priv_obj(vdev);
+	if (!is_dp_link_valid(dp_link)) {
+		dp_err("dp_link from vdev %pK is invalid", vdev);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	qdf_copy_macaddr(&dp_link->mac_addr, new_mac_addr);
+
+	return status;
+}
+
 void ucfg_dp_update_inf_mac(struct wlan_objmgr_psoc *psoc,
 			    struct qdf_mac_addr *cur_mac,
 			    struct qdf_mac_addr *new_mac)