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