drivers/net/wireless/ti/wl18xx/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl18xx/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wl18xx/main.c- Extension
.c- Size
- 65073 bytes
- Lines
- 2160
- 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.
- 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/ip.hlinux/firmware.hlinux/etherdevice.hlinux/irq.h../wlcore/wlcore.h../wlcore/debug.h../wlcore/io.h../wlcore/acx.h../wlcore/tx.h../wlcore/rx.h../wlcore/boot.hreg.hconf.hcmd.hacx.htx.hwl18xx.hio.hscan.hevent.hdebugfs.h
Detected Declarations
enum wl18xx_hw_ratesfunction wl18xx_identify_chipfunction wl18xx_set_clkfunction wl18xx_boot_soft_resetfunction wl18xx_pre_bootfunction wl18xx_pre_uploadfunction wl18xx_set_mac_and_phyfunction wl18xx_enable_interruptsfunction wl18xx_bootfunction wl18xx_trigger_cmdfunction wl18xx_ack_eventfunction wl18xx_calc_tx_blocksfunction wl18xx_set_tx_desc_blocksfunction wl18xx_set_tx_desc_data_lenfunction wl18xx_get_rx_buf_alignfunction wl18xx_get_rx_packet_lenfunction wl18xx_tx_immediate_completionfunction wl18xx_set_host_cfg_bitmapfunction wl18xx_hw_initfunction wl18xx_convert_fw_status_8_9_1function wl18xx_convert_fw_status_8_9_0function wl18xx_convert_fw_statusfunction wl18xx_set_tx_desc_csumfunction wl18xx_set_rx_csumfunction wl18xx_is_mimo_supportedfunction wl18xx_sta_get_ap_rate_maskfunction wl18xx_ap_get_mimo_wide_rate_maskfunction wl18xx_get_pg_verfunction wl18xx_load_conf_filefunction wl18xx_conf_initfunction wl18xx_plt_initfunction wl18xx_get_macfunction wl18xx_handle_static_datafunction wl18xx_get_spare_blocksfunction wl18xx_set_keyfunction wl18xx_pre_pkt_sendfunction wl18xx_sta_rc_updatefunction wl18xx_set_peer_capfunction wl18xx_lnk_high_priofunction wl18xx_lnk_low_priofunction wl18xx_convert_hwaddrfunction wl18xx_setupfunction wl18xx_probe
Annotated Snippet
if (cmd == SET_KEY) {
/* first key */
change_spare = (priv->extra_spare_key_count == 0);
priv->extra_spare_key_count++;
} else if (cmd == DISABLE_KEY) {
/* last key */
change_spare = (priv->extra_spare_key_count == 1);
priv->extra_spare_key_count--;
}
}
wl1271_debug(DEBUG_CRYPT, "extra spare keys after: %d",
priv->extra_spare_key_count);
if (!change_spare)
goto out;
/* key is now set, change the spare blocks */
if (priv->extra_spare_key_count)
ret = wl18xx_set_host_cfg_bitmap(wl,
WL18XX_TX_HW_EXTRA_BLOCK_SPARE);
else
ret = wl18xx_set_host_cfg_bitmap(wl,
WL18XX_TX_HW_BLOCK_SPARE);
out:
return ret;
}
static u32 wl18xx_pre_pkt_send(struct wl1271 *wl,
u32 buf_offset, u32 last_len)
{
if (wl->quirks & WLCORE_QUIRK_TX_PAD_LAST_FRAME) {
struct wl1271_tx_hw_descr *last_desc;
/* get the last TX HW descriptor written to the aggr buf */
last_desc = (struct wl1271_tx_hw_descr *)(wl->aggr_buf +
buf_offset - last_len);
/* the last frame is padded up to an SDIO block */
last_desc->wl18xx_mem.ctrl &= ~WL18XX_TX_CTRL_NOT_PADDED;
return ALIGN(buf_offset, WL12XX_BUS_BLOCK_SIZE);
}
/* no modifications */
return buf_offset;
}
static void wl18xx_sta_rc_update(struct wl1271 *wl,
struct wl12xx_vif *wlvif)
{
bool wide = wlvif->rc_update_bw >= IEEE80211_STA_RX_BW_40;
wl1271_debug(DEBUG_MAC80211, "mac80211 sta_rc_update wide %d", wide);
/* sanity */
if (WARN_ON(wlvif->bss_type != BSS_TYPE_STA_BSS))
return;
/* ignore the change before association */
if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
return;
/*
* If we started out as wide, we can change the operation mode. If we
* thought this was a 20mhz AP, we have to reconnect
*/
if (wlvif->sta.role_chan_type == NL80211_CHAN_HT40MINUS ||
wlvif->sta.role_chan_type == NL80211_CHAN_HT40PLUS)
wl18xx_acx_peer_ht_operation_mode(wl, wlvif->sta.hlid, wide);
else
ieee80211_connection_loss(wl12xx_wlvif_to_vif(wlvif));
}
static int wl18xx_set_peer_cap(struct wl1271 *wl,
struct ieee80211_sta_ht_cap *ht_cap,
bool allow_ht_operation,
u32 rate_set, u8 hlid)
{
return wl18xx_acx_set_peer_cap(wl, ht_cap, allow_ht_operation,
rate_set, hlid);
}
static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
struct wl1271_link *lnk)
{
u8 thold;
struct wl18xx_fw_status_priv *status_priv =
(struct wl18xx_fw_status_priv *)wl->fw_status->priv;
unsigned long suspend_bitmap;
Annotation
- Immediate include surface: `linux/module.h`, `linux/mod_devicetable.h`, `linux/platform_device.h`, `linux/ip.h`, `linux/firmware.h`, `linux/etherdevice.h`, `linux/irq.h`, `../wlcore/wlcore.h`.
- Detected declarations: `enum wl18xx_hw_rates`, `function wl18xx_identify_chip`, `function wl18xx_set_clk`, `function wl18xx_boot_soft_reset`, `function wl18xx_pre_boot`, `function wl18xx_pre_upload`, `function wl18xx_set_mac_and_phy`, `function wl18xx_enable_interrupts`, `function wl18xx_boot`, `function wl18xx_trigger_cmd`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.