drivers/net/wireless/ti/wl1251/cmd.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ti/wl1251/cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ti/wl1251/cmd.c- Extension
.c- Size
- 9606 bytes
- Lines
- 428
- 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
cmd.hlinux/module.hlinux/slab.hlinux/etherdevice.hwl1251.hreg.hio.hps.hacx.h
Detected Declarations
function wl1251_cmd_sendfunction wl1251_cmd_interrogatefunction wl1251_cmd_configurefunction wl1251_cmd_vbmfunction wl1251_cmd_data_path_rxfunction wl1251_cmd_data_path_txfunction wl1251_cmd_joinfunction wl1251_cmd_ps_modefunction wl1251_cmd_template_setfunction wl1251_cmd_scanfunction wl1251_cmd_trigger_scan_to
Annotated Snippet
if (time_after(jiffies, timeout)) {
wl1251_error("command complete timeout");
ret = -ETIMEDOUT;
goto out;
}
msleep(1);
intr = wl1251_reg_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
}
wl1251_reg_write32(wl, ACX_REG_INTERRUPT_ACK,
WL1251_ACX_INTR_CMD_COMPLETE);
out:
return ret;
}
/**
* wl1251_cmd_interrogate - Read acx from firmware
*
* @wl: wl struct
* @id: acx id
* @buf: buffer for the response, including all headers, must work with dma
* @len: length of buf
*/
int wl1251_cmd_interrogate(struct wl1251 *wl, u16 id, void *buf, size_t len)
{
struct acx_header *acx = buf;
int ret;
wl1251_debug(DEBUG_CMD, "cmd interrogate");
acx->id = id;
/* payload length, does not include any headers */
acx->len = len - sizeof(*acx);
ret = wl1251_cmd_send(wl, CMD_INTERROGATE, acx, sizeof(*acx));
if (ret < 0) {
wl1251_error("INTERROGATE command failed");
goto out;
}
/* the interrogate command got in, we can read the answer */
wl1251_mem_read(wl, wl->cmd_box_addr, buf, len);
acx = buf;
if (acx->cmd.status != CMD_STATUS_SUCCESS)
wl1251_error("INTERROGATE command error: %d",
acx->cmd.status);
out:
return ret;
}
/**
* wl1251_cmd_configure - Write acx value to firmware
*
* @wl: wl struct
* @id: acx id
* @buf: buffer containing acx, including all headers, must work with dma
* @len: length of buf
*/
int wl1251_cmd_configure(struct wl1251 *wl, u16 id, void *buf, size_t len)
{
struct acx_header *acx = buf;
int ret;
wl1251_debug(DEBUG_CMD, "cmd configure");
acx->id = id;
/* payload length, does not include any headers */
acx->len = len - sizeof(*acx);
ret = wl1251_cmd_send(wl, CMD_CONFIGURE, acx, len);
if (ret < 0) {
wl1251_warning("CONFIGURE command NOK");
return ret;
}
return 0;
}
int wl1251_cmd_vbm(struct wl1251 *wl, u8 identity,
void *bitmap, u16 bitmap_len, u8 bitmap_control)
{
struct wl1251_cmd_vbm_update *vbm;
int ret;
Annotation
- Immediate include surface: `cmd.h`, `linux/module.h`, `linux/slab.h`, `linux/etherdevice.h`, `wl1251.h`, `reg.h`, `io.h`, `ps.h`.
- Detected declarations: `function wl1251_cmd_send`, `function wl1251_cmd_interrogate`, `function wl1251_cmd_configure`, `function wl1251_cmd_vbm`, `function wl1251_cmd_data_path_rx`, `function wl1251_cmd_data_path_tx`, `function wl1251_cmd_join`, `function wl1251_cmd_ps_mode`, `function wl1251_cmd_template_set`, `function wl1251_cmd_scan`.
- 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.