Browse Source

qcacld-3.0: Only send VHT TX_BF if FW supports it

Only send the VHT TX beamforming capability if firmware has set the
support bit. This helps ensure backward compatibility for older
products.

Change-Id: Ia5830c9f378e3f0ddc83c8019d5168a270ad6f69
CRs-fixed: 2933687
Lincoln Tran 3 years ago
parent
commit
f3ce32ef59

+ 15 - 1
components/nan/core/inc/wlan_nan_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -207,6 +207,14 @@ bool wlan_nan_get_sap_conc_support(struct wlan_objmgr_psoc *psoc);
  * Return: Cleanup NAN state upon NAN disable
  */
 QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * wlan_nan_is_beamforming_supported- Get support for beamforing
+ * @psoc: pointer to psoc object
+ *
+ * Return: True if beamforming is supported, false if not.
+ */
+bool wlan_nan_is_beamforming_supported(struct wlan_objmgr_psoc *psoc);
 #else /* WLAN_FEATURE_NAN */
 static inline QDF_STATUS nan_init(void)
 {
@@ -252,5 +260,11 @@ QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc)
 {
 	return QDF_STATUS_E_FAILURE;
 }
+
+static inline
+bool wlan_nan_is_beamforming_supported(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
 #endif /* WLAN_FEATURE_NAN */
 #endif /* _WLAN_NAN_API_H_ */

+ 5 - 0
components/nan/core/src/nan_main.c

@@ -1399,3 +1399,8 @@ bool wlan_nan_get_sap_conc_support(struct wlan_objmgr_psoc *psoc)
 	return (psoc_nan_obj->nan_caps.nan_sap_supported &&
 		ucfg_is_nan_conc_control_supported(psoc));
 }
+
+bool wlan_nan_is_beamforming_supported(struct wlan_objmgr_psoc *psoc)
+{
+	return ucfg_nan_is_beamforming_supported(psoc);
+}

+ 4 - 1
core/wma/src/wma_dev_if.c

@@ -92,6 +92,7 @@
 #include "wmi_unified_vdev_api.h"
 #include <wlan_cm_api.h>
 #include <../../core/src/wlan_cm_vdev_api.h>
+#include "wlan_nan_api.h"
 #ifdef DCS_INTERFERENCE_DETECTION
 #include <wlan_dcs_ucfg_api.h>
 #endif
@@ -2673,7 +2674,9 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 	wma_set_vdev_mgmt_rate(wma_handle, vdev_id);
 	if (IS_FEATURE_SUPPORTED_BY_FW(DOT11AX))
 		wma_set_he_txbf_cfg(mac, vdev_id);
-	wma_set_vht_txbf_cfg(mac, vdev_id);
+
+	if (wlan_nan_is_beamforming_supported(mac->psoc))
+		wma_set_vht_txbf_cfg(mac, vdev_id);
 
 	/* Initialize roaming offload state */
 	if (vdev_mlme->mgmt.generic.type == WMI_VDEV_TYPE_STA &&