drivers/net/ethernet/cavium/liquidio/liquidio_common.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cavium/liquidio/liquidio_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/cavium/liquidio/liquidio_common.h- Extension
.h- Size
- 23610 bytes
- Lines
- 1040
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
octeon_config.h
Detected Declarations
struct lio_versionstruct octeon_core_setupstruct octeon_sg_entrystruct octeon_instr_ih3struct octeon_instr_pki_ih3struct octeon_instr_ih2struct octeon_instr_irhstruct octeon_instr_rdpstruct oct_link_infostruct liquidio_if_cfg_infostruct nic_rx_statsstruct nic_tx_statsstruct oct_link_statsstruct oct_mdio_cmdstruct oct_intrmod_cfgstruct lio_trusted_vfstruct lio_timestruct lio_vf_rep_statsstruct lio_vf_rep_reqstruct lio_vf_rep_namestruct lio_vf_rep_mtustruct lio_vf_rep_statestruct lio_vf_rep_respenum octeon_tag_typeenum octnet_ifflagsenum lio_phy_typeenum lio_vf_rep_req_typefunction incr_indexfunction add_sg_sizefunction opcode_slow_path
Annotated Snippet
struct lio_version {
u16 major;
u16 minor;
u16 micro;
u16 reserved;
};
#define CONTROL_IQ 0
/** Tag types used by Octeon cores in its work. */
enum octeon_tag_type {
ORDERED_TAG = 0,
ATOMIC_TAG = 1,
NULL_TAG = 2,
NULL_NULL_TAG = 3
};
/* pre-defined host->NIC tag values */
#define LIO_CONTROL (0x11111110)
#define LIO_DATA(i) (0x11111111 + (i))
/* Opcodes used by host driver/apps to perform operations on the core.
* These are used to identify the major subsystem that the operation
* is for.
*/
#define OPCODE_CORE 0 /* used for generic core operations */
#define OPCODE_NIC 1 /* used for NIC operations */
/* Subcodes are used by host driver/apps to identify the sub-operation
* for the core. They only need to by unique for a given subsystem.
*/
#define OPCODE_SUBCODE(op, sub) ((((op) & 0x0f) << 8) | ((sub) & 0x7f))
/** OPCODE_CORE subcodes. For future use. */
/** OPCODE_NIC subcodes */
/* This subcode is sent by core PCI driver to indicate cores are ready. */
#define OPCODE_NIC_CORE_DRV_ACTIVE 0x01
#define OPCODE_NIC_NW_DATA 0x02 /* network packet data */
#define OPCODE_NIC_CMD 0x03
#define OPCODE_NIC_INFO 0x04
#define OPCODE_NIC_PORT_STATS 0x05
#define OPCODE_NIC_MDIO45 0x06
#define OPCODE_NIC_TIMESTAMP 0x07
#define OPCODE_NIC_INTRMOD_CFG 0x08
#define OPCODE_NIC_IF_CFG 0x09
#define OPCODE_NIC_VF_DRV_NOTICE 0x0A
#define OPCODE_NIC_INTRMOD_PARAMS 0x0B
#define OPCODE_NIC_QCOUNT_UPDATE 0x12
#define OPCODE_NIC_SET_TRUSTED_VF 0x13
#define OPCODE_NIC_SYNC_OCTEON_TIME 0x14
#define VF_DRV_LOADED 1
#define VF_DRV_REMOVED -1
#define VF_DRV_MACADDR_CHANGED 2
#define OPCODE_NIC_VF_REP_PKT 0x15
#define OPCODE_NIC_VF_REP_CMD 0x16
#define OPCODE_NIC_UBOOT_CTL 0x17
#define CORE_DRV_TEST_SCATTER_OP 0xFFF5
/* Application codes advertised by the core driver initialization packet. */
#define CVM_DRV_APP_START 0x0
#define CVM_DRV_NO_APP 0
#define CVM_DRV_APP_COUNT 0x2
#define CVM_DRV_BASE_APP (CVM_DRV_APP_START + 0x0)
#define CVM_DRV_NIC_APP (CVM_DRV_APP_START + 0x1)
#define CVM_DRV_INVALID_APP (CVM_DRV_APP_START + 0x2)
#define CVM_DRV_APP_END (CVM_DRV_INVALID_APP - 1)
#define BYTES_PER_DHLEN_UNIT 8
#define MAX_REG_CNT 2000000U
#define INTRNAMSIZ 32
#define IRQ_NAME_OFF(i) ((i) * INTRNAMSIZ)
#define MAX_IOQ_INTERRUPTS_PER_PF (64 * 2)
#define MAX_IOQ_INTERRUPTS_PER_VF (8 * 2)
#define SCR2_BIT_FW_LOADED 63
/* App specific capabilities from firmware to pf driver */
#define LIQUIDIO_TIME_SYNC_CAP 0x1
#define LIQUIDIO_SWITCHDEV_CAP 0x2
#define LIQUIDIO_SPOOFCHK_CAP 0x4
/* error status return from firmware */
#define OCTEON_REQUEST_NO_PERMISSION 0xc
static inline u32 incr_index(u32 index, u32 count, u32 max)
{
if ((index + count) >= max)
index = index + count - max;
Annotation
- Immediate include surface: `octeon_config.h`.
- Detected declarations: `struct lio_version`, `struct octeon_core_setup`, `struct octeon_sg_entry`, `struct octeon_instr_ih3`, `struct octeon_instr_pki_ih3`, `struct octeon_instr_ih2`, `struct octeon_instr_irh`, `struct octeon_instr_rdp`, `struct oct_link_info`, `struct liquidio_if_cfg_info`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.