| 1 |
|
| 2 |
|
| 3 | |
| 4 | * Copyright (C) 2018-2024 Linaro Ltd.
|
| 5 |
|
| 6 | #ifndef _IPA_QMI_MSG_H_
|
| 7 | #define _IPA_QMI_MSG_H_
|
| 8 |
|
| 9 | |
| 10 |
|
| 11 | #include <linux/types.h>
|
| 12 |
|
| 13 | #include <linux/soc/qcom/qmi.h>
|
| 14 |
|
| 15 | |
| 16 | * end issues a response for requests; indications require no response.
|
| 17 |
|
| 18 | #define IPA_QMI_INDICATION_REGISTER 0x20
|
| 19 | #define IPA_QMI_INIT_DRIVER 0x21
|
| 20 | #define IPA_QMI_INIT_COMPLETE 0x22
|
| 21 | #define IPA_QMI_DRIVER_INIT_COMPLETE 0x35
|
| 22 |
|
| 23 | |
| 24 | * the message data, along with type (1 byte) and length (2 byte)
|
| 25 | * information for each field. The qmi_send_*() interfaces require
|
| 26 | * the message size to be provided.
|
| 27 |
|
| 28 | #define IPA_QMI_INDICATION_REGISTER_REQ_SZ 20
|
| 29 | #define IPA_QMI_INDICATION_REGISTER_RSP_SZ 7
|
| 30 | #define IPA_QMI_INIT_DRIVER_REQ_SZ 162
|
| 31 | #define IPA_QMI_INIT_DRIVER_RSP_SZ 25
|
| 32 | #define IPA_QMI_INIT_COMPLETE_IND_SZ 7
|
| 33 | #define IPA_QMI_DRIVER_INIT_COMPLETE_REQ_SZ 4
|
| 34 | #define IPA_QMI_DRIVER_INIT_COMPLETE_RSP_SZ 7
|
| 35 |
|
| 36 |
|
| 37 | #define IPA_QMI_SERVER_MAX_RCV_SZ 8
|
| 38 | #define IPA_QMI_CLIENT_MAX_RCV_SZ 25
|
| 39 |
|
| 40 |
|
| 41 | struct ipa_indication_register_req {
|
| 42 | u8 master_driver_init_complete_valid;
|
| 43 | u8 master_driver_init_complete;
|
| 44 | u8 data_usage_quota_reached_valid;
|
| 45 | u8 data_usage_quota_reached;
|
| 46 | u8 ipa_mhi_ready_ind_valid;
|
| 47 | u8 ipa_mhi_ready_ind;
|
| 48 | u8 endpoint_desc_ind_valid;
|
| 49 | u8 endpoint_desc_ind;
|
| 50 | u8 bw_change_ind_valid;
|
| 51 | u8 bw_change_ind;
|
| 52 | };
|
| 53 |
|
| 54 | |
| 55 | * a standard QMI response.
|
| 56 |
|
| 57 | struct ipa_indication_register_rsp {
|
| 58 | struct qmi_response_type_v01 rsp;
|
| 59 | };
|
| 60 |
|
| 61 |
|
| 62 | struct ipa_driver_init_complete_req {
|
| 63 | u8 status;
|
| 64 | };
|
| 65 |
|
| 66 | |
| 67 | * of a standard QMI response.
|
| 68 |
|
| 69 | struct ipa_driver_init_complete_rsp {
|
| 70 | struct qmi_response_type_v01 rsp;
|
| 71 | };
|
| 72 |
|
| 73 | |
| 74 | * only of a standard QMI response.
|
| 75 |
|
| 76 | struct ipa_init_complete_ind {
|
| 77 | struct qmi_response_type_v01 status;
|
| 78 | };
|
| 79 |
|
| 80 |
|
| 81 | enum ipa_platform_type {
|
| 82 | IPA_QMI_PLATFORM_TYPE_INVALID = 0x0,
|
| 83 | IPA_QMI_PLATFORM_TYPE_TN = 0x1,
|
| 84 | IPA_QMI_PLATFORM_TYPE_LE = 0x2,
|
| 85 | IPA_QMI_PLATFORM_TYPE_MSM_ANDROID = 0x3,
|
| 86 | IPA_QMI_PLATFORM_TYPE_MSM_WINDOWS = 0x4,
|
| 87 | IPA_QMI_PLATFORM_TYPE_MSM_QNX_V01 = 0x5,
|
| 88 | };
|
| 89 |
|
| 90 | |
| 91 | * value is a byte offset relative to the start of IPA shared memory. The
|
| 92 | * end value is the last addressable unit *within* the range. Typically
|
| 93 | * the end value is in units of bytes, however it can also be a maximum
|
| 94 | * array index value.
|
| 95 |
|
| 96 | struct ipa_mem_bounds {
|
| 97 | u32 start;
|
| 98 | u32 end;
|
| 99 | };
|
| 100 |
|
| 101 | |
| 102 | * is an offset relative to the start of IPA shared memory. The
|
| 103 | * size of the array is implied by the number of entries (the entry
|
| 104 | * size is assumed to be known).
|
| 105 |
|
| 106 | struct ipa_mem_array {
|
| 107 | u32 start;
|
| 108 | u32 count;
|
| 109 | };
|
| 110 |
|
| 111 | |
| 112 | * start is an offset relative to the start of IPA shared memory.
|
| 113 | * This differs from the ipa_mem_bounds structure in that the size
|
| 114 | * (in bytes) of the memory region is specified rather than the
|
| 115 | * offset of its last byte.
|
| 116 |
|
| 117 | struct ipa_mem_range {
|
| 118 | u32 start;
|
| 119 | u32 size;
|
| 120 | };
|
| 121 |
|
| 122 | |
| 123 | * from the AP that affects modem initialization.
|
| 124 |
|
| 125 | struct ipa_init_modem_driver_req {
|
| 126 | u8 platform_type_valid;
|
| 127 | u32 platform_type;
|
| 128 |
|
| 129 | |
| 130 | * memory in which the modem may insert header table entries.
|
| 131 |
|
| 132 | u8 hdr_tbl_info_valid;
|
| 133 | struct ipa_mem_bounds hdr_tbl_info;
|
| 134 |
|
| 135 | |
| 136 | * *index* (not byte) for the modem portion of non-hashable IPv4 and
|
| 137 | * IPv6 routing tables. The start values are byte offsets relative
|
| 138 | * to the start of IPA shared memory.
|
| 139 |
|
| 140 | u8 v4_route_tbl_info_valid;
|
| 141 | struct ipa_mem_bounds v4_route_tbl_info;
|
| 142 | u8 v6_route_tbl_info_valid;
|
| 143 | struct ipa_mem_bounds v6_route_tbl_info;
|
| 144 |
|
| 145 | |
| 146 | * non-hashable IPv4 and IPv6 filter tables. The start values are
|
| 147 | * byte offsets relative to the start of IPA shared memory.
|
| 148 |
|
| 149 | u8 v4_filter_tbl_start_valid;
|
| 150 | u32 v4_filter_tbl_start;
|
| 151 | u8 v6_filter_tbl_start_valid;
|
| 152 | u32 v6_filter_tbl_start;
|
| 153 |
|
| 154 | |
| 155 | * size of memory available for the modem to use.
|
| 156 |
|
| 157 | u8 modem_mem_info_valid;
|
| 158 | struct ipa_mem_range modem_mem_info;
|
| 159 |
|
| 160 | |
| 161 | * the modem driver can send control commands. Must be less
|
| 162 | * than ipa_endpoint_max().
|
| 163 |
|
| 164 | u8 ctrl_comm_dest_end_pt_valid;
|
| 165 | u32 ctrl_comm_dest_end_pt;
|
| 166 |
|
| 167 | |
| 168 | * or not. It is unnecessary to reload it if the modem is being
|
| 169 | * restarted.
|
| 170 | *
|
| 171 | * NOTE: this field is named "is_ssr_bootup" elsewhere.
|
| 172 |
|
| 173 | u8 skip_uc_load_valid;
|
| 174 | u8 skip_uc_load;
|
| 175 |
|
| 176 | |
| 177 | * which the modem may insert header processing context table entries.
|
| 178 |
|
| 179 | u8 hdr_proc_ctx_tbl_info_valid;
|
| 180 | struct ipa_mem_bounds hdr_proc_ctx_tbl_info;
|
| 181 |
|
| 182 | |
| 183 | * in which the modem may insert compression/decompression commands.
|
| 184 |
|
| 185 | u8 zip_tbl_info_valid;
|
| 186 | struct ipa_mem_bounds zip_tbl_info;
|
| 187 |
|
| 188 | |
| 189 | * *index* (not byte) for the modem portion of hashable IPv4 and IPv6
|
| 190 | * routing tables (if supported by hardware). The start values are
|
| 191 | * byte offsets relative to the start of IPA shared memory.
|
| 192 |
|
| 193 | u8 v4_hash_route_tbl_info_valid;
|
| 194 | struct ipa_mem_bounds v4_hash_route_tbl_info;
|
| 195 | u8 v6_hash_route_tbl_info_valid;
|
| 196 | struct ipa_mem_bounds v6_hash_route_tbl_info;
|
| 197 |
|
| 198 | |
| 199 | * of hashable IPv4 and IPv6 filter tables (if supported by hardware).
|
| 200 | * The start values are byte offsets relative to the start of IPA
|
| 201 | * shared memory.
|
| 202 |
|
| 203 | u8 v4_hash_filter_tbl_start_valid;
|
| 204 | u32 v4_hash_filter_tbl_start;
|
| 205 | u8 v6_hash_filter_tbl_start_valid;
|
| 206 | u32 v6_hash_filter_tbl_start;
|
| 207 |
|
| 208 | |
| 209 | * first and last statistics sub-regions. (IPA v4.0 and above)
|
| 210 |
|
| 211 | u8 hw_stats_quota_base_addr_valid;
|
| 212 | u32 hw_stats_quota_base_addr;
|
| 213 | u8 hw_stats_quota_size_valid;
|
| 214 | u32 hw_stats_quota_size;
|
| 215 | u8 hw_stats_drop_base_addr_valid;
|
| 216 | u32 hw_stats_drop_base_addr;
|
| 217 | u8 hw_stats_drop_size_valid;
|
| 218 | u32 hw_stats_drop_size;
|
| 219 | };
|
| 220 |
|
| 221 | |
| 222 | * QMI response, but contains other information as well. Currently we
|
| 223 | * simply wait for the INIT_DRIVER transaction to complete and
|
| 224 | * ignore any other data that might be returned.
|
| 225 |
|
| 226 | struct ipa_init_modem_driver_rsp {
|
| 227 | struct qmi_response_type_v01 rsp;
|
| 228 |
|
| 229 | |
| 230 | * the AP driver can send control commands. Must be less than
|
| 231 | * ipa_endpoint_max().
|
| 232 |
|
| 233 | u8 ctrl_comm_dest_end_pt_valid;
|
| 234 | u32 ctrl_comm_dest_end_pt;
|
| 235 |
|
| 236 | |
| 237 | * required to configure the hardware with this value. Must
|
| 238 | * be less than ipa_endpoint_max().
|
| 239 |
|
| 240 | u8 default_end_pt_valid;
|
| 241 | u32 default_end_pt;
|
| 242 |
|
| 243 | |
| 244 | * initialization.
|
| 245 |
|
| 246 | u8 modem_driver_init_pending_valid;
|
| 247 | u8 modem_driver_init_pending;
|
| 248 | };
|
| 249 |
|
| 250 |
|
| 251 | extern const struct qmi_elem_info ipa_indication_register_req_ei[];
|
| 252 | extern const struct qmi_elem_info ipa_indication_register_rsp_ei[];
|
| 253 | extern const struct qmi_elem_info ipa_driver_init_complete_req_ei[];
|
| 254 | extern const struct qmi_elem_info ipa_driver_init_complete_rsp_ei[];
|
| 255 | extern const struct qmi_elem_info ipa_init_complete_ind_ei[];
|
| 256 | extern const struct qmi_elem_info ipa_mem_bounds_ei[];
|
| 257 | extern const struct qmi_elem_info ipa_mem_array_ei[];
|
| 258 | extern const struct qmi_elem_info ipa_mem_range_ei[];
|
| 259 | extern const struct qmi_elem_info ipa_init_modem_driver_req_ei[];
|
| 260 | extern const struct qmi_elem_info ipa_init_modem_driver_rsp_ei[];
|
| 261 |
|
| 262 | #endif
|