Browse Source

qcacld-3.0: Add support for EHT 320 MHz BW caps

Add a new API to append EHT 320 MHz bandwidth capability
from mlme to legacy dot11f structure.

Change-Id: I9ffe7d51da3b22fec47b7be36ab2ac54a8e91bfb
CRs-Fixed: 3330749
Gururaj Pandurangi 2 years ago
parent
commit
876085af7a
3 changed files with 43 additions and 0 deletions
  1. 1 0
      core/hdd/src/wlan_hdd_cfg.c
  2. 14 0
      core/sme/inc/sme_api.h
  3. 28 0
      core/sme/src/common/sme_api.c

+ 1 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -2126,6 +2126,7 @@ int hdd_update_channel_width(struct hdd_adapter *adapter,
 	sme_config->csr_config.channelBondingMode24GHz = bonding_mode;
 	sme_update_config(hdd_ctx->mac_handle, sme_config);
 	sme_set_he_bw_cap(hdd_ctx->mac_handle, adapter->vdev_id, chwidth);
+	sme_set_eht_bw_cap(hdd_ctx->mac_handle, adapter->vdev_id, chwidth);
 	sme_set_vdev_ies_per_band(hdd_ctx->mac_handle, adapter->vdev_id,
 				  adapter->device_mode);
 

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

@@ -3110,6 +3110,16 @@ void sme_update_tgt_eht_cap(mac_handle_t mac_handle,
 void sme_update_eht_cap_nss(mac_handle_t mac_handle, uint8_t session_id,
 			    uint8_t nss);
 
+/**
+ * sme_set_eht_bw_cap() - sets the EHT 320 MHz bandwidth capability
+ * @mac_handle: Opaque handle to the global MAC context
+ * @vdev_id: vdev id
+ * @chwidth: channel width
+ *
+ * Return: None
+ */
+void sme_set_eht_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
+			enum eSirMacHTChannelWidth chwidth);
 #else
 static inline void sme_update_tgt_eht_cap(mac_handle_t mac_handle,
 					  struct wma_tgt_cfg *cfg,
@@ -3120,6 +3130,10 @@ static inline void sme_update_eht_cap_nss(mac_handle_t mac_handle,
 					  uint8_t session_id,
 					  uint8_t nss)
 {}
+
+static inline void sme_set_eht_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
+				      enum eSirMacHTChannelWidth chwidth)
+{}
 #endif
 
 #ifdef WLAN_FEATURE_11AX

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

@@ -10705,6 +10705,33 @@ void sme_update_eht_cap_nss(mac_handle_t mac_handle, uint8_t session_id,
 			    uint8_t nss)
 {
 }
+
+void sme_set_eht_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
+			enum eSirMacHTChannelWidth chwidth)
+{
+	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
+	struct csr_roam_session *session;
+
+	session = CSR_GET_SESSION(mac_ctx, vdev_id);
+	if (!session) {
+		sme_debug("No session for id %d", vdev_id);
+		return;
+	}
+	sme_debug("Config EHT caps for BW %d", chwidth);
+	mac_ctx->mlme_cfg->eht_caps.dot11_eht_cap.support_320mhz_6ghz = 0;
+
+	if (chwidth < eHT_CHANNEL_WIDTH_320MHZ) {
+		sme_debug("EHT caps config not required for bw: %d", chwidth);
+		return;
+	}
+
+	mac_ctx->mlme_cfg->eht_caps.dot11_eht_cap.support_320mhz_6ghz = 1;
+	qdf_mem_copy(&mac_ctx->eht_cap_5g,
+		     &mac_ctx->mlme_cfg->eht_caps.dot11_eht_cap,
+		     sizeof(tDot11fIEeht_cap));
+
+	csr_update_session_eht_cap(mac_ctx, session);
+}
 #endif
 
 #ifdef WLAN_FEATURE_11AX
@@ -14815,6 +14842,7 @@ void sme_set_he_bw_cap(mac_handle_t mac_handle, uint8_t vdev_id,
 			     sizeof(tDot11fIEhe_cap));
 		break;
 	case eHT_CHANNEL_WIDTH_160MHZ:
+	case eHT_CHANNEL_WIDTH_320MHZ:
 		mac_ctx->mlme_cfg->he_caps.dot11_he_cap.chan_width_1 = 1;
 		mac_ctx->mlme_cfg->he_caps.dot11_he_cap.chan_width_2 = 1;
 		*((uint16_t *)