drivers/soc/qcom/wcnss_ctrl.c
Source file repositories/reference/linux-study-clean/drivers/soc/qcom/wcnss_ctrl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/qcom/wcnss_ctrl.c- Extension
.c- Size
- 8776 bytes
- Lines
- 369
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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.
- 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/cleanup.hlinux/firmware.hlinux/module.hlinux/slab.hlinux/io.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/rpmsg.hlinux/soc/qcom/wcnss_ctrl.h
Detected Declarations
struct wcnss_ctrlstruct wcnss_msg_hdrstruct wcnss_version_respstruct wcnss_download_nv_reqstruct wcnss_download_nv_respfunction wcnss_ctrl_smd_callbackfunction wcnss_request_versionfunction wcnss_download_nvfunction qcom_wcnss_open_channelfunction wcnss_async_probefunction wcnss_ctrl_probefunction wcnss_ctrl_removeexport qcom_wcnss_open_channel
Annotated Snippet
struct wcnss_ctrl {
struct device *dev;
struct rpmsg_endpoint *channel;
struct completion ack;
struct completion cbc;
int ack_status;
struct work_struct probe_work;
};
/* message types */
enum {
WCNSS_VERSION_REQ = 0x01000000,
WCNSS_VERSION_RESP,
WCNSS_DOWNLOAD_NV_REQ,
WCNSS_DOWNLOAD_NV_RESP,
WCNSS_UPLOAD_CAL_REQ,
WCNSS_UPLOAD_CAL_RESP,
WCNSS_DOWNLOAD_CAL_REQ,
WCNSS_DOWNLOAD_CAL_RESP,
WCNSS_VBAT_LEVEL_IND,
WCNSS_BUILD_VERSION_REQ,
WCNSS_BUILD_VERSION_RESP,
WCNSS_PM_CONFIG_REQ,
WCNSS_CBC_COMPLETE_IND,
};
/**
* struct wcnss_msg_hdr - common packet header for requests and responses
* @type: packet message type
* @len: total length of the packet, including this header
*/
struct wcnss_msg_hdr {
u32 type;
u32 len;
} __packed;
/*
* struct wcnss_version_resp - version request response
*/
struct wcnss_version_resp {
struct wcnss_msg_hdr hdr;
u8 major;
u8 minor;
u8 version;
u8 revision;
} __packed;
/**
* struct wcnss_download_nv_req - firmware fragment request
* @hdr: common packet wcnss_msg_hdr header
* @seq: sequence number of this fragment
* @last: boolean indicator of this being the last fragment of the binary
* @frag_size: length of this fragment
* @fragment: fragment data
*/
struct wcnss_download_nv_req {
struct wcnss_msg_hdr hdr;
u16 seq;
u16 last;
u32 frag_size;
u8 fragment[] __counted_by(frag_size);
} __packed;
/**
* struct wcnss_download_nv_resp - firmware download response
* @hdr: common packet wcnss_msg_hdr header
* @status: boolean to indicate success of the download
*/
struct wcnss_download_nv_resp {
struct wcnss_msg_hdr hdr;
u8 status;
} __packed;
/**
* wcnss_ctrl_smd_callback() - handler from SMD responses
* @rpdev: remote processor message device pointer
* @data: pointer to the incoming data packet
* @count: size of the incoming data packet
* @priv: unused
* @addr: unused
*
* Handles any incoming packets from the remote WCNSS_CTRL service.
*/
static int wcnss_ctrl_smd_callback(struct rpmsg_device *rpdev,
void *data,
int count,
void *priv,
u32 addr)
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/firmware.h`, `linux/module.h`, `linux/slab.h`, `linux/io.h`, `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`.
- Detected declarations: `struct wcnss_ctrl`, `struct wcnss_msg_hdr`, `struct wcnss_version_resp`, `struct wcnss_download_nv_req`, `struct wcnss_download_nv_resp`, `function wcnss_ctrl_smd_callback`, `function wcnss_request_version`, `function wcnss_download_nv`, `function qcom_wcnss_open_channel`, `function wcnss_async_probe`.
- Atlas domain: Driver Families / drivers/soc.
- Implementation status: integration 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.