drivers/net/ethernet/intel/igbvf/netdev.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/igbvf/netdev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/igbvf/netdev.c- Extension
.c- Size
- 79338 bytes
- Lines
- 2994
- 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/bitfield.hlinux/delay.hlinux/ethtool.hlinux/if_vlan.hlinux/init.hlinux/ipv6.hlinux/mii.hlinux/module.hlinux/netdevice.hlinux/pagemap.hlinux/pci.hlinux/prefetch.hlinux/sctp.hlinux/slab.hlinux/tcp.hlinux/types.hlinux/vmalloc.hnet/checksum.hnet/ip6_checksum.higbvf.h
Detected Declarations
function igbvf_desc_unusedfunction igbvf_receive_skbfunction igbvf_rx_checksum_advfunction igbvf_alloc_rx_buffersfunction igbvf_clean_rx_irqfunction igbvf_put_txbuffunction igbvf_setup_tx_resourcesfunction igbvf_setup_rx_resourcesfunction igbvf_clean_tx_ringfunction igbvf_free_tx_resourcesfunction igbvf_clean_rx_ringfunction igbvf_free_rx_resourcesfunction igbvf_update_itrfunction igbvf_range_to_itrfunction igbvf_set_itrfunction igbvf_clean_tx_irqfunction igbvf_msix_otherfunction igbvf_intr_msix_txfunction igbvf_intr_msix_rxfunction igbvf_assign_vectorfunction igbvf_configure_msixfunction igbvf_reset_interrupt_capabilityfunction igbvf_set_interrupt_capabilityfunction igbvf_request_msixfunction igbvf_alloc_queuesfunction igbvf_request_irqfunction igbvf_free_irqfunction igbvf_irq_disablefunction igbvf_irq_enablefunction igbvf_pollfunction igbvf_set_rlpmlfunction igbvf_vlan_rx_add_vidfunction igbvf_vlan_rx_kill_vidfunction igbvf_restore_vlanfunction igbvf_configure_txfunction igbvf_setup_srrctlfunction igbvf_configure_rxfunction igbvf_set_multifunction igbvf_set_unifunction netdev_for_each_uc_addrfunction igbvf_set_rx_modefunction igbvf_configurefunction igbvf_resetfunction igbvf_upfunction igbvf_downfunction igbvf_reinit_lockedfunction settingsfunction igbvf_initialize_last_counter_stats
Annotated Snippet
static const struct net_device_ops igbvf_netdev_ops = {
.ndo_open = igbvf_open,
.ndo_stop = igbvf_close,
.ndo_start_xmit = igbvf_xmit_frame,
.ndo_set_rx_mode = igbvf_set_rx_mode,
.ndo_set_mac_address = igbvf_set_mac,
.ndo_change_mtu = igbvf_change_mtu,
.ndo_eth_ioctl = igbvf_ioctl,
.ndo_tx_timeout = igbvf_tx_timeout,
.ndo_vlan_rx_add_vid = igbvf_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = igbvf_vlan_rx_kill_vid,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = igbvf_netpoll,
#endif
.ndo_set_features = igbvf_set_features,
.ndo_features_check = igbvf_features_check,
};
/**
* igbvf_probe - Device Initialization Routine
* @pdev: PCI device information struct
* @ent: entry in igbvf_pci_tbl
*
* Returns 0 on success, negative on failure
*
* igbvf_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 igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev;
struct igbvf_adapter *adapter;
struct e1000_hw *hw;
const struct igbvf_info *ei = igbvf_info_tbl[ent->driver_data];
int err;
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;
}
err = pci_request_regions(pdev, igbvf_driver_name);
if (err)
goto err_pci_reg;
pci_set_master(pdev);
err = -ENOMEM;
netdev = alloc_etherdev(sizeof(struct igbvf_adapter));
if (!netdev)
goto err_alloc_etherdev;
SET_NETDEV_DEV(netdev, &pdev->dev);
pci_set_drvdata(pdev, netdev);
adapter = netdev_priv(netdev);
hw = &adapter->hw;
adapter->netdev = netdev;
adapter->pdev = pdev;
adapter->ei = ei;
adapter->pba = ei->pba;
adapter->flags = ei->flags;
adapter->hw.back = adapter;
adapter->hw.mac.type = ei->mac;
adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
/* PCI config space info */
hw->vendor_id = pdev->vendor;
hw->device_id = pdev->device;
hw->subsystem_vendor_id = pdev->subsystem_vendor;
hw->subsystem_device_id = pdev->subsystem_device;
hw->revision_id = pdev->revision;
err = -EIO;
adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
if (!adapter->hw.hw_addr)
goto err_ioremap;
if (ei->get_variants) {
err = ei->get_variants(adapter);
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/delay.h`, `linux/ethtool.h`, `linux/if_vlan.h`, `linux/init.h`, `linux/ipv6.h`, `linux/mii.h`, `linux/module.h`.
- Detected declarations: `function igbvf_desc_unused`, `function igbvf_receive_skb`, `function igbvf_rx_checksum_adv`, `function igbvf_alloc_rx_buffers`, `function igbvf_clean_rx_irq`, `function igbvf_put_txbuf`, `function igbvf_setup_tx_resources`, `function igbvf_setup_rx_resources`, `function igbvf_clean_tx_ring`, `function igbvf_free_tx_resources`.
- 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.