drivers/net/ethernet/sun/sunqe.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sun/sunqe.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sun/sunqe.h- Extension
.h- Size
- 19109 bytes
- Lines
- 352
- 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
- No C-style include directives detected by the generator.
Detected Declarations
struct qe_rxdstruct qe_txdstruct qe_init_blockstruct sunqestruct sunqecstruct sunqe_buffersstruct sunqe
Annotated Snippet
struct qe_rxd {
u32 rx_flags;
u32 rx_addr;
};
#define RXD_OWN 0x80000000 /* Ownership. */
#define RXD_UPDATE 0x10000000 /* Being Updated? */
#define RXD_LENGTH 0x000007ff /* Packet Length. */
struct qe_txd {
u32 tx_flags;
u32 tx_addr;
};
#define TXD_OWN 0x80000000 /* Ownership. */
#define TXD_SOP 0x40000000 /* Start Of Packet */
#define TXD_EOP 0x20000000 /* End Of Packet */
#define TXD_UPDATE 0x10000000 /* Being Updated? */
#define TXD_LENGTH 0x000007ff /* Packet Length. */
#define TX_RING_MAXSIZE 256
#define RX_RING_MAXSIZE 256
#define TX_RING_SIZE 16
#define RX_RING_SIZE 16
#define NEXT_RX(num) (((num) + 1) & (RX_RING_MAXSIZE - 1))
#define NEXT_TX(num) (((num) + 1) & (TX_RING_MAXSIZE - 1))
#define PREV_RX(num) (((num) - 1) & (RX_RING_MAXSIZE - 1))
#define PREV_TX(num) (((num) - 1) & (TX_RING_MAXSIZE - 1))
#define TX_BUFFS_AVAIL(qp) \
(((qp)->tx_old <= (qp)->tx_new) ? \
(qp)->tx_old + (TX_RING_SIZE - 1) - (qp)->tx_new : \
(qp)->tx_old - (qp)->tx_new - 1)
struct qe_init_block {
struct qe_rxd qe_rxd[RX_RING_MAXSIZE];
struct qe_txd qe_txd[TX_RING_MAXSIZE];
};
#define qib_offset(mem, elem) \
((__u32)((unsigned long)(&(((struct qe_init_block *)0)->mem[elem]))))
struct sunqe;
struct sunqec {
void __iomem *gregs; /* QEC Global Registers */
struct sunqe *qes[4]; /* Each child MACE */
unsigned int qec_bursts; /* Support burst sizes */
struct platform_device *op; /* QEC's OF device */
struct sunqec *next_module; /* List of all QECs in system */
};
#define PKT_BUF_SZ 1664
#define RXD_PKT_SZ 1664
struct sunqe_buffers {
u8 tx_buf[TX_RING_SIZE][PKT_BUF_SZ];
u8 __pad[2];
u8 rx_buf[RX_RING_SIZE][PKT_BUF_SZ];
};
#define qebuf_offset(mem, elem) \
((__u32)((unsigned long)(&(((struct sunqe_buffers *)0)->mem[elem][0]))))
struct sunqe {
void __iomem *qcregs; /* QEC per-channel Registers */
void __iomem *mregs; /* Per-channel MACE Registers */
struct qe_init_block *qe_block; /* RX and TX descriptors */
dma_addr_t qblock_dvma; /* RX and TX descriptors */
spinlock_t lock; /* Protects txfull state */
int rx_new, rx_old; /* RX ring extents */
int tx_new, tx_old; /* TX ring extents */
struct sunqe_buffers *buffers; /* CPU visible address. */
dma_addr_t buffers_dvma; /* DVMA visible address. */
struct sunqec *parent;
u8 mconfig; /* Base MACE mconfig value */
struct platform_device *op; /* QE's OF device struct */
struct net_device *dev; /* QE's netdevice struct */
int channel; /* Who am I? */
};
#endif /* !(_SUNQE_H) */
Annotation
- Detected declarations: `struct qe_rxd`, `struct qe_txd`, `struct qe_init_block`, `struct sunqe`, `struct sunqec`, `struct sunqe_buffers`, `struct sunqe`.
- 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.