drivers/net/ethernet/qlogic/qede/qede_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qede/qede_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qede/qede_main.c- Extension
.c- Size
- 78037 bytes
- Lines
- 2931
- 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/crash_dump.hlinux/module.hlinux/pci.hlinux/device.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/errno.hlinux/list.hlinux/string.hlinux/dma-mapping.hlinux/interrupt.hasm/byteorder.hasm/param.hlinux/io.hlinux/netdev_features.hlinux/udp.hlinux/tcp.hnet/udp_tunnel.hlinux/ip.hnet/ipv6.hnet/tcp.hlinux/if_ether.hlinux/if_vlan.hlinux/pkt_sched.hlinux/ethtool.hlinux/in.hlinux/random.hnet/ip6_checksum.hlinux/bitops.hlinux/vmalloc.hqede.h
Detected Declarations
enum qede_pci_privateenum qede_probe_modeenum qede_remove_modeenum qede_unload_modeenum qede_load_modefunction qede_set_vf_vlanfunction qede_set_vf_macfunction qede_sriov_configurefunction qede_suspendfunction qede_netdev_eventfunction qede_initfunction qede_cleanupfunction qede_fill_by_demand_statsfunction qede_get_stats64function qede_get_vf_configfunction qede_set_vf_ratefunction qede_set_vf_spoofchkfunction qede_set_vf_link_statefunction qede_set_vf_trustfunction qede_fp_sb_dumpfunction qede_txq_fp_log_metadatafunction qede_tx_log_printfunction qede_tx_timeoutfunction for_each_queuefunction for_each_cos_in_txqfunction qede_setup_tcfunction for_each_cos_in_txqfunction qede_set_flowerfunction qede_setup_tc_block_cbfunction qede_setup_tc_offloadfunction qede_init_ndevfunction qede_config_debugfunction qede_free_fp_arrayfunction for_each_queuefunction qede_alloc_fp_arrayfunction queuesfunction __qede_lockfunction __qede_unlockfunction qede_lockfunction qede_unlockfunction qede_periodic_taskfunction qede_init_periodic_taskfunction qede_sp_taskfunction qede_update_pf_paramsfunction qede_log_probefunction __qede_probefunction qede_probefunction __qede_remove
Annotated Snippet
static struct pci_driver qede_pci_driver = {
.name = "qede",
.id_table = qede_pci_tbl,
.probe = qede_probe,
.remove = qede_remove,
.shutdown = qede_shutdown,
#ifdef CONFIG_QED_SRIOV
.sriov_configure = qede_sriov_configure,
#endif
.err_handler = &qede_err_handler,
.driver.pm = &qede_pm_ops,
};
static struct qed_eth_cb_ops qede_ll_ops = {
.common = {
#ifdef CONFIG_RFS_ACCEL
.arfs_filter_op = qede_arfs_filter_op,
#endif
.link_update = qede_link_update,
.schedule_recovery_handler = qede_schedule_recovery_handler,
.schedule_hw_err_handler = qede_schedule_hw_err_handler,
.get_generic_tlv_data = qede_get_generic_tlv_data,
.get_protocol_tlv_data = qede_get_eth_tlv_data,
},
.force_mac = qede_force_mac,
.ports_update = qede_udp_ports_update,
};
static int qede_netdev_event(struct notifier_block *this, unsigned long event,
void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
struct ethtool_drvinfo drvinfo;
struct qede_dev *edev;
if (event != NETDEV_CHANGENAME && event != NETDEV_CHANGEADDR)
goto done;
/* Check whether this is a qede device */
if (!ndev || !ndev->ethtool_ops || !ndev->ethtool_ops->get_drvinfo)
goto done;
memset(&drvinfo, 0, sizeof(drvinfo));
ndev->ethtool_ops->get_drvinfo(ndev, &drvinfo);
if (strcmp(drvinfo.driver, "qede"))
goto done;
edev = netdev_priv(ndev);
switch (event) {
case NETDEV_CHANGENAME:
/* Notify qed of the name change */
if (!edev->ops || !edev->ops->common)
goto done;
edev->ops->common->set_name(edev->cdev, edev->ndev->name);
break;
case NETDEV_CHANGEADDR:
edev = netdev_priv(ndev);
qede_rdma_event_changeaddr(edev);
break;
}
done:
return NOTIFY_DONE;
}
static struct notifier_block qede_netdev_notifier = {
.notifier_call = qede_netdev_event,
};
static
int __init qede_init(void)
{
int ret;
pr_info("qede init: QLogic FastLinQ 4xxxx Ethernet Driver qede\n");
qede_forced_speed_maps_init();
qed_ops = qed_get_eth_ops();
if (!qed_ops) {
pr_notice("Failed to get qed ethtool operations\n");
return -EINVAL;
}
/* Must register notifier before pci ops, since we might miss
* interface rename after pci probe and netdev registration.
*/
ret = register_netdevice_notifier(&qede_netdev_notifier);
if (ret) {
pr_notice("Failed to register netdevice_notifier\n");
Annotation
- Immediate include surface: `linux/crash_dump.h`, `linux/module.h`, `linux/pci.h`, `linux/device.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/skbuff.h`, `linux/errno.h`.
- Detected declarations: `enum qede_pci_private`, `enum qede_probe_mode`, `enum qede_remove_mode`, `enum qede_unload_mode`, `enum qede_load_mode`, `function qede_set_vf_vlan`, `function qede_set_vf_mac`, `function qede_sriov_configure`, `function qede_suspend`, `function qede_netdev_event`.
- 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.