Merge tag 'qcom-soc-for-4.7-2' into net-next
[linux-2.6-block.git] / drivers / net / ethernet / broadcom / bnxt / bnxt_hsi.h
1 /* Broadcom NetXtreme-C/E network driver.
2  *
3  * Copyright (c) 2014-2016 Broadcom Corporation
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation.
8  */
9
10 #ifndef BNXT_HSI_H
11 #define BNXT_HSI_H
12
13 /* per-context HW statistics -- chip view */
14 struct ctx_hw_stats  {
15         __le64 rx_ucast_pkts;
16         __le64 rx_mcast_pkts;
17         __le64 rx_bcast_pkts;
18         __le64 rx_discard_pkts;
19         __le64 rx_drop_pkts;
20         __le64 rx_ucast_bytes;
21         __le64 rx_mcast_bytes;
22         __le64 rx_bcast_bytes;
23         __le64 tx_ucast_pkts;
24         __le64 tx_mcast_pkts;
25         __le64 tx_bcast_pkts;
26         __le64 tx_discard_pkts;
27         __le64 tx_drop_pkts;
28         __le64 tx_ucast_bytes;
29         __le64 tx_mcast_bytes;
30         __le64 tx_bcast_bytes;
31         __le64 tpa_pkts;
32         __le64 tpa_bytes;
33         __le64 tpa_events;
34         __le64 tpa_aborts;
35 };
36
37 /* Statistics Ejection Buffer Completion Record (16 bytes) */
38 struct eject_cmpl {
39         __le16 type;
40         #define EJECT_CMPL_TYPE_MASK                                0x3fUL
41         #define EJECT_CMPL_TYPE_SFT                                 0
42         #define EJECT_CMPL_TYPE_STAT_EJECT                         (0x1aUL << 0)
43         __le16 len;
44         __le32 opaque;
45         __le32 v;
46         #define EJECT_CMPL_V                                        0x1UL
47         __le32 unused_2;
48 };
49
50 /* HWRM Completion Record (16 bytes) */
51 struct hwrm_cmpl {
52         __le16 type;
53         #define HWRM_CMPL_TYPE_MASK                                 0x3fUL
54         #define HWRM_CMPL_TYPE_SFT                                  0
55         #define HWRM_CMPL_TYPE_HWRM_DONE                           (0x20UL << 0)
56         __le16 sequence_id;
57         __le32 unused_1;
58         __le32 v;
59         #define HWRM_CMPL_V                                         0x1UL
60         __le32 unused_3;
61 };
62
63 /* HWRM Forwarded Request (16 bytes) */
64 struct hwrm_fwd_req_cmpl {
65         __le16 req_len_type;
66         #define HWRM_FWD_REQ_CMPL_TYPE_MASK                         0x3fUL
67         #define HWRM_FWD_REQ_CMPL_TYPE_SFT                          0
68         #define HWRM_FWD_REQ_CMPL_TYPE_HWRM_FWD_REQ                (0x22UL << 0)
69         #define HWRM_FWD_REQ_CMPL_REQ_LEN_MASK                      0xffc0UL
70         #define HWRM_FWD_REQ_CMPL_REQ_LEN_SFT                       6
71         __le16 source_id;
72         __le32 unused_0;
73         __le32 req_buf_addr_v[2];
74         #define HWRM_FWD_REQ_CMPL_V                                 0x1UL
75         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_MASK                 0xfffffffeUL
76         #define HWRM_FWD_REQ_CMPL_REQ_BUF_ADDR_SFT                  1
77 };
78
79 /* HWRM Forwarded Response (16 bytes) */
80 struct hwrm_fwd_resp_cmpl {
81         __le16 type;
82         #define HWRM_FWD_RESP_CMPL_TYPE_MASK                        0x3fUL
83         #define HWRM_FWD_RESP_CMPL_TYPE_SFT                         0
84         #define HWRM_FWD_RESP_CMPL_TYPE_HWRM_FWD_RESP              (0x24UL << 0)
85         __le16 source_id;
86         __le16 resp_len;
87         __le16 unused_1;
88         __le32 resp_buf_addr_v[2];
89         #define HWRM_FWD_RESP_CMPL_V                                0x1UL
90         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_MASK               0xfffffffeUL
91         #define HWRM_FWD_RESP_CMPL_RESP_BUF_ADDR_SFT                1
92 };
93
94 /* HWRM Asynchronous Event Completion Record (16 bytes) */
95 struct hwrm_async_event_cmpl {
96         __le16 type;
97         #define HWRM_ASYNC_EVENT_CMPL_TYPE_MASK             0x3fUL
98         #define HWRM_ASYNC_EVENT_CMPL_TYPE_SFT                      0
99         #define HWRM_ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT       (0x2eUL << 0)
100         __le16 event_id;
101         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE (0x0UL << 0)
102         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE    (0x1UL << 0)
103         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE  (0x2UL << 0)
104         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE  (0x3UL << 0)
105         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED (0x4UL << 0)
106         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED (0x5UL << 0)
107         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE (0x6UL << 0)
108         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD   (0x10UL << 0)
109         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD     (0x11UL << 0)
110         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD     (0x20UL << 0)
111         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD       (0x21UL << 0)
112         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR              (0x30UL << 0)
113         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE (0x31UL << 0)
114         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE (0x32UL << 0)
115         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE      (0x33UL << 0)
116         #define HWRM_ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR          (0xffUL << 0)
117         __le32 event_data2;
118         u8 opaque_v;
119         #define HWRM_ASYNC_EVENT_CMPL_V                     0x1UL
120         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_MASK                   0xfeUL
121         #define HWRM_ASYNC_EVENT_CMPL_OPAQUE_SFT                    1
122         u8 timestamp_lo;
123         __le16 timestamp_hi;
124         __le32 event_data1;
125 };
126
127 /* HWRM Asynchronous Event Completion Record for link status change (16 bytes) */
128 struct hwrm_async_event_cmpl_link_status_change {
129         __le16 type;
130         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_MASK 0x3fUL
131         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_SFT  0
132         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
133         __le16 event_id;
134         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_ID_LINK_STATUS_CHANGE (0x0UL << 0)
135         __le32 event_data2;
136         u8 opaque_v;
137         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_V          0x1UL
138         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_MASK 0xfeUL
139         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_OPAQUE_SFT 1
140         u8 timestamp_lo;
141         __le16 timestamp_hi;
142         __le32 event_data1;
143         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE 0x1UL
144         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_DOWN (0x0UL << 0)
145         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP (0x1UL << 0)
146         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_LAST    HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_LINK_CHANGE_UP
147         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_MASK 0xeUL
148         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_SFT 1
149         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffff0UL
150         #define HWRM_ASYNC_EVENT_CMPL_LINK_STATUS_CHANGE_EVENT_DATA1_PORT_ID_SFT 4
151 };
152
153 /* HWRM Asynchronous Event Completion Record for link MTU change (16 bytes) */
154 struct hwrm_async_event_cmpl_link_mtu_change {
155         __le16 type;
156         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_MASK    0x3fUL
157         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_SFT     0
158         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
159         __le16 event_id;
160         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_ID_LINK_MTU_CHANGE (0x1UL << 0)
161         __le32 event_data2;
162         u8 opaque_v;
163         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_V     0x1UL
164         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_MASK  0xfeUL
165         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_OPAQUE_SFT   1
166         u8 timestamp_lo;
167         __le16 timestamp_hi;
168         __le32 event_data1;
169         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_MASK 0xffffUL
170         #define HWRM_ASYNC_EVENT_CMPL_LINK_MTU_CHANGE_EVENT_DATA1_NEW_MTU_SFT 0
171 };
172
173 /* HWRM Asynchronous Event Completion Record for link speed change (16 bytes) */
174 struct hwrm_async_event_cmpl_link_speed_change {
175         __le16 type;
176         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_MASK  0x3fUL
177         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_SFT   0
178         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
179         __le16 event_id;
180         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_ID_LINK_SPEED_CHANGE (0x2UL << 0)
181         __le32 event_data2;
182         u8 opaque_v;
183         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_V           0x1UL
184         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_MASK 0xfeUL
185         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_OPAQUE_SFT 1
186         u8 timestamp_lo;
187         __le16 timestamp_hi;
188         __le32 event_data1;
189         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_FORCE 0x1UL
190         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_MASK 0xfffeUL
191         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_SFT 1
192         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100MB (0x1UL << 1)
193         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_1GB (0xaUL << 1)
194         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2GB (0x14UL << 1)
195         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_2_5GB (0x19UL << 1)
196         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10GB (0x64UL << 1)
197         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_20GB (0xc8UL << 1)
198         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_25GB (0xfaUL << 1)
199         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_40GB (0x190UL << 1)
200         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_50GB (0x1f4UL << 1)
201         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_100GB (0x3e8UL << 1)
202         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10MB (0xffffUL << 1)
203         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_LAST    HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_NEW_LINK_SPEED_100MBPS_10MB
204         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffff0000UL
205         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CHANGE_EVENT_DATA1_PORT_ID_SFT 16
206 };
207
208 /* HWRM Asynchronous Event Completion Record for DCB Config change (16 bytes) */
209 struct hwrm_async_event_cmpl_dcb_config_change {
210         __le16 type;
211         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_MASK  0x3fUL
212         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_SFT   0
213         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
214         __le16 event_id;
215         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_ID_DCB_CONFIG_CHANGE (0x3UL << 0)
216         __le32 event_data2;
217         u8 opaque_v;
218         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_V           0x1UL
219         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_MASK 0xfeUL
220         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_OPAQUE_SFT 1
221         u8 timestamp_lo;
222         __le16 timestamp_hi;
223         __le32 event_data1;
224         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffffUL
225         #define HWRM_ASYNC_EVENT_CMPL_DCB_CONFIG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
226 };
227
228 /* HWRM Asynchronous Event Completion Record for port connection not allowed (16 bytes) */
229 struct hwrm_async_event_cmpl_port_conn_not_allowed {
230         __le16 type;
231         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_MASK 0x3fUL
232         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_SFT 0
233         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
234         __le16 event_id;
235         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_ID_PORT_CONN_NOT_ALLOWED (0x4UL << 0)
236         __le32 event_data2;
237         u8 opaque_v;
238         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_V      0x1UL
239         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_MASK 0xfeUL
240         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_OPAQUE_SFT 1
241         u8 timestamp_lo;
242         __le16 timestamp_hi;
243         __le32 event_data1;
244         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK 0xffffUL
245         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
246         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_MASK 0xff0000UL
247         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_SFT 16
248         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_NONE (0x0UL << 16)
249         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_DISABLETX (0x1UL << 16)
250         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_WARNINGMSG (0x2UL << 16)
251         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN (0x3UL << 16)
252         #define HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_LAST    HWRM_ASYNC_EVENT_CMPL_PORT_CONN_NOT_ALLOWED_EVENT_DATA1_ENFORCEMENT_POLICY_PWRDOWN
253 };
254
255 /* HWRM Asynchronous Event Completion Record for link speed config not allowed (16 bytes) */
256 struct hwrm_async_event_cmpl_link_speed_cfg_not_allowed {
257         __le16 type;
258         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_MASK 0x3fUL
259         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_SFT 0
260         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
261         __le16 event_id;
262         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED (0x5UL << 0)
263         __le32 event_data2;
264         u8 opaque_v;
265         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_V 0x1UL
266         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_MASK 0xfeUL
267         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_OPAQUE_SFT 1
268         u8 timestamp_lo;
269         __le16 timestamp_hi;
270         __le32 event_data1;
271         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_MASK 0xffffUL
272         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_NOT_ALLOWED_EVENT_DATA1_PORT_ID_SFT 0
273 };
274
275 /* HWRM Asynchronous Event Completion Record for link speed configuration change (16 bytes) */
276 struct hwrm_async_event_cmpl_link_speed_cfg_change {
277         __le16 type;
278         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_MASK 0x3fUL
279         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_SFT 0
280         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
281         __le16 event_id;
282         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_ID_LINK_SPEED_CFG_CHANGE (0x6UL << 0)
283         __le32 event_data2;
284         u8 opaque_v;
285         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_V      0x1UL
286         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_MASK 0xfeUL
287         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_OPAQUE_SFT 1
288         u8 timestamp_lo;
289         __le16 timestamp_hi;
290         __le32 event_data1;
291         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_MASK 0xffffUL
292         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_PORT_ID_SFT 0
293         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_SUPPORTED_LINK_SPEEDS_CHANGE 0x10000UL
294         #define HWRM_ASYNC_EVENT_CMPL_LINK_SPEED_CFG_CHANGE_EVENT_DATA1_ILLEGAL_LINK_SPEED_CFG 0x20000UL
295 };
296
297 /* HWRM Asynchronous Event Completion Record for Function Driver Unload (16 bytes) */
298 struct hwrm_async_event_cmpl_func_drvr_unload {
299         __le16 type;
300         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_MASK   0x3fUL
301         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_SFT    0
302         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
303         __le16 event_id;
304         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_ID_FUNC_DRVR_UNLOAD (0x10UL << 0)
305         __le32 event_data2;
306         u8 opaque_v;
307         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_V            0x1UL
308         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_MASK 0xfeUL
309         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_OPAQUE_SFT  1
310         u8 timestamp_lo;
311         __le16 timestamp_hi;
312         __le32 event_data1;
313         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
314         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
315 };
316
317 /* HWRM Asynchronous Event Completion Record for Function Driver load (16 bytes) */
318 struct hwrm_async_event_cmpl_func_drvr_load {
319         __le16 type;
320         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_MASK     0x3fUL
321         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_SFT      0
322         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
323         __le16 event_id;
324         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_ID_FUNC_DRVR_LOAD (0x11UL << 0)
325         __le32 event_data2;
326         u8 opaque_v;
327         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_V              0x1UL
328         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_MASK   0xfeUL
329         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_OPAQUE_SFT    1
330         u8 timestamp_lo;
331         __le16 timestamp_hi;
332         __le32 event_data1;
333         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
334         #define HWRM_ASYNC_EVENT_CMPL_FUNC_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
335 };
336
337 /* HWRM Asynchronous Event Completion Record for PF Driver Unload (16 bytes) */
338 struct hwrm_async_event_cmpl_pf_drvr_unload {
339         __le16 type;
340         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_MASK     0x3fUL
341         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_SFT      0
342         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
343         __le16 event_id;
344         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_ID_PF_DRVR_UNLOAD (0x20UL << 0)
345         __le32 event_data2;
346         u8 opaque_v;
347         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_V              0x1UL
348         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_MASK   0xfeUL
349         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_OPAQUE_SFT    1
350         u8 timestamp_lo;
351         __le16 timestamp_hi;
352         __le32 event_data1;
353         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
354         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_FUNC_ID_SFT 0
355         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_MASK 0x70000UL
356         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_UNLOAD_EVENT_DATA1_PORT_SFT 16
357 };
358
359 /* HWRM Asynchronous Event Completion Record for PF Driver load (16 bytes) */
360 struct hwrm_async_event_cmpl_pf_drvr_load {
361         __le16 type;
362         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_MASK       0x3fUL
363         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_SFT         0
364         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
365         __le16 event_id;
366         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_ID_PF_DRVR_LOAD (0x21UL << 0)
367         __le32 event_data2;
368         u8 opaque_v;
369         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_V                0x1UL
370         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_MASK     0xfeUL
371         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_OPAQUE_SFT      1
372         u8 timestamp_lo;
373         __le16 timestamp_hi;
374         __le32 event_data1;
375         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_MASK 0xffffUL
376         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_FUNC_ID_SFT 0
377         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_MASK 0x70000UL
378         #define HWRM_ASYNC_EVENT_CMPL_PF_DRVR_LOAD_EVENT_DATA1_PORT_SFT 16
379 };
380
381 /* HWRM Asynchronous Event Completion Record for VF FLR (16 bytes) */
382 struct hwrm_async_event_cmpl_vf_flr {
383         __le16 type;
384         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_MASK              0x3fUL
385         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_SFT               0
386         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
387         __le16 event_id;
388         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_ID_VF_FLR      (0x30UL << 0)
389         __le32 event_data2;
390         u8 opaque_v;
391         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_V                      0x1UL
392         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_MASK            0xfeUL
393         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_OPAQUE_SFT     1
394         u8 timestamp_lo;
395         __le16 timestamp_hi;
396         __le32 event_data1;
397         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_MASK 0xffffUL
398         #define HWRM_ASYNC_EVENT_CMPL_VF_FLR_EVENT_DATA1_VF_ID_SFT 0
399 };
400
401 /* HWRM Asynchronous Event Completion Record for VF MAC Addr change (16 bytes) */
402 struct hwrm_async_event_cmpl_vf_mac_addr_change {
403         __le16 type;
404         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_MASK 0x3fUL
405         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_SFT  0
406         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
407         __le16 event_id;
408         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_ID_VF_MAC_ADDR_CHANGE (0x31UL << 0)
409         __le32 event_data2;
410         u8 opaque_v;
411         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_V          0x1UL
412         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_MASK 0xfeUL
413         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_OPAQUE_SFT 1
414         u8 timestamp_lo;
415         __le16 timestamp_hi;
416         __le32 event_data1;
417         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_MASK 0xffffUL
418         #define HWRM_ASYNC_EVENT_CMPL_VF_MAC_ADDR_CHANGE_EVENT_DATA1_VF_ID_SFT 0
419 };
420
421 /* HWRM Asynchronous Event Completion Record for PF-VF communication status change (16 bytes) */
422 struct hwrm_async_event_cmpl_pf_vf_comm_status_change {
423         __le16 type;
424         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_MASK 0x3fUL
425         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_SFT 0
426         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
427         __le16 event_id;
428         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_ID_PF_VF_COMM_STATUS_CHANGE (0x32UL << 0)
429         __le32 event_data2;
430         u8 opaque_v;
431         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_V   0x1UL
432         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_MASK 0xfeUL
433         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_OPAQUE_SFT 1
434         u8 timestamp_lo;
435         __le16 timestamp_hi;
436         __le32 event_data1;
437         #define HWRM_ASYNC_EVENT_CMPL_PF_VF_COMM_STATUS_CHANGE_EVENT_DATA1_COMM_ESTABLISHED 0x1UL
438 };
439
440 /* HWRM Asynchronous Event Completion Record for VF configuration change (16 bytes) */
441 struct hwrm_async_event_cmpl_vf_cfg_change {
442         __le16 type;
443         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_MASK      0x3fUL
444         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_SFT       0
445         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
446         __le16 event_id;
447         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_ID_VF_CFG_CHANGE (0x33UL << 0)
448         __le32 event_data2;
449         u8 opaque_v;
450         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_V               0x1UL
451         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_MASK    0xfeUL
452         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_OPAQUE_SFT     1
453         u8 timestamp_lo;
454         __le16 timestamp_hi;
455         __le32 event_data1;
456         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MTU_CHANGE 0x1UL
457         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_MRU_CHANGE 0x2UL
458         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE 0x4UL
459         #define HWRM_ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE 0x8UL
460 };
461
462 /* HWRM Asynchronous Event Completion Record for HWRM Error (16 bytes) */
463 struct hwrm_async_event_cmpl_hwrm_error {
464         __le16 type;
465         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_MASK          0x3fUL
466         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_SFT           0
467         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_TYPE_HWRM_ASYNC_EVENT (0x2eUL << 0)
468         __le16 event_id;
469         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_ID_HWRM_ERROR (0xffUL << 0)
470         __le32 event_data2;
471         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_MASK 0xffUL
472         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_SFT 0
473         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_WARNING (0x0UL << 0)
474         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_NONFATAL (0x1UL << 0)
475         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL (0x2UL << 0)
476         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_LAST    HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA2_SEVERITY_FATAL
477         u8 opaque_v;
478         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_V                  0x1UL
479         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_MASK       0xfeUL
480         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_OPAQUE_SFT         1
481         u8 timestamp_lo;
482         __le16 timestamp_hi;
483         __le32 event_data1;
484         #define HWRM_ASYNC_EVENT_CMPL_HWRM_ERROR_EVENT_DATA1_TIMESTAMP 0x1UL
485 };
486
487 /* HW Resource Manager Specification 1.2.2 */
488 #define HWRM_VERSION_MAJOR      1
489 #define HWRM_VERSION_MINOR      2
490 #define HWRM_VERSION_UPDATE     2
491
492 #define HWRM_VERSION_STR        "1.2.2"
493 /*
494  * Following is the signature for HWRM message field that indicates not
495  * applicable (All F's). Need to cast it the size of the field if needed.
496  */
497 #define HWRM_NA_SIGNATURE       ((__le32)(-1))
498 #define HWRM_MAX_REQ_LEN    (128)  /* hwrm_func_buf_rgtr */
499 #define HWRM_MAX_RESP_LEN    (176)  /* hwrm_func_qstats */
500 #define HW_HASH_INDEX_SIZE      0x80    /* 7 bit indirection table index. */
501 #define HW_HASH_KEY_SIZE        40
502 #define HWRM_RESP_VALID_KEY      1 /* valid key for HWRM response */
503 /* Input (16 bytes) */
504 struct input {
505         __le16 req_type;
506         __le16 cmpl_ring;
507         __le16 seq_id;
508         __le16 target_id;
509         __le64 resp_addr;
510 };
511
512 /* Output (8 bytes) */
513 struct output {
514         __le16 error_code;
515         __le16 req_type;
516         __le16 seq_id;
517         __le16 resp_len;
518 };
519
520 /* Command numbering (8 bytes) */
521 struct cmd_nums {
522         __le16 req_type;
523         #define HWRM_VER_GET                                       (0x0UL)
524         #define HWRM_FUNC_BUF_UNRGTR                               (0xeUL)
525         #define HWRM_FUNC_VF_CFG                                   (0xfUL)
526         #define RESERVED1                                          (0x10UL)
527         #define HWRM_FUNC_RESET                            (0x11UL)
528         #define HWRM_FUNC_GETFID                                   (0x12UL)
529         #define HWRM_FUNC_VF_ALLOC                                 (0x13UL)
530         #define HWRM_FUNC_VF_FREE                                  (0x14UL)
531         #define HWRM_FUNC_QCAPS                            (0x15UL)
532         #define HWRM_FUNC_QCFG                                     (0x16UL)
533         #define HWRM_FUNC_CFG                                      (0x17UL)
534         #define HWRM_FUNC_QSTATS                                   (0x18UL)
535         #define HWRM_FUNC_CLR_STATS                                (0x19UL)
536         #define HWRM_FUNC_DRV_UNRGTR                               (0x1aUL)
537         #define HWRM_FUNC_VF_RESC_FREE                             (0x1bUL)
538         #define HWRM_FUNC_VF_VNIC_IDS_QUERY                        (0x1cUL)
539         #define HWRM_FUNC_DRV_RGTR                                 (0x1dUL)
540         #define HWRM_FUNC_DRV_QVER                                 (0x1eUL)
541         #define HWRM_FUNC_BUF_RGTR                                 (0x1fUL)
542         #define HWRM_PORT_PHY_CFG                                  (0x20UL)
543         #define HWRM_PORT_MAC_CFG                                  (0x21UL)
544         #define HWRM_PORT_TS_QUERY                                 (0x22UL)
545         #define HWRM_PORT_QSTATS                                   (0x23UL)
546         #define HWRM_PORT_LPBK_QSTATS                              (0x24UL)
547         #define HWRM_PORT_CLR_STATS                                (0x25UL)
548         #define HWRM_PORT_LPBK_CLR_STATS                           (0x26UL)
549         #define HWRM_PORT_PHY_QCFG                                 (0x27UL)
550         #define HWRM_PORT_MAC_QCFG                                 (0x28UL)
551         #define HWRM_PORT_BLINK_LED                                (0x29UL)
552         #define HWRM_PORT_PHY_QCAPS                                (0x2aUL)
553         #define HWRM_PORT_PHY_I2C_WRITE                    (0x2bUL)
554         #define HWRM_PORT_PHY_I2C_READ                             (0x2cUL)
555         #define HWRM_QUEUE_QPORTCFG                                (0x30UL)
556         #define HWRM_QUEUE_QCFG                            (0x31UL)
557         #define HWRM_QUEUE_CFG                                     (0x32UL)
558         #define HWRM_QUEUE_BUFFERS_QCFG                    (0x33UL)
559         #define HWRM_QUEUE_BUFFERS_CFG                             (0x34UL)
560         #define HWRM_QUEUE_PFCENABLE_QCFG                          (0x35UL)
561         #define HWRM_QUEUE_PFCENABLE_CFG                           (0x36UL)
562         #define HWRM_QUEUE_PRI2COS_QCFG                    (0x37UL)
563         #define HWRM_QUEUE_PRI2COS_CFG                             (0x38UL)
564         #define HWRM_QUEUE_COS2BW_QCFG                             (0x39UL)
565         #define HWRM_QUEUE_COS2BW_CFG                              (0x3aUL)
566         #define HWRM_VNIC_ALLOC                            (0x40UL)
567         #define HWRM_VNIC_FREE                                     (0x41UL)
568         #define HWRM_VNIC_CFG                                      (0x42UL)
569         #define HWRM_VNIC_QCFG                                     (0x43UL)
570         #define HWRM_VNIC_TPA_CFG                                  (0x44UL)
571         #define HWRM_VNIC_TPA_QCFG                                 (0x45UL)
572         #define HWRM_VNIC_RSS_CFG                                  (0x46UL)
573         #define HWRM_VNIC_RSS_QCFG                                 (0x47UL)
574         #define HWRM_VNIC_PLCMODES_CFG                             (0x48UL)
575         #define HWRM_VNIC_PLCMODES_QCFG                    (0x49UL)
576         #define HWRM_RING_ALLOC                            (0x50UL)
577         #define HWRM_RING_FREE                                     (0x51UL)
578         #define HWRM_RING_CMPL_RING_QAGGINT_PARAMS                 (0x52UL)
579         #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS              (0x53UL)
580         #define HWRM_RING_RESET                            (0x5eUL)
581         #define HWRM_RING_GRP_ALLOC                                (0x60UL)
582         #define HWRM_RING_GRP_FREE                                 (0x61UL)
583         #define HWRM_VNIC_RSS_COS_LB_CTX_ALLOC                     (0x70UL)
584         #define HWRM_VNIC_RSS_COS_LB_CTX_FREE                      (0x71UL)
585         #define HWRM_CFA_L2_FILTER_ALLOC                           (0x90UL)
586         #define HWRM_CFA_L2_FILTER_FREE                    (0x91UL)
587         #define HWRM_CFA_L2_FILTER_CFG                             (0x92UL)
588         #define HWRM_CFA_L2_SET_RX_MASK                    (0x93UL)
589         #define RESERVED3                                          (0x94UL)
590         #define HWRM_CFA_TUNNEL_FILTER_ALLOC                       (0x95UL)
591         #define HWRM_CFA_TUNNEL_FILTER_FREE                        (0x96UL)
592         #define HWRM_CFA_ENCAP_RECORD_ALLOC                        (0x97UL)
593         #define HWRM_CFA_ENCAP_RECORD_FREE                         (0x98UL)
594         #define HWRM_CFA_NTUPLE_FILTER_ALLOC                       (0x99UL)
595         #define HWRM_CFA_NTUPLE_FILTER_FREE                        (0x9aUL)
596         #define HWRM_CFA_NTUPLE_FILTER_CFG                         (0x9bUL)
597         #define HWRM_CFA_EM_FLOW_ALLOC                             (0x9cUL)
598         #define HWRM_CFA_EM_FLOW_FREE                              (0x9dUL)
599         #define HWRM_CFA_EM_FLOW_CFG                               (0x9eUL)
600         #define HWRM_TUNNEL_DST_PORT_QUERY                         (0xa0UL)
601         #define HWRM_TUNNEL_DST_PORT_ALLOC                         (0xa1UL)
602         #define HWRM_TUNNEL_DST_PORT_FREE                          (0xa2UL)
603         #define HWRM_STAT_CTX_ALLOC                                (0xb0UL)
604         #define HWRM_STAT_CTX_FREE                                 (0xb1UL)
605         #define HWRM_STAT_CTX_QUERY                                (0xb2UL)
606         #define HWRM_STAT_CTX_CLR_STATS                    (0xb3UL)
607         #define HWRM_FW_RESET                                      (0xc0UL)
608         #define HWRM_FW_QSTATUS                            (0xc1UL)
609         #define HWRM_EXEC_FWD_RESP                                 (0xd0UL)
610         #define HWRM_REJECT_FWD_RESP                               (0xd1UL)
611         #define HWRM_FWD_RESP                                      (0xd2UL)
612         #define HWRM_FWD_ASYNC_EVENT_CMPL                          (0xd3UL)
613         #define HWRM_TEMP_MONITOR_QUERY                    (0xe0UL)
614         #define HWRM_DBG_READ_DIRECT                               (0xff10UL)
615         #define HWRM_DBG_READ_INDIRECT                             (0xff11UL)
616         #define HWRM_DBG_WRITE_DIRECT                              (0xff12UL)
617         #define HWRM_DBG_WRITE_INDIRECT                    (0xff13UL)
618         #define HWRM_DBG_DUMP                                      (0xff14UL)
619         #define HWRM_NVM_MODIFY                            (0xfff4UL)
620         #define HWRM_NVM_VERIFY_UPDATE                             (0xfff5UL)
621         #define HWRM_NVM_GET_DEV_INFO                              (0xfff6UL)
622         #define HWRM_NVM_ERASE_DIR_ENTRY                           (0xfff7UL)
623         #define HWRM_NVM_MOD_DIR_ENTRY                             (0xfff8UL)
624         #define HWRM_NVM_FIND_DIR_ENTRY                    (0xfff9UL)
625         #define HWRM_NVM_GET_DIR_ENTRIES                           (0xfffaUL)
626         #define HWRM_NVM_GET_DIR_INFO                              (0xfffbUL)
627         #define HWRM_NVM_RAW_DUMP                                  (0xfffcUL)
628         #define HWRM_NVM_READ                                      (0xfffdUL)
629         #define HWRM_NVM_WRITE                                     (0xfffeUL)
630         #define HWRM_NVM_RAW_WRITE_BLK                             (0xffffUL)
631         __le16 unused_0[3];
632 };
633
634 /* Return Codes (8 bytes) */
635 struct ret_codes {
636         __le16 error_code;
637         #define HWRM_ERR_CODE_SUCCESS                              (0x0UL)
638         #define HWRM_ERR_CODE_FAIL                                 (0x1UL)
639         #define HWRM_ERR_CODE_INVALID_PARAMS                       (0x2UL)
640         #define HWRM_ERR_CODE_RESOURCE_ACCESS_DENIED               (0x3UL)
641         #define HWRM_ERR_CODE_RESOURCE_ALLOC_ERROR                 (0x4UL)
642         #define HWRM_ERR_CODE_INVALID_FLAGS                        (0x5UL)
643         #define HWRM_ERR_CODE_INVALID_ENABLES                      (0x6UL)
644         #define HWRM_ERR_CODE_HWRM_ERROR                           (0xfUL)
645         #define HWRM_ERR_CODE_UNKNOWN_ERR                          (0xfffeUL)
646         #define HWRM_ERR_CODE_CMD_NOT_SUPPORTED            (0xffffUL)
647         __le16 unused_0[3];
648 };
649
650 /* Output (16 bytes) */
651 struct hwrm_err_output {
652         __le16 error_code;
653         __le16 req_type;
654         __le16 seq_id;
655         __le16 resp_len;
656         __le32 opaque_0;
657         __le16 opaque_1;
658         u8 cmd_err;
659         u8 valid;
660 };
661
662 /* Port Tx Statistics Formats (408 bytes) */
663 struct tx_port_stats {
664         __le64 tx_64b_frames;
665         __le64 tx_65b_127b_frames;
666         __le64 tx_128b_255b_frames;
667         __le64 tx_256b_511b_frames;
668         __le64 tx_512b_1023b_frames;
669         __le64 tx_1024b_1518_frames;
670         __le64 tx_good_vlan_frames;
671         __le64 tx_1519b_2047_frames;
672         __le64 tx_2048b_4095b_frames;
673         __le64 tx_4096b_9216b_frames;
674         __le64 tx_9217b_16383b_frames;
675         __le64 tx_good_frames;
676         __le64 tx_total_frames;
677         __le64 tx_ucast_frames;
678         __le64 tx_mcast_frames;
679         __le64 tx_bcast_frames;
680         __le64 tx_pause_frames;
681         __le64 tx_pfc_frames;
682         __le64 tx_jabber_frames;
683         __le64 tx_fcs_err_frames;
684         __le64 tx_control_frames;
685         __le64 tx_oversz_frames;
686         __le64 tx_single_dfrl_frames;
687         __le64 tx_multi_dfrl_frames;
688         __le64 tx_single_coll_frames;
689         __le64 tx_multi_coll_frames;
690         __le64 tx_late_coll_frames;
691         __le64 tx_excessive_coll_frames;
692         __le64 tx_frag_frames;
693         __le64 tx_err;
694         __le64 tx_tagged_frames;
695         __le64 tx_dbl_tagged_frames;
696         __le64 tx_runt_frames;
697         __le64 tx_fifo_underruns;
698         __le64 tx_pfc_ena_frames_pri0;
699         __le64 tx_pfc_ena_frames_pri1;
700         __le64 tx_pfc_ena_frames_pri2;
701         __le64 tx_pfc_ena_frames_pri3;
702         __le64 tx_pfc_ena_frames_pri4;
703         __le64 tx_pfc_ena_frames_pri5;
704         __le64 tx_pfc_ena_frames_pri6;
705         __le64 tx_pfc_ena_frames_pri7;
706         __le64 tx_eee_lpi_events;
707         __le64 tx_eee_lpi_duration;
708         __le64 tx_llfc_logical_msgs;
709         __le64 tx_hcfc_msgs;
710         __le64 tx_total_collisions;
711         __le64 tx_bytes;
712         __le64 tx_xthol_frames;
713         __le64 tx_stat_discard;
714         __le64 tx_stat_error;
715 };
716
717 /* Port Rx Statistics Formats (528 bytes) */
718 struct rx_port_stats {
719         __le64 rx_64b_frames;
720         __le64 rx_65b_127b_frames;
721         __le64 rx_128b_255b_frames;
722         __le64 rx_256b_511b_frames;
723         __le64 rx_512b_1023b_frames;
724         __le64 rx_1024b_1518_frames;
725         __le64 rx_good_vlan_frames;
726         __le64 rx_1519b_2047b_frames;
727         __le64 rx_2048b_4095b_frames;
728         __le64 rx_4096b_9216b_frames;
729         __le64 rx_9217b_16383b_frames;
730         __le64 rx_total_frames;
731         __le64 rx_ucast_frames;
732         __le64 rx_mcast_frames;
733         __le64 rx_bcast_frames;
734         __le64 rx_fcs_err_frames;
735         __le64 rx_ctrl_frames;
736         __le64 rx_pause_frames;
737         __le64 rx_pfc_frames;
738         __le64 rx_unsupported_opcode_frames;
739         __le64 rx_unsupported_da_pausepfc_frames;
740         __le64 rx_wrong_sa_frames;
741         __le64 rx_align_err_frames;
742         __le64 rx_oor_len_frames;
743         __le64 rx_code_err_frames;
744         __le64 rx_false_carrier_frames;
745         __le64 rx_ovrsz_frames;
746         __le64 rx_jbr_frames;
747         __le64 rx_mtu_err_frames;
748         __le64 rx_match_crc_frames;
749         __le64 rx_promiscuous_frames;
750         __le64 rx_tagged_frames;
751         __le64 rx_double_tagged_frames;
752         __le64 rx_trunc_frames;
753         __le64 rx_good_frames;
754         __le64 rx_pfc_xon2xoff_frames_pri0;
755         __le64 rx_pfc_xon2xoff_frames_pri1;
756         __le64 rx_pfc_xon2xoff_frames_pri2;
757         __le64 rx_pfc_xon2xoff_frames_pri3;
758         __le64 rx_pfc_xon2xoff_frames_pri4;
759         __le64 rx_pfc_xon2xoff_frames_pri5;
760         __le64 rx_pfc_xon2xoff_frames_pri6;
761         __le64 rx_pfc_xon2xoff_frames_pri7;
762         __le64 rx_pfc_ena_frames_pri0;
763         __le64 rx_pfc_ena_frames_pri1;
764         __le64 rx_pfc_ena_frames_pri2;
765         __le64 rx_pfc_ena_frames_pri3;
766         __le64 rx_pfc_ena_frames_pri4;
767         __le64 rx_pfc_ena_frames_pri5;
768         __le64 rx_pfc_ena_frames_pri6;
769         __le64 rx_pfc_ena_frames_pri7;
770         __le64 rx_sch_crc_err_frames;
771         __le64 rx_undrsz_frames;
772         __le64 rx_frag_frames;
773         __le64 rx_eee_lpi_events;
774         __le64 rx_eee_lpi_duration;
775         __le64 rx_llfc_physical_msgs;
776         __le64 rx_llfc_logical_msgs;
777         __le64 rx_llfc_msgs_with_crc_err;
778         __le64 rx_hcfc_msgs;
779         __le64 rx_hcfc_msgs_with_crc_err;
780         __le64 rx_bytes;
781         __le64 rx_runt_bytes;
782         __le64 rx_runt_frames;
783         __le64 rx_stat_discard;
784         __le64 rx_stat_err;
785 };
786
787 /* hwrm_ver_get */
788 /* Input (24 bytes) */
789 struct hwrm_ver_get_input {
790         __le16 req_type;
791         __le16 cmpl_ring;
792         __le16 seq_id;
793         __le16 target_id;
794         __le64 resp_addr;
795         u8 hwrm_intf_maj;
796         u8 hwrm_intf_min;
797         u8 hwrm_intf_upd;
798         u8 unused_0[5];
799 };
800
801 /* Output (128 bytes) */
802 struct hwrm_ver_get_output {
803         __le16 error_code;
804         __le16 req_type;
805         __le16 seq_id;
806         __le16 resp_len;
807         u8 hwrm_intf_maj;
808         u8 hwrm_intf_min;
809         u8 hwrm_intf_upd;
810         u8 hwrm_intf_rsvd;
811         u8 hwrm_fw_maj;
812         u8 hwrm_fw_min;
813         u8 hwrm_fw_bld;
814         u8 hwrm_fw_rsvd;
815         u8 mgmt_fw_maj;
816         u8 mgmt_fw_min;
817         u8 mgmt_fw_bld;
818         u8 mgmt_fw_rsvd;
819         u8 netctrl_fw_maj;
820         u8 netctrl_fw_min;
821         u8 netctrl_fw_bld;
822         u8 netctrl_fw_rsvd;
823         __le32 reserved1;
824         u8 roce_fw_maj;
825         u8 roce_fw_min;
826         u8 roce_fw_bld;
827         u8 roce_fw_rsvd;
828         char hwrm_fw_name[16];
829         char mgmt_fw_name[16];
830         char netctrl_fw_name[16];
831         __le32 reserved2[4];
832         char roce_fw_name[16];
833         __le16 chip_num;
834         u8 chip_rev;
835         u8 chip_metal;
836         u8 chip_bond_id;
837         u8 chip_platform_type;
838         #define VER_GET_RESP_CHIP_PLATFORM_TYPE_ASIC               (0x0UL << 0)
839         #define VER_GET_RESP_CHIP_PLATFORM_TYPE_FPGA               (0x1UL << 0)
840         #define VER_GET_RESP_CHIP_PLATFORM_TYPE_PALLADIUM          (0x2UL << 0)
841         __le16 max_req_win_len;
842         __le16 max_resp_len;
843         __le16 def_req_timeout;
844         u8 unused_0;
845         u8 unused_1;
846         u8 unused_2;
847         u8 valid;
848 };
849
850 /* hwrm_func_reset */
851 /* Input (24 bytes) */
852 struct hwrm_func_reset_input {
853         __le16 req_type;
854         __le16 cmpl_ring;
855         __le16 seq_id;
856         __le16 target_id;
857         __le64 resp_addr;
858         __le32 enables;
859         #define FUNC_RESET_REQ_ENABLES_VF_ID_VALID                  0x1UL
860         __le16 vf_id;
861         u8 func_reset_level;
862         #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETALL           (0x0UL << 0)
863         #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETME    (0x1UL << 0)
864         #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETCHILDREN     (0x2UL << 0)
865         #define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETVF    (0x3UL << 0)
866         u8 unused_0;
867 };
868
869 /* Output (16 bytes) */
870 struct hwrm_func_reset_output {
871         __le16 error_code;
872         __le16 req_type;
873         __le16 seq_id;
874         __le16 resp_len;
875         __le32 unused_0;
876         u8 unused_1;
877         u8 unused_2;
878         u8 unused_3;
879         u8 valid;
880 };
881
882 /* hwrm_func_getfid */
883 /* Input (24 bytes) */
884 struct hwrm_func_getfid_input {
885         __le16 req_type;
886         __le16 cmpl_ring;
887         __le16 seq_id;
888         __le16 target_id;
889         __le64 resp_addr;
890         __le32 enables;
891         #define FUNC_GETFID_REQ_ENABLES_PCI_ID                      0x1UL
892         __le16 pci_id;
893         __le16 unused_0;
894 };
895
896 /* Output (16 bytes) */
897 struct hwrm_func_getfid_output {
898         __le16 error_code;
899         __le16 req_type;
900         __le16 seq_id;
901         __le16 resp_len;
902         __le16 fid;
903         u8 unused_0;
904         u8 unused_1;
905         u8 unused_2;
906         u8 unused_3;
907         u8 unused_4;
908         u8 valid;
909 };
910
911 /* hwrm_func_vf_alloc */
912 /* Input (24 bytes) */
913 struct hwrm_func_vf_alloc_input {
914         __le16 req_type;
915         __le16 cmpl_ring;
916         __le16 seq_id;
917         __le16 target_id;
918         __le64 resp_addr;
919         __le32 enables;
920         #define FUNC_VF_ALLOC_REQ_ENABLES_FIRST_VF_ID               0x1UL
921         __le16 first_vf_id;
922         __le16 num_vfs;
923 };
924
925 /* Output (16 bytes) */
926 struct hwrm_func_vf_alloc_output {
927         __le16 error_code;
928         __le16 req_type;
929         __le16 seq_id;
930         __le16 resp_len;
931         __le16 first_vf_id;
932         u8 unused_0;
933         u8 unused_1;
934         u8 unused_2;
935         u8 unused_3;
936         u8 unused_4;
937         u8 valid;
938 };
939
940 /* hwrm_func_vf_free */
941 /* Input (24 bytes) */
942 struct hwrm_func_vf_free_input {
943         __le16 req_type;
944         __le16 cmpl_ring;
945         __le16 seq_id;
946         __le16 target_id;
947         __le64 resp_addr;
948         __le32 enables;
949         #define FUNC_VF_FREE_REQ_ENABLES_FIRST_VF_ID                0x1UL
950         __le16 first_vf_id;
951         __le16 num_vfs;
952 };
953
954 /* Output (16 bytes) */
955 struct hwrm_func_vf_free_output {
956         __le16 error_code;
957         __le16 req_type;
958         __le16 seq_id;
959         __le16 resp_len;
960         __le32 unused_0;
961         u8 unused_1;
962         u8 unused_2;
963         u8 unused_3;
964         u8 valid;
965 };
966
967 /* hwrm_func_vf_cfg */
968 /* Input (32 bytes) */
969 struct hwrm_func_vf_cfg_input {
970         __le16 req_type;
971         __le16 cmpl_ring;
972         __le16 seq_id;
973         __le16 target_id;
974         __le64 resp_addr;
975         __le32 enables;
976         #define FUNC_VF_CFG_REQ_ENABLES_MTU                         0x1UL
977         #define FUNC_VF_CFG_REQ_ENABLES_GUEST_VLAN                  0x2UL
978         #define FUNC_VF_CFG_REQ_ENABLES_ASYNC_EVENT_CR              0x4UL
979         #define FUNC_VF_CFG_REQ_ENABLES_DFLT_MAC_ADDR               0x8UL
980         __le16 mtu;
981         __le16 guest_vlan;
982         __le16 async_event_cr;
983         u8 dflt_mac_addr[6];
984 };
985
986 /* Output (16 bytes) */
987 struct hwrm_func_vf_cfg_output {
988         __le16 error_code;
989         __le16 req_type;
990         __le16 seq_id;
991         __le16 resp_len;
992         __le32 unused_0;
993         u8 unused_1;
994         u8 unused_2;
995         u8 unused_3;
996         u8 valid;
997 };
998
999 /* hwrm_func_qcaps */
1000 /* Input (24 bytes) */
1001 struct hwrm_func_qcaps_input {
1002         __le16 req_type;
1003         __le16 cmpl_ring;
1004         __le16 seq_id;
1005         __le16 target_id;
1006         __le64 resp_addr;
1007         __le16 fid;
1008         __le16 unused_0[3];
1009 };
1010
1011 /* Output (80 bytes) */
1012 struct hwrm_func_qcaps_output {
1013         __le16 error_code;
1014         __le16 req_type;
1015         __le16 seq_id;
1016         __le16 resp_len;
1017         __le16 fid;
1018         __le16 port_id;
1019         __le32 flags;
1020         #define FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED           0x1UL
1021         #define FUNC_QCAPS_RESP_FLAGS_GLOBAL_MSIX_AUTOMASKING      0x2UL
1022         #define FUNC_QCAPS_RESP_FLAGS_PTP_SUPPORTED                 0x4UL
1023         u8 mac_address[6];
1024         __le16 max_rsscos_ctx;
1025         __le16 max_cmpl_rings;
1026         __le16 max_tx_rings;
1027         __le16 max_rx_rings;
1028         __le16 max_l2_ctxs;
1029         __le16 max_vnics;
1030         __le16 first_vf_id;
1031         __le16 max_vfs;
1032         __le16 max_stat_ctx;
1033         __le32 max_encap_records;
1034         __le32 max_decap_records;
1035         __le32 max_tx_em_flows;
1036         __le32 max_tx_wm_flows;
1037         __le32 max_rx_em_flows;
1038         __le32 max_rx_wm_flows;
1039         __le32 max_mcast_filters;
1040         __le32 max_flow_id;
1041         __le32 max_hw_ring_grps;
1042         u8 unused_0;
1043         u8 unused_1;
1044         u8 unused_2;
1045         u8 valid;
1046 };
1047
1048 /* hwrm_func_qcfg */
1049 /* Input (24 bytes) */
1050 struct hwrm_func_qcfg_input {
1051         __le16 req_type;
1052         __le16 cmpl_ring;
1053         __le16 seq_id;
1054         __le16 target_id;
1055         __le64 resp_addr;
1056         __le16 fid;
1057         __le16 unused_0[3];
1058 };
1059
1060 /* Output (72 bytes) */
1061 struct hwrm_func_qcfg_output {
1062         __le16 error_code;
1063         __le16 req_type;
1064         __le16 seq_id;
1065         __le16 resp_len;
1066         __le16 fid;
1067         __le16 port_id;
1068         __le16 vlan;
1069         u8 unused_0;
1070         u8 unused_1;
1071         u8 mac_address[6];
1072         __le16 pci_id;
1073         __le16 alloc_rsscos_ctx;
1074         __le16 alloc_cmpl_rings;
1075         __le16 alloc_tx_rings;
1076         __le16 alloc_rx_rings;
1077         __le16 alloc_l2_ctx;
1078         __le16 alloc_vnics;
1079         __le16 mtu;
1080         __le16 mru;
1081         __le16 stat_ctx_id;
1082         u8 port_partition_type;
1083         #define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_SPF             (0x0UL << 0)
1084         #define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_MPFS    (0x1UL << 0)
1085         #define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0         (0x2UL << 0)
1086         #define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_5         (0x3UL << 0)
1087         #define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR2_0         (0x4UL << 0)
1088         #define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_UNKNOWN         (0xffUL << 0)
1089         u8 unused_2;
1090         __le16 dflt_vnic_id;
1091         u8 unused_3;
1092         u8 unused_4;
1093         __le32 min_bw;
1094         __le32 max_bw;
1095         u8 evb_mode;
1096         #define FUNC_QCFG_RESP_EVB_MODE_NO_EVB                     (0x0UL << 0)
1097         #define FUNC_QCFG_RESP_EVB_MODE_VEB                        (0x1UL << 0)
1098         #define FUNC_QCFG_RESP_EVB_MODE_VEPA                       (0x2UL << 0)
1099         u8 unused_5;
1100         __le16 unused_6;
1101         __le32 alloc_mcast_filters;
1102         __le32 alloc_hw_ring_grps;
1103         u8 unused_7;
1104         u8 unused_8;
1105         u8 unused_9;
1106         u8 valid;
1107 };
1108
1109 /* hwrm_func_cfg */
1110 /* Input (88 bytes) */
1111 struct hwrm_func_cfg_input {
1112         __le16 req_type;
1113         __le16 cmpl_ring;
1114         __le16 seq_id;
1115         __le16 target_id;
1116         __le64 resp_addr;
1117         __le16 fid;
1118         u8 unused_0;
1119         u8 unused_1;
1120         __le32 flags;
1121         #define FUNC_CFG_REQ_FLAGS_PROM_MODE                        0x1UL
1122         #define FUNC_CFG_REQ_FLAGS_SRC_MAC_ADDR_CHECK               0x2UL
1123         #define FUNC_CFG_REQ_FLAGS_SRC_IP_ADDR_CHECK                0x4UL
1124         #define FUNC_CFG_REQ_FLAGS_VLAN_PRI_MATCH                   0x8UL
1125         #define FUNC_CFG_REQ_FLAGS_DFLT_PRI_NOMATCH                 0x10UL
1126         #define FUNC_CFG_REQ_FLAGS_DISABLE_PAUSE                    0x20UL
1127         #define FUNC_CFG_REQ_FLAGS_DISABLE_STP                      0x40UL
1128         #define FUNC_CFG_REQ_FLAGS_DISABLE_LLDP             0x80UL
1129         #define FUNC_CFG_REQ_FLAGS_DISABLE_PTPV2                    0x100UL
1130         __le32 enables;
1131         #define FUNC_CFG_REQ_ENABLES_MTU                            0x1UL
1132         #define FUNC_CFG_REQ_ENABLES_MRU                            0x2UL
1133         #define FUNC_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS                0x4UL
1134         #define FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS                 0x8UL
1135         #define FUNC_CFG_REQ_ENABLES_NUM_TX_RINGS                   0x10UL
1136         #define FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS                   0x20UL
1137         #define FUNC_CFG_REQ_ENABLES_NUM_L2_CTXS                    0x40UL
1138         #define FUNC_CFG_REQ_ENABLES_NUM_VNICS                      0x80UL
1139         #define FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS                  0x100UL
1140         #define FUNC_CFG_REQ_ENABLES_DFLT_MAC_ADDR                  0x200UL
1141         #define FUNC_CFG_REQ_ENABLES_DFLT_VLAN                      0x400UL
1142         #define FUNC_CFG_REQ_ENABLES_DFLT_IP_ADDR                   0x800UL
1143         #define FUNC_CFG_REQ_ENABLES_MIN_BW                         0x1000UL
1144         #define FUNC_CFG_REQ_ENABLES_MAX_BW                         0x2000UL
1145         #define FUNC_CFG_REQ_ENABLES_ASYNC_EVENT_CR                 0x4000UL
1146         #define FUNC_CFG_REQ_ENABLES_VLAN_ANTISPOOF_MODE            0x8000UL
1147         #define FUNC_CFG_REQ_ENABLES_ALLOWED_VLAN_PRIS              0x10000UL
1148         #define FUNC_CFG_REQ_ENABLES_EVB_MODE                       0x20000UL
1149         #define FUNC_CFG_REQ_ENABLES_NUM_MCAST_FILTERS              0x40000UL
1150         #define FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS               0x80000UL
1151         __le16 mtu;
1152         __le16 mru;
1153         __le16 num_rsscos_ctxs;
1154         __le16 num_cmpl_rings;
1155         __le16 num_tx_rings;
1156         __le16 num_rx_rings;
1157         __le16 num_l2_ctxs;
1158         __le16 num_vnics;
1159         __le16 num_stat_ctxs;
1160         __le16 num_hw_ring_grps;
1161         u8 dflt_mac_addr[6];
1162         __le16 dflt_vlan;
1163         __be32 dflt_ip_addr[4];
1164         __le32 min_bw;
1165         __le32 max_bw;
1166         __le16 async_event_cr;
1167         u8 vlan_antispoof_mode;
1168         #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_NOCHECK           (0x0UL << 0)
1169         #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_VALIDATE_VLAN    (0x1UL << 0)
1170         #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_INSERT_IF_VLANDNE (0x2UL << 0)
1171         #define FUNC_CFG_REQ_VLAN_ANTISPOOF_MODE_INSERT_OR_OVERRIDE_VLAN (0x3UL << 0)
1172         u8 allowed_vlan_pris;
1173         u8 evb_mode;
1174         #define FUNC_CFG_REQ_EVB_MODE_NO_EVB                       (0x0UL << 0)
1175         #define FUNC_CFG_REQ_EVB_MODE_VEB                          (0x1UL << 0)
1176         #define FUNC_CFG_REQ_EVB_MODE_VEPA                         (0x2UL << 0)
1177         u8 unused_2;
1178         __le16 num_mcast_filters;
1179 };
1180
1181 /* Output (16 bytes) */
1182 struct hwrm_func_cfg_output {
1183         __le16 error_code;
1184         __le16 req_type;
1185         __le16 seq_id;
1186         __le16 resp_len;
1187         __le32 unused_0;
1188         u8 unused_1;
1189         u8 unused_2;
1190         u8 unused_3;
1191         u8 valid;
1192 };
1193
1194 /* hwrm_func_qstats */
1195 /* Input (24 bytes) */
1196 struct hwrm_func_qstats_input {
1197         __le16 req_type;
1198         __le16 cmpl_ring;
1199         __le16 seq_id;
1200         __le16 target_id;
1201         __le64 resp_addr;
1202         __le16 fid;
1203         __le16 unused_0[3];
1204 };
1205
1206 /* Output (176 bytes) */
1207 struct hwrm_func_qstats_output {
1208         __le16 error_code;
1209         __le16 req_type;
1210         __le16 seq_id;
1211         __le16 resp_len;
1212         __le64 tx_ucast_pkts;
1213         __le64 tx_mcast_pkts;
1214         __le64 tx_bcast_pkts;
1215         __le64 tx_err_pkts;
1216         __le64 tx_drop_pkts;
1217         __le64 tx_ucast_bytes;
1218         __le64 tx_mcast_bytes;
1219         __le64 tx_bcast_bytes;
1220         __le64 rx_ucast_pkts;
1221         __le64 rx_mcast_pkts;
1222         __le64 rx_bcast_pkts;
1223         __le64 rx_err_pkts;
1224         __le64 rx_drop_pkts;
1225         __le64 rx_ucast_bytes;
1226         __le64 rx_mcast_bytes;
1227         __le64 rx_bcast_bytes;
1228         __le64 rx_agg_pkts;
1229         __le64 rx_agg_bytes;
1230         __le64 rx_agg_events;
1231         __le64 rx_agg_aborts;
1232         __le32 unused_0;
1233         u8 unused_1;
1234         u8 unused_2;
1235         u8 unused_3;
1236         u8 valid;
1237 };
1238
1239 /* hwrm_func_clr_stats */
1240 /* Input (24 bytes) */
1241 struct hwrm_func_clr_stats_input {
1242         __le16 req_type;
1243         __le16 cmpl_ring;
1244         __le16 seq_id;
1245         __le16 target_id;
1246         __le64 resp_addr;
1247         __le16 fid;
1248         __le16 unused_0[3];
1249 };
1250
1251 /* Output (16 bytes) */
1252 struct hwrm_func_clr_stats_output {
1253         __le16 error_code;
1254         __le16 req_type;
1255         __le16 seq_id;
1256         __le16 resp_len;
1257         __le32 unused_0;
1258         u8 unused_1;
1259         u8 unused_2;
1260         u8 unused_3;
1261         u8 valid;
1262 };
1263
1264 /* hwrm_func_vf_resc_free */
1265 /* Input (24 bytes) */
1266 struct hwrm_func_vf_resc_free_input {
1267         __le16 req_type;
1268         __le16 cmpl_ring;
1269         __le16 seq_id;
1270         __le16 target_id;
1271         __le64 resp_addr;
1272         __le16 vf_id;
1273         __le16 unused_0[3];
1274 };
1275
1276 /* Output (16 bytes) */
1277 struct hwrm_func_vf_resc_free_output {
1278         __le16 error_code;
1279         __le16 req_type;
1280         __le16 seq_id;
1281         __le16 resp_len;
1282         __le32 unused_0;
1283         u8 unused_1;
1284         u8 unused_2;
1285         u8 unused_3;
1286         u8 valid;
1287 };
1288
1289 /* hwrm_func_vf_vnic_ids_query */
1290 /* Input (32 bytes) */
1291 struct hwrm_func_vf_vnic_ids_query_input {
1292         __le16 req_type;
1293         __le16 cmpl_ring;
1294         __le16 seq_id;
1295         __le16 target_id;
1296         __le64 resp_addr;
1297         __le16 vf_id;
1298         u8 unused_0;
1299         u8 unused_1;
1300         __le32 max_vnic_id_cnt;
1301         __le64 vnic_id_tbl_addr;
1302 };
1303
1304 /* Output (16 bytes) */
1305 struct hwrm_func_vf_vnic_ids_query_output {
1306         __le16 error_code;
1307         __le16 req_type;
1308         __le16 seq_id;
1309         __le16 resp_len;
1310         __le32 vnic_id_cnt;
1311         u8 unused_0;
1312         u8 unused_1;
1313         u8 unused_2;
1314         u8 valid;
1315 };
1316
1317 /* hwrm_func_drv_rgtr */
1318 /* Input (80 bytes) */
1319 struct hwrm_func_drv_rgtr_input {
1320         __le16 req_type;
1321         __le16 cmpl_ring;
1322         __le16 seq_id;
1323         __le16 target_id;
1324         __le64 resp_addr;
1325         __le32 flags;
1326         #define FUNC_DRV_RGTR_REQ_FLAGS_FWD_ALL_MODE                0x1UL
1327         #define FUNC_DRV_RGTR_REQ_FLAGS_FWD_NONE_MODE               0x2UL
1328         __le32 enables;
1329         #define FUNC_DRV_RGTR_REQ_ENABLES_OS_TYPE                   0x1UL
1330         #define FUNC_DRV_RGTR_REQ_ENABLES_VER                       0x2UL
1331         #define FUNC_DRV_RGTR_REQ_ENABLES_TIMESTAMP                 0x4UL
1332         #define FUNC_DRV_RGTR_REQ_ENABLES_VF_REQ_FWD                0x8UL
1333         #define FUNC_DRV_RGTR_REQ_ENABLES_ASYNC_EVENT_FWD           0x10UL
1334         __le16 os_type;
1335         #define FUNC_DRV_RGTR_REQ_OS_TYPE_UNKNOWN                  (0x0UL << 0)
1336         #define FUNC_DRV_RGTR_REQ_OS_TYPE_OTHER            (0x1UL << 0)
1337         #define FUNC_DRV_RGTR_REQ_OS_TYPE_MSDOS            (0xeUL << 0)
1338         #define FUNC_DRV_RGTR_REQ_OS_TYPE_WINDOWS                  (0x12UL << 0)
1339         #define FUNC_DRV_RGTR_REQ_OS_TYPE_SOLARIS                  (0x1dUL << 0)
1340         #define FUNC_DRV_RGTR_REQ_OS_TYPE_LINUX            (0x24UL << 0)
1341         #define FUNC_DRV_RGTR_REQ_OS_TYPE_FREEBSD                  (0x2aUL << 0)
1342         #define FUNC_DRV_RGTR_REQ_OS_TYPE_ESXI                     (0x68UL << 0)
1343         #define FUNC_DRV_RGTR_REQ_OS_TYPE_WIN864                   (0x73UL << 0)
1344         #define FUNC_DRV_RGTR_REQ_OS_TYPE_WIN2012R2                (0x74UL << 0)
1345         u8 ver_maj;
1346         u8 ver_min;
1347         u8 ver_upd;
1348         u8 unused_0;
1349         __le16 unused_1;
1350         __le32 timestamp;
1351         __le32 unused_2;
1352         __le32 vf_req_fwd[8];
1353         __le32 async_event_fwd[8];
1354 };
1355
1356 /* Output (16 bytes) */
1357 struct hwrm_func_drv_rgtr_output {
1358         __le16 error_code;
1359         __le16 req_type;
1360         __le16 seq_id;
1361         __le16 resp_len;
1362         __le32 unused_0;
1363         u8 unused_1;
1364         u8 unused_2;
1365         u8 unused_3;
1366         u8 valid;
1367 };
1368
1369 /* hwrm_func_drv_unrgtr */
1370 /* Input (24 bytes) */
1371 struct hwrm_func_drv_unrgtr_input {
1372         __le16 req_type;
1373         __le16 cmpl_ring;
1374         __le16 seq_id;
1375         __le16 target_id;
1376         __le64 resp_addr;
1377         __le32 flags;
1378         #define FUNC_DRV_UNRGTR_REQ_FLAGS_PREPARE_FOR_SHUTDOWN     0x1UL
1379         __le32 unused_0;
1380 };
1381
1382 /* Output (16 bytes) */
1383 struct hwrm_func_drv_unrgtr_output {
1384         __le16 error_code;
1385         __le16 req_type;
1386         __le16 seq_id;
1387         __le16 resp_len;
1388         __le32 unused_0;
1389         u8 unused_1;
1390         u8 unused_2;
1391         u8 unused_3;
1392         u8 valid;
1393 };
1394
1395 /* hwrm_func_buf_rgtr */
1396 /* Input (128 bytes) */
1397 struct hwrm_func_buf_rgtr_input {
1398         __le16 req_type;
1399         __le16 cmpl_ring;
1400         __le16 seq_id;
1401         __le16 target_id;
1402         __le64 resp_addr;
1403         __le32 enables;
1404         #define FUNC_BUF_RGTR_REQ_ENABLES_VF_ID             0x1UL
1405         #define FUNC_BUF_RGTR_REQ_ENABLES_ERR_BUF_ADDR              0x2UL
1406         __le16 vf_id;
1407         __le16 req_buf_num_pages;
1408         __le16 req_buf_page_size;
1409         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_16B    (0x4UL << 0)
1410         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_4K             (0xcUL << 0)
1411         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_8K             (0xdUL << 0)
1412         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_64K    (0x10UL << 0)
1413         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_2M             (0x16UL << 0)
1414         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_4M             (0x17UL << 0)
1415         #define FUNC_BUF_RGTR_REQ_REQ_BUF_PAGE_SIZE_1G             (0x1eUL << 0)
1416         __le16 req_buf_len;
1417         __le16 resp_buf_len;
1418         u8 unused_0;
1419         u8 unused_1;
1420         __le64 req_buf_page_addr0;
1421         __le64 req_buf_page_addr1;
1422         __le64 req_buf_page_addr2;
1423         __le64 req_buf_page_addr3;
1424         __le64 req_buf_page_addr4;
1425         __le64 req_buf_page_addr5;
1426         __le64 req_buf_page_addr6;
1427         __le64 req_buf_page_addr7;
1428         __le64 req_buf_page_addr8;
1429         __le64 req_buf_page_addr9;
1430         __le64 error_buf_addr;
1431         __le64 resp_buf_addr;
1432 };
1433
1434 /* Output (16 bytes) */
1435 struct hwrm_func_buf_rgtr_output {
1436         __le16 error_code;
1437         __le16 req_type;
1438         __le16 seq_id;
1439         __le16 resp_len;
1440         __le32 unused_0;
1441         u8 unused_1;
1442         u8 unused_2;
1443         u8 unused_3;
1444         u8 valid;
1445 };
1446
1447 /* hwrm_func_drv_qver */
1448 /* Input (24 bytes) */
1449 struct hwrm_func_drv_qver_input {
1450         __le16 req_type;
1451         __le16 cmpl_ring;
1452         __le16 seq_id;
1453         __le16 target_id;
1454         __le64 resp_addr;
1455         __le32 reserved;
1456         __le16 fid;
1457         __le16 unused_0;
1458 };
1459
1460 /* Output (16 bytes) */
1461 struct hwrm_func_drv_qver_output {
1462         __le16 error_code;
1463         __le16 req_type;
1464         __le16 seq_id;
1465         __le16 resp_len;
1466         __le16 os_type;
1467         #define FUNC_DRV_QVER_RESP_OS_TYPE_UNKNOWN                 (0x0UL << 0)
1468         #define FUNC_DRV_QVER_RESP_OS_TYPE_OTHER                   (0x1UL << 0)
1469         #define FUNC_DRV_QVER_RESP_OS_TYPE_MSDOS                   (0xeUL << 0)
1470         #define FUNC_DRV_QVER_RESP_OS_TYPE_WINDOWS                 (0x12UL << 0)
1471         #define FUNC_DRV_QVER_RESP_OS_TYPE_SOLARIS                 (0x1dUL << 0)
1472         #define FUNC_DRV_QVER_RESP_OS_TYPE_LINUX                   (0x24UL << 0)
1473         #define FUNC_DRV_QVER_RESP_OS_TYPE_FREEBSD                 (0x2aUL << 0)
1474         #define FUNC_DRV_QVER_RESP_OS_TYPE_ESXI            (0x68UL << 0)
1475         #define FUNC_DRV_QVER_RESP_OS_TYPE_WIN864                  (0x73UL << 0)
1476         #define FUNC_DRV_QVER_RESP_OS_TYPE_WIN2012R2               (0x74UL << 0)
1477         u8 ver_maj;
1478         u8 ver_min;
1479         u8 ver_upd;
1480         u8 unused_0;
1481         u8 unused_1;
1482         u8 valid;
1483 };
1484
1485 /* hwrm_port_phy_cfg */
1486 /* Input (56 bytes) */
1487 struct hwrm_port_phy_cfg_input {
1488         __le16 req_type;
1489         __le16 cmpl_ring;
1490         __le16 seq_id;
1491         __le16 target_id;
1492         __le64 resp_addr;
1493         __le32 flags;
1494         #define PORT_PHY_CFG_REQ_FLAGS_RESET_PHY                    0x1UL
1495         #define PORT_PHY_CFG_REQ_FLAGS_FORCE_LINK_DOWN              0x2UL
1496         #define PORT_PHY_CFG_REQ_FLAGS_FORCE                        0x4UL
1497         #define PORT_PHY_CFG_REQ_FLAGS_RESTART_AUTONEG              0x8UL
1498         #define PORT_PHY_CFG_REQ_FLAGS_EEE_ENABLE                   0x10UL
1499         #define PORT_PHY_CFG_REQ_FLAGS_EEE_DISABLE                  0x20UL
1500         #define PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_ENABLE            0x40UL
1501         #define PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_DISABLE           0x80UL
1502         __le32 enables;
1503         #define PORT_PHY_CFG_REQ_ENABLES_AUTO_MODE                  0x1UL
1504         #define PORT_PHY_CFG_REQ_ENABLES_AUTO_DUPLEX                0x2UL
1505         #define PORT_PHY_CFG_REQ_ENABLES_AUTO_PAUSE                 0x4UL
1506         #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED            0x8UL
1507         #define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK      0x10UL
1508         #define PORT_PHY_CFG_REQ_ENABLES_WIRESPEED                  0x20UL
1509         #define PORT_PHY_CFG_REQ_ENABLES_LPBK                       0x40UL
1510         #define PORT_PHY_CFG_REQ_ENABLES_PREEMPHASIS                0x80UL
1511         #define PORT_PHY_CFG_REQ_ENABLES_FORCE_PAUSE                0x100UL
1512         #define PORT_PHY_CFG_REQ_ENABLES_EEE_LINK_SPEED_MASK       0x200UL
1513         #define PORT_PHY_CFG_REQ_ENABLES_TX_LPI_TIMER               0x400UL
1514         __le16 port_id;
1515         __le16 force_link_speed;
1516         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_100MB    (0x1UL << 0)
1517         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_1GB              (0xaUL << 0)
1518         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_2GB              (0x14UL << 0)
1519         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_2_5GB    (0x19UL << 0)
1520         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_10GB             (0x64UL << 0)
1521         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_20GB             (0xc8UL << 0)
1522         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_25GB             (0xfaUL << 0)
1523         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_40GB             (0x190UL << 0)
1524         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_50GB             (0x1f4UL << 0)
1525         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_100GB    (0x3e8UL << 0)
1526         #define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_10MB             (0xffffUL << 0)
1527         u8 auto_mode;
1528         #define PORT_PHY_CFG_REQ_AUTO_MODE_NONE            (0x0UL << 0)
1529         #define PORT_PHY_CFG_REQ_AUTO_MODE_ALL_SPEEDS              (0x1UL << 0)
1530         #define PORT_PHY_CFG_REQ_AUTO_MODE_ONE_SPEED               (0x2UL << 0)
1531         #define PORT_PHY_CFG_REQ_AUTO_MODE_ONE_OR_BELOW    (0x3UL << 0)
1532         #define PORT_PHY_CFG_REQ_AUTO_MODE_SPEED_MASK              (0x4UL << 0)
1533         u8 auto_duplex;
1534         #define PORT_PHY_CFG_REQ_AUTO_DUPLEX_HALF                  (0x0UL << 0)
1535         #define PORT_PHY_CFG_REQ_AUTO_DUPLEX_FULL                  (0x1UL << 0)
1536         #define PORT_PHY_CFG_REQ_AUTO_DUPLEX_BOTH                  (0x2UL << 0)
1537         u8 auto_pause;
1538         #define PORT_PHY_CFG_REQ_AUTO_PAUSE_TX                      0x1UL
1539         #define PORT_PHY_CFG_REQ_AUTO_PAUSE_RX                      0x2UL
1540         #define PORT_PHY_CFG_REQ_AUTO_PAUSE_AUTONEG_PAUSE           0x4UL
1541         u8 unused_0;
1542         __le16 auto_link_speed;
1543         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_100MB             (0x1UL << 0)
1544         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_1GB               (0xaUL << 0)
1545         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_2GB               (0x14UL << 0)
1546         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_2_5GB             (0x19UL << 0)
1547         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_10GB              (0x64UL << 0)
1548         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_20GB              (0xc8UL << 0)
1549         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_25GB              (0xfaUL << 0)
1550         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_40GB              (0x190UL << 0)
1551         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_50GB              (0x1f4UL << 0)
1552         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_100GB             (0x3e8UL << 0)
1553         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_10MB              (0xffffUL << 0)
1554         __le16 auto_link_speed_mask;
1555         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_100MBHD      0x1UL
1556         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_100MB         0x2UL
1557         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_1GBHD         0x4UL
1558         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_1GB           0x8UL
1559         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_2GB           0x10UL
1560         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_2_5GB         0x20UL
1561         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_10GB          0x40UL
1562         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_20GB          0x80UL
1563         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_25GB          0x100UL
1564         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_40GB          0x200UL
1565         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_50GB          0x400UL
1566         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_100GB         0x800UL
1567         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_10MBHD       0x1000UL
1568         #define PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_MASK_10MB          0x2000UL
1569         u8 wirespeed;
1570         #define PORT_PHY_CFG_REQ_WIRESPEED_OFF                     (0x0UL << 0)
1571         #define PORT_PHY_CFG_REQ_WIRESPEED_ON                      (0x1UL << 0)
1572         u8 lpbk;
1573         #define PORT_PHY_CFG_REQ_LPBK_NONE                         (0x0UL << 0)
1574         #define PORT_PHY_CFG_REQ_LPBK_LOCAL                        (0x1UL << 0)
1575         #define PORT_PHY_CFG_REQ_LPBK_REMOTE                       (0x2UL << 0)
1576         u8 force_pause;
1577         #define PORT_PHY_CFG_REQ_FORCE_PAUSE_TX             0x1UL
1578         #define PORT_PHY_CFG_REQ_FORCE_PAUSE_RX             0x2UL
1579         u8 unused_1;
1580         __le32 preemphasis;
1581         __le16 eee_link_speed_mask;
1582         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_RSVD1          0x1UL
1583         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_100MB          0x2UL
1584         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_RSVD2          0x4UL
1585         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_1GB            0x8UL
1586         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_RSVD3          0x10UL
1587         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_RSVD4          0x20UL
1588         #define PORT_PHY_CFG_REQ_EEE_LINK_SPEED_MASK_10GB           0x40UL
1589         u8 unused_2;
1590         u8 unused_3;
1591         __le32 tx_lpi_timer;
1592         __le32 unused_4;
1593         #define PORT_PHY_CFG_REQ_TX_LPI_TIMER_MASK                  0xffffffUL
1594         #define PORT_PHY_CFG_REQ_TX_LPI_TIMER_SFT                   0
1595 };
1596
1597 /* Output (16 bytes) */
1598 struct hwrm_port_phy_cfg_output {
1599         __le16 error_code;
1600         __le16 req_type;
1601         __le16 seq_id;
1602         __le16 resp_len;
1603         __le32 unused_0;
1604         u8 unused_1;
1605         u8 unused_2;
1606         u8 unused_3;
1607         u8 valid;
1608 };
1609
1610 /* hwrm_port_phy_qcfg */
1611 /* Input (24 bytes) */
1612 struct hwrm_port_phy_qcfg_input {
1613         __le16 req_type;
1614         __le16 cmpl_ring;
1615         __le16 seq_id;
1616         __le16 target_id;
1617         __le64 resp_addr;
1618         __le16 port_id;
1619         __le16 unused_0[3];
1620 };
1621
1622 /* Output (96 bytes) */
1623 struct hwrm_port_phy_qcfg_output {
1624         __le16 error_code;
1625         __le16 req_type;
1626         __le16 seq_id;
1627         __le16 resp_len;
1628         u8 link;
1629         #define PORT_PHY_QCFG_RESP_LINK_NO_LINK            (0x0UL << 0)
1630         #define PORT_PHY_QCFG_RESP_LINK_SIGNAL                     (0x1UL << 0)
1631         #define PORT_PHY_QCFG_RESP_LINK_LINK                       (0x2UL << 0)
1632         u8 unused_0;
1633         __le16 link_speed;
1634         #define PORT_PHY_QCFG_RESP_LINK_SPEED_100MB                (0x1UL << 0)
1635         #define PORT_PHY_QCFG_RESP_LINK_SPEED_1GB                  (0xaUL << 0)
1636         #define PORT_PHY_QCFG_RESP_LINK_SPEED_2GB                  (0x14UL << 0)
1637         #define PORT_PHY_QCFG_RESP_LINK_SPEED_2_5GB                (0x19UL << 0)
1638         #define PORT_PHY_QCFG_RESP_LINK_SPEED_10GB                 (0x64UL << 0)
1639         #define PORT_PHY_QCFG_RESP_LINK_SPEED_20GB                 (0xc8UL << 0)
1640         #define PORT_PHY_QCFG_RESP_LINK_SPEED_25GB                 (0xfaUL << 0)
1641         #define PORT_PHY_QCFG_RESP_LINK_SPEED_40GB                 (0x190UL << 0)
1642         #define PORT_PHY_QCFG_RESP_LINK_SPEED_50GB                 (0x1f4UL << 0)
1643         #define PORT_PHY_QCFG_RESP_LINK_SPEED_100GB                (0x3e8UL << 0)
1644         #define PORT_PHY_QCFG_RESP_LINK_SPEED_10MB                 (0xffffUL << 0)
1645         u8 duplex;
1646         #define PORT_PHY_QCFG_RESP_DUPLEX_HALF                     (0x0UL << 0)
1647         #define PORT_PHY_QCFG_RESP_DUPLEX_FULL                     (0x1UL << 0)
1648         u8 pause;
1649         #define PORT_PHY_QCFG_RESP_PAUSE_TX                         0x1UL
1650         #define PORT_PHY_QCFG_RESP_PAUSE_RX                         0x2UL
1651         __le16 support_speeds;
1652         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100MBHD           0x1UL
1653         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100MB     0x2UL
1654         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_1GBHD     0x4UL
1655         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_1GB               0x8UL
1656         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_2GB               0x10UL
1657         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_2_5GB     0x20UL
1658         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_10GB              0x40UL
1659         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_20GB              0x80UL
1660         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_25GB              0x100UL
1661         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_40GB              0x200UL
1662         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_50GB              0x400UL
1663         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100GB     0x800UL
1664         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_10MBHD            0x1000UL
1665         #define PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_10MB              0x2000UL
1666         __le16 force_link_speed;
1667         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_100MB          (0x1UL << 0)
1668         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_1GB    (0xaUL << 0)
1669         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_2GB    (0x14UL << 0)
1670         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_2_5GB          (0x19UL << 0)
1671         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_10GB           (0x64UL << 0)
1672         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_20GB           (0xc8UL << 0)
1673         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_25GB           (0xfaUL << 0)
1674         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_40GB           (0x190UL << 0)
1675         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_50GB           (0x1f4UL << 0)
1676         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_100GB          (0x3e8UL << 0)
1677         #define PORT_PHY_QCFG_RESP_FORCE_LINK_SPEED_10MB           (0xffffUL << 0)
1678         u8 auto_mode;
1679         #define PORT_PHY_QCFG_RESP_AUTO_MODE_NONE                  (0x0UL << 0)
1680         #define PORT_PHY_QCFG_RESP_AUTO_MODE_ALL_SPEEDS    (0x1UL << 0)
1681         #define PORT_PHY_QCFG_RESP_AUTO_MODE_ONE_SPEED             (0x2UL << 0)
1682         #define PORT_PHY_QCFG_RESP_AUTO_MODE_ONE_OR_BELOW          (0x3UL << 0)
1683         #define PORT_PHY_QCFG_RESP_AUTO_MODE_SPEED_MASK    (0x4UL << 0)
1684         u8 auto_pause;
1685         #define PORT_PHY_QCFG_RESP_AUTO_PAUSE_TX                    0x1UL
1686         #define PORT_PHY_QCFG_RESP_AUTO_PAUSE_RX                    0x2UL
1687         #define PORT_PHY_QCFG_RESP_AUTO_PAUSE_AUTONEG_PAUSE         0x4UL
1688         __le16 auto_link_speed;
1689         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_100MB           (0x1UL << 0)
1690         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_1GB             (0xaUL << 0)
1691         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_2GB             (0x14UL << 0)
1692         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_2_5GB           (0x19UL << 0)
1693         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_10GB    (0x64UL << 0)
1694         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_20GB    (0xc8UL << 0)
1695         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_25GB    (0xfaUL << 0)
1696         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_40GB    (0x190UL << 0)
1697         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_50GB    (0x1f4UL << 0)
1698         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_100GB           (0x3e8UL << 0)
1699         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_10MB    (0xffffUL << 0)
1700         __le16 auto_link_speed_mask;
1701         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_100MBHD    0x1UL
1702         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_100MB      0x2UL
1703         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_1GBHD      0x4UL
1704         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_1GB         0x8UL
1705         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_2GB         0x10UL
1706         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_2_5GB      0x20UL
1707         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_10GB       0x40UL
1708         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_20GB       0x80UL
1709         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_25GB       0x100UL
1710         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_40GB       0x200UL
1711         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_50GB       0x400UL
1712         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_100GB      0x800UL
1713         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_10MBHD     0x1000UL
1714         #define PORT_PHY_QCFG_RESP_AUTO_LINK_SPEED_MASK_10MB       0x2000UL
1715         u8 wirespeed;
1716         #define PORT_PHY_QCFG_RESP_WIRESPEED_OFF                   (0x0UL << 0)
1717         #define PORT_PHY_QCFG_RESP_WIRESPEED_ON            (0x1UL << 0)
1718         u8 lpbk;
1719         #define PORT_PHY_QCFG_RESP_LPBK_NONE                       (0x0UL << 0)
1720         #define PORT_PHY_QCFG_RESP_LPBK_LOCAL                      (0x1UL << 0)
1721         #define PORT_PHY_QCFG_RESP_LPBK_REMOTE                     (0x2UL << 0)
1722         u8 force_pause;
1723         #define PORT_PHY_QCFG_RESP_FORCE_PAUSE_TX                   0x1UL
1724         #define PORT_PHY_QCFG_RESP_FORCE_PAUSE_RX                   0x2UL
1725         u8 module_status;
1726         #define PORT_PHY_QCFG_RESP_MODULE_STATUS_NONE              (0x0UL << 0)
1727         #define PORT_PHY_QCFG_RESP_MODULE_STATUS_DISABLETX         (0x1UL << 0)
1728         #define PORT_PHY_QCFG_RESP_MODULE_STATUS_WARNINGMSG       (0x2UL << 0)
1729         #define PORT_PHY_QCFG_RESP_MODULE_STATUS_PWRDOWN           (0x3UL << 0)
1730         #define PORT_PHY_QCFG_RESP_MODULE_STATUS_NOTINSERTED      (0x4UL << 0)
1731         #define PORT_PHY_QCFG_RESP_MODULE_STATUS_NOTAPPLICABLE    (0xffUL << 0)
1732         __le32 preemphasis;
1733         u8 phy_maj;
1734         u8 phy_min;
1735         u8 phy_bld;
1736         u8 phy_type;
1737         #define PORT_PHY_QCFG_RESP_PHY_TYPE_UNKNOWN                (0x0UL << 0)
1738         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASECR                 (0x1UL << 0)
1739         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKR4                (0x2UL << 0)
1740         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASELR                 (0x3UL << 0)
1741         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASESR                 (0x4UL << 0)
1742         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKR2                (0x5UL << 0)
1743         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKX                 (0x6UL << 0)
1744         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASEKR                 (0x7UL << 0)
1745         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASET                  (0x8UL << 0)
1746         #define PORT_PHY_QCFG_RESP_PHY_TYPE_BASETE                 (0x9UL << 0)
1747         #define PORT_PHY_QCFG_RESP_PHY_TYPE_SGMIIEXTPHY    (0xaUL << 0)
1748         u8 media_type;
1749         #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_UNKNOWN              (0x0UL << 0)
1750         #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_TP                   (0x1UL << 0)
1751         #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_DAC                  (0x2UL << 0)
1752         #define PORT_PHY_QCFG_RESP_MEDIA_TYPE_FIBRE                (0x3UL << 0)
1753         u8 xcvr_pkg_type;
1754         #define PORT_PHY_QCFG_RESP_XCVR_PKG_TYPE_XCVR_INTERNAL    (0x1UL << 0)
1755         #define PORT_PHY_QCFG_RESP_XCVR_PKG_TYPE_XCVR_EXTERNAL    (0x2UL << 0)
1756         u8 eee_config_phy_addr;
1757         #define PORT_PHY_QCFG_RESP_PHY_ADDR_MASK                    0x1fUL
1758         #define PORT_PHY_QCFG_RESP_PHY_ADDR_SFT             0
1759         #define PORT_PHY_QCFG_RESP_EEE_CONFIG_EEE_ENABLED           0x20UL
1760         #define PORT_PHY_QCFG_RESP_EEE_CONFIG_EEE_ACTIVE            0x40UL
1761         #define PORT_PHY_QCFG_RESP_EEE_CONFIG_EEE_TX_LPI            0x80UL
1762         #define PORT_PHY_QCFG_RESP_EEE_CONFIG_MASK                  0xe0UL
1763         #define PORT_PHY_QCFG_RESP_EEE_CONFIG_SFT                   5
1764         u8 parallel_detect;
1765         #define PORT_PHY_QCFG_RESP_PARALLEL_DETECT                  0x1UL
1766         #define PORT_PHY_QCFG_RESP_RESERVED_MASK                    0xfeUL
1767         #define PORT_PHY_QCFG_RESP_RESERVED_SFT             1
1768         __le16 link_partner_adv_speeds;
1769         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_100MBHD 0x1UL
1770         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_100MB   0x2UL
1771         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_1GBHD   0x4UL
1772         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_1GB     0x8UL
1773         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_2GB     0x10UL
1774         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_2_5GB   0x20UL
1775         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_10GB    0x40UL
1776         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_20GB    0x80UL
1777         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_25GB    0x100UL
1778         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_40GB    0x200UL
1779         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_50GB    0x400UL
1780         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_100GB   0x800UL
1781         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_10MBHD  0x1000UL
1782         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_SPEEDS_10MB    0x2000UL
1783         u8 link_partner_adv_auto_mode;
1784         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_NONE (0x0UL << 0)
1785         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_ALL_SPEEDS (0x1UL << 0)
1786         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_ONE_SPEED (0x2UL << 0)
1787         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_ONE_OR_BELOW (0x3UL << 0)
1788         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_AUTO_MODE_SPEED_MASK (0x4UL << 0)
1789         u8 link_partner_adv_pause;
1790         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_PAUSE_TX       0x1UL
1791         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_PAUSE_RX       0x2UL
1792         __le16 adv_eee_link_speed_mask;
1793         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_RSVD1   0x1UL
1794         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_100MB   0x2UL
1795         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_RSVD2   0x4UL
1796         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_1GB     0x8UL
1797         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_RSVD3   0x10UL
1798         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_RSVD4   0x20UL
1799         #define PORT_PHY_QCFG_RESP_ADV_EEE_LINK_SPEED_MASK_10GB    0x40UL
1800         __le16 link_partner_adv_eee_link_speed_mask;
1801         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD1 0x1UL
1802         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_100MB 0x2UL
1803         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD2 0x4UL
1804         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_1GB 0x8UL
1805         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD3 0x10UL
1806         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_RSVD4 0x20UL
1807         #define PORT_PHY_QCFG_RESP_LINK_PARTNER_ADV_EEE_LINK_SPEED_MASK_10GB 0x40UL
1808         __le32 xcvr_identifier_type_tx_lpi_timer;
1809         #define PORT_PHY_QCFG_RESP_TX_LPI_TIMER_MASK                0xffffffUL
1810         #define PORT_PHY_QCFG_RESP_TX_LPI_TIMER_SFT                 0
1811         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_MASK       0xff000000UL
1812         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_SFT         24
1813         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_UNKNOWN   (0x0UL << 24)
1814         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_SFP       (0x3UL << 24)
1815         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP      (0xcUL << 24)
1816         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFPPLUS  (0xdUL << 24)
1817         #define PORT_PHY_QCFG_RESP_XCVR_IDENTIFIER_TYPE_QSFP28    (0x11UL << 24)
1818         __le32 unused_1;
1819         char phy_vendor_name[16];
1820         char phy_vendor_partnumber[16];
1821         __le32 unused_2;
1822         u8 unused_3;
1823         u8 unused_4;
1824         u8 unused_5;
1825         u8 valid;
1826 };
1827
1828 /* hwrm_port_mac_cfg */
1829 /* Input (40 bytes) */
1830 struct hwrm_port_mac_cfg_input {
1831         __le16 req_type;
1832         __le16 cmpl_ring;
1833         __le16 seq_id;
1834         __le16 target_id;
1835         __le64 resp_addr;
1836         __le32 flags;
1837         #define PORT_MAC_CFG_REQ_FLAGS_MATCH_LINK                   0x1UL
1838         #define PORT_MAC_CFG_REQ_FLAGS_COS_ASSIGNMENT_ENABLE       0x2UL
1839         #define PORT_MAC_CFG_REQ_FLAGS_TUNNEL_PRI2COS_ENABLE       0x4UL
1840         #define PORT_MAC_CFG_REQ_FLAGS_IP_DSCP2COS_ENABLE           0x8UL
1841         #define PORT_MAC_CFG_REQ_FLAGS_PTP_RX_TS_CAPTURE_ENABLE    0x10UL
1842         #define PORT_MAC_CFG_REQ_FLAGS_PTP_RX_TS_CAPTURE_DISABLE   0x20UL
1843         #define PORT_MAC_CFG_REQ_FLAGS_PTP_TX_TS_CAPTURE_ENABLE    0x40UL
1844         #define PORT_MAC_CFG_REQ_FLAGS_PTP_TX_TS_CAPTURE_DISABLE   0x80UL
1845         __le32 enables;
1846         #define PORT_MAC_CFG_REQ_ENABLES_IPG                        0x1UL
1847         #define PORT_MAC_CFG_REQ_ENABLES_LPBK                       0x2UL
1848         #define PORT_MAC_CFG_REQ_ENABLES_IVLAN_PRI2COS_MAP_PRI     0x4UL
1849         #define PORT_MAC_CFG_REQ_ENABLES_LCOS_MAP_PRI               0x8UL
1850         #define PORT_MAC_CFG_REQ_ENABLES_TUNNEL_PRI2COS_MAP_PRI    0x10UL
1851         #define PORT_MAC_CFG_REQ_ENABLES_DSCP2COS_MAP_PRI           0x20UL
1852         #define PORT_MAC_CFG_REQ_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE 0x40UL
1853         #define PORT_MAC_CFG_REQ_ENABLES_TX_TS_CAPTURE_PTP_MSG_TYPE 0x80UL
1854         __le16 port_id;
1855         u8 ipg;
1856         u8 lpbk;
1857         #define PORT_MAC_CFG_REQ_LPBK_NONE                         (0x0UL << 0)
1858         #define PORT_MAC_CFG_REQ_LPBK_LOCAL                        (0x1UL << 0)
1859         #define PORT_MAC_CFG_REQ_LPBK_REMOTE                       (0x2UL << 0)
1860         u8 ivlan_pri2cos_map_pri;
1861         u8 lcos_map_pri;
1862         u8 tunnel_pri2cos_map_pri;
1863         u8 dscp2pri_map_pri;
1864         __le16 rx_ts_capture_ptp_msg_type;
1865         __le16 tx_ts_capture_ptp_msg_type;
1866         __le32 unused_0;
1867 };
1868
1869 /* Output (16 bytes) */
1870 struct hwrm_port_mac_cfg_output {
1871         __le16 error_code;
1872         __le16 req_type;
1873         __le16 seq_id;
1874         __le16 resp_len;
1875         __le16 mru;
1876         __le16 mtu;
1877         u8 ipg;
1878         u8 lpbk;
1879         #define PORT_MAC_CFG_RESP_LPBK_NONE                        (0x0UL << 0)
1880         #define PORT_MAC_CFG_RESP_LPBK_LOCAL                       (0x1UL << 0)
1881         #define PORT_MAC_CFG_RESP_LPBK_REMOTE                      (0x2UL << 0)
1882         u8 unused_0;
1883         u8 valid;
1884 };
1885
1886 /* hwrm_port_qstats */
1887 /* Input (40 bytes) */
1888 struct hwrm_port_qstats_input {
1889         __le16 req_type;
1890         __le16 cmpl_ring;
1891         __le16 seq_id;
1892         __le16 target_id;
1893         __le64 resp_addr;
1894         __le16 port_id;
1895         u8 unused_0;
1896         u8 unused_1;
1897         u8 unused_2[3];
1898         u8 unused_3;
1899         __le64 tx_stat_host_addr;
1900         __le64 rx_stat_host_addr;
1901 };
1902
1903 /* Output (16 bytes) */
1904 struct hwrm_port_qstats_output {
1905         __le16 error_code;
1906         __le16 req_type;
1907         __le16 seq_id;
1908         __le16 resp_len;
1909         __le16 tx_stat_size;
1910         __le16 rx_stat_size;
1911         u8 unused_0;
1912         u8 unused_1;
1913         u8 unused_2;
1914         u8 valid;
1915 };
1916
1917 /* hwrm_port_lpbk_qstats */
1918 /* Input (16 bytes) */
1919 struct hwrm_port_lpbk_qstats_input {
1920         __le16 req_type;
1921         __le16 cmpl_ring;
1922         __le16 seq_id;
1923         __le16 target_id;
1924         __le64 resp_addr;
1925 };
1926
1927 /* Output (96 bytes) */
1928 struct hwrm_port_lpbk_qstats_output {
1929         __le16 error_code;
1930         __le16 req_type;
1931         __le16 seq_id;
1932         __le16 resp_len;
1933         __le64 lpbk_ucast_frames;
1934         __le64 lpbk_mcast_frames;
1935         __le64 lpbk_bcast_frames;
1936         __le64 lpbk_ucast_bytes;
1937         __le64 lpbk_mcast_bytes;
1938         __le64 lpbk_bcast_bytes;
1939         __le64 tx_stat_discard;
1940         __le64 tx_stat_error;
1941         __le64 rx_stat_discard;
1942         __le64 rx_stat_error;
1943         __le32 unused_0;
1944         u8 unused_1;
1945         u8 unused_2;
1946         u8 unused_3;
1947         u8 valid;
1948 };
1949
1950 /* hwrm_port_clr_stats */
1951 /* Input (24 bytes) */
1952 struct hwrm_port_clr_stats_input {
1953         __le16 req_type;
1954         __le16 cmpl_ring;
1955         __le16 seq_id;
1956         __le16 target_id;
1957         __le64 resp_addr;
1958         __le16 port_id;
1959         __le16 unused_0[3];
1960 };
1961
1962 /* Output (16 bytes) */
1963 struct hwrm_port_clr_stats_output {
1964         __le16 error_code;
1965         __le16 req_type;
1966         __le16 seq_id;
1967         __le16 resp_len;
1968         __le32 unused_0;
1969         u8 unused_1;
1970         u8 unused_2;
1971         u8 unused_3;
1972         u8 valid;
1973 };
1974
1975 /* hwrm_port_lpbk_clr_stats */
1976 /* Input (16 bytes) */
1977 struct hwrm_port_lpbk_clr_stats_input {
1978         __le16 req_type;
1979         __le16 cmpl_ring;
1980         __le16 seq_id;
1981         __le16 target_id;
1982         __le64 resp_addr;
1983 };
1984
1985 /* Output (16 bytes) */
1986 struct hwrm_port_lpbk_clr_stats_output {
1987         __le16 error_code;
1988         __le16 req_type;
1989         __le16 seq_id;
1990         __le16 resp_len;
1991         __le32 unused_0;
1992         u8 unused_1;
1993         u8 unused_2;
1994         u8 unused_3;
1995         u8 valid;
1996 };
1997
1998 /* hwrm_port_blink_led */
1999 /* Input (24 bytes) */
2000 struct hwrm_port_blink_led_input {
2001         __le16 req_type;
2002         __le16 cmpl_ring;
2003         __le16 seq_id;
2004         __le16 target_id;
2005         __le64 resp_addr;
2006         __le32 num_blinks;
2007         __le32 unused_0;
2008 };
2009
2010 /* Output (16 bytes) */
2011 struct hwrm_port_blink_led_output {
2012         __le16 error_code;
2013         __le16 req_type;
2014         __le16 seq_id;
2015         __le16 resp_len;
2016         __le32 unused_0;
2017         u8 unused_1;
2018         u8 unused_2;
2019         u8 unused_3;
2020         u8 valid;
2021 };
2022
2023 /* hwrm_port_phy_qcaps */
2024 /* Input (24 bytes) */
2025 struct hwrm_port_phy_qcaps_input {
2026         __le16 req_type;
2027         __le16 cmpl_ring;
2028         __le16 seq_id;
2029         __le16 target_id;
2030         __le64 resp_addr;
2031         __le16 port_id;
2032         __le16 unused_0[3];
2033 };
2034
2035 /* Output (24 bytes) */
2036 struct hwrm_port_phy_qcaps_output {
2037         __le16 error_code;
2038         __le16 req_type;
2039         __le16 seq_id;
2040         __le16 resp_len;
2041         u8 eee_supported;
2042         #define PORT_PHY_QCAPS_RESP_EEE_SUPPORTED                   0x1UL
2043         #define PORT_PHY_QCAPS_RESP_RSVD1_MASK                      0xfeUL
2044         #define PORT_PHY_QCAPS_RESP_RSVD1_SFT                       1
2045         u8 unused_0;
2046         __le16 supported_speeds_force_mode;
2047         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_100MBHD 0x1UL
2048         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_100MB 0x2UL
2049         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_1GBHD 0x4UL
2050         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_1GB 0x8UL
2051         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_2GB 0x10UL
2052         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_2_5GB 0x20UL
2053         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_10GB 0x40UL
2054         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_20GB 0x80UL
2055         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_25GB 0x100UL
2056         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_40GB 0x200UL
2057         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_50GB 0x400UL
2058         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_100GB 0x800UL
2059         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_10MBHD 0x1000UL
2060         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_FORCE_MODE_10MB 0x2000UL
2061         __le16 supported_speeds_auto_mode;
2062         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_100MBHD 0x1UL
2063         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_100MB 0x2UL
2064         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_1GBHD 0x4UL
2065         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_1GB 0x8UL
2066         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_2GB 0x10UL
2067         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_2_5GB 0x20UL
2068         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_10GB 0x40UL
2069         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_20GB 0x80UL
2070         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_25GB 0x100UL
2071         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_40GB 0x200UL
2072         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_50GB 0x400UL
2073         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_100GB 0x800UL
2074         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_10MBHD 0x1000UL
2075         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_AUTO_MODE_10MB 0x2000UL
2076         __le16 supported_speeds_eee_mode;
2077         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_RSVD1 0x1UL
2078         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_100MB 0x2UL
2079         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_RSVD2 0x4UL
2080         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_1GB  0x8UL
2081         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_RSVD3 0x10UL
2082         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_RSVD4 0x20UL
2083         #define PORT_PHY_QCAPS_RESP_SUPPORTED_SPEEDS_EEE_MODE_10GB 0x40UL
2084         __le32 tx_lpi_timer_low;
2085         #define PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_LOW_MASK           0xffffffUL
2086         #define PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_LOW_SFT            0
2087         #define PORT_PHY_QCAPS_RESP_RSVD2_MASK                      0xff000000UL
2088         #define PORT_PHY_QCAPS_RESP_RSVD2_SFT                       24
2089         __le32 valid_tx_lpi_timer_high;
2090         #define PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_HIGH_MASK          0xffffffUL
2091         #define PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_HIGH_SFT           0
2092         #define PORT_PHY_QCAPS_RESP_VALID_MASK                      0xff000000UL
2093         #define PORT_PHY_QCAPS_RESP_VALID_SFT                       24
2094 };
2095
2096 /* Input (24 bytes) */
2097 struct hwrm_queue_qportcfg_input {
2098         __le16 req_type;
2099         __le16 cmpl_ring;
2100         __le16 seq_id;
2101         __le16 target_id;
2102         __le64 resp_addr;
2103         __le32 flags;
2104         #define QUEUE_QPORTCFG_REQ_FLAGS_PATH                       0x1UL
2105         #define QUEUE_QPORTCFG_REQ_FLAGS_PATH_TX                   (0x0UL << 0)
2106         #define QUEUE_QPORTCFG_REQ_FLAGS_PATH_RX                   (0x1UL << 0)
2107         #define QUEUE_QPORTCFG_REQ_FLAGS_PATH_LAST    QUEUE_QPORTCFG_REQ_FLAGS_PATH_RX
2108         __le16 port_id;
2109         __le16 unused_0;
2110 };
2111
2112 /* Output (32 bytes) */
2113 struct hwrm_queue_qportcfg_output {
2114         __le16 error_code;
2115         __le16 req_type;
2116         __le16 seq_id;
2117         __le16 resp_len;
2118         u8 max_configurable_queues;
2119         u8 max_configurable_lossless_queues;
2120         u8 queue_cfg_allowed;
2121         u8 queue_buffers_cfg_allowed;
2122         u8 queue_pfcenable_cfg_allowed;
2123         u8 queue_pri2cos_cfg_allowed;
2124         u8 queue_cos2bw_cfg_allowed;
2125         u8 queue_id0;
2126         u8 queue_id0_service_profile;
2127         #define QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2128         #define QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2129         #define QUEUE_QPORTCFG_RESP_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2130         u8 queue_id1;
2131         u8 queue_id1_service_profile;
2132         #define QUEUE_QPORTCFG_RESP_QUEUE_ID1_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2133         #define QUEUE_QPORTCFG_RESP_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2134         #define QUEUE_QPORTCFG_RESP_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2135         u8 queue_id2;
2136         u8 queue_id2_service_profile;
2137         #define QUEUE_QPORTCFG_RESP_QUEUE_ID2_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2138         #define QUEUE_QPORTCFG_RESP_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2139         #define QUEUE_QPORTCFG_RESP_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2140         u8 queue_id3;
2141         u8 queue_id3_service_profile;
2142         #define QUEUE_QPORTCFG_RESP_QUEUE_ID3_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2143         #define QUEUE_QPORTCFG_RESP_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2144         #define QUEUE_QPORTCFG_RESP_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2145         u8 queue_id4;
2146         u8 queue_id4_service_profile;
2147         #define QUEUE_QPORTCFG_RESP_QUEUE_ID4_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2148         #define QUEUE_QPORTCFG_RESP_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2149         #define QUEUE_QPORTCFG_RESP_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2150         u8 queue_id5;
2151         u8 queue_id5_service_profile;
2152         #define QUEUE_QPORTCFG_RESP_QUEUE_ID5_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2153         #define QUEUE_QPORTCFG_RESP_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2154         #define QUEUE_QPORTCFG_RESP_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2155         u8 queue_id6;
2156         u8 queue_id6_service_profile;
2157         #define QUEUE_QPORTCFG_RESP_QUEUE_ID6_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2158         #define QUEUE_QPORTCFG_RESP_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2159         #define QUEUE_QPORTCFG_RESP_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2160         u8 queue_id7;
2161         u8 queue_id7_service_profile;
2162         #define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_LOSSY (0x0UL << 0)
2163         #define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS (0x1UL << 0)
2164         #define QUEUE_QPORTCFG_RESP_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN (0xffUL << 0)
2165         u8 valid;
2166 };
2167
2168 /* hwrm_queue_cfg */
2169 /* Input (40 bytes) */
2170 struct hwrm_queue_cfg_input {
2171         __le16 req_type;
2172         __le16 cmpl_ring;
2173         __le16 seq_id;
2174         __le16 target_id;
2175         __le64 resp_addr;
2176         __le32 flags;
2177         #define QUEUE_CFG_REQ_FLAGS_PATH                            0x1UL
2178         #define QUEUE_CFG_REQ_FLAGS_PATH_TX                        (0x0UL << 0)
2179         #define QUEUE_CFG_REQ_FLAGS_PATH_RX                        (0x1UL << 0)
2180         #define QUEUE_CFG_REQ_FLAGS_PATH_LAST    QUEUE_CFG_REQ_FLAGS_PATH_RX
2181         __le32 enables;
2182         #define QUEUE_CFG_REQ_ENABLES_DFLT_LEN                      0x1UL
2183         #define QUEUE_CFG_REQ_ENABLES_SERVICE_PROFILE               0x2UL
2184         __le32 queue_id;
2185         __le32 dflt_len;
2186         u8 service_profile;
2187         #define QUEUE_CFG_REQ_SERVICE_PROFILE_LOSSY                (0x0UL << 0)
2188         #define QUEUE_CFG_REQ_SERVICE_PROFILE_LOSSLESS             (0x1UL << 0)
2189         #define QUEUE_CFG_REQ_SERVICE_PROFILE_UNKNOWN              (0xffUL << 0)
2190         u8 unused_0[7];
2191 };
2192
2193 /* Output (16 bytes) */
2194 struct hwrm_queue_cfg_output {
2195         __le16 error_code;
2196         __le16 req_type;
2197         __le16 seq_id;
2198         __le16 resp_len;
2199         __le32 unused_0;
2200         u8 unused_1;
2201         u8 unused_2;
2202         u8 unused_3;
2203         u8 valid;
2204 };
2205
2206 /* hwrm_queue_buffers_cfg */
2207 /* Input (56 bytes) */
2208 struct hwrm_queue_buffers_cfg_input {
2209         __le16 req_type;
2210         __le16 cmpl_ring;
2211         __le16 seq_id;
2212         __le16 target_id;
2213         __le64 resp_addr;
2214         __le32 flags;
2215         #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH                    0x1UL
2216         #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH_TX                (0x0UL << 0)
2217         #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH_RX                (0x1UL << 0)
2218         #define QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH_LAST    QUEUE_BUFFERS_CFG_REQ_FLAGS_PATH_RX
2219         __le32 enables;
2220         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_RESERVED              0x1UL
2221         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_SHARED                0x2UL
2222         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_XOFF                  0x4UL
2223         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_XON                   0x8UL
2224         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_FULL                  0x10UL
2225         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_NOTFULL               0x20UL
2226         #define QUEUE_BUFFERS_CFG_REQ_ENABLES_MAX                   0x40UL
2227         __le32 queue_id;
2228         __le32 reserved;
2229         __le32 shared;
2230         __le32 xoff;
2231         __le32 xon;
2232         __le32 full;
2233         __le32 notfull;
2234         __le32 max;
2235 };
2236
2237 /* Output (16 bytes) */
2238 struct hwrm_queue_buffers_cfg_output {
2239         __le16 error_code;
2240         __le16 req_type;
2241         __le16 seq_id;
2242         __le16 resp_len;
2243         __le32 unused_0;
2244         u8 unused_1;
2245         u8 unused_2;
2246         u8 unused_3;
2247         u8 valid;
2248 };
2249
2250 /* hwrm_queue_pfcenable_cfg */
2251 /* Input (24 bytes) */
2252 struct hwrm_queue_pfcenable_cfg_input {
2253         __le16 req_type;
2254         __le16 cmpl_ring;
2255         __le16 seq_id;
2256         __le16 target_id;
2257         __le64 resp_addr;
2258         __le32 flags;
2259         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI0_PFC_ENABLED     0x1UL
2260         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI1_PFC_ENABLED     0x2UL
2261         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI2_PFC_ENABLED     0x4UL
2262         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI3_PFC_ENABLED     0x8UL
2263         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI4_PFC_ENABLED     0x10UL
2264         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI5_PFC_ENABLED     0x20UL
2265         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI6_PFC_ENABLED     0x40UL
2266         #define QUEUE_PFCENABLE_CFG_REQ_FLAGS_PRI7_PFC_ENABLED     0x80UL
2267         __le16 port_id;
2268         __le16 unused_0;
2269 };
2270
2271 /* Output (16 bytes) */
2272 struct hwrm_queue_pfcenable_cfg_output {
2273         __le16 error_code;
2274         __le16 req_type;
2275         __le16 seq_id;
2276         __le16 resp_len;
2277         __le32 unused_0;
2278         u8 unused_1;
2279         u8 unused_2;
2280         u8 unused_3;
2281         u8 valid;
2282 };
2283
2284 /* hwrm_queue_pri2cos_cfg */
2285 /* Input (40 bytes) */
2286 struct hwrm_queue_pri2cos_cfg_input {
2287         __le16 req_type;
2288         __le16 cmpl_ring;
2289         __le16 seq_id;
2290         __le16 target_id;
2291         __le64 resp_addr;
2292         __le32 flags;
2293         #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH                    0x1UL
2294         #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_TX                (0x0UL << 0)
2295         #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_RX                (0x1UL << 0)
2296         #define QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_LAST    QUEUE_PRI2COS_CFG_REQ_FLAGS_PATH_RX
2297         #define QUEUE_PRI2COS_CFG_REQ_FLAGS_IVLAN                   0x2UL
2298         __le32 enables;
2299         u8 port_id;
2300         u8 pri0_cos_queue_id;
2301         u8 pri1_cos_queue_id;
2302         u8 pri2_cos_queue_id;
2303         u8 pri3_cos_queue_id;
2304         u8 pri4_cos_queue_id;
2305         u8 pri5_cos_queue_id;
2306         u8 pri6_cos_queue_id;
2307         u8 pri7_cos_queue_id;
2308         u8 unused_0[7];
2309 };
2310
2311 /* Output (16 bytes) */
2312 struct hwrm_queue_pri2cos_cfg_output {
2313         __le16 error_code;
2314         __le16 req_type;
2315         __le16 seq_id;
2316         __le16 resp_len;
2317         __le32 unused_0;
2318         u8 unused_1;
2319         u8 unused_2;
2320         u8 unused_3;
2321         u8 valid;
2322 };
2323
2324 /* hwrm_queue_cos2bw_cfg */
2325 /* Input (128 bytes) */
2326 struct hwrm_queue_cos2bw_cfg_input {
2327         __le16 req_type;
2328         __le16 cmpl_ring;
2329         __le16 seq_id;
2330         __le16 target_id;
2331         __le64 resp_addr;
2332         __le32 flags;
2333         __le32 enables;
2334         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID0_VALID   0x1UL
2335         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID1_VALID   0x2UL
2336         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID2_VALID   0x4UL
2337         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID3_VALID   0x8UL
2338         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID4_VALID   0x10UL
2339         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID5_VALID   0x20UL
2340         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID6_VALID   0x40UL
2341         #define QUEUE_COS2BW_CFG_REQ_ENABLES_COS_QUEUE_ID7_VALID   0x80UL
2342         __le16 port_id;
2343         u8 queue_id0;
2344         u8 unused_0;
2345         __le32 queue_id0_min_bw;
2346         __le32 queue_id0_max_bw;
2347         u8 queue_id0_tsa_assign;
2348         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_SP      (0x0UL << 0)
2349         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_ETS     (0x1UL << 0)
2350         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2351         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID0_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2352         u8 queue_id0_pri_lvl;
2353         u8 queue_id0_bw_weight;
2354         u8 queue_id1;
2355         __le32 queue_id1_min_bw;
2356         __le32 queue_id1_max_bw;
2357         u8 queue_id1_tsa_assign;
2358         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_SP      (0x0UL << 0)
2359         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_ETS     (0x1UL << 0)
2360         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2361         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID1_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2362         u8 queue_id1_pri_lvl;
2363         u8 queue_id1_bw_weight;
2364         u8 queue_id2;
2365         __le32 queue_id2_min_bw;
2366         __le32 queue_id2_max_bw;
2367         u8 queue_id2_tsa_assign;
2368         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_SP      (0x0UL << 0)
2369         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_ETS     (0x1UL << 0)
2370         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2371         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID2_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2372         u8 queue_id2_pri_lvl;
2373         u8 queue_id2_bw_weight;
2374         u8 queue_id3;
2375         __le32 queue_id3_min_bw;
2376         __le32 queue_id3_max_bw;
2377         u8 queue_id3_tsa_assign;
2378         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_SP      (0x0UL << 0)
2379         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_ETS     (0x1UL << 0)
2380         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2381         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID3_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2382         u8 queue_id3_pri_lvl;
2383         u8 queue_id3_bw_weight;
2384         u8 queue_id4;
2385         __le32 queue_id4_min_bw;
2386         __le32 queue_id4_max_bw;
2387         u8 queue_id4_tsa_assign;
2388         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_SP      (0x0UL << 0)
2389         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_ETS     (0x1UL << 0)
2390         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2391         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID4_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2392         u8 queue_id4_pri_lvl;
2393         u8 queue_id4_bw_weight;
2394         u8 queue_id5;
2395         __le32 queue_id5_min_bw;
2396         __le32 queue_id5_max_bw;
2397         u8 queue_id5_tsa_assign;
2398         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_SP      (0x0UL << 0)
2399         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_ETS     (0x1UL << 0)
2400         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2401         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID5_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2402         u8 queue_id5_pri_lvl;
2403         u8 queue_id5_bw_weight;
2404         u8 queue_id6;
2405         __le32 queue_id6_min_bw;
2406         __le32 queue_id6_max_bw;
2407         u8 queue_id6_tsa_assign;
2408         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_SP      (0x0UL << 0)
2409         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_ETS     (0x1UL << 0)
2410         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2411         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID6_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2412         u8 queue_id6_pri_lvl;
2413         u8 queue_id6_bw_weight;
2414         u8 queue_id7;
2415         __le32 queue_id7_min_bw;
2416         __le32 queue_id7_max_bw;
2417         u8 queue_id7_tsa_assign;
2418         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_SP      (0x0UL << 0)
2419         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_ETS     (0x1UL << 0)
2420         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_RESERVED_FIRST (0x2UL << 0)
2421         #define QUEUE_COS2BW_CFG_REQ_QUEUE_ID7_TSA_ASSIGN_RESERVED_LAST (0xffffUL << 0)
2422         u8 queue_id7_pri_lvl;
2423         u8 queue_id7_bw_weight;
2424         u8 unused_1[5];
2425 };
2426
2427 /* Output (16 bytes) */
2428 struct hwrm_queue_cos2bw_cfg_output {
2429         __le16 error_code;
2430         __le16 req_type;
2431         __le16 seq_id;
2432         __le16 resp_len;
2433         __le32 unused_0;
2434         u8 unused_1;
2435         u8 unused_2;
2436         u8 unused_3;
2437         u8 valid;
2438 };
2439
2440 /* hwrm_vnic_alloc */
2441 /* Input (24 bytes) */
2442 struct hwrm_vnic_alloc_input {
2443         __le16 req_type;
2444         __le16 cmpl_ring;
2445         __le16 seq_id;
2446         __le16 target_id;
2447         __le64 resp_addr;
2448         __le32 flags;
2449         #define VNIC_ALLOC_REQ_FLAGS_DEFAULT                        0x1UL
2450         __le32 unused_0;
2451 };
2452
2453 /* Output (16 bytes) */
2454 struct hwrm_vnic_alloc_output {
2455         __le16 error_code;
2456         __le16 req_type;
2457         __le16 seq_id;
2458         __le16 resp_len;
2459         __le32 vnic_id;
2460         u8 unused_0;
2461         u8 unused_1;
2462         u8 unused_2;
2463         u8 valid;
2464 };
2465
2466 /* hwrm_vnic_free */
2467 /* Input (24 bytes) */
2468 struct hwrm_vnic_free_input {
2469         __le16 req_type;
2470         __le16 cmpl_ring;
2471         __le16 seq_id;
2472         __le16 target_id;
2473         __le64 resp_addr;
2474         __le32 vnic_id;
2475         __le32 unused_0;
2476 };
2477
2478 /* Output (16 bytes) */
2479 struct hwrm_vnic_free_output {
2480         __le16 error_code;
2481         __le16 req_type;
2482         __le16 seq_id;
2483         __le16 resp_len;
2484         __le32 unused_0;
2485         u8 unused_1;
2486         u8 unused_2;
2487         u8 unused_3;
2488         u8 valid;
2489 };
2490
2491 /* hwrm_vnic_cfg */
2492 /* Input (40 bytes) */
2493 struct hwrm_vnic_cfg_input {
2494         __le16 req_type;
2495         __le16 cmpl_ring;
2496         __le16 seq_id;
2497         __le16 target_id;
2498         __le64 resp_addr;
2499         __le32 flags;
2500         #define VNIC_CFG_REQ_FLAGS_DEFAULT                          0x1UL
2501         #define VNIC_CFG_REQ_FLAGS_VLAN_STRIP_MODE                  0x2UL
2502         #define VNIC_CFG_REQ_FLAGS_BD_STALL_MODE                    0x4UL
2503         #define VNIC_CFG_REQ_FLAGS_ROCE_DUAL_VNIC_MODE              0x8UL
2504         #define VNIC_CFG_REQ_FLAGS_ROCE_ONLY_VNIC_MODE              0x10UL
2505         __le32 enables;
2506         #define VNIC_CFG_REQ_ENABLES_DFLT_RING_GRP                  0x1UL
2507         #define VNIC_CFG_REQ_ENABLES_RSS_RULE                       0x2UL
2508         #define VNIC_CFG_REQ_ENABLES_COS_RULE                       0x4UL
2509         #define VNIC_CFG_REQ_ENABLES_LB_RULE                        0x8UL
2510         #define VNIC_CFG_REQ_ENABLES_MRU                            0x10UL
2511         __le16 vnic_id;
2512         __le16 dflt_ring_grp;
2513         __le16 rss_rule;
2514         __le16 cos_rule;
2515         __le16 lb_rule;
2516         __le16 mru;
2517         __le32 unused_0;
2518 };
2519
2520 /* Output (16 bytes) */
2521 struct hwrm_vnic_cfg_output {
2522         __le16 error_code;
2523         __le16 req_type;
2524         __le16 seq_id;
2525         __le16 resp_len;
2526         __le32 unused_0;
2527         u8 unused_1;
2528         u8 unused_2;
2529         u8 unused_3;
2530         u8 valid;
2531 };
2532
2533 /* hwrm_vnic_tpa_cfg */
2534 /* Input (40 bytes) */
2535 struct hwrm_vnic_tpa_cfg_input {
2536         __le16 req_type;
2537         __le16 cmpl_ring;
2538         __le16 seq_id;
2539         __le16 target_id;
2540         __le64 resp_addr;
2541         __le32 flags;
2542         #define VNIC_TPA_CFG_REQ_FLAGS_TPA                          0x1UL
2543         #define VNIC_TPA_CFG_REQ_FLAGS_ENCAP_TPA                    0x2UL
2544         #define VNIC_TPA_CFG_REQ_FLAGS_RSC_WND_UPDATE               0x4UL
2545         #define VNIC_TPA_CFG_REQ_FLAGS_GRO                          0x8UL
2546         #define VNIC_TPA_CFG_REQ_FLAGS_AGG_WITH_ECN                 0x10UL
2547         #define VNIC_TPA_CFG_REQ_FLAGS_AGG_WITH_SAME_GRE_SEQ       0x20UL
2548         #define VNIC_TPA_CFG_REQ_FLAGS_GRO_IPID_CHECK               0x40UL
2549         #define VNIC_TPA_CFG_REQ_FLAGS_GRO_TTL_CHECK                0x80UL
2550         __le32 enables;
2551         #define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGG_SEGS               0x1UL
2552         #define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGGS                   0x2UL
2553         #define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGG_TIMER              0x4UL
2554         #define VNIC_TPA_CFG_REQ_ENABLES_MIN_AGG_LEN                0x8UL
2555         __le16 vnic_id;
2556         __le16 max_agg_segs;
2557         #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_1            (0x0UL << 0)
2558         #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_2            (0x1UL << 0)
2559         #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_4            (0x2UL << 0)
2560         #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_8            (0x3UL << 0)
2561         #define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_MAX                  (0x1fUL << 0)
2562         __le16 max_aggs;
2563         #define VNIC_TPA_CFG_REQ_MAX_AGGS_1                        (0x0UL << 0)
2564         #define VNIC_TPA_CFG_REQ_MAX_AGGS_2                        (0x1UL << 0)
2565         #define VNIC_TPA_CFG_REQ_MAX_AGGS_4                        (0x2UL << 0)
2566         #define VNIC_TPA_CFG_REQ_MAX_AGGS_8                        (0x3UL << 0)
2567         #define VNIC_TPA_CFG_REQ_MAX_AGGS_16                       (0x4UL << 0)
2568         #define VNIC_TPA_CFG_REQ_MAX_AGGS_MAX                      (0x7UL << 0)
2569         u8 unused_0;
2570         u8 unused_1;
2571         __le32 max_agg_timer;
2572         __le32 min_agg_len;
2573 };
2574
2575 /* Output (16 bytes) */
2576 struct hwrm_vnic_tpa_cfg_output {
2577         __le16 error_code;
2578         __le16 req_type;
2579         __le16 seq_id;
2580         __le16 resp_len;
2581         __le32 unused_0;
2582         u8 unused_1;
2583         u8 unused_2;
2584         u8 unused_3;
2585         u8 valid;
2586 };
2587
2588 /* hwrm_vnic_rss_cfg */
2589 /* Input (48 bytes) */
2590 struct hwrm_vnic_rss_cfg_input {
2591         __le16 req_type;
2592         __le16 cmpl_ring;
2593         __le16 seq_id;
2594         __le16 target_id;
2595         __le64 resp_addr;
2596         __le32 hash_type;
2597         #define VNIC_RSS_CFG_REQ_HASH_TYPE_IPV4             0x1UL
2598         #define VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV4                 0x2UL
2599         #define VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4                 0x4UL
2600         #define VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6             0x8UL
2601         #define VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6                 0x10UL
2602         #define VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV6                 0x20UL
2603         __le32 unused_0;
2604         __le64 ring_grp_tbl_addr;
2605         __le64 hash_key_tbl_addr;
2606         __le16 rss_ctx_idx;
2607         __le16 unused_1[3];
2608 };
2609
2610 /* Output (16 bytes) */
2611 struct hwrm_vnic_rss_cfg_output {
2612         __le16 error_code;
2613         __le16 req_type;
2614         __le16 seq_id;
2615         __le16 resp_len;
2616         __le32 unused_0;
2617         u8 unused_1;
2618         u8 unused_2;
2619         u8 unused_3;
2620         u8 valid;
2621 };
2622
2623 /* hwrm_vnic_plcmodes_cfg */
2624 /* Input (40 bytes) */
2625 struct hwrm_vnic_plcmodes_cfg_input {
2626         __le16 req_type;
2627         __le16 cmpl_ring;
2628         __le16 seq_id;
2629         __le16 target_id;
2630         __le64 resp_addr;
2631         __le32 flags;
2632         #define VNIC_PLCMODES_CFG_REQ_FLAGS_REGULAR_PLACEMENT      0x1UL
2633         #define VNIC_PLCMODES_CFG_REQ_FLAGS_JUMBO_PLACEMENT         0x2UL
2634         #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV4                0x4UL
2635         #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6                0x8UL
2636         #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_FCOE                0x10UL
2637         #define VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_ROCE                0x20UL
2638         __le32 enables;
2639         #define VNIC_PLCMODES_CFG_REQ_ENABLES_JUMBO_THRESH_VALID   0x1UL
2640         #define VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_OFFSET_VALID     0x2UL
2641         #define VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID  0x4UL
2642         __le32 vnic_id;
2643         __le16 jumbo_thresh;
2644         __le16 hds_offset;
2645         __le16 hds_threshold;
2646         __le16 unused_0[3];
2647 };
2648
2649 /* Output (16 bytes) */
2650 struct hwrm_vnic_plcmodes_cfg_output {
2651         __le16 error_code;
2652         __le16 req_type;
2653         __le16 seq_id;
2654         __le16 resp_len;
2655         __le32 unused_0;
2656         u8 unused_1;
2657         u8 unused_2;
2658         u8 unused_3;
2659         u8 valid;
2660 };
2661
2662 /* hwrm_vnic_rss_cos_lb_ctx_alloc */
2663 /* Input (16 bytes) */
2664 struct hwrm_vnic_rss_cos_lb_ctx_alloc_input {
2665         __le16 req_type;
2666         __le16 cmpl_ring;
2667         __le16 seq_id;
2668         __le16 target_id;
2669         __le64 resp_addr;
2670 };
2671
2672 /* Output (16 bytes) */
2673 struct hwrm_vnic_rss_cos_lb_ctx_alloc_output {
2674         __le16 error_code;
2675         __le16 req_type;
2676         __le16 seq_id;
2677         __le16 resp_len;
2678         __le16 rss_cos_lb_ctx_id;
2679         u8 unused_0;
2680         u8 unused_1;
2681         u8 unused_2;
2682         u8 unused_3;
2683         u8 unused_4;
2684         u8 valid;
2685 };
2686
2687 /* hwrm_vnic_rss_cos_lb_ctx_free */
2688 /* Input (24 bytes) */
2689 struct hwrm_vnic_rss_cos_lb_ctx_free_input {
2690         __le16 req_type;
2691         __le16 cmpl_ring;
2692         __le16 seq_id;
2693         __le16 target_id;
2694         __le64 resp_addr;
2695         __le16 rss_cos_lb_ctx_id;
2696         __le16 unused_0[3];
2697 };
2698
2699 /* Output (16 bytes) */
2700 struct hwrm_vnic_rss_cos_lb_ctx_free_output {
2701         __le16 error_code;
2702         __le16 req_type;
2703         __le16 seq_id;
2704         __le16 resp_len;
2705         __le32 unused_0;
2706         u8 unused_1;
2707         u8 unused_2;
2708         u8 unused_3;
2709         u8 valid;
2710 };
2711
2712 /* hwrm_ring_alloc */
2713 /* Input (80 bytes) */
2714 struct hwrm_ring_alloc_input {
2715         __le16 req_type;
2716         __le16 cmpl_ring;
2717         __le16 seq_id;
2718         __le16 target_id;
2719         __le64 resp_addr;
2720         __le32 enables;
2721         #define RING_ALLOC_REQ_ENABLES_RESERVED1                    0x1UL
2722         #define RING_ALLOC_REQ_ENABLES_RESERVED2                    0x2UL
2723         #define RING_ALLOC_REQ_ENABLES_RESERVED3                    0x4UL
2724         #define RING_ALLOC_REQ_ENABLES_STAT_CTX_ID_VALID            0x8UL
2725         #define RING_ALLOC_REQ_ENABLES_RESERVED4                    0x10UL
2726         #define RING_ALLOC_REQ_ENABLES_MAX_BW_VALID                 0x20UL
2727         u8 ring_type;
2728         #define RING_ALLOC_REQ_RING_TYPE_CMPL                      (0x0UL << 0)
2729         #define RING_ALLOC_REQ_RING_TYPE_TX                        (0x1UL << 0)
2730         #define RING_ALLOC_REQ_RING_TYPE_RX                        (0x2UL << 0)
2731         u8 unused_0;
2732         __le16 unused_1;
2733         __le64 page_tbl_addr;
2734         __le32 fbo;
2735         u8 page_size;
2736         u8 page_tbl_depth;
2737         u8 unused_2;
2738         u8 unused_3;
2739         __le32 length;
2740         __le16 logical_id;
2741         __le16 cmpl_ring_id;
2742         __le16 queue_id;
2743         u8 unused_4;
2744         u8 unused_5;
2745         __le32 reserved1;
2746         __le16 reserved2;
2747         u8 unused_6;
2748         u8 unused_7;
2749         __le32 reserved3;
2750         __le32 stat_ctx_id;
2751         __le32 reserved4;
2752         __le32 max_bw;
2753         u8 int_mode;
2754         #define RING_ALLOC_REQ_INT_MODE_LEGACY                     (0x0UL << 0)
2755         #define RING_ALLOC_REQ_INT_MODE_RSVD                       (0x1UL << 0)
2756         #define RING_ALLOC_REQ_INT_MODE_MSIX                       (0x2UL << 0)
2757         #define RING_ALLOC_REQ_INT_MODE_POLL                       (0x3UL << 0)
2758         u8 unused_8[3];
2759 };
2760
2761 /* Output (16 bytes) */
2762 struct hwrm_ring_alloc_output {
2763         __le16 error_code;
2764         __le16 req_type;
2765         __le16 seq_id;
2766         __le16 resp_len;
2767         __le16 ring_id;
2768         __le16 logical_ring_id;
2769         u8 unused_0;
2770         u8 unused_1;
2771         u8 unused_2;
2772         u8 valid;
2773 };
2774
2775 /* hwrm_ring_free */
2776 /* Input (24 bytes) */
2777 struct hwrm_ring_free_input {
2778         __le16 req_type;
2779         __le16 cmpl_ring;
2780         __le16 seq_id;
2781         __le16 target_id;
2782         __le64 resp_addr;
2783         u8 ring_type;
2784         #define RING_FREE_REQ_RING_TYPE_CMPL                       (0x0UL << 0)
2785         #define RING_FREE_REQ_RING_TYPE_TX                         (0x1UL << 0)
2786         #define RING_FREE_REQ_RING_TYPE_RX                         (0x2UL << 0)
2787         u8 unused_0;
2788         __le16 ring_id;
2789         __le32 unused_1;
2790 };
2791
2792 /* Output (16 bytes) */
2793 struct hwrm_ring_free_output {
2794         __le16 error_code;
2795         __le16 req_type;
2796         __le16 seq_id;
2797         __le16 resp_len;
2798         __le32 unused_0;
2799         u8 unused_1;
2800         u8 unused_2;
2801         u8 unused_3;
2802         u8 valid;
2803 };
2804
2805 /* hwrm_ring_cmpl_ring_qaggint_params */
2806 /* Input (24 bytes) */
2807 struct hwrm_ring_cmpl_ring_qaggint_params_input {
2808         __le16 req_type;
2809         __le16 cmpl_ring;
2810         __le16 seq_id;
2811         __le16 target_id;
2812         __le64 resp_addr;
2813         __le16 ring_id;
2814         __le16 unused_0[3];
2815 };
2816
2817 /* Output (32 bytes) */
2818 struct hwrm_ring_cmpl_ring_qaggint_params_output {
2819         __le16 error_code;
2820         __le16 req_type;
2821         __le16 seq_id;
2822         __le16 resp_len;
2823         __le16 flags;
2824         #define RING_CMPL_RING_QAGGINT_PARAMS_RESP_FLAGS_TIMER_RESET 0x1UL
2825         #define RING_CMPL_RING_QAGGINT_PARAMS_RESP_FLAGS_RING_IDLE 0x2UL
2826         __le16 num_cmpl_dma_aggr;
2827         __le16 num_cmpl_dma_aggr_during_int;
2828         __le16 cmpl_aggr_dma_tmr;
2829         __le16 cmpl_aggr_dma_tmr_during_int;
2830         __le16 int_lat_tmr_min;
2831         __le16 int_lat_tmr_max;
2832         __le16 num_cmpl_aggr_int;
2833         __le32 unused_0;
2834         u8 unused_1;
2835         u8 unused_2;
2836         u8 unused_3;
2837         u8 valid;
2838 };
2839
2840 /* hwrm_ring_cmpl_ring_cfg_aggint_params */
2841 /* Input (40 bytes) */
2842 struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {
2843         __le16 req_type;
2844         __le16 cmpl_ring;
2845         __le16 seq_id;
2846         __le16 target_id;
2847         __le64 resp_addr;
2848         __le16 ring_id;
2849         __le16 flags;
2850         #define RING_CMPL_RING_CFG_AGGINT_PARAMS_REQ_FLAGS_TIMER_RESET 0x1UL
2851         #define RING_CMPL_RING_CFG_AGGINT_PARAMS_REQ_FLAGS_RING_IDLE 0x2UL
2852         __le16 num_cmpl_dma_aggr;
2853         __le16 num_cmpl_dma_aggr_during_int;
2854         __le16 cmpl_aggr_dma_tmr;
2855         __le16 cmpl_aggr_dma_tmr_during_int;
2856         __le16 int_lat_tmr_min;
2857         __le16 int_lat_tmr_max;
2858         __le16 num_cmpl_aggr_int;
2859         __le16 unused_0[3];
2860 };
2861
2862 /* Output (16 bytes) */
2863 struct hwrm_ring_cmpl_ring_cfg_aggint_params_output {
2864         __le16 error_code;
2865         __le16 req_type;
2866         __le16 seq_id;
2867         __le16 resp_len;
2868         __le32 unused_0;
2869         u8 unused_1;
2870         u8 unused_2;
2871         u8 unused_3;
2872         u8 valid;
2873 };
2874
2875 /* hwrm_ring_reset */
2876 /* Input (24 bytes) */
2877 struct hwrm_ring_reset_input {
2878         __le16 req_type;
2879         __le16 cmpl_ring;
2880         __le16 seq_id;
2881         __le16 target_id;
2882         __le64 resp_addr;
2883         u8 ring_type;
2884         #define RING_RESET_REQ_RING_TYPE_CMPL                      (0x0UL << 0)
2885         #define RING_RESET_REQ_RING_TYPE_TX                        (0x1UL << 0)
2886         #define RING_RESET_REQ_RING_TYPE_RX                        (0x2UL << 0)
2887         u8 unused_0;
2888         __le16 ring_id;
2889         __le32 unused_1;
2890 };
2891
2892 /* Output (16 bytes) */
2893 struct hwrm_ring_reset_output {
2894         __le16 error_code;
2895         __le16 req_type;
2896         __le16 seq_id;
2897         __le16 resp_len;
2898         __le32 unused_0;
2899         u8 unused_1;
2900         u8 unused_2;
2901         u8 unused_3;
2902         u8 valid;
2903 };
2904
2905 /* hwrm_ring_grp_alloc */
2906 /* Input (24 bytes) */
2907 struct hwrm_ring_grp_alloc_input {
2908         __le16 req_type;
2909         __le16 cmpl_ring;
2910         __le16 seq_id;
2911         __le16 target_id;
2912         __le64 resp_addr;
2913         __le16 cr;
2914         __le16 rr;
2915         __le16 ar;
2916         __le16 sc;
2917 };
2918
2919 /* Output (16 bytes) */
2920 struct hwrm_ring_grp_alloc_output {
2921         __le16 error_code;
2922         __le16 req_type;
2923         __le16 seq_id;
2924         __le16 resp_len;
2925         __le32 ring_group_id;
2926         u8 unused_0;
2927         u8 unused_1;
2928         u8 unused_2;
2929         u8 valid;
2930 };
2931
2932 /* hwrm_ring_grp_free */
2933 /* Input (24 bytes) */
2934 struct hwrm_ring_grp_free_input {
2935         __le16 req_type;
2936         __le16 cmpl_ring;
2937         __le16 seq_id;
2938         __le16 target_id;
2939         __le64 resp_addr;
2940         __le32 ring_group_id;
2941         __le32 unused_0;
2942 };
2943
2944 /* Output (16 bytes) */
2945 struct hwrm_ring_grp_free_output {
2946         __le16 error_code;
2947         __le16 req_type;
2948         __le16 seq_id;
2949         __le16 resp_len;
2950         __le32 unused_0;
2951         u8 unused_1;
2952         u8 unused_2;
2953         u8 unused_3;
2954         u8 valid;
2955 };
2956
2957 /* hwrm_cfa_l2_filter_alloc */
2958 /* Input (96 bytes) */
2959 struct hwrm_cfa_l2_filter_alloc_input {
2960         __le16 req_type;
2961         __le16 cmpl_ring;
2962         __le16 seq_id;
2963         __le16 target_id;
2964         __le64 resp_addr;
2965         __le32 flags;
2966         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH                  0x1UL
2967         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_TX              (0x0UL << 0)
2968         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_RX              (0x1UL << 0)
2969         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_LAST    CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_RX
2970         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_LOOPBACK              0x2UL
2971         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_DROP                  0x4UL
2972         #define CFA_L2_FILTER_ALLOC_REQ_FLAGS_OUTERMOST     0x8UL
2973         __le32 enables;
2974         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR     0x1UL
2975         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR_MASK       0x2UL
2976         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_OVLAN            0x4UL
2977         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_OVLAN_MASK      0x8UL
2978         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_IVLAN            0x10UL
2979         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_IVLAN_MASK      0x20UL
2980         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_ADDR           0x40UL
2981         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_ADDR_MASK     0x80UL
2982         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_OVLAN          0x100UL
2983         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_OVLAN_MASK    0x200UL
2984         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_IVLAN          0x400UL
2985         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_T_L2_IVLAN_MASK    0x800UL
2986         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_SRC_TYPE            0x1000UL
2987         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_SRC_ID              0x2000UL
2988         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_TUNNEL_TYPE         0x4000UL
2989         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_DST_ID              0x8000UL
2990         #define CFA_L2_FILTER_ALLOC_REQ_ENABLES_MIRROR_VNIC_ID     0x10000UL
2991         u8 l2_addr[6];
2992         u8 unused_0;
2993         u8 unused_1;
2994         u8 l2_addr_mask[6];
2995         __le16 l2_ovlan;
2996         __le16 l2_ovlan_mask;
2997         __le16 l2_ivlan;
2998         __le16 l2_ivlan_mask;
2999         u8 unused_2;
3000         u8 unused_3;
3001         u8 t_l2_addr[6];
3002         u8 unused_4;
3003         u8 unused_5;
3004         u8 t_l2_addr_mask[6];
3005         __le16 t_l2_ovlan;
3006         __le16 t_l2_ovlan_mask;
3007         __le16 t_l2_ivlan;
3008         __le16 t_l2_ivlan_mask;
3009         u8 src_type;
3010         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_NPORT             (0x0UL << 0)
3011         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_PF                (0x1UL << 0)
3012         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_VF                (0x2UL << 0)
3013         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_VNIC              (0x3UL << 0)
3014         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_KONG              (0x4UL << 0)
3015         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_APE               (0x5UL << 0)
3016         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_BONO              (0x6UL << 0)
3017         #define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_TANG              (0x7UL << 0)
3018         u8 unused_6;
3019         __le32 src_id;
3020         u8 tunnel_type;
3021         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_NONTUNNEL     (0x0UL << 0)
3022         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN          (0x1UL << 0)
3023         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE          (0x2UL << 0)
3024         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2GRE          (0x3UL << 0)
3025         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPIP           (0x4UL << 0)
3026         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE         (0x5UL << 0)
3027         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_MPLS           (0x6UL << 0)
3028         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_STT    (0x7UL << 0)
3029         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE          (0x8UL << 0)
3030         #define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL     (0xffUL << 0)
3031         u8 unused_7;
3032         __le16 dst_id;
3033         __le16 mirror_vnic_id;
3034         u8 pri_hint;
3035         #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_NO_PREFER         (0x0UL << 0)
3036         #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_ABOVE_FILTER     (0x1UL << 0)
3037         #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_BELOW_FILTER     (0x2UL << 0)
3038         #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_MAX               (0x3UL << 0)
3039         #define CFA_L2_FILTER_ALLOC_REQ_PRI_HINT_MIN               (0x4UL << 0)
3040         u8 unused_8;
3041         __le32 unused_9;
3042         __le64 l2_filter_id_hint;
3043 };
3044
3045 /* Output (24 bytes) */
3046 struct hwrm_cfa_l2_filter_alloc_output {
3047         __le16 error_code;
3048         __le16 req_type;
3049         __le16 seq_id;
3050         __le16 resp_len;
3051         __le64 l2_filter_id;
3052         __le32 flow_id;
3053         u8 unused_0;
3054         u8 unused_1;
3055         u8 unused_2;
3056         u8 valid;
3057 };
3058
3059 /* hwrm_cfa_l2_filter_free */
3060 /* Input (24 bytes) */
3061 struct hwrm_cfa_l2_filter_free_input {
3062         __le16 req_type;
3063         __le16 cmpl_ring;
3064         __le16 seq_id;
3065         __le16 target_id;
3066         __le64 resp_addr;
3067         __le64 l2_filter_id;
3068 };
3069
3070 /* Output (16 bytes) */
3071 struct hwrm_cfa_l2_filter_free_output {
3072         __le16 error_code;
3073         __le16 req_type;
3074         __le16 seq_id;
3075         __le16 resp_len;
3076         __le32 unused_0;
3077         u8 unused_1;
3078         u8 unused_2;
3079         u8 unused_3;
3080         u8 valid;
3081 };
3082
3083 /* hwrm_cfa_l2_filter_cfg */
3084 /* Input (40 bytes) */
3085 struct hwrm_cfa_l2_filter_cfg_input {
3086         __le16 req_type;
3087         __le16 cmpl_ring;
3088         __le16 seq_id;
3089         __le16 target_id;
3090         __le64 resp_addr;
3091         __le32 flags;
3092         #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH                    0x1UL
3093         #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_TX                (0x0UL << 0)
3094         #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX                (0x1UL << 0)
3095         #define CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_LAST    CFA_L2_FILTER_CFG_REQ_FLAGS_PATH_RX
3096         #define CFA_L2_FILTER_CFG_REQ_FLAGS_DROP                    0x2UL
3097         __le32 enables;
3098         #define CFA_L2_FILTER_CFG_REQ_ENABLES_DST_ID                0x1UL
3099         #define CFA_L2_FILTER_CFG_REQ_ENABLES_NEW_MIRROR_VNIC_ID   0x2UL
3100         __le64 l2_filter_id;
3101         __le32 dst_id;
3102         __le32 new_mirror_vnic_id;
3103 };
3104
3105 /* Output (16 bytes) */
3106 struct hwrm_cfa_l2_filter_cfg_output {
3107         __le16 error_code;
3108         __le16 req_type;
3109         __le16 seq_id;
3110         __le16 resp_len;
3111         __le32 unused_0;
3112         u8 unused_1;
3113         u8 unused_2;
3114         u8 unused_3;
3115         u8 valid;
3116 };
3117
3118 /* hwrm_cfa_l2_set_rx_mask */
3119 /* Input (40 bytes) */
3120 struct hwrm_cfa_l2_set_rx_mask_input {
3121         __le16 req_type;
3122         __le16 cmpl_ring;
3123         __le16 seq_id;
3124         __le16 target_id;
3125         __le64 resp_addr;
3126         __le32 vnic_id;
3127         __le32 mask;
3128         #define CFA_L2_SET_RX_MASK_REQ_MASK_RESERVED                0x1UL
3129         #define CFA_L2_SET_RX_MASK_REQ_MASK_MCAST                   0x2UL
3130         #define CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST               0x4UL
3131         #define CFA_L2_SET_RX_MASK_REQ_MASK_BCAST                   0x8UL
3132         #define CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS     0x10UL
3133         #define CFA_L2_SET_RX_MASK_REQ_MASK_OUTERMOST               0x20UL
3134         __le64 mc_tbl_addr;
3135         __le32 num_mc_entries;
3136         __le32 unused_0;
3137 };
3138
3139 /* Output (16 bytes) */
3140 struct hwrm_cfa_l2_set_rx_mask_output {
3141         __le16 error_code;
3142         __le16 req_type;
3143         __le16 seq_id;
3144         __le16 resp_len;
3145         __le32 unused_0;
3146         u8 unused_1;
3147         u8 unused_2;
3148         u8 unused_3;
3149         u8 valid;
3150 };
3151
3152 /* hwrm_cfa_tunnel_filter_alloc */
3153 /* Input (88 bytes) */
3154 struct hwrm_cfa_tunnel_filter_alloc_input {
3155         __le16 req_type;
3156         __le16 cmpl_ring;
3157         __le16 seq_id;
3158         __le16 target_id;
3159         __le64 resp_addr;
3160         __le32 flags;
3161         #define CFA_TUNNEL_FILTER_ALLOC_REQ_FLAGS_LOOPBACK          0x1UL
3162         __le32 enables;
3163         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L2_FILTER_ID   0x1UL
3164         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L2_ADDR         0x2UL
3165         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L2_IVLAN       0x4UL
3166         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L3_ADDR         0x8UL
3167         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_L3_ADDR_TYPE   0x10UL
3168         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_T_L3_ADDR_TYPE 0x20UL
3169         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_T_L3_ADDR      0x40UL
3170         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_TUNNEL_TYPE    0x80UL
3171         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_VNI     0x100UL
3172         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_DST_VNIC_ID    0x200UL
3173         #define CFA_TUNNEL_FILTER_ALLOC_REQ_ENABLES_MIRROR_VNIC_ID 0x400UL
3174         __le64 l2_filter_id;
3175         u8 l2_addr[6];
3176         __le16 l2_ivlan;
3177         __le32 l3_addr[4];
3178         __le32 t_l3_addr[4];
3179         u8 l3_addr_type;
3180         u8 t_l3_addr_type;
3181         u8 tunnel_type;
3182         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_NONTUNNEL (0x0UL << 0)
3183         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN     (0x1UL << 0)
3184         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE     (0x2UL << 0)
3185         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2GRE     (0x3UL << 0)
3186         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPIP      (0x4UL << 0)
3187         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE    (0x5UL << 0)
3188         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_MPLS      (0x6UL << 0)
3189         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_STT       (0x7UL << 0)
3190         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE     (0x8UL << 0)
3191         #define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL (0xffUL << 0)
3192         u8 unused_0;
3193         __le32 vni;
3194         __le32 dst_vnic_id;
3195         __le32 mirror_vnic_id;
3196 };
3197
3198 /* Output (24 bytes) */
3199 struct hwrm_cfa_tunnel_filter_alloc_output {
3200         __le16 error_code;
3201         __le16 req_type;
3202         __le16 seq_id;
3203         __le16 resp_len;
3204         __le64 tunnel_filter_id;
3205         __le32 flow_id;
3206         u8 unused_0;
3207         u8 unused_1;
3208         u8 unused_2;
3209         u8 valid;
3210 };
3211
3212 /* hwrm_cfa_tunnel_filter_free */
3213 /* Input (24 bytes) */
3214 struct hwrm_cfa_tunnel_filter_free_input {
3215         __le16 req_type;
3216         __le16 cmpl_ring;
3217         __le16 seq_id;
3218         __le16 target_id;
3219         __le64 resp_addr;
3220         __le64 tunnel_filter_id;
3221 };
3222
3223 /* Output (16 bytes) */
3224 struct hwrm_cfa_tunnel_filter_free_output {
3225         __le16 error_code;
3226         __le16 req_type;
3227         __le16 seq_id;
3228         __le16 resp_len;
3229         __le32 unused_0;
3230         u8 unused_1;
3231         u8 unused_2;
3232         u8 unused_3;
3233         u8 valid;
3234 };
3235
3236 /* hwrm_cfa_encap_record_alloc */
3237 /* Input (32 bytes) */
3238 struct hwrm_cfa_encap_record_alloc_input {
3239         __le16 req_type;
3240         __le16 cmpl_ring;
3241         __le16 seq_id;
3242         __le16 target_id;
3243         __le64 resp_addr;
3244         __le32 flags;
3245         #define CFA_ENCAP_RECORD_ALLOC_REQ_FLAGS_LOOPBACK           0x1UL
3246         u8 encap_type;
3247         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VXLAN       (0x1UL << 0)
3248         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_NVGRE       (0x2UL << 0)
3249         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_L2GRE       (0x3UL << 0)
3250         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_IPIP         (0x4UL << 0)
3251         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_GENEVE      (0x5UL << 0)
3252         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_MPLS         (0x6UL << 0)
3253         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VLAN         (0x7UL << 0)
3254         #define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_IPGRE       (0x8UL << 0)
3255         u8 unused_0;
3256         __le16 unused_1;
3257         __le32 encap_data[16];
3258 };
3259
3260 /* Output (16 bytes) */
3261 struct hwrm_cfa_encap_record_alloc_output {
3262         __le16 error_code;
3263         __le16 req_type;
3264         __le16 seq_id;
3265         __le16 resp_len;
3266         __le32 encap_record_id;
3267         u8 unused_0;
3268         u8 unused_1;
3269         u8 unused_2;
3270         u8 valid;
3271 };
3272
3273 /* hwrm_cfa_encap_record_free */
3274 /* Input (24 bytes) */
3275 struct hwrm_cfa_encap_record_free_input {
3276         __le16 req_type;
3277         __le16 cmpl_ring;
3278         __le16 seq_id;
3279         __le16 target_id;
3280         __le64 resp_addr;
3281         __le32 encap_record_id;
3282         __le32 unused_0;
3283 };
3284
3285 /* Output (16 bytes) */
3286 struct hwrm_cfa_encap_record_free_output {
3287         __le16 error_code;
3288         __le16 req_type;
3289         __le16 seq_id;
3290         __le16 resp_len;
3291         __le32 unused_0;
3292         u8 unused_1;
3293         u8 unused_2;
3294         u8 unused_3;
3295         u8 valid;
3296 };
3297
3298 /* hwrm_cfa_ntuple_filter_alloc */
3299 /* Input (128 bytes) */
3300 struct hwrm_cfa_ntuple_filter_alloc_input {
3301         __le16 req_type;
3302         __le16 cmpl_ring;
3303         __le16 seq_id;
3304         __le16 target_id;
3305         __le64 resp_addr;
3306         __le32 flags;
3307         #define CFA_NTUPLE_FILTER_ALLOC_REQ_FLAGS_LOOPBACK          0x1UL
3308         #define CFA_NTUPLE_FILTER_ALLOC_REQ_FLAGS_DROP              0x2UL
3309         __le32 enables;
3310         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_L2_FILTER_ID   0x1UL
3311         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_ETHERTYPE      0x2UL
3312         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_TUNNEL_TYPE    0x4UL
3313         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_MACADDR    0x8UL
3314         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_IPADDR_TYPE    0x10UL
3315         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_IPADDR     0x20UL
3316         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_IPADDR_MASK 0x40UL
3317         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_IPADDR     0x80UL
3318         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_IPADDR_MASK 0x100UL
3319         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_IP_PROTOCOL    0x200UL
3320         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_PORT       0x400UL
3321         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_SRC_PORT_MASK  0x800UL
3322         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_PORT       0x1000UL
3323         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_PORT_MASK  0x2000UL
3324         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_PRI_HINT       0x4000UL
3325         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_NTUPLE_FILTER_ID 0x8000UL
3326         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_ID          0x10000UL
3327         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_MIRROR_VNIC_ID 0x20000UL
3328         #define CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_DST_MACADDR    0x40000UL
3329         __le64 l2_filter_id;
3330         u8 src_macaddr[6];
3331         __be16 ethertype;
3332         u8 ip_addr_type;
3333         #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_ADDR_TYPE_UNKNOWN  (0x0UL << 0)
3334         #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_ADDR_TYPE_IPV4     (0x4UL << 0)
3335         #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_ADDR_TYPE_IPV6     (0x6UL << 0)
3336         u8 ip_protocol;
3337         #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UNKNOWN   (0x0UL << 0)
3338         #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UDP       (0x6UL << 0)
3339         #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_TCP       (0x11UL << 0)
3340         __le16 dst_id;
3341         __le16 mirror_vnic_id;
3342         u8 tunnel_type;
3343         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NONTUNNEL (0x0UL << 0)
3344         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN     (0x1UL << 0)
3345         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_NVGRE     (0x2UL << 0)
3346         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2GRE     (0x3UL << 0)
3347         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPIP      (0x4UL << 0)
3348         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_GENEVE    (0x5UL << 0)
3349         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_MPLS      (0x6UL << 0)
3350         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_STT       (0x7UL << 0)
3351         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE     (0x8UL << 0)
3352         #define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL (0xffUL << 0)
3353         u8 pri_hint;
3354         #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_NO_PREFER    (0x0UL << 0)
3355         #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_ABOVE         (0x1UL << 0)
3356         #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_BELOW         (0x2UL << 0)
3357         #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_HIGHEST      (0x3UL << 0)
3358         #define CFA_NTUPLE_FILTER_ALLOC_REQ_PRI_HINT_LOWEST       (0x4UL << 0)
3359         __be32 src_ipaddr[4];
3360         __be32 src_ipaddr_mask[4];
3361         __be32 dst_ipaddr[4];
3362         __be32 dst_ipaddr_mask[4];
3363         __be16 src_port;
3364         __be16 src_port_mask;
3365         __be16 dst_port;
3366         __be16 dst_port_mask;
3367         __le64 ntuple_filter_id_hint;
3368 };
3369
3370 /* Output (24 bytes) */
3371 struct hwrm_cfa_ntuple_filter_alloc_output {
3372         __le16 error_code;
3373         __le16 req_type;
3374         __le16 seq_id;
3375         __le16 resp_len;
3376         __le64 ntuple_filter_id;
3377         __le32 flow_id;
3378         u8 unused_0;
3379         u8 unused_1;
3380         u8 unused_2;
3381         u8 valid;
3382 };
3383
3384 /* hwrm_cfa_ntuple_filter_free */
3385 /* Input (24 bytes) */
3386 struct hwrm_cfa_ntuple_filter_free_input {
3387         __le16 req_type;
3388         __le16 cmpl_ring;
3389         __le16 seq_id;
3390         __le16 target_id;
3391         __le64 resp_addr;
3392         __le64 ntuple_filter_id;
3393 };
3394
3395 /* Output (16 bytes) */
3396 struct hwrm_cfa_ntuple_filter_free_output {
3397         __le16 error_code;
3398         __le16 req_type;
3399         __le16 seq_id;
3400         __le16 resp_len;
3401         __le32 unused_0;
3402         u8 unused_1;
3403         u8 unused_2;
3404         u8 unused_3;
3405         u8 valid;
3406 };
3407
3408 /* hwrm_cfa_ntuple_filter_cfg */
3409 /* Input (40 bytes) */
3410 struct hwrm_cfa_ntuple_filter_cfg_input {
3411         __le16 req_type;
3412         __le16 cmpl_ring;
3413         __le16 seq_id;
3414         __le16 target_id;
3415         __le64 resp_addr;
3416         __le32 enables;
3417         #define CFA_NTUPLE_FILTER_CFG_REQ_ENABLES_NEW_DST_ID       0x1UL
3418         #define CFA_NTUPLE_FILTER_CFG_REQ_ENABLES_NEW_MIRROR_VNIC_ID 0x2UL
3419         __le32 unused_0;
3420         __le64 ntuple_filter_id;
3421         __le32 new_dst_id;
3422         __le32 new_mirror_vnic_id;
3423 };
3424
3425 /* Output (16 bytes) */
3426 struct hwrm_cfa_ntuple_filter_cfg_output {
3427         __le16 error_code;
3428         __le16 req_type;
3429         __le16 seq_id;
3430         __le16 resp_len;
3431         __le32 unused_0;
3432         u8 unused_1;
3433         u8 unused_2;
3434         u8 unused_3;
3435         u8 valid;
3436 };
3437
3438 /* hwrm_tunnel_dst_port_query */
3439 /* Input (24 bytes) */
3440 struct hwrm_tunnel_dst_port_query_input {
3441         __le16 req_type;
3442         __le16 cmpl_ring;
3443         __le16 seq_id;
3444         __le16 target_id;
3445         __le64 resp_addr;
3446         u8 tunnel_type;
3447         #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN       (0x1UL << 0)
3448         #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_GENEVE      (0x5UL << 0)
3449         u8 unused_0[7];
3450 };
3451
3452 /* Output (16 bytes) */
3453 struct hwrm_tunnel_dst_port_query_output {
3454         __le16 error_code;
3455         __le16 req_type;
3456         __le16 seq_id;
3457         __le16 resp_len;
3458         __le16 tunnel_dst_port_id;
3459         __be16 tunnel_dst_port_val;
3460         u8 unused_0;
3461         u8 unused_1;
3462         u8 unused_2;
3463         u8 valid;
3464 };
3465
3466 /* hwrm_tunnel_dst_port_alloc */
3467 /* Input (24 bytes) */
3468 struct hwrm_tunnel_dst_port_alloc_input {
3469         __le16 req_type;
3470         __le16 cmpl_ring;
3471         __le16 seq_id;
3472         __le16 target_id;
3473         __le64 resp_addr;
3474         u8 tunnel_type;
3475         #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN       (0x1UL << 0)
3476         #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE      (0x5UL << 0)
3477         u8 unused_0;
3478         __be16 tunnel_dst_port_val;
3479         __le32 unused_1;
3480 };
3481
3482 /* Output (16 bytes) */
3483 struct hwrm_tunnel_dst_port_alloc_output {
3484         __le16 error_code;
3485         __le16 req_type;
3486         __le16 seq_id;
3487         __le16 resp_len;
3488         __le16 tunnel_dst_port_id;
3489         u8 unused_0;
3490         u8 unused_1;
3491         u8 unused_2;
3492         u8 unused_3;
3493         u8 unused_4;
3494         u8 valid;
3495 };
3496
3497 /* hwrm_tunnel_dst_port_free */
3498 /* Input (24 bytes) */
3499 struct hwrm_tunnel_dst_port_free_input {
3500         __le16 req_type;
3501         __le16 cmpl_ring;
3502         __le16 seq_id;
3503         __le16 target_id;
3504         __le64 resp_addr;
3505         u8 tunnel_type;
3506         #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN         (0x1UL << 0)
3507         #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE       (0x5UL << 0)
3508         u8 unused_0;
3509         __le16 tunnel_dst_port_id;
3510         __le32 unused_1;
3511 };
3512
3513 /* Output (16 bytes) */
3514 struct hwrm_tunnel_dst_port_free_output {
3515         __le16 error_code;
3516         __le16 req_type;
3517         __le16 seq_id;
3518         __le16 resp_len;
3519         __le32 unused_0;
3520         u8 unused_1;
3521         u8 unused_2;
3522         u8 unused_3;
3523         u8 valid;
3524 };
3525
3526 /* hwrm_stat_ctx_alloc */
3527 /* Input (32 bytes) */
3528 struct hwrm_stat_ctx_alloc_input {
3529         __le16 req_type;
3530         __le16 cmpl_ring;
3531         __le16 seq_id;
3532         __le16 target_id;
3533         __le64 resp_addr;
3534         __le64 stats_dma_addr;
3535         __le32 update_period_ms;
3536         __le32 unused_0;
3537 };
3538
3539 /* Output (16 bytes) */
3540 struct hwrm_stat_ctx_alloc_output {
3541         __le16 error_code;
3542         __le16 req_type;
3543         __le16 seq_id;
3544         __le16 resp_len;
3545         __le32 stat_ctx_id;
3546         u8 unused_0;
3547         u8 unused_1;
3548         u8 unused_2;
3549         u8 valid;
3550 };
3551
3552 /* hwrm_stat_ctx_free */
3553 /* Input (24 bytes) */
3554 struct hwrm_stat_ctx_free_input {
3555         __le16 req_type;
3556         __le16 cmpl_ring;
3557         __le16 seq_id;
3558         __le16 target_id;
3559         __le64 resp_addr;
3560         __le32 stat_ctx_id;
3561         __le32 unused_0;
3562 };
3563
3564 /* Output (16 bytes) */
3565 struct hwrm_stat_ctx_free_output {
3566         __le16 error_code;
3567         __le16 req_type;
3568         __le16 seq_id;
3569         __le16 resp_len;
3570         __le32 stat_ctx_id;
3571         u8 unused_0;
3572         u8 unused_1;
3573         u8 unused_2;
3574         u8 valid;
3575 };
3576
3577 /* hwrm_stat_ctx_query */
3578 /* Input (24 bytes) */
3579 struct hwrm_stat_ctx_query_input {
3580         __le16 req_type;
3581         __le16 cmpl_ring;
3582         __le16 seq_id;
3583         __le16 target_id;
3584         __le64 resp_addr;
3585         __le32 stat_ctx_id;
3586         __le32 unused_0;
3587 };
3588
3589 /* Output (176 bytes) */
3590 struct hwrm_stat_ctx_query_output {
3591         __le16 error_code;
3592         __le16 req_type;
3593         __le16 seq_id;
3594         __le16 resp_len;
3595         __le64 tx_ucast_pkts;
3596         __le64 tx_mcast_pkts;
3597         __le64 tx_bcast_pkts;
3598         __le64 tx_err_pkts;
3599         __le64 tx_drop_pkts;
3600         __le64 tx_ucast_bytes;
3601         __le64 tx_mcast_bytes;
3602         __le64 tx_bcast_bytes;
3603         __le64 rx_ucast_pkts;
3604         __le64 rx_mcast_pkts;
3605         __le64 rx_bcast_pkts;
3606         __le64 rx_err_pkts;
3607         __le64 rx_drop_pkts;
3608         __le64 rx_ucast_bytes;
3609         __le64 rx_mcast_bytes;
3610         __le64 rx_bcast_bytes;
3611         __le64 rx_agg_pkts;
3612         __le64 rx_agg_bytes;
3613         __le64 rx_agg_events;
3614         __le64 rx_agg_aborts;
3615         __le32 unused_0;
3616         u8 unused_1;
3617         u8 unused_2;
3618         u8 unused_3;
3619         u8 valid;
3620 };
3621
3622 /* hwrm_stat_ctx_clr_stats */
3623 /* Input (24 bytes) */
3624 struct hwrm_stat_ctx_clr_stats_input {
3625         __le16 req_type;
3626         __le16 cmpl_ring;
3627         __le16 seq_id;
3628         __le16 target_id;
3629         __le64 resp_addr;
3630         __le32 stat_ctx_id;
3631         __le32 unused_0;
3632 };
3633
3634 /* Output (16 bytes) */
3635 struct hwrm_stat_ctx_clr_stats_output {
3636         __le16 error_code;
3637         __le16 req_type;
3638         __le16 seq_id;
3639         __le16 resp_len;
3640         __le32 unused_0;
3641         u8 unused_1;
3642         u8 unused_2;
3643         u8 unused_3;
3644         u8 valid;
3645 };
3646
3647 /* hwrm_fw_reset */
3648 /* Input (24 bytes) */
3649 struct hwrm_fw_reset_input {
3650         __le16 req_type;
3651         __le16 cmpl_ring;
3652         __le16 seq_id;
3653         __le16 target_id;
3654         __le64 resp_addr;
3655         u8 embedded_proc_type;
3656         #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_BOOT               (0x0UL << 0)
3657         #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_MGMT               (0x1UL << 0)
3658         #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_NETCTRL    (0x2UL << 0)
3659         #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_ROCE               (0x3UL << 0)
3660         #define FW_RESET_REQ_EMBEDDED_PROC_TYPE_RSVD               (0x4UL << 0)
3661         u8 selfrst_status;
3662         #define FW_RESET_REQ_SELFRST_STATUS_SELFRSTNONE    (0x0UL << 0)
3663         #define FW_RESET_REQ_SELFRST_STATUS_SELFRSTASAP    (0x1UL << 0)
3664         #define FW_RESET_REQ_SELFRST_STATUS_SELFRSTPCIERST         (0x2UL << 0)
3665         __le16 unused_0[3];
3666 };
3667
3668 /* Output (16 bytes) */
3669 struct hwrm_fw_reset_output {
3670         __le16 error_code;
3671         __le16 req_type;
3672         __le16 seq_id;
3673         __le16 resp_len;
3674         u8 selfrst_status;
3675         #define FW_RESET_RESP_SELFRST_STATUS_SELFRSTNONE           (0x0UL << 0)
3676         #define FW_RESET_RESP_SELFRST_STATUS_SELFRSTASAP           (0x1UL << 0)
3677         #define FW_RESET_RESP_SELFRST_STATUS_SELFRSTPCIERST       (0x2UL << 0)
3678         u8 unused_0;
3679         __le16 unused_1;
3680         u8 unused_2;
3681         u8 unused_3;
3682         u8 unused_4;
3683         u8 valid;
3684 };
3685
3686 /* hwrm_fw_qstatus */
3687 /* Input (24 bytes) */
3688 struct hwrm_fw_qstatus_input {
3689         __le16 req_type;
3690         __le16 cmpl_ring;
3691         __le16 seq_id;
3692         __le16 target_id;
3693         __le64 resp_addr;
3694         u8 embedded_proc_type;
3695         #define FW_QSTATUS_REQ_EMBEDDED_PROC_TYPE_BOOT             (0x0UL << 0)
3696         #define FW_QSTATUS_REQ_EMBEDDED_PROC_TYPE_MGMT             (0x1UL << 0)
3697         #define FW_QSTATUS_REQ_EMBEDDED_PROC_TYPE_NETCTRL          (0x2UL << 0)
3698         #define FW_QSTATUS_REQ_EMBEDDED_PROC_TYPE_ROCE             (0x3UL << 0)
3699         #define FW_QSTATUS_REQ_EMBEDDED_PROC_TYPE_RSVD             (0x4UL << 0)
3700         u8 unused_0[7];
3701 };
3702
3703 /* Output (16 bytes) */
3704 struct hwrm_fw_qstatus_output {
3705         __le16 error_code;
3706         __le16 req_type;
3707         __le16 seq_id;
3708         __le16 resp_len;
3709         u8 selfrst_status;
3710         #define FW_QSTATUS_RESP_SELFRST_STATUS_SELFRSTNONE         (0x0UL << 0)
3711         #define FW_QSTATUS_RESP_SELFRST_STATUS_SELFRSTASAP         (0x1UL << 0)
3712         #define FW_QSTATUS_RESP_SELFRST_STATUS_SELFRSTPCIERST     (0x2UL << 0)
3713         u8 unused_0;
3714         __le16 unused_1;
3715         u8 unused_2;
3716         u8 unused_3;
3717         u8 unused_4;
3718         u8 valid;
3719 };
3720
3721 /* hwrm_exec_fwd_resp */
3722 /* Input (128 bytes) */
3723 struct hwrm_exec_fwd_resp_input {
3724         __le16 req_type;
3725         __le16 cmpl_ring;
3726         __le16 seq_id;
3727         __le16 target_id;
3728         __le64 resp_addr;
3729         __le32 encap_request[26];
3730         __le16 encap_resp_target_id;
3731         __le16 unused_0[3];
3732 };
3733
3734 /* Output (16 bytes) */
3735 struct hwrm_exec_fwd_resp_output {
3736         __le16 error_code;
3737         __le16 req_type;
3738         __le16 seq_id;
3739         __le16 resp_len;
3740         __le32 unused_0;
3741         u8 unused_1;
3742         u8 unused_2;
3743         u8 unused_3;
3744         u8 valid;
3745 };
3746
3747 /* hwrm_reject_fwd_resp */
3748 /* Input (128 bytes) */
3749 struct hwrm_reject_fwd_resp_input {
3750         __le16 req_type;
3751         __le16 cmpl_ring;
3752         __le16 seq_id;
3753         __le16 target_id;
3754         __le64 resp_addr;
3755         __le32 encap_request[26];
3756         __le16 encap_resp_target_id;
3757         __le16 unused_0[3];
3758 };
3759
3760 /* Output (16 bytes) */
3761 struct hwrm_reject_fwd_resp_output {
3762         __le16 error_code;
3763         __le16 req_type;
3764         __le16 seq_id;
3765         __le16 resp_len;
3766         __le32 unused_0;
3767         u8 unused_1;
3768         u8 unused_2;
3769         u8 unused_3;
3770         u8 valid;
3771 };
3772
3773 /* hwrm_fwd_resp */
3774 /* Input (40 bytes) */
3775 struct hwrm_fwd_resp_input {
3776         __le16 req_type;
3777         __le16 cmpl_ring;
3778         __le16 seq_id;
3779         __le16 target_id;
3780         __le64 resp_addr;
3781         __le16 encap_resp_target_id;
3782         __le16 encap_resp_cmpl_ring;
3783         __le16 encap_resp_len;
3784         u8 unused_0;
3785         u8 unused_1;
3786         __le64 encap_resp_addr;
3787         __le32 encap_resp[24];
3788 };
3789
3790 /* Output (16 bytes) */
3791 struct hwrm_fwd_resp_output {
3792         __le16 error_code;
3793         __le16 req_type;
3794         __le16 seq_id;
3795         __le16 resp_len;
3796         __le32 unused_0;
3797         u8 unused_1;
3798         u8 unused_2;
3799         u8 unused_3;
3800         u8 valid;
3801 };
3802
3803 /* hwrm_fwd_async_event_cmpl */
3804 /* Input (32 bytes) */
3805 struct hwrm_fwd_async_event_cmpl_input {
3806         __le16 req_type;
3807         __le16 cmpl_ring;
3808         __le16 seq_id;
3809         __le16 target_id;
3810         __le64 resp_addr;
3811         __le16 encap_async_event_target_id;
3812         u8 unused_0;
3813         u8 unused_1;
3814         u8 unused_2[3];
3815         u8 unused_3;
3816         __le32 encap_async_event_cmpl[4];
3817 };
3818
3819 /* Output (16 bytes) */
3820 struct hwrm_fwd_async_event_cmpl_output {
3821         __le16 error_code;
3822         __le16 req_type;
3823         __le16 seq_id;
3824         __le16 resp_len;
3825         __le32 unused_0;
3826         u8 unused_1;
3827         u8 unused_2;
3828         u8 unused_3;
3829         u8 valid;
3830 };
3831
3832 /* hwrm_temp_monitor_query */
3833 /* Input (16 bytes) */
3834 struct hwrm_temp_monitor_query_input {
3835         __le16 req_type;
3836         __le16 cmpl_ring;
3837         __le16 seq_id;
3838         __le16 target_id;
3839         __le64 resp_addr;
3840 };
3841
3842 /* Output (16 bytes) */
3843 struct hwrm_temp_monitor_query_output {
3844         __le16 error_code;
3845         __le16 req_type;
3846         __le16 seq_id;
3847         __le16 resp_len;
3848         u8 temp;
3849         u8 unused_0;
3850         __le16 unused_1;
3851         u8 unused_2;
3852         u8 unused_3;
3853         u8 unused_4;
3854         u8 valid;
3855 };
3856
3857 /* hwrm_nvm_raw_write_blk */
3858 /* Input (32 bytes) */
3859 struct hwrm_nvm_raw_write_blk_input {
3860         __le16 req_type;
3861         __le16 cmpl_ring;
3862         __le16 seq_id;
3863         __le16 target_id;
3864         __le64 resp_addr;
3865         __le64 host_src_addr;
3866         __le32 dest_addr;
3867         __le32 len;
3868 };
3869
3870 /* Output (16 bytes) */
3871 struct hwrm_nvm_raw_write_blk_output {
3872         __le16 error_code;
3873         __le16 req_type;
3874         __le16 seq_id;
3875         __le16 resp_len;
3876         __le32 unused_0;
3877         u8 unused_1;
3878         u8 unused_2;
3879         u8 unused_3;
3880         u8 valid;
3881 };
3882
3883 /* hwrm_nvm_read */
3884 /* Input (40 bytes) */
3885 struct hwrm_nvm_read_input {
3886         __le16 req_type;
3887         __le16 cmpl_ring;
3888         __le16 seq_id;
3889         __le16 target_id;
3890         __le64 resp_addr;
3891         __le64 host_dest_addr;
3892         __le16 dir_idx;
3893         u8 unused_0;
3894         u8 unused_1;
3895         __le32 offset;
3896         __le32 len;
3897         __le32 unused_2;
3898 };
3899
3900 /* Output (16 bytes) */
3901 struct hwrm_nvm_read_output {
3902         __le16 error_code;
3903         __le16 req_type;
3904         __le16 seq_id;
3905         __le16 resp_len;
3906         __le32 unused_0;
3907         u8 unused_1;
3908         u8 unused_2;
3909         u8 unused_3;
3910         u8 valid;
3911 };
3912
3913 /* hwrm_nvm_raw_dump */
3914 /* Input (32 bytes) */
3915 struct hwrm_nvm_raw_dump_input {
3916         __le16 req_type;
3917         __le16 cmpl_ring;
3918         __le16 seq_id;
3919         __le16 target_id;
3920         __le64 resp_addr;
3921         __le64 host_dest_addr;
3922         __le32 offset;
3923         __le32 len;
3924 };
3925
3926 /* Output (16 bytes) */
3927 struct hwrm_nvm_raw_dump_output {
3928         __le16 error_code;
3929         __le16 req_type;
3930         __le16 seq_id;
3931         __le16 resp_len;
3932         __le32 unused_0;
3933         u8 unused_1;
3934         u8 unused_2;
3935         u8 unused_3;
3936         u8 valid;
3937 };
3938
3939 /* hwrm_nvm_get_dir_entries */
3940 /* Input (24 bytes) */
3941 struct hwrm_nvm_get_dir_entries_input {
3942         __le16 req_type;
3943         __le16 cmpl_ring;
3944         __le16 seq_id;
3945         __le16 target_id;
3946         __le64 resp_addr;
3947         __le64 host_dest_addr;
3948 };
3949
3950 /* Output (16 bytes) */
3951 struct hwrm_nvm_get_dir_entries_output {
3952         __le16 error_code;
3953         __le16 req_type;
3954         __le16 seq_id;
3955         __le16 resp_len;
3956         __le32 unused_0;
3957         u8 unused_1;
3958         u8 unused_2;
3959         u8 unused_3;
3960         u8 valid;
3961 };
3962
3963 /* hwrm_nvm_get_dir_info */
3964 /* Input (16 bytes) */
3965 struct hwrm_nvm_get_dir_info_input {
3966         __le16 req_type;
3967         __le16 cmpl_ring;
3968         __le16 seq_id;
3969         __le16 target_id;
3970         __le64 resp_addr;
3971 };
3972
3973 /* Output (24 bytes) */
3974 struct hwrm_nvm_get_dir_info_output {
3975         __le16 error_code;
3976         __le16 req_type;
3977         __le16 seq_id;
3978         __le16 resp_len;
3979         __le32 entries;
3980         __le32 entry_length;
3981         __le32 unused_0;
3982         u8 unused_1;
3983         u8 unused_2;
3984         u8 unused_3;
3985         u8 valid;
3986 };
3987
3988 /* hwrm_nvm_write */
3989 /* Input (48 bytes) */
3990 struct hwrm_nvm_write_input {
3991         __le16 req_type;
3992         __le16 cmpl_ring;
3993         __le16 seq_id;
3994         __le16 target_id;
3995         __le64 resp_addr;
3996         __le64 host_src_addr;
3997         __le16 dir_type;
3998         __le16 dir_ordinal;
3999         __le16 dir_ext;
4000         __le16 dir_attr;
4001         __le32 dir_data_length;
4002         __le16 option;
4003         __le16 flags;
4004         #define NVM_WRITE_REQ_FLAGS_KEEP_ORIG_ACTIVE_IMG            0x1UL
4005         __le32 dir_item_length;
4006         __le32 unused_0;
4007 };
4008
4009 /* Output (16 bytes) */
4010 struct hwrm_nvm_write_output {
4011         __le16 error_code;
4012         __le16 req_type;
4013         __le16 seq_id;
4014         __le16 resp_len;
4015         __le32 dir_item_length;
4016         __le16 dir_idx;
4017         u8 unused_0;
4018         u8 valid;
4019 };
4020
4021 /* hwrm_nvm_modify */
4022 /* Input (40 bytes) */
4023 struct hwrm_nvm_modify_input {
4024         __le16 req_type;
4025         __le16 cmpl_ring;
4026         __le16 seq_id;
4027         __le16 target_id;
4028         __le64 resp_addr;
4029         __le64 host_src_addr;
4030         __le16 dir_idx;
4031         u8 unused_0;
4032         u8 unused_1;
4033         __le32 offset;
4034         __le32 len;
4035         __le32 unused_2;
4036 };
4037
4038 /* Output (16 bytes) */
4039 struct hwrm_nvm_modify_output {
4040         __le16 error_code;
4041         __le16 req_type;
4042         __le16 seq_id;
4043         __le16 resp_len;
4044         __le32 unused_0;
4045         u8 unused_1;
4046         u8 unused_2;
4047         u8 unused_3;
4048         u8 valid;
4049 };
4050
4051 /* hwrm_nvm_find_dir_entry */
4052 /* Input (32 bytes) */
4053 struct hwrm_nvm_find_dir_entry_input {
4054         __le16 req_type;
4055         __le16 cmpl_ring;
4056         __le16 seq_id;
4057         __le16 target_id;
4058         __le64 resp_addr;
4059         __le32 enables;
4060         #define NVM_FIND_DIR_ENTRY_REQ_ENABLES_DIR_IDX_VALID       0x1UL
4061         __le16 dir_idx;
4062         __le16 dir_type;
4063         __le16 dir_ordinal;
4064         __le16 dir_ext;
4065         u8 opt_ordinal;
4066         #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_MASK     0x3UL
4067         #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_SFT              0
4068         #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_EQ              (0x0UL << 0)
4069         #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_GE              (0x1UL << 0)
4070         #define NVM_FIND_DIR_ENTRY_REQ_OPT_ORDINAL_GT              (0x2UL << 0)
4071         u8 unused_1[3];
4072 };
4073
4074 /* Output (32 bytes) */
4075 struct hwrm_nvm_find_dir_entry_output {
4076         __le16 error_code;
4077         __le16 req_type;
4078         __le16 seq_id;
4079         __le16 resp_len;
4080         __le32 dir_item_length;
4081         __le32 dir_data_length;
4082         __le32 fw_ver;
4083         __le16 dir_ordinal;
4084         __le16 dir_idx;
4085         __le32 unused_0;
4086         u8 unused_1;
4087         u8 unused_2;
4088         u8 unused_3;
4089         u8 valid;
4090 };
4091
4092 /* hwrm_nvm_erase_dir_entry */
4093 /* Input (24 bytes) */
4094 struct hwrm_nvm_erase_dir_entry_input {
4095         __le16 req_type;
4096         __le16 cmpl_ring;
4097         __le16 seq_id;
4098         __le16 target_id;
4099         __le64 resp_addr;
4100         __le16 dir_idx;
4101         __le16 unused_0[3];
4102 };
4103
4104 /* Output (16 bytes) */
4105 struct hwrm_nvm_erase_dir_entry_output {
4106         __le16 error_code;
4107         __le16 req_type;
4108         __le16 seq_id;
4109         __le16 resp_len;
4110         __le32 unused_0;
4111         u8 unused_1;
4112         u8 unused_2;
4113         u8 unused_3;
4114         u8 valid;
4115 };
4116
4117 /* hwrm_nvm_get_dev_info */
4118 /* Input (16 bytes) */
4119 struct hwrm_nvm_get_dev_info_input {
4120         __le16 req_type;
4121         __le16 cmpl_ring;
4122         __le16 seq_id;
4123         __le16 target_id;
4124         __le64 resp_addr;
4125 };
4126
4127 /* Output (32 bytes) */
4128 struct hwrm_nvm_get_dev_info_output {
4129         __le16 error_code;
4130         __le16 req_type;
4131         __le16 seq_id;
4132         __le16 resp_len;
4133         __le16 manufacturer_id;
4134         __le16 device_id;
4135         __le32 sector_size;
4136         __le32 nvram_size;
4137         __le32 reserved_size;
4138         __le32 available_size;
4139         u8 unused_0;
4140         u8 unused_1;
4141         u8 unused_2;
4142         u8 valid;
4143 };
4144
4145 /* hwrm_nvm_mod_dir_entry */
4146 /* Input (32 bytes) */
4147 struct hwrm_nvm_mod_dir_entry_input {
4148         __le16 req_type;
4149         __le16 cmpl_ring;
4150         __le16 seq_id;
4151         __le16 target_id;
4152         __le64 resp_addr;
4153         __le32 enables;
4154         #define NVM_MOD_DIR_ENTRY_REQ_ENABLES_CHECKSUM              0x1UL
4155         __le16 dir_idx;
4156         __le16 dir_ordinal;
4157         __le16 dir_ext;
4158         __le16 dir_attr;
4159         __le32 checksum;
4160 };
4161
4162 /* Output (16 bytes) */
4163 struct hwrm_nvm_mod_dir_entry_output {
4164         __le16 error_code;
4165         __le16 req_type;
4166         __le16 seq_id;
4167         __le16 resp_len;
4168         __le32 unused_0;
4169         u8 unused_1;
4170         u8 unused_2;
4171         u8 unused_3;
4172         u8 valid;
4173 };
4174
4175 /* hwrm_nvm_verify_update */
4176 /* Input (24 bytes) */
4177 struct hwrm_nvm_verify_update_input {
4178         __le16 req_type;
4179         __le16 cmpl_ring;
4180         __le16 seq_id;
4181         __le16 target_id;
4182         __le64 resp_addr;
4183         __le16 dir_type;
4184         __le16 dir_ordinal;
4185         __le16 dir_ext;
4186         __le16 unused_0;
4187 };
4188
4189 /* Output (16 bytes) */
4190 struct hwrm_nvm_verify_update_output {
4191         __le16 error_code;
4192         __le16 req_type;
4193         __le16 seq_id;
4194         __le16 resp_len;
4195         __le32 unused_0;
4196         u8 unused_1;
4197         u8 unused_2;
4198         u8 unused_3;
4199         u8 valid;
4200 };
4201
4202 #endif