drivers/net/ethernet/freescale/gianfar.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/gianfar.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/gianfar.h- Extension
.h- Size
- 43505 bytes
- Lines
- 1370
- 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/kernel.hlinux/sched.hlinux/string.hlinux/errno.hlinux/slab.hlinux/interrupt.hlinux/delay.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/spinlock.hlinux/mm.hlinux/mii.hlinux/phy.hasm/io.hasm/irq.hlinux/uaccess.hlinux/module.hlinux/crc32.hlinux/workqueue.hlinux/ethtool.h
Detected Declarations
struct ethtool_flow_spec_containerstruct ethtool_rx_liststruct txbd8struct txfcbstruct rxbd8struct rxfcbstruct gianfar_skb_cbstruct rmon_mibstruct rmon_overflowstruct gfar_extra_statsstruct gfarstruct tx_q_statsstruct gfar_priv_tx_qstruct rx_q_statsstruct gfar_rx_buffstruct gfar_priv_rx_qstruct gfar_irqinfostruct gfar_priv_grpstruct gfar_privatestruct gfar_filer_entrystruct filer_tableenum gfar_irqinfo_idenum gfar_errataenum gfar_dev_statefunction gfar_has_erratafunction gfar_readfunction gfar_writefunction gfar_write_filerfunction gfar_read_filerfunction gfar_write_isrgfunction for_each_set_bitfunction for_each_set_bitfunction gfar_is_dma_stoppedfunction gfar_is_rx_dma_stoppedfunction gfar_wmbfunction gfar_clear_txbd_statusfunction gfar_rxbd_unusedfunction gfar_rxbd_dma_lastfree
Annotated Snippet
struct ethtool_flow_spec_container {
struct ethtool_rx_flow_spec fs;
struct list_head list;
};
struct ethtool_rx_list {
struct list_head list;
unsigned int count;
};
/* Length for FCB */
#define GMAC_FCB_LEN 8
/* Length for TxPAL */
#define GMAC_TXPAL_LEN 16
/* Default padding amount */
#define DEFAULT_PADDING 2
/* Number of bytes to align the rx bufs to */
#define RXBUF_ALIGNMENT 64
#define DRV_NAME "gfar-enet"
/* MAXIMUM NUMBER OF QUEUES SUPPORTED */
#define MAX_TX_QS 0x8
#define MAX_RX_QS 0x8
/* MAXIMUM NUMBER OF GROUPS SUPPORTED */
#define MAXGROUPS 0x2
/* These need to be powers of 2 for this driver */
#define DEFAULT_TX_RING_SIZE 256
#define DEFAULT_RX_RING_SIZE 256
#define GFAR_RX_BUFF_ALLOC 16
#define GFAR_RX_MAX_RING_SIZE 256
#define GFAR_TX_MAX_RING_SIZE 256
#define FBTHR_SHIFT 24
#define DEFAULT_RX_LFC_THR 16
#define DEFAULT_LFC_PTVVAL 4
#define GFAR_RXB_TRUESIZE 2048
#define GFAR_SKBFRAG_OVR (RXBUF_ALIGNMENT \
+ SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
#define GFAR_RXB_SIZE rounddown(GFAR_RXB_TRUESIZE - GFAR_SKBFRAG_OVR, 64)
#define GFAR_SKBFRAG_SIZE (GFAR_RXB_SIZE + GFAR_SKBFRAG_OVR)
#define TX_RING_MOD_MASK(size) (size-1)
#define RX_RING_MOD_MASK(size) (size-1)
#define GFAR_JUMBO_FRAME_SIZE 9600
#define DEFAULT_FIFO_TX_THR 0x100
#define DEFAULT_FIFO_TX_STARVE 0x40
#define DEFAULT_FIFO_TX_STARVE_OFF 0x80
/* The number of Exact Match registers */
#define GFAR_EM_NUM 15
/* Latency of interface clock in nanoseconds */
/* Interface clock latency , in this case, means the
* time described by a value of 1 in the interrupt
* coalescing registers' time fields. Since those fields
* refer to the time it takes for 64 clocks to pass, the
* latencies are as such:
* GBIT = 125MHz => 8ns/clock => 8*64 ns / tick
* 100 = 25 MHz => 40ns/clock => 40*64 ns / tick
* 10 = 2.5 MHz => 400ns/clock => 400*64 ns / tick
*/
#define GFAR_GBIT_TIME 512
#define GFAR_100_TIME 2560
#define GFAR_10_TIME 25600
#define DEFAULT_TX_COALESCE 1
#define DEFAULT_TXCOUNT 16
#define DEFAULT_TXTIME 21
#define DEFAULT_RXTIME 21
#define DEFAULT_RX_COALESCE 0
#define DEFAULT_RXCOUNT 0
/* TBI register addresses */
#define MII_TBICON 0x11
/* TBICON register bit fields */
#define TBICON_CLK_SELECT 0x0020
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/sched.h`, `linux/string.h`, `linux/errno.h`, `linux/slab.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/netdevice.h`.
- Detected declarations: `struct ethtool_flow_spec_container`, `struct ethtool_rx_list`, `struct txbd8`, `struct txfcb`, `struct rxbd8`, `struct rxfcb`, `struct gianfar_skb_cb`, `struct rmon_mib`, `struct rmon_overflow`, `struct gfar_extra_stats`.
- 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.