cnss2: Send QMI message to download TME-L patch
Send QMI message with TME-L patch information to WLAN FW, to download TME-L patch. Change-Id: Ieae07c0f761ada45ffcb990b1412654b9c6862b1 CRs-Fixed: 3521187
This commit is contained in:

committad av
Rahul Choudhary

förälder
2ec2768bfc
incheckning
bdd3c6bf67
81
cnss2/qmi.c
81
cnss2/qmi.c
@@ -1017,6 +1017,87 @@ err_req_fw:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cnss_wlfw_tme_patch_dnld_send_sync(struct cnss_plat_data *plat_priv,
|
||||
enum wlfw_tme_lite_file_type_v01 file)
|
||||
{
|
||||
struct wlfw_tme_lite_info_req_msg_v01 *req;
|
||||
struct wlfw_tme_lite_info_resp_msg_v01 *resp;
|
||||
struct qmi_txn txn;
|
||||
struct cnss_fw_mem *tme_lite_mem = &plat_priv->tme_lite_mem;
|
||||
int ret = 0;
|
||||
|
||||
cnss_pr_dbg("Sending TME patch information message, state: 0x%lx\n",
|
||||
plat_priv->driver_state);
|
||||
|
||||
if (plat_priv->device_id != PEACH_DEVICE_ID)
|
||||
return 0;
|
||||
|
||||
req = kzalloc(sizeof(*req), GFP_KERNEL);
|
||||
if (!req)
|
||||
return -ENOMEM;
|
||||
|
||||
resp = kzalloc(sizeof(*resp), GFP_KERNEL);
|
||||
if (!resp) {
|
||||
kfree(req);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (!tme_lite_mem->pa || !tme_lite_mem->size) {
|
||||
cnss_pr_err("Memory for TME patch is not available\n");
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
cnss_pr_dbg("TME-L patch memory, va: 0x%pK, pa: %pa, size: 0x%zx\n",
|
||||
tme_lite_mem->va, &tme_lite_mem->pa, tme_lite_mem->size);
|
||||
|
||||
req->tme_file = file;
|
||||
req->addr = plat_priv->tme_lite_mem.pa;
|
||||
req->size = plat_priv->tme_lite_mem.size;
|
||||
|
||||
ret = qmi_txn_init(&plat_priv->qmi_wlfw, &txn,
|
||||
wlfw_tme_lite_info_resp_msg_v01_ei, resp);
|
||||
if (ret < 0) {
|
||||
cnss_pr_err("Failed to initialize txn for TME patch information request, err: %d\n",
|
||||
ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = qmi_send_request(&plat_priv->qmi_wlfw, NULL, &txn,
|
||||
QMI_WLFW_TME_LITE_INFO_REQ_V01,
|
||||
WLFW_TME_LITE_INFO_REQ_MSG_V01_MAX_MSG_LEN,
|
||||
wlfw_tme_lite_info_req_msg_v01_ei, req);
|
||||
if (ret < 0) {
|
||||
qmi_txn_cancel(&txn);
|
||||
cnss_pr_err("Failed to send TME patch information request, err: %d\n",
|
||||
ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = qmi_txn_wait(&txn, QMI_WLFW_TIMEOUT_JF);
|
||||
if (ret < 0) {
|
||||
cnss_pr_err("Failed to wait for response of TME patch information request, err: %d\n",
|
||||
ret);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (resp->resp.result != QMI_RESULT_SUCCESS_V01) {
|
||||
cnss_pr_err("TME patch information request failed, result: %d, err: %d\n",
|
||||
resp->resp.result, resp->resp.error);
|
||||
ret = -resp->resp.result;
|
||||
goto out;
|
||||
}
|
||||
|
||||
kfree(req);
|
||||
kfree(resp);
|
||||
return 0;
|
||||
|
||||
out:
|
||||
kfree(req);
|
||||
kfree(resp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cnss_wlfw_m3_dnld_send_sync(struct cnss_plat_data *plat_priv)
|
||||
{
|
||||
struct wlfw_m3_info_req_msg_v01 *req;
|
||||
|
Referens i nytt ärende
Block a user