18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
28e99ea8dSJohannes Berg /*
3*f7d6ef33SJohannes Berg  * Copyright (C) 2012-2014, 2018-2020 Intel Corporation
48e99ea8dSJohannes Berg  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
58e99ea8dSJohannes Berg  * Copyright (C) 2016-2017 Intel Deutschland GmbH
68e99ea8dSJohannes Berg  */
7d172a5efSJohannes Berg #ifndef __iwl_fw_api_datapath_h__
8d172a5efSJohannes Berg #define __iwl_fw_api_datapath_h__
9d172a5efSJohannes Berg 
10d172a5efSJohannes Berg /**
11d172a5efSJohannes Berg  * enum iwl_data_path_subcmd_ids - data path group commands
12d172a5efSJohannes Berg  */
13d172a5efSJohannes Berg enum iwl_data_path_subcmd_ids {
14d172a5efSJohannes Berg 	/**
15d172a5efSJohannes Berg 	 * @DQA_ENABLE_CMD: &struct iwl_dqa_enable_cmd
16d172a5efSJohannes Berg 	 */
17d172a5efSJohannes Berg 	DQA_ENABLE_CMD = 0x0,
18d172a5efSJohannes Berg 
19d172a5efSJohannes Berg 	/**
20d172a5efSJohannes Berg 	 * @UPDATE_MU_GROUPS_CMD: &struct iwl_mu_group_mgmt_cmd
21d172a5efSJohannes Berg 	 */
22d172a5efSJohannes Berg 	UPDATE_MU_GROUPS_CMD = 0x1,
23d172a5efSJohannes Berg 
24d172a5efSJohannes Berg 	/**
25d172a5efSJohannes Berg 	 * @TRIGGER_RX_QUEUES_NOTIF_CMD: &struct iwl_rxq_sync_cmd
26d172a5efSJohannes Berg 	 */
27d172a5efSJohannes Berg 	TRIGGER_RX_QUEUES_NOTIF_CMD = 0x2,
28d172a5efSJohannes Berg 
29d172a5efSJohannes Berg 	/**
308a6171a7SLuca Coelho 	 * @STA_HE_CTXT_CMD: &struct iwl_he_sta_context_cmd
318a6171a7SLuca Coelho 	 */
328a6171a7SLuca Coelho 	STA_HE_CTXT_CMD = 0x7,
338a6171a7SLuca Coelho 
348a6171a7SLuca Coelho 	/**
358edbfaa1SSara Sharon 	 * @RFH_QUEUE_CONFIG_CMD: &struct iwl_rfh_queue_config
368edbfaa1SSara Sharon 	 */
378edbfaa1SSara Sharon 	RFH_QUEUE_CONFIG_CMD = 0xD,
388edbfaa1SSara Sharon 
398edbfaa1SSara Sharon 	/**
40110b32f0SGregory Greenman 	 * @TLC_MNG_CONFIG_CMD: &struct iwl_tlc_config_cmd
41110b32f0SGregory Greenman 	 */
42110b32f0SGregory Greenman 	TLC_MNG_CONFIG_CMD = 0xF,
43110b32f0SGregory Greenman 
44110b32f0SGregory Greenman 	/**
4598920961SShaul Triebitz 	 * @HE_AIR_SNIFFER_CONFIG_CMD: &struct iwl_he_monitor_cmd
4698920961SShaul Triebitz 	 */
4798920961SShaul Triebitz 	HE_AIR_SNIFFER_CONFIG_CMD = 0x13,
4898920961SShaul Triebitz 
4998920961SShaul Triebitz 	/**
505213e8a8SJohannes Berg 	 * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI
515213e8a8SJohannes Berg 	 *	matrix collection, uses &struct iwl_channel_estimation_cfg
525213e8a8SJohannes Berg 	 */
535213e8a8SJohannes Berg 	CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14,
545213e8a8SJohannes Berg 
555213e8a8SJohannes Berg 	/**
56*f7d6ef33SJohannes Berg 	 * @MONITOR_NOTIF: Datapath monitoring notification, using
57*f7d6ef33SJohannes Berg 	 *	&struct iwl_datapath_monitor_notif
58*f7d6ef33SJohannes Berg 	 */
59*f7d6ef33SJohannes Berg 	MONITOR_NOTIF = 0xF4,
60*f7d6ef33SJohannes Berg 
61*f7d6ef33SJohannes Berg 	/**
62bf9dfedaSShaul Triebitz 	 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data
63bf9dfedaSShaul Triebitz 	 */
64bf9dfedaSShaul Triebitz 	RX_NO_DATA_NOTIF = 0xF5,
65bf9dfedaSShaul Triebitz 
66bf9dfedaSShaul Triebitz 	/**
6746d372afSGregory Greenman 	 * @TLC_MNG_UPDATE_NOTIF: &struct iwl_tlc_update_notif
6846d372afSGregory Greenman 	 */
6946d372afSGregory Greenman 	TLC_MNG_UPDATE_NOTIF = 0xF7,
7046d372afSGregory Greenman 
7146d372afSGregory Greenman 	/**
72d172a5efSJohannes Berg 	 * @STA_PM_NOTIF: &struct iwl_mvm_pm_state_notification
73d172a5efSJohannes Berg 	 */
74d172a5efSJohannes Berg 	STA_PM_NOTIF = 0xFD,
75d172a5efSJohannes Berg 
76d172a5efSJohannes Berg 	/**
77d172a5efSJohannes Berg 	 * @MU_GROUP_MGMT_NOTIF: &struct iwl_mu_group_mgmt_notif
78d172a5efSJohannes Berg 	 */
79d172a5efSJohannes Berg 	MU_GROUP_MGMT_NOTIF = 0xFE,
80d172a5efSJohannes Berg 
81d172a5efSJohannes Berg 	/**
82d172a5efSJohannes Berg 	 * @RX_QUEUES_NOTIFICATION: &struct iwl_rxq_sync_notification
83d172a5efSJohannes Berg 	 */
84d172a5efSJohannes Berg 	RX_QUEUES_NOTIFICATION = 0xFF,
85d172a5efSJohannes Berg };
86d172a5efSJohannes Berg 
87d172a5efSJohannes Berg /**
88d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_cmd - VHT MU-MIMO group configuration
89d172a5efSJohannes Berg  *
90d172a5efSJohannes Berg  * @reserved: reserved
91d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
92d172a5efSJohannes Berg  * @user_position:the position of station in a group. If the station is in the
93d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
94d172a5efSJohannes Berg  */
95d172a5efSJohannes Berg struct iwl_mu_group_mgmt_cmd {
96d172a5efSJohannes Berg 	__le32 reserved;
97d172a5efSJohannes Berg 	__le32 membership_status[2];
98d172a5efSJohannes Berg 	__le32 user_position[4];
99d172a5efSJohannes Berg } __packed; /* MU_GROUP_ID_MNG_TABLE_API_S_VER_1 */
100d172a5efSJohannes Berg 
101d172a5efSJohannes Berg /**
102d172a5efSJohannes Berg  * struct iwl_mu_group_mgmt_notif - VHT MU-MIMO group id notification
103d172a5efSJohannes Berg  *
104d172a5efSJohannes Berg  * @membership_status: a bitmap of MU groups
105d172a5efSJohannes Berg  * @user_position: the position of station in a group. If the station is in the
106d172a5efSJohannes Berg  *	group then bits (group * 2) is the position -1
107d172a5efSJohannes Berg  */
108d172a5efSJohannes Berg struct iwl_mu_group_mgmt_notif {
109d172a5efSJohannes Berg 	__le32 membership_status[2];
110d172a5efSJohannes Berg 	__le32 user_position[4];
111d172a5efSJohannes Berg } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */
112d172a5efSJohannes Berg 
1135213e8a8SJohannes Berg enum iwl_channel_estimation_flags {
1145213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_ENABLE	= BIT(0),
1155213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_TIMER	= BIT(1),
1165213e8a8SJohannes Berg 	IWL_CHANNEL_ESTIMATION_COUNTER	= BIT(2),
1175213e8a8SJohannes Berg };
1185213e8a8SJohannes Berg 
1195213e8a8SJohannes Berg /**
1205213e8a8SJohannes Berg  * struct iwl_channel_estimation_cfg - channel estimation reporting config
1215213e8a8SJohannes Berg  */
1225213e8a8SJohannes Berg struct iwl_channel_estimation_cfg {
1235213e8a8SJohannes Berg 	/**
1245213e8a8SJohannes Berg 	 * @flags: flags, see &enum iwl_channel_estimation_flags
1255213e8a8SJohannes Berg 	 */
1265213e8a8SJohannes Berg 	__le32 flags;
1275213e8a8SJohannes Berg 	/**
1285213e8a8SJohannes Berg 	 * @timer: if enabled via flags, automatically disable after this many
1295213e8a8SJohannes Berg 	 *	microseconds
1305213e8a8SJohannes Berg 	 */
1315213e8a8SJohannes Berg 	__le32 timer;
1325213e8a8SJohannes Berg 	/**
1335213e8a8SJohannes Berg 	 * @count: if enabled via flags, automatically disable after this many
1345213e8a8SJohannes Berg 	 *	frames with channel estimation matrix were captured
1355213e8a8SJohannes Berg 	 */
1365213e8a8SJohannes Berg 	__le32 count;
1375213e8a8SJohannes Berg 	/**
1385213e8a8SJohannes Berg 	 * @rate_n_flags_mask: only try to record the channel estimation matrix
1395213e8a8SJohannes Berg 	 *	if the rate_n_flags value for the received frame (let's call
1405213e8a8SJohannes Berg 	 *	that rx_rnf) matches the mask/value given here like this:
1415213e8a8SJohannes Berg 	 *	(rx_rnf & rate_n_flags_mask) == rate_n_flags_val.
1425213e8a8SJohannes Berg 	 */
1435213e8a8SJohannes Berg 	__le32 rate_n_flags_mask;
1445213e8a8SJohannes Berg 	/**
1455213e8a8SJohannes Berg 	 * @rate_n_flags_val: see @rate_n_flags_mask
1465213e8a8SJohannes Berg 	 */
1475213e8a8SJohannes Berg 	__le32 rate_n_flags_val;
1485213e8a8SJohannes Berg 	/**
1495213e8a8SJohannes Berg 	 * @reserved: reserved (for alignment)
1505213e8a8SJohannes Berg 	 */
1515213e8a8SJohannes Berg 	__le32 reserved;
1525213e8a8SJohannes Berg 	/**
1535213e8a8SJohannes Berg 	 * @frame_types: bitmap of frame types to capture, the received frame's
1545213e8a8SJohannes Berg 	 *	subtype|type takes 6 bits in the frame and the corresponding bit
1555213e8a8SJohannes Berg 	 *	in this field must be set to 1 to capture channel estimation for
1565213e8a8SJohannes Berg 	 *	that frame type. Set to all-ones to enable capturing for all
1575213e8a8SJohannes Berg 	 *	frame types.
1585213e8a8SJohannes Berg 	 */
1595213e8a8SJohannes Berg 	__le64 frame_types;
1605213e8a8SJohannes Berg } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */
1615213e8a8SJohannes Berg 
162*f7d6ef33SJohannes Berg enum iwl_datapath_monitor_notif_type {
163*f7d6ef33SJohannes Berg 	IWL_DP_MON_NOTIF_TYPE_EXT_CCA,
164*f7d6ef33SJohannes Berg };
165*f7d6ef33SJohannes Berg 
166*f7d6ef33SJohannes Berg struct iwl_datapath_monitor_notif {
167*f7d6ef33SJohannes Berg 	__le32 type;
168*f7d6ef33SJohannes Berg 	u8 mac_id;
169*f7d6ef33SJohannes Berg 	u8 reserved[3];
170*f7d6ef33SJohannes Berg } __packed; /* MONITOR_NTF_API_S_VER_1 */
171*f7d6ef33SJohannes Berg 
172d172a5efSJohannes Berg #endif /* __iwl_fw_api_datapath_h__ */
173