drivers/net/wireless/ti/wl18xx/cmd.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl18xx/cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wl18xx/cmd.c- Extension
.c- Size
- 5227 bytes
- Lines
- 243
- 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.
- 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
../wlcore/cmd.h../wlcore/debug.h../wlcore/hw_ops.hcmd.h
Detected Declarations
function Copyrightfunction wl18xx_cmd_smart_config_startfunction wl18xx_cmd_smart_config_stopfunction wl18xx_cmd_smart_config_set_group_keyfunction wl18xx_cmd_set_cacfunction wl18xx_cmd_radar_detection_debugfunction wl18xx_cmd_dfs_master_restart
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* This file is part of wl18xx
*
* Copyright (C) 2011 Texas Instruments Inc.
*/
#include "../wlcore/cmd.h"
#include "../wlcore/debug.h"
#include "../wlcore/hw_ops.h"
#include "cmd.h"
int wl18xx_cmd_channel_switch(struct wl1271 *wl,
struct wl12xx_vif *wlvif,
struct ieee80211_channel_switch *ch_switch)
{
struct wl18xx_cmd_channel_switch *cmd;
u32 supported_rates;
int ret;
wl1271_debug(DEBUG_ACX, "cmd channel switch (count=%d)",
ch_switch->count);
cmd = kzalloc_obj(*cmd);
if (!cmd) {
ret = -ENOMEM;
goto out;
}
cmd->role_id = wlvif->role_id;
cmd->channel = ch_switch->chandef.chan->hw_value;
cmd->switch_time = ch_switch->count;
cmd->stop_tx = ch_switch->block_tx;
switch (ch_switch->chandef.chan->band) {
case NL80211_BAND_2GHZ:
cmd->band = WLCORE_BAND_2_4GHZ;
break;
case NL80211_BAND_5GHZ:
cmd->band = WLCORE_BAND_5GHZ;
break;
default:
wl1271_error("invalid channel switch band: %d",
ch_switch->chandef.chan->band);
ret = -EINVAL;
goto out_free;
}
supported_rates = CONF_TX_ENABLED_RATES | CONF_TX_MCS_RATES;
if (wlvif->bss_type == BSS_TYPE_STA_BSS)
supported_rates |= wlcore_hw_sta_get_ap_rate_mask(wl, wlvif);
else
supported_rates |=
wlcore_hw_ap_get_mimo_wide_rate_mask(wl, wlvif);
if (wlvif->p2p)
supported_rates &= ~CONF_TX_CCK_RATES;
cmd->local_supported_rates = cpu_to_le32(supported_rates);
cmd->channel_type = wlvif->channel_type;
ret = wl1271_cmd_send(wl, CMD_CHANNEL_SWITCH, cmd, sizeof(*cmd), 0);
if (ret < 0) {
wl1271_error("failed to send channel switch command");
goto out_free;
}
out_free:
kfree(cmd);
out:
return ret;
}
int wl18xx_cmd_smart_config_start(struct wl1271 *wl, u32 group_bitmap)
{
struct wl18xx_cmd_smart_config_start *cmd;
int ret = 0;
wl1271_debug(DEBUG_CMD, "cmd smart config start group_bitmap=0x%x",
group_bitmap);
cmd = kzalloc_obj(*cmd);
if (!cmd) {
ret = -ENOMEM;
goto out;
}
cmd->group_id_bitmask = cpu_to_le32(group_bitmap);
ret = wl1271_cmd_send(wl, CMD_SMART_CONFIG_START, cmd, sizeof(*cmd), 0);
if (ret < 0) {
Annotation
- Immediate include surface: `../wlcore/cmd.h`, `../wlcore/debug.h`, `../wlcore/hw_ops.h`, `cmd.h`.
- Detected declarations: `function Copyright`, `function wl18xx_cmd_smart_config_start`, `function wl18xx_cmd_smart_config_stop`, `function wl18xx_cmd_smart_config_set_group_key`, `function wl18xx_cmd_set_cac`, `function wl18xx_cmd_radar_detection_debug`, `function wl18xx_cmd_dfs_master_restart`.
- 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.