drivers/net/wireless/ath/ath10k/qmi.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/qmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/qmi.c- Extension
.c- Size
- 29473 bytes
- Lines
- 1148
- 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/completion.hlinux/device.hlinux/debugfs.hlinux/idr.hlinux/kernel.hlinux/of.hlinux/of_address.hlinux/module.hlinux/net.hlinux/platform_device.hlinux/firmware/qcom/qcom_scm.hlinux/soc/qcom/smem.hlinux/string.hnet/sock.hdebug.hsnoc.h
Detected Declarations
function Copyrightfunction ath10k_qmi_unmap_msa_permissionfunction ath10k_qmi_setup_msa_permissionsfunction ath10k_qmi_remove_msa_permissionfunction ath10k_qmi_msa_mem_info_send_sync_msgfunction ath10k_qmi_msa_ready_send_sync_msgfunction ath10k_qmi_bdf_dnld_send_syncfunction ath10k_qmi_send_cal_report_reqfunction ath10k_qmi_mode_send_sync_msgfunction ath10k_qmi_cfg_send_sync_msgfunction ath10k_qmi_wlan_enablefunction ath10k_qmi_wlan_disablefunction ath10k_qmi_add_wlan_ver_smemfunction ath10k_qmi_cap_send_sync_msgfunction ath10k_qmi_host_cap_send_syncfunction ath10k_qmi_set_fw_log_modefunction ath10k_qmi_ind_register_send_sync_msgfunction ath10k_qmi_event_server_arrivefunction ath10k_qmi_fetch_board_filefunction ath10k_qmi_driver_event_postfunction ath10k_qmi_event_server_exitfunction ath10k_qmi_event_msa_readyfunction ath10k_qmi_event_fw_ready_indfunction ath10k_qmi_fw_ready_indfunction ath10k_qmi_msa_ready_indfunction ath10k_qmi_new_serverfunction ath10k_qmi_del_serverfunction ath10k_qmi_driver_event_workfunction ath10k_qmi_initfunction ath10k_qmi_deinit
Annotated Snippet
if (remaining > QMI_WLFW_MAX_DATA_SIZE_V01) {
req->data_len = QMI_WLFW_MAX_DATA_SIZE_V01;
} else {
req->data_len = remaining;
req->end = 1;
}
memcpy(req->data, temp, req->data_len);
ret = qmi_txn_init(&qmi->qmi_hdl, &txn,
wlfw_bdf_download_resp_msg_v01_ei,
&resp);
if (ret < 0)
goto out;
ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn,
QMI_WLFW_BDF_DOWNLOAD_REQ_V01,
WLFW_BDF_DOWNLOAD_REQ_MSG_V01_MAX_MSG_LEN,
wlfw_bdf_download_req_msg_v01_ei, req);
if (ret < 0) {
qmi_txn_cancel(&txn);
goto out;
}
ret = qmi_txn_wait(&txn, ATH10K_QMI_TIMEOUT * HZ);
if (ret < 0)
goto out;
/* end = 1 triggers a CRC check on the BDF. If this fails, we
* get a QMI_ERR_MALFORMED_MSG_V01 error, but the FW is still
* willing to use the BDF. For some platforms, all the valid
* released BDFs fail this CRC check, so attempt to detect this
* scenario and treat it as non-fatal.
*/
if (resp.resp.result != QMI_RESULT_SUCCESS_V01 &&
!(req->end == 1 &&
resp.resp.result == QMI_ERR_MALFORMED_MSG_V01)) {
ath10k_err(ar, "failed to download board data file: %d\n",
resp.resp.error);
ret = -EINVAL;
goto out;
}
remaining -= req->data_len;
temp += req->data_len;
req->seg_id++;
}
ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi bdf download request completed\n");
kfree(req);
return 0;
out:
kfree(req);
return ret;
}
static int ath10k_qmi_send_cal_report_req(struct ath10k_qmi *qmi)
{
struct wlfw_cal_report_resp_msg_v01 resp = {};
struct wlfw_cal_report_req_msg_v01 req = {};
struct ath10k *ar = qmi->ar;
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
struct qmi_txn txn;
int i, j = 0;
int ret;
if (ar_snoc->xo_cal_supported) {
req.xo_cal_data_valid = 1;
req.xo_cal_data = ar_snoc->xo_cal_data;
}
ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_cal_report_resp_msg_v01_ei,
&resp);
if (ret < 0)
goto out;
for (i = 0; i < QMI_WLFW_MAX_NUM_CAL_V01; i++) {
if (qmi->cal_data[i].total_size &&
qmi->cal_data[i].data) {
req.meta_data[j] = qmi->cal_data[i].cal_id;
j++;
}
}
req.meta_data_len = j;
ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn,
QMI_WLFW_CAL_REPORT_REQ_V01,
Annotation
- Immediate include surface: `linux/completion.h`, `linux/device.h`, `linux/debugfs.h`, `linux/idr.h`, `linux/kernel.h`, `linux/of.h`, `linux/of_address.h`, `linux/module.h`.
- Detected declarations: `function Copyright`, `function ath10k_qmi_unmap_msa_permission`, `function ath10k_qmi_setup_msa_permissions`, `function ath10k_qmi_remove_msa_permission`, `function ath10k_qmi_msa_mem_info_send_sync_msg`, `function ath10k_qmi_msa_ready_send_sync_msg`, `function ath10k_qmi_bdf_dnld_send_sync`, `function ath10k_qmi_send_cal_report_req`, `function ath10k_qmi_mode_send_sync_msg`, `function ath10k_qmi_cfg_send_sync_msg`.
- 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.