drivers/net/ethernet/tehuti/tehuti.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/tehuti/tehuti.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/tehuti/tehuti.h- Extension
.h- Size
- 15142 bytes
- Lines
- 561
- 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.
- 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/module.hlinux/kernel.hlinux/netdevice.hlinux/etherdevice.hlinux/pci.hlinux/delay.hlinux/ethtool.hlinux/mii.hlinux/crc32.hlinux/uaccess.hlinux/in.hlinux/ip.hlinux/tcp.hlinux/sched.hlinux/tty.hlinux/if_vlan.hlinux/interrupt.hlinux/vmalloc.hlinux/firmware.hasm/byteorder.hlinux/dma-mapping.hlinux/slab.h
Detected Declarations
struct pci_nicstruct fifostruct txf_fifostruct txd_fifostruct rxf_fifostruct rxd_fifostruct rx_mapstruct rxdbstruct tx_mapstruct txdbstruct bdx_statsstruct bdx_privstruct rxf_descstruct rxd_descstruct pblstruct txd_desc
Annotated Snippet
struct pci_nic {
int port_num;
void __iomem *regs;
int irq_type;
struct bdx_priv *priv[LUXOR_MAX_PORT];
};
enum { IRQ_INTX, IRQ_MSI, IRQ_MSIX };
#define PCK_TH_MULT 128
#define INT_COAL_MULT 2
#define BITS_MASK(nbits) ((1<<nbits)-1)
#define GET_BITS_SHIFT(x, nbits, nshift) (((x)>>nshift)&BITS_MASK(nbits))
#define BITS_SHIFT_MASK(nbits, nshift) (BITS_MASK(nbits)<<nshift)
#define BITS_SHIFT_VAL(x, nbits, nshift) (((x)&BITS_MASK(nbits))<<nshift)
#define BITS_SHIFT_CLEAR(x, nbits, nshift) \
((x)&(~BITS_SHIFT_MASK(nbits, nshift)))
#define GET_INT_COAL(x) GET_BITS_SHIFT(x, 15, 0)
#define GET_INT_COAL_RC(x) GET_BITS_SHIFT(x, 1, 15)
#define GET_RXF_TH(x) GET_BITS_SHIFT(x, 4, 16)
#define GET_PCK_TH(x) GET_BITS_SHIFT(x, 4, 20)
#define INT_REG_VAL(coal, coal_rc, rxf_th, pck_th) \
((coal)|((coal_rc)<<15)|((rxf_th)<<16)|((pck_th)<<20))
struct fifo {
dma_addr_t da; /* physical address of fifo (used by HW) */
char *va; /* virtual address of fifo (used by SW) */
u32 rptr, wptr; /* cached values of RPTR and WPTR registers,
they're 32 bits on both 32 and 64 archs */
u16 reg_CFG0, reg_CFG1;
u16 reg_RPTR, reg_WPTR;
u16 memsz; /* memory size allocated for fifo */
u16 size_mask;
u16 pktsz; /* skb packet size to allocate */
u16 rcvno; /* number of buffers that come from this RXF */
};
struct txf_fifo {
struct fifo m; /* minimal set of variables used by all fifos */
};
struct txd_fifo {
struct fifo m; /* minimal set of variables used by all fifos */
};
struct rxf_fifo {
struct fifo m; /* minimal set of variables used by all fifos */
};
struct rxd_fifo {
struct fifo m; /* minimal set of variables used by all fifos */
};
struct rx_map {
u64 dma;
struct sk_buff *skb;
};
struct rxdb {
int *stack;
struct rx_map *elems;
int nelem;
int top;
};
union bdx_dma_addr {
dma_addr_t dma;
struct sk_buff *skb;
};
/* Entry in the db.
* if len == 0 addr is dma
* if len != 0 addr is skb */
struct tx_map {
union bdx_dma_addr addr;
int len;
};
/* tx database - implemented as circular fifo buffer*/
struct txdb {
struct tx_map *start; /* points to the first element */
struct tx_map *end; /* points just AFTER the last element */
struct tx_map *rptr; /* points to the next element to read */
struct tx_map *wptr; /* points to the next element to write */
int size; /* number of elements in the db */
};
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/pci.h`, `linux/delay.h`, `linux/ethtool.h`, `linux/mii.h`.
- Detected declarations: `struct pci_nic`, `struct fifo`, `struct txf_fifo`, `struct txd_fifo`, `struct rxf_fifo`, `struct rxd_fifo`, `struct rx_map`, `struct rxdb`, `struct tx_map`, `struct txdb`.
- 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.