drivers/net/ethernet/via/via-velocity.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/via/via-velocity.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/via/via-velocity.h- Extension
.h- Size
- 40622 bytes
- Lines
- 1529
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct rdesc0struct rdesc1struct rx_descstruct tdesc0struct tdesc1struct td_bufstruct tx_descstruct velocity_rd_infostruct velocity_td_infostruct mac_regsstruct velocity_info_tblstruct arp_packetstruct _magic_packetstruct velocity_contextstruct velocity_optstruct velocity_infostruct tx_infostruct rx_infoenum velocity_ownerenum hw_mibenum chip_typeenum speed_optenum velocity_init_typeenum velocity_flow_cntl_typefunction mac_eeprom_reloadfunction velocity_get_ipfunction overflowfunction init_flow_control_register
Annotated Snippet
struct rdesc0 {
__le16 RSR; /* Receive status */
__le16 len; /* bits 0--13; bit 15 - owner */
};
struct rdesc1 {
__le16 PQTAG;
u8 CSM;
u8 IPKT;
};
enum {
RX_INTEN = cpu_to_le16(0x8000)
};
struct rx_desc {
struct rdesc0 rdesc0;
struct rdesc1 rdesc1;
__le32 pa_low; /* Low 32 bit PCI address */
__le16 pa_high; /* Next 16 bit PCI address (48 total) */
__le16 size; /* bits 0--14 - frame size, bit 15 - enable int. */
} __packed;
/*
* Transmit descriptor
*/
struct tdesc0 {
__le16 TSR; /* Transmit status register */
__le16 len; /* bits 0--13 - size of frame, bit 15 - owner */
};
struct tdesc1 {
__le16 vlan;
u8 TCR;
u8 cmd; /* bits 0--1 - TCPLS, bits 4--7 - CMDZ */
} __packed;
enum {
TD_QUEUE = cpu_to_le16(0x8000)
};
struct td_buf {
__le32 pa_low;
__le16 pa_high;
__le16 size; /* bits 0--13 - size, bit 15 - queue */
} __packed;
struct tx_desc {
struct tdesc0 tdesc0;
struct tdesc1 tdesc1;
struct td_buf td_buf[7];
};
struct velocity_rd_info {
struct sk_buff *skb;
dma_addr_t skb_dma;
};
/*
* Used to track transmit side buffers.
*/
struct velocity_td_info {
struct sk_buff *skb;
int nskb_dma;
dma_addr_t skb_dma[7];
};
enum velocity_owner {
OWNED_BY_HOST = 0,
OWNED_BY_NIC = cpu_to_le16(0x8000)
};
/*
* MAC registers and macros.
*/
#define MCAM_SIZE 64
#define VCAM_SIZE 64
#define TX_QUEUE_NO 4
#define MAX_HW_MIB_COUNTER 32
#define VELOCITY_MIN_MTU (64)
#define VELOCITY_MAX_MTU (9000)
/*
* Registers in the MAC
Annotation
- Detected declarations: `struct rdesc0`, `struct rdesc1`, `struct rx_desc`, `struct tdesc0`, `struct tdesc1`, `struct td_buf`, `struct tx_desc`, `struct velocity_rd_info`, `struct velocity_td_info`, `struct mac_regs`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.