drivers/net/wireless/ti/wl12xx/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl12xx/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wl12xx/main.c- Extension
.c- Size
- 54389 bytes
- Lines
- 1967
- 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/mod_devicetable.hlinux/platform_device.hlinux/err.h../wlcore/wlcore.h../wlcore/debug.h../wlcore/io.h../wlcore/acx.h../wlcore/tx.h../wlcore/rx.h../wlcore/boot.hwl12xx.hreg.hcmd.hacx.hscan.hevent.hdebugfs.hconf.h
Detected Declarations
enum wl12xx_hw_ratesfunction wl127x_prepare_readfunction wl12xx_identify_chipfunction wl12xx_top_reg_writefunction wl12xx_top_reg_readfunction wl128x_switch_tcxo_to_freffunction wl128x_is_tcxo_validfunction wl128x_is_fref_validfunction wl128x_manually_configure_mcs_pllfunction wl128x_configure_mcs_pllfunction wl128x_boot_clkfunction wl127x_boot_clkfunction wl1271_boot_soft_resetfunction wl12xx_pre_bootfunction wl12xx_pre_uploadfunction wl12xx_enable_interruptsfunction wl12xx_bootfunction wl12xx_trigger_cmdfunction wl12xx_ack_eventfunction wl12xx_calc_tx_blocksfunction wl12xx_set_tx_desc_blocksfunction wl12xx_set_tx_desc_data_lenfunction wl12xx_get_rx_buf_alignfunction wl12xx_get_rx_packet_lenfunction wl12xx_tx_delayed_complfunction wl12xx_hw_initfunction wl12xx_convert_fw_statusfunction wl12xx_sta_get_ap_rate_maskfunction wl12xx_conf_initfunction wl12xx_mac_in_fusefunction wl12xx_get_fuse_macfunction wl12xx_get_pg_verfunction wl12xx_get_macfunction wl12xx_set_tx_desc_csumfunction wl12xx_plt_initfunction wl12xx_get_spare_blocksfunction wl12xx_set_keyfunction wl12xx_set_peer_capfunction wl12xx_lnk_high_priofunction wl12xx_lnk_low_priofunction wl12xx_convert_hwaddrfunction wl12xx_get_clock_idxfunction wl12xx_setupfunction wl12xx_probefunction wl12xx_remove
Annotated Snippet
if (time_after(jiffies, timeout)) {
/* 1.2 check pWhalBus->uSelfClearTime if the
* timeout was reached */
wl1271_error("soft reset timeout");
return -1;
}
udelay(SOFT_RESET_STALL_TIME);
}
/* disable Rx/Tx */
ret = wlcore_write32(wl, WL12XX_ENABLE, 0x0);
if (ret < 0)
goto out;
/* disable auto calibration on start*/
ret = wlcore_write32(wl, WL12XX_SPARE_A2, 0xffff);
out:
return ret;
}
static int wl12xx_pre_boot(struct wl1271 *wl)
{
struct wl12xx_priv *priv = wl->priv;
int ret = 0;
u32 clk;
int selected_clock = -1;
if (wl->chip.id == CHIP_ID_128X_PG20) {
ret = wl128x_boot_clk(wl, &selected_clock);
if (ret < 0)
goto out;
} else {
ret = wl127x_boot_clk(wl);
if (ret < 0)
goto out;
}
/* Continue the ELP wake up sequence */
ret = wlcore_write32(wl, WL12XX_WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL);
if (ret < 0)
goto out;
udelay(500);
ret = wlcore_set_partition(wl, &wl->ptable[PART_DRPW]);
if (ret < 0)
goto out;
/* Read-modify-write DRPW_SCRATCH_START register (see next state)
to be used by DRPw FW. The RTRIM value will be added by the FW
before taking DRPw out of reset */
ret = wlcore_read32(wl, WL12XX_DRPW_SCRATCH_START, &clk);
if (ret < 0)
goto out;
wl1271_debug(DEBUG_BOOT, "clk2 0x%x", clk);
if (wl->chip.id == CHIP_ID_128X_PG20)
clk |= ((selected_clock & 0x3) << 1) << 4;
else
clk |= (priv->ref_clock << 1) << 4;
ret = wlcore_write32(wl, WL12XX_DRPW_SCRATCH_START, clk);
if (ret < 0)
goto out;
ret = wlcore_set_partition(wl, &wl->ptable[PART_WORK]);
if (ret < 0)
goto out;
/* Disable interrupts */
ret = wlcore_write_reg(wl, REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL);
if (ret < 0)
goto out;
ret = wl1271_boot_soft_reset(wl);
if (ret < 0)
goto out;
out:
return ret;
}
static int wl12xx_pre_upload(struct wl1271 *wl)
{
u32 tmp;
u16 polarity;
Annotation
- Immediate include surface: `linux/module.h`, `linux/mod_devicetable.h`, `linux/platform_device.h`, `linux/err.h`, `../wlcore/wlcore.h`, `../wlcore/debug.h`, `../wlcore/io.h`, `../wlcore/acx.h`.
- Detected declarations: `enum wl12xx_hw_rates`, `function wl127x_prepare_read`, `function wl12xx_identify_chip`, `function wl12xx_top_reg_write`, `function wl12xx_top_reg_read`, `function wl128x_switch_tcxo_to_fref`, `function wl128x_is_tcxo_valid`, `function wl128x_is_fref_valid`, `function wl128x_manually_configure_mcs_pll`, `function wl128x_configure_mcs_pll`.
- 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.