drivers/net/wireless/intel/iwlegacy/3945-mac.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlegacy/3945-mac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlegacy/3945-mac.c- Extension
.c- Size
- 105536 bytes
- Lines
- 3890
- 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/kernel.hlinux/module.hlinux/init.hlinux/pci.hlinux/slab.hlinux/dma-mapping.hlinux/delay.hlinux/sched.hlinux/skbuff.hlinux/netdevice.hlinux/firmware.hlinux/etherdevice.hlinux/if_arp.hnet/ieee80211_radiotap.hnet/mac80211.hasm/div64.hcommands.hcommon.h3945.hiwl-spectrum.h
Detected Declarations
function il3945_get_antenna_flagsfunction il3945_set_ccmp_dynamic_key_infofunction il3945_set_tkip_dynamic_key_infofunction il3945_set_wep_dynamic_key_infofunction il3945_clear_sta_key_infofunction il3945_set_dynamic_keyfunction il3945_remove_static_keyfunction il3945_set_static_keyfunction il3945_clear_free_framesfunction il3945_get_free_framefunction il3945_free_framefunction il3945_fill_beacon_framefunction il3945_send_beacon_cmdfunction il3945_unset_hw_paramsfunction il3945_build_tx_cmd_hwcryptofunction il3945_build_tx_cmd_basicfunction il3945_tx_skbfunction il3945_get_measurementfunction il3945_hdl_alivefunction il3945_hdl_add_stafunction il3945_hdl_beaconfunction il3945_hdl_card_statefunction il3945_setup_handlersfunction emptyfunction il3945_rx_queue_restockfunction absfunction itemfunction il3945_rx_queue_resetfunction il3945_rx_replenishfunction il3945_rx_replenish_nowfunction il3945_rx_queue_freefunction il3945_rx_handlefunction memoryfunction il3945_synchronize_irqfunction il3945_desc_lookupfunction il3945_dump_nic_error_logfunction il3945_irq_taskletfunction il3945_get_channels_for_scanfunction channelsfunction il3945_init_hw_ratesfunction il3945_dealloc_ucode_pcifunction il3945_verify_inst_fullfunction il3945_verify_inst_sparsefunction il3945_verify_ucodefunction il3945_nic_startfunction il3945_ucode_get_header_sizefunction il3945_ucode_get_datafunction il3945_read_ucode
Annotated Snippet
static struct pci_driver il3945_driver = {
.name = DRV_NAME,
.id_table = il3945_hw_card_ids,
.probe = il3945_pci_probe,
.remove = il3945_pci_remove,
.driver.pm = IL_LEGACY_PM_OPS,
};
static int __init
il3945_init(void)
{
int ret;
pr_info(DRV_DESCRIPTION ", " DRV_VERSION "\n");
pr_info(DRV_COPYRIGHT "\n");
/*
* Disabling hardware scan means that mac80211 will perform scans
* "the hard way", rather than using device's scan.
*/
if (il3945_mod_params.disable_hw_scan) {
pr_info("hw_scan is disabled\n");
il3945_mac_ops.hw_scan = NULL;
}
ret = il3945_rate_control_register();
if (ret) {
pr_err("Unable to register rate control algorithm: %d\n", ret);
return ret;
}
ret = pci_register_driver(&il3945_driver);
if (ret) {
pr_err("Unable to initialize PCI module\n");
goto error_register;
}
return ret;
error_register:
il3945_rate_control_unregister();
return ret;
}
static void __exit
il3945_exit(void)
{
pci_unregister_driver(&il3945_driver);
il3945_rate_control_unregister();
}
MODULE_FIRMWARE(IL3945_MODULE_FIRMWARE(IL3945_UCODE_API_MAX));
module_param_named(antenna, il3945_mod_params.antenna, int, 0444);
MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])");
module_param_named(swcrypto, il3945_mod_params.sw_crypto, int, 0444);
MODULE_PARM_DESC(swcrypto, "using software crypto (default 1 [software])");
module_param_named(disable_hw_scan, il3945_mod_params.disable_hw_scan, int,
0444);
MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 1)");
#ifdef CONFIG_IWLEGACY_DEBUG
module_param_named(debug, il_debug_level, uint, 0644);
MODULE_PARM_DESC(debug, "debug output mask");
#endif
module_param_named(fw_restart, il3945_mod_params.restart_fw, int, 0444);
MODULE_PARM_DESC(fw_restart, "restart firmware in case of error");
module_exit(il3945_exit);
module_init(il3945_init);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/pci.h`, `linux/slab.h`, `linux/dma-mapping.h`, `linux/delay.h`, `linux/sched.h`.
- Detected declarations: `function il3945_get_antenna_flags`, `function il3945_set_ccmp_dynamic_key_info`, `function il3945_set_tkip_dynamic_key_info`, `function il3945_set_wep_dynamic_key_info`, `function il3945_clear_sta_key_info`, `function il3945_set_dynamic_key`, `function il3945_remove_static_key`, `function il3945_set_static_key`, `function il3945_clear_free_frames`, `function il3945_get_free_frame`.
- 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.