Utkarsh Saxena | 971a03c | 2017-01-22 22:04:13 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _IPA_H_ |
| 14 | #define _IPA_H_ |
| 15 | |
| 16 | #include <linux/msm_ipa.h> |
| 17 | #include <linux/skbuff.h> |
| 18 | #include <linux/types.h> |
| 19 | #include <linux/msm-sps.h> |
| 20 | #include <linux/if_ether.h> |
| 21 | #include "linux/msm_gsi.h" |
| 22 | |
| 23 | #define IPA_APPS_MAX_BW_IN_MBPS 700 |
| 24 | /** |
| 25 | * enum ipa_transport_type |
| 26 | * transport type: either GSI or SPS |
| 27 | */ |
| 28 | enum ipa_transport_type { |
| 29 | IPA_TRANSPORT_TYPE_SPS, |
| 30 | IPA_TRANSPORT_TYPE_GSI |
| 31 | }; |
| 32 | |
| 33 | /** |
| 34 | * enum ipa_nat_en_type - NAT setting type in IPA end-point |
| 35 | */ |
| 36 | enum ipa_nat_en_type { |
| 37 | IPA_BYPASS_NAT, |
| 38 | IPA_SRC_NAT, |
| 39 | IPA_DST_NAT, |
| 40 | }; |
| 41 | |
| 42 | /** |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 43 | * enum ipa_ipv6ct_en_type - IPv6CT setting type in IPA end-point |
| 44 | */ |
| 45 | enum ipa_ipv6ct_en_type { |
| 46 | IPA_BYPASS_IPV6CT, |
| 47 | IPA_ENABLE_IPV6CT, |
| 48 | }; |
| 49 | |
| 50 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 51 | * enum ipa_mode_type - mode setting type in IPA end-point |
| 52 | * @BASIC: basic mode |
| 53 | * @ENABLE_FRAMING_HDLC: not currently supported |
| 54 | * @ENABLE_DEFRAMING_HDLC: not currently supported |
| 55 | * @DMA: all data arriving IPA will not go through IPA logic blocks, this |
| 56 | * allows IPA to work as DMA for specific pipes. |
| 57 | */ |
| 58 | enum ipa_mode_type { |
| 59 | IPA_BASIC, |
| 60 | IPA_ENABLE_FRAMING_HDLC, |
| 61 | IPA_ENABLE_DEFRAMING_HDLC, |
| 62 | IPA_DMA, |
| 63 | }; |
| 64 | |
| 65 | /** |
| 66 | * enum ipa_aggr_en_type - aggregation setting type in IPA |
| 67 | * end-point |
| 68 | */ |
| 69 | enum ipa_aggr_en_type { |
| 70 | IPA_BYPASS_AGGR, |
| 71 | IPA_ENABLE_AGGR, |
| 72 | IPA_ENABLE_DEAGGR, |
| 73 | }; |
| 74 | |
| 75 | /** |
| 76 | * enum ipa_aggr_type - type of aggregation in IPA end-point |
| 77 | */ |
| 78 | enum ipa_aggr_type { |
| 79 | IPA_MBIM_16 = 0, |
| 80 | IPA_HDLC = 1, |
| 81 | IPA_TLP = 2, |
| 82 | IPA_RNDIS = 3, |
| 83 | IPA_GENERIC = 4, |
| 84 | IPA_QCMAP = 6, |
| 85 | }; |
| 86 | |
| 87 | /** |
| 88 | * enum ipa_aggr_mode - global aggregation mode |
| 89 | */ |
| 90 | enum ipa_aggr_mode { |
| 91 | IPA_MBIM_AGGR, |
| 92 | IPA_QCNCM_AGGR, |
| 93 | }; |
| 94 | |
| 95 | /** |
| 96 | * enum ipa_dp_evt_type - type of event client callback is |
| 97 | * invoked for on data path |
| 98 | * @IPA_RECEIVE: data is struct sk_buff |
| 99 | * @IPA_WRITE_DONE: data is struct sk_buff |
| 100 | */ |
| 101 | enum ipa_dp_evt_type { |
| 102 | IPA_RECEIVE, |
| 103 | IPA_WRITE_DONE, |
| 104 | IPA_CLIENT_START_POLL, |
| 105 | IPA_CLIENT_COMP_NAPI, |
| 106 | }; |
| 107 | |
| 108 | /** |
Skylar Chang | fcf36c2 | 2016-10-04 14:15:25 -0700 | [diff] [blame] | 109 | * enum hdr_total_len_or_pad_type - type of value held by TOTAL_LEN_OR_PAD |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 110 | * field in header configuration register. |
| 111 | * @IPA_HDR_PAD: field is used as padding length |
| 112 | * @IPA_HDR_TOTAL_LEN: field is used as total length |
| 113 | */ |
| 114 | enum hdr_total_len_or_pad_type { |
| 115 | IPA_HDR_PAD = 0, |
| 116 | IPA_HDR_TOTAL_LEN = 1, |
| 117 | }; |
| 118 | |
| 119 | /** |
| 120 | * struct ipa_ep_cfg_nat - NAT configuration in IPA end-point |
| 121 | * @nat_en: This defines the default NAT mode for the pipe: in case of |
| 122 | * filter miss - the default NAT mode defines the NATing operation |
| 123 | * on the packet. Valid for Input Pipes only (IPA consumer) |
| 124 | */ |
| 125 | struct ipa_ep_cfg_nat { |
| 126 | enum ipa_nat_en_type nat_en; |
| 127 | }; |
| 128 | |
| 129 | /** |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 130 | * struct ipa_ep_cfg_conn_track - IPv6 Connection tracking configuration in |
| 131 | * IPA end-point |
| 132 | * @conn_track_en: Defines speculative conn_track action, means if specific |
| 133 | * pipe needs to have UL/DL IPv6 Connection Tracking or Bybass |
| 134 | * IPv6 Connection Tracking. 0: Bypass IPv6 Connection Tracking |
| 135 | * 1: IPv6 UL/DL Connection Tracking. |
| 136 | * Valid for Input Pipes only (IPA consumer) |
| 137 | */ |
| 138 | struct ipa_ep_cfg_conn_track { |
| 139 | enum ipa_ipv6ct_en_type conn_track_en; |
| 140 | }; |
| 141 | |
| 142 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 143 | * struct ipa_ep_cfg_hdr - header configuration in IPA end-point |
| 144 | * |
| 145 | * @hdr_len:Header length in bytes to be added/removed. Assuming |
| 146 | * header len is constant per endpoint. Valid for |
| 147 | * both Input and Output Pipes |
| 148 | * @hdr_ofst_metadata_valid: 0: Metadata_Ofst value is invalid, i.e., no |
| 149 | * metadata within header. |
| 150 | * 1: Metadata_Ofst value is valid, i.e., metadata |
| 151 | * within header is in offset Metadata_Ofst Valid |
| 152 | * for Input Pipes only (IPA Consumer) (for output |
| 153 | * pipes, metadata already set within the header) |
| 154 | * @hdr_ofst_metadata: Offset within header in which metadata resides |
| 155 | * Size of metadata - 4bytes |
| 156 | * Example - Stream ID/SSID/mux ID. |
| 157 | * Valid for Input Pipes only (IPA Consumer) (for output |
| 158 | * pipes, metadata already set within the header) |
| 159 | * @hdr_additional_const_len: Defines the constant length that should be added |
| 160 | * to the payload length in order for IPA to update |
| 161 | * correctly the length field within the header |
| 162 | * (valid only in case Hdr_Ofst_Pkt_Size_Valid=1) |
| 163 | * Valid for Output Pipes (IPA Producer) |
| 164 | * @hdr_ofst_pkt_size_valid: 0: Hdr_Ofst_Pkt_Size value is invalid, i.e., no |
| 165 | * length field within the inserted header |
| 166 | * 1: Hdr_Ofst_Pkt_Size value is valid, i.e., a |
| 167 | * packet length field resides within the header |
| 168 | * Valid for Output Pipes (IPA Producer) |
| 169 | * @hdr_ofst_pkt_size: Offset within header in which packet size reside. Upon |
| 170 | * Header Insertion, IPA will update this field within the |
| 171 | * header with the packet length . Assumption is that |
| 172 | * header length field size is constant and is 2Bytes |
| 173 | * Valid for Output Pipes (IPA Producer) |
| 174 | * @hdr_a5_mux: Determines whether A5 Mux header should be added to the packet. |
| 175 | * This bit is valid only when Hdr_En=01(Header Insertion) |
| 176 | * SW should set this bit for IPA-to-A5 pipes. |
| 177 | * 0: Do not insert A5 Mux Header |
| 178 | * 1: Insert A5 Mux Header |
| 179 | * Valid for Output Pipes (IPA Producer) |
| 180 | * @hdr_remove_additional: bool switch, remove more of the header |
| 181 | * based on the aggregation configuration (register |
| 182 | * HDR_LEN_INC_DEAGG_HDR) |
| 183 | * @hdr_metadata_reg_valid: bool switch, metadata from |
| 184 | * register INIT_HDR_METADATA_n is valid. |
| 185 | * (relevant only for IPA Consumer pipes) |
| 186 | */ |
| 187 | struct ipa_ep_cfg_hdr { |
| 188 | u32 hdr_len; |
| 189 | u32 hdr_ofst_metadata_valid; |
| 190 | u32 hdr_ofst_metadata; |
| 191 | u32 hdr_additional_const_len; |
| 192 | u32 hdr_ofst_pkt_size_valid; |
| 193 | u32 hdr_ofst_pkt_size; |
| 194 | u32 hdr_a5_mux; |
| 195 | u32 hdr_remove_additional; |
| 196 | u32 hdr_metadata_reg_valid; |
| 197 | }; |
| 198 | |
| 199 | /** |
| 200 | * struct ipa_ep_cfg_hdr_ext - extended header configuration in IPA end-point |
| 201 | * @hdr_pad_to_alignment: Pad packet to specified alignment |
| 202 | * (2^pad to alignment value), i.e. value of 3 means pad to 2^3 = 8 bytes |
| 203 | * alignment. Alignment is to 0,2 up to 32 bytes (IPAv2 does not support 64 |
| 204 | * byte alignment). Valid for Output Pipes only (IPA Producer). |
| 205 | * @hdr_total_len_or_pad_offset: Offset to length field containing either |
| 206 | * total length or pad length, per hdr_total_len_or_pad config |
| 207 | * @hdr_payload_len_inc_padding: 0-IPA_ENDP_INIT_HDR_n's |
| 208 | * HDR_OFST_PKT_SIZE does |
| 209 | * not includes padding bytes size, payload_len = packet length, |
| 210 | * 1-IPA_ENDP_INIT_HDR_n's HDR_OFST_PKT_SIZE includes |
| 211 | * padding bytes size, payload_len = packet length + padding |
| 212 | * @hdr_total_len_or_pad: field is used as PAD length ot as Total length |
| 213 | * (header + packet + padding) |
| 214 | * @hdr_total_len_or_pad_valid: 0-Ignore TOTAL_LEN_OR_PAD field, 1-Process |
| 215 | * TOTAL_LEN_OR_PAD field |
| 216 | * @hdr_little_endian: 0-Big Endian, 1-Little Endian |
| 217 | */ |
| 218 | struct ipa_ep_cfg_hdr_ext { |
| 219 | u32 hdr_pad_to_alignment; |
| 220 | u32 hdr_total_len_or_pad_offset; |
| 221 | bool hdr_payload_len_inc_padding; |
| 222 | enum hdr_total_len_or_pad_type hdr_total_len_or_pad; |
| 223 | bool hdr_total_len_or_pad_valid; |
| 224 | bool hdr_little_endian; |
| 225 | }; |
| 226 | |
| 227 | /** |
| 228 | * struct ipa_ep_cfg_mode - mode configuration in IPA end-point |
| 229 | * @mode: Valid for Input Pipes only (IPA Consumer) |
| 230 | * @dst: This parameter specifies the output pipe to which the packets |
| 231 | * will be routed to. |
| 232 | * This parameter is valid for Mode=DMA and not valid for |
| 233 | * Mode=Basic |
| 234 | * Valid for Input Pipes only (IPA Consumer) |
| 235 | */ |
| 236 | struct ipa_ep_cfg_mode { |
| 237 | enum ipa_mode_type mode; |
| 238 | enum ipa_client_type dst; |
| 239 | }; |
| 240 | |
| 241 | /** |
| 242 | * struct ipa_ep_cfg_aggr - aggregation configuration in IPA end-point |
| 243 | * |
| 244 | * @aggr_en: Valid for both Input and Output Pipes |
| 245 | * @aggr: aggregation type (Valid for both Input and Output Pipes) |
| 246 | * @aggr_byte_limit: Limit of aggregated packet size in KB (<=32KB) When set |
| 247 | * to 0, there is no size limitation on the aggregation. |
| 248 | * When both, Aggr_Byte_Limit and Aggr_Time_Limit are set |
| 249 | * to 0, there is no aggregation, every packet is sent |
| 250 | * independently according to the aggregation structure |
| 251 | * Valid for Output Pipes only (IPA Producer ) |
| 252 | * @aggr_time_limit: Timer to close aggregated packet (<=32ms) When set to 0, |
| 253 | * there is no time limitation on the aggregation. When |
| 254 | * both, Aggr_Byte_Limit and Aggr_Time_Limit are set to 0, |
| 255 | * there is no aggregation, every packet is sent |
| 256 | * independently according to the aggregation structure |
| 257 | * Valid for Output Pipes only (IPA Producer) |
| 258 | * @aggr_pkt_limit: Defines if EOF close aggregation or not. if set to false |
| 259 | * HW closes aggregation (sends EOT) only based on its |
| 260 | * aggregation config (byte/time limit, etc). if set to |
| 261 | * true EOF closes aggregation in addition to HW based |
| 262 | * aggregation closure. Valid for Output Pipes only (IPA |
| 263 | * Producer). EOF affects only Pipes configured for |
| 264 | * generic aggregation. |
| 265 | * @aggr_hard_byte_limit_en: If set to 1, byte-limit aggregation for this |
| 266 | * pipe will apply a hard-limit behavior which will not |
| 267 | * allow frames to be closed with more than byte-limit |
| 268 | * bytes. If set to 0, previous byte-limit behavior |
| 269 | * will apply - frames close once a packet causes the |
| 270 | * accumulated byte-count to cross the byte-limit |
| 271 | * threshold (closed frame will contain that packet). |
| 272 | * @aggr_sw_eof_active: 0: EOF does not close aggregation. HW closes aggregation |
| 273 | * (sends EOT) only based on its aggregation config |
| 274 | * (byte/time limit, etc). |
| 275 | * 1: EOF closes aggregation in addition to HW based |
| 276 | * aggregation closure. Valid for Output Pipes only (IPA |
| 277 | * Producer). EOF affects only Pipes configured for generic |
| 278 | * aggregation. |
| 279 | */ |
| 280 | struct ipa_ep_cfg_aggr { |
| 281 | enum ipa_aggr_en_type aggr_en; |
| 282 | enum ipa_aggr_type aggr; |
| 283 | u32 aggr_byte_limit; |
| 284 | u32 aggr_time_limit; |
| 285 | u32 aggr_pkt_limit; |
| 286 | u32 aggr_hard_byte_limit_en; |
| 287 | bool aggr_sw_eof_active; |
| 288 | }; |
| 289 | |
| 290 | /** |
| 291 | * struct ipa_ep_cfg_route - route configuration in IPA end-point |
| 292 | * @rt_tbl_hdl: Defines the default routing table index to be used in case there |
| 293 | * is no filter rule matching, valid for Input Pipes only (IPA |
| 294 | * Consumer). Clients should set this to 0 which will cause default |
| 295 | * v4 and v6 routes setup internally by IPA driver to be used for |
| 296 | * this end-point |
| 297 | */ |
| 298 | struct ipa_ep_cfg_route { |
| 299 | u32 rt_tbl_hdl; |
| 300 | }; |
| 301 | |
| 302 | /** |
| 303 | * struct ipa_ep_cfg_holb - head of line blocking configuration in IPA end-point |
| 304 | * @en: enable(1 => ok to drop pkt)/disable(0 => never drop pkt) |
| 305 | * @tmr_val: duration in units of 128 IPA clk clock cyles [0,511], 1 clk=1.28us |
| 306 | * IPAv2.5 support 32 bit HOLB timeout value, previous versions |
| 307 | * supports 16 bit |
| 308 | */ |
| 309 | struct ipa_ep_cfg_holb { |
| 310 | u16 en; |
| 311 | u32 tmr_val; |
| 312 | }; |
| 313 | |
| 314 | /** |
| 315 | * struct ipa_ep_cfg_deaggr - deaggregation configuration in IPA end-point |
| 316 | * @deaggr_hdr_len: Deaggregation Header length in bytes. Valid only for Input |
| 317 | * Pipes, which are configured for 'Generic' deaggregation. |
| 318 | * @packet_offset_valid: - 0: PACKET_OFFSET is not used, 1: PACKET_OFFSET is |
| 319 | * used. |
| 320 | * @packet_offset_location: Location of packet offset field, which specifies |
| 321 | * the offset to the packet from the start of the packet offset field. |
| 322 | * @max_packet_len: DEAGGR Max Packet Length in Bytes. A Packet with higher |
| 323 | * size wil be treated as an error. 0 - Packet Length is not Bound, |
| 324 | * IPA should not check for a Max Packet Length. |
| 325 | */ |
| 326 | struct ipa_ep_cfg_deaggr { |
| 327 | u32 deaggr_hdr_len; |
| 328 | bool packet_offset_valid; |
| 329 | u32 packet_offset_location; |
| 330 | u32 max_packet_len; |
| 331 | }; |
| 332 | |
| 333 | /** |
| 334 | * enum ipa_cs_offload - checksum offload setting |
| 335 | */ |
| 336 | enum ipa_cs_offload { |
| 337 | IPA_DISABLE_CS_OFFLOAD, |
| 338 | IPA_ENABLE_CS_OFFLOAD_UL, |
| 339 | IPA_ENABLE_CS_OFFLOAD_DL, |
| 340 | IPA_CS_RSVD |
| 341 | }; |
| 342 | |
| 343 | /** |
| 344 | * struct ipa_ep_cfg_cfg - IPA ENDP_INIT Configuration register |
| 345 | * @frag_offload_en: - 0 - IP packet fragment handling is disabled. IP packet |
| 346 | * fragments should be sent to SW. SW is responsible for |
| 347 | * configuring filter rules, and IP packet filter exception should be |
| 348 | * used to send all fragments to SW. 1 - IP packet fragment |
| 349 | * handling is enabled. IPA checks for fragments and uses frag |
| 350 | * rules table for processing fragments. Valid only for Input Pipes |
| 351 | * (IPA Consumer) |
| 352 | * @cs_offload_en: Checksum offload enable: 00: Disable checksum offload, 01: |
| 353 | * Enable checksum calculation offload (UL) - For output pipe |
| 354 | * (IPA producer) specifies that checksum trailer is to be added. |
| 355 | * For input pipe (IPA consumer) specifies presence of checksum |
| 356 | * header and IPA checksum calculation accordingly. 10: Enable |
| 357 | * checksum calculation offload (DL) - For output pipe (IPA |
| 358 | * producer) specifies that checksum trailer is to be added. For |
| 359 | * input pipe (IPA consumer) specifies IPA checksum calculation. |
| 360 | * 11: Reserved |
| 361 | * @cs_metadata_hdr_offset: Offset in Words (4 bytes) within header in which |
| 362 | * checksum meta info header (4 bytes) starts (UL). Values are 0-15, which |
| 363 | * mean 0 - 60 byte checksum header offset. Valid for input |
| 364 | * pipes only (IPA consumer) |
| 365 | * @gen_qmb_master_sel: Select bit for ENDP GEN-QMB master. This is used to |
| 366 | * separate DDR & PCIe transactions in-order to limit them as |
| 367 | * a group (using MAX_WRITES/READS limiation). Valid for input and |
| 368 | * output pipes (IPA consumer+producer) |
| 369 | */ |
| 370 | struct ipa_ep_cfg_cfg { |
| 371 | bool frag_offload_en; |
| 372 | enum ipa_cs_offload cs_offload_en; |
| 373 | u8 cs_metadata_hdr_offset; |
| 374 | u8 gen_qmb_master_sel; |
| 375 | }; |
| 376 | |
| 377 | /** |
| 378 | * struct ipa_ep_cfg_metadata_mask - Endpoint initialization hdr metadata mask |
| 379 | * @metadata_mask: Mask specifying which metadata bits to write to |
| 380 | * IPA_ENDP_INIT_HDR_n.s HDR_OFST_METADATA. Only |
| 381 | * masked metadata bits (set to 1) will be written. Valid for Output |
| 382 | * Pipes only (IPA Producer) |
| 383 | */ |
| 384 | struct ipa_ep_cfg_metadata_mask { |
| 385 | u32 metadata_mask; |
| 386 | }; |
| 387 | |
| 388 | /** |
| 389 | * struct ipa_ep_cfg_metadata - Meta Data configuration in IPA end-point |
| 390 | * @md: This defines the meta data from tx data descriptor |
| 391 | * @qmap_id: qmap id |
| 392 | */ |
| 393 | struct ipa_ep_cfg_metadata { |
| 394 | u32 qmap_id; |
| 395 | }; |
| 396 | |
| 397 | /** |
| 398 | * struct ipa_ep_cfg_seq - HPS/DPS sequencer type configuration in IPA end-point |
| 399 | * @set_dynamic: 0 - HPS/DPS seq type is configured statically, |
| 400 | * 1 - HPS/DPS seq type is set to seq_type |
| 401 | * @seq_type: HPS/DPS sequencer type configuration |
| 402 | */ |
| 403 | struct ipa_ep_cfg_seq { |
| 404 | bool set_dynamic; |
| 405 | int seq_type; |
| 406 | }; |
| 407 | |
| 408 | /** |
| 409 | * struct ipa_ep_cfg - configuration of IPA end-point |
| 410 | * @nat: NAT parmeters |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 411 | * @conn_track: IPv6CT parmeters |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 412 | * @hdr: Header parameters |
| 413 | * @hdr_ext: Extended header parameters |
| 414 | * @mode: Mode parameters |
| 415 | * @aggr: Aggregation parameters |
| 416 | * @deaggr: Deaggregation params |
| 417 | * @route: Routing parameters |
| 418 | * @cfg: Configuration register data |
| 419 | * @metadata_mask: Hdr metadata mask |
| 420 | * @meta: Meta Data |
| 421 | * @seq: HPS/DPS sequencers configuration |
| 422 | */ |
| 423 | struct ipa_ep_cfg { |
| 424 | struct ipa_ep_cfg_nat nat; |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 425 | struct ipa_ep_cfg_conn_track conn_track; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 426 | struct ipa_ep_cfg_hdr hdr; |
| 427 | struct ipa_ep_cfg_hdr_ext hdr_ext; |
| 428 | struct ipa_ep_cfg_mode mode; |
| 429 | struct ipa_ep_cfg_aggr aggr; |
| 430 | struct ipa_ep_cfg_deaggr deaggr; |
| 431 | struct ipa_ep_cfg_route route; |
| 432 | struct ipa_ep_cfg_cfg cfg; |
| 433 | struct ipa_ep_cfg_metadata_mask metadata_mask; |
| 434 | struct ipa_ep_cfg_metadata meta; |
| 435 | struct ipa_ep_cfg_seq seq; |
| 436 | }; |
| 437 | |
| 438 | /** |
| 439 | * struct ipa_ep_cfg_ctrl - Control configuration in IPA end-point |
| 440 | * @ipa_ep_suspend: 0 - ENDP is enabled, 1 - ENDP is suspended (disabled). |
| 441 | * Valid for PROD Endpoints |
| 442 | * @ipa_ep_delay: 0 - ENDP is free-running, 1 - ENDP is delayed. |
| 443 | * SW controls the data flow of an endpoint usind this bit. |
| 444 | * Valid for CONS Endpoints |
| 445 | */ |
| 446 | struct ipa_ep_cfg_ctrl { |
| 447 | bool ipa_ep_suspend; |
| 448 | bool ipa_ep_delay; |
| 449 | }; |
| 450 | |
| 451 | /** |
| 452 | * x should be in bytes |
| 453 | */ |
| 454 | #define IPA_NUM_OF_FIFO_DESC(x) (x/sizeof(struct sps_iovec)) |
| 455 | typedef void (*ipa_notify_cb)(void *priv, enum ipa_dp_evt_type evt, |
| 456 | unsigned long data); |
| 457 | |
| 458 | /** |
Skylar Chang | fcf36c2 | 2016-10-04 14:15:25 -0700 | [diff] [blame] | 459 | * enum ipa_wdi_meter_evt_type - type of event client callback is |
| 460 | * for AP+STA mode metering |
| 461 | * @IPA_GET_WDI_SAP_STATS: get IPA_stats betwen SAP and STA - |
| 462 | * use ipa_get_wdi_sap_stats structure |
| 463 | * @IPA_SET_WIFI_QUOTA: set quota limit on STA - |
| 464 | * use ipa_set_wifi_quota structure |
| 465 | */ |
| 466 | enum ipa_wdi_meter_evt_type { |
| 467 | IPA_GET_WDI_SAP_STATS, |
| 468 | IPA_SET_WIFI_QUOTA, |
| 469 | }; |
| 470 | |
| 471 | struct ipa_get_wdi_sap_stats { |
| 472 | /* indicate to reset stats after query */ |
| 473 | uint8_t reset_stats; |
| 474 | /* indicate valid stats from wlan-fw */ |
| 475 | uint8_t stats_valid; |
| 476 | /* Tx: SAP->STA */ |
| 477 | uint64_t ipv4_tx_packets; |
| 478 | uint64_t ipv4_tx_bytes; |
| 479 | /* Rx: STA->SAP */ |
| 480 | uint64_t ipv4_rx_packets; |
| 481 | uint64_t ipv4_rx_bytes; |
| 482 | uint64_t ipv6_tx_packets; |
| 483 | uint64_t ipv6_tx_bytes; |
| 484 | uint64_t ipv6_rx_packets; |
| 485 | uint64_t ipv6_rx_bytes; |
| 486 | }; |
| 487 | |
| 488 | /** |
| 489 | * struct ipa_set_wifi_quota - structure used for |
| 490 | * IPA_SET_WIFI_QUOTA. |
| 491 | * |
| 492 | * @quota_bytes: Quota (in bytes) for the STA interface. |
| 493 | * @set_quota: Indicate whether to set the quota (use 1) or |
| 494 | * unset the quota. |
| 495 | * |
| 496 | */ |
| 497 | struct ipa_set_wifi_quota { |
| 498 | uint64_t quota_bytes; |
| 499 | uint8_t set_quota; |
| 500 | /* indicate valid quota set from wlan-fw */ |
| 501 | uint8_t set_valid; |
| 502 | }; |
| 503 | |
| 504 | typedef void (*ipa_wdi_meter_notifier_cb)(enum ipa_wdi_meter_evt_type evt, |
| 505 | void *data); |
| 506 | |
| 507 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 508 | * struct ipa_connect_params - low-level client connect input parameters. Either |
| 509 | * client allocates the data and desc FIFO and specifies that in data+desc OR |
| 510 | * specifies sizes and pipe_mem pref and IPA does the allocation. |
| 511 | * |
| 512 | * @ipa_ep_cfg: IPA EP configuration |
| 513 | * @client: type of "client" |
| 514 | * @client_bam_hdl: client SPS handle |
| 515 | * @client_ep_idx: client PER EP index |
| 516 | * @priv: callback cookie |
| 517 | * @notify: callback |
| 518 | * priv - callback cookie evt - type of event data - data relevant |
| 519 | * to event. May not be valid. See event_type enum for valid |
| 520 | * cases. |
| 521 | * @desc_fifo_sz: size of desc FIFO |
| 522 | * @data_fifo_sz: size of data FIFO |
| 523 | * @pipe_mem_preferred: if true, try to alloc the FIFOs in pipe mem, fallback |
| 524 | * to sys mem if pipe mem alloc fails |
| 525 | * @desc: desc FIFO meta-data when client has allocated it |
| 526 | * @data: data FIFO meta-data when client has allocated it |
| 527 | * @skip_ep_cfg: boolean field that determines if EP should be configured |
| 528 | * by IPA driver |
| 529 | * @keep_ipa_awake: when true, IPA will not be clock gated |
| 530 | */ |
| 531 | struct ipa_connect_params { |
| 532 | struct ipa_ep_cfg ipa_ep_cfg; |
| 533 | enum ipa_client_type client; |
| 534 | unsigned long client_bam_hdl; |
| 535 | u32 client_ep_idx; |
| 536 | void *priv; |
| 537 | ipa_notify_cb notify; |
| 538 | u32 desc_fifo_sz; |
| 539 | u32 data_fifo_sz; |
| 540 | bool pipe_mem_preferred; |
| 541 | struct sps_mem_buffer desc; |
| 542 | struct sps_mem_buffer data; |
| 543 | bool skip_ep_cfg; |
| 544 | bool keep_ipa_awake; |
| 545 | }; |
| 546 | |
| 547 | /** |
| 548 | * struct ipa_sps_params - SPS related output parameters resulting from |
| 549 | * low/high level client connect |
| 550 | * @ipa_bam_hdl: IPA SPS handle |
| 551 | * @ipa_ep_idx: IPA PER EP index |
| 552 | * @desc: desc FIFO meta-data |
| 553 | * @data: data FIFO meta-data |
| 554 | */ |
| 555 | struct ipa_sps_params { |
| 556 | unsigned long ipa_bam_hdl; |
| 557 | u32 ipa_ep_idx; |
| 558 | struct sps_mem_buffer desc; |
| 559 | struct sps_mem_buffer data; |
| 560 | }; |
| 561 | |
| 562 | /** |
| 563 | * struct ipa_tx_intf - interface tx properties |
| 564 | * @num_props: number of tx properties |
| 565 | * @prop: the tx properties array |
| 566 | */ |
| 567 | struct ipa_tx_intf { |
| 568 | u32 num_props; |
| 569 | struct ipa_ioc_tx_intf_prop *prop; |
| 570 | }; |
| 571 | |
| 572 | /** |
| 573 | * struct ipa_rx_intf - interface rx properties |
| 574 | * @num_props: number of rx properties |
| 575 | * @prop: the rx properties array |
| 576 | */ |
| 577 | struct ipa_rx_intf { |
| 578 | u32 num_props; |
| 579 | struct ipa_ioc_rx_intf_prop *prop; |
| 580 | }; |
| 581 | |
| 582 | /** |
| 583 | * struct ipa_ext_intf - interface ext properties |
| 584 | * @excp_pipe_valid: is next field valid? |
| 585 | * @excp_pipe: exception packets should be routed to this pipe |
| 586 | * @num_props: number of ext properties |
| 587 | * @prop: the ext properties array |
| 588 | */ |
| 589 | struct ipa_ext_intf { |
| 590 | bool excp_pipe_valid; |
| 591 | enum ipa_client_type excp_pipe; |
| 592 | u32 num_props; |
| 593 | struct ipa_ioc_ext_intf_prop *prop; |
| 594 | }; |
| 595 | |
| 596 | /** |
| 597 | * struct ipa_sys_connect_params - information needed to setup an IPA end-point |
| 598 | * in system-BAM mode |
| 599 | * @ipa_ep_cfg: IPA EP configuration |
| 600 | * @client: the type of client who "owns" the EP |
| 601 | * @desc_fifo_sz: size of desc FIFO. This number is used to allocate the desc |
| 602 | * fifo for BAM. For GSI, this size is used by IPA driver as a |
| 603 | * baseline to calculate the GSI ring size in the following way: |
| 604 | * For PROD pipes, GSI ring is 4 * desc_fifo_sz. |
| 605 | For PROD pipes, GSI ring is 2 * desc_fifo_sz. |
| 606 | * @priv: callback cookie |
| 607 | * @notify: callback |
| 608 | * priv - callback cookie |
| 609 | * evt - type of event |
| 610 | * data - data relevant to event. May not be valid. See event_type |
| 611 | * enum for valid cases. |
| 612 | * @skip_ep_cfg: boolean field that determines if EP should be configured |
| 613 | * by IPA driver |
| 614 | * @keep_ipa_awake: when true, IPA will not be clock gated |
| 615 | * @napi_enabled: when true, IPA call client callback to start polling |
| 616 | */ |
| 617 | struct ipa_sys_connect_params { |
| 618 | struct ipa_ep_cfg ipa_ep_cfg; |
| 619 | enum ipa_client_type client; |
| 620 | u32 desc_fifo_sz; |
| 621 | void *priv; |
| 622 | ipa_notify_cb notify; |
| 623 | bool skip_ep_cfg; |
| 624 | bool keep_ipa_awake; |
| 625 | bool napi_enabled; |
Gidon Studinski | 3021a6f | 2016-11-10 12:48:48 +0200 | [diff] [blame] | 626 | bool recycle_enabled; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 627 | }; |
| 628 | |
| 629 | /** |
| 630 | * struct ipa_tx_meta - meta-data for the TX packet |
| 631 | * @dma_address: dma mapped address of TX packet |
| 632 | * @dma_address_valid: is above field valid? |
| 633 | */ |
| 634 | struct ipa_tx_meta { |
| 635 | u8 pkt_init_dst_ep; |
| 636 | bool pkt_init_dst_ep_valid; |
| 637 | bool pkt_init_dst_ep_remote; |
| 638 | dma_addr_t dma_address; |
| 639 | bool dma_address_valid; |
| 640 | }; |
| 641 | |
| 642 | /** |
| 643 | * typedef ipa_msg_free_fn - callback function |
| 644 | * @param buff - [in] the message payload to free |
| 645 | * @param len - [in] size of message payload |
| 646 | * @param type - [in] the message type |
| 647 | * |
| 648 | * Message callback registered by kernel client with IPA driver to |
| 649 | * free message payload after IPA driver processing is complete |
| 650 | * |
| 651 | * No return value |
| 652 | */ |
| 653 | typedef void (*ipa_msg_free_fn)(void *buff, u32 len, u32 type); |
| 654 | |
| 655 | /** |
| 656 | * typedef ipa_msg_pull_fn - callback function |
| 657 | * @param buff - [in] where to copy message payload |
| 658 | * @param len - [in] size of buffer to copy payload into |
| 659 | * @param type - [in] the message type |
| 660 | * |
| 661 | * Message callback registered by kernel client with IPA driver for |
| 662 | * IPA driver to pull messages from the kernel client upon demand from |
| 663 | * user-space |
| 664 | * |
| 665 | * Returns how many bytes were copied into the buffer. |
| 666 | */ |
| 667 | typedef int (*ipa_msg_pull_fn)(void *buff, u32 len, u32 type); |
| 668 | |
| 669 | /** |
| 670 | * enum ipa_voltage_level - IPA Voltage levels |
| 671 | */ |
| 672 | enum ipa_voltage_level { |
| 673 | IPA_VOLTAGE_UNSPECIFIED, |
Skylar Chang | 448d8b8 | 2017-08-08 17:30:32 -0700 | [diff] [blame] | 674 | IPA_VOLTAGE_SVS2 = IPA_VOLTAGE_UNSPECIFIED, |
| 675 | IPA_VOLTAGE_SVS, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 676 | IPA_VOLTAGE_NOMINAL, |
| 677 | IPA_VOLTAGE_TURBO, |
| 678 | IPA_VOLTAGE_MAX, |
| 679 | }; |
| 680 | |
| 681 | /** |
| 682 | * enum ipa_rm_event - IPA RM events |
| 683 | * |
| 684 | * Indicate the resource state change |
| 685 | */ |
| 686 | enum ipa_rm_event { |
| 687 | IPA_RM_RESOURCE_GRANTED, |
| 688 | IPA_RM_RESOURCE_RELEASED |
| 689 | }; |
| 690 | |
| 691 | typedef void (*ipa_rm_notify_cb)(void *user_data, |
| 692 | enum ipa_rm_event event, |
| 693 | unsigned long data); |
| 694 | /** |
| 695 | * struct ipa_rm_register_params - information needed to |
| 696 | * register IPA RM client with IPA RM |
| 697 | * |
| 698 | * @user_data: IPA RM client provided information |
| 699 | * to be passed to notify_cb callback below |
| 700 | * @notify_cb: callback which is called by resource |
| 701 | * to notify the IPA RM client about its state |
| 702 | * change IPA RM client is expected to perform non |
| 703 | * blocking operations only in notify_cb and |
| 704 | * release notification context as soon as |
| 705 | * possible. |
| 706 | */ |
| 707 | struct ipa_rm_register_params { |
| 708 | void *user_data; |
| 709 | ipa_rm_notify_cb notify_cb; |
| 710 | }; |
| 711 | |
| 712 | /** |
| 713 | * struct ipa_rm_create_params - information needed to initialize |
| 714 | * the resource |
| 715 | * @name: resource name |
| 716 | * @floor_voltage: floor voltage needed for client to operate in maximum |
| 717 | * bandwidth. |
| 718 | * @reg_params: register parameters, contains are ignored |
| 719 | * for consumer resource NULL should be provided |
| 720 | * for consumer resource |
| 721 | * @request_resource: function which should be called to request resource, |
| 722 | * NULL should be provided for producer resource |
| 723 | * @release_resource: function which should be called to release resource, |
| 724 | * NULL should be provided for producer resource |
| 725 | * |
| 726 | * IPA RM client is expected to perform non blocking operations only |
| 727 | * in request_resource and release_resource functions and |
| 728 | * release notification context as soon as possible. |
| 729 | */ |
| 730 | struct ipa_rm_create_params { |
| 731 | enum ipa_rm_resource_name name; |
| 732 | enum ipa_voltage_level floor_voltage; |
| 733 | struct ipa_rm_register_params reg_params; |
| 734 | int (*request_resource)(void); |
| 735 | int (*release_resource)(void); |
| 736 | }; |
| 737 | |
| 738 | /** |
| 739 | * struct ipa_rm_perf_profile - information regarding IPA RM client performance |
| 740 | * profile |
| 741 | * |
| 742 | * @max_bandwidth_mbps: maximum bandwidth need of the client in Mbps |
| 743 | */ |
| 744 | struct ipa_rm_perf_profile { |
| 745 | u32 max_supported_bandwidth_mbps; |
| 746 | }; |
| 747 | |
| 748 | #define A2_MUX_HDR_NAME_V4_PREF "dmux_hdr_v4_" |
| 749 | #define A2_MUX_HDR_NAME_V6_PREF "dmux_hdr_v6_" |
| 750 | |
| 751 | /** |
| 752 | * enum teth_tethering_mode - Tethering mode (Rmnet / MBIM) |
| 753 | */ |
| 754 | enum teth_tethering_mode { |
| 755 | TETH_TETHERING_MODE_RMNET, |
| 756 | TETH_TETHERING_MODE_MBIM, |
| 757 | TETH_TETHERING_MODE_MAX, |
| 758 | }; |
| 759 | |
| 760 | /** |
| 761 | * teth_bridge_init_params - Parameters used for in/out USB API |
| 762 | * @usb_notify_cb: Callback function which should be used by the caller. |
| 763 | * Output parameter. |
| 764 | * @private_data: Data for the callback function. Should be used by the |
| 765 | * caller. Output parameter. |
| 766 | * @skip_ep_cfg: boolean field that determines if Apps-processor |
| 767 | * should or should not confiugre this end-point. |
| 768 | */ |
| 769 | struct teth_bridge_init_params { |
| 770 | ipa_notify_cb usb_notify_cb; |
| 771 | void *private_data; |
| 772 | enum ipa_client_type client; |
| 773 | bool skip_ep_cfg; |
| 774 | }; |
| 775 | |
| 776 | /** |
| 777 | * struct teth_bridge_connect_params - Parameters used in teth_bridge_connect() |
| 778 | * @ipa_usb_pipe_hdl: IPA to USB pipe handle, returned from ipa_connect() |
| 779 | * @usb_ipa_pipe_hdl: USB to IPA pipe handle, returned from ipa_connect() |
| 780 | * @tethering_mode: Rmnet or MBIM |
| 781 | * @ipa_client_type: IPA "client" name (IPA_CLIENT_USB#_PROD) |
| 782 | */ |
| 783 | struct teth_bridge_connect_params { |
| 784 | u32 ipa_usb_pipe_hdl; |
| 785 | u32 usb_ipa_pipe_hdl; |
| 786 | enum teth_tethering_mode tethering_mode; |
| 787 | enum ipa_client_type client_type; |
| 788 | }; |
| 789 | |
| 790 | /** |
| 791 | * struct ipa_tx_data_desc - information needed |
| 792 | * to send data packet to HW link: link to data descriptors |
| 793 | * priv: client specific private data |
| 794 | * @pyld_buffer: pointer to the data buffer that holds frame |
| 795 | * @pyld_len: length of the data packet |
| 796 | */ |
| 797 | struct ipa_tx_data_desc { |
| 798 | struct list_head link; |
| 799 | void *priv; |
| 800 | void *pyld_buffer; |
| 801 | u16 pyld_len; |
| 802 | }; |
| 803 | |
| 804 | /** |
| 805 | * struct ipa_rx_data - information needed |
| 806 | * to send to wlan driver on receiving data from ipa hw |
| 807 | * @skb: skb |
| 808 | * @dma_addr: DMA address of this Rx packet |
| 809 | */ |
| 810 | struct ipa_rx_data { |
| 811 | struct sk_buff *skb; |
| 812 | dma_addr_t dma_addr; |
| 813 | }; |
| 814 | |
| 815 | /** |
| 816 | * enum ipa_irq_type - IPA Interrupt Type |
| 817 | * Used to register handlers for IPA interrupts |
| 818 | * |
| 819 | * Below enum is a logical mapping and not the actual interrupt bit in HW |
| 820 | */ |
| 821 | enum ipa_irq_type { |
| 822 | IPA_BAD_SNOC_ACCESS_IRQ, |
| 823 | IPA_EOT_COAL_IRQ, |
| 824 | IPA_UC_IRQ_0, |
| 825 | IPA_UC_IRQ_1, |
| 826 | IPA_UC_IRQ_2, |
| 827 | IPA_UC_IRQ_3, |
| 828 | IPA_UC_IN_Q_NOT_EMPTY_IRQ, |
| 829 | IPA_UC_RX_CMD_Q_NOT_FULL_IRQ, |
| 830 | IPA_UC_TX_CMD_Q_NOT_FULL_IRQ, |
| 831 | IPA_UC_TO_PROC_ACK_Q_NOT_FULL_IRQ, |
| 832 | IPA_PROC_TO_UC_ACK_Q_NOT_EMPTY_IRQ, |
| 833 | IPA_RX_ERR_IRQ, |
| 834 | IPA_DEAGGR_ERR_IRQ, |
| 835 | IPA_TX_ERR_IRQ, |
| 836 | IPA_STEP_MODE_IRQ, |
| 837 | IPA_PROC_ERR_IRQ, |
| 838 | IPA_TX_SUSPEND_IRQ, |
| 839 | IPA_TX_HOLB_DROP_IRQ, |
| 840 | IPA_BAM_IDLE_IRQ, |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 841 | IPA_GSI_IDLE_IRQ = IPA_BAM_IDLE_IRQ, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 842 | IPA_IRQ_MAX |
| 843 | }; |
| 844 | |
| 845 | /** |
| 846 | * struct ipa_tx_suspend_irq_data - interrupt data for IPA_TX_SUSPEND_IRQ |
| 847 | * @endpoints: bitmask of endpoints which case IPA_TX_SUSPEND_IRQ interrupt |
| 848 | * @dma_addr: DMA address of this Rx packet |
| 849 | */ |
| 850 | struct ipa_tx_suspend_irq_data { |
| 851 | u32 endpoints; |
| 852 | }; |
| 853 | |
| 854 | |
| 855 | /** |
| 856 | * typedef ipa_irq_handler_t - irq handler/callback type |
| 857 | * @param ipa_irq_type - [in] interrupt type |
| 858 | * @param private_data - [in, out] the client private data |
| 859 | * @param interrupt_data - [out] interrupt information data |
| 860 | * |
| 861 | * callback registered by ipa_add_interrupt_handler function to |
| 862 | * handle a specific interrupt type |
| 863 | * |
| 864 | * No return value |
| 865 | */ |
| 866 | typedef void (*ipa_irq_handler_t)(enum ipa_irq_type interrupt, |
| 867 | void *private_data, |
| 868 | void *interrupt_data); |
| 869 | |
| 870 | /** |
| 871 | * struct IpaHwBamStats_t - Strucuture holding the BAM statistics |
| 872 | * |
| 873 | * @bamFifoFull : Number of times Bam Fifo got full - For In Ch: Good, |
| 874 | * For Out Ch: Bad |
| 875 | * @bamFifoEmpty : Number of times Bam Fifo got empty - For In Ch: Bad, |
| 876 | * For Out Ch: Good |
| 877 | * @bamFifoUsageHigh : Number of times Bam fifo usage went above 75% - |
| 878 | * For In Ch: Good, For Out Ch: Bad |
| 879 | * @bamFifoUsageLow : Number of times Bam fifo usage went below 25% - |
| 880 | * For In Ch: Bad, For Out Ch: Good |
| 881 | */ |
| 882 | struct IpaHwBamStats_t { |
| 883 | u32 bamFifoFull; |
| 884 | u32 bamFifoEmpty; |
| 885 | u32 bamFifoUsageHigh; |
| 886 | u32 bamFifoUsageLow; |
| 887 | u32 bamUtilCount; |
| 888 | } __packed; |
| 889 | |
| 890 | /** |
| 891 | * struct IpaHwRingStats_t - Strucuture holding the Ring statistics |
| 892 | * |
| 893 | * @ringFull : Number of times Transfer Ring got full - For In Ch: Good, |
| 894 | * For Out Ch: Bad |
| 895 | * @ringEmpty : Number of times Transfer Ring got empty - For In Ch: Bad, |
| 896 | * For Out Ch: Good |
| 897 | * @ringUsageHigh : Number of times Transfer Ring usage went above 75% - |
| 898 | * For In Ch: Good, For Out Ch: Bad |
| 899 | * @ringUsageLow : Number of times Transfer Ring usage went below 25% - |
| 900 | * For In Ch: Bad, For Out Ch: Good |
| 901 | */ |
| 902 | struct IpaHwRingStats_t { |
| 903 | u32 ringFull; |
| 904 | u32 ringEmpty; |
| 905 | u32 ringUsageHigh; |
| 906 | u32 ringUsageLow; |
| 907 | u32 RingUtilCount; |
| 908 | } __packed; |
| 909 | |
| 910 | /** |
| 911 | * struct IpaHwStatsWDIRxInfoData_t - Structure holding the WDI Rx channel |
| 912 | * structures |
| 913 | * |
| 914 | * @max_outstanding_pkts : Number of outstanding packets in Rx Ring |
| 915 | * @num_pkts_processed : Number of packets processed - cumulative |
| 916 | * @rx_ring_rp_value : Read pointer last advertized to the WLAN FW |
| 917 | * @rx_ind_ring_stats : Ring info |
| 918 | * @bam_stats : BAM info |
| 919 | * @num_bam_int_handled : Number of Bam Interrupts handled by FW |
| 920 | * @num_db : Number of times the doorbell was rung |
| 921 | * @num_unexpected_db : Number of unexpected doorbells |
| 922 | * @num_pkts_in_dis_uninit_state : number of completions we |
| 923 | * received in disabled or uninitialized state |
| 924 | * @num_ic_inj_vdev_change : Number of times the Imm Cmd is |
| 925 | * injected due to vdev_id change |
| 926 | * @num_ic_inj_fw_desc_change : Number of times the Imm Cmd is |
| 927 | * injected due to fw_desc change |
Utkarsh Saxena | 971a03c | 2017-01-22 22:04:13 +0530 | [diff] [blame] | 928 | * @num_qmb_int_handled : Number of QMB interrupts handled |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 929 | */ |
| 930 | struct IpaHwStatsWDIRxInfoData_t { |
| 931 | u32 max_outstanding_pkts; |
| 932 | u32 num_pkts_processed; |
| 933 | u32 rx_ring_rp_value; |
| 934 | struct IpaHwRingStats_t rx_ind_ring_stats; |
| 935 | struct IpaHwBamStats_t bam_stats; |
| 936 | u32 num_bam_int_handled; |
| 937 | u32 num_db; |
| 938 | u32 num_unexpected_db; |
| 939 | u32 num_pkts_in_dis_uninit_state; |
| 940 | u32 num_ic_inj_vdev_change; |
| 941 | u32 num_ic_inj_fw_desc_change; |
Utkarsh Saxena | 971a03c | 2017-01-22 22:04:13 +0530 | [diff] [blame] | 942 | u32 num_qmb_int_handled; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 943 | u32 reserved1; |
| 944 | u32 reserved2; |
| 945 | } __packed; |
| 946 | |
| 947 | /** |
| 948 | * struct IpaHwStatsWDITxInfoData_t - Structure holding the WDI Tx channel |
| 949 | * structures |
| 950 | * |
| 951 | * @num_pkts_processed : Number of packets processed - cumulative |
| 952 | * @copy_engine_doorbell_value : latest value of doorbell written to copy engine |
| 953 | * @num_db_fired : Number of DB from uC FW to Copy engine |
| 954 | * @tx_comp_ring_stats : ring info |
| 955 | * @bam_stats : BAM info |
| 956 | * @num_db : Number of times the doorbell was rung |
| 957 | * @num_unexpected_db : Number of unexpected doorbells |
| 958 | * @num_bam_int_handled : Number of Bam Interrupts handled by FW |
| 959 | * @num_bam_int_in_non_running_state : Number of Bam interrupts while not in |
| 960 | * Running state |
| 961 | * @num_qmb_int_handled : Number of QMB interrupts handled |
| 962 | */ |
| 963 | struct IpaHwStatsWDITxInfoData_t { |
| 964 | u32 num_pkts_processed; |
| 965 | u32 copy_engine_doorbell_value; |
| 966 | u32 num_db_fired; |
| 967 | struct IpaHwRingStats_t tx_comp_ring_stats; |
| 968 | struct IpaHwBamStats_t bam_stats; |
| 969 | u32 num_db; |
| 970 | u32 num_unexpected_db; |
| 971 | u32 num_bam_int_handled; |
| 972 | u32 num_bam_int_in_non_running_state; |
| 973 | u32 num_qmb_int_handled; |
| 974 | u32 num_bam_int_handled_while_wait_for_bam; |
| 975 | } __packed; |
| 976 | |
| 977 | /** |
| 978 | * struct IpaHwStatsWDIInfoData_t - Structure holding the WDI channel structures |
| 979 | * |
| 980 | * @rx_ch_stats : RX stats |
| 981 | * @tx_ch_stats : TX stats |
| 982 | */ |
| 983 | struct IpaHwStatsWDIInfoData_t { |
| 984 | struct IpaHwStatsWDIRxInfoData_t rx_ch_stats; |
| 985 | struct IpaHwStatsWDITxInfoData_t tx_ch_stats; |
| 986 | } __packed; |
| 987 | |
| 988 | |
| 989 | /** |
| 990 | * struct ipa_wdi_ul_params - WDI_RX configuration |
| 991 | * @rdy_ring_base_pa: physical address of the base of the Rx ring (containing |
| 992 | * Rx buffers) |
| 993 | * @rdy_ring_size: size of the Rx ring in bytes |
| 994 | * @rdy_ring_rp_pa: physical address of the location through which IPA uc is |
| 995 | * reading (WDI-1.0) |
| 996 | * @rdy_comp_ring_base_pa: physical address of the base of the Rx completion |
| 997 | * ring (WDI-2.0) |
| 998 | * @rdy_comp_ring_wp_pa: physical address of the location through which IPA |
| 999 | * uc is writing (WDI-2.0) |
| 1000 | * @rdy_comp_ring_size: size of the Rx_completion ring in bytes |
| 1001 | * expected to communicate about the Read pointer into the Rx Ring |
| 1002 | */ |
| 1003 | struct ipa_wdi_ul_params { |
| 1004 | phys_addr_t rdy_ring_base_pa; |
| 1005 | u32 rdy_ring_size; |
| 1006 | phys_addr_t rdy_ring_rp_pa; |
| 1007 | phys_addr_t rdy_comp_ring_base_pa; |
| 1008 | phys_addr_t rdy_comp_ring_wp_pa; |
| 1009 | u32 rdy_comp_ring_size; |
| 1010 | u32 *rdy_ring_rp_va; |
| 1011 | u32 *rdy_comp_ring_wp_va; |
| 1012 | }; |
| 1013 | |
| 1014 | /** |
| 1015 | * struct ipa_wdi_ul_params_smmu - WDI_RX configuration (with WLAN SMMU) |
| 1016 | * @rdy_ring: SG table describing the Rx ring (containing Rx buffers) |
| 1017 | * @rdy_ring_size: size of the Rx ring in bytes |
| 1018 | * @rdy_ring_rp_pa: physical address of the location through which IPA uc is |
| 1019 | * expected to communicate about the Read pointer into the Rx Ring |
| 1020 | */ |
| 1021 | struct ipa_wdi_ul_params_smmu { |
| 1022 | struct sg_table rdy_ring; |
| 1023 | u32 rdy_ring_size; |
| 1024 | phys_addr_t rdy_ring_rp_pa; |
| 1025 | struct sg_table rdy_comp_ring; |
| 1026 | phys_addr_t rdy_comp_ring_wp_pa; |
| 1027 | u32 rdy_comp_ring_size; |
| 1028 | u32 *rdy_ring_rp_va; |
| 1029 | u32 *rdy_comp_ring_wp_va; |
| 1030 | }; |
| 1031 | |
| 1032 | /** |
| 1033 | * struct ipa_wdi_dl_params - WDI_TX configuration |
| 1034 | * @comp_ring_base_pa: physical address of the base of the Tx completion ring |
| 1035 | * @comp_ring_size: size of the Tx completion ring in bytes |
| 1036 | * @ce_ring_base_pa: physical address of the base of the Copy Engine Source |
| 1037 | * Ring |
| 1038 | * @ce_door_bell_pa: physical address of the doorbell that the IPA uC has to |
| 1039 | * write into to trigger the copy engine |
| 1040 | * @ce_ring_size: Copy Engine Ring size in bytes |
| 1041 | * @num_tx_buffers: Number of pkt buffers allocated |
| 1042 | */ |
| 1043 | struct ipa_wdi_dl_params { |
| 1044 | phys_addr_t comp_ring_base_pa; |
| 1045 | u32 comp_ring_size; |
| 1046 | phys_addr_t ce_ring_base_pa; |
| 1047 | phys_addr_t ce_door_bell_pa; |
| 1048 | u32 ce_ring_size; |
| 1049 | u32 num_tx_buffers; |
| 1050 | }; |
| 1051 | |
| 1052 | /** |
| 1053 | * struct ipa_wdi_dl_params_smmu - WDI_TX configuration (with WLAN SMMU) |
| 1054 | * @comp_ring: SG table describing the Tx completion ring |
| 1055 | * @comp_ring_size: size of the Tx completion ring in bytes |
| 1056 | * @ce_ring: SG table describing the Copy Engine Source Ring |
| 1057 | * @ce_door_bell_pa: physical address of the doorbell that the IPA uC has to |
| 1058 | * write into to trigger the copy engine |
| 1059 | * @ce_ring_size: Copy Engine Ring size in bytes |
| 1060 | * @num_tx_buffers: Number of pkt buffers allocated |
| 1061 | */ |
| 1062 | struct ipa_wdi_dl_params_smmu { |
| 1063 | struct sg_table comp_ring; |
| 1064 | u32 comp_ring_size; |
| 1065 | struct sg_table ce_ring; |
| 1066 | phys_addr_t ce_door_bell_pa; |
| 1067 | u32 ce_ring_size; |
| 1068 | u32 num_tx_buffers; |
| 1069 | }; |
| 1070 | |
| 1071 | /** |
| 1072 | * struct ipa_wdi_in_params - information provided by WDI client |
| 1073 | * @sys: IPA EP configuration info |
| 1074 | * @ul: WDI_RX configuration info |
| 1075 | * @dl: WDI_TX configuration info |
| 1076 | * @ul_smmu: WDI_RX configuration info when WLAN uses SMMU |
| 1077 | * @dl_smmu: WDI_TX configuration info when WLAN uses SMMU |
| 1078 | * @smmu_enabled: true if WLAN uses SMMU |
Skylar Chang | fcf36c2 | 2016-10-04 14:15:25 -0700 | [diff] [blame] | 1079 | * @ipa_wdi_meter_notifier_cb: Get WDI stats and quato info |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1080 | */ |
| 1081 | struct ipa_wdi_in_params { |
| 1082 | struct ipa_sys_connect_params sys; |
| 1083 | union { |
| 1084 | struct ipa_wdi_ul_params ul; |
| 1085 | struct ipa_wdi_dl_params dl; |
| 1086 | struct ipa_wdi_ul_params_smmu ul_smmu; |
| 1087 | struct ipa_wdi_dl_params_smmu dl_smmu; |
| 1088 | } u; |
| 1089 | bool smmu_enabled; |
Skylar Chang | fcf36c2 | 2016-10-04 14:15:25 -0700 | [diff] [blame] | 1090 | #ifdef IPA_WAN_MSG_IPv6_ADDR_GW_LEN |
| 1091 | ipa_wdi_meter_notifier_cb wdi_notify; |
| 1092 | #endif |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1093 | }; |
| 1094 | |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 1095 | enum ipa_upstream_type { |
| 1096 | IPA_UPSTEAM_MODEM = 1, |
| 1097 | IPA_UPSTEAM_WLAN, |
| 1098 | IPA_UPSTEAM_MAX |
| 1099 | }; |
| 1100 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1101 | /** |
| 1102 | * struct ipa_wdi_out_params - information provided to WDI client |
| 1103 | * @uc_door_bell_pa: physical address of IPA uc doorbell |
| 1104 | * @clnt_hdl: opaque handle assigned to client |
| 1105 | */ |
| 1106 | struct ipa_wdi_out_params { |
| 1107 | phys_addr_t uc_door_bell_pa; |
| 1108 | u32 clnt_hdl; |
| 1109 | }; |
| 1110 | |
| 1111 | /** |
| 1112 | * struct ipa_wdi_db_params - information provided to retrieve |
| 1113 | * physical address of uC doorbell |
| 1114 | * @client: type of "client" (IPA_CLIENT_WLAN#_PROD/CONS) |
| 1115 | * @uc_door_bell_pa: physical address of IPA uc doorbell |
| 1116 | */ |
| 1117 | struct ipa_wdi_db_params { |
| 1118 | enum ipa_client_type client; |
| 1119 | phys_addr_t uc_door_bell_pa; |
| 1120 | }; |
| 1121 | |
| 1122 | /** |
| 1123 | * struct ipa_wdi_uc_ready_params - uC ready CB parameters |
| 1124 | * @is_uC_ready: uC loaded or not |
| 1125 | * @priv : callback cookie |
| 1126 | * @notify: callback |
| 1127 | */ |
| 1128 | typedef void (*ipa_uc_ready_cb)(void *priv); |
| 1129 | struct ipa_wdi_uc_ready_params { |
| 1130 | bool is_uC_ready; |
| 1131 | void *priv; |
| 1132 | ipa_uc_ready_cb notify; |
| 1133 | }; |
| 1134 | |
| 1135 | /** |
| 1136 | * struct ipa_wdi_buffer_info - address info of a WLAN allocated buffer |
| 1137 | * @pa: physical address of the buffer |
| 1138 | * @iova: IOVA of the buffer as embedded inside the WDI descriptors |
| 1139 | * @size: size in bytes of the buffer |
| 1140 | * @result: result of map or unmap operations (out param) |
| 1141 | * |
| 1142 | * IPA driver will create/release IOMMU mapping in IPA SMMU from iova->pa |
| 1143 | */ |
| 1144 | struct ipa_wdi_buffer_info { |
| 1145 | phys_addr_t pa; |
| 1146 | unsigned long iova; |
| 1147 | size_t size; |
| 1148 | int result; |
| 1149 | }; |
| 1150 | |
| 1151 | /** |
| 1152 | * struct ipa_gsi_ep_config - IPA GSI endpoint configurations |
| 1153 | * |
| 1154 | * @ipa_ep_num: IPA EP pipe number |
| 1155 | * @ipa_gsi_chan_num: GSI channel number |
| 1156 | * @ipa_if_tlv: number of IPA_IF TLV |
| 1157 | * @ipa_if_aos: number of IPA_IF AOS |
| 1158 | * @ee: Execution environment |
| 1159 | */ |
| 1160 | struct ipa_gsi_ep_config { |
| 1161 | int ipa_ep_num; |
| 1162 | int ipa_gsi_chan_num; |
| 1163 | int ipa_if_tlv; |
| 1164 | int ipa_if_aos; |
| 1165 | int ee; |
| 1166 | }; |
| 1167 | |
Skylar Chang | 48afa05 | 2017-10-25 09:32:57 -0700 | [diff] [blame] | 1168 | /** |
| 1169 | * struct ipa_tz_unlock_reg_info - Used in order unlock regions of memory by TZ |
| 1170 | * @reg_addr - Physical address of the start of the region |
| 1171 | * @size - Size of the region in bytes |
| 1172 | */ |
| 1173 | struct ipa_tz_unlock_reg_info { |
| 1174 | u64 reg_addr; |
| 1175 | u64 size; |
| 1176 | }; |
| 1177 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1178 | #if defined CONFIG_IPA || defined CONFIG_IPA3 |
| 1179 | |
| 1180 | /* |
| 1181 | * Connect / Disconnect |
| 1182 | */ |
| 1183 | int ipa_connect(const struct ipa_connect_params *in, struct ipa_sps_params *sps, |
| 1184 | u32 *clnt_hdl); |
| 1185 | int ipa_disconnect(u32 clnt_hdl); |
| 1186 | |
| 1187 | /* |
| 1188 | * Resume / Suspend |
| 1189 | */ |
| 1190 | int ipa_reset_endpoint(u32 clnt_hdl); |
| 1191 | |
| 1192 | /* |
| 1193 | * Remove ep delay |
| 1194 | */ |
| 1195 | int ipa_clear_endpoint_delay(u32 clnt_hdl); |
| 1196 | |
| 1197 | /* |
| 1198 | * Disable ep |
| 1199 | */ |
| 1200 | int ipa_disable_endpoint(u32 clnt_hdl); |
| 1201 | |
| 1202 | /* |
| 1203 | * Configuration |
| 1204 | */ |
| 1205 | int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg); |
| 1206 | |
| 1207 | int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg); |
| 1208 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 1209 | int ipa_cfg_ep_conn_track(u32 clnt_hdl, |
| 1210 | const struct ipa_ep_cfg_conn_track *ep_conn_track); |
| 1211 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1212 | int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg); |
| 1213 | |
| 1214 | int ipa_cfg_ep_hdr_ext(u32 clnt_hdl, |
| 1215 | const struct ipa_ep_cfg_hdr_ext *ipa_ep_cfg); |
| 1216 | |
| 1217 | int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ipa_ep_cfg); |
| 1218 | |
| 1219 | int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ipa_ep_cfg); |
| 1220 | |
| 1221 | int ipa_cfg_ep_deaggr(u32 clnt_hdl, |
| 1222 | const struct ipa_ep_cfg_deaggr *ipa_ep_cfg); |
| 1223 | |
| 1224 | int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ipa_ep_cfg); |
| 1225 | |
| 1226 | int ipa_cfg_ep_holb(u32 clnt_hdl, const struct ipa_ep_cfg_holb *ipa_ep_cfg); |
| 1227 | |
| 1228 | int ipa_cfg_ep_cfg(u32 clnt_hdl, const struct ipa_ep_cfg_cfg *ipa_ep_cfg); |
| 1229 | |
| 1230 | int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, const struct ipa_ep_cfg_metadata_mask |
| 1231 | *ipa_ep_cfg); |
| 1232 | |
| 1233 | int ipa_cfg_ep_holb_by_client(enum ipa_client_type client, |
| 1234 | const struct ipa_ep_cfg_holb *ipa_ep_cfg); |
| 1235 | |
| 1236 | int ipa_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl); |
| 1237 | |
| 1238 | /* |
| 1239 | * Header removal / addition |
| 1240 | */ |
| 1241 | int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs); |
| 1242 | |
| 1243 | int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls); |
| 1244 | |
| 1245 | int ipa_commit_hdr(void); |
| 1246 | |
| 1247 | int ipa_reset_hdr(void); |
| 1248 | |
| 1249 | int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup); |
| 1250 | |
| 1251 | int ipa_put_hdr(u32 hdr_hdl); |
| 1252 | |
| 1253 | int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy); |
| 1254 | |
| 1255 | /* |
| 1256 | * Header Processing Context |
| 1257 | */ |
| 1258 | int ipa_add_hdr_proc_ctx(struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs); |
| 1259 | |
| 1260 | int ipa_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls); |
| 1261 | |
| 1262 | /* |
| 1263 | * Routing |
| 1264 | */ |
| 1265 | int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules); |
| 1266 | |
| 1267 | int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls); |
| 1268 | |
| 1269 | int ipa_commit_rt(enum ipa_ip_type ip); |
| 1270 | |
| 1271 | int ipa_reset_rt(enum ipa_ip_type ip); |
| 1272 | |
| 1273 | int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup); |
| 1274 | |
| 1275 | int ipa_put_rt_tbl(u32 rt_tbl_hdl); |
| 1276 | |
| 1277 | int ipa_query_rt_index(struct ipa_ioc_get_rt_tbl_indx *in); |
| 1278 | |
| 1279 | int ipa_mdfy_rt_rule(struct ipa_ioc_mdfy_rt_rule *rules); |
| 1280 | |
| 1281 | /* |
| 1282 | * Filtering |
| 1283 | */ |
| 1284 | int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules); |
| 1285 | |
| 1286 | int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls); |
| 1287 | |
| 1288 | int ipa_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *rules); |
| 1289 | |
| 1290 | int ipa_commit_flt(enum ipa_ip_type ip); |
| 1291 | |
| 1292 | int ipa_reset_flt(enum ipa_ip_type ip); |
| 1293 | |
| 1294 | /* |
| 1295 | * NAT |
| 1296 | */ |
| 1297 | int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem); |
| 1298 | |
| 1299 | int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init); |
| 1300 | |
| 1301 | int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); |
| 1302 | |
| 1303 | int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del); |
| 1304 | |
| 1305 | /* |
| 1306 | * Messaging |
| 1307 | */ |
| 1308 | int ipa_send_msg(struct ipa_msg_meta *meta, void *buff, |
| 1309 | ipa_msg_free_fn callback); |
| 1310 | int ipa_register_pull_msg(struct ipa_msg_meta *meta, ipa_msg_pull_fn callback); |
| 1311 | int ipa_deregister_pull_msg(struct ipa_msg_meta *meta); |
| 1312 | |
| 1313 | /* |
| 1314 | * Interface |
| 1315 | */ |
| 1316 | int ipa_register_intf(const char *name, const struct ipa_tx_intf *tx, |
| 1317 | const struct ipa_rx_intf *rx); |
| 1318 | int ipa_register_intf_ext(const char *name, const struct ipa_tx_intf *tx, |
| 1319 | const struct ipa_rx_intf *rx, |
| 1320 | const struct ipa_ext_intf *ext); |
| 1321 | int ipa_deregister_intf(const char *name); |
| 1322 | |
| 1323 | /* |
| 1324 | * Aggregation |
| 1325 | */ |
| 1326 | int ipa_set_aggr_mode(enum ipa_aggr_mode mode); |
| 1327 | |
| 1328 | int ipa_set_qcncm_ndp_sig(char sig[3]); |
| 1329 | |
| 1330 | int ipa_set_single_ndp_per_mbim(bool enable); |
| 1331 | |
| 1332 | /* |
| 1333 | * Data path |
| 1334 | */ |
| 1335 | int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb, |
| 1336 | struct ipa_tx_meta *metadata); |
| 1337 | |
| 1338 | /* |
| 1339 | * To transfer multiple data packets |
| 1340 | * While passing the data descriptor list, the anchor node |
| 1341 | * should be of type struct ipa_tx_data_desc not list_head |
| 1342 | */ |
| 1343 | int ipa_tx_dp_mul(enum ipa_client_type dst, |
| 1344 | struct ipa_tx_data_desc *data_desc); |
| 1345 | |
| 1346 | void ipa_free_skb(struct ipa_rx_data *); |
| 1347 | int ipa_rx_poll(u32 clnt_hdl, int budget); |
| 1348 | void ipa_recycle_wan_skb(struct sk_buff *skb); |
| 1349 | |
| 1350 | /* |
| 1351 | * System pipes |
| 1352 | */ |
| 1353 | int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl); |
| 1354 | |
| 1355 | int ipa_teardown_sys_pipe(u32 clnt_hdl); |
| 1356 | |
| 1357 | int ipa_connect_wdi_pipe(struct ipa_wdi_in_params *in, |
| 1358 | struct ipa_wdi_out_params *out); |
| 1359 | int ipa_disconnect_wdi_pipe(u32 clnt_hdl); |
| 1360 | int ipa_enable_wdi_pipe(u32 clnt_hdl); |
| 1361 | int ipa_disable_wdi_pipe(u32 clnt_hdl); |
| 1362 | int ipa_resume_wdi_pipe(u32 clnt_hdl); |
| 1363 | int ipa_suspend_wdi_pipe(u32 clnt_hdl); |
| 1364 | int ipa_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats); |
| 1365 | u16 ipa_get_smem_restr_bytes(void); |
Skylar Chang | fcf36c2 | 2016-10-04 14:15:25 -0700 | [diff] [blame] | 1366 | int ipa_broadcast_wdi_quota_reach_ind(uint32_t fid, |
| 1367 | uint64_t num_bytes); |
| 1368 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1369 | /* |
| 1370 | * To retrieve doorbell physical address of |
| 1371 | * wlan pipes |
| 1372 | */ |
| 1373 | int ipa_uc_wdi_get_dbpa(struct ipa_wdi_db_params *out); |
| 1374 | |
| 1375 | /* |
| 1376 | * To register uC ready callback if uC not ready |
| 1377 | * and also check uC readiness |
| 1378 | * if uC not ready only, register callback |
| 1379 | */ |
| 1380 | int ipa_uc_reg_rdyCB(struct ipa_wdi_uc_ready_params *param); |
| 1381 | /* |
| 1382 | * To de-register uC ready callback |
| 1383 | */ |
| 1384 | int ipa_uc_dereg_rdyCB(void); |
| 1385 | |
| 1386 | int ipa_create_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info); |
| 1387 | int ipa_release_wdi_mapping(u32 num_buffers, struct ipa_wdi_buffer_info *info); |
| 1388 | |
| 1389 | /* |
| 1390 | * Resource manager |
| 1391 | */ |
| 1392 | int ipa_rm_create_resource(struct ipa_rm_create_params *create_params); |
| 1393 | |
| 1394 | int ipa_rm_delete_resource(enum ipa_rm_resource_name resource_name); |
| 1395 | |
| 1396 | int ipa_rm_register(enum ipa_rm_resource_name resource_name, |
| 1397 | struct ipa_rm_register_params *reg_params); |
| 1398 | |
| 1399 | int ipa_rm_deregister(enum ipa_rm_resource_name resource_name, |
| 1400 | struct ipa_rm_register_params *reg_params); |
| 1401 | |
| 1402 | int ipa_rm_set_perf_profile(enum ipa_rm_resource_name resource_name, |
| 1403 | struct ipa_rm_perf_profile *profile); |
| 1404 | |
| 1405 | int ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name, |
| 1406 | enum ipa_rm_resource_name depends_on_name); |
| 1407 | |
| 1408 | int ipa_rm_add_dependency_sync(enum ipa_rm_resource_name resource_name, |
| 1409 | enum ipa_rm_resource_name depends_on_name); |
| 1410 | |
| 1411 | int ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name, |
| 1412 | enum ipa_rm_resource_name depends_on_name); |
| 1413 | |
| 1414 | int ipa_rm_request_resource(enum ipa_rm_resource_name resource_name); |
| 1415 | |
| 1416 | int ipa_rm_release_resource(enum ipa_rm_resource_name resource_name); |
| 1417 | |
| 1418 | int ipa_rm_notify_completion(enum ipa_rm_event event, |
| 1419 | enum ipa_rm_resource_name resource_name); |
| 1420 | |
| 1421 | int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name, |
| 1422 | unsigned long msecs); |
| 1423 | |
| 1424 | int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name); |
| 1425 | |
| 1426 | int ipa_rm_inactivity_timer_request_resource( |
| 1427 | enum ipa_rm_resource_name resource_name); |
| 1428 | |
| 1429 | int ipa_rm_inactivity_timer_release_resource( |
| 1430 | enum ipa_rm_resource_name resource_name); |
| 1431 | |
| 1432 | /* |
| 1433 | * Tethering bridge (Rmnet / MBIM) |
| 1434 | */ |
| 1435 | int teth_bridge_init(struct teth_bridge_init_params *params); |
| 1436 | |
| 1437 | int teth_bridge_disconnect(enum ipa_client_type client); |
| 1438 | |
| 1439 | int teth_bridge_connect(struct teth_bridge_connect_params *connect_params); |
| 1440 | |
| 1441 | /* |
| 1442 | * Tethering client info |
| 1443 | */ |
| 1444 | void ipa_set_client(int index, enum ipacm_client_enum client, bool uplink); |
| 1445 | |
| 1446 | enum ipacm_client_enum ipa_get_client(int pipe_idx); |
| 1447 | |
| 1448 | bool ipa_get_client_uplink(int pipe_idx); |
| 1449 | |
| 1450 | /* |
| 1451 | * IPADMA |
| 1452 | */ |
| 1453 | int ipa_dma_init(void); |
| 1454 | |
| 1455 | int ipa_dma_enable(void); |
| 1456 | |
| 1457 | int ipa_dma_disable(void); |
| 1458 | |
| 1459 | int ipa_dma_sync_memcpy(u64 dest, u64 src, int len); |
| 1460 | |
| 1461 | int ipa_dma_async_memcpy(u64 dest, u64 src, int len, |
| 1462 | void (*user_cb)(void *user1), void *user_param); |
| 1463 | |
| 1464 | int ipa_dma_uc_memcpy(phys_addr_t dest, phys_addr_t src, int len); |
| 1465 | |
| 1466 | void ipa_dma_destroy(void); |
| 1467 | |
| 1468 | /* |
| 1469 | * mux id |
| 1470 | */ |
| 1471 | int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in); |
| 1472 | |
| 1473 | /* |
| 1474 | * interrupts |
| 1475 | */ |
| 1476 | int ipa_add_interrupt_handler(enum ipa_irq_type interrupt, |
| 1477 | ipa_irq_handler_t handler, |
| 1478 | bool deferred_flag, |
| 1479 | void *private_data); |
| 1480 | |
| 1481 | int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt); |
| 1482 | |
| 1483 | int ipa_restore_suspend_handler(void); |
| 1484 | |
| 1485 | /* |
| 1486 | * Miscellaneous |
| 1487 | */ |
| 1488 | void ipa_bam_reg_dump(void); |
| 1489 | |
| 1490 | int ipa_get_ep_mapping(enum ipa_client_type client); |
| 1491 | |
| 1492 | bool ipa_is_ready(void); |
| 1493 | |
| 1494 | void ipa_proxy_clk_vote(void); |
| 1495 | void ipa_proxy_clk_unvote(void); |
| 1496 | |
| 1497 | enum ipa_hw_type ipa_get_hw_type(void); |
| 1498 | |
| 1499 | bool ipa_is_client_handle_valid(u32 clnt_hdl); |
| 1500 | |
| 1501 | enum ipa_client_type ipa_get_client_mapping(int pipe_idx); |
| 1502 | |
| 1503 | enum ipa_rm_resource_name ipa_get_rm_resource_from_ep(int pipe_idx); |
| 1504 | |
| 1505 | bool ipa_get_modem_cfg_emb_pipe_flt(void); |
| 1506 | |
| 1507 | enum ipa_transport_type ipa_get_transport_type(void); |
| 1508 | |
| 1509 | struct device *ipa_get_dma_dev(void); |
| 1510 | struct iommu_domain *ipa_get_smmu_domain(void); |
| 1511 | |
| 1512 | int ipa_disable_apps_wan_cons_deaggr(uint32_t agg_size, uint32_t agg_count); |
| 1513 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1514 | const struct ipa_gsi_ep_config *ipa_get_gsi_ep_info |
| 1515 | (enum ipa_client_type client); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1516 | |
| 1517 | int ipa_stop_gsi_channel(u32 clnt_hdl); |
| 1518 | |
| 1519 | typedef void (*ipa_ready_cb)(void *user_data); |
| 1520 | |
| 1521 | /** |
| 1522 | * ipa_register_ipa_ready_cb() - register a callback to be invoked |
| 1523 | * when IPA core driver initialization is complete. |
| 1524 | * |
| 1525 | * @ipa_ready_cb: CB to be triggered. |
| 1526 | * @user_data: Data to be sent to the originator of the CB. |
| 1527 | * |
| 1528 | * Note: This function is expected to be utilized when ipa_is_ready |
| 1529 | * function returns false. |
| 1530 | * An IPA client may also use this function directly rather than |
| 1531 | * calling ipa_is_ready beforehand, as if this API returns -EEXIST, |
| 1532 | * this means IPA initialization is complete (and no callback will |
| 1533 | * be triggered). |
| 1534 | * When the callback is triggered, the client MUST perform his |
| 1535 | * operations in a different context. |
| 1536 | * |
| 1537 | * The function will return 0 on success, -ENOMEM on memory issues and |
| 1538 | * -EEXIST if IPA initialization is complete already. |
| 1539 | */ |
| 1540 | int ipa_register_ipa_ready_cb(void (*ipa_ready_cb)(void *user_data), |
| 1541 | void *user_data); |
| 1542 | |
Skylar Chang | 48afa05 | 2017-10-25 09:32:57 -0700 | [diff] [blame] | 1543 | /** |
| 1544 | * ipa_tz_unlock_reg - Unlocks memory regions so that they become accessible |
| 1545 | * from AP. |
| 1546 | * @reg_info - Pointer to array of memory regions to unlock |
| 1547 | * @num_regs - Number of elements in the array |
| 1548 | * |
| 1549 | * Converts the input array of regions to a struct that TZ understands and |
| 1550 | * issues an SCM call. |
| 1551 | * Also flushes the memory cache to DDR in order to make sure that TZ sees the |
| 1552 | * correct data structure. |
| 1553 | * |
| 1554 | * Returns: 0 on success, negative on failure |
| 1555 | */ |
| 1556 | int ipa_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, u16 num_regs); |
| 1557 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1558 | #else /* (CONFIG_IPA || CONFIG_IPA3) */ |
| 1559 | |
| 1560 | /* |
| 1561 | * Connect / Disconnect |
| 1562 | */ |
| 1563 | static inline int ipa_connect(const struct ipa_connect_params *in, |
| 1564 | struct ipa_sps_params *sps, u32 *clnt_hdl) |
| 1565 | { |
| 1566 | return -EPERM; |
| 1567 | } |
| 1568 | |
| 1569 | static inline int ipa_disconnect(u32 clnt_hdl) |
| 1570 | { |
| 1571 | return -EPERM; |
| 1572 | } |
| 1573 | |
| 1574 | /* |
| 1575 | * Resume / Suspend |
| 1576 | */ |
| 1577 | static inline int ipa_reset_endpoint(u32 clnt_hdl) |
| 1578 | { |
| 1579 | return -EPERM; |
| 1580 | } |
| 1581 | |
| 1582 | /* |
| 1583 | * Remove ep delay |
| 1584 | */ |
| 1585 | static inline int ipa_clear_endpoint_delay(u32 clnt_hdl) |
| 1586 | { |
| 1587 | return -EPERM; |
| 1588 | } |
| 1589 | |
| 1590 | /* |
| 1591 | * Disable ep |
| 1592 | */ |
| 1593 | static inline int ipa_disable_endpoint(u32 clnt_hdl) |
| 1594 | { |
| 1595 | return -EPERM; |
| 1596 | } |
| 1597 | |
| 1598 | /* |
| 1599 | * Configuration |
| 1600 | */ |
| 1601 | static inline int ipa_cfg_ep(u32 clnt_hdl, |
| 1602 | const struct ipa_ep_cfg *ipa_ep_cfg) |
| 1603 | { |
| 1604 | return -EPERM; |
| 1605 | } |
| 1606 | |
| 1607 | static inline int ipa_cfg_ep_nat(u32 clnt_hdl, |
| 1608 | const struct ipa_ep_cfg_nat *ipa_ep_cfg) |
| 1609 | { |
| 1610 | return -EPERM; |
| 1611 | } |
| 1612 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 1613 | static inline int ipa_cfg_ep_conn_track(u32 clnt_hdl, |
| 1614 | const struct ipa_ep_cfg_conn_track *ep_conn_track) |
| 1615 | { |
| 1616 | return -EPERM |
| 1617 | } |
| 1618 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1619 | static inline int ipa_cfg_ep_hdr(u32 clnt_hdl, |
| 1620 | const struct ipa_ep_cfg_hdr *ipa_ep_cfg) |
| 1621 | { |
| 1622 | return -EPERM; |
| 1623 | } |
| 1624 | |
| 1625 | static inline int ipa_cfg_ep_hdr_ext(u32 clnt_hdl, |
| 1626 | const struct ipa_ep_cfg_hdr_ext *ipa_ep_cfg) |
| 1627 | { |
| 1628 | return -EPERM; |
| 1629 | } |
| 1630 | |
| 1631 | static inline int ipa_cfg_ep_mode(u32 clnt_hdl, |
| 1632 | const struct ipa_ep_cfg_mode *ipa_ep_cfg) |
| 1633 | { |
| 1634 | return -EPERM; |
| 1635 | } |
| 1636 | |
| 1637 | static inline int ipa_cfg_ep_aggr(u32 clnt_hdl, |
| 1638 | const struct ipa_ep_cfg_aggr *ipa_ep_cfg) |
| 1639 | { |
| 1640 | return -EPERM; |
| 1641 | } |
| 1642 | |
| 1643 | static inline int ipa_cfg_ep_deaggr(u32 clnt_hdl, |
| 1644 | const struct ipa_ep_cfg_deaggr *ipa_ep_cfg) |
| 1645 | { |
| 1646 | return -EPERM; |
| 1647 | } |
| 1648 | |
| 1649 | static inline int ipa_cfg_ep_route(u32 clnt_hdl, |
| 1650 | const struct ipa_ep_cfg_route *ipa_ep_cfg) |
| 1651 | { |
| 1652 | return -EPERM; |
| 1653 | } |
| 1654 | |
| 1655 | static inline int ipa_cfg_ep_holb(u32 clnt_hdl, |
| 1656 | const struct ipa_ep_cfg_holb *ipa_ep_cfg) |
| 1657 | { |
| 1658 | return -EPERM; |
| 1659 | } |
| 1660 | |
| 1661 | static inline int ipa_cfg_ep_cfg(u32 clnt_hdl, |
| 1662 | const struct ipa_ep_cfg_cfg *ipa_ep_cfg) |
| 1663 | { |
| 1664 | return -EPERM; |
| 1665 | } |
| 1666 | |
| 1667 | static inline int ipa_cfg_ep_metadata_mask(u32 clnt_hdl, |
| 1668 | const struct ipa_ep_cfg_metadata_mask *ipa_ep_cfg) |
| 1669 | { |
| 1670 | return -EPERM; |
| 1671 | } |
| 1672 | |
| 1673 | static inline int ipa_cfg_ep_ctrl(u32 clnt_hdl, |
| 1674 | const struct ipa_ep_cfg_ctrl *ep_ctrl) |
| 1675 | { |
| 1676 | return -EPERM; |
| 1677 | } |
| 1678 | |
| 1679 | /* |
| 1680 | * Header removal / addition |
| 1681 | */ |
| 1682 | static inline int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs) |
| 1683 | { |
| 1684 | return -EPERM; |
| 1685 | } |
| 1686 | |
| 1687 | static inline int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls) |
| 1688 | { |
| 1689 | return -EPERM; |
| 1690 | } |
| 1691 | |
| 1692 | static inline int ipa_commit_hdr(void) |
| 1693 | { |
| 1694 | return -EPERM; |
| 1695 | } |
| 1696 | |
| 1697 | static inline int ipa_reset_hdr(void) |
| 1698 | { |
| 1699 | return -EPERM; |
| 1700 | } |
| 1701 | |
| 1702 | static inline int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup) |
| 1703 | { |
| 1704 | return -EPERM; |
| 1705 | } |
| 1706 | |
| 1707 | static inline int ipa_put_hdr(u32 hdr_hdl) |
| 1708 | { |
| 1709 | return -EPERM; |
| 1710 | } |
| 1711 | |
| 1712 | static inline int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy) |
| 1713 | { |
| 1714 | return -EPERM; |
| 1715 | } |
| 1716 | |
| 1717 | /* |
| 1718 | * Header Processing Context |
| 1719 | */ |
| 1720 | static inline int ipa_add_hdr_proc_ctx( |
| 1721 | struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs) |
| 1722 | { |
| 1723 | return -EPERM; |
| 1724 | } |
| 1725 | |
| 1726 | static inline int ipa_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls) |
| 1727 | { |
| 1728 | return -EPERM; |
| 1729 | } |
| 1730 | /* |
| 1731 | * Routing |
| 1732 | */ |
| 1733 | static inline int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules) |
| 1734 | { |
| 1735 | return -EPERM; |
| 1736 | } |
| 1737 | |
| 1738 | static inline int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls) |
| 1739 | { |
| 1740 | return -EPERM; |
| 1741 | } |
| 1742 | |
| 1743 | static inline int ipa_commit_rt(enum ipa_ip_type ip) |
| 1744 | { |
| 1745 | return -EPERM; |
| 1746 | } |
| 1747 | |
| 1748 | static inline int ipa_reset_rt(enum ipa_ip_type ip) |
| 1749 | { |
| 1750 | return -EPERM; |
| 1751 | } |
| 1752 | |
| 1753 | static inline int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup) |
| 1754 | { |
| 1755 | return -EPERM; |
| 1756 | } |
| 1757 | |
| 1758 | static inline int ipa_put_rt_tbl(u32 rt_tbl_hdl) |
| 1759 | { |
| 1760 | return -EPERM; |
| 1761 | } |
| 1762 | |
| 1763 | static inline int ipa_query_rt_index(struct ipa_ioc_get_rt_tbl_indx *in) |
| 1764 | { |
| 1765 | return -EPERM; |
| 1766 | } |
| 1767 | |
| 1768 | static inline int ipa_mdfy_rt_rule(struct ipa_ioc_mdfy_rt_rule *rules) |
| 1769 | { |
| 1770 | return -EPERM; |
| 1771 | } |
| 1772 | |
| 1773 | /* |
| 1774 | * Filtering |
| 1775 | */ |
| 1776 | static inline int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) |
| 1777 | { |
| 1778 | return -EPERM; |
| 1779 | } |
| 1780 | |
| 1781 | static inline int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls) |
| 1782 | { |
| 1783 | return -EPERM; |
| 1784 | } |
| 1785 | |
| 1786 | static inline int ipa_mdfy_flt_rule(struct ipa_ioc_mdfy_flt_rule *rules) |
| 1787 | { |
| 1788 | return -EPERM; |
| 1789 | } |
| 1790 | |
| 1791 | static inline int ipa_commit_flt(enum ipa_ip_type ip) |
| 1792 | { |
| 1793 | return -EPERM; |
| 1794 | } |
| 1795 | |
| 1796 | static inline int ipa_reset_flt(enum ipa_ip_type ip) |
| 1797 | { |
| 1798 | return -EPERM; |
| 1799 | } |
| 1800 | |
| 1801 | /* |
| 1802 | * NAT |
| 1803 | */ |
| 1804 | static inline int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem) |
| 1805 | { |
| 1806 | return -EPERM; |
| 1807 | } |
| 1808 | |
| 1809 | |
| 1810 | static inline int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init) |
| 1811 | { |
| 1812 | return -EPERM; |
| 1813 | } |
| 1814 | |
| 1815 | |
| 1816 | static inline int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma) |
| 1817 | { |
| 1818 | return -EPERM; |
| 1819 | } |
| 1820 | |
| 1821 | |
| 1822 | static inline int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del) |
| 1823 | { |
| 1824 | return -EPERM; |
| 1825 | } |
| 1826 | |
| 1827 | /* |
| 1828 | * Messaging |
| 1829 | */ |
| 1830 | static inline int ipa_send_msg(struct ipa_msg_meta *meta, void *buff, |
| 1831 | ipa_msg_free_fn callback) |
| 1832 | { |
| 1833 | return -EPERM; |
| 1834 | } |
| 1835 | |
| 1836 | static inline int ipa_register_pull_msg(struct ipa_msg_meta *meta, |
| 1837 | ipa_msg_pull_fn callback) |
| 1838 | { |
| 1839 | return -EPERM; |
| 1840 | } |
| 1841 | |
| 1842 | static inline int ipa_deregister_pull_msg(struct ipa_msg_meta *meta) |
| 1843 | { |
| 1844 | return -EPERM; |
| 1845 | } |
| 1846 | |
| 1847 | /* |
| 1848 | * Interface |
| 1849 | */ |
| 1850 | static inline int ipa_register_intf(const char *name, |
| 1851 | const struct ipa_tx_intf *tx, |
| 1852 | const struct ipa_rx_intf *rx) |
| 1853 | { |
| 1854 | return -EPERM; |
| 1855 | } |
| 1856 | |
| 1857 | static inline int ipa_register_intf_ext(const char *name, |
| 1858 | const struct ipa_tx_intf *tx, |
| 1859 | const struct ipa_rx_intf *rx, |
| 1860 | const struct ipa_ext_intf *ext) |
| 1861 | { |
| 1862 | return -EPERM; |
| 1863 | } |
| 1864 | |
| 1865 | static inline int ipa_deregister_intf(const char *name) |
| 1866 | { |
| 1867 | return -EPERM; |
| 1868 | } |
| 1869 | |
| 1870 | /* |
| 1871 | * Aggregation |
| 1872 | */ |
| 1873 | static inline int ipa_set_aggr_mode(enum ipa_aggr_mode mode) |
| 1874 | { |
| 1875 | return -EPERM; |
| 1876 | } |
| 1877 | |
| 1878 | static inline int ipa_set_qcncm_ndp_sig(char sig[3]) |
| 1879 | { |
| 1880 | return -EPERM; |
| 1881 | } |
| 1882 | |
| 1883 | static inline int ipa_set_single_ndp_per_mbim(bool enable) |
| 1884 | { |
| 1885 | return -EPERM; |
| 1886 | } |
| 1887 | |
| 1888 | /* |
| 1889 | * Data path |
| 1890 | */ |
| 1891 | static inline int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb, |
| 1892 | struct ipa_tx_meta *metadata) |
| 1893 | { |
| 1894 | return -EPERM; |
| 1895 | } |
| 1896 | |
| 1897 | /* |
| 1898 | * To transfer multiple data packets |
| 1899 | */ |
| 1900 | static inline int ipa_tx_dp_mul( |
| 1901 | enum ipa_client_type dst, |
| 1902 | struct ipa_tx_data_desc *data_desc) |
| 1903 | { |
| 1904 | return -EPERM; |
| 1905 | } |
| 1906 | |
| 1907 | static inline void ipa_free_skb(struct ipa_rx_data *rx_in) |
| 1908 | { |
| 1909 | } |
| 1910 | |
| 1911 | static inline int ipa_rx_poll(u32 clnt_hdl, int budget) |
| 1912 | { |
| 1913 | return -EPERM; |
| 1914 | } |
| 1915 | |
| 1916 | static inline void ipa_recycle_wan_skb(struct sk_buff *skb) |
| 1917 | { |
| 1918 | } |
| 1919 | |
| 1920 | /* |
| 1921 | * System pipes |
| 1922 | */ |
| 1923 | static inline u16 ipa_get_smem_restr_bytes(void) |
| 1924 | { |
| 1925 | return -EPERM; |
| 1926 | } |
| 1927 | |
| 1928 | static inline int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, |
| 1929 | u32 *clnt_hdl) |
| 1930 | { |
| 1931 | return -EPERM; |
| 1932 | } |
| 1933 | |
| 1934 | static inline int ipa_teardown_sys_pipe(u32 clnt_hdl) |
| 1935 | { |
| 1936 | return -EPERM; |
| 1937 | } |
| 1938 | |
| 1939 | static inline int ipa_connect_wdi_pipe(struct ipa_wdi_in_params *in, |
| 1940 | struct ipa_wdi_out_params *out) |
| 1941 | { |
| 1942 | return -EPERM; |
| 1943 | } |
| 1944 | |
| 1945 | static inline int ipa_disconnect_wdi_pipe(u32 clnt_hdl) |
| 1946 | { |
| 1947 | return -EPERM; |
| 1948 | } |
| 1949 | |
| 1950 | static inline int ipa_enable_wdi_pipe(u32 clnt_hdl) |
| 1951 | { |
| 1952 | return -EPERM; |
| 1953 | } |
| 1954 | |
| 1955 | static inline int ipa_disable_wdi_pipe(u32 clnt_hdl) |
| 1956 | { |
| 1957 | return -EPERM; |
| 1958 | } |
| 1959 | |
| 1960 | static inline int ipa_resume_wdi_pipe(u32 clnt_hdl) |
| 1961 | { |
| 1962 | return -EPERM; |
| 1963 | } |
| 1964 | |
| 1965 | static inline int ipa_suspend_wdi_pipe(u32 clnt_hdl) |
| 1966 | { |
| 1967 | return -EPERM; |
| 1968 | } |
| 1969 | |
Skylar Chang | fcf36c2 | 2016-10-04 14:15:25 -0700 | [diff] [blame] | 1970 | static inline int ipa_broadcast_wdi_quota_reach_ind(uint32_t fid, |
| 1971 | uint64_t num_bytes) |
| 1972 | { |
| 1973 | return -EPERM; |
| 1974 | } |
| 1975 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1976 | static inline int ipa_uc_wdi_get_dbpa( |
| 1977 | struct ipa_wdi_db_params *out) |
| 1978 | { |
| 1979 | return -EPERM; |
| 1980 | } |
| 1981 | |
| 1982 | static inline int ipa_uc_reg_rdyCB( |
| 1983 | struct ipa_wdi_uc_ready_params *param) |
| 1984 | { |
| 1985 | return -EPERM; |
| 1986 | } |
| 1987 | |
| 1988 | static inline int ipa_uc_dereg_rdyCB(void) |
| 1989 | { |
| 1990 | return -EPERM; |
| 1991 | } |
| 1992 | |
| 1993 | |
| 1994 | /* |
| 1995 | * Resource manager |
| 1996 | */ |
| 1997 | static inline int ipa_rm_create_resource( |
| 1998 | struct ipa_rm_create_params *create_params) |
| 1999 | { |
| 2000 | return -EPERM; |
| 2001 | } |
| 2002 | |
| 2003 | static inline int ipa_rm_delete_resource( |
| 2004 | enum ipa_rm_resource_name resource_name) |
| 2005 | { |
| 2006 | return -EPERM; |
| 2007 | } |
| 2008 | |
| 2009 | static inline int ipa_rm_register(enum ipa_rm_resource_name resource_name, |
| 2010 | struct ipa_rm_register_params *reg_params) |
| 2011 | { |
| 2012 | return -EPERM; |
| 2013 | } |
| 2014 | |
| 2015 | static inline int ipa_rm_set_perf_profile( |
| 2016 | enum ipa_rm_resource_name resource_name, |
| 2017 | struct ipa_rm_perf_profile *profile) |
| 2018 | { |
| 2019 | return -EPERM; |
| 2020 | } |
| 2021 | |
| 2022 | static inline int ipa_rm_deregister(enum ipa_rm_resource_name resource_name, |
| 2023 | struct ipa_rm_register_params *reg_params) |
| 2024 | { |
| 2025 | return -EPERM; |
| 2026 | } |
| 2027 | |
| 2028 | static inline int ipa_rm_add_dependency( |
| 2029 | enum ipa_rm_resource_name resource_name, |
| 2030 | enum ipa_rm_resource_name depends_on_name) |
| 2031 | { |
| 2032 | return -EPERM; |
| 2033 | } |
| 2034 | |
| 2035 | static inline int ipa_rm_add_dependency_sync( |
| 2036 | enum ipa_rm_resource_name resource_name, |
| 2037 | enum ipa_rm_resource_name depends_on_name) |
| 2038 | { |
| 2039 | return -EPERM; |
| 2040 | } |
| 2041 | |
| 2042 | static inline int ipa_rm_delete_dependency( |
| 2043 | enum ipa_rm_resource_name resource_name, |
| 2044 | enum ipa_rm_resource_name depends_on_name) |
| 2045 | { |
| 2046 | return -EPERM; |
| 2047 | } |
| 2048 | |
| 2049 | static inline int ipa_rm_request_resource( |
| 2050 | enum ipa_rm_resource_name resource_name) |
| 2051 | { |
| 2052 | return -EPERM; |
| 2053 | } |
| 2054 | |
| 2055 | static inline int ipa_rm_release_resource( |
| 2056 | enum ipa_rm_resource_name resource_name) |
| 2057 | { |
| 2058 | return -EPERM; |
| 2059 | } |
| 2060 | |
| 2061 | static inline int ipa_rm_notify_completion(enum ipa_rm_event event, |
| 2062 | enum ipa_rm_resource_name resource_name) |
| 2063 | { |
| 2064 | return -EPERM; |
| 2065 | } |
| 2066 | |
| 2067 | static inline int ipa_rm_inactivity_timer_init( |
| 2068 | enum ipa_rm_resource_name resource_name, |
| 2069 | unsigned long msecs) |
| 2070 | { |
| 2071 | return -EPERM; |
| 2072 | } |
| 2073 | |
| 2074 | static inline int ipa_rm_inactivity_timer_destroy( |
| 2075 | enum ipa_rm_resource_name resource_name) |
| 2076 | { |
| 2077 | return -EPERM; |
| 2078 | } |
| 2079 | |
| 2080 | static inline int ipa_rm_inactivity_timer_request_resource( |
| 2081 | enum ipa_rm_resource_name resource_name) |
| 2082 | { |
| 2083 | return -EPERM; |
| 2084 | } |
| 2085 | |
| 2086 | static inline int ipa_rm_inactivity_timer_release_resource( |
| 2087 | enum ipa_rm_resource_name resource_name) |
| 2088 | { |
| 2089 | return -EPERM; |
| 2090 | } |
| 2091 | |
| 2092 | /* |
| 2093 | * Tethering bridge (Rmnet / MBIM) |
| 2094 | */ |
| 2095 | static inline int teth_bridge_init(struct teth_bridge_init_params *params) |
| 2096 | { |
| 2097 | return -EPERM; |
| 2098 | } |
| 2099 | |
| 2100 | static inline int teth_bridge_disconnect(enum ipa_client_type client) |
| 2101 | { |
| 2102 | return -EPERM; |
| 2103 | } |
| 2104 | |
| 2105 | static inline int teth_bridge_connect(struct teth_bridge_connect_params |
| 2106 | *connect_params) |
| 2107 | { |
| 2108 | return -EPERM; |
| 2109 | } |
| 2110 | |
| 2111 | /* |
| 2112 | * Tethering client info |
| 2113 | */ |
| 2114 | static inline void ipa_set_client(int index, enum ipacm_client_enum client, |
| 2115 | bool uplink) |
| 2116 | { |
| 2117 | } |
| 2118 | |
| 2119 | static inline enum ipacm_client_enum ipa_get_client(int pipe_idx) |
| 2120 | { |
| 2121 | return -EPERM; |
| 2122 | } |
| 2123 | |
| 2124 | static inline bool ipa_get_client_uplink(int pipe_idx) |
| 2125 | { |
| 2126 | return -EPERM; |
| 2127 | } |
| 2128 | |
| 2129 | /* |
| 2130 | * IPADMA |
| 2131 | */ |
| 2132 | static inline int ipa_dma_init(void) |
| 2133 | { |
| 2134 | return -EPERM; |
| 2135 | } |
| 2136 | |
| 2137 | static inline int ipa_dma_enable(void) |
| 2138 | { |
| 2139 | return -EPERM; |
| 2140 | } |
| 2141 | |
| 2142 | static inline int ipa_dma_disable(void) |
| 2143 | { |
| 2144 | return -EPERM; |
| 2145 | } |
| 2146 | |
| 2147 | static inline int ipa_dma_sync_memcpy(phys_addr_t dest, phys_addr_t src |
| 2148 | , int len) |
| 2149 | { |
| 2150 | return -EPERM; |
| 2151 | } |
| 2152 | |
| 2153 | static inline int ipa_dma_async_memcpy(phys_addr_t dest, phys_addr_t src |
| 2154 | , int len, void (*user_cb)(void *user1), |
| 2155 | void *user_param) |
| 2156 | { |
| 2157 | return -EPERM; |
| 2158 | } |
| 2159 | |
| 2160 | static inline int ipa_dma_uc_memcpy(phys_addr_t dest, phys_addr_t src, int len) |
| 2161 | { |
| 2162 | return -EPERM; |
| 2163 | } |
| 2164 | |
| 2165 | static inline void ipa_dma_destroy(void) |
| 2166 | { |
| 2167 | } |
| 2168 | |
| 2169 | /* |
| 2170 | * mux id |
| 2171 | */ |
| 2172 | static inline int ipa_write_qmap_id(struct ipa_ioc_write_qmapid *param_in) |
| 2173 | { |
| 2174 | return -EPERM; |
| 2175 | } |
| 2176 | |
| 2177 | /* |
| 2178 | * interrupts |
| 2179 | */ |
| 2180 | static inline int ipa_add_interrupt_handler(enum ipa_irq_type interrupt, |
| 2181 | ipa_irq_handler_t handler, |
| 2182 | bool deferred_flag, |
| 2183 | void *private_data) |
| 2184 | { |
| 2185 | return -EPERM; |
| 2186 | } |
| 2187 | |
| 2188 | static inline int ipa_remove_interrupt_handler(enum ipa_irq_type interrupt) |
| 2189 | { |
| 2190 | return -EPERM; |
| 2191 | } |
| 2192 | |
| 2193 | static inline int ipa_restore_suspend_handler(void) |
| 2194 | { |
| 2195 | return -EPERM; |
| 2196 | } |
| 2197 | |
| 2198 | /* |
| 2199 | * Miscellaneous |
| 2200 | */ |
| 2201 | static inline void ipa_bam_reg_dump(void) |
| 2202 | { |
| 2203 | } |
| 2204 | |
| 2205 | static inline int ipa_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats) |
| 2206 | { |
| 2207 | return -EPERM; |
| 2208 | } |
| 2209 | |
| 2210 | static inline int ipa_get_ep_mapping(enum ipa_client_type client) |
| 2211 | { |
| 2212 | return -EPERM; |
| 2213 | } |
| 2214 | |
| 2215 | static inline bool ipa_is_ready(void) |
| 2216 | { |
| 2217 | return false; |
| 2218 | } |
| 2219 | |
| 2220 | static inline void ipa_proxy_clk_vote(void) |
| 2221 | { |
| 2222 | } |
| 2223 | |
| 2224 | static inline void ipa_proxy_clk_unvote(void) |
| 2225 | { |
| 2226 | } |
| 2227 | |
| 2228 | static inline enum ipa_hw_type ipa_get_hw_type(void) |
| 2229 | { |
| 2230 | return IPA_HW_None; |
| 2231 | } |
| 2232 | |
| 2233 | static inline bool ipa_is_client_handle_valid(u32 clnt_hdl) |
| 2234 | { |
| 2235 | return -EINVAL; |
| 2236 | } |
| 2237 | |
| 2238 | static inline enum ipa_client_type ipa_get_client_mapping(int pipe_idx) |
| 2239 | { |
| 2240 | return -EINVAL; |
| 2241 | } |
| 2242 | |
| 2243 | static inline enum ipa_rm_resource_name ipa_get_rm_resource_from_ep( |
| 2244 | int pipe_idx) |
| 2245 | { |
| 2246 | return -EFAULT; |
| 2247 | } |
| 2248 | |
| 2249 | static inline bool ipa_get_modem_cfg_emb_pipe_flt(void) |
| 2250 | { |
| 2251 | return -EINVAL; |
| 2252 | } |
| 2253 | |
| 2254 | static inline enum ipa_transport_type ipa_get_transport_type(void) |
| 2255 | { |
| 2256 | return -EFAULT; |
| 2257 | } |
| 2258 | |
| 2259 | static inline struct device *ipa_get_dma_dev(void) |
| 2260 | { |
| 2261 | return NULL; |
| 2262 | } |
| 2263 | |
| 2264 | static inline struct iommu_domain *ipa_get_smmu_domain(void) |
| 2265 | { |
| 2266 | return NULL; |
| 2267 | } |
| 2268 | |
| 2269 | static inline int ipa_create_wdi_mapping(u32 num_buffers, |
| 2270 | struct ipa_wdi_buffer_info *info) |
| 2271 | { |
| 2272 | return -EINVAL; |
| 2273 | } |
| 2274 | |
| 2275 | static inline int ipa_release_wdi_mapping(u32 num_buffers, |
| 2276 | struct ipa_wdi_buffer_info *info) |
| 2277 | { |
| 2278 | return -EINVAL; |
| 2279 | } |
| 2280 | |
| 2281 | static inline int ipa_disable_apps_wan_cons_deaggr(void) |
| 2282 | { |
| 2283 | return -EINVAL; |
| 2284 | } |
| 2285 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2286 | static inline const struct ipa_gsi_ep_config *ipa_get_gsi_ep_info |
| 2287 | (enum ipa_client_type client) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2288 | { |
| 2289 | return NULL; |
| 2290 | } |
| 2291 | |
| 2292 | static inline int ipa_stop_gsi_channel(u32 clnt_hdl) |
| 2293 | { |
| 2294 | return -EPERM; |
| 2295 | } |
| 2296 | |
| 2297 | static inline int ipa_register_ipa_ready_cb( |
| 2298 | void (*ipa_ready_cb)(void *user_data), |
| 2299 | void *user_data) |
| 2300 | { |
| 2301 | return -EPERM; |
| 2302 | } |
| 2303 | |
Skylar Chang | 48afa05 | 2017-10-25 09:32:57 -0700 | [diff] [blame] | 2304 | static inline int ipa_tz_unlock_reg(struct ipa_tz_unlock_reg_info *reg_info, |
| 2305 | u16 num_regs) |
| 2306 | { |
| 2307 | return -EPERM; |
| 2308 | } |
| 2309 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2310 | #endif /* (CONFIG_IPA || CONFIG_IPA3) */ |
| 2311 | |
| 2312 | #endif /* _IPA_H_ */ |