浏览代码

qcacld-3.0: Add support to send bcast capability to firmware

If both INI and FW capability is set,
enable capability flag in twt enable command.

Change-Id: I1c070256c4b672b09a1323665fc5a2f166f951fb
CRs-fixed: 2423752
Arif Hussain 6 年之前
父节点
当前提交
50689083eb

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

@@ -2028,6 +2028,13 @@ void hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 			hdd_ctx->psoc, cfg->obss_color_collision_offloaded);
 	if (QDF_IS_STATUS_ERROR(status))
 		hdd_err("Failed to set WNI_CFG_OBSS_COLOR_COLLISION_OFFLOAD");
+
+	ucfg_mlme_get_bcast_twt(hdd_ctx->psoc, &bval);
+	if (bval)
+		ucfg_mlme_set_bcast_twt(hdd_ctx->psoc, cfg->bcast_twt_support);
+	else
+		hdd_debug("bcast twt is disable in ini, fw cap %d",
+			  cfg->bcast_twt_support);
 }
 
 bool hdd_dfs_indicate_radar(struct hdd_context *hdd_ctx)

+ 1 - 1
core/hdd/src/wlan_hdd_twt.c

@@ -71,7 +71,7 @@ void hdd_send_twt_enable_cmd(struct hdd_context *hdd_ctx)
 		  req_val, resp_val, bcast_val, pdev_id, congestion_timeout);
 
 	if (req_val || resp_val || bcast_val)
-		wma_send_twt_enable_cmd(pdev_id, congestion_timeout);
+		wma_send_twt_enable_cmd(pdev_id, congestion_timeout, bcast_val);
 }
 
 /**

+ 2 - 0
core/wma/inc/wma_tgt_cfg.h

@@ -172,6 +172,7 @@ struct board_info {
  * @obss_detection_offloaded: obss detection offloaded to firmware
  * @obss_color_collision_offloaded: obss color collision offloaded to firmware
  * @sar_version: Version of SAR supported by firmware
+ * @bcast_twt_support: braodcast twt support
  */
 struct wma_tgt_cfg {
 	uint32_t target_fw_version;
@@ -211,5 +212,6 @@ struct wma_tgt_cfg {
 	struct board_info hw_bd_info;
 	enum sar_version sar_version;
 	struct nan_tgt_caps nan_caps;
+	bool bcast_twt_support;
 };
 #endif /* WMA_TGT_CFG_H */

+ 6 - 2
core/wma/inc/wma_twt.h

@@ -27,10 +27,13 @@
  * wma_send_twt_enable_cmd() - Send TWT Enable command to firmware
  * @pdev_id: pdev id
  * @congestion_timeout: Timeout value for the TWT congestion timer
+ * @bcast_val: broadcast twt support
  *
  * Return: None
  */
-void wma_send_twt_enable_cmd(uint32_t pdev_id, uint32_t congestion_timeout);
+void wma_send_twt_enable_cmd(uint32_t pdev_id,
+			     uint32_t congestion_timeout,
+			     bool bcast_val);
 
 /**
  * wma_set_twt_peer_caps() - Fill the peer TWT capabilities
@@ -60,7 +63,8 @@ QDF_STATUS wma_twt_process_del_dialog(struct wmi_twt_del_dialog_param *params);
 
 #else
 static inline void wma_send_twt_enable_cmd(uint32_t pdev_id,
-					   uint32_t congestion_timeout)
+					   uint32_t congestion_timeout,
+					   bool bcast_val)
 {
 	WMA_LOGD(FL("TWT not supported as WLAN_SUPPORT_TWT is disabled"));
 }

+ 20 - 0
core/wma/src/wma_main.c

@@ -5464,6 +5464,25 @@ static void wma_update_obss_detection_support(tp_wma_handle wh,
 		tgt_cfg->obss_detection_offloaded = false;
 }
 
+/**
+ * wma_update_bcast_twt_support() - update bcost twt support
+ * @wh: wma handle
+ * @tgt_cfg: target configuration to be updated
+ *
+ * Update braodcast twt support based on service bit.
+ *
+ * Return: None
+ */
+static void wma_update_bcast_twt_support(tp_wma_handle wh,
+					 struct wma_tgt_cfg *tgt_cfg)
+{
+	if (wmi_service_enabled(wh->wmi_handle,
+				wmi_service_bcast_twt_support))
+		tgt_cfg->bcast_twt_support = true;
+	else
+		tgt_cfg->bcast_twt_support = false;
+}
+
 /**
  * wma_update_obss_color_collision_support() - update obss color collision
  *   offload support
@@ -5676,6 +5695,7 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
 	wma_update_obss_color_collision_support(wma_handle, &tgt_cfg);
 	wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg);
 	wma_update_nan_target_caps(wma_handle, &tgt_cfg);
+	wma_update_bcast_twt_support(wma_handle, &tgt_cfg);
 
 	/* Take the max of chains supported by FW, which will limit nss */
 	for (i = 0; i < tgt_hdl->info.total_mac_phy_cnt; i++)

+ 3 - 1
core/wma/src/wma_twt.c

@@ -27,7 +27,8 @@
 #include "wma_internal.h"
 #include "wmi_unified_priv.h"
 
-void wma_send_twt_enable_cmd(uint32_t pdev_id, uint32_t congestion_timeout)
+void wma_send_twt_enable_cmd(uint32_t pdev_id,
+			     uint32_t congestion_timeout, bool bcast_val)
 {
 	t_wma_handle *wma = cds_get_context(QDF_MODULE_ID_WMA);
 	struct wmi_twt_enable_param twt_enable_params = {0};
@@ -39,6 +40,7 @@ void wma_send_twt_enable_cmd(uint32_t pdev_id, uint32_t congestion_timeout)
 	}
 	twt_enable_params.pdev_id = pdev_id;
 	twt_enable_params.sta_cong_timer_ms = congestion_timeout;
+	TWT_EN_DIS_FLAGS_SET_BTWT(twt_enable_params.flags, bcast_val);
 	ret = wmi_unified_twt_enable_cmd(wma->wmi_handle, &twt_enable_params);
 
 	if (ret)