Browse Source

qcacld-3.0: Add support for ll_lt_sap service capability

Add support for ll_lt_sap service capability

Change-Id: I72322eb18911cad7d7f367e4cb828df97516440e
CRs-Fixed: 3647672
Ashish Kumar Dhanotiya 1 year ago
parent
commit
dda17ba73b

+ 11 - 5
components/umac/mlme/sap/ll_sap/core/src/wlan_ll_lt_sap_main.c

@@ -22,13 +22,19 @@
 #include "wlan_ll_sap_main.h"
 #include "wlan_ll_lt_sap_bearer_switch.h"
 #include "wlan_scan_api.h"
+#include "target_if.h"
 
-bool ll_lt_sap_is_supported(void)
+bool ll_lt_sap_is_supported(struct wlan_objmgr_psoc *psoc)
 {
-	/* To do, check the FW capability to decide if this is supported
-	 * or not supported.
-	 */
-	return true;
+	struct wmi_unified *wmi_handle;
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		ll_sap_err("Invalid WMI handle");
+		return false;
+	}
+
+	return wmi_service_enabled(wmi_handle, wmi_service_xpan_support);
 }
 
 /**

+ 2 - 2
components/umac/mlme/sap/ll_sap/core/src/wlan_ll_lt_sap_main.h

@@ -30,10 +30,10 @@
 
 /**
  * ll_lt_sap_is_supported() - Check if ll_lt_sap is supported or not
- *
+ * @psoc: Pointer to psoc object
  * Return: True/False
  */
-bool ll_lt_sap_is_supported(void);
+bool ll_lt_sap_is_supported(struct wlan_objmgr_psoc *psoc);
 
 /**
  * ll_lt_sap_get_freq_list() - API to get frequency list for LL_LT_SAP

+ 3 - 2
components/umac/mlme/sap/ll_sap/dispatcher/inc/wlan_ll_sap_ucfg_api.h

@@ -42,10 +42,11 @@ QDF_STATUS ucfg_ll_sap_deinit(void);
 
 /**
  * ucfg_is_ll_lt_sap_supported() - Check if ll_lt_sap is supported or not
+ *@psoc: Psoc pointer
  *
  * Return: True/False
  */
-bool ucfg_is_ll_lt_sap_supported(void);
+bool ucfg_is_ll_lt_sap_supported(struct wlan_objmgr_psoc *psoc);
 
 /**
  * ucfg_ll_lt_sap_request_for_audio_transport_switch() - Request to switch the
@@ -99,7 +100,7 @@ static inline QDF_STATUS ucfg_ll_sap_deinit(void)
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline bool ucfg_is_ll_lt_sap_supported(void)
+static inline bool ucfg_is_ll_lt_sap_supported(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
 }

+ 2 - 2
components/umac/mlme/sap/ll_sap/dispatcher/src/wlan_ll_sap_ucfg_api.c

@@ -34,9 +34,9 @@ QDF_STATUS ucfg_ll_sap_deinit(void)
 	return ll_sap_deinit();
 }
 
-bool ucfg_is_ll_lt_sap_supported(void)
+bool ucfg_is_ll_lt_sap_supported(struct wlan_objmgr_psoc *psoc)
 {
-	return ll_lt_sap_is_supported();
+	return ll_lt_sap_is_supported(psoc);
 }
 
 QDF_STATUS ucfg_ll_lt_sap_request_for_audio_transport_switch(

+ 7 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5061,12 +5061,17 @@ static inline void wlan_hdd_set_ndi_feature(uint8_t *feature_flags)
 }
 #endif
 
-static inline void wlan_hdd_set_ll_lt_sap_feature(uint8_t *feature_flags)
+static inline void wlan_hdd_set_ll_lt_sap_feature(struct wlan_objmgr_psoc *psoc,
+						  uint8_t *feature_flags)
 {
 	/* To Do: Once FW feature capability changes for ll_lt_sap feature are
 	 * merged, then this feature will be set based on that feature set
 	 * capability
 	 */
+	if (!ucfg_is_ll_lt_sap_supported(psoc)) {
+		hdd_debug("ll_lt_sap feature is disabled in FW");
+		return;
+	}
 	wlan_hdd_cfg80211_set_feature(feature_flags,
 				      QCA_WLAN_VENDOR_FEATURE_ENHANCED_AUDIO_EXPERIENCE_OVER_WLAN);
 }
@@ -5193,7 +5198,7 @@ __wlan_hdd_cfg80211_get_features(struct wiphy *wiphy,
 				feature_flags,
 				QCA_WLAN_VENDOR_FEATURE_AP_ALLOWED_FREQ_LIST);
 	wlan_wifi_pos_cfg80211_set_features(hdd_ctx->psoc, feature_flags);
-	wlan_hdd_set_ll_lt_sap_feature(feature_flags);
+	wlan_hdd_set_ll_lt_sap_feature(hdd_ctx->psoc, feature_flags);
 
 	skb = wlan_cfg80211_vendor_cmd_alloc_reply_skb(wiphy,
 						       sizeof(feature_flags) +