Browse Source

qcacmn: Extract hw_link_id and store in target_if pdev context

hw_link_id is unique across psoc to identify pdev in multi-soc ML cases.
Exract hw_link_id from mac_phy_cap and provide APIs in target_if to set
and get this for pdev

Change-Id: I9dcc4c1e4b515e83151ca88f5f026c0dd0b04646
CRs-Fixed: 3023496
Kiran Venkatappa 3 years ago
parent
commit
7aaef9935d

+ 30 - 0
target_if/core/inc/target_if.h

@@ -335,6 +335,7 @@ struct target_psoc_info {
  * @accelerator_hdl: NSS offload/IPA handles
  * @accelerator_hdl: NSS offload/IPA handles
  * @pdev_idx: pdev id (of FW)
  * @pdev_idx: pdev id (of FW)
  * @phy_idx: phy id (of FW)
  * @phy_idx: phy id (of FW)
+ * @hw_link_id: Unique link id across SoC required in multi-soc ML
  * @feature_ptr: stores legacy pointer or few driver specific structures
  * @feature_ptr: stores legacy pointer or few driver specific structures
  */
  */
 struct target_pdev_info {
 struct target_pdev_info {
@@ -342,6 +343,9 @@ struct target_pdev_info {
 	struct common_accelerator_handle *accelerator_hdl;
 	struct common_accelerator_handle *accelerator_hdl;
 	int32_t pdev_idx;
 	int32_t pdev_idx;
 	int32_t phy_idx;
 	int32_t phy_idx;
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
+	uint16_t hw_link_id;
+#endif
 	void *feature_ptr;
 	void *feature_ptr;
 };
 };
 
 
@@ -2707,4 +2711,30 @@ static inline uint32_t target_psoc_get_target_cap_flags
 	return psoc_info->info.service_ext2_param.target_cap_flags;
 	return psoc_info->info.service_ext2_param.target_cap_flags;
 }
 }
 
 
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
+/**
+ * target_pdev_get_hw_link_id  - get hw_link_id
+ * @pdev:  pointer to structure target_pdev_info
+ *
+ * API to get hw_link_id
+ *
+ * Return: uint16_t
+ */
+#define PDEV_INVALID_HW_LINK_ID 0xFFFF
+uint16_t  target_if_pdev_get_hw_link_id
+		(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * target_pdev_set_hw_link_id - set hw_link_id
+ * @pdev:  pointer to structure target_pdev_info
+ * @hw_link_id: unique hw link id of pdev across psoc
+ *
+ * API to set hw_link_id
+ *
+ * Return: void
+ */
+void target_pdev_set_hw_link_id
+		(struct wlan_objmgr_pdev *pdev, uint16_t hw_link_id);
+#endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/
+
 #endif
 #endif

+ 31 - 0
target_if/core/src/target_if_main.c

@@ -877,3 +877,34 @@ void target_if_set_reg_cc_ext_supp(struct target_psoc_info *tgt_hdl,
 	info->wlan_res_cfg.is_reg_cc_ext_event_supported =
 	info->wlan_res_cfg.is_reg_cc_ext_event_supported =
 		target_if_reg_is_reg_cc_ext_event_host_supported(psoc);
 		target_if_reg_is_reg_cc_ext_event_host_supported(psoc);
 }
 }
+
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
+uint16_t  target_if_pdev_get_hw_link_id(struct wlan_objmgr_pdev *pdev)
+{
+	struct target_pdev_info *tgt_pdev_info;
+
+	if (!pdev)
+		return PDEV_INVALID_HW_LINK_ID;
+
+	tgt_pdev_info = wlan_pdev_get_tgt_if_handle(pdev);
+	if (!tgt_pdev_info)
+		return PDEV_INVALID_HW_LINK_ID;
+
+	return tgt_pdev_info->hw_link_id;
+}
+
+void target_pdev_set_hw_link_id(struct wlan_objmgr_pdev *pdev,
+				uint16_t hw_link_id)
+{
+	struct target_pdev_info *tgt_pdev_info;
+
+	if (!pdev)
+		return;
+
+	tgt_pdev_info = wlan_pdev_get_tgt_if_handle(pdev);
+	if (!tgt_pdev_info)
+		return;
+
+	tgt_pdev_info->hw_link_id  = hw_link_id;
+}
+#endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/

+ 4 - 0
target_if/init_deinit/inc/service_ready_param.h

@@ -184,6 +184,7 @@ struct wlan_psoc_host_hal_reg_cap_ext {
  * @nss_ratio_enabled: This flag is set if nss ratio is received from FW as part
  * @nss_ratio_enabled: This flag is set if nss ratio is received from FW as part
  *                     of service ready ext event.
  *                     of service ready ext event.
  * @nss_ratio: nss ratio is used to calculate the NSS value for 160MHz.
  * @nss_ratio: nss ratio is used to calculate the NSS value for 160MHz.
+ * @hw_link_id: Unique link id across SoCs used to identify link in Multi-SoC ML
  */
  */
 struct wlan_psoc_host_mac_phy_caps {
 struct wlan_psoc_host_mac_phy_caps {
 	uint32_t hw_mode_id;
 	uint32_t hw_mode_id;
@@ -230,6 +231,9 @@ struct wlan_psoc_host_mac_phy_caps {
 	uint32_t tgt_pdev_id;
 	uint32_t tgt_pdev_id;
 	bool nss_ratio_enabled;
 	bool nss_ratio_enabled;
 	uint8_t nss_ratio_info;
 	uint8_t nss_ratio_info;
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
+	uint16_t hw_link_id;
+#endif
 };
 };
 
 
 /**
 /**

+ 4 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -354,6 +354,7 @@ enum wlan_mlme_cfg_id;
  * @psoc_vdev_rsp_timer_mod: function to modify the time of vdev rsp timer
  * @psoc_vdev_rsp_timer_mod: function to modify the time of vdev rsp timer
  * @psoc_wake_lock_init: Initialize psoc wake lock for vdev response timer
  * @psoc_wake_lock_init: Initialize psoc wake lock for vdev response timer
  * @psoc_wake_lock_deinit: De-Initialize psoc wake lock for vdev response timer
  * @psoc_wake_lock_deinit: De-Initialize psoc wake lock for vdev response timer
+ * @get_hw_link_id: Get hw_link_id for pdev
  */
  */
 struct wlan_lmac_if_mlme_tx_ops {
 struct wlan_lmac_if_mlme_tx_ops {
 	uint32_t (*get_wifi_iface_id) (struct wlan_objmgr_pdev *pdev);
 	uint32_t (*get_wifi_iface_id) (struct wlan_objmgr_pdev *pdev);
@@ -436,6 +437,9 @@ struct wlan_lmac_if_mlme_tx_ops {
 				struct wlan_objmgr_psoc *psoc,
 				struct wlan_objmgr_psoc *psoc,
 				struct vdev_response_timer *vdev_rsp,
 				struct vdev_response_timer *vdev_rsp,
 				enum wlan_vdev_mgr_tgt_if_rsp_bit clear_bit);
 				enum wlan_vdev_mgr_tgt_if_rsp_bit clear_bit);
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
+	uint16_t (*get_hw_link_id)(struct wlan_objmgr_pdev *pdev);
+#endif
 };
 };
 
 
 /**
 /**

+ 18 - 3
wmi/src/wmi_unified_tlv.c

@@ -11693,6 +11693,19 @@ extract_service_ready_11be_support(struct wlan_psoc_host_mac_phy_caps *param,
 }
 }
 #endif
 #endif
 
 
+#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
+static void extract_hw_link_id(struct wlan_psoc_host_mac_phy_caps *param,
+			       WMI_MAC_PHY_CAPABILITIES *mac_phy_caps)
+{
+	param->hw_link_id = WMI_PHY_GET_HW_LINK_ID(mac_phy_caps->pdev_id);
+}
+#else
+static void extract_hw_link_id(struct wlan_psoc_host_mac_phy_caps *param,
+			       WMI_MAC_PHY_CAPABILITIES *mac_phy_caps)
+{
+}
+#endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/
+
 /**
 /**
  * extract_mac_phy_cap_service_ready_ext_tlv() -
  * extract_mac_phy_cap_service_ready_ext_tlv() -
  *       extract MAC phy cap from service ready event
  *       extract MAC phy cap from service ready event
@@ -11713,7 +11726,7 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv(
 	WMI_MAC_PHY_CAPABILITIES *mac_phy_caps;
 	WMI_MAC_PHY_CAPABILITIES *mac_phy_caps;
 	WMI_SOC_MAC_PHY_HW_MODE_CAPS *hw_caps;
 	WMI_SOC_MAC_PHY_HW_MODE_CAPS *hw_caps;
 	uint32_t phy_map;
 	uint32_t phy_map;
-	uint8_t hw_idx, phy_idx = 0;
+	uint8_t hw_idx, phy_idx = 0, pdev_id;
 
 
 	param_buf = (WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *) event;
 	param_buf = (WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *) event;
 	if (!param_buf)
 	if (!param_buf)
@@ -11751,10 +11764,12 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv(
 
 
 	param->hw_mode_id = mac_phy_caps->hw_mode_id;
 	param->hw_mode_id = mac_phy_caps->hw_mode_id;
 	param->phy_idx = phy_idx;
 	param->phy_idx = phy_idx;
+	pdev_id = WMI_PHY_GET_PDEV_ID(mac_phy_caps->pdev_id);
 	param->pdev_id = wmi_handle->ops->convert_pdev_id_target_to_host(
 	param->pdev_id = wmi_handle->ops->convert_pdev_id_target_to_host(
 							wmi_handle,
 							wmi_handle,
-							mac_phy_caps->pdev_id);
-	param->tgt_pdev_id = mac_phy_caps->pdev_id;
+							pdev_id);
+	param->tgt_pdev_id = pdev_id;
+	extract_hw_link_id(param, mac_phy_caps);
 	param->phy_id = mac_phy_caps->phy_id;
 	param->phy_id = mac_phy_caps->phy_id;
 	param->supports_11b =
 	param->supports_11b =
 			WMI_SUPPORT_11B_GET(mac_phy_caps->supported_flags);
 			WMI_SUPPORT_11B_GET(mac_phy_caps->supported_flags);