drivers/net/ethernet/microchip/lan743x_main.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/lan743x_main.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/lan743x_main.h- Extension
.h- Size
- 42833 bytes
- Lines
- 1215
- 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
linux/phy.hlinux/phylink.hlan743x_ptp.h
Detected Declarations
struct lan743x_adapterstruct lan743x_csrstruct lan743x_vectorstruct lan743x_intrstruct lan743x_phystruct lan743x_tx_descriptorstruct lan743x_tx_buffer_infostruct lan743x_txstruct lan743x_rx_descriptorstruct lan743x_rx_buffer_infostruct lan743x_rxstruct lan743x_adapterstruct lan743x_tx_descriptorstruct lan743x_tx_buffer_infostruct lan743x_rx_descriptorstruct lan743x_rx_buffer_infoenum lan743x_sgmii_lsd
Annotated Snippet
struct lan743x_csr {
u32 flags;
u8 __iomem *csr_address;
u32 id_rev;
u32 fpga_rev;
};
/* INTERRUPTS */
typedef void(*lan743x_vector_handler)(void *context, u32 int_sts, u32 flags);
#define LAN743X_VECTOR_FLAG_IRQ_SHARED BIT(0)
#define LAN743X_VECTOR_FLAG_SOURCE_STATUS_READ BIT(1)
#define LAN743X_VECTOR_FLAG_SOURCE_STATUS_R2C BIT(2)
#define LAN743X_VECTOR_FLAG_SOURCE_STATUS_W2C BIT(3)
#define LAN743X_VECTOR_FLAG_SOURCE_ENABLE_CHECK BIT(4)
#define LAN743X_VECTOR_FLAG_SOURCE_ENABLE_CLEAR BIT(5)
#define LAN743X_VECTOR_FLAG_SOURCE_ENABLE_R2C BIT(6)
#define LAN743X_VECTOR_FLAG_MASTER_ENABLE_CLEAR BIT(7)
#define LAN743X_VECTOR_FLAG_MASTER_ENABLE_SET BIT(8)
#define LAN743X_VECTOR_FLAG_VECTOR_ENABLE_ISR_CLEAR BIT(9)
#define LAN743X_VECTOR_FLAG_VECTOR_ENABLE_ISR_SET BIT(10)
#define LAN743X_VECTOR_FLAG_VECTOR_ENABLE_AUTO_CLEAR BIT(11)
#define LAN743X_VECTOR_FLAG_VECTOR_ENABLE_AUTO_SET BIT(12)
#define LAN743X_VECTOR_FLAG_SOURCE_ENABLE_AUTO_CLEAR BIT(13)
#define LAN743X_VECTOR_FLAG_SOURCE_ENABLE_AUTO_SET BIT(14)
#define LAN743X_VECTOR_FLAG_SOURCE_STATUS_AUTO_CLEAR BIT(15)
struct lan743x_vector {
int irq;
u32 flags;
struct lan743x_adapter *adapter;
int vector_index;
u32 int_mask;
lan743x_vector_handler handler;
void *context;
};
#define LAN743X_MAX_VECTOR_COUNT (8)
#define PCI11X1X_MAX_VECTOR_COUNT (16)
struct lan743x_intr {
int flags;
unsigned int irq;
struct lan743x_vector vector_list[PCI11X1X_MAX_VECTOR_COUNT];
int number_of_vectors;
bool using_vectors;
bool software_isr_flag;
wait_queue_head_t software_isr_wq;
};
#define LAN743X_MAX_FRAME_SIZE (9 * 1024)
/* PHY */
struct lan743x_phy {
bool fc_autoneg;
u8 fc_request_control;
};
/* TX */
struct lan743x_tx_descriptor;
struct lan743x_tx_buffer_info;
#define GPIO_QUEUE_STARTED (0)
#define GPIO_TX_FUNCTION (1)
#define GPIO_TX_COMPLETION (2)
#define GPIO_TX_FRAGMENT (3)
#define TX_FRAME_FLAG_IN_PROGRESS BIT(0)
#define TX_TS_FLAG_TIMESTAMPING_ENABLED BIT(0)
#define TX_TS_FLAG_ONE_STEP_SYNC BIT(1)
struct lan743x_tx {
struct lan743x_adapter *adapter;
u32 ts_flags;
u32 vector_flags;
int channel_number;
int ring_size;
size_t ring_allocation_size;
struct lan743x_tx_descriptor *ring_cpu_ptr;
dma_addr_t ring_dma_ptr;
/* ring_lock: used to prevent concurrent access to tx ring */
spinlock_t ring_lock;
u32 frame_flags;
u32 frame_first;
u32 frame_data0;
Annotation
- Immediate include surface: `linux/phy.h`, `linux/phylink.h`, `lan743x_ptp.h`.
- Detected declarations: `struct lan743x_adapter`, `struct lan743x_csr`, `struct lan743x_vector`, `struct lan743x_intr`, `struct lan743x_phy`, `struct lan743x_tx_descriptor`, `struct lan743x_tx_buffer_info`, `struct lan743x_tx`, `struct lan743x_rx_descriptor`, `struct lan743x_rx_buffer_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.