瀏覽代碼

qcacld-3.0: Add new SME API to update EHT capabilities

Add a new SME API to update session EHT capabilities.
This includes Tx BFee support as well as Tx BF settings for
different bandwidths such as < 80 MHz, 160 MHz, and 320 MHz.
For future scope, more EHT caps can be updated within this
same API based on the inputs.

Change-Id: I16b0e8ec9a4c97f6475f871bda3a4627168d43d7
CRs-Fixed: 3277133
Gururaj Pandurangi 2 年之前
父節點
當前提交
38c42e203e
共有 2 個文件被更改,包括 88 次插入0 次删除
  1. 42 0
      core/sme/inc/sme_api.h
  2. 46 0
      core/sme/src/common/sme_api.c

+ 42 - 0
core/sme/inc/sme_api.h

@@ -3682,7 +3682,27 @@ static inline void sme_set_ru_242_tone_tx_cfg(mac_handle_t mac_handle,
  */
 void sme_set_nss_capability(mac_handle_t mac_handle, uint8_t vdev_id,
 			    uint8_t nss, enum QDF_OPMODE op_mode);
+
+/**
+ * enum sme_eht_tx_bfee_cap_type - EHT TX Beamformee capability type
+ * @EHT_TX_BFEE_ENABLE: TX beamformee enable
+ * @EHT_TX_BFEE_SS_80MHZ: TX beamformee for 80 MHz
+ * @EHT_TX_BFEE_SS_160MHZ: TX beamformee for 160 MHz
+ * @EHT_TX_BFEE_SS_320MHZ: TX beamformee for 320 MHz
+ * @EHT_TX_BFEE_SOUNDING_FEEDBACK_RATELIMIT: TX beamformee sounding feedback
+ * ratelimit
+ */
+enum sme_eht_tx_bfee_cap_type {
+	EHT_TX_BFEE_ENABLE = 1,
+	EHT_TX_BFEE_SS_80MHZ = 2,
+	EHT_TX_BFEE_SS_160MHZ = 3,
+	EHT_TX_BFEE_SS_320MHZ = 4,
+	EHT_TX_BFEE_SOUNDING_FEEDBACK_RATELIMIT = 5,
+};
+
 #ifdef WLAN_FEATURE_11BE
+#define MAX_SIMULTANEOUS_STA_ML_LINKS 1
+#define MAX_NUM_STA_ML_lINKS 3
 
 /**
  * sme_set_eht_testbed_def() - set eht testbed default
@@ -3749,6 +3769,20 @@ void sme_set_mlo_assoc_link_band(mac_handle_t mac_handle, uint8_t vdev_id,
 void sme_activate_mlo_links(mac_handle_t mac_handle, uint8_t session_id,
 			    uint8_t num_links,
 			    struct qdf_mac_addr active_link_addr[2]);
+
+/**
+ * sme_update_eht_caps() - Update the session EHT caps
+ * @mac_handle: Opaque handle to the global MAC context
+ * @session_id: SME session id
+ * @cfg_val: Set value
+ * @cap_type: EHT TX beamformee capability type
+ * @op_mode: Operation mode of the vdev
+ *
+ * Return: 0 on success otherwise error code
+ */
+int sme_update_eht_caps(mac_handle_t mac_handle, uint8_t session_id,
+			uint8_t cfg_val, enum sme_eht_tx_bfee_cap_type cap_type,
+			enum QDF_OPMODE op_mode);
 #else
 static inline void sme_set_eht_testbed_def(mac_handle_t mac_handle,
 					   uint8_t vdev_id)
@@ -3777,6 +3811,14 @@ void sme_set_mlo_max_simultaneous_links(mac_handle_t mac_handle,
 					uint8_t vdev_id, uint8_t val)
 {
 }
+
+static inline
+int sme_update_eht_caps(mac_handle_t mac_handle, uint8_t session_id,
+			uint8_t cfg_val, enum sme_eht_tx_bfee_cap_type cap_type,
+			enum QDF_OPMODE op_mode)
+{
+	return 0;
+}
 #endif
 
 /**

+ 46 - 0
core/sme/src/common/sme_api.c

@@ -15162,6 +15162,52 @@ void sme_activate_mlo_links(mac_handle_t mac_handle, uint8_t session_id,
 	policy_mgr_activate_mlo_links(mac_ctx->psoc, session_id, num_links,
 				      active_link_addr);
 }
+
+int sme_update_eht_caps(mac_handle_t mac_handle, uint8_t session_id,
+			uint8_t cfg_val, enum sme_eht_tx_bfee_cap_type cap_type,
+			enum QDF_OPMODE op_mode)
+{
+	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
+	struct csr_roam_session *session;
+	tDot11fIEeht_cap *cfg_eht_cap;
+
+	session = CSR_GET_SESSION(mac_ctx, session_id);
+
+	if (!session) {
+		sme_err("No session for id %d", session_id);
+		return -EINVAL;
+	}
+	cfg_eht_cap = &mac_ctx->mlme_cfg->eht_caps.dot11_eht_cap;
+
+	switch (cap_type) {
+	case EHT_TX_BFEE_ENABLE:
+		cfg_eht_cap->su_beamformee = cfg_val;
+		break;
+	case EHT_TX_BFEE_SS_80MHZ:
+		cfg_eht_cap->bfee_ss_le_80mhz = cfg_val;
+		break;
+	case EHT_TX_BFEE_SS_160MHZ:
+		cfg_eht_cap->bfee_ss_160mhz = cfg_val;
+		break;
+	case EHT_TX_BFEE_SS_320MHZ:
+		cfg_eht_cap->bfee_ss_320mhz = cfg_val;
+		break;
+	default:
+		sme_debug("default: Unhandled cap type %d", cap_type);
+		return -EINVAL;
+	}
+
+	sme_debug("EHT cap: cap type %d, cfg val %d", cap_type, cfg_val);
+	csr_update_session_eht_cap(mac_ctx, session);
+
+	qdf_mem_copy(&mac_ctx->eht_cap_2g, cfg_eht_cap,
+		     sizeof(tDot11fIEeht_cap));
+	qdf_mem_copy(&mac_ctx->eht_cap_5g, cfg_eht_cap,
+		     sizeof(tDot11fIEeht_cap));
+	sme_set_vdev_ies_per_band(mac_handle, session_id, op_mode);
+
+	return 0;
+}
 #endif
 
 void sme_set_nss_capability(mac_handle_t mac_handle, uint8_t vdev_id,