drivers/net/ethernet/dec/tulip/tulip_core.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/dec/tulip/tulip_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/dec/tulip/tulip_core.c- Extension
.c- Size
- 57365 bytes
- Lines
- 1932
- 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/pci.hlinux/slab.htulip.hlinux/init.hlinux/interrupt.hlinux/etherdevice.hlinux/delay.hlinux/mii.hlinux/crc32.hlinux/unaligned.hlinux/uaccess.hasm/prom.h
Detected Declarations
function tulip_timerfunction tulip_set_power_statefunction tulip_upfunction tulip_openfunction tulip_tx_timeoutfunction tulip_init_ringfunction tulip_start_xmitfunction tulip_clean_tx_ringfunction tulip_downfunction tulip_free_ringfunction tulip_closefunction tulip_get_drvinfofunction tulip_ethtool_set_wolfunction tulip_ethtool_get_wolfunction private_ioctlfunction build_setup_frame_hashfunction build_setup_frame_perfectfunction set_rx_modefunction netdev_for_each_mc_addrfunction tulip_mwi_configfunction tulip_uli_dm_quirkfunction tulip_init_onefunction driverfunction tulip_set_woloptsfunction tulip_suspendfunction tulip_resumefunction tulip_remove_onefunction poll_tulipfunction tulip_initfunction tulip_cleanupmodule init tulip_init
Annotated Snippet
static const struct net_device_ops tulip_netdev_ops = {
.ndo_open = tulip_open,
.ndo_start_xmit = tulip_start_xmit,
.ndo_tx_timeout = tulip_tx_timeout,
.ndo_stop = tulip_close,
.ndo_get_stats = tulip_get_stats,
.ndo_eth_ioctl = private_ioctl,
.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_tulip,
#endif
};
static const struct pci_device_id early_486_chipsets[] = {
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82424) },
{ PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_496) },
{ },
};
static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct tulip_private *tp;
/* See note below on the multiport cards. */
static unsigned char last_phys_addr[ETH_ALEN] = {
0x00, 'L', 'i', 'n', 'u', 'x'
};
#if defined(__i386__) || defined(__x86_64__) /* Patch up x86 BIOS bug. */
static int last_irq;
#endif
int i, irq;
unsigned short sum;
unsigned char *ee_data;
struct net_device *dev;
void __iomem *ioaddr;
static int board_idx = -1;
int chip_idx = ent->driver_data;
const char *chip_name = tulip_tbl[chip_idx].chip_name;
unsigned int eeprom_missing = 0;
u8 addr[ETH_ALEN] __aligned(2);
unsigned int force_csr0 = 0;
board_idx++;
/*
* Lan media wire a tulip chip to a wan interface. Needs a very
* different driver (lmc driver)
*/
if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) {
pr_err("skipping LMC card\n");
return -ENODEV;
} else if (pdev->subsystem_vendor == PCI_VENDOR_ID_SBE &&
(pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_T3E3 ||
pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P0 ||
pdev->subsystem_device == PCI_SUBDEVICE_ID_SBE_2T3E3_P1)) {
pr_err("skipping SBE T3E3 port\n");
return -ENODEV;
}
/*
* DM910x chips should be handled by the dmfe driver, except
* on-board chips on SPARC systems. Also, early DM9100s need
* software CRC which only the dmfe driver supports.
*/
#ifdef CONFIG_TULIP_DM910X
if (chip_idx == DM910X) {
struct device_node *dp;
if (pdev->vendor == 0x1282 && pdev->device == 0x9100 &&
pdev->revision < 0x30) {
pr_info("skipping early DM9100 with Crc bug (use dmfe)\n");
return -ENODEV;
}
dp = pci_device_to_OF_node(pdev);
if (!(dp && of_get_property(dp, "local-mac-address", NULL))) {
pr_info("skipping DM910x expansion card (use dmfe)\n");
return -ENODEV;
}
}
#endif
/*
* Looks for early PCI chipsets where people report hangs
* without the workarounds being on.
*/
Annotation
- Immediate include surface: `linux/module.h`, `linux/pci.h`, `linux/slab.h`, `tulip.h`, `linux/init.h`, `linux/interrupt.h`, `linux/etherdevice.h`, `linux/delay.h`.
- Detected declarations: `function tulip_timer`, `function tulip_set_power_state`, `function tulip_up`, `function tulip_open`, `function tulip_tx_timeout`, `function tulip_init_ring`, `function tulip_start_xmit`, `function tulip_clean_tx_ring`, `function tulip_down`, `function tulip_free_ring`.
- 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.