Эх сурвалжийг харах

qcacmn: Add WMI command for WMM based ATF config

Add new WMI command to support WMM based ATF configuration.
The new WMI command sends the Access category ID and the
corresponding airtime allocation to the firmware.

Change-Id: I7a5fafa6190d779d0fef8982b7b781af54656b19
CRs-Fixed: 2293193
Jeffin Mammen 6 жил өмнө
parent
commit
31320b31bc

+ 10 - 11
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -850,8 +850,8 @@ struct wlan_lmac_if_p2p_rx_ops {
  * @atf_get_logging:                   Get logging enabled/disabled
  * @atf_update_buf_held:               Set Num buf held by subgroup
  * @atf_get_ssidgroup:                 Get ssid group state
- * @atf_get_tx_block_count:            Get tx block count
- * @atf_get_peer_blk_txtraffic:        Get peer tx traffic block state
+ * @atf_get_vdev_ac_blk_cnt:           Get AC block count for vdev
+ * @atf_get_peer_blk_txbitmap:         Get peer tx traffic AC bitmap
  * @atf_get_vdev_blk_txtraffic:        Get vdev tx traffic block state
  * @atf_get_sched:                     Get ATF scheduled policy
  * @atf_get_tx_tokens:                 Get Tx tokens
@@ -874,8 +874,8 @@ struct wlan_lmac_if_p2p_rx_ops {
  * @atf_set_peers:                     Set peers number
  * @atf_set_peer_stats:                Set peer stats
  * @atf_set_vdev_blk_txtraffic:        Set Block/unblock vdev tx traffic
- * @atf_set_peer_blk_txtraffic:        Set Block/unblock peer tx traffic
- * @atf_set_tx_block_count:            Set tx block count
+ * @atf_peer_blk_txtraffic:            Block peer tx traffic
+ * @atf_peer_unblk_txtraffic:          Unblock peer tx traffic
  * @atf_set_token_allocated:           Set atf token allocated
  * @atf_set_token_utilized:            Set atf token utilized
  */
@@ -892,8 +892,8 @@ struct wlan_lmac_if_atf_rx_ops {
 	void*   (*atf_update_buf_held)(struct wlan_objmgr_peer *peer,
 				       int8_t ac);
 	uint32_t (*atf_get_ssidgroup)(struct wlan_objmgr_pdev *pdev);
-	uint32_t (*atf_get_tx_block_count)(struct wlan_objmgr_vdev *vdev);
-	uint8_t (*atf_get_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer);
+	uint32_t (*atf_get_vdev_ac_blk_cnt)(struct wlan_objmgr_vdev *vdev);
+	uint8_t (*atf_get_peer_blk_txbitmap)(struct wlan_objmgr_peer *peer);
 	uint8_t (*atf_get_vdev_blk_txtraffic)(struct wlan_objmgr_vdev *vdev);
 	uint32_t (*atf_get_sched)(struct wlan_objmgr_pdev *pdev);
 	uint32_t (*atf_get_tx_tokens)(struct wlan_objmgr_peer *peer);
@@ -922,7 +922,6 @@ struct wlan_lmac_if_atf_rx_ops {
 					    uint8_t ac);
 	uint16_t (*atf_get_token_allocated)(struct wlan_objmgr_peer *peer);
 	uint16_t (*atf_get_token_utilized)(struct wlan_objmgr_peer *peer);
-
 	void (*atf_set_sched)(struct wlan_objmgr_pdev *pdev, uint32_t value);
 	void (*atf_set_fmcap)(struct wlan_objmgr_psoc *psoc, uint32_t value);
 	void (*atf_set_obss_scale)(struct wlan_objmgr_pdev *pdev,
@@ -936,10 +935,10 @@ struct wlan_lmac_if_atf_rx_ops {
 				   struct atf_stats *stats);
 	void (*atf_set_vdev_blk_txtraffic)(struct wlan_objmgr_vdev *vdev,
 					   uint8_t value);
-	void (*atf_set_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer,
-					   uint8_t value);
-	void (*atf_set_tx_block_count)(struct wlan_objmgr_vdev *vdev,
-					uint32_t count);
+	void (*atf_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer,
+				       int8_t ac_id);
+	void (*atf_peer_unblk_txtraffic)(struct wlan_objmgr_peer *peer,
+					 int8_t ac_id);
 	void (*atf_set_token_allocated)(struct wlan_objmgr_peer *peer,
 					uint16_t value);
 	void (*atf_set_token_utilized)(struct wlan_objmgr_peer *peer,

+ 4 - 4
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -116,8 +116,8 @@ wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 	atf_rx_ops->atf_get_logging = tgt_atf_get_logging;
 	atf_rx_ops->atf_update_buf_held = tgt_atf_update_buf_held;
 	atf_rx_ops->atf_get_ssidgroup = tgt_atf_get_ssidgroup;
-	atf_rx_ops->atf_get_tx_block_count = tgt_atf_get_tx_block_count;
-	atf_rx_ops->atf_get_peer_blk_txtraffic = tgt_atf_get_peer_blk_txtraffic;
+	atf_rx_ops->atf_get_vdev_ac_blk_cnt = tgt_atf_get_vdev_ac_blk_cnt;
+	atf_rx_ops->atf_get_peer_blk_txbitmap = tgt_atf_get_peer_blk_txbitmap;
 	atf_rx_ops->atf_get_vdev_blk_txtraffic = tgt_atf_get_vdev_blk_txtraffic;
 	atf_rx_ops->atf_get_sched = tgt_atf_get_sched;
 	atf_rx_ops->atf_get_tx_tokens = tgt_atf_get_tx_tokens;
@@ -145,8 +145,8 @@ wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 	atf_rx_ops->atf_set_peers = tgt_atf_set_peers;
 	atf_rx_ops->atf_set_peer_stats = tgt_atf_set_peer_stats;
 	atf_rx_ops->atf_set_vdev_blk_txtraffic = tgt_atf_set_vdev_blk_txtraffic;
-	atf_rx_ops->atf_set_peer_blk_txtraffic = tgt_atf_set_peer_blk_txtraffic;
-	atf_rx_ops->atf_set_tx_block_count = tgt_atf_set_tx_block_count;
+	atf_rx_ops->atf_peer_blk_txtraffic = tgt_atf_peer_blk_txtraffic;
+	atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic;
 	atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated;
 	atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized;
 }

+ 21 - 11
wmi/inc/wmi_unified_api.h

@@ -1197,9 +1197,6 @@ QDF_STATUS wmi_unified_send_coex_ver_cfg_cmd(void *wmi_hdl,
 QDF_STATUS wmi_unified_send_coex_config_cmd(void *wmi_hdl,
 					    struct coex_config_params *param);
 
-QDF_STATUS wmi_unified_set_atf_cmd_send(void *wmi_hdl,
-				struct set_atf_params *param);
-
 QDF_STATUS wmi_unified_pdev_fips_cmd_send(void *wmi_hdl,
 				struct fips_params *param);
 
@@ -1496,13 +1493,32 @@ QDF_STATUS wmi_unified_lcr_set_cmd_send(void *wmi_hdl,
 QDF_STATUS wmi_unified_send_periodic_chan_stats_config_cmd(void *wmi_hdl,
 			struct periodic_chan_stats_params *param);
 
+#ifdef WLAN_ATF_ENABLE
+QDF_STATUS
+wmi_unified_set_atf_cmd_send(void *wmi_hdl,
+			     struct set_atf_params *param);
+
 QDF_STATUS
 wmi_send_atf_peer_request_cmd(void *wmi_hdl,
-			struct atf_peer_request_params *param);
+			      struct atf_peer_request_params *param);
 
 QDF_STATUS
 wmi_send_set_atf_grouping_cmd(void *wmi_hdl,
-			struct atf_grouping_params *param);
+			      struct atf_grouping_params *param);
+
+QDF_STATUS
+wmi_send_set_atf_group_ac_cmd(void *wmi_hdl,
+			      struct atf_group_ac_params *param);
+
+QDF_STATUS
+wmi_extract_atf_peer_stats_ev(void *wmi_hdl, void *evt_buf,
+			      wmi_host_atf_peer_stats_event *ev);
+
+QDF_STATUS
+wmi_extract_atf_token_info_ev(void *wmi_hdl, void *evt_buf, uint8_t idx,
+			      wmi_host_atf_peer_stats_info *atf_token_info);
+#endif
+
 /* Extract APIs */
 
 QDF_STATUS wmi_extract_wds_addr_event(void *wmi_hdl,
@@ -1723,12 +1739,6 @@ QDF_STATUS wmi_extract_peer_stats(void *wmi_hdl, void *evt_buf,
 QDF_STATUS wmi_extract_tx_data_traffic_ctrl_ev(void *wmi_hdl, void *evt_buf,
 		wmi_host_tx_data_traffic_ctrl_event *ev);
 
-QDF_STATUS wmi_extract_atf_peer_stats_ev(void *wmi_hdl, void *evt_buf,
-		wmi_host_atf_peer_stats_event *ev);
-
-QDF_STATUS wmi_extract_atf_token_info_ev(void *wmi_hdl, void *evt_buf,
-		uint8_t idx, wmi_host_atf_peer_stats_info *atf_token_info);
-
 QDF_STATUS wmi_extract_vdev_stats(void *wmi_hdl, void *evt_buf,
 		uint32_t index, wmi_host_vdev_stats *vdev_stats);
 

+ 32 - 1
wmi/inc/wmi_unified_param.h

@@ -4304,6 +4304,32 @@ struct atf_grouping_params {
 	atf_group_info group_info[ATF_ACTIVED_MAX_ATFGROUPS];
 };
 
+/**
+ * struct atf_group_wmm_ac_info - ATF group AC info params
+ * @atf_config_ac_be: Relative ATF% for BE traffic
+ * @atf_config_ac_bk: Relative ATF% for BK traffic
+ * @atf_config_ac_vi: Relative ATF% for VI traffic
+ * @atf_config_ac_vo: Relative ATF% for VO traffic
+ * @reserved: Reserved for future use
+ */
+struct atf_group_wmm_ac_info {
+	uint32_t  atf_config_ac_be;
+	uint32_t  atf_config_ac_bk;
+	uint32_t  atf_config_ac_vi;
+	uint32_t  atf_config_ac_vo;
+	uint32_t reserved[2];
+};
+
+/**
+ * struct atf_grp_ac_params - ATF group AC config params
+ * @num_groups: number of groups
+ * @group_inf: Group informaition
+ */
+struct atf_group_ac_params {
+	uint32_t num_groups;
+	struct atf_group_wmm_ac_info group_info[ATF_ACTIVED_MAX_ATFGROUPS];
+};
+
 /**
  * struct wlan_profile_params - WLAN profile params
  * @param_id: param id
@@ -7475,12 +7501,17 @@ typedef struct {
  *                WMI_INVALID_PEER_AST_INDEX
  * @vdev_id: only applies if peer_ast_idx == INVALID
  * @ctrl_cmd: WMI_TX_DATA_TRAFFIC_CTRL_BLOCK or
- *                WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
+ *            WMI_TX_DATA_TRAFFIC_CTRL_UNBLOCK
+ * @wmm_ac: Indicates AC to be blocked or unblocked
+ *          Bits  4-31 : Reserved (Shall be zero)
+ *          Bits  0-3  : WMM AC NO [ BE (1), BK (2), VI (3), VO (4)]
+ *          Started numbering from 1 to preserve backward compatibility
  */
 typedef struct {
 	uint32_t peer_ast_idx;
 	uint32_t vdev_id;
 	uint32_t ctrl_cmd;
+	uint32_t wmm_ac;
 } wmi_host_tx_data_traffic_ctrl_event;
 
 enum {

+ 19 - 13
wmi/inc/wmi_unified_priv.h

@@ -835,9 +835,6 @@ QDF_STATUS (*send_pdev_get_tpc_config_cmd)(wmi_unified_t wmi_handle,
 QDF_STATUS (*send_set_bwf_cmd)(wmi_unified_t wmi_handle,
 		struct set_bwf_params *param);
 
-QDF_STATUS (*send_set_atf_cmd)(wmi_unified_t wmi_handle,
-		struct set_atf_params *param);
-
 QDF_STATUS (*send_pdev_fips_cmd)(wmi_unified_t wmi_handle,
 		struct fips_params *param);
 
@@ -1098,13 +1095,30 @@ QDF_STATUS (*send_lcr_set_cmd)(wmi_unified_t wmi_handle,
 QDF_STATUS (*send_periodic_chan_stats_config_cmd)(wmi_unified_t wmi_handle,
 			struct periodic_chan_stats_params *param);
 
+#ifdef WLAN_ATF_ENABLE
+QDF_STATUS (*send_set_atf_cmd)(wmi_unified_t wmi_handle,
+			       struct set_atf_params *param);
+
 QDF_STATUS
 (*send_atf_peer_request_cmd)(wmi_unified_t wmi_handle,
-			struct atf_peer_request_params *param);
+			     struct atf_peer_request_params *param);
 
 QDF_STATUS
 (*send_set_atf_grouping_cmd)(wmi_unified_t wmi_handle,
-			struct atf_grouping_params *param);
+			     struct atf_grouping_params *param);
+
+QDF_STATUS
+(*send_set_atf_group_ac_cmd)(wmi_unified_t wmi_handle,
+			     struct atf_group_ac_params *param);
+
+QDF_STATUS (*extract_atf_peer_stats_ev)(wmi_unified_t wmi_handle,
+					void *evt_buf,
+					wmi_host_atf_peer_stats_event *ev);
+
+QDF_STATUS (*extract_atf_token_info_ev)(wmi_unified_t wmi_handle,
+					void *evt_buf, uint8_t idx,
+					wmi_host_atf_peer_stats_info *atf_info);
+#endif
 
 QDF_STATUS (*send_get_user_position_cmd)(wmi_unified_t wmi_handle,
 			uint32_t value);
@@ -1358,14 +1372,6 @@ QDF_STATUS (*extract_inst_rssi_stats_event)(wmi_unified_t wmi_handle,
 QDF_STATUS (*extract_tx_data_traffic_ctrl_ev)(wmi_unified_t wmi_handle,
 		void *evt_buf, wmi_host_tx_data_traffic_ctrl_event *ev);
 
-QDF_STATUS (*extract_atf_peer_stats_ev)(wmi_unified_t wmi_handle,
-		void *evt_buf, wmi_host_atf_peer_stats_event *ev);
-
-QDF_STATUS (*extract_atf_token_info_ev)(wmi_unified_t wmi_handle,
-		void *evt_buf,
-		uint8_t idx,
-		wmi_host_atf_peer_stats_info *atf_token_info);
-
 QDF_STATUS (*extract_vdev_extd_stats)(wmi_unified_t wmi_handle, void *evt_buf,
 		uint32_t index, wmi_host_vdev_extd_stats *vdev_extd_stats);
 

+ 90 - 67
wmi/src/wmi_unified_api.c

@@ -3259,24 +3259,6 @@ QDF_STATUS wmi_unified_set_bwf_cmd_send(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
-/**
- *  wmi_unified_set_atf_cmd_send() - WMI set atf function
- *  @param wmi_handle      : handle to WMI.
- *  @param param    : pointer to set atf param
- *
- *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
- */
-QDF_STATUS wmi_unified_set_atf_cmd_send(void *wmi_hdl,
-				struct set_atf_params *param)
-{
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
-
-	if (wmi_handle->ops->send_set_atf_cmd)
-		return wmi_handle->ops->send_set_atf_cmd(wmi_handle, param);
-
-	return QDF_STATUS_E_FAILURE;
-}
-
 /**
  *  wmi_unified_pdev_fips_cmd_send() - WMI pdev fips cmd function
  *  @param wmi_handle      : handle to WMI.
@@ -4901,6 +4883,26 @@ QDF_STATUS wmi_unified_send_periodic_chan_stats_config_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
+#ifdef WLAN_ATF_ENABLE
+/**
+ *  wmi_unified_set_atf_cmd_send() - WMI set atf function
+ *  @param wmi_handle      : handle to WMI.
+ *  @param param    : pointer to set atf param
+ *
+ *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_unified_set_atf_cmd_send(void *wmi_hdl,
+			     struct set_atf_params *param)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->send_set_atf_cmd)
+		return wmi_handle->ops->send_set_atf_cmd(wmi_handle, param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 /**
  * wmi_send_atf_peer_request_cmd() - send atf peer request command to fw
  * @wmi_handle: wmi handle
@@ -4910,13 +4912,13 @@ QDF_STATUS wmi_unified_send_periodic_chan_stats_config_cmd(void *wmi_hdl,
  */
 QDF_STATUS
 wmi_send_atf_peer_request_cmd(void *wmi_hdl,
-		struct atf_peer_request_params *param)
+			      struct atf_peer_request_params *param)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
 
 	if (wmi_handle->ops->send_atf_peer_request_cmd)
 		return wmi_handle->ops->send_atf_peer_request_cmd(wmi_handle,
-					param);
+								  param);
 
 	return QDF_STATUS_E_FAILURE;
 }
@@ -4930,17 +4932,81 @@ wmi_send_atf_peer_request_cmd(void *wmi_hdl,
  */
 QDF_STATUS
 wmi_send_set_atf_grouping_cmd(void *wmi_hdl,
-		struct atf_grouping_params *param)
+			      struct atf_grouping_params *param)
 {
-	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
 
 	if (wmi_handle->ops->send_set_atf_grouping_cmd)
 		return wmi_handle->ops->send_set_atf_grouping_cmd(wmi_handle,
-					param);
+								  param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
+/**
+ * wmi_send_set_atf_group_ac_cmd() - send set atf AC command to fw
+ * @wmi_handle: wmi handle
+ * @param: pointer to set atf AC group param
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_send_set_atf_group_ac_cmd(void *wmi_hdl,
+			      struct atf_group_ac_params *param)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->send_set_atf_group_ac_cmd)
+		return wmi_handle->ops->send_set_atf_group_ac_cmd(wmi_handle,
+								  param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
+/**
+ * wmi_extract_atf_peer_stats_ev() - extract atf peer stats
+ * from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param ev: Pointer to hold atf peer stats
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_extract_atf_peer_stats_ev(void *wmi_hdl, void *evt_buf,
+			      wmi_host_atf_peer_stats_event *ev)
+{
+	wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
+
+	if (wmi->ops->extract_atf_peer_stats_ev)
+		return wmi->ops->extract_atf_peer_stats_ev(wmi, evt_buf, ev);
 
 	return QDF_STATUS_E_FAILURE;
+}
 
+/**
+ * wmi_extract_atf_token_info_ev() - extract atf token info
+ * from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param idx: Index indicating the peer number
+ * @param ev: Pointer to hold atf token info
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_extract_atf_token_info_ev(void *wmi_hdl, void *evt_buf, uint8_t idx,
+			      wmi_host_atf_peer_stats_info *ev)
+{
+	wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
+
+	if (wmi->ops->extract_atf_token_info_ev)
+		return wmi->ops->extract_atf_token_info_ev(wmi, evt_buf,
+							   idx, ev);
+
+	return QDF_STATUS_E_FAILURE;
 }
+#endif /* WLAN_ATF_ENABLE */
 
 /**
  * wmi_send_get_user_position_cmd() - send get user position command to fw
@@ -6369,49 +6435,6 @@ QDF_STATUS wmi_extract_tx_data_traffic_ctrl_ev(void *wmi_hdl, void *evt_buf,
 	return QDF_STATUS_E_FAILURE;
 }
 
-/**
- * wmi_extract_atf_peer_stats_ev() - extract atf peer stats
- * from event
- * @wmi_handle: wmi handle
- * @param evt_buf: pointer to event buffer
- * @param ev: Pointer to hold atf peer stats
- *
- * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
- */
-QDF_STATUS wmi_extract_atf_peer_stats_ev(void *wmi_hdl, void *evt_buf,
-			wmi_host_atf_peer_stats_event *ev)
-{
-	wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
-
-	if (wmi->ops->extract_atf_peer_stats_ev)
-		return wmi->ops->extract_atf_peer_stats_ev(wmi,
-				evt_buf, ev);
-
-	return QDF_STATUS_E_FAILURE;
-}
-
-/**
- * wmi_extract_atf_token_info_ev() - extract atf token info
- * from event
- * @wmi_handle: wmi handle
- * @param evt_buf: pointer to event buffer
- * @param idx: Index indicating the peer number
- * @param ev: Pointer to hold atf token info
- *
- * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
- */
-QDF_STATUS wmi_extract_atf_token_info_ev(void *wmi_hdl, void *evt_buf,
-			uint8_t idx, wmi_host_atf_peer_stats_info *ev)
-{
-	wmi_unified_t wmi = (wmi_unified_t) wmi_hdl;
-
-	if (wmi->ops->extract_atf_token_info_ev)
-		return wmi->ops->extract_atf_token_info_ev(wmi,
-				evt_buf, idx, ev);
-
-	return QDF_STATUS_E_FAILURE;
-}
-
 /**
  * wmi_extract_vdev_extd_stats() - extract extended vdev stats from event
  * @wmi_handle: wmi handle

+ 108 - 65
wmi/src/wmi_unified_non_tlv.c

@@ -3412,6 +3412,7 @@ send_set_bwf_cmd_non_tlv(wmi_unified_t wmi_handle,
 	return retval;
 }
 
+#ifdef WLAN_ATF_ENABLE
 /**
  * send_set_atf_cmd_non_tlv() - send set atf command to fw
  * @wmi_handle: wmi handle
@@ -3421,7 +3422,7 @@ send_set_bwf_cmd_non_tlv(wmi_unified_t wmi_handle,
  */
 static QDF_STATUS
 send_set_atf_cmd_non_tlv(wmi_unified_t wmi_handle,
-				struct set_atf_params *param)
+			 struct set_atf_params *param)
 {
 	struct wmi_atf_peer_info   *peer_info;
 	wmi_peer_atf_request *cmd;
@@ -3441,13 +3442,13 @@ send_set_atf_cmd_non_tlv(wmi_unified_t wmi_handle,
 	peer_info = (struct wmi_atf_peer_info *)&(cmd->peer_info[0]);
 	for (i = 0; i < param->num_peers; i++) {
 		qdf_mem_copy(&(peer_info[i].peer_macaddr),
-			&(param->peer_info[i].peer_macaddr),
-			sizeof(wmi_mac_addr));
+			     &param->peer_info[i].peer_macaddr,
+			     sizeof(wmi_mac_addr));
 		peer_info[i].atf_units = param->peer_info[i].percentage_peer;
 	}
 /*	qdf_print("wmi_unified_pdev_set_atf peer_num=%d", cmd->num_peers); */
 	retval = wmi_unified_cmd_send(wmi_handle, buf, len,
-		WMI_PEER_ATF_REQUEST_CMDID);
+				      WMI_PEER_ATF_REQUEST_CMDID);
 	return retval;
 }
 
@@ -3460,7 +3461,7 @@ send_set_atf_cmd_non_tlv(wmi_unified_t wmi_handle,
  */
 static QDF_STATUS
 send_atf_peer_request_cmd_non_tlv(wmi_unified_t wmi_handle,
-				struct atf_peer_request_params *param)
+				  struct atf_peer_request_params *param)
 {
 	struct wmi_atf_peer_ext_info *peer_ext_info;
 	wmi_peer_atf_ext_request *cmd;
@@ -3481,15 +3482,15 @@ send_atf_peer_request_cmd_non_tlv(wmi_unified_t wmi_handle,
 	    (struct wmi_atf_peer_ext_info *)&(cmd->peer_ext_info[0]);
 	for (i = 0; i < param->num_peers; i++) {
 		qdf_mem_copy(&(peer_ext_info[i].peer_macaddr),
-			&(param->peer_ext_info[i].peer_macaddr),
-			sizeof(wmi_mac_addr));
+			     &param->peer_ext_info[i].peer_macaddr,
+			     sizeof(wmi_mac_addr));
 		peer_ext_info[i].atf_groupid =
 			param->peer_ext_info[i].group_index;
 		peer_ext_info[i].atf_units_reserved =
 			param->peer_ext_info[i].atf_index_reserved;
 	}
 	retval = wmi_unified_cmd_send(wmi_handle, buf, len,
-		WMI_PEER_ATF_EXT_REQUEST_CMDID);
+				      WMI_PEER_ATF_EXT_REQUEST_CMDID);
 
 	return retval;
 }
@@ -3503,7 +3504,7 @@ send_atf_peer_request_cmd_non_tlv(wmi_unified_t wmi_handle,
  */
 static QDF_STATUS
 send_set_atf_grouping_cmd_non_tlv(wmi_unified_t wmi_handle,
-				struct atf_grouping_params *param)
+				  struct atf_grouping_params *param)
 {
 	struct wmi_atf_group_info *group_info;
 	wmi_atf_ssid_grp_request *cmd;
@@ -3520,7 +3521,7 @@ send_set_atf_grouping_cmd_non_tlv(wmi_unified_t wmi_handle,
 
 	cmd = (wmi_atf_ssid_grp_request *)wmi_buf_data(buf);
 	qdf_mem_copy(&(cmd->num_groups), &(param->num_groups),
-		sizeof(uint32_t));
+		     sizeof(uint32_t));
 	group_info = (struct wmi_atf_group_info *)&(cmd->group_info[0]);
 	for (i = 0; i < param->num_groups; i++)	{
 		group_info[i].atf_group_units =
@@ -3529,11 +3530,102 @@ send_set_atf_grouping_cmd_non_tlv(wmi_unified_t wmi_handle,
 			param->group_info[i].atf_group_units_reserved;
 	}
 	retval = wmi_unified_cmd_send(wmi_handle, buf, len,
-		WMI_ATF_SSID_GROUPING_REQUEST_CMDID);
+				      WMI_ATF_SSID_GROUPING_REQUEST_CMDID);
 
 	return retval;
 }
 
+/**
+ * send_set_atf_group_ac_cmd_non_tlv() - send set atf AC command to fw
+ * @wmi_handle: wmi handle
+ * @param: pointer to set atf AC group param
+ *
+ * Return: 0 for success or error code
+ */
+static QDF_STATUS
+send_set_atf_group_ac_cmd_non_tlv(wmi_unified_t wmi_handle,
+				  struct atf_group_ac_params *param)
+{
+	struct wmi_atf_group_wmm_ac_info *group_info;
+	wmi_atf_grp_wmm_ac_cfg_request *cmd;
+	wmi_buf_t buf;
+	int len = sizeof(wmi_atf_grp_wmm_ac_cfg_request);
+	int i;
+
+	len += param->num_groups * sizeof(struct wmi_atf_group_wmm_ac_info);
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf) {
+		qdf_print("%s:wmi_buf_alloc failed\n", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	cmd = (wmi_atf_grp_wmm_ac_cfg_request *)wmi_buf_data(buf);
+	qdf_mem_copy(&cmd->num_groups, &param->num_groups, sizeof(uint32_t));
+	group_info = (struct wmi_atf_group_wmm_ac_info *)&cmd->group_info[0];
+	for (i = 0; i < param->num_groups; i++)	{
+		qdf_mem_copy(&group_info[i], &param->group_info[i],
+			     sizeof(struct wmi_atf_group_wmm_ac_info));
+	}
+
+	return wmi_unified_cmd_send(wmi_handle, buf, len,
+				    WMI_ATF_GROUP_WMM_AC_CONFIG_REQUEST_CMDID);
+}
+
+/**
+ * extract_atf_peer_stats_ev_non_tlv() - extract atf peer stats
+ * from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param ev: Pointer to hold atf stats event data
+ *
+ * Return: 0 for success or error code
+ */
+static QDF_STATUS
+extract_atf_peer_stats_ev_non_tlv(wmi_unified_t wmi_handle,
+				  void *evt_buf,
+				  wmi_host_atf_peer_stats_event *ev)
+{
+	wmi_atf_peer_stats_event *evt =
+		(wmi_atf_peer_stats_event *)evt_buf;
+
+	ev->pdev_id = WMI_NON_TLV_DEFAULT_PDEV_ID;
+	ev->num_atf_peers = evt->num_atf_peers;
+	ev->comp_usable_airtime = evt->comp_usable_airtime;
+	qdf_mem_copy(&ev->reserved[0], &evt->reserved[0],
+		     sizeof(evt->reserved));
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * extract_atf_token_info_ev_non_tlv() - extract atf token info
+ * from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @idx: Index indicating the peer number
+ * @param atf_token_info: Pointer to hold atf token info
+ *
+ * Return: 0 for success or error code
+ */
+static QDF_STATUS
+extract_atf_token_info_ev_non_tlv(wmi_unified_t wmi_handle, void *evt_buf,
+				  uint8_t idx,
+				  wmi_host_atf_peer_stats_info *atf_token_info)
+{
+	wmi_atf_peer_stats_event *evt =
+		(wmi_atf_peer_stats_event *)evt_buf;
+
+	if (idx > evt->num_atf_peers)
+		return QDF_STATUS_E_INVAL;
+
+	atf_token_info->field1 = evt->token_info_list[idx].field1;
+	atf_token_info->field2 = evt->token_info_list[idx].field2;
+	atf_token_info->field3 = evt->token_info_list[idx].field3;
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 /**
  * send_wlan_profile_enable_cmd_non_tlv() - send wlan profile enable command
  * to fw
@@ -8314,58 +8406,6 @@ static QDF_STATUS extract_tx_data_traffic_ctrl_ev_non_tlv(
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * extract_atf_peer_stats_ev_non_tlv() - extract atf peer stats
- * from event
- * @wmi_handle: wmi handle
- * @param evt_buf: pointer to event buffer
- * @param ev: Pointer to hold atf stats event data
- *
- * Return: 0 for success or error code
- */
-static QDF_STATUS extract_atf_peer_stats_ev_non_tlv(
-	wmi_unified_t wmi_handle, void *evt_buf,
-	wmi_host_atf_peer_stats_event *ev)
-{
-	wmi_atf_peer_stats_event *evt =
-		(wmi_atf_peer_stats_event *)evt_buf;
-
-	ev->pdev_id = WMI_NON_TLV_DEFAULT_PDEV_ID;
-	ev->num_atf_peers = evt->num_atf_peers;
-	ev->comp_usable_airtime = evt->comp_usable_airtime;
-	qdf_mem_copy(&ev->reserved[0], &evt->reserved[0],
-				sizeof(evt->reserved));
-
-	return QDF_STATUS_SUCCESS;
-}
-
-/**
- * extract_atf_token_info_ev_non_tlv() - extract atf token info
- * from event
- * @wmi_handle: wmi handle
- * @param evt_buf: pointer to event buffer
- * @idx: Index indicating the peer number
- * @param atf_token_info: Pointer to hold atf token info
- *
- * Return: 0 for success or error code
- */
-static QDF_STATUS extract_atf_token_info_ev_non_tlv(
-	wmi_unified_t wmi_handle, void *evt_buf,
-	uint8_t idx, wmi_host_atf_peer_stats_info *atf_token_info)
-{
-	wmi_atf_peer_stats_event *evt =
-		(wmi_atf_peer_stats_event *)evt_buf;
-
-	if (idx > evt->num_atf_peers)
-		return QDF_STATUS_E_INVAL;
-
-	atf_token_info->field1 = evt->token_info_list[idx].field1;
-	atf_token_info->field2 = evt->token_info_list[idx].field2;
-	atf_token_info->field3 = evt->token_info_list[idx].field3;
-
-	return QDF_STATUS_SUCCESS;
-}
-
 /**
  * extract_pdev_utf_event_non_tlv() - extract UTF data info from event
  * @wmi_handle: WMI handle
@@ -8678,9 +8718,14 @@ struct wmi_ops non_tlv_ops =  {
 	.send_scan_stop_cmd = send_scan_stop_cmd_non_tlv,
 	.send_scan_chan_list_cmd = send_scan_chan_list_cmd_non_tlv,
 	.send_pdev_get_tpc_config_cmd = send_pdev_get_tpc_config_cmd_non_tlv,
+#ifdef WLAN_ATF_ENABLE
 	.send_set_atf_cmd = send_set_atf_cmd_non_tlv,
 	.send_atf_peer_request_cmd = send_atf_peer_request_cmd_non_tlv,
 	.send_set_atf_grouping_cmd = send_set_atf_grouping_cmd_non_tlv,
+	.send_set_atf_group_ac_cmd = send_set_atf_group_ac_cmd_non_tlv,
+	.extract_atf_peer_stats_ev = extract_atf_peer_stats_ev_non_tlv,
+	.extract_atf_token_info_ev = extract_atf_token_info_ev_non_tlv,
+#endif
 	.send_set_bwf_cmd = send_set_bwf_cmd_non_tlv,
 	.send_pdev_fips_cmd = send_pdev_fips_cmd_non_tlv,
 	.send_wlan_profile_enable_cmd = send_wlan_profile_enable_cmd_non_tlv,
@@ -8868,8 +8913,6 @@ struct wmi_ops non_tlv_ops =  {
 	.extract_pdev_caldata_version_check_ev_param =
 			extract_pdev_caldata_version_check_ev_param_non_tlv,
 	.extract_mu_db_entry = extract_mu_db_entry_non_tlv,
-	.extract_atf_peer_stats_ev = extract_atf_peer_stats_ev_non_tlv,
-	.extract_atf_token_info_ev = extract_atf_token_info_ev_non_tlv,
 	.extract_pdev_utf_event = extract_pdev_utf_event_non_tlv,
 	.wmi_set_htc_tx_tag = wmi_set_htc_tx_tag_non_tlv,
 	.is_management_record = is_management_record_non_tlv,

+ 4 - 0
wmi/src/wmi_unified_tlv.c

@@ -11413,6 +11413,7 @@ static QDF_STATUS send_smart_ant_set_node_config_cmd_tlv(
 	return ret;
 }
 
+#ifdef WLAN_ATF_ENABLE
 /**
  * send_set_atf_cmd_tlv() - send set atf command to fw
  * @wmi_handle: wmi handle
@@ -11491,6 +11492,7 @@ send_set_atf_cmd_tlv(wmi_unified_t wmi_handle,
 
 	return retval;
 }
+#endif
 
 /**
  * send_vdev_set_fwtest_param_cmd_tlv() - send fwtest param in fw
@@ -22122,7 +22124,9 @@ struct wmi_ops tlv_ops =  {
 		send_smart_ant_set_training_info_cmd_tlv,
 	.send_smart_ant_set_node_config_cmd =
 		send_smart_ant_set_node_config_cmd_tlv,
+#ifdef WLAN_ATF_ENABLE
 	.send_set_atf_cmd = send_set_atf_cmd_tlv,
+#endif
 	.send_vdev_set_fwtest_param_cmd = send_vdev_set_fwtest_param_cmd_tlv,
 	.send_set_qboost_param_cmd = send_set_qboost_param_cmd_tlv,
 	.send_gpio_config_cmd = send_gpio_config_cmd_tlv,