drivers/net/wireless/ath/ath12k/qmi.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/qmi.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/ath12k/qmi.c
Extension
.c
Size
104559 bytes
Lines
4096
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (partner_ab->device_id == ATH12K_INVALID_DEVICE_ID) {
			ath12k_err(ab, "failed to send MLO cap due to invalid partner device id\n");
			ret = -EINVAL;
			goto device_cleanup;
		}

		info->chip_id = partner_ab->device_id;
		info->num_local_links = partner_ab->qmi.num_radios;

		ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo device id %d num_link %d\n",
			   info->chip_id, info->num_local_links);

		for (j = 0; j < info->num_local_links; j++) {
			info->hw_link_id[j] = partner_ab->wsi_info.hw_link_id_base + j;
			info->valid_mlo_link_id[j] = 1;

			ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo hw_link_id %d\n",
				   info->hw_link_id[j]);

			hw_link_id++;
		}
	}

	if (hw_link_id <= 0)
		ag->mlo_capable = false;

	req->mlo_chip_info_valid = 1;

	mutex_unlock(&ag->mutex);

	return 0;

device_cleanup:
	for (i = i - 1; i >= 0; i--) {
		info = &req->mlo_chip_info[i];

		memset(info, 0, sizeof(*info));
	}

	req->mlo_num_chips = 0;
	req->mlo_num_chips_valid = 0;

	req->max_mlo_peer = 0;
	req->max_mlo_peer_valid = 0;
	req->mlo_group_id = 0;
	req->mlo_group_id_valid = 0;
	req->mlo_chip_id = 0;
	req->mlo_chip_id_valid = 0;
	req->mlo_capable = 0;
	req->mlo_capable_valid = 0;

	ag->mlo_capable = false;

	mutex_unlock(&ag->mutex);

	return ret;
}

/* clang stack usage explodes if this is inlined */
static noinline_for_stack
int ath12k_qmi_host_cap_send(struct ath12k_base *ab)
{
	struct qmi_wlanfw_host_cap_req_msg_v01 req = {};
	struct qmi_wlanfw_host_cap_resp_msg_v01 resp = {};
	struct qmi_txn txn;
	int ret = 0;

	req.num_clients_valid = 1;
	req.num_clients = 1;
	req.mem_cfg_mode = ab->qmi.target_mem_mode;
	req.mem_cfg_mode_valid = 1;
	req.bdf_support_valid = 1;
	req.bdf_support = 1;

	if (ab->hw_params->fw.m3_loader == ath12k_m3_fw_loader_driver) {
		req.m3_support_valid = 1;
		req.m3_support = 1;
		req.m3_cache_support_valid = 1;
		req.m3_cache_support = 1;
	}

	req.cal_done_valid = 1;
	req.cal_done = ab->qmi.cal_done;

	if (ab->hw_params->qmi_cnss_feature_bitmap) {
		req.feature_list_valid = 1;
		req.feature_list = ab->hw_params->qmi_cnss_feature_bitmap;
	}

	/* BRINGUP: here we are piggybacking a lot of stuff using

Annotation

Implementation Notes