drivers/net/ethernet/dlink/dl2k.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/dlink/dl2k.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/dlink/dl2k.h- Extension
.h- Size
- 12235 bytes
- Lines
- 439
- 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
linux/module.hlinux/kernel.hlinux/string.hlinux/timer.hlinux/errno.hlinux/ioport.hlinux/slab.hlinux/interrupt.hlinux/pci.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/crc32.hlinux/ethtool.hlinux/mii.hlinux/bitops.hasm/processor.hasm/io.hlinux/uaccess.hlinux/delay.hlinux/spinlock.hlinux/time.h
Detected Declarations
struct ioctl_datastruct netdev_descstruct netdev_privateenum dl2x_offsetsenum IntStatus_bitsenum ReceiveMode_bitsenum MACCtrl_bitsenum ASICCtrl_LoWord_bitsenum ASICCtrl_HiWord_bitsenum TFC_bitsenum RFS_bitsenum _mii_regenum _pcs_regenum _mii_esrenum _pcs_anarenum _pcs_anlpar
Annotated Snippet
struct ioctl_data {
char signature[10];
int cmd;
int len;
char *data;
};
/* The Rx and Tx buffer descriptors. */
struct netdev_desc {
__le64 next_desc;
__le64 status;
__le64 fraginfo;
};
#define PRIV_ALIGN 15 /* Required alignment mask */
/* Use __attribute__((aligned (L1_CACHE_BYTES))) to maintain alignment
within the structure. */
struct netdev_private {
/* Descriptor rings first for alignment. */
struct netdev_desc *rx_ring;
struct netdev_desc *tx_ring;
struct sk_buff *rx_skbuff[RX_RING_SIZE];
struct sk_buff *tx_skbuff[TX_RING_SIZE];
dma_addr_t tx_ring_dma;
dma_addr_t rx_ring_dma;
struct pci_dev *pdev;
void __iomem *ioaddr;
void __iomem *eeprom_addr;
// To ensure synchronization when stats are updated.
spinlock_t stats_lock;
spinlock_t tx_lock;
spinlock_t rx_lock;
unsigned int rx_buf_sz; /* Based on MTU+slack. */
unsigned int speed; /* Operating speed */
unsigned int vlan; /* VLAN Id */
unsigned int chip_id; /* PCI table chip id */
unsigned int rx_coalesce; /* Maximum frames each RxDMAComplete intr */
unsigned int rx_timeout; /* Wait time between RxDMAComplete intr */
unsigned int tx_coalesce; /* Maximum frames each tx interrupt */
unsigned int full_duplex:1; /* Full-duplex operation requested. */
unsigned int an_enable:2; /* Auto-Negotiated Enable */
unsigned int jumbo:1; /* Jumbo frame enable */
unsigned int coalesce:1; /* Rx coalescing enable */
unsigned int tx_flow:1; /* Tx flow control enable */
unsigned int rx_flow:1; /* Rx flow control enable */
unsigned int phy_media:1; /* 1: fiber, 0: copper */
unsigned int link_status:1; /* Current link status */
struct netdev_desc *last_tx; /* Last Tx descriptor used. */
unsigned long cur_rx, old_rx; /* Producer/consumer ring indices */
unsigned long cur_tx, old_tx;
struct timer_list timer;
int wake_polarity;
char name[256]; /* net device description */
u8 duplex_polarity;
u16 mcast_filter[4];
u16 advertising; /* NWay media advertisement */
u16 negotiate; /* Negotiated media */
int phy_addr; /* PHY addresses. */
u16 led_mode; /* LED mode read from EEPROM (IP1000A only) */
bool rmon_enable;
};
/* The station address location in the EEPROM. */
/* The struct pci_device_id consist of:
vendor, device Vendor and device ID to match (or PCI_ANY_ID)
subvendor, subdevice Subsystem vendor and device ID to match (or PCI_ANY_ID)
class Device class to match. The class_mask tells which bits
class_mask of the class are honored during the comparison.
driver_data Data private to the driver.
*/
#define CHIP_IP1000A 1
static const struct pci_device_id rio_pci_tbl[] = {
{ PCI_DEVICE(0x1186, 0x4000) },
{ PCI_DEVICE(0x13f0, 0x1021) },
{ PCI_VDEVICE(SUNDANCE, 0x1023), .driver_data = CHIP_IP1000A },
{ PCI_VDEVICE(SUNDANCE, 0x2021), .driver_data = CHIP_IP1000A },
{ PCI_VDEVICE(DLINK, 0x9021), .driver_data = CHIP_IP1000A },
{ PCI_VDEVICE(DLINK, 0x4020), .driver_data = CHIP_IP1000A },
{ }
};
MODULE_DEVICE_TABLE (pci, rio_pci_tbl);
#define TX_TIMEOUT (4*HZ)
#define PACKET_SIZE 1536
#define MAX_JUMBO 8000
#define RIO_IO_SIZE 340
#define DEFAULT_RXC 5
#define DEFAULT_RXT 750
#define DEFAULT_TXC 1
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/string.h`, `linux/timer.h`, `linux/errno.h`, `linux/ioport.h`, `linux/slab.h`, `linux/interrupt.h`.
- Detected declarations: `struct ioctl_data`, `struct netdev_desc`, `struct netdev_private`, `enum dl2x_offsets`, `enum IntStatus_bits`, `enum ReceiveMode_bits`, `enum MACCtrl_bits`, `enum ASICCtrl_LoWord_bits`, `enum ASICCtrl_HiWord_bits`, `enum TFC_bits`.
- 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.