drivers/net/ethernet/freescale/fec.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/fec.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/fec.h- Extension
.h- Size
- 26553 bytes
- Lines
- 706
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dt-bindings/firmware/imx/rsrc.hlinux/bpf.hlinux/clocksource.hlinux/firmware/imx/sci.hlinux/net_tstamp.hlinux/pm_qos.hlinux/ptp_clock_kernel.hlinux/timecounter.hnet/xdp.h
Detected Declarations
struct bufdescstruct bufdescstruct bufdesc_exstruct bufdesc_propstruct fec_tx_bufferstruct fec_enet_priv_tx_qstruct fec_enet_priv_rx_qstruct fec_stop_mode_gprstruct fec_enet_privateenum fec_txbuf_type
Annotated Snippet
struct bufdesc {
__fec16 cbd_datlen; /* Data length */
__fec16 cbd_sc; /* Control and status info */
__fec32 cbd_bufaddr; /* Buffer address */
};
#else
#define fec32_to_cpu be32_to_cpu
#define fec16_to_cpu be16_to_cpu
#define cpu_to_fec32 cpu_to_be32
#define cpu_to_fec16 cpu_to_be16
#define __fec32 __be32
#define __fec16 __be16
struct bufdesc {
__fec16 cbd_sc; /* Control and status info */
__fec16 cbd_datlen; /* Data length */
__fec32 cbd_bufaddr; /* Buffer address */
};
#endif
struct bufdesc_ex {
struct bufdesc desc;
__fec32 cbd_esc;
__fec32 cbd_prot;
__fec32 cbd_bdu;
__fec32 ts;
__fec16 res0[4];
};
/* Buffer descriptor control/status used by Ethernet receive.
*/
#define BD_ENET_RX_EMPTY ((ushort)0x8000)
#define BD_ENET_RX_WRAP ((ushort)0x2000)
#define BD_ENET_RX_INTR ((ushort)0x1000)
#define BD_ENET_RX_LAST ((ushort)0x0800)
#define BD_ENET_RX_FIRST ((ushort)0x0400)
#define BD_ENET_RX_MISS ((ushort)0x0100)
#define BD_ENET_RX_LG ((ushort)0x0020)
#define BD_ENET_RX_NO ((ushort)0x0010)
#define BD_ENET_RX_SH ((ushort)0x0008)
#define BD_ENET_RX_CR ((ushort)0x0004)
#define BD_ENET_RX_OV ((ushort)0x0002)
#define BD_ENET_RX_CL ((ushort)0x0001)
#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
/* Enhanced buffer descriptor control/status used by Ethernet receive */
#define BD_ENET_RX_VLAN 0x00000004
/* Buffer descriptor control/status used by Ethernet transmit.
*/
#define BD_ENET_TX_READY ((ushort)0x8000)
#define BD_ENET_TX_PAD ((ushort)0x4000)
#define BD_ENET_TX_WRAP ((ushort)0x2000)
#define BD_ENET_TX_INTR ((ushort)0x1000)
#define BD_ENET_TX_LAST ((ushort)0x0800)
#define BD_ENET_TX_TC ((ushort)0x0400)
#define BD_ENET_TX_DEF ((ushort)0x0200)
#define BD_ENET_TX_HB ((ushort)0x0100)
#define BD_ENET_TX_LC ((ushort)0x0080)
#define BD_ENET_TX_RL ((ushort)0x0040)
#define BD_ENET_TX_RCMASK ((ushort)0x003c)
#define BD_ENET_TX_UN ((ushort)0x0002)
#define BD_ENET_TX_CSL ((ushort)0x0001)
#define BD_ENET_TX_STATS ((ushort)0x0fff) /* All status bits */
/* enhanced buffer descriptor control/status used by Ethernet transmit */
#define BD_ENET_TX_INT 0x40000000
#define BD_ENET_TX_TS 0x20000000
#define BD_ENET_TX_PINS 0x10000000
#define BD_ENET_TX_IINS 0x08000000
/* This device has up to three irqs on some platforms */
#define FEC_IRQ_NUM 3
/* Maximum number of queues supported
* ENET with AVB IP can support up to 3 independent tx queues and rx queues.
* User can point the queue number that is less than or equal to 3.
*/
#define FEC_ENET_MAX_TX_QS 3
#define FEC_ENET_MAX_RX_QS 3
#define FEC_R_DES_START(X) (((X) == 1) ? FEC_R_DES_START_1 : \
(((X) == 2) ? \
FEC_R_DES_START_2 : FEC_R_DES_START_0))
#define FEC_X_DES_START(X) (((X) == 1) ? FEC_X_DES_START_1 : \
(((X) == 2) ? \
FEC_X_DES_START_2 : FEC_X_DES_START_0))
#define FEC_R_BUFF_SIZE(X) (((X) == 1) ? FEC_R_BUFF_SIZE_1 : \
(((X) == 2) ? \
Annotation
- Immediate include surface: `dt-bindings/firmware/imx/rsrc.h`, `linux/bpf.h`, `linux/clocksource.h`, `linux/firmware/imx/sci.h`, `linux/net_tstamp.h`, `linux/pm_qos.h`, `linux/ptp_clock_kernel.h`, `linux/timecounter.h`.
- Detected declarations: `struct bufdesc`, `struct bufdesc`, `struct bufdesc_ex`, `struct bufdesc_prop`, `struct fec_tx_buffer`, `struct fec_enet_priv_tx_q`, `struct fec_enet_priv_rx_q`, `struct fec_stop_mode_gpr`, `struct fec_enet_private`, `enum fec_txbuf_type`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.