drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c- Extension
.c- Size
- 110329 bytes
- Lines
- 4247
- 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/vmalloc.hlinux/interrupt.hlinux/swab.hlinux/dma-mapping.hlinux/if_vlan.hnet/ip.hlinux/ipv6.hlinux/inetdevice.hlinux/log2.hlinux/pci.hnet/vxlan.hqlcnic.hqlcnic_sriov.hqlcnic_hw.h
Detected Declarations
function qlcnic_vlan_tx_checkfunction qlcnic_update_cmd_producerfunction qlcnic_alloc_sds_ringsfunction qlcnic_free_sds_ringsfunction qlcnic_read_mac_addrfunction qlcnic_delete_adapter_macfunction list_for_each_entryfunction qlcnic_set_macfunction qlcnic_fdb_delfunction qlcnic_fdb_addfunction qlcnic_fdb_dumpfunction qlcnic_82xx_cancel_idc_workfunction qlcnic_get_phys_port_idfunction qlcnic_udp_tunnel_syncfunction qlcnic_features_checkfunction qlcnic_check_multi_tx_capabilityfunction qlcnic_max_ringsfunction qlcnic_set_tx_ring_countfunction qlcnic_set_sds_ring_countfunction qlcnic_setup_tss_rss_intrfunction qlcnic_enable_msixfunction qlcnic_82xx_calculate_msix_vectorfunction qlcnic_enable_msi_legacyfunction qlcnic_82xx_setup_intrfunction qlcnic_82xx_mq_intrptfunction qlcnic_teardown_intrfunction qlcnic_cleanup_pci_mapfunction qlcnic_get_act_pci_funcfunction qlcnic_port_eswitch_cfg_capabilityfunction qlcnic_init_pci_infofunction qlcnic_set_function_modesfunction qlcnic_check_vffunction qlcnic_get_bar_lengthfunction qlcnic_setup_pci_mapfunction qlcnic_validate_subsystem_idfunction qlcnic_get_board_namefunction qlcnic_check_optionsfunction qlcnic_initialize_nicfunction qlcnic_set_vlan_configfunction qlcnic_vlan_rx_addfunction qlcnic_vlan_rx_delfunction qlcnic_set_eswitch_port_featuresfunction qlcnic_set_eswitch_port_configfunction qlcnic_set_netdev_featuresfunction qlcnic_check_eswitch_modefunction qlcnic_set_default_offload_settingsfunction qlcnic_reset_eswitch_configfunction qlcnic_reset_npar_config
Annotated Snippet
static const struct net_device_ops qlcnic_netdev_ops = {
.ndo_open = qlcnic_open,
.ndo_stop = qlcnic_close,
.ndo_start_xmit = qlcnic_xmit_frame,
.ndo_get_stats = qlcnic_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = qlcnic_set_multi,
.ndo_set_mac_address = qlcnic_set_mac,
.ndo_change_mtu = qlcnic_change_mtu,
.ndo_fix_features = qlcnic_fix_features,
.ndo_set_features = qlcnic_set_features,
.ndo_tx_timeout = qlcnic_tx_timeout,
.ndo_vlan_rx_add_vid = qlcnic_vlan_rx_add,
.ndo_vlan_rx_kill_vid = qlcnic_vlan_rx_del,
.ndo_fdb_add = qlcnic_fdb_add,
.ndo_fdb_del = qlcnic_fdb_del,
.ndo_fdb_dump = qlcnic_fdb_dump,
.ndo_get_phys_port_id = qlcnic_get_phys_port_id,
.ndo_features_check = qlcnic_features_check,
#ifdef CONFIG_QLCNIC_SRIOV
.ndo_set_vf_mac = qlcnic_sriov_set_vf_mac,
.ndo_set_vf_rate = qlcnic_sriov_set_vf_tx_rate,
.ndo_get_vf_config = qlcnic_sriov_get_vf_config,
.ndo_set_vf_vlan = qlcnic_sriov_set_vf_vlan,
.ndo_set_vf_spoofchk = qlcnic_sriov_set_vf_spoofchk,
#endif
};
static const struct net_device_ops qlcnic_netdev_failed_ops = {
.ndo_open = qlcnic_open,
};
static struct qlcnic_nic_template qlcnic_ops = {
.config_bridged_mode = qlcnic_config_bridged_mode,
.config_led = qlcnic_82xx_config_led,
.start_firmware = qlcnic_82xx_start_firmware,
.request_reset = qlcnic_82xx_dev_request_reset,
.cancel_idc_work = qlcnic_82xx_cancel_idc_work,
.napi_add = qlcnic_82xx_napi_add,
.napi_del = qlcnic_82xx_napi_del,
.config_ipaddr = qlcnic_82xx_config_ipaddr,
.shutdown = qlcnic_82xx_shutdown,
.resume = qlcnic_82xx_resume,
.clear_legacy_intr = qlcnic_82xx_clear_legacy_intr,
};
struct qlcnic_nic_template qlcnic_vf_ops = {
.config_bridged_mode = qlcnicvf_config_bridged_mode,
.config_led = qlcnicvf_config_led,
.start_firmware = qlcnicvf_start_firmware
};
static struct qlcnic_hardware_ops qlcnic_hw_ops = {
.read_crb = qlcnic_82xx_read_crb,
.write_crb = qlcnic_82xx_write_crb,
.read_reg = qlcnic_82xx_hw_read_wx_2M,
.write_reg = qlcnic_82xx_hw_write_wx_2M,
.get_mac_address = qlcnic_82xx_get_mac_address,
.setup_intr = qlcnic_82xx_setup_intr,
.alloc_mbx_args = qlcnic_82xx_alloc_mbx_args,
.mbx_cmd = qlcnic_82xx_issue_cmd,
.get_func_no = qlcnic_82xx_get_func_no,
.api_lock = qlcnic_82xx_api_lock,
.api_unlock = qlcnic_82xx_api_unlock,
.add_sysfs = qlcnic_82xx_add_sysfs,
.remove_sysfs = qlcnic_82xx_remove_sysfs,
.process_lb_rcv_ring_diag = qlcnic_82xx_process_rcv_ring_diag,
.create_rx_ctx = qlcnic_82xx_fw_cmd_create_rx_ctx,
.create_tx_ctx = qlcnic_82xx_fw_cmd_create_tx_ctx,
.del_rx_ctx = qlcnic_82xx_fw_cmd_del_rx_ctx,
.del_tx_ctx = qlcnic_82xx_fw_cmd_del_tx_ctx,
.setup_link_event = qlcnic_82xx_linkevent_request,
.get_nic_info = qlcnic_82xx_get_nic_info,
.get_pci_info = qlcnic_82xx_get_pci_info,
.set_nic_info = qlcnic_82xx_set_nic_info,
.change_macvlan = qlcnic_82xx_sre_macaddr_change,
.napi_enable = qlcnic_82xx_napi_enable,
.napi_disable = qlcnic_82xx_napi_disable,
.config_intr_coal = qlcnic_82xx_config_intr_coalesce,
.config_rss = qlcnic_82xx_config_rss,
.config_hw_lro = qlcnic_82xx_config_hw_lro,
.config_loopback = qlcnic_82xx_set_lb_mode,
.clear_loopback = qlcnic_82xx_clear_lb_mode,
.config_promisc_mode = qlcnic_82xx_nic_set_promisc,
.change_l2_filter = qlcnic_82xx_change_filter,
.get_board_info = qlcnic_82xx_get_board_info,
.set_mac_filter_count = qlcnic_82xx_set_mac_filter_count,
.free_mac_list = qlcnic_82xx_free_mac_list,
.read_phys_port_id = qlcnic_82xx_read_phys_port_id,
.io_error_detected = qlcnic_82xx_io_error_detected,
Annotation
- Immediate include surface: `linux/vmalloc.h`, `linux/interrupt.h`, `linux/swab.h`, `linux/dma-mapping.h`, `linux/if_vlan.h`, `net/ip.h`, `linux/ipv6.h`, `linux/inetdevice.h`.
- Detected declarations: `function qlcnic_vlan_tx_check`, `function qlcnic_update_cmd_producer`, `function qlcnic_alloc_sds_rings`, `function qlcnic_free_sds_rings`, `function qlcnic_read_mac_addr`, `function qlcnic_delete_adapter_mac`, `function list_for_each_entry`, `function qlcnic_set_mac`, `function qlcnic_fdb_del`, `function qlcnic_fdb_add`.
- 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.