drivers/net/wireless/ath/wcn36xx/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wcn36xx/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wcn36xx/main.c- Extension
.c- Size
- 47123 bytes
- Lines
- 1691
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/module.hlinux/firmware.hlinux/platform_device.hlinux/of.hlinux/of_address.hlinux/rpmsg.hlinux/soc/qcom/smem_state.hlinux/soc/qcom/wcnss_ctrl.hnet/ipv6.hwcn36xx.htestmode.hfirmware.h
Detected Declarations
function get_sta_indexfunction wcn36xx_feat_caps_infofunction wcn36xx_startfunction wcn36xx_stopfunction wcn36xx_change_psfunction list_for_each_entryfunction wcn36xx_change_opchannelfunction list_for_each_entryfunction wcn36xx_configfunction wcn36xx_configure_filterfunction wcn36xx_prepare_multicastfunction netdev_hw_addr_list_for_eachfunction wcn36xx_txfunction wcn36xx_set_keyfunction wcn36xx_hw_scanfunction wcn36xx_cancel_hw_scanfunction wcn36xx_sw_scan_startfunction wcn36xx_sw_scan_completefunction wcn36xx_update_allowed_ratesfunction wcn36xx_set_default_ratesfunction wcn36xx_set_default_rates_v1function wcn36xx_bss_info_changedfunction wcn36xx_set_rts_thresholdfunction wcn36xx_remove_interfacefunction wcn36xx_add_interfacefunction wcn36xx_sta_addfunction wcn36xx_sta_removefunction list_for_each_entryfunction wcn36xx_suspendfunction wcn36xx_resumefunction wcn36xx_set_rekey_datafunction wcn36xx_ampdu_actionfunction wcn36xx_ipv6_addr_changefunction wcn36xx_flushfunction wcn36xx_get_surveyfunction wcn36xx_sta_statisticsfunction wcn36xx_set_ieee80211_vht_capsfunction wcn36xx_init_ieee80211function wcn36xx_platform_get_resourcesfunction wcn36xx_probefunction wcn36xx_remove
Annotated Snippet
if (wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, i)) {
wcn36xx_dbg(WCN36XX_DBG_MAC, "FW Cap %s\n",
wcn36xx_firmware_get_cap_name(i));
}
}
}
static int wcn36xx_start(struct ieee80211_hw *hw)
{
struct wcn36xx *wcn = hw->priv;
int ret;
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac start\n");
/* SMD initialization */
ret = wcn36xx_smd_open(wcn);
if (ret) {
wcn36xx_err("Failed to open smd channel: %d\n", ret);
goto out_err;
}
/* Allocate memory pools for Mgmt BD headers and Data BD headers */
ret = wcn36xx_dxe_allocate_mem_pools(wcn);
if (ret) {
wcn36xx_err("Failed to alloc DXE mempool: %d\n", ret);
goto out_smd_close;
}
ret = wcn36xx_dxe_alloc_ctl_blks(wcn);
if (ret) {
wcn36xx_err("Failed to alloc DXE ctl blocks: %d\n", ret);
goto out_free_dxe_pool;
}
ret = wcn36xx_smd_load_nv(wcn);
if (ret) {
wcn36xx_err("Failed to push NV to chip\n");
goto out_free_dxe_ctl;
}
ret = wcn36xx_smd_start(wcn);
if (ret) {
wcn36xx_err("Failed to start chip\n");
goto out_free_dxe_ctl;
}
if (!wcn36xx_is_fw_version(wcn, 1, 2, 2, 24)) {
ret = wcn36xx_smd_feature_caps_exchange(wcn);
if (ret)
wcn36xx_warn("Exchange feature caps failed\n");
else
wcn36xx_feat_caps_info(wcn);
}
/* DMA channel initialization */
ret = wcn36xx_dxe_init(wcn);
if (ret) {
wcn36xx_err("DXE init failed\n");
goto out_smd_stop;
}
wcn36xx_debugfs_init(wcn);
INIT_LIST_HEAD(&wcn->vif_list);
spin_lock_init(&wcn->dxe_lock);
spin_lock_init(&wcn->survey_lock);
return 0;
out_smd_stop:
wcn36xx_smd_stop(wcn);
out_free_dxe_ctl:
wcn36xx_dxe_free_ctl_blks(wcn);
out_free_dxe_pool:
wcn36xx_dxe_free_mem_pools(wcn);
out_smd_close:
wcn36xx_smd_close(wcn);
out_err:
return ret;
}
static void wcn36xx_stop(struct ieee80211_hw *hw, bool suspend)
{
struct wcn36xx *wcn = hw->priv;
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac stop\n");
mutex_lock(&wcn->scan_lock);
if (wcn->scan_req) {
struct cfg80211_scan_info scan_info = {
Annotation
- Immediate include surface: `linux/module.h`, `linux/firmware.h`, `linux/platform_device.h`, `linux/of.h`, `linux/of_address.h`, `linux/rpmsg.h`, `linux/soc/qcom/smem_state.h`, `linux/soc/qcom/wcnss_ctrl.h`.
- Detected declarations: `function get_sta_index`, `function wcn36xx_feat_caps_info`, `function wcn36xx_start`, `function wcn36xx_stop`, `function wcn36xx_change_ps`, `function list_for_each_entry`, `function wcn36xx_change_opchannel`, `function list_for_each_entry`, `function wcn36xx_config`, `function wcn36xx_configure_filter`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.