Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /****************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Driver for Solarflare network controllers and boards
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright 2010-2012 Solarflare Communications Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #ifndef _VFDI_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #define _VFDI_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * DOC: Virtual Function Driver Interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * This file contains software structures used to form a two way
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * communication channel between the VF driver and the PF driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * named Virtual Function Driver Interface (VFDI).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * For the purposes of VFDI, a page is a memory region with size and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * alignment of 4K.  All addresses are DMA addresses to be used within
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * the domain of the relevant VF.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * The only hardware-defined channels for a VF driver to communicate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * with the PF driver are the event mailboxes (%FR_CZ_USR_EV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * registers).  Writing to these registers generates an event with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * EV_CODE = EV_CODE_USR_EV, USER_QID set to the index of the mailbox
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * and USER_EV_REG_VALUE set to the value written.  The PF driver may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * direct or disable delivery of these events by setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * %FR_CZ_USR_EV_CFG.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * The PF driver can send arbitrary events to arbitrary event queues.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * However, for consistency, VFDI events from the PF are defined to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * follow the same form and be sent to the first event queue assigned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  * to the VF while that queue is enabled by the VF driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * The general form of the variable bits of VFDI events is:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)  *       0             16                       24   31
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)  *      | DATA        | TYPE                   | SEQ   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  * SEQ is a sequence number which should be incremented by 1 (modulo
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * 256) for each event.  The sequence numbers used in each direction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * are independent.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * The VF submits requests of type &struct vfdi_req by sending the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  * address of the request (ADDR) in a series of 4 events:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)  *       0             16                       24   31
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)  *      | ADDR[0:15]  | VFDI_EV_TYPE_REQ_WORD0 | SEQ   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47)  *      | ADDR[16:31] | VFDI_EV_TYPE_REQ_WORD1 | SEQ+1 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  *      | ADDR[32:47] | VFDI_EV_TYPE_REQ_WORD2 | SEQ+2 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  *      | ADDR[48:63] | VFDI_EV_TYPE_REQ_WORD3 | SEQ+3 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51)  * The address must be page-aligned.  After receiving such a valid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  * series of events, the PF driver will attempt to read the request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * and write a response to the same address.  In case of an invalid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  * sequence of events or a DMA error, there will be no response.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  * The VF driver may request that the PF driver writes status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  * information into its domain asynchronously.  After writing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  * status, the PF driver will send an event of the form:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  *       0             16                       24   31
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  *      | reserved    | VFDI_EV_TYPE_STATUS    | SEQ   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * In case the VF must be reset for any reason, the PF driver will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  * send an event of the form:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  *       0             16                       24   31
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  *      | reserved    | VFDI_EV_TYPE_RESET     | SEQ   |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)  * It is then the responsibility of the VF driver to request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  * reinitialisation of its queues.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) #define VFDI_EV_SEQ_LBN 24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) #define VFDI_EV_SEQ_WIDTH 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) #define VFDI_EV_TYPE_LBN 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) #define VFDI_EV_TYPE_WIDTH 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) #define VFDI_EV_TYPE_REQ_WORD0 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) #define VFDI_EV_TYPE_REQ_WORD1 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) #define VFDI_EV_TYPE_REQ_WORD2 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) #define VFDI_EV_TYPE_REQ_WORD3 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) #define VFDI_EV_TYPE_STATUS 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) #define VFDI_EV_TYPE_RESET 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) #define VFDI_EV_DATA_LBN 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) #define VFDI_EV_DATA_WIDTH 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) struct vfdi_endpoint {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	u8 mac_addr[ETH_ALEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	__be16 tci;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)  * enum vfdi_op - VFDI operation enumeration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  * @VFDI_OP_RESPONSE: Indicates a response to the request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  * @VFDI_OP_INIT_EVQ: Initialize SRAM entries and initialize an EVQ.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  * @VFDI_OP_INIT_RXQ: Initialize SRAM entries and initialize an RXQ.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  * @VFDI_OP_INIT_TXQ: Initialize SRAM entries and initialize a TXQ.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  * @VFDI_OP_FINI_ALL_QUEUES: Flush all queues, finalize all queues, then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  *	finalize the SRAM entries.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * @VFDI_OP_INSERT_FILTER: Insert a MAC filter targeting the given RXQ.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  * @VFDI_OP_REMOVE_ALL_FILTERS: Remove all filters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  * @VFDI_OP_SET_STATUS_PAGE: Set the DMA page(s) used for status updates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  *	from PF and write the initial status.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  * @VFDI_OP_CLEAR_STATUS_PAGE: Clear the DMA page(s) used for status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)  *	updates from PF.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) enum vfdi_op {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	VFDI_OP_RESPONSE = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	VFDI_OP_INIT_EVQ = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	VFDI_OP_INIT_RXQ = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	VFDI_OP_INIT_TXQ = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	VFDI_OP_FINI_ALL_QUEUES = 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	VFDI_OP_INSERT_FILTER = 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	VFDI_OP_REMOVE_ALL_FILTERS = 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	VFDI_OP_SET_STATUS_PAGE = 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	VFDI_OP_CLEAR_STATUS_PAGE = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	VFDI_OP_LIMIT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) /* Response codes for VFDI operations. Other values may be used in future. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define VFDI_RC_SUCCESS		0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #define VFDI_RC_ENOMEM		(-12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #define VFDI_RC_EINVAL		(-22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #define VFDI_RC_EOPNOTSUPP	(-95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) #define VFDI_RC_ETIMEDOUT	(-110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  * struct vfdi_req - Request from VF driver to PF driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  * @op: Operation code or response indicator, taken from &enum vfdi_op.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  * @rc: Response code.  Set to 0 on success or a negative error code on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  * @u.init_evq.index: Index of event queue to create.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  * @u.init_evq.buf_count: Number of 4k buffers backing event queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  * @u.init_evq.addr: Array of length %u.init_evq.buf_count containing DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  *	address of each page backing the event queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  * @u.init_rxq.index: Index of receive queue to create.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  * @u.init_rxq.buf_count: Number of 4k buffers backing receive queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  * @u.init_rxq.evq: Instance of event queue to target receive events at.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  * @u.init_rxq.label: Label used in receive events.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)  * @u.init_rxq.flags: Unused.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)  * @u.init_rxq.addr: Array of length %u.init_rxq.buf_count containing DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)  *	address of each page backing the receive queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)  * @u.init_txq.index: Index of transmit queue to create.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)  * @u.init_txq.buf_count: Number of 4k buffers backing transmit queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)  * @u.init_txq.evq: Instance of event queue to target transmit completion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  *	events at.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  * @u.init_txq.label: Label used in transmit completion events.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  * @u.init_txq.flags: Checksum offload flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * @u.init_txq.addr: Array of length %u.init_txq.buf_count containing DMA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  *	address of each page backing the transmit queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * @u.mac_filter.rxq: Insert MAC filter at VF local address/VLAN targeting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  *	all traffic at this receive queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)  * @u.mac_filter.flags: MAC filter flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)  * @u.set_status_page.dma_addr: Base address for the &struct vfdi_status.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)  *	This address must be page-aligned and the PF may write up to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)  *	whole page (allowing for extension of the structure).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)  * @u.set_status_page.peer_page_count: Number of additional pages the VF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)  *	has provided into which peer addresses may be DMAd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)  * @u.set_status_page.peer_page_addr: Array of DMA addresses of pages.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)  *	If the number of peers exceeds 256, then the VF must provide
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)  *	additional pages in this array. The PF will then DMA up to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  *	512 vfdi_endpoint structures into each page.  These addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  *	must be page-aligned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) struct vfdi_req {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	u32 op;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	u32 reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	s32 rc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	u32 reserved2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			u32 index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 			u32 buf_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 			u64 addr[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 		} init_evq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 			u32 index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 			u32 buf_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 			u32 evq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 			u32 label;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 			u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) #define VFDI_RXQ_FLAG_SCATTER_EN 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 			u32 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 			u64 addr[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		} init_rxq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 			u32 index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 			u32 buf_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 			u32 evq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 			u32 label;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #define VFDI_TXQ_FLAG_IP_CSUM_DIS 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #define VFDI_TXQ_FLAG_TCPUDP_CSUM_DIS 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 			u32 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 			u64 addr[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 		} init_txq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 			u32 rxq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 			u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) #define VFDI_MAC_FILTER_FLAG_RSS 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) #define VFDI_MAC_FILTER_FLAG_SCATTER 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		} mac_filter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 			u64 dma_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 			u64 peer_page_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 			u64 peer_page_addr[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		} set_status_page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	} u;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)  * struct vfdi_status - Status provided by PF driver to VF driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)  * @generation_start: A generation count DMA'd to VF *before* the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)  *	rest of the structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)  * @generation_end: A generation count DMA'd to VF *after* the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)  *	rest of the structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)  * @version: Version of this structure; currently set to 1.  Later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)  *	versions must either be layout-compatible or only be sent to VFs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)  *	that specifically request them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)  * @length: Total length of this structure including embedded tables
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)  * @vi_scale: log2 the number of VIs available on this VF. This quantity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)  *	is used by the hardware for register decoding.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)  * @max_tx_channels: The maximum number of transmit queues the VF can use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)  * @rss_rxq_count: The number of receive queues present in the shared RSS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)  *	indirection table.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)  * @peer_count: Total number of peers in the complete peer list. If larger
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)  *	than ARRAY_SIZE(%peers), then the VF must provide sufficient
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)  *	additional pages each of which is filled with vfdi_endpoint structures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)  * @local: The MAC address and outer VLAN tag of *this* VF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)  * @peers: Table of peer addresses.  The @tci fields in these structures
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)  *	are currently unused and must be ignored.  Additional peers are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)  *	written into any additional pages provided by the VF.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)  * @timer_quantum_ns: Timer quantum (nominal period between timer ticks)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)  *	for interrupt moderation timers, in nanoseconds. This member is only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)  *	present if @length is sufficiently large.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) struct vfdi_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	u32 generation_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	u32 generation_end;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	u32 version;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	u32 length;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	u8 vi_scale;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	u8 max_tx_channels;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	u8 rss_rxq_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	u8 reserved1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 	u16 peer_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 	u16 reserved2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 	struct vfdi_endpoint local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 	struct vfdi_endpoint peers[256];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 	/* Members below here extend version 1 of this structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 	u32 timer_quantum_ns;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #endif