drivers/net/ethernet/3com/3c59x.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/3com/3c59x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/3com/3c59x.c- Extension
.c- Size
- 104591 bytes
- Lines
- 3358
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/module.hlinux/kernel.hlinux/string.hlinux/timer.hlinux/errno.hlinux/in.hlinux/ioport.hlinux/interrupt.hlinux/pci.hlinux/mii.hlinux/init.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/ethtool.hlinux/highmem.hlinux/eisa.hlinux/bitops.hlinux/jiffies.hlinux/gfp.hasm/irq.hasm/io.hlinux/uaccess.hlinux/delay.h
Detected Declarations
struct boom_rx_descstruct boom_tx_descstruct vortex_extra_statsstruct vortex_privateenum pci_flags_bitenum vortex_chipsenum vortex_cmdenum RxFilterenum vortex_statusenum Window1enum Window0enum Win0_EEPROM_bitsenum eeprom_offsetenum Window2enum Window3enum Window4enum Win4_Media_bitsenum Window7enum MasterCtrlenum rx_desc_statusenum tx_desc_statusenum ChipCapsenum xcvr_typesfunction window_setfunction poll_vortexfunction vortex_suspendfunction vortex_resumefunction vortex_eisa_probefunction vortex_eisa_removefunction vortex_eisa_initfunction vortex_init_onefunction vortex_probe1function issue_and_waitfunction vortex_set_duplexfunction vortex_check_mediafunction vortex_upfunction vortex_openfunction vortex_timerfunction vortex_tx_timeoutfunction vortex_errorfunction vortex_start_xmitfunction boomerang_start_xmitfunction _vortex_interruptfunction _boomerang_interruptfunction vortex_boomerang_interruptfunction vortex_rxfunction boomerang_rxfunction vortex_down
Annotated Snippet
static const struct net_device_ops boomrang_netdev_ops = {
.ndo_open = vortex_open,
.ndo_stop = vortex_close,
.ndo_start_xmit = boomerang_start_xmit,
.ndo_tx_timeout = vortex_tx_timeout,
.ndo_get_stats = vortex_get_stats,
#ifdef CONFIG_PCI
.ndo_eth_ioctl = vortex_ioctl,
#endif
.ndo_set_rx_mode = set_rx_mode,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = poll_vortex,
#endif
};
static const struct net_device_ops vortex_netdev_ops = {
.ndo_open = vortex_open,
.ndo_stop = vortex_close,
.ndo_start_xmit = vortex_start_xmit,
.ndo_tx_timeout = vortex_tx_timeout,
.ndo_get_stats = vortex_get_stats,
#ifdef CONFIG_PCI
.ndo_eth_ioctl = vortex_ioctl,
#endif
.ndo_set_rx_mode = set_rx_mode,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = poll_vortex,
#endif
};
/*
* Start up the PCI/EISA device which is described by *gendev.
* Return 0 on success.
*
* NOTE: pdev can be NULL, for the case of a Compaq device
*/
static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
int chip_idx, int card_idx)
{
struct vortex_private *vp;
int option;
unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
__be16 addr[ETH_ALEN / 2];
int i, step;
struct net_device *dev;
static int printed_version;
int retval, print_info;
struct vortex_chip_info * const vci = &vortex_info_tbl[chip_idx];
const char *print_name = "3c59x";
struct pci_dev *pdev = NULL;
struct eisa_device *edev = NULL;
if (!printed_version) {
pr_info("%s", version);
printed_version = 1;
}
if (gendev) {
if ((pdev = DEVICE_PCI(gendev))) {
print_name = pci_name(pdev);
}
if ((edev = DEVICE_EISA(gendev))) {
print_name = dev_name(&edev->dev);
}
}
dev = alloc_etherdev(sizeof(*vp));
retval = -ENOMEM;
if (!dev)
goto out;
SET_NETDEV_DEV(dev, gendev);
vp = netdev_priv(dev);
option = global_options;
/* The lower four bits are the media type. */
if (dev->mem_start) {
/*
* The 'options' param is passed in as the third arg to the
* LILO 'ether=' argument for non-modular use
*/
option = dev->mem_start;
}
else if (card_idx < MAX_UNITS) {
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/string.h`, `linux/timer.h`, `linux/errno.h`, `linux/in.h`, `linux/ioport.h`, `linux/interrupt.h`.
- Detected declarations: `struct boom_rx_desc`, `struct boom_tx_desc`, `struct vortex_extra_stats`, `struct vortex_private`, `enum pci_flags_bit`, `enum vortex_chips`, `enum vortex_cmd`, `enum RxFilter`, `enum vortex_status`, `enum Window1`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.