1 /* SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB) OR BSD-2-Clause */
2 /* Copyright (c) 2017-2020 Pensando Systems, Inc. All rights reserved. */
7 #define IONIC_DEV_INFO_SIGNATURE 0x44455649 /* 'DEVI' */
8 #define IONIC_DEV_INFO_VERSION 1
9 #define IONIC_IFNAMSIZ 16
12 * enum ionic_cmd_opcode - Device commands
14 enum ionic_cmd_opcode {
18 IONIC_CMD_IDENTIFY = 1,
21 IONIC_CMD_GETATTR = 4,
22 IONIC_CMD_SETATTR = 5,
25 IONIC_CMD_PORT_IDENTIFY = 10,
26 IONIC_CMD_PORT_INIT = 11,
27 IONIC_CMD_PORT_RESET = 12,
28 IONIC_CMD_PORT_GETATTR = 13,
29 IONIC_CMD_PORT_SETATTR = 14,
32 IONIC_CMD_LIF_IDENTIFY = 20,
33 IONIC_CMD_LIF_INIT = 21,
34 IONIC_CMD_LIF_RESET = 22,
35 IONIC_CMD_LIF_GETATTR = 23,
36 IONIC_CMD_LIF_SETATTR = 24,
37 IONIC_CMD_LIF_SETPHC = 25,
39 IONIC_CMD_RX_MODE_SET = 30,
40 IONIC_CMD_RX_FILTER_ADD = 31,
41 IONIC_CMD_RX_FILTER_DEL = 32,
44 IONIC_CMD_Q_IDENTIFY = 39,
45 IONIC_CMD_Q_INIT = 40,
46 IONIC_CMD_Q_CONTROL = 41,
49 IONIC_CMD_RDMA_RESET_LIF = 50,
50 IONIC_CMD_RDMA_CREATE_EQ = 51,
51 IONIC_CMD_RDMA_CREATE_CQ = 52,
52 IONIC_CMD_RDMA_CREATE_ADMINQ = 53,
55 IONIC_CMD_VF_GETATTR = 60,
56 IONIC_CMD_VF_SETATTR = 61,
59 IONIC_CMD_QOS_CLASS_IDENTIFY = 240,
60 IONIC_CMD_QOS_CLASS_INIT = 241,
61 IONIC_CMD_QOS_CLASS_RESET = 242,
62 IONIC_CMD_QOS_CLASS_UPDATE = 243,
63 IONIC_CMD_QOS_CLEAR_STATS = 244,
64 IONIC_CMD_QOS_RESET = 245,
66 /* Firmware commands */
67 IONIC_CMD_FW_DOWNLOAD = 252,
68 IONIC_CMD_FW_CONTROL = 253,
69 IONIC_CMD_FW_DOWNLOAD_V1 = 254,
70 IONIC_CMD_FW_CONTROL_V1 = 255,
74 * enum ionic_status_code - Device command return codes
76 enum ionic_status_code {
77 IONIC_RC_SUCCESS = 0, /* Success */
78 IONIC_RC_EVERSION = 1, /* Incorrect version for request */
79 IONIC_RC_EOPCODE = 2, /* Invalid cmd opcode */
80 IONIC_RC_EIO = 3, /* I/O error */
81 IONIC_RC_EPERM = 4, /* Permission denied */
82 IONIC_RC_EQID = 5, /* Bad qid */
83 IONIC_RC_EQTYPE = 6, /* Bad qtype */
84 IONIC_RC_ENOENT = 7, /* No such element */
85 IONIC_RC_EINTR = 8, /* operation interrupted */
86 IONIC_RC_EAGAIN = 9, /* Try again */
87 IONIC_RC_ENOMEM = 10, /* Out of memory */
88 IONIC_RC_EFAULT = 11, /* Bad address */
89 IONIC_RC_EBUSY = 12, /* Device or resource busy */
90 IONIC_RC_EEXIST = 13, /* object already exists */
91 IONIC_RC_EINVAL = 14, /* Invalid argument */
92 IONIC_RC_ENOSPC = 15, /* No space left or alloc failure */
93 IONIC_RC_ERANGE = 16, /* Parameter out of range */
94 IONIC_RC_BAD_ADDR = 17, /* Descriptor contains a bad ptr */
95 IONIC_RC_DEV_CMD = 18, /* Device cmd attempted on AdminQ */
96 IONIC_RC_ENOSUPP = 19, /* Operation not supported */
97 IONIC_RC_ERROR = 29, /* Generic error */
98 IONIC_RC_ERDMA = 30, /* Generic RDMA error */
99 IONIC_RC_EVFID = 31, /* VF ID does not exist */
100 IONIC_RC_EBAD_FW = 32, /* FW file is invalid or corrupted */
103 enum ionic_notifyq_opcode {
104 IONIC_EVENT_LINK_CHANGE = 1,
105 IONIC_EVENT_RESET = 2,
106 IONIC_EVENT_HEARTBEAT = 3,
108 IONIC_EVENT_XCVR = 5,
112 * struct ionic_admin_cmd - General admin command format
113 * @opcode: Opcode for the command
114 * @lif_index: LIF index
115 * @cmd_data: Opcode-specific command bytes
117 struct ionic_admin_cmd {
125 * struct ionic_admin_comp - General admin command completion format
126 * @status: Status of the command (enum ionic_status_code)
127 * @comp_index: Index in the descriptor ring for which this is the completion
128 * @cmd_data: Command-specific bytes
129 * @color: Color bit (Always 0 for commands issued to the
130 * Device Cmd Registers)
132 struct ionic_admin_comp {
138 #define IONIC_COMP_COLOR_MASK 0x80
141 static inline u8 color_match(u8 color, u8 done_color)
143 return (!!(color & IONIC_COMP_COLOR_MASK)) == done_color;
147 * struct ionic_nop_cmd - NOP command
150 struct ionic_nop_cmd {
156 * struct ionic_nop_comp - NOP command completion
157 * @status: Status of the command (enum ionic_status_code)
159 struct ionic_nop_comp {
165 * struct ionic_dev_init_cmd - Device init command
169 struct ionic_dev_init_cmd {
176 * struct ionic_dev_init_comp - Device init command completion
177 * @status: Status of the command (enum ionic_status_code)
179 struct ionic_dev_init_comp {
185 * struct ionic_dev_reset_cmd - Device reset command
188 struct ionic_dev_reset_cmd {
194 * struct ionic_dev_reset_comp - Reset command completion
195 * @status: Status of the command (enum ionic_status_code)
197 struct ionic_dev_reset_comp {
202 #define IONIC_IDENTITY_VERSION_1 1
205 * struct ionic_dev_identify_cmd - Driver/device identify command
207 * @ver: Highest version of identify supported by driver
209 struct ionic_dev_identify_cmd {
216 * struct ionic_dev_identify_comp - Driver/device identify command completion
217 * @status: Status of the command (enum ionic_status_code)
218 * @ver: Version of identify returned by device
220 struct ionic_dev_identify_comp {
227 IONIC_OS_TYPE_LINUX = 1,
228 IONIC_OS_TYPE_WIN = 2,
229 IONIC_OS_TYPE_DPDK = 3,
230 IONIC_OS_TYPE_FREEBSD = 4,
231 IONIC_OS_TYPE_IPXE = 5,
232 IONIC_OS_TYPE_ESXI = 6,
236 * union ionic_drv_identity - driver identity information
237 * @os_type: OS type (see enum ionic_os_type)
238 * @os_dist: OS distribution, numeric format
239 * @os_dist_str: OS distribution, string format
240 * @kernel_ver: Kernel version, numeric format
241 * @kernel_ver_str: Kernel version, string format
242 * @driver_ver_str: Driver version, string format
244 union ionic_drv_identity {
248 char os_dist_str[128];
250 char kernel_ver_str[32];
251 char driver_ver_str[32];
257 * union ionic_dev_identity - device identity information
258 * @version: Version of device identify
259 * @type: Identify type (0 for now)
260 * @nports: Number of ports provisioned
261 * @nlifs: Number of LIFs provisioned
262 * @nintrs: Number of interrupts provisioned
263 * @ndbpgs_per_lif: Number of doorbell pages per LIF
264 * @intr_coal_mult: Interrupt coalescing multiplication factor
265 * Scale user-supplied interrupt coalescing
266 * value in usecs to device units using:
267 * device units = usecs * mult / div
268 * @intr_coal_div: Interrupt coalescing division factor
269 * Scale user-supplied interrupt coalescing
270 * value in usecs to device units using:
271 * device units = usecs * mult / div
272 * @eq_count: Number of shared event queues
273 * @hwstamp_mask: Bitmask for subtraction of hardware tick values.
274 * @hwstamp_mult: Hardware tick to nanosecond multiplier.
275 * @hwstamp_shift: Hardware tick to nanosecond divisor (power of two).
277 union ionic_dev_identity {
286 __le32 ndbpgs_per_lif;
287 __le32 intr_coal_mult;
288 __le32 intr_coal_div;
292 __le32 hwstamp_shift;
297 enum ionic_lif_type {
298 IONIC_LIF_TYPE_CLASSIC = 0,
299 IONIC_LIF_TYPE_MACVLAN = 1,
300 IONIC_LIF_TYPE_NETQUEUE = 2,
304 * struct ionic_lif_identify_cmd - LIF identify command
306 * @type: LIF type (enum ionic_lif_type)
307 * @ver: Version of identify returned by device
309 struct ionic_lif_identify_cmd {
317 * struct ionic_lif_identify_comp - LIF identify command completion
318 * @status: Status of the command (enum ionic_status_code)
319 * @ver: Version of identify returned by device
321 struct ionic_lif_identify_comp {
328 * enum ionic_lif_capability - LIF capabilities
329 * @IONIC_LIF_CAP_ETH: LIF supports Ethernet
330 * @IONIC_LIF_CAP_RDMA: LIF supports RDMA
332 enum ionic_lif_capability {
333 IONIC_LIF_CAP_ETH = BIT(0),
334 IONIC_LIF_CAP_RDMA = BIT(1),
338 * enum ionic_logical_qtype - Logical Queue Types
339 * @IONIC_QTYPE_ADMINQ: Administrative Queue
340 * @IONIC_QTYPE_NOTIFYQ: Notify Queue
341 * @IONIC_QTYPE_RXQ: Receive Queue
342 * @IONIC_QTYPE_TXQ: Transmit Queue
343 * @IONIC_QTYPE_EQ: Event Queue
344 * @IONIC_QTYPE_MAX: Max queue type supported
346 enum ionic_logical_qtype {
347 IONIC_QTYPE_ADMINQ = 0,
348 IONIC_QTYPE_NOTIFYQ = 1,
352 IONIC_QTYPE_MAX = 16,
356 * enum ionic_q_feature - Common Features for most queue types
358 * Common features use bits 0-15. Per-queue-type features use higher bits.
360 * @IONIC_QIDENT_F_CQ: Queue has completion ring
361 * @IONIC_QIDENT_F_SG: Queue has scatter/gather ring
362 * @IONIC_QIDENT_F_EQ: Queue can use event queue
363 * @IONIC_QIDENT_F_CMB: Queue is in cmb bar
364 * @IONIC_Q_F_2X_DESC: Double main descriptor size
365 * @IONIC_Q_F_2X_CQ_DESC: Double cq descriptor size
366 * @IONIC_Q_F_2X_SG_DESC: Double sg descriptor size
367 * @IONIC_Q_F_4X_DESC: Quadruple main descriptor size
368 * @IONIC_Q_F_4X_CQ_DESC: Quadruple cq descriptor size
369 * @IONIC_Q_F_4X_SG_DESC: Quadruple sg descriptor size
371 enum ionic_q_feature {
372 IONIC_QIDENT_F_CQ = BIT_ULL(0),
373 IONIC_QIDENT_F_SG = BIT_ULL(1),
374 IONIC_QIDENT_F_EQ = BIT_ULL(2),
375 IONIC_QIDENT_F_CMB = BIT_ULL(3),
376 IONIC_Q_F_2X_DESC = BIT_ULL(4),
377 IONIC_Q_F_2X_CQ_DESC = BIT_ULL(5),
378 IONIC_Q_F_2X_SG_DESC = BIT_ULL(6),
379 IONIC_Q_F_4X_DESC = BIT_ULL(7),
380 IONIC_Q_F_4X_CQ_DESC = BIT_ULL(8),
381 IONIC_Q_F_4X_SG_DESC = BIT_ULL(9),
385 * enum ionic_rxq_feature - RXQ-specific Features
387 * Per-queue-type features use bits 16 and higher.
389 * @IONIC_RXQ_F_HWSTAMP: Queue supports Hardware Timestamping
391 enum ionic_rxq_feature {
392 IONIC_RXQ_F_HWSTAMP = BIT_ULL(16),
396 * enum ionic_txq_feature - TXQ-specific Features
398 * Per-queue-type features use bits 16 and higher.
400 * @IONIC_TXQ_F_HWSTAMP: Queue supports Hardware Timestamping
402 enum ionic_txq_feature {
403 IONIC_TXQ_F_HWSTAMP = BIT(16),
407 * struct ionic_hwstamp_bits - Hardware timestamp decoding bits
408 * @IONIC_HWSTAMP_INVALID: Invalid hardware timestamp value
409 * @IONIC_HWSTAMP_CQ_NEGOFFSET: Timestamp field negative offset
410 * from the base cq descriptor.
412 enum ionic_hwstamp_bits {
413 IONIC_HWSTAMP_INVALID = ~0ull,
414 IONIC_HWSTAMP_CQ_NEGOFFSET = 8,
418 * struct ionic_lif_logical_qtype - Descriptor of logical to HW queue type
419 * @qtype: Hardware Queue Type
420 * @qid_count: Number of Queue IDs of the logical type
421 * @qid_base: Minimum Queue ID of the logical type
423 struct ionic_lif_logical_qtype {
431 * enum ionic_lif_state - LIF state
432 * @IONIC_LIF_DISABLE: LIF disabled
433 * @IONIC_LIF_ENABLE: LIF enabled
434 * @IONIC_LIF_QUIESCE: LIF Quiesced
436 enum ionic_lif_state {
437 IONIC_LIF_QUIESCE = 0,
438 IONIC_LIF_ENABLE = 1,
439 IONIC_LIF_DISABLE = 2,
443 * union ionic_lif_config - LIF configuration
444 * @state: LIF state (enum ionic_lif_state)
447 * @mac: Station MAC address
448 * @vlan: Default Vlan ID
449 * @features: Features (enum ionic_eth_hw_features)
450 * @queue_count: Queue counts per queue-type
452 union ionic_lif_config {
456 char name[IONIC_IFNAMSIZ];
461 __le32 queue_count[IONIC_QTYPE_MAX];
467 * struct ionic_lif_identity - LIF identity information (type-specific)
469 * @capabilities: LIF capabilities
471 * @eth: Ethernet identify structure
472 * @version: Ethernet identify structure version
473 * @max_ucast_filters: Number of perfect unicast addresses supported
474 * @max_mcast_filters: Number of perfect multicast addresses supported
475 * @min_frame_size: Minimum size of frames to be sent
476 * @max_frame_size: Maximum size of frames to be sent
477 * @hwstamp_tx_modes: Bitmask of BIT_ULL(enum ionic_txstamp_mode)
478 * @hwstamp_rx_filters: Bitmask of enum ionic_pkt_class
479 * @config: LIF config struct with features, mtu, mac, q counts
481 * @rdma: RDMA identify structure
482 * @version: RDMA version of opcodes and queue descriptors
483 * @qp_opcodes: Number of RDMA queue pair opcodes supported
484 * @admin_opcodes: Number of RDMA admin opcodes supported
485 * @npts_per_lif: Page table size per LIF
486 * @nmrs_per_lif: Number of memory regions per LIF
487 * @nahs_per_lif: Number of address handles per LIF
488 * @max_stride: Max work request stride
489 * @cl_stride: Cache line stride
490 * @pte_stride: Page table entry stride
491 * @rrq_stride: Remote RQ work request stride
492 * @rsq_stride: Remote SQ work request stride
493 * @dcqcn_profiles: Number of DCQCN profiles
494 * @aq_qtype: RDMA Admin Qtype
495 * @sq_qtype: RDMA Send Qtype
496 * @rq_qtype: RDMA Receive Qtype
497 * @cq_qtype: RDMA Completion Qtype
498 * @eq_qtype: RDMA Event Qtype
500 union ionic_lif_identity {
507 __le32 max_ucast_filters;
508 __le32 max_mcast_filters;
509 __le16 rss_ind_tbl_sz;
510 __le32 min_frame_size;
511 __le32 max_frame_size;
513 __le64 hwstamp_tx_modes;
514 __le64 hwstamp_rx_filters;
516 union ionic_lif_config config;
533 u8 rsvd_dimensions[10];
534 struct ionic_lif_logical_qtype aq_qtype;
535 struct ionic_lif_logical_qtype sq_qtype;
536 struct ionic_lif_logical_qtype rq_qtype;
537 struct ionic_lif_logical_qtype cq_qtype;
538 struct ionic_lif_logical_qtype eq_qtype;
545 * struct ionic_lif_init_cmd - LIF init command
547 * @type: LIF type (enum ionic_lif_type)
549 * @info_pa: Destination address for LIF info (struct ionic_lif_info)
551 struct ionic_lif_init_cmd {
561 * struct ionic_lif_init_comp - LIF init command completion
562 * @status: Status of the command (enum ionic_status_code)
563 * @hw_index: Hardware index of the initialized LIF
565 struct ionic_lif_init_comp {
573 * struct ionic_q_identify_cmd - queue identify command
575 * @lif_type: LIF type (enum ionic_lif_type)
576 * @type: Logical queue type (enum ionic_logical_qtype)
577 * @ver: Highest queue type version that the driver supports
579 struct ionic_q_identify_cmd {
589 * struct ionic_q_identify_comp - queue identify command completion
590 * @status: Status of the command (enum ionic_status_code)
591 * @comp_index: Index in the descriptor ring for which this is the completion
592 * @ver: Queue type version that can be used with FW
594 struct ionic_q_identify_comp {
603 * union ionic_q_identity - queue identity information
604 * @version: Queue type version that can be used with FW
605 * @supported: Bitfield of queue versions, first bit = ver 0
606 * @features: Queue features (enum ionic_q_feature, etc)
607 * @desc_sz: Descriptor size
608 * @comp_sz: Completion descriptor size
609 * @sg_desc_sz: Scatter/Gather descriptor size
610 * @max_sg_elems: Maximum number of Scatter/Gather elements
611 * @sg_desc_stride: Number of Scatter/Gather elements per descriptor
613 union ionic_q_identity {
623 __le16 sg_desc_stride;
629 * struct ionic_q_init_cmd - Queue init command
631 * @type: Logical queue type
632 * @ver: Queue type version
633 * @lif_index: LIF index
634 * @index: (LIF, qtype) relative admin queue index
635 * @intr_index: Interrupt control register index, or Event queue index
638 * IRQ: Interrupt requested on completion
639 * ENA: Enable the queue. If ENA=0 the queue is initialized
640 * but remains disabled, to be later enabled with the
641 * Queue Enable command. If ENA=1, then queue is
642 * initialized and then enabled.
643 * SG: Enable Scatter-Gather on the queue.
644 * in number of descs. The actual ring size is
645 * (1 << ring_size). For example, to
646 * select a ring size of 64 descriptors write
647 * ring_size = 6. The minimum ring_size value is 2
648 * for a ring size of 4 descriptors. The maximum
649 * ring_size value is 16 for a ring size of 64k
650 * descriptors. Values of ring_size <2 and >16 are
652 * EQ: Enable the Event Queue
653 * @cos: Class of service for this queue
654 * @ring_size: Queue ring size, encoded as a log2(size)
655 * @ring_base: Queue ring base address
656 * @cq_ring_base: Completion queue ring base address
657 * @sg_ring_base: Scatter/Gather ring base address
658 * @features: Mask of queue features to enable, if not in the flags above.
660 struct ionic_q_init_cmd {
671 #define IONIC_QINIT_F_IRQ 0x01 /* Request interrupt on completion */
672 #define IONIC_QINIT_F_ENA 0x02 /* Enable the queue */
673 #define IONIC_QINIT_F_SG 0x04 /* Enable scatter/gather on the queue */
674 #define IONIC_QINIT_F_EQ 0x08 /* Enable event queue */
675 #define IONIC_QINIT_F_CMB 0x10 /* Enable cmb-based queue */
676 #define IONIC_QINIT_F_DEBUG 0x80 /* Enable queue debugging */
687 * struct ionic_q_init_comp - Queue init command completion
688 * @status: Status of the command (enum ionic_status_code)
689 * @comp_index: Index in the descriptor ring for which this is the completion
690 * @hw_index: Hardware Queue ID
691 * @hw_type: Hardware Queue type
694 struct ionic_q_init_comp {
704 /* the device's internal addressing uses up to 52 bits */
705 #define IONIC_ADDR_LEN 52
706 #define IONIC_ADDR_MASK (BIT_ULL(IONIC_ADDR_LEN) - 1)
708 enum ionic_txq_desc_opcode {
709 IONIC_TXQ_DESC_OPCODE_CSUM_NONE = 0,
710 IONIC_TXQ_DESC_OPCODE_CSUM_PARTIAL = 1,
711 IONIC_TXQ_DESC_OPCODE_CSUM_HW = 2,
712 IONIC_TXQ_DESC_OPCODE_TSO = 3,
716 * struct ionic_txq_desc - Ethernet Tx queue descriptor format
717 * @cmd: Tx operation, see IONIC_TXQ_DESC_OPCODE_*:
719 * IONIC_TXQ_DESC_OPCODE_CSUM_NONE:
720 * Non-offload send. No segmentation,
721 * fragmentation or checksum calc/insertion is
722 * performed by device; packet is prepared
723 * to send by software stack and requires
724 * no further manipulation from device.
726 * IONIC_TXQ_DESC_OPCODE_CSUM_PARTIAL:
727 * Offload 16-bit L4 checksum
728 * calculation/insertion. The device will
729 * calculate the L4 checksum value and
730 * insert the result in the packet's L4
731 * header checksum field. The L4 checksum
732 * is calculated starting at @csum_start bytes
733 * into the packet to the end of the packet.
734 * The checksum insertion position is given
735 * in @csum_offset, which is the offset from
736 * @csum_start to the checksum field in the L4
737 * header. This feature is only applicable to
738 * protocols such as TCP, UDP and ICMP where a
739 * standard (i.e. the 'IP-style' checksum)
740 * one's complement 16-bit checksum is used,
741 * using an IP pseudo-header to seed the
742 * calculation. Software will preload the L4
743 * checksum field with the IP pseudo-header
746 * For tunnel encapsulation, @csum_start and
747 * @csum_offset refer to the inner L4
748 * header. Supported tunnels encapsulations
749 * are: IPIP, GRE, and UDP. If the @encap
750 * is clear, no further processing by the
751 * device is required; software will
752 * calculate the outer header checksums. If
753 * the @encap is set, the device will
754 * offload the outer header checksums using
755 * LCO (local checksum offload) (see
756 * Documentation/networking/checksum-offloads.rst
759 * IONIC_TXQ_DESC_OPCODE_CSUM_HW:
760 * Offload 16-bit checksum computation to hardware.
761 * If @csum_l3 is set then the packet's L3 checksum is
762 * updated. Similarly, if @csum_l4 is set the the L4
763 * checksum is updated. If @encap is set then encap header
764 * checksums are also updated.
766 * IONIC_TXQ_DESC_OPCODE_TSO:
767 * Device performs TCP segmentation offload
768 * (TSO). @hdr_len is the number of bytes
769 * to the end of TCP header (the offset to
770 * the TCP payload). @mss is the desired
771 * MSS, the TCP payload length for each
772 * segment. The device will calculate/
773 * insert IP (IPv4 only) and TCP checksums
774 * for each segment. In the first data
775 * buffer containing the header template,
776 * the driver will set IPv4 checksum to 0
777 * and preload TCP checksum with the IP
778 * pseudo header calculated with IP length = 0.
780 * Supported tunnel encapsulations are IPIP,
781 * layer-3 GRE, and UDP. @hdr_len includes
782 * both outer and inner headers. The driver
783 * will set IPv4 checksum to zero and
784 * preload TCP checksum with IP pseudo
785 * header on the inner header.
787 * TCP ECN offload is supported. The device
788 * will set CWR flag in the first segment if
789 * CWR is set in the template header, and
790 * clear CWR in remaining segments.
793 * Insert an L2 VLAN header using @vlan_tci
795 * Calculate encap header checksum
797 * Compute L3 header checksum
799 * Compute L4 header checksum
804 * @num_sg_elems: Number of scatter-gather elements in SG
806 * @addr: First data buffer's DMA address
807 * (Subsequent data buffers are on txq_sg_desc)
808 * @len: First data buffer's length, in bytes
809 * @vlan_tci: VLAN tag to insert in the packet (if requested
810 * by @V-bit). Includes .1p and .1q tags
811 * @hdr_len: Length of packet headers, including
812 * encapsulating outer header, if applicable
813 * Valid for opcodes IONIC_TXQ_DESC_OPCODE_CALC_CSUM and
814 * IONIC_TXQ_DESC_OPCODE_TSO. Should be set to zero for
815 * all other modes. For
816 * IONIC_TXQ_DESC_OPCODE_CALC_CSUM, @hdr_len is length
817 * of headers up to inner-most L4 header. For
818 * IONIC_TXQ_DESC_OPCODE_TSO, @hdr_len is up to
819 * inner-most L4 payload, so inclusive of
820 * inner-most L4 header.
821 * @mss: Desired MSS value for TSO; only applicable for
822 * IONIC_TXQ_DESC_OPCODE_TSO
823 * @csum_start: Offset from packet to first byte checked in L4 checksum
824 * @csum_offset: Offset from csum_start to L4 checksum field
826 struct ionic_txq_desc {
828 #define IONIC_TXQ_DESC_OPCODE_MASK 0xf
829 #define IONIC_TXQ_DESC_OPCODE_SHIFT 4
830 #define IONIC_TXQ_DESC_FLAGS_MASK 0xf
831 #define IONIC_TXQ_DESC_FLAGS_SHIFT 0
832 #define IONIC_TXQ_DESC_NSGE_MASK 0xf
833 #define IONIC_TXQ_DESC_NSGE_SHIFT 8
834 #define IONIC_TXQ_DESC_ADDR_MASK (BIT_ULL(IONIC_ADDR_LEN) - 1)
835 #define IONIC_TXQ_DESC_ADDR_SHIFT 12
838 #define IONIC_TXQ_DESC_FLAG_VLAN 0x1
839 #define IONIC_TXQ_DESC_FLAG_ENCAP 0x2
841 /* flags for csum_hw opcode */
842 #define IONIC_TXQ_DESC_FLAG_CSUM_L3 0x4
843 #define IONIC_TXQ_DESC_FLAG_CSUM_L4 0x8
845 /* flags for tso opcode */
846 #define IONIC_TXQ_DESC_FLAG_TSO_SOT 0x4
847 #define IONIC_TXQ_DESC_FLAG_TSO_EOT 0x8
866 static inline u64 encode_txq_desc_cmd(u8 opcode, u8 flags,
871 cmd = (opcode & IONIC_TXQ_DESC_OPCODE_MASK) << IONIC_TXQ_DESC_OPCODE_SHIFT;
872 cmd |= (flags & IONIC_TXQ_DESC_FLAGS_MASK) << IONIC_TXQ_DESC_FLAGS_SHIFT;
873 cmd |= (nsge & IONIC_TXQ_DESC_NSGE_MASK) << IONIC_TXQ_DESC_NSGE_SHIFT;
874 cmd |= (addr & IONIC_TXQ_DESC_ADDR_MASK) << IONIC_TXQ_DESC_ADDR_SHIFT;
879 static inline void decode_txq_desc_cmd(u64 cmd, u8 *opcode, u8 *flags,
882 *opcode = (cmd >> IONIC_TXQ_DESC_OPCODE_SHIFT) & IONIC_TXQ_DESC_OPCODE_MASK;
883 *flags = (cmd >> IONIC_TXQ_DESC_FLAGS_SHIFT) & IONIC_TXQ_DESC_FLAGS_MASK;
884 *nsge = (cmd >> IONIC_TXQ_DESC_NSGE_SHIFT) & IONIC_TXQ_DESC_NSGE_MASK;
885 *addr = (cmd >> IONIC_TXQ_DESC_ADDR_SHIFT) & IONIC_TXQ_DESC_ADDR_MASK;
889 * struct ionic_txq_sg_elem - Transmit scatter-gather (SG) descriptor element
890 * @addr: DMA address of SG element data buffer
891 * @len: Length of SG element data buffer, in bytes
893 struct ionic_txq_sg_elem {
900 * struct ionic_txq_sg_desc - Transmit scatter-gather (SG) list
901 * @elems: Scatter-gather elements
903 struct ionic_txq_sg_desc {
904 #define IONIC_TX_MAX_SG_ELEMS 8
905 #define IONIC_TX_SG_DESC_STRIDE 8
906 struct ionic_txq_sg_elem elems[IONIC_TX_MAX_SG_ELEMS];
909 struct ionic_txq_sg_desc_v1 {
910 #define IONIC_TX_MAX_SG_ELEMS_V1 15
911 #define IONIC_TX_SG_DESC_STRIDE_V1 16
912 struct ionic_txq_sg_elem elems[IONIC_TX_SG_DESC_STRIDE_V1];
916 * struct ionic_txq_comp - Ethernet transmit queue completion descriptor
917 * @status: Status of the command (enum ionic_status_code)
918 * @comp_index: Index in the descriptor ring for which this is the completion
921 struct ionic_txq_comp {
929 enum ionic_rxq_desc_opcode {
930 IONIC_RXQ_DESC_OPCODE_SIMPLE = 0,
931 IONIC_RXQ_DESC_OPCODE_SG = 1,
935 * struct ionic_rxq_desc - Ethernet Rx queue descriptor format
936 * @opcode: Rx operation, see IONIC_RXQ_DESC_OPCODE_*:
938 * IONIC_RXQ_DESC_OPCODE_SIMPLE:
939 * Receive full packet into data buffer
940 * starting at @addr. Results of
941 * receive, including actual bytes received,
942 * are recorded in Rx completion descriptor.
944 * @len: Data buffer's length, in bytes
945 * @addr: Data buffer's DMA address
947 struct ionic_rxq_desc {
955 * struct ionic_rxq_sg_elem - Receive scatter-gather (SG) descriptor element
956 * @addr: DMA address of SG element data buffer
957 * @len: Length of SG element data buffer, in bytes
959 struct ionic_rxq_sg_elem {
966 * struct ionic_rxq_sg_desc - Receive scatter-gather (SG) list
967 * @elems: Scatter-gather elements
969 struct ionic_rxq_sg_desc {
970 #define IONIC_RX_MAX_SG_ELEMS 8
971 #define IONIC_RX_SG_DESC_STRIDE 8
972 struct ionic_rxq_sg_elem elems[IONIC_RX_SG_DESC_STRIDE];
976 * struct ionic_rxq_comp - Ethernet receive queue completion descriptor
977 * @status: Status of the command (enum ionic_status_code)
978 * @num_sg_elems: Number of SG elements used by this descriptor
979 * @comp_index: Index in the descriptor ring for which this is the completion
980 * @rss_hash: 32-bit RSS hash
981 * @csum: 16-bit sum of the packet's L2 payload
982 * If the packet's L2 payload is odd length, an extra
983 * zero-value byte is included in the @csum calculation but
984 * not included in @len.
985 * @vlan_tci: VLAN tag stripped from the packet. Valid if @VLAN is
986 * set. Includes .1p and .1q tags.
987 * @len: Received packet length, in bytes. Excludes FCS.
988 * @csum_calc L2 payload checksum is computed or not
989 * @csum_flags: See IONIC_RXQ_COMP_CSUM_F_*:
991 * IONIC_RXQ_COMP_CSUM_F_TCP_OK:
992 * The TCP checksum calculated by the device
993 * matched the checksum in the receive packet's
996 * IONIC_RXQ_COMP_CSUM_F_TCP_BAD:
997 * The TCP checksum calculated by the device did
998 * not match the checksum in the receive packet's
1001 * IONIC_RXQ_COMP_CSUM_F_UDP_OK:
1002 * The UDP checksum calculated by the device
1003 * matched the checksum in the receive packet's
1006 * IONIC_RXQ_COMP_CSUM_F_UDP_BAD:
1007 * The UDP checksum calculated by the device did
1008 * not match the checksum in the receive packet's
1011 * IONIC_RXQ_COMP_CSUM_F_IP_OK:
1012 * The IPv4 checksum calculated by the device
1013 * matched the checksum in the receive packet's
1014 * first IPv4 header. If the receive packet
1015 * contains both a tunnel IPv4 header and a
1016 * transport IPv4 header, the device validates the
1017 * checksum for the both IPv4 headers.
1019 * IONIC_RXQ_COMP_CSUM_F_IP_BAD:
1020 * The IPv4 checksum calculated by the device did
1021 * not match the checksum in the receive packet's
1022 * first IPv4 header. If the receive packet
1023 * contains both a tunnel IPv4 header and a
1024 * transport IPv4 header, the device validates the
1025 * checksum for both IP headers.
1027 * IONIC_RXQ_COMP_CSUM_F_VLAN:
1028 * The VLAN header was stripped and placed in @vlan_tci.
1030 * IONIC_RXQ_COMP_CSUM_F_CALC:
1031 * The checksum was calculated by the device.
1033 * @pkt_type_color: Packet type and color bit; see IONIC_RXQ_COMP_PKT_TYPE_MASK
1035 struct ionic_rxq_comp {
1044 #define IONIC_RXQ_COMP_CSUM_F_TCP_OK 0x01
1045 #define IONIC_RXQ_COMP_CSUM_F_TCP_BAD 0x02
1046 #define IONIC_RXQ_COMP_CSUM_F_UDP_OK 0x04
1047 #define IONIC_RXQ_COMP_CSUM_F_UDP_BAD 0x08
1048 #define IONIC_RXQ_COMP_CSUM_F_IP_OK 0x10
1049 #define IONIC_RXQ_COMP_CSUM_F_IP_BAD 0x20
1050 #define IONIC_RXQ_COMP_CSUM_F_VLAN 0x40
1051 #define IONIC_RXQ_COMP_CSUM_F_CALC 0x80
1053 #define IONIC_RXQ_COMP_PKT_TYPE_MASK 0x7f
1056 enum ionic_pkt_type {
1057 IONIC_PKT_TYPE_NON_IP = 0x00,
1058 IONIC_PKT_TYPE_IPV4 = 0x01,
1059 IONIC_PKT_TYPE_IPV4_TCP = 0x03,
1060 IONIC_PKT_TYPE_IPV4_UDP = 0x05,
1061 IONIC_PKT_TYPE_IPV6 = 0x08,
1062 IONIC_PKT_TYPE_IPV6_TCP = 0x18,
1063 IONIC_PKT_TYPE_IPV6_UDP = 0x28,
1064 /* below types are only used if encap offloads are enabled on lif */
1065 IONIC_PKT_TYPE_ENCAP_NON_IP = 0x40,
1066 IONIC_PKT_TYPE_ENCAP_IPV4 = 0x41,
1067 IONIC_PKT_TYPE_ENCAP_IPV4_TCP = 0x43,
1068 IONIC_PKT_TYPE_ENCAP_IPV4_UDP = 0x45,
1069 IONIC_PKT_TYPE_ENCAP_IPV6 = 0x48,
1070 IONIC_PKT_TYPE_ENCAP_IPV6_TCP = 0x58,
1071 IONIC_PKT_TYPE_ENCAP_IPV6_UDP = 0x68,
1074 enum ionic_eth_hw_features {
1075 IONIC_ETH_HW_VLAN_TX_TAG = BIT(0),
1076 IONIC_ETH_HW_VLAN_RX_STRIP = BIT(1),
1077 IONIC_ETH_HW_VLAN_RX_FILTER = BIT(2),
1078 IONIC_ETH_HW_RX_HASH = BIT(3),
1079 IONIC_ETH_HW_RX_CSUM = BIT(4),
1080 IONIC_ETH_HW_TX_SG = BIT(5),
1081 IONIC_ETH_HW_RX_SG = BIT(6),
1082 IONIC_ETH_HW_TX_CSUM = BIT(7),
1083 IONIC_ETH_HW_TSO = BIT(8),
1084 IONIC_ETH_HW_TSO_IPV6 = BIT(9),
1085 IONIC_ETH_HW_TSO_ECN = BIT(10),
1086 IONIC_ETH_HW_TSO_GRE = BIT(11),
1087 IONIC_ETH_HW_TSO_GRE_CSUM = BIT(12),
1088 IONIC_ETH_HW_TSO_IPXIP4 = BIT(13),
1089 IONIC_ETH_HW_TSO_IPXIP6 = BIT(14),
1090 IONIC_ETH_HW_TSO_UDP = BIT(15),
1091 IONIC_ETH_HW_TSO_UDP_CSUM = BIT(16),
1092 IONIC_ETH_HW_RX_CSUM_GENEVE = BIT(17),
1093 IONIC_ETH_HW_TX_CSUM_GENEVE = BIT(18),
1094 IONIC_ETH_HW_TSO_GENEVE = BIT(19),
1095 IONIC_ETH_HW_TIMESTAMP = BIT(20),
1099 * enum ionic_pkt_class - Packet classification mask.
1101 * Used with rx steering filter, packets indicated by the mask can be steered
1102 * toward a specific receive queue.
1104 * @IONIC_PKT_CLS_NTP_ALL: All NTP packets.
1105 * @IONIC_PKT_CLS_PTP1_SYNC: PTPv1 sync
1106 * @IONIC_PKT_CLS_PTP1_DREQ: PTPv1 delay-request
1107 * @IONIC_PKT_CLS_PTP1_ALL: PTPv1 all packets
1108 * @IONIC_PKT_CLS_PTP2_L4_SYNC: PTPv2-UDP sync
1109 * @IONIC_PKT_CLS_PTP2_L4_DREQ: PTPv2-UDP delay-request
1110 * @IONIC_PKT_CLS_PTP2_L4_ALL: PTPv2-UDP all packets
1111 * @IONIC_PKT_CLS_PTP2_L2_SYNC: PTPv2-ETH sync
1112 * @IONIC_PKT_CLS_PTP2_L2_DREQ: PTPv2-ETH delay-request
1113 * @IONIC_PKT_CLS_PTP2_L2_ALL: PTPv2-ETH all packets
1114 * @IONIC_PKT_CLS_PTP2_SYNC: PTPv2 sync
1115 * @IONIC_PKT_CLS_PTP2_DREQ: PTPv2 delay-request
1116 * @IONIC_PKT_CLS_PTP2_ALL: PTPv2 all packets
1117 * @IONIC_PKT_CLS_PTP_SYNC: PTP sync
1118 * @IONIC_PKT_CLS_PTP_DREQ: PTP delay-request
1119 * @IONIC_PKT_CLS_PTP_ALL: PTP all packets
1121 enum ionic_pkt_class {
1122 IONIC_PKT_CLS_NTP_ALL = BIT(0),
1124 IONIC_PKT_CLS_PTP1_SYNC = BIT(1),
1125 IONIC_PKT_CLS_PTP1_DREQ = BIT(2),
1126 IONIC_PKT_CLS_PTP1_ALL = BIT(3) |
1127 IONIC_PKT_CLS_PTP1_SYNC | IONIC_PKT_CLS_PTP1_DREQ,
1129 IONIC_PKT_CLS_PTP2_L4_SYNC = BIT(4),
1130 IONIC_PKT_CLS_PTP2_L4_DREQ = BIT(5),
1131 IONIC_PKT_CLS_PTP2_L4_ALL = BIT(6) |
1132 IONIC_PKT_CLS_PTP2_L4_SYNC | IONIC_PKT_CLS_PTP2_L4_DREQ,
1134 IONIC_PKT_CLS_PTP2_L2_SYNC = BIT(7),
1135 IONIC_PKT_CLS_PTP2_L2_DREQ = BIT(8),
1136 IONIC_PKT_CLS_PTP2_L2_ALL = BIT(9) |
1137 IONIC_PKT_CLS_PTP2_L2_SYNC | IONIC_PKT_CLS_PTP2_L2_DREQ,
1139 IONIC_PKT_CLS_PTP2_SYNC =
1140 IONIC_PKT_CLS_PTP2_L4_SYNC | IONIC_PKT_CLS_PTP2_L2_SYNC,
1141 IONIC_PKT_CLS_PTP2_DREQ =
1142 IONIC_PKT_CLS_PTP2_L4_DREQ | IONIC_PKT_CLS_PTP2_L2_DREQ,
1143 IONIC_PKT_CLS_PTP2_ALL =
1144 IONIC_PKT_CLS_PTP2_L4_ALL | IONIC_PKT_CLS_PTP2_L2_ALL,
1146 IONIC_PKT_CLS_PTP_SYNC =
1147 IONIC_PKT_CLS_PTP1_SYNC | IONIC_PKT_CLS_PTP2_SYNC,
1148 IONIC_PKT_CLS_PTP_DREQ =
1149 IONIC_PKT_CLS_PTP1_DREQ | IONIC_PKT_CLS_PTP2_DREQ,
1150 IONIC_PKT_CLS_PTP_ALL =
1151 IONIC_PKT_CLS_PTP1_ALL | IONIC_PKT_CLS_PTP2_ALL,
1155 * struct ionic_q_control_cmd - Queue control command
1158 * @lif_index: LIF index
1159 * @index: Queue index
1160 * @oper: Operation (enum ionic_q_control_oper)
1162 struct ionic_q_control_cmd {
1171 typedef struct ionic_admin_comp ionic_q_control_comp;
1173 enum q_control_oper {
1174 IONIC_Q_DISABLE = 0,
1176 IONIC_Q_HANG_RESET = 2,
1180 * enum ionic_phy_type - Physical connection type
1181 * @IONIC_PHY_TYPE_NONE: No PHY installed
1182 * @IONIC_PHY_TYPE_COPPER: Copper PHY
1183 * @IONIC_PHY_TYPE_FIBER: Fiber PHY
1185 enum ionic_phy_type {
1186 IONIC_PHY_TYPE_NONE = 0,
1187 IONIC_PHY_TYPE_COPPER = 1,
1188 IONIC_PHY_TYPE_FIBER = 2,
1192 * enum ionic_xcvr_state - Transceiver status
1193 * @IONIC_XCVR_STATE_REMOVED: Transceiver removed
1194 * @IONIC_XCVR_STATE_INSERTED: Transceiver inserted
1195 * @IONIC_XCVR_STATE_PENDING: Transceiver pending
1196 * @IONIC_XCVR_STATE_SPROM_READ: Transceiver data read
1197 * @IONIC_XCVR_STATE_SPROM_READ_ERR: Transceiver data read error
1199 enum ionic_xcvr_state {
1200 IONIC_XCVR_STATE_REMOVED = 0,
1201 IONIC_XCVR_STATE_INSERTED = 1,
1202 IONIC_XCVR_STATE_PENDING = 2,
1203 IONIC_XCVR_STATE_SPROM_READ = 3,
1204 IONIC_XCVR_STATE_SPROM_READ_ERR = 4,
1208 * enum ionic_xcvr_pid - Supported link modes
1210 enum ionic_xcvr_pid {
1211 IONIC_XCVR_PID_UNKNOWN = 0,
1214 IONIC_XCVR_PID_QSFP_100G_CR4 = 1,
1215 IONIC_XCVR_PID_QSFP_40GBASE_CR4 = 2,
1216 IONIC_XCVR_PID_SFP_25GBASE_CR_S = 3,
1217 IONIC_XCVR_PID_SFP_25GBASE_CR_L = 4,
1218 IONIC_XCVR_PID_SFP_25GBASE_CR_N = 5,
1221 IONIC_XCVR_PID_QSFP_100G_AOC = 50,
1222 IONIC_XCVR_PID_QSFP_100G_ACC = 51,
1223 IONIC_XCVR_PID_QSFP_100G_SR4 = 52,
1224 IONIC_XCVR_PID_QSFP_100G_LR4 = 53,
1225 IONIC_XCVR_PID_QSFP_100G_ER4 = 54,
1226 IONIC_XCVR_PID_QSFP_40GBASE_ER4 = 55,
1227 IONIC_XCVR_PID_QSFP_40GBASE_SR4 = 56,
1228 IONIC_XCVR_PID_QSFP_40GBASE_LR4 = 57,
1229 IONIC_XCVR_PID_QSFP_40GBASE_AOC = 58,
1230 IONIC_XCVR_PID_SFP_25GBASE_SR = 59,
1231 IONIC_XCVR_PID_SFP_25GBASE_LR = 60,
1232 IONIC_XCVR_PID_SFP_25GBASE_ER = 61,
1233 IONIC_XCVR_PID_SFP_25GBASE_AOC = 62,
1234 IONIC_XCVR_PID_SFP_10GBASE_SR = 63,
1235 IONIC_XCVR_PID_SFP_10GBASE_LR = 64,
1236 IONIC_XCVR_PID_SFP_10GBASE_LRM = 65,
1237 IONIC_XCVR_PID_SFP_10GBASE_ER = 66,
1238 IONIC_XCVR_PID_SFP_10GBASE_AOC = 67,
1239 IONIC_XCVR_PID_SFP_10GBASE_CU = 68,
1240 IONIC_XCVR_PID_QSFP_100G_CWDM4 = 69,
1241 IONIC_XCVR_PID_QSFP_100G_PSM4 = 70,
1242 IONIC_XCVR_PID_SFP_25GBASE_ACC = 71,
1243 IONIC_XCVR_PID_SFP_10GBASE_T = 72,
1244 IONIC_XCVR_PID_SFP_1000BASE_T = 73,
1248 * enum ionic_port_type - Port types
1249 * @IONIC_PORT_TYPE_NONE: Port type not configured
1250 * @IONIC_PORT_TYPE_ETH: Port carries ethernet traffic (inband)
1251 * @IONIC_PORT_TYPE_MGMT: Port carries mgmt traffic (out-of-band)
1253 enum ionic_port_type {
1254 IONIC_PORT_TYPE_NONE = 0,
1255 IONIC_PORT_TYPE_ETH = 1,
1256 IONIC_PORT_TYPE_MGMT = 2,
1260 * enum ionic_port_admin_state - Port config state
1261 * @IONIC_PORT_ADMIN_STATE_NONE: Port admin state not configured
1262 * @IONIC_PORT_ADMIN_STATE_DOWN: Port admin disabled
1263 * @IONIC_PORT_ADMIN_STATE_UP: Port admin enabled
1265 enum ionic_port_admin_state {
1266 IONIC_PORT_ADMIN_STATE_NONE = 0,
1267 IONIC_PORT_ADMIN_STATE_DOWN = 1,
1268 IONIC_PORT_ADMIN_STATE_UP = 2,
1272 * enum ionic_port_oper_status - Port operational status
1273 * @IONIC_PORT_OPER_STATUS_NONE: Port disabled
1274 * @IONIC_PORT_OPER_STATUS_UP: Port link status up
1275 * @IONIC_PORT_OPER_STATUS_DOWN: Port link status down
1277 enum ionic_port_oper_status {
1278 IONIC_PORT_OPER_STATUS_NONE = 0,
1279 IONIC_PORT_OPER_STATUS_UP = 1,
1280 IONIC_PORT_OPER_STATUS_DOWN = 2,
1284 * enum ionic_port_fec_type - Ethernet Forward error correction (FEC) modes
1285 * @IONIC_PORT_FEC_TYPE_NONE: FEC Disabled
1286 * @IONIC_PORT_FEC_TYPE_FC: FireCode FEC
1287 * @IONIC_PORT_FEC_TYPE_RS: ReedSolomon FEC
1289 enum ionic_port_fec_type {
1290 IONIC_PORT_FEC_TYPE_NONE = 0,
1291 IONIC_PORT_FEC_TYPE_FC = 1,
1292 IONIC_PORT_FEC_TYPE_RS = 2,
1296 * enum ionic_port_pause_type - Ethernet pause (flow control) modes
1297 * @IONIC_PORT_PAUSE_TYPE_NONE: Disable Pause
1298 * @IONIC_PORT_PAUSE_TYPE_LINK: Link level pause
1299 * @IONIC_PORT_PAUSE_TYPE_PFC: Priority-Flow Control
1301 enum ionic_port_pause_type {
1302 IONIC_PORT_PAUSE_TYPE_NONE = 0,
1303 IONIC_PORT_PAUSE_TYPE_LINK = 1,
1304 IONIC_PORT_PAUSE_TYPE_PFC = 2,
1308 * enum ionic_port_loopback_mode - Loopback modes
1309 * @IONIC_PORT_LOOPBACK_MODE_NONE: Disable loopback
1310 * @IONIC_PORT_LOOPBACK_MODE_MAC: MAC loopback
1311 * @IONIC_PORT_LOOPBACK_MODE_PHY: PHY/SerDes loopback
1313 enum ionic_port_loopback_mode {
1314 IONIC_PORT_LOOPBACK_MODE_NONE = 0,
1315 IONIC_PORT_LOOPBACK_MODE_MAC = 1,
1316 IONIC_PORT_LOOPBACK_MODE_PHY = 2,
1320 * struct ionic_xcvr_status - Transceiver Status information
1321 * @state: Transceiver status (enum ionic_xcvr_state)
1322 * @phy: Physical connection type (enum ionic_phy_type)
1323 * @pid: Transceiver link mode (enum ionic_xcvr_pid)
1324 * @sprom: Transceiver sprom contents
1326 struct ionic_xcvr_status {
1334 * union ionic_port_config - Port configuration
1335 * @speed: port speed (in Mbps)
1337 * @state: port admin state (enum ionic_port_admin_state)
1338 * @an_enable: autoneg enable
1339 * @fec_type: fec type (enum ionic_port_fec_type)
1340 * @pause_type: pause type (enum ionic_port_pause_type)
1341 * @loopback_mode: loopback mode (enum ionic_port_loopback_mode)
1343 union ionic_port_config {
1345 #define IONIC_SPEED_100G 100000 /* 100G in Mbps */
1346 #define IONIC_SPEED_50G 50000 /* 50G in Mbps */
1347 #define IONIC_SPEED_40G 40000 /* 40G in Mbps */
1348 #define IONIC_SPEED_25G 25000 /* 25G in Mbps */
1349 #define IONIC_SPEED_10G 10000 /* 10G in Mbps */
1350 #define IONIC_SPEED_1G 1000 /* 1G in Mbps */
1356 #define IONIC_PAUSE_TYPE_MASK 0x0f
1357 #define IONIC_PAUSE_FLAGS_MASK 0xf0
1358 #define IONIC_PAUSE_F_TX 0x10
1359 #define IONIC_PAUSE_F_RX 0x20
1367 * struct ionic_port_status - Port Status information
1368 * @status: link status (enum ionic_port_oper_status)
1370 * @speed: link speed (in Mbps)
1371 * @link_down_count: number of times link went from from up to down
1372 * @fec_type: fec type (enum ionic_port_fec_type)
1373 * @xcvr: tranceiver status
1375 struct ionic_port_status {
1379 __le16 link_down_count;
1382 struct ionic_xcvr_status xcvr;
1386 * struct ionic_port_identify_cmd - Port identify command
1388 * @index: port index
1389 * @ver: Highest version of identify supported by driver
1391 struct ionic_port_identify_cmd {
1399 * struct ionic_port_identify_comp - Port identify command completion
1400 * @status: Status of the command (enum ionic_status_code)
1401 * @ver: Version of identify returned by device
1403 struct ionic_port_identify_comp {
1410 * struct ionic_port_init_cmd - Port initialization command
1412 * @index: port index
1413 * @info_pa: destination address for port info (struct ionic_port_info)
1415 struct ionic_port_init_cmd {
1424 * struct ionic_port_init_comp - Port initialization command completion
1425 * @status: Status of the command (enum ionic_status_code)
1427 struct ionic_port_init_comp {
1433 * struct ionic_port_reset_cmd - Port reset command
1435 * @index: port index
1437 struct ionic_port_reset_cmd {
1444 * struct ionic_port_reset_comp - Port reset command completion
1445 * @status: Status of the command (enum ionic_status_code)
1447 struct ionic_port_reset_comp {
1453 * enum ionic_stats_ctl_cmd - List of commands for stats control
1454 * @IONIC_STATS_CTL_RESET: Reset statistics
1456 enum ionic_stats_ctl_cmd {
1457 IONIC_STATS_CTL_RESET = 0,
1461 * enum ionic_txstamp_mode - List of TX Timestamping Modes
1462 * @IONIC_TXSTAMP_OFF: Disable TX hardware timetamping.
1463 * @IONIC_TXSTAMP_ON: Enable local TX hardware timetamping.
1464 * @IONIC_TXSTAMP_ONESTEP_SYNC: Modify TX PTP Sync packets.
1465 * @IONIC_TXSTAMP_ONESTEP_P2P: Modify TX PTP Sync and PDelayResp.
1467 enum ionic_txstamp_mode {
1468 IONIC_TXSTAMP_OFF = 0,
1469 IONIC_TXSTAMP_ON = 1,
1470 IONIC_TXSTAMP_ONESTEP_SYNC = 2,
1471 IONIC_TXSTAMP_ONESTEP_P2P = 3,
1475 * enum ionic_port_attr - List of device attributes
1476 * @IONIC_PORT_ATTR_STATE: Port state attribute
1477 * @IONIC_PORT_ATTR_SPEED: Port speed attribute
1478 * @IONIC_PORT_ATTR_MTU: Port MTU attribute
1479 * @IONIC_PORT_ATTR_AUTONEG: Port autonegotiation attribute
1480 * @IONIC_PORT_ATTR_FEC: Port FEC attribute
1481 * @IONIC_PORT_ATTR_PAUSE: Port pause attribute
1482 * @IONIC_PORT_ATTR_LOOPBACK: Port loopback attribute
1483 * @IONIC_PORT_ATTR_STATS_CTRL: Port statistics control attribute
1485 enum ionic_port_attr {
1486 IONIC_PORT_ATTR_STATE = 0,
1487 IONIC_PORT_ATTR_SPEED = 1,
1488 IONIC_PORT_ATTR_MTU = 2,
1489 IONIC_PORT_ATTR_AUTONEG = 3,
1490 IONIC_PORT_ATTR_FEC = 4,
1491 IONIC_PORT_ATTR_PAUSE = 5,
1492 IONIC_PORT_ATTR_LOOPBACK = 6,
1493 IONIC_PORT_ATTR_STATS_CTRL = 7,
1497 * struct ionic_port_setattr_cmd - Set port attributes on the NIC
1499 * @index: Port index
1500 * @attr: Attribute type (enum ionic_port_attr)
1501 * @state: Port state
1502 * @speed: Port speed
1504 * @an_enable: Port autonegotiation setting
1505 * @fec_type: Port FEC type setting
1506 * @pause_type: Port pause type setting
1507 * @loopback_mode: Port loopback mode
1508 * @stats_ctl: Port stats setting
1510 struct ionic_port_setattr_cmd {
1529 * struct ionic_port_setattr_comp - Port set attr command completion
1530 * @status: Status of the command (enum ionic_status_code)
1533 struct ionic_port_setattr_comp {
1540 * struct ionic_port_getattr_cmd - Get port attributes from the NIC
1542 * @index: port index
1543 * @attr: Attribute type (enum ionic_port_attr)
1545 struct ionic_port_getattr_cmd {
1553 * struct ionic_port_getattr_comp - Port get attr command completion
1554 * @status: Status of the command (enum ionic_status_code)
1555 * @state: Port state
1556 * @speed: Port speed
1558 * @an_enable: Port autonegotiation setting
1559 * @fec_type: Port FEC type setting
1560 * @pause_type: Port pause type setting
1561 * @loopback_mode: Port loopback mode
1564 struct ionic_port_getattr_comp {
1581 * struct ionic_lif_status - LIF status register
1582 * @eid: most recent NotifyQ event id
1583 * @port_num: port the LIF is connected to
1584 * @link_status: port status (enum ionic_port_oper_status)
1585 * @link_speed: speed of link in Mbps
1586 * @link_down_count: number of times link went from up to down
1588 struct ionic_lif_status {
1593 __le32 link_speed; /* units of 1Mbps: eg 10000 = 10Gbps */
1594 __le16 link_down_count;
1599 * struct ionic_lif_reset_cmd - LIF reset command
1603 struct ionic_lif_reset_cmd {
1610 typedef struct ionic_admin_comp ionic_lif_reset_comp;
1612 enum ionic_dev_state {
1613 IONIC_DEV_DISABLE = 0,
1614 IONIC_DEV_ENABLE = 1,
1615 IONIC_DEV_HANG_RESET = 2,
1619 * enum ionic_dev_attr - List of device attributes
1620 * @IONIC_DEV_ATTR_STATE: Device state attribute
1621 * @IONIC_DEV_ATTR_NAME: Device name attribute
1622 * @IONIC_DEV_ATTR_FEATURES: Device feature attributes
1624 enum ionic_dev_attr {
1625 IONIC_DEV_ATTR_STATE = 0,
1626 IONIC_DEV_ATTR_NAME = 1,
1627 IONIC_DEV_ATTR_FEATURES = 2,
1631 * struct ionic_dev_setattr_cmd - Set Device attributes on the NIC
1633 * @attr: Attribute type (enum ionic_dev_attr)
1634 * @state: Device state (enum ionic_dev_state)
1635 * @name: The bus info, e.g. PCI slot-device-function, 0 terminated
1636 * @features: Device features
1638 struct ionic_dev_setattr_cmd {
1644 char name[IONIC_IFNAMSIZ];
1651 * struct ionic_dev_setattr_comp - Device set attr command completion
1652 * @status: Status of the command (enum ionic_status_code)
1653 * @features: Device features
1656 struct ionic_dev_setattr_comp {
1667 * struct ionic_dev_getattr_cmd - Get Device attributes from the NIC
1669 * @attr: Attribute type (enum ionic_dev_attr)
1671 struct ionic_dev_getattr_cmd {
1678 * struct ionic_dev_setattr_comp - Device set attr command completion
1679 * @status: Status of the command (enum ionic_status_code)
1680 * @features: Device features
1683 struct ionic_dev_getattr_comp {
1696 #define IONIC_RSS_HASH_KEY_SIZE 40
1698 enum ionic_rss_hash_types {
1699 IONIC_RSS_TYPE_IPV4 = BIT(0),
1700 IONIC_RSS_TYPE_IPV4_TCP = BIT(1),
1701 IONIC_RSS_TYPE_IPV4_UDP = BIT(2),
1702 IONIC_RSS_TYPE_IPV6 = BIT(3),
1703 IONIC_RSS_TYPE_IPV6_TCP = BIT(4),
1704 IONIC_RSS_TYPE_IPV6_UDP = BIT(5),
1708 * enum ionic_lif_attr - List of LIF attributes
1709 * @IONIC_LIF_ATTR_STATE: LIF state attribute
1710 * @IONIC_LIF_ATTR_NAME: LIF name attribute
1711 * @IONIC_LIF_ATTR_MTU: LIF MTU attribute
1712 * @IONIC_LIF_ATTR_MAC: LIF MAC attribute
1713 * @IONIC_LIF_ATTR_FEATURES: LIF features attribute
1714 * @IONIC_LIF_ATTR_RSS: LIF RSS attribute
1715 * @IONIC_LIF_ATTR_STATS_CTRL: LIF statistics control attribute
1716 * @IONIC_LIF_ATTR_TXSTAMP: LIF TX timestamping mode
1718 enum ionic_lif_attr {
1719 IONIC_LIF_ATTR_STATE = 0,
1720 IONIC_LIF_ATTR_NAME = 1,
1721 IONIC_LIF_ATTR_MTU = 2,
1722 IONIC_LIF_ATTR_MAC = 3,
1723 IONIC_LIF_ATTR_FEATURES = 4,
1724 IONIC_LIF_ATTR_RSS = 5,
1725 IONIC_LIF_ATTR_STATS_CTRL = 6,
1726 IONIC_LIF_ATTR_TXSTAMP = 7,
1730 * struct ionic_lif_setattr_cmd - Set LIF attributes on the NIC
1732 * @attr: Attribute type (enum ionic_lif_attr)
1734 * @state: LIF state (enum ionic_lif_state)
1735 * @name: The netdev name string, 0 terminated
1738 * @features: Features (enum ionic_eth_hw_features)
1739 * @rss: RSS properties
1740 * @types: The hash types to enable (see rss_hash_types)
1741 * @key: The hash secret key
1742 * @addr: Address for the indirection table shared memory
1743 * @stats_ctl: stats control commands (enum ionic_stats_ctl_cmd)
1744 * @txstamp: TX Timestamping Mode (enum ionic_txstamp_mode)
1746 struct ionic_lif_setattr_cmd {
1752 char name[IONIC_IFNAMSIZ];
1758 u8 key[IONIC_RSS_HASH_KEY_SIZE];
1763 __le16 txstamp_mode;
1769 * struct ionic_lif_setattr_comp - LIF set attr command completion
1770 * @status: Status of the command (enum ionic_status_code)
1771 * @comp_index: Index in the descriptor ring for which this is the completion
1772 * @features: features (enum ionic_eth_hw_features)
1775 struct ionic_lif_setattr_comp {
1787 * struct ionic_lif_getattr_cmd - Get LIF attributes from the NIC
1789 * @attr: Attribute type (enum ionic_lif_attr)
1792 struct ionic_lif_getattr_cmd {
1800 * struct ionic_lif_getattr_comp - LIF get attr command completion
1801 * @status: Status of the command (enum ionic_status_code)
1802 * @comp_index: Index in the descriptor ring for which this is the completion
1803 * @state: LIF state (enum ionic_lif_state)
1804 * @name: The netdev name string, 0 terminated
1807 * @features: Features (enum ionic_eth_hw_features)
1808 * @txstamp: TX Timestamping Mode (enum ionic_txstamp_mode)
1811 struct ionic_lif_getattr_comp {
1820 __le16 txstamp_mode;
1827 * struct ionic_lif_setphc_cmd - Set LIF PTP Hardware Clock
1829 * @lif_index: LIF index
1830 * @tick: Hardware stamp tick of an instant in time.
1831 * @nsec: Nanosecond stamp of the same instant.
1832 * @frac: Fractional nanoseconds at the same instant.
1833 * @mult: Cycle to nanosecond multiplier.
1834 * @shift: Cycle to nanosecond divisor (power of two).
1836 struct ionic_lif_setphc_cmd {
1849 enum ionic_rx_mode {
1850 IONIC_RX_MODE_F_UNICAST = BIT(0),
1851 IONIC_RX_MODE_F_MULTICAST = BIT(1),
1852 IONIC_RX_MODE_F_BROADCAST = BIT(2),
1853 IONIC_RX_MODE_F_PROMISC = BIT(3),
1854 IONIC_RX_MODE_F_ALLMULTI = BIT(4),
1855 IONIC_RX_MODE_F_RDMA_SNIFFER = BIT(5),
1859 * struct ionic_rx_mode_set_cmd - Set LIF's Rx mode command
1861 * @lif_index: LIF index
1862 * @rx_mode: Rx mode flags:
1863 * IONIC_RX_MODE_F_UNICAST: Accept known unicast packets
1864 * IONIC_RX_MODE_F_MULTICAST: Accept known multicast packets
1865 * IONIC_RX_MODE_F_BROADCAST: Accept broadcast packets
1866 * IONIC_RX_MODE_F_PROMISC: Accept any packets
1867 * IONIC_RX_MODE_F_ALLMULTI: Accept any multicast packets
1868 * IONIC_RX_MODE_F_RDMA_SNIFFER: Sniff RDMA packets
1870 struct ionic_rx_mode_set_cmd {
1878 typedef struct ionic_admin_comp ionic_rx_mode_set_comp;
1880 enum ionic_rx_filter_match_type {
1881 IONIC_RX_FILTER_MATCH_VLAN = 0x0,
1882 IONIC_RX_FILTER_MATCH_MAC = 0x1,
1883 IONIC_RX_FILTER_MATCH_MAC_VLAN = 0x2,
1884 IONIC_RX_FILTER_STEER_PKTCLASS = 0x10,
1888 * struct ionic_rx_filter_add_cmd - Add LIF Rx filter command
1890 * @qtype: Queue type
1891 * @lif_index: LIF index
1893 * @match: Rx filter match type (see IONIC_RX_FILTER_MATCH_xxx)
1894 * @vlan: VLAN filter
1897 * @addr: MAC address (network-byte order)
1898 * @mac_vlan: MACVLAN filter
1900 * @addr: MAC address (network-byte order)
1901 * @pkt_class: Packet classification filter
1903 struct ionic_rx_filter_add_cmd {
1926 * struct ionic_rx_filter_add_comp - Add LIF Rx filter command completion
1927 * @status: Status of the command (enum ionic_status_code)
1928 * @comp_index: Index in the descriptor ring for which this is the completion
1929 * @filter_id: Filter ID
1932 struct ionic_rx_filter_add_comp {
1942 * struct ionic_rx_filter_del_cmd - Delete LIF Rx filter command
1944 * @lif_index: LIF index
1945 * @filter_id: Filter ID
1947 struct ionic_rx_filter_del_cmd {
1955 typedef struct ionic_admin_comp ionic_rx_filter_del_comp;
1957 enum ionic_vf_attr {
1958 IONIC_VF_ATTR_SPOOFCHK = 1,
1959 IONIC_VF_ATTR_TRUST = 2,
1960 IONIC_VF_ATTR_MAC = 3,
1961 IONIC_VF_ATTR_LINKSTATE = 4,
1962 IONIC_VF_ATTR_VLAN = 5,
1963 IONIC_VF_ATTR_RATE = 6,
1964 IONIC_VF_ATTR_STATSADDR = 7,
1968 * enum ionic_vf_link_status - Virtual Function link status
1969 * @IONIC_VF_LINK_STATUS_AUTO: Use link state of the uplink
1970 * @IONIC_VF_LINK_STATUS_UP: Link always up
1971 * @IONIC_VF_LINK_STATUS_DOWN: Link always down
1973 enum ionic_vf_link_status {
1974 IONIC_VF_LINK_STATUS_AUTO = 0,
1975 IONIC_VF_LINK_STATUS_UP = 1,
1976 IONIC_VF_LINK_STATUS_DOWN = 2,
1980 * struct ionic_vf_setattr_cmd - Set VF attributes on the NIC
1982 * @attr: Attribute type (enum ionic_vf_attr)
1983 * @vf_index: VF index
1984 * @macaddr: mac address
1986 * @maxrate: max Tx rate in Mbps
1987 * @spoofchk: enable address spoof checking
1988 * @trust: enable VF trust
1989 * @linkstate: set link up or down
1990 * @stats_pa: set DMA address for VF stats
1992 struct ionic_vf_setattr_cmd {
2008 struct ionic_vf_setattr_comp {
2018 * struct ionic_vf_getattr_cmd - Get VF attributes from the NIC
2020 * @attr: Attribute type (enum ionic_vf_attr)
2021 * @vf_index: VF index
2023 struct ionic_vf_getattr_cmd {
2030 struct ionic_vf_getattr_comp {
2048 * struct ionic_qos_identify_cmd - QoS identify command
2050 * @ver: Highest version of identify supported by driver
2053 struct ionic_qos_identify_cmd {
2060 * struct ionic_qos_identify_comp - QoS identify command completion
2061 * @status: Status of the command (enum ionic_status_code)
2062 * @ver: Version of identify returned by device
2064 struct ionic_qos_identify_comp {
2070 #define IONIC_QOS_TC_MAX 8
2071 #define IONIC_QOS_ALL_TC 0xFF
2072 /* Capri max supported, should be renamed. */
2073 #define IONIC_QOS_CLASS_MAX 7
2074 #define IONIC_QOS_PCP_MAX 8
2075 #define IONIC_QOS_CLASS_NAME_SZ 32
2076 #define IONIC_QOS_DSCP_MAX 64
2077 #define IONIC_QOS_ALL_PCP 0xFF
2078 #define IONIC_DSCP_BLOCK_SIZE 8
2081 * enum ionic_qos_class
2083 enum ionic_qos_class {
2084 IONIC_QOS_CLASS_DEFAULT = 0,
2085 IONIC_QOS_CLASS_USER_DEFINED_1 = 1,
2086 IONIC_QOS_CLASS_USER_DEFINED_2 = 2,
2087 IONIC_QOS_CLASS_USER_DEFINED_3 = 3,
2088 IONIC_QOS_CLASS_USER_DEFINED_4 = 4,
2089 IONIC_QOS_CLASS_USER_DEFINED_5 = 5,
2090 IONIC_QOS_CLASS_USER_DEFINED_6 = 6,
2094 * enum ionic_qos_class_type - Traffic classification criteria
2095 * @IONIC_QOS_CLASS_TYPE_NONE: No QoS
2096 * @IONIC_QOS_CLASS_TYPE_PCP: Dot1Q PCP
2097 * @IONIC_QOS_CLASS_TYPE_DSCP: IP DSCP
2099 enum ionic_qos_class_type {
2100 IONIC_QOS_CLASS_TYPE_NONE = 0,
2101 IONIC_QOS_CLASS_TYPE_PCP = 1,
2102 IONIC_QOS_CLASS_TYPE_DSCP = 2,
2106 * enum ionic_qos_sched_type - QoS class scheduling type
2107 * @IONIC_QOS_SCHED_TYPE_STRICT: Strict priority
2108 * @IONIC_QOS_SCHED_TYPE_DWRR: Deficit weighted round-robin
2110 enum ionic_qos_sched_type {
2111 IONIC_QOS_SCHED_TYPE_STRICT = 0,
2112 IONIC_QOS_SCHED_TYPE_DWRR = 1,
2116 * union ionic_qos_config - QoS configuration structure
2117 * @flags: Configuration flags
2118 * IONIC_QOS_CONFIG_F_ENABLE enable
2119 * IONIC_QOS_CONFIG_F_NO_DROP drop/nodrop
2120 * IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP enable dot1q pcp rewrite
2121 * IONIC_QOS_CONFIG_F_RW_IP_DSCP enable ip dscp rewrite
2122 * IONIC_QOS_CONFIG_F_NON_DISRUPTIVE Non-disruptive TC update
2123 * @sched_type: QoS class scheduling type (enum ionic_qos_sched_type)
2124 * @class_type: QoS class type (enum ionic_qos_class_type)
2125 * @pause_type: QoS pause type (enum ionic_qos_pause_type)
2126 * @name: QoS class name
2127 * @mtu: MTU of the class
2128 * @pfc_cos: Priority-Flow Control class of service
2129 * @dwrr_weight: QoS class scheduling weight
2130 * @strict_rlmt: Rate limit for strict priority scheduling
2131 * @rw_dot1q_pcp: Rewrite dot1q pcp to value (valid iff F_RW_DOT1Q_PCP)
2132 * @rw_ip_dscp: Rewrite ip dscp to value (valid iff F_RW_IP_DSCP)
2133 * @dot1q_pcp: Dot1q pcp value
2134 * @ndscp: Number of valid dscp values in the ip_dscp field
2135 * @ip_dscp: IP dscp values
2137 union ionic_qos_config {
2139 #define IONIC_QOS_CONFIG_F_ENABLE BIT(0)
2140 #define IONIC_QOS_CONFIG_F_NO_DROP BIT(1)
2141 /* Used to rewrite PCP or DSCP value. */
2142 #define IONIC_QOS_CONFIG_F_RW_DOT1Q_PCP BIT(2)
2143 #define IONIC_QOS_CONFIG_F_RW_IP_DSCP BIT(3)
2144 /* Non-disruptive TC update */
2145 #define IONIC_QOS_CONFIG_F_NON_DISRUPTIVE BIT(4)
2150 char name[IONIC_QOS_CLASS_NAME_SZ];
2160 /* Used to rewrite PCP or DSCP value. */
2165 /* classification */
2170 u8 ip_dscp[IONIC_QOS_DSCP_MAX];
2178 * union ionic_qos_identity - QoS identity structure
2179 * @version: Version of the identify structure
2180 * @type: QoS system type
2181 * @nclasses: Number of usable QoS classes
2182 * @config: Current configuration of classes
2184 union ionic_qos_identity {
2189 union ionic_qos_config config[IONIC_QOS_CLASS_MAX];
2195 * struct ionic_qos_init_cmd - QoS config init command
2197 * @group: QoS class id
2198 * @info_pa: destination address for qos info
2200 struct ionic_qos_init_cmd {
2208 typedef struct ionic_admin_comp ionic_qos_init_comp;
2211 * struct ionic_qos_reset_cmd - QoS config reset command
2213 * @group: QoS class id
2215 struct ionic_qos_reset_cmd {
2222 * struct ionic_qos_clear_port_stats_cmd - Qos config reset command
2225 struct ionic_qos_clear_stats_cmd {
2231 typedef struct ionic_admin_comp ionic_qos_reset_comp;
2234 * struct ionic_fw_download_cmd - Firmware download command
2236 * @addr: dma address of the firmware buffer
2237 * @offset: offset of the firmware buffer within the full image
2238 * @length: number of valid bytes in the firmware buffer
2240 struct ionic_fw_download_cmd {
2248 typedef struct ionic_admin_comp ionic_fw_download_comp;
2251 * enum ionic_fw_control_oper - FW control operations
2252 * @IONIC_FW_RESET: Reset firmware
2253 * @IONIC_FW_INSTALL: Install firmware
2254 * @IONIC_FW_ACTIVATE: Activate firmware
2255 * @IONIC_FW_INSTALL_ASYNC: Install firmware asynchronously
2256 * @IONIC_FW_INSTALL_STATUS: Firmware installation status
2257 * @IONIC_FW_ACTIVATE_ASYNC: Activate firmware asynchronously
2258 * @IONIC_FW_ACTIVATE_STATUS: Firmware activate status
2260 enum ionic_fw_control_oper {
2262 IONIC_FW_INSTALL = 1,
2263 IONIC_FW_ACTIVATE = 2,
2264 IONIC_FW_INSTALL_ASYNC = 3,
2265 IONIC_FW_INSTALL_STATUS = 4,
2266 IONIC_FW_ACTIVATE_ASYNC = 5,
2267 IONIC_FW_ACTIVATE_STATUS = 6,
2268 IONIC_FW_UPDATE_CLEANUP = 7,
2272 * struct ionic_fw_control_cmd - Firmware control command
2274 * @oper: firmware control operation (enum ionic_fw_control_oper)
2275 * @slot: slot to activate
2277 struct ionic_fw_control_cmd {
2286 * struct ionic_fw_control_comp - Firmware control copletion
2287 * @status: Status of the command (enum ionic_status_code)
2288 * @comp_index: Index in the descriptor ring for which this is the completion
2289 * @slot: Slot where the firmware was installed
2292 struct ionic_fw_control_comp {
2301 /******************************************************************
2302 ******************* RDMA Commands ********************************
2303 ******************************************************************/
2306 * struct ionic_rdma_reset_cmd - Reset RDMA LIF cmd
2308 * @lif_index: LIF index
2310 * There is no RDMA specific dev command completion struct. Completion uses
2311 * the common struct ionic_admin_comp. Only the status is indicated.
2312 * Nonzero status means the LIF does not support RDMA.
2314 struct ionic_rdma_reset_cmd {
2322 * struct ionic_rdma_queue_cmd - Create RDMA Queue command
2323 * @opcode: opcode, 52, 53
2324 * @lif_index: LIF index
2325 * @qid_ver: (qid | (RDMA version << 24))
2326 * @cid: intr, eq_id, or cq_id
2327 * @dbid: doorbell page id
2328 * @depth_log2: log base two of queue depth
2329 * @stride_log2: log base two of queue stride
2330 * @dma_addr: address of the queue memory
2332 * The same command struct is used to create an RDMA event queue, completion
2333 * queue, or RDMA admin queue. The cid is an interrupt number for an event
2334 * queue, an event queue id for a completion queue, or a completion queue id
2335 * for an RDMA admin queue.
2337 * The queue created via a dev command must be contiguous in dma space.
2339 * The dev commands are intended only to be used during driver initialization,
2340 * to create queues supporting the RDMA admin queue. Other queues, and other
2341 * types of RDMA resources like memory regions, will be created and registered
2342 * via the RDMA admin queue, and will support a more complete interface
2343 * providing scatter gather lists for larger, scattered queue buffers and
2344 * memory registration.
2346 * There is no RDMA specific dev command completion struct. Completion uses
2347 * the common struct ionic_admin_comp. Only the status is indicated.
2349 struct ionic_rdma_queue_cmd {
2362 /******************************************************************
2363 ******************* Notify Events ********************************
2364 ******************************************************************/
2367 * struct ionic_notifyq_event - Generic event reporting structure
2368 * @eid: event number
2369 * @ecode: event code
2370 * @data: unspecified data about the event
2372 * This is the generic event report struct from which the other
2373 * actual events will be formed.
2375 struct ionic_notifyq_event {
2382 * struct ionic_link_change_event - Link change event notification
2383 * @eid: event number
2384 * @ecode: event code = IONIC_EVENT_LINK_CHANGE
2385 * @link_status: link up/down, with error bits (enum ionic_port_status)
2386 * @link_speed: speed of the network link
2388 * Sent when the network link state changes between UP and DOWN
2390 struct ionic_link_change_event {
2394 __le32 link_speed; /* units of 1Mbps: e.g. 10000 = 10Gbps */
2399 * struct ionic_reset_event - Reset event notification
2400 * @eid: event number
2401 * @ecode: event code = IONIC_EVENT_RESET
2402 * @reset_code: reset type
2403 * @state: 0=pending, 1=complete, 2=error
2405 * Sent when the NIC or some subsystem is going to be or
2408 struct ionic_reset_event {
2417 * struct ionic_heartbeat_event - Sent periodically by NIC to indicate health
2418 * @eid: event number
2419 * @ecode: event code = IONIC_EVENT_HEARTBEAT
2421 struct ionic_heartbeat_event {
2428 * struct ionic_log_event - Sent to notify the driver of an internal error
2429 * @eid: event number
2430 * @ecode: event code = IONIC_EVENT_LOG
2433 struct ionic_log_event {
2440 * struct ionic_xcvr_event - Transceiver change event
2441 * @eid: event number
2442 * @ecode: event code = IONIC_EVENT_XCVR
2444 struct ionic_xcvr_event {
2451 * struct ionic_port_stats - Port statistics structure
2453 struct ionic_port_stats {
2454 __le64 frames_rx_ok;
2455 __le64 frames_rx_all;
2456 __le64 frames_rx_bad_fcs;
2457 __le64 frames_rx_bad_all;
2458 __le64 octets_rx_ok;
2459 __le64 octets_rx_all;
2460 __le64 frames_rx_unicast;
2461 __le64 frames_rx_multicast;
2462 __le64 frames_rx_broadcast;
2463 __le64 frames_rx_pause;
2464 __le64 frames_rx_bad_length;
2465 __le64 frames_rx_undersized;
2466 __le64 frames_rx_oversized;
2467 __le64 frames_rx_fragments;
2468 __le64 frames_rx_jabber;
2469 __le64 frames_rx_pripause;
2470 __le64 frames_rx_stomped_crc;
2471 __le64 frames_rx_too_long;
2472 __le64 frames_rx_vlan_good;
2473 __le64 frames_rx_dropped;
2474 __le64 frames_rx_less_than_64b;
2475 __le64 frames_rx_64b;
2476 __le64 frames_rx_65b_127b;
2477 __le64 frames_rx_128b_255b;
2478 __le64 frames_rx_256b_511b;
2479 __le64 frames_rx_512b_1023b;
2480 __le64 frames_rx_1024b_1518b;
2481 __le64 frames_rx_1519b_2047b;
2482 __le64 frames_rx_2048b_4095b;
2483 __le64 frames_rx_4096b_8191b;
2484 __le64 frames_rx_8192b_9215b;
2485 __le64 frames_rx_other;
2486 __le64 frames_tx_ok;
2487 __le64 frames_tx_all;
2488 __le64 frames_tx_bad;
2489 __le64 octets_tx_ok;
2490 __le64 octets_tx_total;
2491 __le64 frames_tx_unicast;
2492 __le64 frames_tx_multicast;
2493 __le64 frames_tx_broadcast;
2494 __le64 frames_tx_pause;
2495 __le64 frames_tx_pripause;
2496 __le64 frames_tx_vlan;
2497 __le64 frames_tx_less_than_64b;
2498 __le64 frames_tx_64b;
2499 __le64 frames_tx_65b_127b;
2500 __le64 frames_tx_128b_255b;
2501 __le64 frames_tx_256b_511b;
2502 __le64 frames_tx_512b_1023b;
2503 __le64 frames_tx_1024b_1518b;
2504 __le64 frames_tx_1519b_2047b;
2505 __le64 frames_tx_2048b_4095b;
2506 __le64 frames_tx_4096b_8191b;
2507 __le64 frames_tx_8192b_9215b;
2508 __le64 frames_tx_other;
2509 __le64 frames_tx_pri_0;
2510 __le64 frames_tx_pri_1;
2511 __le64 frames_tx_pri_2;
2512 __le64 frames_tx_pri_3;
2513 __le64 frames_tx_pri_4;
2514 __le64 frames_tx_pri_5;
2515 __le64 frames_tx_pri_6;
2516 __le64 frames_tx_pri_7;
2517 __le64 frames_rx_pri_0;
2518 __le64 frames_rx_pri_1;
2519 __le64 frames_rx_pri_2;
2520 __le64 frames_rx_pri_3;
2521 __le64 frames_rx_pri_4;
2522 __le64 frames_rx_pri_5;
2523 __le64 frames_rx_pri_6;
2524 __le64 frames_rx_pri_7;
2525 __le64 tx_pripause_0_1us_count;
2526 __le64 tx_pripause_1_1us_count;
2527 __le64 tx_pripause_2_1us_count;
2528 __le64 tx_pripause_3_1us_count;
2529 __le64 tx_pripause_4_1us_count;
2530 __le64 tx_pripause_5_1us_count;
2531 __le64 tx_pripause_6_1us_count;
2532 __le64 tx_pripause_7_1us_count;
2533 __le64 rx_pripause_0_1us_count;
2534 __le64 rx_pripause_1_1us_count;
2535 __le64 rx_pripause_2_1us_count;
2536 __le64 rx_pripause_3_1us_count;
2537 __le64 rx_pripause_4_1us_count;
2538 __le64 rx_pripause_5_1us_count;
2539 __le64 rx_pripause_6_1us_count;
2540 __le64 rx_pripause_7_1us_count;
2541 __le64 rx_pause_1us_count;
2542 __le64 frames_tx_truncated;
2545 struct ionic_mgmt_port_stats {
2546 __le64 frames_rx_ok;
2547 __le64 frames_rx_all;
2548 __le64 frames_rx_bad_fcs;
2549 __le64 frames_rx_bad_all;
2550 __le64 octets_rx_ok;
2551 __le64 octets_rx_all;
2552 __le64 frames_rx_unicast;
2553 __le64 frames_rx_multicast;
2554 __le64 frames_rx_broadcast;
2555 __le64 frames_rx_pause;
2556 __le64 frames_rx_bad_length;
2557 __le64 frames_rx_undersized;
2558 __le64 frames_rx_oversized;
2559 __le64 frames_rx_fragments;
2560 __le64 frames_rx_jabber;
2561 __le64 frames_rx_64b;
2562 __le64 frames_rx_65b_127b;
2563 __le64 frames_rx_128b_255b;
2564 __le64 frames_rx_256b_511b;
2565 __le64 frames_rx_512b_1023b;
2566 __le64 frames_rx_1024b_1518b;
2567 __le64 frames_rx_gt_1518b;
2568 __le64 frames_rx_fifo_full;
2569 __le64 frames_tx_ok;
2570 __le64 frames_tx_all;
2571 __le64 frames_tx_bad;
2572 __le64 octets_tx_ok;
2573 __le64 octets_tx_total;
2574 __le64 frames_tx_unicast;
2575 __le64 frames_tx_multicast;
2576 __le64 frames_tx_broadcast;
2577 __le64 frames_tx_pause;
2580 enum ionic_pb_buffer_drop_stats {
2581 IONIC_BUFFER_INTRINSIC_DROP = 0,
2582 IONIC_BUFFER_DISCARDED,
2583 IONIC_BUFFER_ADMITTED,
2584 IONIC_BUFFER_OUT_OF_CELLS_DROP,
2585 IONIC_BUFFER_OUT_OF_CELLS_DROP_2,
2586 IONIC_BUFFER_OUT_OF_CREDIT_DROP,
2587 IONIC_BUFFER_TRUNCATION_DROP,
2588 IONIC_BUFFER_PORT_DISABLED_DROP,
2589 IONIC_BUFFER_COPY_TO_CPU_TAIL_DROP,
2590 IONIC_BUFFER_SPAN_TAIL_DROP,
2591 IONIC_BUFFER_MIN_SIZE_VIOLATION_DROP,
2592 IONIC_BUFFER_ENQUEUE_ERROR_DROP,
2593 IONIC_BUFFER_INVALID_PORT_DROP,
2594 IONIC_BUFFER_INVALID_OUTPUT_QUEUE_DROP,
2595 IONIC_BUFFER_DROP_MAX,
2598 enum ionic_oflow_drop_stats {
2599 IONIC_OFLOW_OCCUPANCY_DROP,
2600 IONIC_OFLOW_EMERGENCY_STOP_DROP,
2601 IONIC_OFLOW_WRITE_BUFFER_ACK_FILL_UP_DROP,
2602 IONIC_OFLOW_WRITE_BUFFER_ACK_FULL_DROP,
2603 IONIC_OFLOW_WRITE_BUFFER_FULL_DROP,
2604 IONIC_OFLOW_CONTROL_FIFO_FULL_DROP,
2605 IONIC_OFLOW_DROP_MAX,
2609 * struct port_pb_stats - packet buffers system stats
2610 * uses ionic_pb_buffer_drop_stats for drop_counts[]
2612 struct ionic_port_pb_stats {
2613 __le64 sop_count_in;
2614 __le64 eop_count_in;
2615 __le64 sop_count_out;
2616 __le64 eop_count_out;
2617 __le64 drop_counts[IONIC_BUFFER_DROP_MAX];
2618 __le64 input_queue_buffer_occupancy[IONIC_QOS_TC_MAX];
2619 __le64 input_queue_port_monitor[IONIC_QOS_TC_MAX];
2620 __le64 output_queue_port_monitor[IONIC_QOS_TC_MAX];
2621 __le64 oflow_drop_counts[IONIC_OFLOW_DROP_MAX];
2622 __le64 input_queue_good_pkts_in[IONIC_QOS_TC_MAX];
2623 __le64 input_queue_good_pkts_out[IONIC_QOS_TC_MAX];
2624 __le64 input_queue_err_pkts_in[IONIC_QOS_TC_MAX];
2625 __le64 input_queue_fifo_depth[IONIC_QOS_TC_MAX];
2626 __le64 input_queue_max_fifo_depth[IONIC_QOS_TC_MAX];
2627 __le64 input_queue_peak_occupancy[IONIC_QOS_TC_MAX];
2628 __le64 output_queue_buffer_occupancy[IONIC_QOS_TC_MAX];
2632 * struct ionic_port_identity - port identity structure
2633 * @version: identity structure version
2634 * @type: type of port (enum ionic_port_type)
2635 * @num_lanes: number of lanes for the port
2636 * @autoneg: autoneg supported
2637 * @min_frame_size: minimum frame size supported
2638 * @max_frame_size: maximum frame size supported
2639 * @fec_type: supported fec types
2640 * @pause_type: supported pause types
2641 * @loopback_mode: supported loopback mode
2642 * @speeds: supported speeds
2643 * @config: current port configuration
2645 union ionic_port_identity {
2651 __le32 min_frame_size;
2652 __le32 max_frame_size;
2655 u8 loopback_mode[2];
2658 union ionic_port_config config;
2664 * struct ionic_port_info - port info structure
2665 * @config: Port configuration data
2666 * @status: Port status data
2667 * @stats: Port statistics data
2668 * @mgmt_stats: Port management statistics data
2669 * @port_pb_drop_stats: uplink pb drop stats
2671 struct ionic_port_info {
2672 union ionic_port_config config;
2673 struct ionic_port_status status;
2675 struct ionic_port_stats stats;
2676 struct ionic_mgmt_port_stats mgmt_stats;
2678 /* room for pb_stats to start at 2k offset */
2680 struct ionic_port_pb_stats pb_stats;
2684 * struct ionic_lif_stats - LIF statistics structure
2686 struct ionic_lif_stats {
2688 __le64 rx_ucast_bytes;
2689 __le64 rx_ucast_packets;
2690 __le64 rx_mcast_bytes;
2691 __le64 rx_mcast_packets;
2692 __le64 rx_bcast_bytes;
2693 __le64 rx_bcast_packets;
2697 __le64 rx_ucast_drop_bytes;
2698 __le64 rx_ucast_drop_packets;
2699 __le64 rx_mcast_drop_bytes;
2700 __le64 rx_mcast_drop_packets;
2701 __le64 rx_bcast_drop_bytes;
2702 __le64 rx_bcast_drop_packets;
2703 __le64 rx_dma_error;
2706 __le64 tx_ucast_bytes;
2707 __le64 tx_ucast_packets;
2708 __le64 tx_mcast_bytes;
2709 __le64 tx_mcast_packets;
2710 __le64 tx_bcast_bytes;
2711 __le64 tx_bcast_packets;
2715 __le64 tx_ucast_drop_bytes;
2716 __le64 tx_ucast_drop_packets;
2717 __le64 tx_mcast_drop_bytes;
2718 __le64 tx_mcast_drop_packets;
2719 __le64 tx_bcast_drop_bytes;
2720 __le64 tx_bcast_drop_packets;
2721 __le64 tx_dma_error;
2723 /* Rx Queue/Ring drops */
2724 __le64 rx_queue_disabled;
2725 __le64 rx_queue_empty;
2726 __le64 rx_queue_error;
2727 __le64 rx_desc_fetch_error;
2728 __le64 rx_desc_data_error;
2732 /* Tx Queue/Ring drops */
2733 __le64 tx_queue_disabled;
2734 __le64 tx_queue_error;
2735 __le64 tx_desc_fetch_error;
2736 __le64 tx_desc_data_error;
2737 __le64 tx_queue_empty;
2743 __le64 tx_rdma_ucast_bytes;
2744 __le64 tx_rdma_ucast_packets;
2745 __le64 tx_rdma_mcast_bytes;
2746 __le64 tx_rdma_mcast_packets;
2747 __le64 tx_rdma_cnp_packets;
2753 __le64 rx_rdma_ucast_bytes;
2754 __le64 rx_rdma_ucast_packets;
2755 __le64 rx_rdma_mcast_bytes;
2756 __le64 rx_rdma_mcast_packets;
2757 __le64 rx_rdma_cnp_packets;
2758 __le64 rx_rdma_ecn_packets;
2798 /* RDMA/ROCE REQ Error/Debugs (768 - 895) */
2799 __le64 rdma_req_rx_pkt_seq_err;
2800 __le64 rdma_req_rx_rnr_retry_err;
2801 __le64 rdma_req_rx_remote_access_err;
2802 __le64 rdma_req_rx_remote_inv_req_err;
2803 __le64 rdma_req_rx_remote_oper_err;
2804 __le64 rdma_req_rx_implied_nak_seq_err;
2805 __le64 rdma_req_rx_cqe_err;
2806 __le64 rdma_req_rx_cqe_flush_err;
2808 __le64 rdma_req_rx_dup_responses;
2809 __le64 rdma_req_rx_invalid_packets;
2810 __le64 rdma_req_tx_local_access_err;
2811 __le64 rdma_req_tx_local_oper_err;
2812 __le64 rdma_req_tx_memory_mgmt_err;
2817 /* RDMA/ROCE RESP Error/Debugs (896 - 1023) */
2818 __le64 rdma_resp_rx_dup_requests;
2819 __le64 rdma_resp_rx_out_of_buffer;
2820 __le64 rdma_resp_rx_out_of_seq_pkts;
2821 __le64 rdma_resp_rx_cqe_err;
2822 __le64 rdma_resp_rx_cqe_flush_err;
2823 __le64 rdma_resp_rx_local_len_err;
2824 __le64 rdma_resp_rx_inv_request_err;
2825 __le64 rdma_resp_rx_local_qp_oper_err;
2827 __le64 rdma_resp_rx_out_of_atomic_resource;
2828 __le64 rdma_resp_tx_pkt_seq_err;
2829 __le64 rdma_resp_tx_remote_inv_req_err;
2830 __le64 rdma_resp_tx_remote_access_err;
2831 __le64 rdma_resp_tx_remote_oper_err;
2832 __le64 rdma_resp_tx_rnr_retry_err;
2838 * struct ionic_lif_info - LIF info structure
2839 * @config: LIF configuration structure
2840 * @status: LIF status structure
2841 * @stats: LIF statistics structure
2843 struct ionic_lif_info {
2844 union ionic_lif_config config;
2845 struct ionic_lif_status status;
2846 struct ionic_lif_stats stats;
2849 union ionic_dev_cmd {
2851 struct ionic_admin_cmd cmd;
2852 struct ionic_nop_cmd nop;
2854 struct ionic_dev_identify_cmd identify;
2855 struct ionic_dev_init_cmd init;
2856 struct ionic_dev_reset_cmd reset;
2857 struct ionic_dev_getattr_cmd getattr;
2858 struct ionic_dev_setattr_cmd setattr;
2860 struct ionic_port_identify_cmd port_identify;
2861 struct ionic_port_init_cmd port_init;
2862 struct ionic_port_reset_cmd port_reset;
2863 struct ionic_port_getattr_cmd port_getattr;
2864 struct ionic_port_setattr_cmd port_setattr;
2866 struct ionic_vf_setattr_cmd vf_setattr;
2867 struct ionic_vf_getattr_cmd vf_getattr;
2869 struct ionic_lif_identify_cmd lif_identify;
2870 struct ionic_lif_init_cmd lif_init;
2871 struct ionic_lif_reset_cmd lif_reset;
2873 struct ionic_qos_identify_cmd qos_identify;
2874 struct ionic_qos_init_cmd qos_init;
2875 struct ionic_qos_reset_cmd qos_reset;
2876 struct ionic_qos_clear_stats_cmd qos_clear_stats;
2878 struct ionic_q_identify_cmd q_identify;
2879 struct ionic_q_init_cmd q_init;
2880 struct ionic_q_control_cmd q_control;
2882 struct ionic_fw_download_cmd fw_download;
2883 struct ionic_fw_control_cmd fw_control;
2886 union ionic_dev_cmd_comp {
2889 struct ionic_admin_comp comp;
2890 struct ionic_nop_comp nop;
2892 struct ionic_dev_identify_comp identify;
2893 struct ionic_dev_init_comp init;
2894 struct ionic_dev_reset_comp reset;
2895 struct ionic_dev_getattr_comp getattr;
2896 struct ionic_dev_setattr_comp setattr;
2898 struct ionic_port_identify_comp port_identify;
2899 struct ionic_port_init_comp port_init;
2900 struct ionic_port_reset_comp port_reset;
2901 struct ionic_port_getattr_comp port_getattr;
2902 struct ionic_port_setattr_comp port_setattr;
2904 struct ionic_vf_setattr_comp vf_setattr;
2905 struct ionic_vf_getattr_comp vf_getattr;
2907 struct ionic_lif_identify_comp lif_identify;
2908 struct ionic_lif_init_comp lif_init;
2909 ionic_lif_reset_comp lif_reset;
2911 struct ionic_qos_identify_comp qos_identify;
2912 ionic_qos_init_comp qos_init;
2913 ionic_qos_reset_comp qos_reset;
2915 struct ionic_q_identify_comp q_identify;
2916 struct ionic_q_init_comp q_init;
2918 ionic_fw_download_comp fw_download;
2919 struct ionic_fw_control_comp fw_control;
2923 * struct ionic_hwstamp_regs - Hardware current timestamp registers
2924 * @tick_low: Low 32 bits of hardware timestamp
2925 * @tick_high: High 32 bits of hardware timestamp
2927 struct ionic_hwstamp_regs {
2933 * union ionic_dev_info_regs - Device info register format (read-only)
2934 * @signature: Signature value of 0x44455649 ('DEVI')
2935 * @version: Current version of info
2936 * @asic_type: Asic type
2937 * @asic_rev: Asic revision
2938 * @fw_status: Firmware status
2939 * bit 0 - 1 = fw running
2940 * bit 4-7 - 4 bit generation number, changes on fw restart
2941 * @fw_heartbeat: Firmware heartbeat counter
2942 * @serial_num: Serial number
2943 * @fw_version: Firmware version
2944 * @hwstamp_regs: Hardware current timestamp registers
2946 union ionic_dev_info_regs {
2947 #define IONIC_DEVINFO_FWVERS_BUFLEN 32
2948 #define IONIC_DEVINFO_SERIAL_BUFLEN 32
2954 #define IONIC_FW_STS_F_RUNNING 0x01
2955 #define IONIC_FW_STS_F_GENERATION 0xF0
2958 char fw_version[IONIC_DEVINFO_FWVERS_BUFLEN];
2959 char serial_num[IONIC_DEVINFO_SERIAL_BUFLEN];
2960 u8 rsvd_pad1024[948];
2961 struct ionic_hwstamp_regs hwstamp;
2967 * union ionic_dev_cmd_regs - Device command register format (read-write)
2968 * @doorbell: Device Cmd Doorbell, write-only
2969 * Write a 1 to signal device to process cmd,
2970 * poll done for completion.
2971 * @done: Done indicator, bit 0 == 1 when command is complete
2972 * @cmd: Opcode-specific command bytes
2973 * @comp: Opcode-specific response bytes
2974 * @data: Opcode-specific side-data
2976 union ionic_dev_cmd_regs {
2980 union ionic_dev_cmd cmd;
2981 union ionic_dev_cmd_comp comp;
2989 * union ionic_dev_regs - Device register format for bar 0 page 0
2990 * @info: Device info registers
2991 * @devcmd: Device command registers
2993 union ionic_dev_regs {
2995 union ionic_dev_info_regs info;
2996 union ionic_dev_cmd_regs devcmd;
3001 union ionic_adminq_cmd {
3002 struct ionic_admin_cmd cmd;
3003 struct ionic_nop_cmd nop;
3004 struct ionic_q_identify_cmd q_identify;
3005 struct ionic_q_init_cmd q_init;
3006 struct ionic_q_control_cmd q_control;
3007 struct ionic_lif_setattr_cmd lif_setattr;
3008 struct ionic_lif_getattr_cmd lif_getattr;
3009 struct ionic_lif_setphc_cmd lif_setphc;
3010 struct ionic_rx_mode_set_cmd rx_mode_set;
3011 struct ionic_rx_filter_add_cmd rx_filter_add;
3012 struct ionic_rx_filter_del_cmd rx_filter_del;
3013 struct ionic_rdma_reset_cmd rdma_reset;
3014 struct ionic_rdma_queue_cmd rdma_queue;
3015 struct ionic_fw_download_cmd fw_download;
3016 struct ionic_fw_control_cmd fw_control;
3019 union ionic_adminq_comp {
3020 struct ionic_admin_comp comp;
3021 struct ionic_nop_comp nop;
3022 struct ionic_q_identify_comp q_identify;
3023 struct ionic_q_init_comp q_init;
3024 struct ionic_lif_setattr_comp lif_setattr;
3025 struct ionic_lif_getattr_comp lif_getattr;
3026 struct ionic_admin_comp lif_setphc;
3027 struct ionic_rx_filter_add_comp rx_filter_add;
3028 struct ionic_fw_control_comp fw_control;
3031 #define IONIC_BARS_MAX 6
3032 #define IONIC_PCI_BAR_DBELL 1
3035 #define IONIC_BAR0_SIZE 0x8000
3037 #define IONIC_BAR0_DEV_INFO_REGS_OFFSET 0x0000
3038 #define IONIC_BAR0_DEV_CMD_REGS_OFFSET 0x0800
3039 #define IONIC_BAR0_DEV_CMD_DATA_REGS_OFFSET 0x0c00
3040 #define IONIC_BAR0_INTR_STATUS_OFFSET 0x1000
3041 #define IONIC_BAR0_INTR_CTRL_OFFSET 0x2000
3042 #define IONIC_DEV_CMD_DONE 0x00000001
3044 #define IONIC_ASIC_TYPE_CAPRI 0
3047 * struct ionic_doorbell - Doorbell register layout
3048 * @p_index: Producer index
3049 * @ring: Selects the specific ring of the queue to update
3050 * Type-specific meaning:
3051 * ring=0: Default producer/consumer queue
3052 * ring=1: (CQ, EQ) Re-Arm queue. RDMA CQs
3053 * send events to EQs when armed. EQs send
3054 * interrupts when armed.
3055 * @qid_lo: Queue destination for the producer index and flags (low bits)
3056 * @qid_hi: Queue destination for the producer index and flags (high bits)
3058 struct ionic_doorbell {
3066 struct ionic_intr_status {
3070 struct ionic_notifyq_cmd {
3071 __le32 data; /* Not used but needed for qcq structure */
3074 union ionic_notifyq_comp {
3075 struct ionic_notifyq_event event;
3076 struct ionic_link_change_event link_change;
3077 struct ionic_reset_event reset;
3078 struct ionic_heartbeat_event heartbeat;
3079 struct ionic_log_event log;
3083 struct ionic_identity {
3084 union ionic_drv_identity drv;
3085 union ionic_dev_identity dev;
3086 union ionic_lif_identity lif;
3087 union ionic_port_identity port;
3088 union ionic_qos_identity qos;
3089 union ionic_q_identity txq;
3092 #endif /* _IONIC_IF_H_ */