浏览代码

qcacld-3.0: Configure Traffic shaping mode for coex scenario

Change to parse wpa_cli command to set wifi configuration for attribute
QCA_WLAN_VENDOR_ATTR_CONFIG_COEX_TRAFFIC_SHAPING_MODE and send traffic
shaping mode to FW with WMI WMI_COEX_SET_TRAFFIC_SHAPING_MODE.

Change-Id: I3965dfc6b63f55e568aed34e0091b95a21fae88f
CRs-Fixed: 3625180
Shailendra Singh 1 年之前
父节点
当前提交
f72feda4a1
共有 3 个文件被更改,包括 76 次插入0 次删除
  1. 11 0
      core/hdd/inc/wlan_hdd_main.h
  2. 40 0
      core/hdd/src/wlan_hdd_cfg80211.c
  3. 25 0
      core/hdd/src/wlan_hdd_main.c

+ 11 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -5468,6 +5468,17 @@ void hdd_set_sar_init_index(struct hdd_context *hdd_ctx);
 static inline void hdd_set_sar_init_index(struct hdd_context *hdd_ctx)
 {}
 #endif
+/**
+ * hdd_send_coex_traffic_shaping_mode() - Send coex traffic shaping mode
+ * to FW
+ * @vdev_id: vdev ID
+ * @mode: traffic shaping mode
+ *
+ * This function is used to send coex traffic shaping mode to FW
+ *
+ * Return: 0 on success and -EINVAL on failure
+ */
+int hdd_send_coex_traffic_shaping_mode(uint8_t vdev_id, uint8_t mode);
 
 #ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
 /**

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

@@ -8499,6 +8499,8 @@ const struct nla_policy wlan_hdd_wifi_config_policy[
 	[QCA_WLAN_VENDOR_ATTR_CONFIG_PEER_AMPDU_CNT] = {.type = NLA_U16},
 	[QCA_WLAN_VENDOR_ATTR_CONFIG_TTLM_NEGOTIATION_SUPPORT] = {
 		.type = NLA_U8},
+	[QCA_WLAN_VENDOR_ATTR_CONFIG_COEX_TRAFFIC_SHAPING_MODE] = {
+		.type = NLA_U8},
 };
 
 #define WLAN_MAX_LINK_ID 15
@@ -11489,6 +11491,42 @@ static int hdd_set_ul_mu_config(struct wlan_hdd_link_info *link_info,
 	return errno;
 }
 
+/**
+ * hdd_set_coex_traffic_shaping_mode() - Configure coex traffic
+ * shaping mode
+ * @link_info: Link info pointer in HDD adapter
+ * @attr: pointer to nla attr
+ *
+ * Return: 0 on success, negative on failure
+ */
+
+static int
+hdd_set_coex_traffic_shaping_mode(struct wlan_hdd_link_info *link_info,
+				  const struct nlattr *attr)
+{
+	uint8_t mode;
+	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(link_info->adapter);
+	int errno, ret;
+
+	errno = wlan_hdd_validate_context(hdd_ctx);
+	if (errno) {
+		hdd_err("Invalid HDD ctx, errno : %d", errno);
+		return errno;
+	}
+
+	mode = nla_get_u8(attr);
+	if (mode > QCA_COEX_TRAFFIC_SHAPING_MODE_ENABLE) {
+		hdd_err("Invalid traffic shaping mode : %d", mode);
+		return -EINVAL;
+	}
+
+	hdd_debug("Coex Traffic shaping mode : %d", mode);
+
+	ret = hdd_send_coex_traffic_shaping_mode(link_info->vdev_id, mode);
+
+	return ret;
+}
+
 #ifdef WLAN_FEATURE_11BE_MLO
 static int hdd_test_config_emlsr_mode(struct hdd_context *hdd_ctx,
 				      bool cfg_val)
@@ -12113,6 +12151,8 @@ static const struct independent_setters independent_setters[] = {
 	 hdd_set_master_channel_list},
 	{QCA_WLAN_VENDOR_ATTR_CONFIG_TTLM_NEGOTIATION_SUPPORT,
 	 hdd_set_t2lm_negotiation_support},
+	{QCA_WLAN_VENDOR_ATTR_CONFIG_COEX_TRAFFIC_SHAPING_MODE,
+	 hdd_set_coex_traffic_shaping_mode},
 };
 
 #ifdef WLAN_FEATURE_ELNA

+ 25 - 0
core/hdd/src/wlan_hdd_main.c

@@ -8222,6 +8222,31 @@ err:
 	return -EINVAL;
 }
 
+/**
+ * hdd_send_coex_traffic_shaping_mode() - Send coex traffic shaping mode
+ * to FW
+ * @vdev_id: vdev ID
+ * @mode: traffic shaping mode
+ *
+ * This function is used to send coex traffic shaping mode to FW
+ *
+ * Return: 0 on success and -EINVAL on failure
+ */
+int hdd_send_coex_traffic_shaping_mode(uint8_t vdev_id, uint8_t mode)
+{
+	struct coex_config_params coex_cfg_params = {0};
+
+	coex_cfg_params.config_type = WMI_COEX_SET_TRAFFIC_SHAPING_MODE;
+	coex_cfg_params.config_arg1 = mode;
+	coex_cfg_params.vdev_id     = vdev_id;
+
+	if (QDF_IS_STATUS_ERROR(sme_send_coex_config_cmd(&coex_cfg_params))) {
+		hdd_err_rl("Failed to send coex traffic shaping mode");
+		return -EINVAL;
+	}
+	return 0;
+}
+
 #define MAX_PDEV_SET_FW_PARAMS 7
 /* params being sent:
  * 1.wmi_pdev_param_dtim_synth