Selaa lähdekoodia

Merge "qcacmn: Add support for MLO target recovery"

Linux Build Service Account 3 vuotta sitten
vanhempi
sitoutus
e53c033e74

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

@@ -634,4 +634,18 @@ struct mlo_link_set_active_req {
 	struct mlo_link_set_active_ctx ctx;
 	struct mlo_link_set_active_param param;
 };
+
+/*
+ * enum mlo_chip_recovery_type - MLO chip recovery types
+ * @MLO_RECOVERY_MODE_0: CRASH_PARTNER_CHIPS & recover all chips
+ * @MLO_RECOVERY_MODE_1: Crash & recover asserted chip alone
+ * @MLO_RECOVERY_MODE_MAX: Max limit for recovery types
+ */
+enum mlo_chip_recovery_type {
+	MLO_RECOVERY_MODE_0 = 1,
+	MLO_RECOVERY_MODE_1 = 2,
+
+	/* Add new types above */
+	MLO_RECOVERY_MODE_MAX = 0xf
+};
 #endif

+ 25 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h

@@ -18,6 +18,31 @@
  */
 
 #ifdef WLAN_MLO_MULTI_CHIP
+/**
+ * mlo_is_ml_soc() - API to check if psoc belongs to ML group
+ * @psoc: Soc to be checked.
+ *
+ * Return: true if psoc found in ml soc_list, or else return false
+ */
+bool mlo_is_ml_soc(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * mlo_get_soc_list() - API to get the list of SOCs participating in MLO
+ * @soc_list: list where ML participating SOCs need to be populated
+ *
+ * Return: None
+ */
+void mlo_get_soc_list(struct wlan_objmgr_psoc **soc_list);
+
+/**
+ * mlo_cleanup_asserted_soc_setup_info() - API to cleanup the mlo setup info of
+ * asserted soc
+ * @psoc: Soc to be cleaned up
+ *
+ * Return: None
+ */
+void mlo_cleanup_asserted_soc_setup_info(struct wlan_objmgr_psoc *psoc);
+
 /**
  * mlo_setup_update_total_socs() - API to update total socs for mlo
  * @tot_socs: Total socs

+ 67 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_setup.c

@@ -24,6 +24,73 @@
 #endif
 
 #ifdef WLAN_MLO_MULTI_CHIP
+bool mlo_is_ml_soc(struct wlan_objmgr_psoc *psoc)
+{
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+	uint8_t chip_idx;
+
+	if (!mlo_ctx)
+		return false;
+
+	for (chip_idx = 0; chip_idx < MAX_MLO_CHIPS; chip_idx++)
+		if (mlo_ctx->setup_info.soc_list[chip_idx] == psoc)
+			return true;
+
+	return false;
+}
+
+qdf_export_symbol(mlo_is_ml_soc);
+
+void mlo_get_soc_list(struct wlan_objmgr_psoc **soc_list)
+{
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+	uint8_t chip_idx;
+
+	if (!mlo_ctx) {
+		for (chip_idx = 0; chip_idx < MAX_MLO_CHIPS; chip_idx++)
+			soc_list[chip_idx] = NULL;
+
+		return;
+	}
+
+	for (chip_idx = 0; chip_idx < MAX_MLO_CHIPS; chip_idx++)
+		soc_list[chip_idx] = mlo_ctx->setup_info.soc_list[chip_idx];
+}
+
+qdf_export_symbol(mlo_get_soc_list);
+
+void mlo_cleanup_asserted_soc_setup_info(struct wlan_objmgr_psoc *psoc)
+{
+	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();
+	uint8_t link_idx;
+	struct wlan_objmgr_pdev *pdev;
+
+	if (!mlo_ctx)
+		return;
+
+	if (!mlo_ctx->setup_info.num_links)
+		return;
+
+	if (!psoc) {
+		qdf_info("NULL psoc");
+		return;
+	}
+
+	for (link_idx = 0; link_idx < MAX_MLO_LINKS; link_idx++) {
+		pdev = mlo_ctx->setup_info.pdev_list[link_idx];
+		if (pdev) {
+			if (wlan_pdev_get_psoc(pdev) == psoc) {
+				mlo_ctx->setup_info.pdev_list[link_idx] = NULL;
+				mlo_ctx->setup_info.state[link_idx] =
+					MLO_LINK_TEARDOWN;
+				mlo_ctx->setup_info.num_links--;
+			}
+		}
+	}
+}
+
+qdf_export_symbol(mlo_cleanup_asserted_soc_setup_info);
+
 void mlo_setup_update_total_socs(uint8_t tot_socs)
 {
 	struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx();