drivers/net/ethernet/smsc/smsc911x.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/smsc/smsc911x.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/smsc/smsc911x.h- Extension
.h- Size
- 12333 bytes
- Lines
- 413
- 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.
Dependency Surface
asm/smsc911x.hlinux/smscphy.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#ifndef __SMSC911X_H__
#define __SMSC911X_H__
/*Chip ID*/
#define LAN9115 0x01150000
#define LAN9116 0x01160000
#define LAN9117 0x01170000
#define LAN9118 0x01180000
#define LAN9215 0x115A0000
#define LAN9216 0x116A0000
#define LAN9217 0x117A0000
#define LAN9218 0x118A0000
#define LAN9210 0x92100000
#define LAN9211 0x92110000
#define LAN9220 0x92200000
#define LAN9221 0x92210000
#define LAN9250 0x92500000
#define LAN89218 0x218A0000
#define TX_FIFO_LOW_THRESHOLD ((u32)1600)
#define SMSC911X_EEPROM_SIZE ((u32)128)
#define USE_DEBUG 0
/* This is the maximum number of packets to be received every
* NAPI poll */
#define SMSC_NAPI_WEIGHT 16
/* implements a PHY loopback test at initialisation time, to ensure a packet
* can be successfully looped back */
#define USE_PHY_WORK_AROUND
#if USE_DEBUG >= 1
#define SMSC_WARN(pdata, nlevel, fmt, args...) \
netif_warn(pdata, nlevel, (pdata)->dev, \
"%s: " fmt "\n", __func__, ##args)
#else
#define SMSC_WARN(pdata, nlevel, fmt, args...) \
no_printk(fmt "\n", ##args)
#endif
#if USE_DEBUG >= 2
#define SMSC_TRACE(pdata, nlevel, fmt, args...) \
netif_info(pdata, nlevel, pdata->dev, fmt "\n", ##args)
#else
#define SMSC_TRACE(pdata, nlevel, fmt, args...) \
no_printk(fmt "\n", ##args)
#endif
#ifdef CONFIG_DEBUG_SPINLOCK
#define SMSC_ASSERT_MAC_LOCK(pdata) \
lockdep_assert_held(&pdata->mac_lock)
#else
#define SMSC_ASSERT_MAC_LOCK(pdata) do {} while (0)
#endif /* CONFIG_DEBUG_SPINLOCK */
/* SMSC911x registers and bitfields */
#define RX_DATA_FIFO 0x00
#define TX_DATA_FIFO 0x20
#define TX_CMD_A_ON_COMP_ 0x80000000
#define TX_CMD_A_BUF_END_ALGN_ 0x03000000
#define TX_CMD_A_4_BYTE_ALGN_ 0x00000000
#define TX_CMD_A_16_BYTE_ALGN_ 0x01000000
#define TX_CMD_A_32_BYTE_ALGN_ 0x02000000
#define TX_CMD_A_DATA_OFFSET_ 0x001F0000
#define TX_CMD_A_FIRST_SEG_ 0x00002000
#define TX_CMD_A_LAST_SEG_ 0x00001000
#define TX_CMD_A_BUF_SIZE_ 0x000007FF
#define TX_CMD_B_PKT_TAG_ 0xFFFF0000
#define TX_CMD_B_ADD_CRC_DISABLE_ 0x00002000
#define TX_CMD_B_DISABLE_PADDING_ 0x00001000
#define TX_CMD_B_PKT_BYTE_LENGTH_ 0x000007FF
#define RX_STATUS_FIFO 0x40
#define RX_STS_ES_ 0x00008000
#define RX_STS_LENGTH_ERR_ 0x00001000
#define RX_STS_MCAST_ 0x00000400
#define RX_STS_FRAME_TYPE_ 0x00000020
#define RX_STS_CRC_ERR_ 0x00000002
#define RX_STATUS_FIFO_PEEK 0x44
#define TX_STATUS_FIFO 0x48
#define TX_STS_ES_ 0x00008000
#define TX_STS_LOST_CARRIER_ 0x00000800
#define TX_STS_NO_CARRIER_ 0x00000400
#define TX_STS_LATE_COL_ 0x00000200
#define TX_STS_EXCESS_COL_ 0x00000100
#define TX_STATUS_FIFO_PEEK 0x4C
Annotation
- Immediate include surface: `asm/smsc911x.h`, `linux/smscphy.h`.
- 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.