drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c- Extension
.c- Size
- 350424 bytes
- Lines
- 12461
- 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/types.hlinux/module.hlinux/pci.hlinux/netdevice.hlinux/vmalloc.hlinux/string.hlinux/in.hlinux/interrupt.hlinux/iopoll.hlinux/ip.hlinux/tcp.hlinux/sctp.hlinux/pkt_sched.hlinux/ipv6.hlinux/slab.hnet/checksum.hnet/ip6_checksum.hlinux/etherdevice.hlinux/ethtool.hlinux/if.hlinux/if_vlan.hlinux/if_macvlan.hlinux/if_bridge.hlinux/prefetch.hlinux/bpf.hlinux/bpf_trace.hlinux/atomic.hlinux/numa.hgenerated/utsrelease.hscsi/fc/fc_fcoe.hnet/udp_tunnel.hnet/pkt_cls.h
Detected Declarations
struct ixgbe_reg_infostruct my_u0struct upper_walk_datafunction netif_is_ixgbefunction ixgbe_read_pci_cfg_word_parentfunction ixgbe_get_parent_bus_infofunction ixgbe_pcie_from_parentfunction ixgbe_check_minimum_linkfunction ixgbe_service_event_schedulefunction ixgbe_remove_adapterfunction ixgbe_check_removefunction IXGBE_FAILED_READ_REGfunction ixgbe_check_cfg_removefunction ixgbe_read_pci_cfg_wordfunction ixgbe_read_pci_cfg_dwordfunction ixgbe_write_pci_cfg_wordfunction ixgbe_service_event_completefunction ixgbe_regdumpfunction ixgbe_print_bufferfunction ixgbe_dumpfunction ixgbe_release_hw_controlfunction ixgbe_get_hw_controlfunction ixgbe_set_ivarfunction ixgbe_irq_rearm_queuesfunction ixgbe_update_xoff_rx_lfcfunction ixgbe_update_xoff_receivedfunction ixgbe_get_tx_completedfunction ixgbe_get_tx_pendingfunction ixgbe_get_vf_idxfunction ixgbe_check_tx_hangfunction ixgbe_tx_timeout_resetfunction ixgbe_tx_maxratefunction ixgbe_update_tx_ring_statsfunction ixgbe_update_rx_ring_statsfunction ixgbe_pf_handle_tx_hangfunction ixgbe_vf_handle_tx_hangfunction ixgbe_poll_tx_icachefunction ixgbe_check_illegal_queuefunction ixgbe_handle_mdd_eventfunction ixgbe_clean_tx_irqfunction ixgbe_update_tx_dcafunction ixgbe_update_rx_dcafunction ixgbe_update_dcafunction ixgbe_setup_dcafunction __ixgbe_notify_dcafunction ixgbe_rx_hashfunction ixgbe_rx_is_fcoefunction ixgbe_rx_checksum
Annotated Snippet
static const struct net_device_ops ixgbe_netdev_ops;
static bool netif_is_ixgbe(struct net_device *dev)
{
return dev && (dev->netdev_ops == &ixgbe_netdev_ops);
}
static int ixgbe_read_pci_cfg_word_parent(struct ixgbe_adapter *adapter,
u32 reg, u16 *value)
{
struct pci_dev *parent_dev;
struct pci_bus *parent_bus;
parent_bus = adapter->pdev->bus->parent;
if (!parent_bus)
return -1;
parent_dev = parent_bus->self;
if (!parent_dev)
return -1;
if (!pci_is_pcie(parent_dev))
return -1;
pcie_capability_read_word(parent_dev, reg, value);
if (*value == IXGBE_FAILED_READ_CFG_WORD &&
ixgbe_check_cfg_remove(&adapter->hw, parent_dev))
return -1;
return 0;
}
static int ixgbe_get_parent_bus_info(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
u16 link_status = 0;
int err;
hw->bus.type = ixgbe_bus_type_pci_express;
/* Get the negotiated link width and speed from PCI config space of the
* parent, as this device is behind a switch
*/
err = ixgbe_read_pci_cfg_word_parent(adapter, 18, &link_status);
/* assume caller will handle error case */
if (err)
return err;
hw->bus.width = ixgbe_convert_bus_width(link_status);
hw->bus.speed = ixgbe_convert_bus_speed(link_status);
return 0;
}
/**
* ixgbe_pcie_from_parent - Determine whether PCIe info should come from parent
* @hw: hw specific details
*
* This function is used by probe to determine whether a device's PCI-Express
* bandwidth details should be gathered from the parent bus instead of from the
* device. Used to ensure that various locations all have the correct device ID
* checks.
*
* Return: true if information should be collected from the parent bus, false
* otherwise
*/
static bool ixgbe_pcie_from_parent(struct ixgbe_hw *hw)
{
switch (hw->device_id) {
case IXGBE_DEV_ID_82599_SFP_SF_QP:
case IXGBE_DEV_ID_82599_QSFP_SF_QP:
return true;
default:
return false;
}
}
static void ixgbe_check_minimum_link(struct ixgbe_adapter *adapter,
int expected_gts)
{
struct ixgbe_hw *hw = &adapter->hw;
struct pci_dev *pdev;
/* Some devices are not connected over PCIe and thus do not negotiate
* speed. These devices do not have valid bus info, and thus any report
* we generate may not be correct.
*/
if (hw->bus.type == ixgbe_bus_type_internal)
return;
Annotation
- Immediate include surface: `linux/types.h`, `linux/module.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/vmalloc.h`, `linux/string.h`, `linux/in.h`, `linux/interrupt.h`.
- Detected declarations: `struct ixgbe_reg_info`, `struct my_u0`, `struct upper_walk_data`, `function netif_is_ixgbe`, `function ixgbe_read_pci_cfg_word_parent`, `function ixgbe_get_parent_bus_info`, `function ixgbe_pcie_from_parent`, `function ixgbe_check_minimum_link`, `function ixgbe_service_event_schedule`, `function ixgbe_remove_adapter`.
- 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.