From patchwork Wed May 8 11:39:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anilkumar Kolli X-Patchwork-Id: 10935517 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E95CB13AD for ; Wed, 8 May 2019 11:40:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF7BF205C0 for ; Wed, 8 May 2019 11:40:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD311283C3; Wed, 8 May 2019 11:40:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 113E8205C0 for ; Wed, 8 May 2019 11:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WGD1BbUMd0Sq9W5dj83JkfgkHOLQ2pikjFfhEY+Txdw=; b=cVGtMmEqkpSDBq AzBNe8ptMTIMaoTyLuQ5/sHjUkTzexiZany705V3wkSci7DdJlPG5k8RFDqm/ywu8LYoCzBUp/149 0jd/XH+uf2h0asKEdjG1ba1n2IWRVboSTryi2ixBCx3k4D6CJSYmNq1/bG4grkMQ4z3Emi4LBopXD UeOJzRkz3jpAhpmJ38t9fC2a69FUnKvOz27YHFQCyF7nzlF/fbI3z5e9k8cvILTUrjEkDspRKQQj3 yfaF0T0yMVkO54de3JrwHCUAbp7zKli0n127YtalNJxcLLrnZCiBMACU7Gm0nFAI1snAQ2fpHHejs XNz3IX3BGHcR9RSSN2lQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOKvk-0001jN-5L; Wed, 08 May 2019 11:40:12 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOKvh-0001iT-5g for ath11k@lists.infradead.org; Wed, 08 May 2019 11:40:10 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 21F2761359; Wed, 8 May 2019 11:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557315608; bh=BnFcdGe469Ho/VMUuRzZIWTKN2ar5njL9ZqcfOvFHII=; h=From:To:Cc:Subject:Date:From; b=NdrvnDLV2tm9Zc9/uxVzdPA4TD8Ve8QLVGyWgfBLDZZh3FI0VOXZPQxcO19b4oWY1 mp4Cf5bYdBDu59DaQBJ2frdJqPNgC9mCm+eX36e7Ma7hYmbxHRY1LHUgqHzDboV6LW XLfyMtzXSjjKSpnpnc/nsOaC5cxA5tYF9CeQHW9s= Received: from localhost (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: akolli@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D7EC161515; Wed, 8 May 2019 11:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1557315606; bh=BnFcdGe469Ho/VMUuRzZIWTKN2ar5njL9ZqcfOvFHII=; h=From:To:Cc:Subject:Date:From; b=BYWgASlOBuazOdu+6DNmZ/s4kpm++mG6zyMhGsFJu8WRTmeDyrWz2X3/rYf3Th0FK ewvsNM0Of5v2VJXO/U1DejDAtButuGmuYfGE+yyVEzIR6r6PKB+kdzpOnyNMdgBYeo 3xXZQShvnzTFgdGlNCSLhv2IZJ4NR4rNHdEzXm8o= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D7EC161515 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=akolli@codeaurora.org From: Anilkumar Kolli To: ath11k@lists.infradead.org Subject: [PATCH v2] ath11k: clean up in qmi source files Date: Wed, 8 May 2019 17:09:39 +0530 Message-Id: <1557315579-20508-1-git-send-email-akolli@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190508_044009_255917_B7C92AA0 X-CRM114-Status: GOOD ( 14.49 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Fix coding style, Remove unused variable. Signed-off-by: Anilkumar Kolli --- V2: - Rebased on latest tree drivers/net/wireless/ath/ath11k/qmi.c | 36 +++++++++--------------- drivers/net/wireless/ath/ath11k/qmi.h | 53 ++++++++++++++++------------------- 2 files changed, 37 insertions(+), 52 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c index b862fa93bba8..cd1f5bc614fd 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c @@ -312,7 +312,7 @@ .array_type = NO_ARRAY, .tlv_type = 0x11, .offset = offsetof(struct qmi_wlanfw_ind_register_req_msg_v01, - initiate_cal_download_enable), + initiate_cal_download_enable), }, { .data_type = QMI_OPT_FLAG, @@ -570,7 +570,6 @@ struct qmi_elem_info qmi_wlanfw_ind_register_resp_msg_v01_ei[] = { }, }; - static struct qmi_elem_info qmi_wlanfw_mem_seg_s_v01_ei[] = { { .data_type = QMI_UNSIGNED_4_BYTE, @@ -1643,12 +1642,6 @@ static int ath11k_qmi_respond_fw_mem_request(struct ath11k_base *ab) goto out; for (i = 0; i < req->mem_seg_len ; i++) { - if (!ab->qmi.target_mem[i].paddr || !ab->qmi.target_mem[i].size) { - ath11k_warn(ab, "qmi invalid mem request for target\n"); - ret = -EINVAL; - goto out; - } - req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr; req->mem_seg[i].size = ab->qmi.target_mem[i].size; req->mem_seg[i].type = ab->qmi.target_mem[i].type; @@ -1688,8 +1681,8 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) int i, idx, mode = ab->qmi.target_mem_mode; if (of_property_read_u32_array(dev->of_node, "qcom,bdf-addr", - &bdf_location[0], - ARRAY_SIZE(bdf_location))) { + &bdf_location[0], + ARRAY_SIZE(bdf_location))) { ath11k_warn(ab, "qmi no bdf_addr in device_tree\n"); return -EINVAL; } @@ -1708,17 +1701,16 @@ static int ath11k_qmi_alloc_target_mem_chunk(struct ath11k_base *ab) ath11k_warn(ab, "qmi mem size is low to load caldata\n"); return -EINVAL; } - ab->qmi.target_mem[idx].paddr = - bdf_location[mode] + ATH11K_QMI_CALDATA_OFFSET; - ab->qmi.target_mem[idx].vaddr = - bdf_location[mode] + ATH11K_QMI_CALDATA_OFFSET; + /* TODO ath11k does not support cold boot calibration */ + ab->qmi.target_mem[idx].paddr = 0; + ab->qmi.target_mem[idx].vaddr = 0; ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; idx++; break; default: ath11k_warn(ab, "qmi ignore invalid mem req type %d\n", - ab->qmi.target_mem[i].type); + ab->qmi.target_mem[i].type); break; } } @@ -1791,7 +1783,6 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) return ret; } - static int ath11k_qmi_prepare_bdf_download(struct ath11k_base *ab, int type, struct qmi_wlanfw_bdf_download_req_msg_v01 *req, @@ -1818,7 +1809,7 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) break; case ATH11K_QMI_FILE_TYPE_CALDATA: snprintf(filename, sizeof(filename), - "%s/%s",ab->hw_params.fw.dir, ATH11K_QMI_DEFAULT_CAL_FILE_NAME); + "%s/%s", ab->hw_params.fw.dir, ATH11K_QMI_DEFAULT_CAL_FILE_NAME); ret = request_firmware(&fw_entry, filename, dev); if (ret) { ath11k_warn(ab, "qmi failed to load CAL: %s\n", filename); @@ -1835,7 +1826,7 @@ static int ath11k_qmi_request_target_cap(struct ath11k_base *ab) release_firmware(fw_entry); break; default: - ret =-EINVAL; + ret = -EINVAL; goto out; } @@ -1863,7 +1854,7 @@ static int ath11k_qmi_load_bdf(struct ath11k_base *ab) if (of_property_read_u32_array(dev->of_node, "qcom,bdf-addr", &location[0], ARRAY_SIZE(location))) { ath11k_err(ab, "qmi bdf_addr is not in device_tree\n"); - ret =-EINVAL; + ret = -EINVAL; goto out; } @@ -1914,7 +1905,7 @@ static int ath11k_qmi_load_bdf(struct ath11k_base *ab) if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { ath11k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n", - resp.resp.result, resp.resp.error); + resp.resp.result, resp.resp.error); ret = resp.resp.result; goto out_qmi_bdf; } @@ -2266,7 +2257,6 @@ static void ath11k_qmi_msg_fw_ready_cb(struct qmi_handle *qmi_hdl, ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_READY, NULL); } - static void ath11k_qmi_msg_cold_boot_cal_done_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, struct qmi_txn *txn, @@ -2435,8 +2425,8 @@ int ath11k_qmi_init_service(struct ath11k_base *ab) INIT_WORK(&ab->qmi.event_work, ath11k_qmi_driver_event_work); ret = qmi_add_lookup(&ab->qmi.handle, ATH11K_QMI_WLFW_SERVICE_ID_V01, - ATH11K_QMI_WLFW_SERVICE_VERS_V01, - ATH11K_QMI_WLFW_SERVICE_INS_ID_V01); + ATH11K_QMI_WLFW_SERVICE_VERS_V01, + ATH11K_QMI_WLFW_SERVICE_INS_ID_V01); if (ret < 0) { ath11k_warn(ab, "failed to add qmi lookup\n"); return ret; diff --git a/drivers/net/wireless/ath/ath11k/qmi.h b/drivers/net/wireless/ath/ath11k/qmi.h index b01759667466..0d1b45d37c8a 100644 --- a/drivers/net/wireless/ath/ath11k/qmi.h +++ b/drivers/net/wireless/ath/ath11k/qmi.h @@ -13,15 +13,15 @@ #define ATH11K_QMI_WLANFW_TIMEOUT_MS 5000 #define ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE 64 #define ATH11K_QMI_BDF_MAX_SIZE (256 * 1024) -#define ATH11K_QMI_CALDATA_OFFSET (128 * 1024) +#define ATH11K_QMI_CALDATA_OFFSET (128 * 1024) #define ATH11K_QMI_WLANFW_MAX_BUILD_ID_LEN_V01 128 #define ATH11K_QMI_WLFW_SERVICE_ID_V01 0x45 #define ATH11K_QMI_WLFW_SERVICE_VERS_V01 0x01 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02 -#define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32 +#define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32 #define ATH11K_QMI_RESP_LEN_MAX 8192 #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32 -#define ATH11K_QMI_CALDB_SIZE 0x480000 +#define ATH11K_QMI_CALDB_SIZE 0x480000 #define ATH11K_QMI_DEFAULT_CAL_FILE_NAME "caldata.bin" #define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035 @@ -31,15 +31,12 @@ #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144 #define ATH11K_FIRMWARE_MODE_OFF 4 -#define Q6_CALDB_ADDR 0x50000000 -#define Q6_CALDB_SIZE 0x480000 struct ath11k_base; -enum ath11k_firmware_mode; enum ath11k_qmi_file_type { ATH11K_QMI_FILE_TYPE_BDF_GOLDEN, - ATH11K_QMI_FILE_TYPE_CALDATA, + ATH11K_QMI_FILE_TYPE_CALDATA, ATH11K_QMI_MAX_FILE_TYPE, }; @@ -66,7 +63,6 @@ struct ath11k_qmi_driver_event { void *data; }; - struct ath11k_qmi_ce_cfg { const u8 *tgt_ce; int tgt_ce_len; @@ -88,7 +84,6 @@ struct target_mem_chunk { u32 type; dma_addr_t paddr; u32 vaddr; - bool is_valid; }; struct target_info { @@ -112,7 +107,7 @@ struct ath11k_qmi { struct target_mem_chunk target_mem[ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01]; u32 mem_seg_count; u32 target_mem_mode; - bool cal_done; + u8 cal_done; struct target_info target; }; @@ -120,11 +115,11 @@ struct ath11k_qmi { #define QMI_WLANFW_HOST_CAP_REQ_V01 0x0034 #define QMI_WLANFW_HOST_CAP_RESP_MSG_V01_MAX_LEN 7 #define QMI_WLFW_HOST_CAP_RESP_V01 0x0034 -#define QMI_WLFW_MAX_NUM_GPIO_V01 32 +#define QMI_WLFW_MAX_NUM_GPIO_V01 32 #define QMI_IPQ8074_FW_MEM_MODE 0xFF -#define HOST_DDR_REGION_TYPE 0x1 -#define BDF_MEM_REGION_TYPE 0x2 -#define CALDB_MEM_REGION_TYPE 0x4 +#define HOST_DDR_REGION_TYPE 0x1 +#define BDF_MEM_REGION_TYPE 0x2 +#define CALDB_MEM_REGION_TYPE 0x4 struct qmi_wlanfw_host_cap_req_msg_v01 { u8 num_clients_valid; @@ -208,27 +203,27 @@ struct qmi_wlanfw_ind_register_resp_msg_v01 { #define QMI_WLANFW_MAX_NUM_MEM_CFG_V01 2 struct qmi_wlanfw_mem_cfg_s_v01 { - u64 offset; - u32 size; - u8 secure_flag; + u64 offset; + u32 size; + u8 secure_flag; }; enum qmi_wlanfw_mem_type_enum_v01 { - WLANFW_MEM_TYPE_ENUM_MIN_VAL_V01 = INT_MIN, - QMI_WLANFW_MEM_TYPE_MSA_V01 = 0, - QMI_WLANFW_MEM_TYPE_DDR_V01 = 1, - QMI_WLANFW_MEM_BDF_V01 = 2, - QMI_WLANFW_MEM_M3_V01 = 3, - QMI_WLANFW_MEM_CAL_V01 = 4, - QMI_WLANFW_MEM_DPD_V01 = 5, - WLANFW_MEM_TYPE_ENUM_MAX_VAL_V01 = INT_MAX, + WLANFW_MEM_TYPE_ENUM_MIN_VAL_V01 = INT_MIN, + QMI_WLANFW_MEM_TYPE_MSA_V01 = 0, + QMI_WLANFW_MEM_TYPE_DDR_V01 = 1, + QMI_WLANFW_MEM_BDF_V01 = 2, + QMI_WLANFW_MEM_M3_V01 = 3, + QMI_WLANFW_MEM_CAL_V01 = 4, + QMI_WLANFW_MEM_DPD_V01 = 5, + WLANFW_MEM_TYPE_ENUM_MAX_VAL_V01 = INT_MAX, }; struct qmi_wlanfw_mem_seg_s_v01 { - u32 size; - enum qmi_wlanfw_mem_type_enum_v01 type; - u32 mem_cfg_len; - struct qmi_wlanfw_mem_cfg_s_v01 mem_cfg[QMI_WLANFW_MAX_NUM_MEM_CFG_V01]; + u32 size; + enum qmi_wlanfw_mem_type_enum_v01 type; + u32 mem_cfg_len; + struct qmi_wlanfw_mem_cfg_s_v01 mem_cfg[QMI_WLANFW_MAX_NUM_MEM_CFG_V01]; }; struct qmi_wlanfw_request_mem_ind_msg_v01 {