drivers/net/ethernet/cavium/liquidio/octeon_console.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/cavium/liquidio/octeon_console.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/cavium/liquidio/octeon_console.c- Extension
.c- Size
- 25509 bytes
- Lines
- 920
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/moduleparam.hlinux/pci.hlinux/netdevice.hlinux/crc32.hliquidio_common.hocteon_droq.hocteon_iq.hresponse_manager.hocteon_device.hliquidio_image.hocteon_mem_ops.h
Detected Declarations
struct cvmx_bootmem_descstruct octeon_pci_consolestruct octeon_pci_console_descfunction __cvmx_bootmem_desc_getfunction memcpyfunction __cvmx_bootmem_check_versionfunction cvmx_bootmem_phy_named_block_findfunction octeon_named_block_findfunction octeon_remote_lockfunction octeon_wait_for_bootloaderfunction octeon_console_handle_resultfunction output_console_linefunction check_consolefunction octeon_init_consolesfunction octeon_get_uboot_versionfunction octeon_add_consolefunction octeon_remove_consolesfunction octeon_console_free_bytesfunction octeon_console_avail_bytesfunction octeon_console_readfunction octeon_download_firmware
Annotated Snippet
struct cvmx_bootmem_desc {
/** spinlock to control access to list */
u32 lock;
/** flags for indicating various conditions */
u32 flags;
u64 head_addr;
/** incremented changed when incompatible changes made */
u32 major_version;
/** incremented changed when compatible changes made,
* reset to zero when major incremented
*/
u32 minor_version;
u64 app_data_addr;
u64 app_data_size;
/** number of elements in named blocks array */
u32 nb_num_blocks;
/** length of name array in bootmem blocks */
u32 named_block_name_len;
/** address of named memory block descriptors */
u64 named_block_array_addr;
};
/* Structure that defines a single console.
*
* Note: when read_index == write_index, the buffer is empty.
* The actual usable size of each console is console_buf_size -1;
*/
struct octeon_pci_console {
u64 input_base_addr;
u32 input_read_index;
u32 input_write_index;
u64 output_base_addr;
u32 output_read_index;
u32 output_write_index;
u32 lock;
u32 buf_size;
};
/* This is the main container structure that contains all the information
* about all PCI consoles. The address of this structure is passed to various
* routines that operation on PCI consoles.
*/
struct octeon_pci_console_desc {
u32 major_version;
u32 minor_version;
u32 lock;
u32 flags;
u32 num_consoles;
u32 pad;
/* must be 64 bit aligned here... */
/* Array of addresses of octeon_pci_console structures */
u64 console_addr_array[];
/* Implicit storage for console_addr_array */
};
/*
* This function is the implementation of the get macros defined
* for individual structure members. The argument are generated
* by the macros inorder to read only the needed memory.
*
* @param oct Pointer to current octeon device
* @param base 64bit physical address of the complete structure
* @param offset Offset from the beginning of the structure to the member being
* accessed.
* @param size Size of the structure member.
*
* @return Value of the structure member promoted into a u64.
*/
static inline u64 __cvmx_bootmem_desc_get(struct octeon_device *oct,
u64 base,
u32 offset,
u32 size)
{
base = (1ull << 63) | (base + offset);
switch (size) {
case 4:
return octeon_read_device_mem32(oct, base);
case 8:
return octeon_read_device_mem64(oct, base);
default:
return 0;
}
Annotation
- Immediate include surface: `linux/moduleparam.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/crc32.h`, `liquidio_common.h`, `octeon_droq.h`, `octeon_iq.h`, `response_manager.h`.
- Detected declarations: `struct cvmx_bootmem_desc`, `struct octeon_pci_console`, `struct octeon_pci_console_desc`, `function __cvmx_bootmem_desc_get`, `function memcpy`, `function __cvmx_bootmem_check_version`, `function cvmx_bootmem_phy_named_block_find`, `function octeon_named_block_find`, `function octeon_remote_lock`, `function octeon_wait_for_bootloader`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.