net/bnxt: add hardware resource manager init code
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright(c) Broadcom Limited.
5  *   All rights reserved.
6  *
7  *   Redistribution and use in source and binary forms, with or without
8  *   modification, are permitted provided that the following conditions
9  *   are met:
10  *
11  *     * Redistributions of source code must retain the above copyright
12  *       notice, this list of conditions and the following disclaimer.
13  *     * Redistributions in binary form must reproduce the above copyright
14  *       notice, this list of conditions and the following disclaimer in
15  *       the documentation and/or other materials provided with the
16  *       distribution.
17  *     * Neither the name of Broadcom Corporation nor the names of its
18  *       contributors may be used to endorse or promote products derived
19  *       from this software without specific prior written permission.
20  *
21  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef _HSI_STRUCT_DEF_EXTERNAL_H_
35 #define _HSI_STRUCT_DEF_EXTERNAL_H_
36
37 /* HW Resource Manager Specification 1.2.0 */
38 #define HWRM_VERSION_MAJOR      1
39 #define HWRM_VERSION_MINOR      2
40 #define HWRM_VERSION_UPDATE     0
41
42 /*
43  * Following is the signature for HWRM message field that indicates not
44  * applicable (All F's). Need to cast it the size of the field if needed.
45  */
46 #define HWRM_MAX_REQ_LEN        (128)  /* hwrm_func_buf_rgtr */
47 #define HWRM_MAX_RESP_LEN       (176)  /* hwrm_func_qstats */
48 #define HWRM_RESP_VALID_KEY     1 /* valid key for HWRM response */
49
50 /*
51  * Request types
52  */
53 #define HWRM_VER_GET                    (UINT32_C(0x0))
54 #define HWRM_FUNC_QCAPS                 (UINT32_C(0x15))
55 #define HWRM_QUEUE_QPORTCFG             (UINT32_C(0x30))
56
57 /*
58  * Note: The Hardware Resource Manager (HWRM) manages various hardware resources
59  * inside the chip. The HWRM is implemented in firmware, and runs on embedded
60  * processors inside the chip. This firmware is vital part of the chip's
61  * hardware. The chip can not be used by driver without it.
62  */
63
64 /* Input (16 bytes) */
65 struct input {
66         /*
67          * This value indicates what type of request this is. The format for the
68          * rest of the command is determined by this field.
69          */
70         uint16_t req_type;
71
72         /*
73          * This value indicates the what completion ring the request will be
74          * optionally completed on. If the value is -1, then no CR completion
75          * will be generated. Any other value must be a valid CR ring_id value
76          * for this function.
77          */
78         uint16_t cmpl_ring;
79
80         /* This value indicates the command sequence number. */
81         uint16_t seq_id;
82
83         /*
84          * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
85          * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
86          */
87         uint16_t target_id;
88
89         /*
90          * This is the host address where the response will be written when the
91          * request is complete. This area must be 16B aligned and must be
92          * cleared to zero before the request is made.
93          */
94         uint64_t resp_addr;
95 } __attribute__((packed));
96
97 /* Output (8 bytes) */
98 struct output {
99         /*
100          * Pass/Fail or error type Note: receiver to verify the in parameters,
101          * and fail the call with an error when appropriate
102          */
103         uint16_t error_code;
104
105         /* This field returns the type of original request. */
106         uint16_t req_type;
107
108         /* This field provides original sequence number of the command. */
109         uint16_t seq_id;
110
111         /*
112          * This field is the length of the response in bytes. The last byte of
113          * the response is a valid flag that will read as '1' when the command
114          * has been completely written to memory.
115          */
116         uint16_t resp_len;
117 } __attribute__((packed));
118
119 /* hwrm_func_qcaps */
120 /*
121  * Description: This command returns capabilities of a function. The input FID
122  * value is used to indicate what function is being queried. This allows a
123  * physical function driver to query virtual functions that are children of the
124  * physical function. The output FID value is needed to configure Rings and
125  * MSI-X vectors so their DMA operations appear correctly on the PCI bus.
126  */
127
128 /* Input (24 bytes) */
129 struct hwrm_func_qcaps_input {
130         /*
131          * This value indicates what type of request this is. The format for the
132          * rest of the command is determined by this field.
133          */
134         uint16_t req_type;
135
136         /*
137          * This value indicates the what completion ring the request will be
138          * optionally completed on. If the value is -1, then no CR completion
139          * will be generated. Any other value must be a valid CR ring_id value
140          * for this function.
141          */
142         uint16_t cmpl_ring;
143
144         /* This value indicates the command sequence number. */
145         uint16_t seq_id;
146
147         /*
148          * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
149          * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
150          */
151         uint16_t target_id;
152
153         /*
154          * This is the host address where the response will be written when the
155          * request is complete. This area must be 16B aligned and must be
156          * cleared to zero before the request is made.
157          */
158         uint64_t resp_addr;
159
160         /*
161          * Function ID of the function that is being queried. 0xFF... (All Fs)
162          * if the query is for the requesting function.
163          */
164         uint16_t fid;
165
166         uint16_t unused_0[3];
167 } __attribute__((packed));
168
169 /* Output (80 bytes) */
170 struct hwrm_func_qcaps_output {
171         /*
172          * Pass/Fail or error type Note: receiver to verify the in parameters,
173          * and fail the call with an error when appropriate
174          */
175         uint16_t error_code;
176
177         /* This field returns the type of original request. */
178         uint16_t req_type;
179
180         /* This field provides original sequence number of the command. */
181         uint16_t seq_id;
182
183         /*
184          * This field is the length of the response in bytes. The last byte of
185          * the response is a valid flag that will read as '1' when the command
186          * has been completely written to memory.
187          */
188         uint16_t resp_len;
189
190         /*
191          * FID value. This value is used to identify operations on the PCI bus
192          * as belonging to a particular PCI function.
193          */
194         uint16_t fid;
195
196         /*
197          * Port ID of port that this function is associated with. Valid only for
198          * the PF. 0xFF... (All Fs) if this function is not associated with any
199          * port. 0xFF... (All Fs) if this function is called from a VF.
200          */
201         uint16_t port_id;
202
203         /* If 1, then Push mode is supported on this function. */
204         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PUSH_MODE_SUPPORTED   UINT32_C(0x1)
205         /*
206          * If 1, then the global MSI-X auto-masking is enabled for the device.
207          */
208         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_GLOBAL_MSIX_AUTOMASKING \
209                                                                 UINT32_C(0x2)
210         /*
211          * If 1, then the Precision Time Protocol (PTP) processing is supported
212          * on this function. The HWRM should enable PTP on only a single
213          * Physical Function (PF) per port.
214          */
215         #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PTP_SUPPORTED         UINT32_C(0x4)
216         uint32_t flags;
217
218         /*
219          * This value is current MAC address configured for this function. A
220          * value of 00-00-00-00-00-00 indicates no MAC address is currently
221          * configured.
222          */
223         uint8_t perm_mac_address[6];
224
225         /*
226          * The maximum number of RSS/COS contexts that can be allocated to the
227          * function.
228          */
229         uint16_t max_rsscos_ctx;
230
231         /*
232          * The maximum number of completion rings that can be allocated to the
233          * function.
234          */
235         uint16_t max_cmpl_rings;
236
237         /*
238          * The maximum number of transmit rings that can be allocated to the
239          * function.
240          */
241         uint16_t max_tx_rings;
242
243         /*
244          * The maximum number of receive rings that can be allocated to the
245          * function.
246          */
247         uint16_t max_rx_rings;
248
249         /*
250          * The maximum number of L2 contexts that can be allocated to the
251          * function.
252          */
253         uint16_t max_l2_ctxs;
254
255         /* The maximum number of VNICs that can be allocated to the function. */
256         uint16_t max_vnics;
257
258         /*
259          * The identifier for the first VF enabled on a PF. This is valid only
260          * on the PF with SR-IOV enabled. 0xFF... (All Fs) if this command is
261          * called on a PF with SR-IOV disabled or on a VF.
262          */
263         uint16_t first_vf_id;
264
265         /*
266          * The maximum number of VFs that can be allocated to the function. This
267          * is valid only on the PF with SR-IOV enabled. 0xFF... (All Fs) if this
268          * command is called on a PF with SR-IOV disabled or on a VF.
269          */
270         uint16_t max_vfs;
271
272         /*
273          * The maximum number of statistic contexts that can be allocated to the
274          * function.
275          */
276         uint16_t max_stat_ctx;
277
278         /*
279          * The maximum number of Encapsulation records that can be offloaded by
280          * this function.
281          */
282         uint32_t max_encap_records;
283
284         /*
285          * The maximum number of decapsulation records that can be offloaded by
286          * this function.
287          */
288         uint32_t max_decap_records;
289
290         /*
291          * The maximum number of Exact Match (EM) flows that can be offloaded by
292          * this function on the TX side.
293          */
294         uint32_t max_tx_em_flows;
295
296         /*
297          * The maximum number of Wildcard Match (WM) flows that can be offloaded
298          * by this function on the TX side.
299          */
300         uint32_t max_tx_wm_flows;
301
302         /*
303          * The maximum number of Exact Match (EM) flows that can be offloaded by
304          * this function on the RX side.
305          */
306         uint32_t max_rx_em_flows;
307
308         /*
309          * The maximum number of Wildcard Match (WM) flows that can be offloaded
310          * by this function on the RX side.
311          */
312         uint32_t max_rx_wm_flows;
313
314         /*
315          * The maximum number of multicast filters that can be supported by this
316          * function on the RX side.
317          */
318         uint32_t max_mcast_filters;
319
320         /*
321          * The maximum value of flow_id that can be supported in completion
322          * records.
323          */
324         uint32_t max_flow_id;
325
326         /*
327          * The maximum number of HW ring groups that can be supported on this
328          * function.
329          */
330         uint32_t max_hw_ring_grps;
331
332         uint8_t unused_0;
333         uint8_t unused_1;
334         uint8_t unused_2;
335
336         /*
337          * This field is used in Output records to indicate that the output is
338          * completely written to RAM. This field should be read as '1' to
339          * indicate that the output has been completely written. When writing a
340          * command completion or response to an internal processor, the order of
341          * writes has to be such that this field is written last.
342          */
343         uint8_t valid;
344 } __attribute__((packed));
345
346 /* hwrm_ver_get */
347 /*
348  * Description: This function is called by a driver to determine the HWRM
349  * interface version supported by the HWRM firmware, the version of HWRM
350  * firmware implementation, the name of HWRM firmware, the versions of other
351  * embedded firmwares, and the names of other embedded firmwares, etc. Any
352  * interface or firmware version with major = 0, minor = 0, and update = 0 shall
353  * be considered an invalid version.
354  */
355
356 /* Input (24 bytes) */
357 struct hwrm_ver_get_input {
358         /*
359          * This value indicates what type of request this is. The format for the
360          * rest of the command is determined by this field.
361          */
362         uint16_t req_type;
363
364         /*
365          * This value indicates the what completion ring the request will be
366          * optionally completed on. If the value is -1, then no CR completion
367          * will be generated. Any other value must be a valid CR ring_id value
368          * for this function.
369          */
370         uint16_t cmpl_ring;
371
372         /* This value indicates the command sequence number. */
373         uint16_t seq_id;
374
375         /*
376          * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
377          * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
378          */
379         uint16_t target_id;
380
381         /*
382          * This is the host address where the response will be written when the
383          * request is complete. This area must be 16B aligned and must be
384          * cleared to zero before the request is made.
385          */
386         uint64_t resp_addr;
387
388         /*
389          * This field represents the major version of HWRM interface
390          * specification supported by the driver HWRM implementation. The
391          * interface major version is intended to change only when non backward
392          * compatible changes are made to the HWRM interface specification.
393          */
394         uint8_t hwrm_intf_maj;
395
396         /*
397          * This field represents the minor version of HWRM interface
398          * specification supported by the driver HWRM implementation. A change
399          * in interface minor version is used to reflect significant backward
400          * compatible modification to HWRM interface specification. This can be
401          * due to addition or removal of functionality. HWRM interface
402          * specifications with the same major version but different minor
403          * versions are compatible.
404          */
405         uint8_t hwrm_intf_min;
406
407         /*
408          * This field represents the update version of HWRM interface
409          * specification supported by the driver HWRM implementation. The
410          * interface update version is used to reflect minor changes or bug
411          * fixes to a released HWRM interface specification.
412          */
413         uint8_t hwrm_intf_upd;
414
415         uint8_t unused_0[5];
416 } __attribute__((packed));
417
418 /* Output (128 bytes) */
419 struct hwrm_ver_get_output {
420         /*
421          * Pass/Fail or error type Note: receiver to verify the in parameters,
422          * and fail the call with an error when appropriate
423          */
424         uint16_t error_code;
425
426         /* This field returns the type of original request. */
427         uint16_t req_type;
428
429         /* This field provides original sequence number of the command. */
430         uint16_t seq_id;
431
432         /*
433          * This field is the length of the response in bytes. The last byte of
434          * the response is a valid flag that will read as '1' when the command
435          * has been completely written to memory.
436          */
437         uint16_t resp_len;
438
439         /*
440          * This field represents the major version of HWRM interface
441          * specification supported by the HWRM implementation. The interface
442          * major version is intended to change only when non backward compatible
443          * changes are made to the HWRM interface specification. A HWRM
444          * implementation that is compliant with this specification shall
445          * provide value of 1 in this field.
446          */
447         uint8_t hwrm_intf_maj;
448
449         /*
450          * This field represents the minor version of HWRM interface
451          * specification supported by the HWRM implementation. A change in
452          * interface minor version is used to reflect significant backward
453          * compatible modification to HWRM interface specification. This can be
454          * due to addition or removal of functionality. HWRM interface
455          * specifications with the same major version but different minor
456          * versions are compatible. A HWRM implementation that is compliant with
457          * this specification shall provide value of 0 in this field.
458          */
459         uint8_t hwrm_intf_min;
460
461         /*
462          * This field represents the update version of HWRM interface
463          * specification supported by the HWRM implementation. The interface
464          * update version is used to reflect minor changes or bug fixes to a
465          * released HWRM interface specification. A HWRM implementation that is
466          * compliant with this specification shall provide value of 1 in this
467          * field.
468          */
469         uint8_t hwrm_intf_upd;
470
471         uint8_t hwrm_intf_rsvd;
472
473         /*
474          * This field represents the major version of HWRM firmware. A change in
475          * firmware major version represents a major firmware release.
476          */
477         uint8_t hwrm_fw_maj;
478
479         /*
480          * This field represents the minor version of HWRM firmware. A change in
481          * firmware minor version represents significant firmware functionality
482          * changes.
483          */
484         uint8_t hwrm_fw_min;
485
486         /*
487          * This field represents the build version of HWRM firmware. A change in
488          * firmware build version represents bug fixes to a released firmware.
489          */
490         uint8_t hwrm_fw_bld;
491
492         /*
493          * This field is a reserved field. This field can be used to represent
494          * firmware branches or customer specific releases tied to a specific
495          * (major,minor,update) version of the HWRM firmware.
496          */
497         uint8_t hwrm_fw_rsvd;
498
499         /*
500          * This field represents the major version of mgmt firmware. A change in
501          * major version represents a major release.
502          */
503         uint8_t mgmt_fw_maj;
504
505         /*
506          * This field represents the minor version of mgmt firmware. A change in
507          * minor version represents significant functionality changes.
508          */
509         uint8_t mgmt_fw_min;
510
511         /*
512          * This field represents the build version of mgmt firmware. A change in
513          * update version represents bug fixes.
514          */
515         uint8_t mgmt_fw_bld;
516
517         /*
518          * This field is a reserved field. This field can be used to represent
519          * firmware branches or customer specific releases tied to a specific
520          * (major,minor,update) version
521          */
522         uint8_t mgmt_fw_rsvd;
523
524         /*
525          * This field represents the major version of network control firmware.
526          * A change in major version represents a major release.
527          */
528         uint8_t netctrl_fw_maj;
529
530         /*
531          * This field represents the minor version of network control firmware.
532          * A change in minor version represents significant functionality
533          * changes.
534          */
535         uint8_t netctrl_fw_min;
536
537         /*
538          * This field represents the build version of network control firmware.
539          * A change in update version represents bug fixes.
540          */
541         uint8_t netctrl_fw_bld;
542
543         /*
544          * This field is a reserved field. This field can be used to represent
545          * firmware branches or customer specific releases tied to a specific
546          * (major,minor,update) version
547          */
548         uint8_t netctrl_fw_rsvd;
549
550         /*
551          * This field is reserved for future use. The responder should set it to
552          * 0. The requester should ignore this field.
553          */
554         uint32_t reserved1;
555
556         /*
557          * This field represents the major version of RoCE firmware. A change in
558          * major version represents a major release.
559          */
560         uint8_t roce_fw_maj;
561
562         /*
563          * This field represents the minor version of RoCE firmware. A change in
564          * minor version represents significant functionality changes.
565          */
566         uint8_t roce_fw_min;
567
568         /*
569          * This field represents the build version of RoCE firmware. A change in
570          * update version represents bug fixes.
571          */
572         uint8_t roce_fw_bld;
573
574         /*
575          * This field is a reserved field. This field can be used to represent
576          * firmware branches or customer specific releases tied to a specific
577          * (major,minor,update) version
578          */
579         uint8_t roce_fw_rsvd;
580
581         /*
582          * This field represents the name of HWRM FW (ASCII chars without NULL
583          * at the end).
584          */
585         char hwrm_fw_name[16];
586
587         /*
588          * This field represents the name of mgmt FW (ASCII chars without NULL
589          * at the end).
590          */
591         char mgmt_fw_name[16];
592
593         /*
594          * This field represents the name of network control firmware (ASCII
595          * chars without NULL at the end).
596          */
597         char netctrl_fw_name[16];
598
599         /*
600          * This field is reserved for future use. The responder should set it to
601          * 0. The requester should ignore this field.
602          */
603         uint32_t reserved2[4];
604
605         /*
606          * This field represents the name of RoCE FW (ASCII chars without NULL
607          * at the end).
608          */
609         char roce_fw_name[16];
610
611         /* This field returns the chip number. */
612         uint16_t chip_num;
613
614         /* This field returns the revision of chip. */
615         uint8_t chip_rev;
616
617         /* This field returns the chip metal number. */
618         uint8_t chip_metal;
619
620         /* This field returns the bond id of the chip. */
621         uint8_t chip_bond_id;
622
623         /*
624          * This value indicates the type of platform used for chip
625          * implementation.
626          */
627         /* ASIC */
628         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_ASIC \
629                                                         (UINT32_C(0x0) << 0)
630         /* FPGA platform of the chip. */
631         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_FPGA \
632                                                         (UINT32_C(0x1) << 0)
633         /* Palladium platform of the chip. */
634         #define HWRM_VER_GET_OUTPUT_CHIP_PLATFORM_TYPE_PALLADIUM \
635                                                         (UINT32_C(0x2) << 0)
636         uint8_t chip_platform_type;
637
638         /*
639          * This field returns the maximum value of request window that is
640          * supported by the HWRM. The request window is mapped into device
641          * address space using MMIO.
642          */
643         uint16_t max_req_win_len;
644
645         /*
646          * This field returns the maximum value of response buffer in bytes. If
647          * a request specifies the response buffer length that is greater than
648          * this value, then the HWRM should fail it. The value of this field
649          * shall be 4KB or more.
650          */
651         uint16_t max_resp_len;
652
653         /*
654          * This field returns the default request timeout value in milliseconds.
655          */
656         uint16_t def_req_timeout;
657
658         uint8_t unused_0;
659         uint8_t unused_1;
660         uint8_t unused_2;
661
662         /*
663          * This field is used in Output records to indicate that the output is
664          * completely written to RAM. This field should be read as '1' to
665          * indicate that the output has been completely written. When writing a
666          * command completion or response to an internal processor, the order of
667          * writes has to be such that this field is written last.
668          */
669         uint8_t valid;
670 } __attribute__((packed));
671
672 /* hwrm_queue_qportcfg */
673 /*
674  * Description: This function is called by a driver to query queue configuration
675  * of a port. # The HWRM shall at least advertise one queue with lossy service
676  * profile. # The driver shall use this command to query queue ids before
677  * configuring or using any queues. # If a service profile is not set for a
678  * queue, then the driver shall not use that queue without configuring a service
679  * profile for it. # If the driver is not allowed to configure service profiles,
680  * then the driver shall only use queues for which service profiles are pre-
681  * configured.
682  */
683
684 /* Input (24 bytes) */
685 struct hwrm_queue_qportcfg_input {
686         /*
687          * This value indicates what type of request this is. The format for the
688          * rest of the command is determined by this field.
689          */
690         uint16_t req_type;
691
692         /*
693          * This value indicates the what completion ring the request will be
694          * optionally completed on. If the value is -1, then no CR completion
695          * will be generated. Any other value must be a valid CR ring_id value
696          * for this function.
697          */
698         uint16_t cmpl_ring;
699
700         /* This value indicates the command sequence number. */
701         uint16_t seq_id;
702
703         /*
704          * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
705          * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
706          */
707         uint16_t target_id;
708
709         /*
710          * This is the host address where the response will be written when the
711          * request is complete. This area must be 16B aligned and must be
712          * cleared to zero before the request is made.
713          */
714         uint64_t resp_addr;
715
716         /*
717          * Enumeration denoting the RX, TX type of the resource. This
718          * enumeration is used for resources that are similar for both TX and RX
719          * paths of the chip.
720          */
721         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH \
722                                                         UINT32_C(0x1)
723                 /* tx path */
724         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_TX \
725                                                         (UINT32_C(0x0) << 0)
726                 /* rx path */
727         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX \
728                                                         (UINT32_C(0x1) << 0)
729         #define HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_LAST \
730                                         HWRM_QUEUE_QPORTCFG_INPUT_FLAGS_PATH_RX
731         uint32_t flags;
732
733         /*
734          * Port ID of port for which the queue configuration is being queried.
735          * This field is only required when sent by IPC.
736          */
737         uint16_t port_id;
738
739         uint16_t unused_0;
740 } __attribute__((packed));
741
742 /* Output (32 bytes) */
743 struct hwrm_queue_qportcfg_output {
744         /*
745          * Pass/Fail or error type Note: receiver to verify the in parameters,
746          * and fail the call with an error when appropriate
747          */
748         uint16_t error_code;
749
750         /* This field returns the type of original request. */
751         uint16_t req_type;
752
753         /* This field provides original sequence number of the command. */
754         uint16_t seq_id;
755
756         /*
757          * This field is the length of the response in bytes. The last byte of
758          * the response is a valid flag that will read as '1' when the command
759          * has been completely written to memory.
760          */
761         uint16_t resp_len;
762
763         /* The maximum number of queues that can be configured. */
764         uint8_t max_configurable_queues;
765
766         /* The maximum number of lossless queues that can be configured. */
767         uint8_t max_configurable_lossless_queues;
768
769         /*
770          * 0 - Not allowed. Non-zero - Allowed. If this value is non-zero, then
771          * the HWRM shall allow the host SW driver to configure queues using
772          * hwrm_queue_cfg.
773          */
774         uint8_t queue_cfg_allowed;
775
776         /*
777          * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
778          * the HWRM shall allow the host SW driver to configure queue buffers
779          * using hwrm_queue_buffers_cfg.
780          */
781         uint8_t queue_buffers_cfg_allowed;
782
783         /*
784          * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
785          * the HWRM shall allow the host SW driver to configure PFC using
786          * hwrm_queue_pfcenable_cfg.
787          */
788         uint8_t queue_pfcenable_cfg_allowed;
789
790         /*
791          * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
792          * the HWRM shall allow the host SW driver to configure Priority to CoS
793          * mapping using hwrm_queue_pri2cos_cfg.
794          */
795         uint8_t queue_pri2cos_cfg_allowed;
796
797         /*
798          * 0 - Not allowed. Non-zero - Allowed If this value is non-zero, then
799          * the HWRM shall allow the host SW driver to configure CoS Bandwidth
800          * configuration using hwrm_queue_cos2bw_cfg.
801          */
802         uint8_t queue_cos2bw_cfg_allowed;
803
804         /* ID of CoS Queue 0. FF - Invalid id */
805         uint8_t queue_id0;
806
807         /* This value is applicable to CoS queues only. */
808                 /* Lossy (best-effort) */
809         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSY \
810                                                         (UINT32_C(0x0) << 0)
811                 /* Lossless */
812         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_LOSSLESS \
813                                                         (UINT32_C(0x1) << 0)
814                 /*
815                  * Set to 0xFF... (All Fs) if there is no service profile
816                  * specified
817                  */
818         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID0_SERVICE_PROFILE_UNKNOWN \
819                                                         (UINT32_C(0xff) << 0)
820         uint8_t queue_id0_service_profile;
821
822         /* ID of CoS Queue 1. FF - Invalid id */
823         uint8_t queue_id1;
824         /* This value is applicable to CoS queues only. */
825                 /* Lossy (best-effort) */
826         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSY \
827                                                         (UINT32_C(0x0) << 0)
828                 /* Lossless */
829         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_LOSSLESS \
830                                                         (UINT32_C(0x1) << 0)
831                 /*
832                  * Set to 0xFF... (All Fs) if there is no service profile
833                  * specified
834                  */
835         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID1_SERVICE_PROFILE_UNKNOWN \
836                                                         (UINT32_C(0xff) << 0)
837         uint8_t queue_id1_service_profile;
838
839         /* ID of CoS Queue 2. FF - Invalid id */
840         uint8_t queue_id2;
841         /* This value is applicable to CoS queues only. */
842                 /* Lossy (best-effort) */
843         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSY \
844                                                         (UINT32_C(0x0) << 0)
845                 /* Lossless */
846         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_LOSSLESS \
847                                                         (UINT32_C(0x1) << 0)
848                 /*
849                  * Set to 0xFF... (All Fs) if there is no service profile
850                  * specified
851                  */
852         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID2_SERVICE_PROFILE_UNKNOWN \
853                                                         (UINT32_C(0xff) << 0)
854         uint8_t queue_id2_service_profile;
855
856         /* ID of CoS Queue 3. FF - Invalid id */
857         uint8_t queue_id3;
858
859         /* This value is applicable to CoS queues only. */
860                 /* Lossy (best-effort) */
861         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSY \
862                                                         (UINT32_C(0x0) << 0)
863                 /* Lossless */
864         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_LOSSLESS \
865                                                         (UINT32_C(0x1) << 0)
866                 /*
867                  * Set to 0xFF... (All Fs) if there is no service profile
868                  * specified
869                  */
870         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID3_SERVICE_PROFILE_UNKNOWN \
871                                                         (UINT32_C(0xff) << 0)
872         uint8_t queue_id3_service_profile;
873
874         /* ID of CoS Queue 4. FF - Invalid id */
875         uint8_t queue_id4;
876         /* This value is applicable to CoS queues only. */
877                 /* Lossy (best-effort) */
878         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSY \
879                                                         (UINT32_C(0x0) << 0)
880                 /* Lossless */
881         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_LOSSLESS \
882                                                         (UINT32_C(0x1) << 0)
883                 /*
884                  * Set to 0xFF... (All Fs) if there is no service profile
885                  * specified
886                  */
887         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID4_SERVICE_PROFILE_UNKNOWN \
888                                                         (UINT32_C(0xff) << 0)
889         uint8_t queue_id4_service_profile;
890
891         /* ID of CoS Queue 5. FF - Invalid id */
892         uint8_t queue_id5;
893
894         /* This value is applicable to CoS queues only. */
895                 /* Lossy (best-effort) */
896         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSY \
897                                                         (UINT32_C(0x0) << 0)
898                 /* Lossless */
899         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_LOSSLESS \
900                                                         (UINT32_C(0x1) << 0)
901                 /*
902                  * Set to 0xFF... (All Fs) if there is no service profile
903                  * specified
904                  */
905         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID5_SERVICE_PROFILE_UNKNOWN \
906                                                         (UINT32_C(0xff) << 0)
907         uint8_t queue_id5_service_profile;
908
909         /* ID of CoS Queue 6. FF - Invalid id */
910         uint8_t queue_id6_service_profile;
911         /* This value is applicable to CoS queues only. */
912                 /* Lossy (best-effort) */
913         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSY \
914                                                         (UINT32_C(0x0) << 0)
915                 /* Lossless */
916         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_LOSSLESS \
917                                                         (UINT32_C(0x1) << 0)
918                 /*
919                  * Set to 0xFF... (All Fs) if there is no service profile
920                  * specified
921                  */
922         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID6_SERVICE_PROFILE_UNKNOWN \
923                                                         (UINT32_C(0xff) << 0)
924         uint8_t queue_id6;
925
926         /* ID of CoS Queue 7. FF - Invalid id */
927         uint8_t queue_id7;
928
929         /* This value is applicable to CoS queues only. */
930                 /* Lossy (best-effort) */
931         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSY \
932                                                         (UINT32_C(0x0) << 0)
933                 /* Lossless */
934         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_LOSSLESS \
935                                                         (UINT32_C(0x1) << 0)
936                 /*
937                  * Set to 0xFF... (All Fs) if there is no service profile
938                  * specified
939                  */
940         #define HWRM_QUEUE_QPORTCFG_OUTPUT_QUEUE_ID7_SERVICE_PROFILE_UNKNOWN \
941                                                         (UINT32_C(0xff) << 0)
942         uint8_t queue_id7_service_profile;
943
944         /*
945          * This field is used in Output records to indicate that the output is
946          * completely written to RAM. This field should be read as '1' to
947          * indicate that the output has been completely written. When writing a
948          * command completion or response to an internal processor, the order of
949          * writes has to be such that this field is written last.
950          */
951         uint8_t valid;
952 } __attribute__((packed));
953
954 #endif