drivers/net/ethernet/intel/e1000e/netdev.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/e1000e/netdev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/e1000e/netdev.c- Extension
.c- Size
- 232931 bytes
- Lines
- 8223
- 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/module.hlinux/types.hlinux/init.hlinux/pci.hlinux/vmalloc.hlinux/pagemap.hlinux/delay.hlinux/netdevice.hlinux/interrupt.hlinux/tcp.hlinux/ipv6.hlinux/slab.hnet/checksum.hnet/ip6_checksum.hlinux/ethtool.hlinux/if_vlan.hlinux/cpu.hlinux/smp.hlinux/pm_qos.hlinux/pm_runtime.hlinux/prefetch.hlinux/suspend.he1000.he1000e_trace.h
Detected Declarations
struct e1000_reg_infostruct my_u0struct my_u1function __ew32_preparefunction __ew32function e1000_regdumpfunction e1000e_dump_ps_pagesfunction e1000e_dumpfunction e1000_desc_unusedfunction e1000e_systim_to_hwtstampfunction e1000e_rx_hwtstampfunction e1000_receive_skbfunction e1000_rx_checksumfunction e1000e_update_rdt_wafunction e1000e_update_tdt_wafunction e1000_alloc_rx_buffersfunction e1000_alloc_rx_buffers_psfunction e1000_alloc_jumbo_rx_buffersfunction e1000_rx_hashfunction e1000_clean_rx_irqfunction e1000_put_txbuffunction e1000_print_hw_hangfunction e1000e_tx_hwtstamp_workfunction e1000_clean_tx_irqfunction e1000_desc_unusedfunction e1000_clean_rx_irq_psfunction e1000_consume_pagefunction e1000_clean_jumbo_rx_irqfunction e1000_clean_rx_ringfunction e1000e_downshift_workaroundfunction e1000_intr_msifunction e1000_intrfunction e1000_msix_otherfunction e1000_intr_msix_txfunction e1000_intr_msix_rxfunction e1000_configure_msixfunction e1000e_reset_interrupt_capabilityfunction e1000e_set_interrupt_capabilityfunction e1000_request_msixfunction e1000_request_irqfunction e1000_free_irqfunction e1000_irq_disablefunction e1000_irq_enablefunction e1000e_get_hw_controlfunction e1000e_release_hw_controlfunction e1000_alloc_ring_dmafunction e1000e_setup_tx_resourcesfunction e1000e_setup_rx_resources
Annotated Snippet
static const struct net_device_ops e1000e_netdev_ops = {
.ndo_open = e1000e_open,
.ndo_stop = e1000e_close,
.ndo_start_xmit = e1000_xmit_frame,
.ndo_get_stats64 = e1000e_get_stats64,
.ndo_set_rx_mode = e1000e_set_rx_mode,
.ndo_set_mac_address = e1000_set_mac,
.ndo_change_mtu = e1000_change_mtu,
.ndo_eth_ioctl = e1000_ioctl,
.ndo_tx_timeout = e1000_tx_timeout,
.ndo_validate_addr = eth_validate_addr,
.ndo_vlan_rx_add_vid = e1000_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = e1000_vlan_rx_kill_vid,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = e1000_netpoll,
#endif
.ndo_set_features = e1000_set_features,
.ndo_fix_features = e1000_fix_features,
.ndo_features_check = passthru_features_check,
.ndo_hwtstamp_get = e1000e_hwtstamp_get,
.ndo_hwtstamp_set = e1000e_hwtstamp_set,
};
/**
* e1000_probe - Device Initialization Routine
* @pdev: PCI device information struct
* @ent: entry in e1000_pci_tbl
*
* Returns 0 on success, negative on failure
*
* e1000_probe initializes an adapter identified by a pci_dev structure.
* The OS initialization, configuring of the adapter private structure,
* and a hardware reset occur.
**/
static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev;
struct e1000_adapter *adapter;
struct e1000_hw *hw;
const struct e1000_info *ei = e1000_info_tbl[ent->driver_data];
resource_size_t mmio_start, mmio_len;
resource_size_t flash_start, flash_len;
static int cards_found;
u16 aspm_disable_flag = 0;
u16 eeprom_data = 0;
u16 eeprom_apme_mask = E1000_EEPROM_APME;
int bars, i, err;
s32 ret_val = 0;
if (ei->flags2 & FLAG2_DISABLE_ASPM_L0S)
aspm_disable_flag = PCIE_LINK_STATE_L0S;
if (ei->flags2 & FLAG2_DISABLE_ASPM_L1)
aspm_disable_flag |= PCIE_LINK_STATE_L1;
if (aspm_disable_flag)
e1000e_disable_aspm(pdev, aspm_disable_flag);
err = pci_enable_device_mem(pdev);
if (err)
return err;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
dev_err(&pdev->dev,
"No usable DMA configuration, aborting\n");
goto err_dma;
}
bars = pci_select_bars(pdev, IORESOURCE_MEM);
err = pci_request_selected_regions_exclusive(pdev, bars,
e1000e_driver_name);
if (err)
goto err_pci_reg;
pci_set_master(pdev);
/* PCI config space info */
err = pci_save_state(pdev);
if (err)
goto err_alloc_etherdev;
err = -ENOMEM;
netdev = alloc_etherdev(sizeof(struct e1000_adapter));
if (!netdev)
goto err_alloc_etherdev;
SET_NETDEV_DEV(netdev, &pdev->dev);
netdev->irq = pdev->irq;
pci_set_drvdata(pdev, netdev);
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/init.h`, `linux/pci.h`, `linux/vmalloc.h`, `linux/pagemap.h`, `linux/delay.h`, `linux/netdevice.h`.
- Detected declarations: `struct e1000_reg_info`, `struct my_u0`, `struct my_u1`, `function __ew32_prepare`, `function __ew32`, `function e1000_regdump`, `function e1000e_dump_ps_pages`, `function e1000e_dump`, `function e1000_desc_unused`, `function e1000e_systim_to_hwtstamp`.
- 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.