xref: /linux/drivers/net/wireless/intel/iwlwifi/fw/api/dhc.h (revision 1cc3462159babb69c84c39cb1b4e262aef3ea325)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2025 Intel Corporation
4  */
5 #ifndef __iwl_fw_api_dhc_h__
6 #define __iwl_fw_api_dhc_h__
7 
8 #define DHC_TABLE_MASK_POS (28)
9 
10 /**
11  * enum iwl_dhc_table_id - DHC table operations index
12  */
13 enum iwl_dhc_table_id {
14 	/**
15 	 * @DHC_TABLE_INTEGRATION: select the integration table
16 	 */
17 	DHC_TABLE_INTEGRATION	= 2 << DHC_TABLE_MASK_POS,
18 };
19 
20 /**
21  * enum iwl_dhc_umac_integration_table - integration operations
22  */
23 enum iwl_dhc_umac_integration_table {
24 	/**
25 	 * @DHC_INT_UMAC_TWT_OPERATION: trigger a TWT operation
26 	 */
27 	DHC_INT_UMAC_TWT_OPERATION = 4,
28 	/**
29 	 * @DHC_INTEGRATION_TLC_DEBUG_CONFIG: TLC debug
30 	 */
31 	DHC_INTEGRATION_TLC_DEBUG_CONFIG = 1,
32 	/**
33 	 * @DHC_INTEGRATION_MAX: Maximum UMAC integration table entries
34 	 */
35 	DHC_INTEGRATION_MAX
36 };
37 
38 #define DHC_TARGET_UMAC BIT(27)
39 
40 /**
41  * struct iwl_dhc_cmd - debug host command
42  * @length: length in DWs of the data structure that is concatenated to the end
43  *	of this struct
44  * @index_and_mask: bit 31 is 1 for data set operation else it's 0
45  *	bits 28-30 is the index of the table of the operation -
46  *	&enum iwl_dhc_table_id *
47  *	bit 27 is 0 if the cmd targeted to LMAC and 1 if targeted to UMAC,
48  *	(LMAC is 0 for backward compatibility)
49  *	bit 26 is 0 if the cmd targeted to LMAC0 and 1 if targeted to LMAC1,
50  *	relevant only if bit 27 set to 0
51  *	bits 0-25 is a specific entry index in the table specified in bits 28-30
52  *
53  * @data: the concatenated data.
54  */
55 struct iwl_dhc_cmd {
56 	__le32 length;
57 	__le32 index_and_mask;
58 	__le32 data[];
59 } __packed; /* DHC_CMD_API_S */
60 
61 /**
62  * enum iwl_dhc_twt_operation_type - describes the TWT operation type
63  *
64  * @DHC_TWT_REQUEST: Send a Request TWT command
65  * @DHC_TWT_SUGGEST: Send a Suggest TWT command
66  * @DHC_TWT_DEMAND: Send a Demand TWT command
67  * @DHC_TWT_GROUPING: Send a Grouping TWT command
68  * @DHC_TWT_ACCEPT: Send a Accept TWT command
69  * @DHC_TWT_ALTERNATE: Send a Alternate TWT command
70  * @DHC_TWT_DICTATE: Send a Dictate TWT command
71  * @DHC_TWT_REJECT: Send a Reject TWT command
72  * @DHC_TWT_TEARDOWN: Send a TearDown TWT command
73  */
74 enum iwl_dhc_twt_operation_type {
75 	DHC_TWT_REQUEST,
76 	DHC_TWT_SUGGEST,
77 	DHC_TWT_DEMAND,
78 	DHC_TWT_GROUPING,
79 	DHC_TWT_ACCEPT,
80 	DHC_TWT_ALTERNATE,
81 	DHC_TWT_DICTATE,
82 	DHC_TWT_REJECT,
83 	DHC_TWT_TEARDOWN,
84 }; /* DHC_TWT_OPERATION_TYPE_E */
85 
86 /**
87  * struct iwl_dhc_twt_operation - trigger a TWT operation
88  *
89  * @mac_id: the mac Id on which to trigger TWT operation
90  * @twt_operation: see &enum iwl_dhc_twt_operation_type
91  * @target_wake_time: when should we be on channel
92  * @interval_exp: the exponent for the interval
93  * @interval_mantissa: the mantissa for the interval
94  * @min_wake_duration: the minimum duration for the wake period
95  * @trigger: is the TWT triggered or not
96  * @flow_type: is the TWT announced or not
97  * @flow_id: the TWT flow identifier from 0 to 7
98  * @protection: is the TWT protected
99  * @ndo_paging_indicator: is ndo_paging_indicator set
100  * @responder_pm_mode: is responder_pm_mode set
101  * @negotiation_type: if the responder wants to doze outside the TWT SP
102  * @twt_request: 1 for TWT request, 0 otherwise
103  * @implicit: is TWT implicit
104  * @twt_group_assignment: the TWT group assignment
105  * @twt_channel: the TWT channel
106  * @reserved: reserved
107  */
108 struct iwl_dhc_twt_operation {
109 	__le32 mac_id;
110 	__le32 twt_operation;
111 	__le64 target_wake_time;
112 	__le32 interval_exp;
113 	__le32 interval_mantissa;
114 	__le32 min_wake_duration;
115 	u8 trigger;
116 	u8 flow_type;
117 	u8 flow_id;
118 	u8 protection;
119 	u8 ndo_paging_indicator;
120 	u8 responder_pm_mode;
121 	u8 negotiation_type;
122 	u8 twt_request;
123 	u8 implicit;
124 	u8 twt_group_assignment;
125 	u8 twt_channel;
126 	u8 reserved;
127 }; /* DHC_TWT_OPERATION_API_S */
128 
129 #endif /* __iwl_fw_api_dhc_h__ */
130