Selaa lähdekoodia

qcacld-3.0: Config support for BTWT and Rx control frame to MBSS

Add configuration support for broadcast TWT support and Rx control
frames to MultiBSS HE capabilities.

Change-Id: I2b3075a21c919c120e7a1ff674ac33fdd5d73801
CRs-Fixed: 2979513
Kiran Kumar Lokere 3 vuotta sitten
vanhempi
sitoutus
a70df38665

+ 2 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1447,6 +1447,7 @@ struct wlan_mlme_acs {
  * @is_all_twt_tgt_cap_enabled: support for all twt enable/disable
  * @is_twt_statistics_tgt_cap_enabled: support for twt statistics
  * @twt_congestion_timeout: congestion timeout value
+ * @disable_btwt_usr_cfg: User config param to enable/disable the BTWT support
  * @enable_twt_24ghz: Enable/disable host TWT when STA is connected in
  * 2.4Ghz
  * @req_flag: requestor flag enable/disable
@@ -1464,6 +1465,7 @@ struct wlan_mlme_cfg_twt {
 	bool is_all_twt_tgt_cap_enabled;
 	bool is_twt_statistics_tgt_cap_enabled;
 	uint32_t twt_congestion_timeout;
+	bool disable_btwt_usr_cfg;
 	bool enable_twt_24ghz;
 	bool req_flag;
 	bool res_flag;

+ 24 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -6954,6 +6954,10 @@ wlan_hdd_wifi_test_config_policy[
 			.type = NLA_U8},
 		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_ENABLE_TX_BEAMFORMEE] = {
 			.type = NLA_U8},
+		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_RX_CTRL_FRAME_TO_MBSS] = {
+			.type = NLA_U8},
+		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_BCAST_TWT_SUPPORT] = {
+			.type = NLA_U8},
 		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_TX_BEAMFORMEE_NSTS] = {
 			.type = NLA_U8},
 		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_MAC_PADDING_DUR] = {
@@ -10130,6 +10134,26 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
 
 	}
 
+	cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_RX_CTRL_FRAME_TO_MBSS;
+	if (tb[cmd_id]) {
+		cfg_val = nla_get_u8(tb[cmd_id]);
+		ret_val = sme_update_he_capabilities(mac_handle,
+						     adapter->vdev_id,
+						     cfg_val, cmd_id);
+		if (ret_val)
+			sme_err("Failed to update HE cap");
+	}
+
+	cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_BCAST_TWT_SUPPORT;
+	if (tb[cmd_id]) {
+		cfg_val = nla_get_u8(tb[cmd_id]);
+		ret_val = sme_update_he_capabilities(mac_handle,
+						     adapter->vdev_id,
+						     cfg_val, cmd_id);
+		if (ret_val)
+			sme_err("Failed to update HE cap");
+	}
+
 	if (tb[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_TX_BEAMFORMEE_NSTS]) {
 		cfg_val = nla_get_u8(tb[
 			QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_HE_TX_BEAMFORMEE_NSTS]);

+ 2 - 1
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -6476,7 +6476,8 @@ populate_dot11f_twt_he_cap(struct mac_context *mac,
 			   tDot11fIEhe_cap *he_cap)
 {
 	bool bcast_requestor =
-		mac->mlme_cfg->twt_cfg.is_bcast_requestor_enabled;
+		mac->mlme_cfg->twt_cfg.is_bcast_requestor_enabled &&
+		!mac->mlme_cfg->twt_cfg.disable_btwt_usr_cfg;
 	bool bcast_responder =
 		mac->mlme_cfg->twt_cfg.is_bcast_responder_enabled;
 

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

@@ -3293,6 +3293,18 @@ int sme_update_he_frag_supp(mac_handle_t mac_handle, uint8_t session_id,
 int sme_update_he_ldpc_supp(mac_handle_t mac_handle, uint8_t session_id,
 			    uint16_t he_ldpc);
 
+/**
+ * sme_update_he_capabilities() - Update the session HE capability
+ * @mac_handle: Opaque handle to the global MAC context
+ * @session_id: SME session id
+ * @cfg_val: set value
+ * @cfg_id: HE cap cfg id
+ *
+ * Return: 0 on success else err code
+ */
+int sme_update_he_capabilities(mac_handle_t mac_handle, uint8_t session_id,
+			       uint8_t cfg_val, uint8_t cfg_id);
+
 /**
  * sme_update_he_twt_req_support() - Sets twt request capability
  * @mac_handle: Opaque handle to the global MAC context
@@ -3445,6 +3457,14 @@ static inline int sme_update_he_twt_req_support(mac_handle_t mac_handle,
 	return 0;
 }
 
+static inline int sme_update_he_capabilities(mac_handle_t mac_handle,
+					      uint8_t session_id,
+					      uint8_t cfg_val,
+					      uint8_t cfg_id)
+{
+	return 0;
+}
+
 static inline int sme_update_he_full_ul_mumimo(mac_handle_t mac_handle,
 					       uint8_t session_id,
 					       uint8_t cfg_val)

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

@@ -10956,6 +10956,49 @@ void sme_set_he_mu_edca_def_cfg(mac_handle_t mac_handle)
 	}
 }
 
+int sme_update_he_capabilities(mac_handle_t mac_handle, uint8_t session_id,
+			       uint8_t cfg_val, uint8_t cfg_id)
+{
+	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
+	struct csr_roam_session *session;
+	tDot11fIEhe_cap *cfg_he_cap;
+	tDot11fIEhe_cap *he_cap_orig;
+
+	session = CSR_GET_SESSION(mac_ctx, session_id);
+
+	if (!session) {
+		sme_err("No session for id %d", session_id);
+		return -EINVAL;
+	}
+	cfg_he_cap = &mac_ctx->mlme_cfg->he_caps.dot11_he_cap;
+	he_cap_orig = &mac_ctx->mlme_cfg->he_caps.he_cap_orig;
+
+	switch (cfg_id) {
+	case QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_BCAST_TWT_SUPPORT:
+		if (cfg_val) {
+			mac_ctx->mlme_cfg->twt_cfg.disable_btwt_usr_cfg = false;
+			cfg_he_cap->broadcast_twt = he_cap_orig->broadcast_twt;
+		} else {
+			cfg_he_cap->broadcast_twt = 0;
+			mac_ctx->mlme_cfg->twt_cfg.disable_btwt_usr_cfg = true;
+		}
+		break;
+	case QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_RX_CTRL_FRAME_TO_MBSS:
+		if (cfg_val)
+			cfg_he_cap->rx_ctrl_frame = he_cap_orig->rx_ctrl_frame;
+		else
+			cfg_he_cap->rx_ctrl_frame = 0;
+		break;
+	default:
+		sme_debug("default: Unhandled cfg %d", cfg_id);
+		return -EINVAL;
+	}
+
+	sme_debug("HE cap: cfg id %d, cfg val %d", cfg_id, cfg_val);
+	csr_update_session_he_cap(mac_ctx, session);
+	return 0;
+}
+
 int sme_update_he_tx_bfee_supp(mac_handle_t mac_handle, uint8_t session_id,
 			       uint8_t cfg_val)
 {
@@ -14755,6 +14798,9 @@ void sme_set_he_testbed_def(mac_handle_t mac_handle, uint8_t vdev_id)
 	sme_debug("set HE testbed defaults");
 	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.amsdu_in_ampdu = 0;
 	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.twt_request = 0;
+	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.broadcast_twt = 0;
+	mac_ctx->mlme_cfg->twt_cfg.disable_btwt_usr_cfg = true;
+	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.rx_ctrl_frame = 0;
 	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.omi_a_ctrl = 0;
 	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.he_ppdu_20_in_160_80p80Mhz = 0;
 	mac_ctx->mlme_cfg->he_caps.dot11_he_cap.he_ppdu_20_in_40Mhz_2G = 0;
@@ -14844,6 +14890,8 @@ void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
 
 	if (QDF_STATUS_SUCCESS != status)
 		sme_err("prevent PM reset cmd send failed");
+
+	mac_ctx->mlme_cfg->twt_cfg.disable_btwt_usr_cfg = false;
 	status = ucfg_mlme_set_enable_bcast_probe_rsp(mac_ctx->psoc, true);
 	if (QDF_IS_STATUS_ERROR(status))
 		sme_err("Failed not set enable bcast probe resp info, %d",