drivers/net/wireless/ti/wlcore/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wlcore/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wlcore/main.c- Extension
.c- Size
- 174546 bytes
- Lines
- 6862
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/firmware.hlinux/etherdevice.hlinux/vmalloc.hlinux/interrupt.hlinux/irq.hlinux/pm_runtime.hlinux/pm_wakeirq.hwlcore.hdebug.hwl12xx_80211.hio.htx.hps.hinit.hdebugfs.htestmode.hvendor_cmd.hscan.hhw_ops.hsysfs.h
Detected Declarations
struct vif_counter_datastruct wlcore_hw_queue_iter_datastruct wl1271_filter_paramsfunction wl12xx_set_authorizedfunction wl1271_reg_notifyfunction wl1271_set_rx_streamingfunction wl1271_recalc_rx_streamingfunction wl1271_rx_streaming_enable_workfunction wl1271_rx_streaming_disable_workfunction wl1271_rx_streaming_timerfunction wl12xx_rearm_tx_watchdog_lockedfunction wlcore_rc_update_workfunction wl12xx_tx_watchdog_workfunction timefunction wlcore_adjust_conffunction wl12xx_irq_ps_regulate_linkfunction wl12xx_irq_update_links_statusfunction wlcore_fw_statusfunction for_each_set_bitfunction wl1271_flush_deferred_workfunction wl1271_netstack_workfunction wlcore_irq_lockedfunction wlcore_irqfunction wl12xx_vif_count_iterfunction wl12xx_get_vif_countfunction wl12xx_fetch_firmwarefunction wl12xx_queue_recovery_workfunction wl12xx_copy_fwlogfunction wl12xx_read_fwlog_panicfunction wlcore_save_freed_pktsfunction wlcore_save_freed_pkts_addrfunction wlcore_print_recoveryfunction wl1271_recovery_workfunction wlcore_fw_wakeupfunction wl1271_setupfunction wl12xx_set_power_onfunction wl12xx_chip_wakeupfunction wl1271_plt_startfunction wl1271_plt_stopfunction wl1271_op_txfunction wl1271_tx_dummy_packetfunction wl1271_validate_wowlan_patternfunction wl1271_rx_filter_freefunction wl1271_rx_filter_alloc_fieldfunction wl1271_rx_filter_get_fields_sizefunction wl1271_rx_filter_flatten_fieldsfunction rx_filter_freefunction wl1271_configure_wowlan
Annotated Snippet
struct vif_counter_data {
u8 counter;
struct ieee80211_vif *cur_vif;
bool cur_vif_running;
};
static void wl12xx_vif_count_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct vif_counter_data *counter = data;
counter->counter++;
if (counter->cur_vif == vif)
counter->cur_vif_running = true;
}
/* caller must not hold wl->mutex, as it might deadlock */
static void wl12xx_get_vif_count(struct ieee80211_hw *hw,
struct ieee80211_vif *cur_vif,
struct vif_counter_data *data)
{
memset(data, 0, sizeof(*data));
data->cur_vif = cur_vif;
ieee80211_iterate_active_interfaces(hw, IEEE80211_IFACE_ITER_RESUME_ALL,
wl12xx_vif_count_iter, data);
}
static int wl12xx_fetch_firmware(struct wl1271 *wl, bool plt)
{
const struct firmware *fw;
const char *fw_name;
enum wl12xx_fw_type fw_type;
int ret;
if (plt) {
fw_type = WL12XX_FW_TYPE_PLT;
fw_name = wl->plt_fw_name;
} else {
/*
* we can't call wl12xx_get_vif_count() here because
* wl->mutex is taken, so use the cached last_vif_count value
*/
if (wl->last_vif_count > 1 && wl->mr_fw_name) {
fw_type = WL12XX_FW_TYPE_MULTI;
fw_name = wl->mr_fw_name;
} else {
fw_type = WL12XX_FW_TYPE_NORMAL;
fw_name = wl->sr_fw_name;
}
}
if (wl->fw_type == fw_type)
return 0;
wl1271_debug(DEBUG_BOOT, "booting firmware %s", fw_name);
ret = request_firmware(&fw, fw_name, wl->dev);
if (ret < 0) {
wl1271_error("could not get firmware %s: %d", fw_name, ret);
return ret;
}
if (fw->size % 4) {
wl1271_error("firmware size is not multiple of 32 bits: %zu",
fw->size);
ret = -EILSEQ;
goto out;
}
vfree(wl->fw);
wl->fw_type = WL12XX_FW_TYPE_NONE;
wl->fw_len = fw->size;
wl->fw = vmalloc(wl->fw_len);
if (!wl->fw) {
wl1271_error("could not allocate memory for the firmware");
ret = -ENOMEM;
goto out;
}
memcpy(wl->fw, fw->data, wl->fw_len);
ret = 0;
wl->fw_type = fw_type;
out:
release_firmware(fw);
return ret;
Annotation
- Immediate include surface: `linux/module.h`, `linux/firmware.h`, `linux/etherdevice.h`, `linux/vmalloc.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/pm_runtime.h`, `linux/pm_wakeirq.h`.
- Detected declarations: `struct vif_counter_data`, `struct wlcore_hw_queue_iter_data`, `struct wl1271_filter_params`, `function wl12xx_set_authorized`, `function wl1271_reg_notify`, `function wl1271_set_rx_streaming`, `function wl1271_recalc_rx_streaming`, `function wl1271_rx_streaming_enable_work`, `function wl1271_rx_streaming_disable_work`, `function wl1271_rx_streaming_timer`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.