drivers/net/ethernet/intel/e100.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/e100.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/e100.c- Extension
.c- Size
- 92987 bytes
- Lines
- 3199
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hardirq.hlinux/interrupt.hlinux/module.hlinux/moduleparam.hlinux/kernel.hlinux/types.hlinux/sched.hlinux/slab.hlinux/delay.hlinux/init.hlinux/pci.hlinux/dma-mapping.hlinux/dmapool.hlinux/netdevice.hlinux/etherdevice.hlinux/mii.hlinux/if_vlan.hlinux/skbuff.hlinux/ethtool.hlinux/string.hlinux/firmware.hlinux/rtnetlink.hlinux/unaligned.h
Detected Declarations
struct csrstruct rfdstruct rxstruct configstruct multistruct cbstruct statsstruct memstruct param_rangestruct paramsstruct nicenum macenum phyenum scb_statusenum ru_stateenum scb_stat_ackenum scb_cmd_hienum scb_cmd_loenum cuc_dumpenum portenum eeprom_ctrl_loenum mdi_ctrlenum eeprom_openum eeprom_offsetsenum eeprom_cnfg_mdixenum eeprom_phy_ifaceenum eeprom_idenum eeprom_config_asfenum cb_statusenum cb_commandenum loopbackenum led_statefunction e100_write_flushfunction e100_enable_irqfunction e100_disable_irqfunction e100_hw_resetfunction e100_self_testfunction e100_eeprom_writefunction e100_eeprom_readfunction e100_eeprom_loadfunction e100_eeprom_savefunction e100_exec_cmdfunction e100_exec_cbfunction mdio_readfunction mdio_writefunction mdio_ctrl_hwfunction mdio_ctrl_phy_82552_vfunction types
Annotated Snippet
static const struct net_device_ops e100_netdev_ops = {
.ndo_open = e100_open,
.ndo_stop = e100_close,
.ndo_start_xmit = e100_xmit_frame,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = e100_set_multicast_list,
.ndo_set_mac_address = e100_set_mac_address,
.ndo_eth_ioctl = e100_do_ioctl,
.ndo_tx_timeout = e100_tx_timeout,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = e100_netpoll,
#endif
.ndo_set_features = e100_set_features,
};
static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev;
struct nic *nic;
int err;
if (!(netdev = alloc_etherdev(sizeof(struct nic))))
return -ENOMEM;
netdev->hw_features |= NETIF_F_RXFCS;
netdev->priv_flags |= IFF_SUPP_NOFCS;
netdev->hw_features |= NETIF_F_RXALL;
netdev->netdev_ops = &e100_netdev_ops;
netdev->ethtool_ops = &e100_ethtool_ops;
netdev->watchdog_timeo = E100_WATCHDOG_PERIOD;
strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
nic = netdev_priv(netdev);
netif_napi_add_weight(netdev, &nic->napi, e100_poll, E100_NAPI_WEIGHT);
nic->netdev = netdev;
nic->pdev = pdev;
nic->msg_enable = (1 << debug) - 1;
nic->mdio_ctrl = mdio_ctrl_hw;
pci_set_drvdata(pdev, netdev);
if ((err = pci_enable_device(pdev))) {
netif_err(nic, probe, nic->netdev, "Cannot enable PCI device, aborting\n");
goto err_out_free_dev;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
netif_err(nic, probe, nic->netdev, "Cannot find proper PCI device base address, aborting\n");
err = -ENODEV;
goto err_out_disable_pdev;
}
if ((err = pci_request_regions(pdev, DRV_NAME))) {
netif_err(nic, probe, nic->netdev, "Cannot obtain PCI resources, aborting\n");
goto err_out_disable_pdev;
}
if ((err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)))) {
netif_err(nic, probe, nic->netdev, "No usable DMA configuration, aborting\n");
goto err_out_free_res;
}
SET_NETDEV_DEV(netdev, &pdev->dev);
if (use_io)
netif_info(nic, probe, nic->netdev, "using i/o access mode\n");
nic->csr = pci_iomap(pdev, (use_io ? 1 : 0), sizeof(struct csr));
if (!nic->csr) {
netif_err(nic, probe, nic->netdev, "Cannot map device registers, aborting\n");
err = -ENOMEM;
goto err_out_free_res;
}
if (ent->driver_data)
nic->flags |= ich;
else
nic->flags &= ~ich;
e100_get_defaults(nic);
/* D100 MAC doesn't allow rx of vlan packets with normal MTU */
if (nic->mac < mac_82558_D101_A4)
netdev->features |= NETIF_F_VLAN_CHALLENGED;
/* locks must be initialized before calling hw_reset */
spin_lock_init(&nic->cb_lock);
spin_lock_init(&nic->cmd_lock);
spin_lock_init(&nic->mdio_lock);
Annotation
- Immediate include surface: `linux/hardirq.h`, `linux/interrupt.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/types.h`, `linux/sched.h`, `linux/slab.h`.
- Detected declarations: `struct csr`, `struct rfd`, `struct rx`, `struct config`, `struct multi`, `struct cb`, `struct stats`, `struct mem`, `struct param_range`, `struct params`.
- 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.