1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. */ 3 4 #ifndef CNSS_PLAT_IPC_SERVICE_V01_H 5 #define CNSS_PLAT_IPC_SERVICE_V01_H 6 7 #include <linux/soc/qcom/qmi.h> 8 9 #define CNSS_PLATFORM_SERVICE_ID_V01 0x42E 10 #define CNSS_PLATFORM_SERVICE_VERS_V01 0x01 11 12 #define CNSS_PLAT_IPC_QMI_REG_CLIENT_RESP_V01 0x0006 13 #define CNSS_PLAT_IPC_QMI_FILE_DOWNLOAD_REQ_V01 0x0003 14 #define CNSS_PLAT_IPC_QMI_FILE_UPLOAD_IND_V01 0x0004 15 #define CNSS_PLAT_IPC_QMI_FILE_DOWNLOAD_IND_V01 0x0002 16 #define CNSS_PLAT_IPC_QMI_REG_CLIENT_REQ_V01 0x0006 17 #define CNSS_PLAT_IPC_QMI_INIT_SETUP_REQ_V01 0x0001 18 #define CNSS_PLAT_IPC_QMI_FILE_UPLOAD_REQ_V01 0x0005 19 #define CNSS_PLAT_IPC_QMI_FILE_DOWNLOAD_RESP_V01 0x0003 20 #define CNSS_PLAT_IPC_QMI_FILE_UPLOAD_RESP_V01 0x0005 21 #define CNSS_PLAT_IPC_QMI_INIT_SETUP_RESP_V01 0x0001 22 23 #define CNSS_PLAT_IPC_QMI_MAX_FILE_NAME_LEN_V01 32 24 #define CNSS_PLAT_IPC_QMI_MAX_DATA_SIZE_V01 61440 25 #define CNSS_PLAT_IPC_QMI_MAX_MSG_SIZE_V01 65535 26 27 #define CNSS_PLAT_IPC_QMI_DRIVER_CBC_DONE_V01 ((u64)0x01ULL) 28 #define CNSS_PLAT_IPC_QMI_DRIVER_WLAN_ACTIVE_V01 ((u64)0x02ULL) 29 30 enum cnss_plat_ipc_qmi_client_id_v01 { 31 CNSS_PLAT_IPC_QMI_CLIENT_ID_MIN_VAL_V01 = INT_MIN, 32 CNSS_PLAT_IPC_BT_QMI_CLIENT_V01 = 0, 33 CNSS_PLAT_IPC_DAEMON_QMI_CLIENT_V01 = 1, 34 CNSS_PLAT_IPC_QMI_CLIENT_ID_MAX_VAL_V01 = INT_MAX, 35 }; 36 37 struct cnss_plat_ipc_qmi_init_setup_req_msg_v01 { 38 u8 dms_mac_addr_supported; 39 u8 qdss_hw_trace_override; 40 u32 cal_file_available_bitmask; 41 }; 42 43 #define CNSS_PLAT_IPC_QMI_INIT_SETUP_REQ_MSG_V01_MAX_MSG_LEN 15 44 extern struct qmi_elem_info cnss_plat_ipc_qmi_init_setup_req_msg_v01_ei[]; 45 46 struct cnss_plat_ipc_qmi_init_setup_resp_msg_v01 { 47 struct qmi_response_type_v01 resp; 48 u64 drv_status; 49 }; 50 51 #define CNSS_PLAT_IPC_QMI_INIT_SETUP_RESP_MSG_V01_MAX_MSG_LEN 18 52 extern struct qmi_elem_info cnss_plat_ipc_qmi_init_setup_resp_msg_v01_ei[]; 53 54 struct cnss_plat_ipc_qmi_file_download_ind_msg_v01 { 55 char file_name[CNSS_PLAT_IPC_QMI_MAX_FILE_NAME_LEN_V01 + 1]; 56 u32 file_id; 57 }; 58 59 #define CNSS_PLAT_IPC_QMI_FILE_DOWNLOAD_IND_MSG_V01_MAX_MSG_LEN 42 60 extern struct qmi_elem_info cnss_plat_ipc_qmi_file_download_ind_msg_v01_ei[]; 61 62 struct cnss_plat_ipc_qmi_file_download_req_msg_v01 { 63 u32 file_id; 64 u32 file_size; 65 u8 end; 66 u32 seg_index; 67 u32 seg_buf_len; 68 u8 seg_buf[CNSS_PLAT_IPC_QMI_MAX_DATA_SIZE_V01]; 69 }; 70 71 #define CNSS_PLAT_IPC_QMI_FILE_DOWNLOAD_REQ_MSG_V01_MAX_MSG_LEN 61470 72 extern struct qmi_elem_info cnss_plat_ipc_qmi_file_download_req_msg_v01_ei[]; 73 74 struct cnss_plat_ipc_qmi_file_download_resp_msg_v01 { 75 struct qmi_response_type_v01 resp; 76 u32 file_id; 77 u32 seg_index; 78 }; 79 80 #define CNSS_PLAT_IPC_QMI_FILE_DOWNLOAD_RESP_MSG_V01_MAX_MSG_LEN 21 81 extern struct qmi_elem_info cnss_plat_ipc_qmi_file_download_resp_msg_v01_ei[]; 82 83 struct cnss_plat_ipc_qmi_file_upload_ind_msg_v01 { 84 char file_name[CNSS_PLAT_IPC_QMI_MAX_FILE_NAME_LEN_V01 + 1]; 85 u32 file_id; 86 u32 file_size; 87 }; 88 89 #define CNSS_PLAT_IPC_QMI_FILE_UPLOAD_IND_MSG_V01_MAX_MSG_LEN 49 90 extern struct qmi_elem_info cnss_plat_ipc_qmi_file_upload_ind_msg_v01_ei[]; 91 92 struct cnss_plat_ipc_qmi_file_upload_req_msg_v01 { 93 u32 file_id; 94 u32 seg_index; 95 }; 96 97 #define CNSS_PLAT_IPC_QMI_FILE_UPLOAD_REQ_MSG_V01_MAX_MSG_LEN 14 98 extern struct qmi_elem_info cnss_plat_ipc_qmi_file_upload_req_msg_v01_ei[]; 99 100 struct cnss_plat_ipc_qmi_file_upload_resp_msg_v01 { 101 struct qmi_response_type_v01 resp; 102 u32 file_id; 103 u8 end; 104 u32 seg_index; 105 u32 seg_buf_len; 106 u8 seg_buf[CNSS_PLAT_IPC_QMI_MAX_DATA_SIZE_V01]; 107 }; 108 109 #define CNSS_PLAT_IPC_QMI_FILE_UPLOAD_RESP_MSG_V01_MAX_MSG_LEN 61470 110 extern struct qmi_elem_info cnss_plat_ipc_qmi_file_upload_resp_msg_v01_ei[]; 111 112 struct cnss_plat_ipc_qmi_reg_client_req_msg_v01 { 113 u8 client_id_valid; 114 enum cnss_plat_ipc_qmi_client_id_v01 client_id; 115 }; 116 117 #define CNSS_PLAT_IPC_QMI_REG_CLIENT_REQ_MSG_V01_MAX_MSG_LEN 7 118 extern struct qmi_elem_info cnss_plat_ipc_qmi_reg_client_req_msg_v01_ei[]; 119 120 struct cnss_plat_ipc_qmi_reg_client_resp_msg_v01 { 121 struct qmi_response_type_v01 resp; 122 }; 123 124 #define CNSS_PLAT_IPC_QMI_REG_CLIENT_RESP_MSG_V01_MAX_MSG_LEN 7 125 extern struct qmi_elem_info cnss_plat_ipc_qmi_reg_client_resp_msg_v01_ei[]; 126 127 #endif 128