Vladislav Mordohovich | e7970c6 | 2013-02-26 19:25:33 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [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 <mach/sps.h> |
| 20 | |
| 21 | /** |
| 22 | * enum ipa_nat_en_type - NAT setting type in IPA end-point |
| 23 | */ |
| 24 | enum ipa_nat_en_type { |
| 25 | IPA_BYPASS_NAT, |
| 26 | IPA_SRC_NAT, |
| 27 | IPA_DST_NAT, |
| 28 | }; |
| 29 | |
| 30 | /** |
| 31 | * enum ipa_mode_type - mode setting type in IPA end-point |
| 32 | * @BASIC: basic mode |
| 33 | * @ENABLE_FRAMING_HDLC: not currently supported |
| 34 | * @ENABLE_DEFRAMING_HDLC: not currently supported |
| 35 | */ |
| 36 | enum ipa_mode_type { |
| 37 | IPA_BASIC, |
| 38 | IPA_ENABLE_FRAMING_HDLC, |
| 39 | IPA_ENABLE_DEFRAMING_HDLC, |
| 40 | IPA_DMA, |
| 41 | }; |
| 42 | |
| 43 | /** |
| 44 | * enum ipa_aggr_en_type - aggregation setting type in IPA |
| 45 | * end-point |
| 46 | */ |
| 47 | enum ipa_aggr_en_type { |
| 48 | IPA_BYPASS_AGGR, |
| 49 | IPA_ENABLE_AGGR, |
| 50 | IPA_ENABLE_DEAGGR, |
| 51 | }; |
| 52 | |
| 53 | /** |
| 54 | * enum ipa_aggr_type - type of aggregation in IPA end-point |
| 55 | */ |
| 56 | enum ipa_aggr_type { |
| 57 | IPA_MBIM_16, |
| 58 | IPA_MBIM_32, |
| 59 | IPA_TLP, |
| 60 | }; |
| 61 | |
| 62 | /** |
| 63 | * enum ipa_aggr_mode - global aggregation mode |
| 64 | */ |
| 65 | enum ipa_aggr_mode { |
| 66 | IPA_MBIM, |
| 67 | IPA_QCNCM, |
| 68 | }; |
| 69 | |
| 70 | /** |
| 71 | * enum ipa_dp_evt_type - type of event client callback is |
| 72 | * invoked for on data path |
| 73 | * @IPA_RECEIVE: data is struct sk_buff |
| 74 | * @IPA_WRITE_DONE: data is struct sk_buff |
| 75 | */ |
| 76 | enum ipa_dp_evt_type { |
| 77 | IPA_RECEIVE, |
| 78 | IPA_WRITE_DONE, |
| 79 | }; |
| 80 | |
| 81 | /** |
| 82 | * struct ipa_ep_cfg_nat - NAT configuration in IPA end-point |
| 83 | * @nat_en: This defines the default NAT mode for the pipe: in case of |
| 84 | * filter miss - the default NAT mode defines the NATing operation |
| 85 | * on the packet. Valid for Input Pipes only (IPA consumer) |
| 86 | */ |
| 87 | struct ipa_ep_cfg_nat { |
| 88 | enum ipa_nat_en_type nat_en; |
| 89 | }; |
| 90 | |
| 91 | /** |
| 92 | * struct ipa_ep_cfg_hdr - header configuration in IPA end-point |
| 93 | * @hdr_len: Header length in bytes to be added/removed. Assuming header len |
| 94 | * is constant per endpoint. Valid for both Input and Output Pipes |
| 95 | * @hdr_ofst_metadata_valid: 0: Metadata_Ofst value is invalid, i.e., no |
| 96 | * metadata within header. |
| 97 | * 1: Metadata_Ofst value is valid, i.e., metadata |
| 98 | * within header is in offset Metadata_Ofst Valid |
| 99 | * for Input Pipes only (IPA Consumer) (for output |
| 100 | * pipes, metadata already set within the header) |
| 101 | * @hdr_ofst_metadata: Offset within header in which metadata resides |
| 102 | * Size of metadata - 4bytes |
| 103 | * Example - Stream ID/SSID/mux ID. |
| 104 | * Valid for Input Pipes only (IPA Consumer) (for output |
| 105 | * pipes, metadata already set within the header) |
| 106 | * @hdr_additional_const_len: Defines the constant length that should be added |
| 107 | * to the payload length in order for IPA to update |
| 108 | * correctly the length field within the header |
| 109 | * (valid only in case Hdr_Ofst_Pkt_Size_Valid=1) |
| 110 | * Valid for Output Pipes (IPA Producer) |
| 111 | * @hdr_ofst_pkt_size_valid: 0: Hdr_Ofst_Pkt_Size value is invalid, i.e., no |
| 112 | * length field within the inserted header |
| 113 | * 1: Hdr_Ofst_Pkt_Size value is valid, i.e., a |
| 114 | * packet length field resides within the header |
| 115 | * Valid for Output Pipes (IPA Producer) |
| 116 | * @hdr_ofst_pkt_size: Offset within header in which packet size reside. Upon |
| 117 | * Header Insertion, IPA will update this field within the |
| 118 | * header with the packet length . Assumption is that |
| 119 | * header length field size is constant and is 2Bytes |
| 120 | * Valid for Output Pipes (IPA Producer) |
| 121 | * @hdr_a5_mux: Determines whether A5 Mux header should be added to the packet. |
| 122 | * This bit is valid only when Hdr_En=01(Header Insertion) |
| 123 | * SW should set this bit for IPA-to-A5 pipes. |
| 124 | * 0: Do not insert A5 Mux Header |
| 125 | * 1: Insert A5 Mux Header |
| 126 | * Valid for Output Pipes (IPA Producer) |
| 127 | */ |
| 128 | struct ipa_ep_cfg_hdr { |
| 129 | u32 hdr_len; |
| 130 | u32 hdr_ofst_metadata_valid; |
| 131 | u32 hdr_ofst_metadata; |
| 132 | u32 hdr_additional_const_len; |
| 133 | u32 hdr_ofst_pkt_size_valid; |
| 134 | u32 hdr_ofst_pkt_size; |
| 135 | u32 hdr_a5_mux; |
| 136 | }; |
| 137 | |
| 138 | /** |
| 139 | * struct ipa_ep_cfg_mode - mode configuration in IPA end-point |
| 140 | * @mode: Valid for Input Pipes only (IPA Consumer) |
| 141 | * @dst: This parameter specifies the output pipe to which the packets |
| 142 | * will be routed to. |
| 143 | * This parameter is valid for Mode=DMA and not valid for |
| 144 | * Mode=Basic |
| 145 | * Valid for Input Pipes only (IPA Consumer) |
| 146 | */ |
| 147 | struct ipa_ep_cfg_mode { |
| 148 | enum ipa_mode_type mode; |
| 149 | enum ipa_client_type dst; |
| 150 | }; |
| 151 | |
| 152 | /** |
| 153 | * struct ipa_ep_cfg_aggr - aggregation configuration in IPA end-point |
| 154 | * @aggr_en: Valid for both Input and Output Pipes |
| 155 | * @aggr: Valid for both Input and Output Pipes |
| 156 | * @aggr_byte_limit: Limit of aggregated packet size in KB (<=32KB) When set |
| 157 | * to 0, there is no size limitation on the aggregation. |
| 158 | * When both, Aggr_Byte_Limit and Aggr_Time_Limit are set |
| 159 | * to 0, there is no aggregation, every packet is sent |
| 160 | * independently according to the aggregation structure |
| 161 | * Valid for Output Pipes only (IPA Producer ) |
| 162 | * @aggr_time_limit: Timer to close aggregated packet (<=32ms) When set to 0, |
| 163 | * there is no time limitation on the aggregation. When |
| 164 | * both, Aggr_Byte_Limit and Aggr_Time_Limit are set to 0, |
| 165 | * there is no aggregation, every packet is sent |
| 166 | * independently according to the aggregation structure |
| 167 | * Valid for Output Pipes only (IPA Producer) |
| 168 | */ |
| 169 | struct ipa_ep_cfg_aggr { |
| 170 | enum ipa_aggr_en_type aggr_en; |
| 171 | enum ipa_aggr_type aggr; |
| 172 | u32 aggr_byte_limit; |
| 173 | u32 aggr_time_limit; |
| 174 | }; |
| 175 | |
| 176 | /** |
| 177 | * struct ipa_ep_cfg_route - route configuration in IPA end-point |
| 178 | * @rt_tbl_hdl: Defines the default routing table index to be used in case there |
| 179 | * is no filter rule matching, valid for Input Pipes only (IPA |
| 180 | * Consumer). Clients should set this to 0 which will cause default |
| 181 | * v4 and v6 routes setup internally by IPA driver to be used for |
| 182 | * this end-point |
| 183 | */ |
| 184 | struct ipa_ep_cfg_route { |
| 185 | u32 rt_tbl_hdl; |
| 186 | }; |
| 187 | |
| 188 | /** |
| 189 | * struct ipa_ep_cfg - configuration of IPA end-point |
| 190 | * @nat: NAT parmeters |
| 191 | * @hdr: Header parameters |
| 192 | * @mode: Mode parameters |
| 193 | * @aggr: Aggregation parameters |
| 194 | * @route: Routing parameters |
| 195 | */ |
| 196 | struct ipa_ep_cfg { |
| 197 | struct ipa_ep_cfg_nat nat; |
| 198 | struct ipa_ep_cfg_hdr hdr; |
| 199 | struct ipa_ep_cfg_mode mode; |
| 200 | struct ipa_ep_cfg_aggr aggr; |
| 201 | struct ipa_ep_cfg_route route; |
| 202 | }; |
| 203 | |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 204 | typedef void (*ipa_notify_cb)(void *priv, enum ipa_dp_evt_type evt, |
| 205 | unsigned long data); |
| 206 | |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 207 | /** |
| 208 | * struct ipa_connect_params - low-level client connect input parameters. Either |
| 209 | * client allocates the data and desc FIFO and specifies that in data+desc OR |
| 210 | * specifies sizes and pipe_mem pref and IPA does the allocation. |
| 211 | * |
| 212 | * @ipa_ep_cfg: IPA EP configuration |
| 213 | * @client: type of "client" |
| 214 | * @client_bam_hdl: client SPS handle |
| 215 | * @client_ep_idx: client PER EP index |
| 216 | * @priv: callback cookie |
| 217 | * @notify: callback |
| 218 | * priv - callback cookie evt - type of event data - data relevant |
| 219 | * to event. May not be valid. See event_type enum for valid |
| 220 | * cases. |
| 221 | * @desc_fifo_sz: size of desc FIFO |
| 222 | * @data_fifo_sz: size of data FIFO |
| 223 | * @pipe_mem_preferred: if true, try to alloc the FIFOs in pipe mem, fallback |
| 224 | * to sys mem if pipe mem alloc fails |
| 225 | * @desc: desc FIFO meta-data when client has allocated it |
| 226 | * @data: data FIFO meta-data when client has allocated it |
| 227 | */ |
| 228 | struct ipa_connect_params { |
| 229 | struct ipa_ep_cfg ipa_ep_cfg; |
| 230 | enum ipa_client_type client; |
| 231 | u32 client_bam_hdl; |
| 232 | u32 client_ep_idx; |
| 233 | void *priv; |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 234 | ipa_notify_cb notify; |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 235 | u32 desc_fifo_sz; |
| 236 | u32 data_fifo_sz; |
| 237 | bool pipe_mem_preferred; |
| 238 | struct sps_mem_buffer desc; |
| 239 | struct sps_mem_buffer data; |
| 240 | }; |
| 241 | |
| 242 | /** |
| 243 | * struct ipa_sps_params - SPS related output parameters resulting from |
| 244 | * low/high level client connect |
| 245 | * @ipa_bam_hdl: IPA SPS handle |
| 246 | * @ipa_ep_idx: IPA PER EP index |
| 247 | * @desc: desc FIFO meta-data |
| 248 | * @data: data FIFO meta-data |
| 249 | */ |
| 250 | struct ipa_sps_params { |
| 251 | u32 ipa_bam_hdl; |
| 252 | u32 ipa_ep_idx; |
| 253 | struct sps_mem_buffer desc; |
| 254 | struct sps_mem_buffer data; |
| 255 | }; |
| 256 | |
| 257 | /** |
| 258 | * struct ipa_tx_intf - interface tx properties |
| 259 | * @num_props: number of tx properties |
| 260 | * @prop: the tx properties array |
| 261 | */ |
| 262 | struct ipa_tx_intf { |
| 263 | u32 num_props; |
| 264 | struct ipa_ioc_tx_intf_prop *prop; |
| 265 | }; |
| 266 | |
| 267 | /** |
| 268 | * struct ipa_rx_intf - interface rx properties |
| 269 | * @num_props: number of rx properties |
| 270 | * @prop: the rx properties array |
| 271 | */ |
| 272 | struct ipa_rx_intf { |
| 273 | u32 num_props; |
| 274 | struct ipa_ioc_rx_intf_prop *prop; |
| 275 | }; |
| 276 | |
| 277 | /** |
| 278 | * struct ipa_sys_connect_params - information needed to setup an IPA end-point |
| 279 | * in system-BAM mode |
| 280 | * @ipa_ep_cfg: IPA EP configuration |
| 281 | * @client: the type of client who "owns" the EP |
| 282 | * @desc_fifo_sz: size of desc FIFO |
| 283 | * @priv: callback cookie |
| 284 | * @notify: callback |
| 285 | * priv - callback cookie |
| 286 | * evt - type of event |
| 287 | * data - data relevant to event. May not be valid. See event_type |
| 288 | * enum for valid cases. |
| 289 | */ |
| 290 | struct ipa_sys_connect_params { |
| 291 | struct ipa_ep_cfg ipa_ep_cfg; |
| 292 | enum ipa_client_type client; |
| 293 | u32 desc_fifo_sz; |
| 294 | void *priv; |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 295 | ipa_notify_cb notify; |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 296 | }; |
| 297 | |
| 298 | /** |
| 299 | * struct ipa_tx_meta - meta-data for the TX packet |
| 300 | * @mbim_stream_id: the stream ID used in NDP signature |
| 301 | * @mbim_stream_id_valid: is above field valid? |
| 302 | */ |
| 303 | struct ipa_tx_meta { |
| 304 | u8 mbim_stream_id; |
| 305 | bool mbim_stream_id_valid; |
| 306 | }; |
| 307 | |
| 308 | /** |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 309 | * typedef ipa_msg_free_fn - callback function |
| 310 | * @param buff - [in] the message payload to free |
| 311 | * @param len - [in] size of message payload |
| 312 | * @param type - [in] the message type |
| 313 | * |
| 314 | * Message callback registered by kernel client with IPA driver to |
| 315 | * free message payload after IPA driver processing is complete |
| 316 | * |
| 317 | * No return value |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 318 | */ |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 319 | typedef void (*ipa_msg_free_fn)(void *buff, u32 len, u32 type); |
| 320 | |
| 321 | /** |
| 322 | * typedef ipa_msg_pull_fn - callback function |
| 323 | * @param buff - [in] where to copy message payload |
| 324 | * @param len - [in] size of buffer to copy payload into |
| 325 | * @param type - [in] the message type |
| 326 | * |
| 327 | * Message callback registered by kernel client with IPA driver for |
| 328 | * IPA driver to pull messages from the kernel client upon demand from |
| 329 | * user-space |
| 330 | * |
| 331 | * Returns how many bytes were copied into the buffer. |
| 332 | */ |
| 333 | typedef int (*ipa_msg_pull_fn)(void *buff, u32 len, u32 type); |
| 334 | |
| 335 | /** |
| 336 | * enum ipa_bridge_dir - direction of the bridge from air interface perspective |
| 337 | * |
| 338 | * IPA bridge direction |
| 339 | */ |
| 340 | enum ipa_bridge_dir { |
| 341 | IPA_BRIDGE_DIR_DL, |
| 342 | IPA_BRIDGE_DIR_UL, |
| 343 | IPA_BRIDGE_DIR_MAX |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 344 | }; |
| 345 | |
| 346 | /** |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 347 | * enum ipa_bridge_type - type of SW bridge |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 348 | * |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 349 | * IPA bridge type |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 350 | */ |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 351 | enum ipa_bridge_type { |
| 352 | IPA_BRIDGE_TYPE_TETHERED, |
| 353 | IPA_BRIDGE_TYPE_EMBEDDED, |
| 354 | IPA_BRIDGE_TYPE_MAX |
| 355 | }; |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 356 | |
Vladislav Mordohovich | e7970c6 | 2013-02-26 19:25:33 +0200 | [diff] [blame] | 357 | /** |
| 358 | * enum ipa_rm_resource_name - IPA RM clients identification names |
| 359 | * |
| 360 | * Add new mapping to ipa_rm_dep_prod_index() / ipa_rm_dep_cons_index() |
| 361 | * when adding new entry to this enum. |
| 362 | */ |
| 363 | enum ipa_rm_resource_name { |
| 364 | IPA_RM_RESOURCE_PROD = 0, |
| 365 | IPA_RM_RESOURCE_BRIDGE_PROD = IPA_RM_RESOURCE_PROD, |
| 366 | IPA_RM_RESOURCE_A2_PROD, |
| 367 | IPA_RM_RESOURCE_USB_PROD, |
| 368 | IPA_RM_RESOURCE_HSIC_PROD, |
| 369 | IPA_RM_RESOURCE_STD_ECM_PROD, |
| 370 | IPA_RM_RESOURCE_WWAN_0_PROD, |
| 371 | IPA_RM_RESOURCE_WWAN_1_PROD, |
| 372 | IPA_RM_RESOURCE_WWAN_2_PROD, |
| 373 | IPA_RM_RESOURCE_WWAN_3_PROD, |
| 374 | IPA_RM_RESOURCE_WWAN_4_PROD, |
| 375 | IPA_RM_RESOURCE_WWAN_5_PROD, |
| 376 | IPA_RM_RESOURCE_WWAN_6_PROD, |
| 377 | IPA_RM_RESOURCE_WWAN_7_PROD, |
| 378 | IPA_RM_RESOURCE_WLAN_PROD, |
| 379 | IPA_RM_RESOURCE_PROD_MAX, |
| 380 | |
| 381 | IPA_RM_RESOURCE_A2_CONS = IPA_RM_RESOURCE_PROD_MAX, |
| 382 | IPA_RM_RESOURCE_USB_CONS, |
| 383 | IPA_RM_RESOURCE_HSIC_CONS, |
| 384 | IPA_RM_RESOURCE_MAX |
| 385 | }; |
| 386 | |
| 387 | /** |
| 388 | * enum ipa_rm_event - IPA RM events |
| 389 | * |
| 390 | * Indicate the resource state change |
| 391 | */ |
| 392 | enum ipa_rm_event { |
| 393 | IPA_RM_RESOURCE_GRANTED, |
| 394 | IPA_RM_RESOURCE_RELEASED |
| 395 | }; |
| 396 | |
| 397 | typedef void (*ipa_rm_notify_cb)(void *user_data, |
| 398 | enum ipa_rm_event event, |
| 399 | unsigned long data); |
| 400 | /** |
| 401 | * struct ipa_rm_register_params - information needed to |
| 402 | * register IPA RM client with IPA RM |
| 403 | * |
| 404 | * @user_data: IPA RM client provided information |
| 405 | * to be passed to notify_cb callback below |
| 406 | * @notify_cb: callback which is called by resource |
| 407 | * to notify the IPA RM client about its state |
| 408 | * change IPA RM client is expected to perform non |
| 409 | * blocking operations only in notify_cb and |
| 410 | * release notification context as soon as |
| 411 | * possible. |
| 412 | */ |
| 413 | struct ipa_rm_register_params { |
| 414 | void *user_data; |
| 415 | ipa_rm_notify_cb notify_cb; |
| 416 | }; |
| 417 | |
| 418 | /** |
| 419 | * struct ipa_rm_create_params - information needed to initialize |
| 420 | * the resource |
| 421 | * @name: resource name |
| 422 | * @reg_params: register parameters, contains are ignored |
| 423 | * for consumer resource NULL should be provided |
| 424 | * for consumer resource |
| 425 | * @request_resource: function which should be called to request resource, |
| 426 | * NULL should be provided for producer resource |
| 427 | * @release_resource: function which should be called to release resource, |
| 428 | * NULL should be provided for producer resource |
| 429 | * |
| 430 | * IPA RM client is expected to perform non blocking operations only |
| 431 | * in request_resource and release_resource functions and |
| 432 | * release notification context as soon as possible. |
| 433 | */ |
| 434 | struct ipa_rm_create_params { |
| 435 | enum ipa_rm_resource_name name; |
| 436 | struct ipa_rm_register_params reg_params; |
| 437 | int (*request_resource)(void); |
| 438 | int (*release_resource)(void); |
| 439 | }; |
| 440 | |
Vladislav Mordohovich | 7928bc5 | 2013-03-05 09:31:08 +0200 | [diff] [blame] | 441 | #define A2_MUX_HDR_NAME_V4_PREF "dmux_hdr_v4_" |
| 442 | #define A2_MUX_HDR_NAME_V6_PREF "dmux_hdr_v6_" |
| 443 | |
Vladislav Mordohovich | 4028f80 | 2013-03-04 15:16:31 +0200 | [diff] [blame] | 444 | enum a2_mux_event_type { |
| 445 | A2_MUX_RECEIVE, |
| 446 | A2_MUX_WRITE_DONE |
| 447 | }; |
| 448 | |
| 449 | enum a2_mux_logical_channel_id { |
| 450 | A2_MUX_WWAN_0, |
| 451 | A2_MUX_WWAN_1, |
| 452 | A2_MUX_WWAN_2, |
| 453 | A2_MUX_WWAN_3, |
| 454 | A2_MUX_WWAN_4, |
| 455 | A2_MUX_WWAN_5, |
| 456 | A2_MUX_WWAN_6, |
| 457 | A2_MUX_WWAN_7, |
| 458 | A2_MUX_TETHERED_0, |
| 459 | A2_MUX_NUM_CHANNELS |
| 460 | }; |
| 461 | |
| 462 | typedef void (*a2_mux_notify_cb)(void *user_data, |
| 463 | enum a2_mux_event_type event, |
| 464 | unsigned long data); |
| 465 | |
Gidon Studinski | a83ef57 | 2013-03-04 18:38:16 +0200 | [diff] [blame] | 466 | /** |
| 467 | * enum teth_tethering_mode - Tethering mode (Rmnet / MBIM) |
Vladislav Mordohovich | 4028f80 | 2013-03-04 15:16:31 +0200 | [diff] [blame] | 468 | */ |
Gidon Studinski | a83ef57 | 2013-03-04 18:38:16 +0200 | [diff] [blame] | 469 | enum teth_tethering_mode { |
| 470 | TETH_TETHERING_MODE_RMNET, |
| 471 | TETH_TETHERING_MODE_MBIM, |
| 472 | TETH_TETHERING_MODE_MAX, |
| 473 | }; |
Vladislav Mordohovich | 4028f80 | 2013-03-04 15:16:31 +0200 | [diff] [blame] | 474 | |
Gidon Studinski | a83ef57 | 2013-03-04 18:38:16 +0200 | [diff] [blame] | 475 | /** |
| 476 | * struct teth_bridge_connect_params - Parameters used in teth_bridge_connect() |
| 477 | * @ipa_usb_pipe_hdl: IPA to USB pipe handle, returned from ipa_connect() |
| 478 | * @usb_ipa_pipe_hdl: USB to IPA pipe handle, returned from ipa_connect() |
| 479 | * @tethering_mode: Rmnet or MBIM |
| 480 | */ |
| 481 | struct teth_bridge_connect_params { |
| 482 | u32 ipa_usb_pipe_hdl; |
| 483 | u32 usb_ipa_pipe_hdl; |
| 484 | enum teth_tethering_mode tethering_mode; |
| 485 | }; |
Vladislav Mordohovich | 4028f80 | 2013-03-04 15:16:31 +0200 | [diff] [blame] | 486 | |
Gidon Studinski | a83ef57 | 2013-03-04 18:38:16 +0200 | [diff] [blame] | 487 | #ifdef CONFIG_IPA |
Vladislav Mordohovich | 4028f80 | 2013-03-04 15:16:31 +0200 | [diff] [blame] | 488 | |
| 489 | /* |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 490 | * Connect / Disconnect |
| 491 | */ |
| 492 | int ipa_connect(const struct ipa_connect_params *in, struct ipa_sps_params *sps, |
| 493 | u32 *clnt_hdl); |
| 494 | int ipa_disconnect(u32 clnt_hdl); |
| 495 | |
| 496 | /* |
| 497 | * Configuration |
| 498 | */ |
| 499 | int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg); |
| 500 | |
| 501 | int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg); |
| 502 | |
| 503 | int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg); |
| 504 | |
| 505 | int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ipa_ep_cfg); |
| 506 | |
| 507 | int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ipa_ep_cfg); |
| 508 | |
| 509 | int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ipa_ep_cfg); |
| 510 | |
| 511 | /* |
| 512 | * Header removal / addition |
| 513 | */ |
| 514 | int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs); |
| 515 | |
| 516 | int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls); |
| 517 | |
| 518 | int ipa_commit_hdr(void); |
| 519 | |
| 520 | int ipa_reset_hdr(void); |
| 521 | |
| 522 | int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup); |
| 523 | |
| 524 | int ipa_put_hdr(u32 hdr_hdl); |
| 525 | |
| 526 | int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy); |
| 527 | |
| 528 | /* |
| 529 | * Routing |
| 530 | */ |
| 531 | int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules); |
| 532 | |
| 533 | int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls); |
| 534 | |
| 535 | int ipa_commit_rt(enum ipa_ip_type ip); |
| 536 | |
| 537 | int ipa_reset_rt(enum ipa_ip_type ip); |
| 538 | |
| 539 | int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup); |
| 540 | |
| 541 | int ipa_put_rt_tbl(u32 rt_tbl_hdl); |
| 542 | |
| 543 | /* |
| 544 | * Filtering |
| 545 | */ |
| 546 | int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules); |
| 547 | |
| 548 | int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls); |
| 549 | |
| 550 | int ipa_commit_flt(enum ipa_ip_type ip); |
| 551 | |
| 552 | int ipa_reset_flt(enum ipa_ip_type ip); |
| 553 | |
| 554 | /* |
| 555 | * NAT |
| 556 | */ |
| 557 | int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem); |
| 558 | |
| 559 | int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init); |
| 560 | |
| 561 | int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma); |
| 562 | |
| 563 | int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del); |
| 564 | |
| 565 | /* |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 566 | * Messaging |
| 567 | */ |
| 568 | int ipa_send_msg(struct ipa_msg_meta *meta, void *buff, |
| 569 | ipa_msg_free_fn callback); |
| 570 | int ipa_register_pull_msg(struct ipa_msg_meta *meta, ipa_msg_pull_fn callback); |
| 571 | int ipa_deregister_pull_msg(struct ipa_msg_meta *meta); |
| 572 | |
| 573 | /* |
| 574 | * Interface |
| 575 | */ |
| 576 | int ipa_register_intf(const char *name, const struct ipa_tx_intf *tx, |
| 577 | const struct ipa_rx_intf *rx); |
| 578 | int ipa_deregister_intf(const char *name); |
| 579 | |
| 580 | /* |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 581 | * Aggregation |
| 582 | */ |
| 583 | int ipa_set_aggr_mode(enum ipa_aggr_mode mode); |
| 584 | |
| 585 | int ipa_set_qcncm_ndp_sig(char sig[3]); |
| 586 | |
| 587 | int ipa_set_single_ndp_per_mbim(bool enable); |
| 588 | |
| 589 | /* |
| 590 | * rmnet bridge |
| 591 | */ |
| 592 | int rmnet_bridge_init(void); |
| 593 | |
| 594 | int rmnet_bridge_disconnect(void); |
| 595 | |
| 596 | int rmnet_bridge_connect(u32 producer_hdl, |
| 597 | u32 consumer_hdl, |
| 598 | int wwan_logical_channel_id); |
| 599 | |
| 600 | /* |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 601 | * SW bridge (between IPA and A2) |
| 602 | */ |
| 603 | int ipa_bridge_setup(enum ipa_bridge_dir dir, enum ipa_bridge_type type, |
| 604 | struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl); |
| 605 | int ipa_bridge_teardown(enum ipa_bridge_dir dir, enum ipa_bridge_type type, |
| 606 | u32 clnt_hdl); |
| 607 | |
| 608 | |
| 609 | /* |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 610 | * Data path |
| 611 | */ |
| 612 | int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb, |
| 613 | struct ipa_tx_meta *metadata); |
| 614 | |
| 615 | /* |
| 616 | * System pipes |
| 617 | */ |
| 618 | int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl); |
| 619 | |
| 620 | int ipa_teardown_sys_pipe(u32 clnt_hdl); |
| 621 | |
Vladislav Mordohovich | e7970c6 | 2013-02-26 19:25:33 +0200 | [diff] [blame] | 622 | /* |
| 623 | * Resource manager |
| 624 | */ |
| 625 | int ipa_rm_create_resource(struct ipa_rm_create_params *create_params); |
| 626 | |
| 627 | int ipa_rm_register(enum ipa_rm_resource_name resource_name, |
| 628 | struct ipa_rm_register_params *reg_params); |
| 629 | |
| 630 | int ipa_rm_deregister(enum ipa_rm_resource_name resource_name, |
| 631 | struct ipa_rm_register_params *reg_params); |
| 632 | |
| 633 | int ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name, |
| 634 | enum ipa_rm_resource_name depends_on_name); |
| 635 | |
| 636 | int ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name, |
| 637 | enum ipa_rm_resource_name depends_on_name); |
| 638 | |
| 639 | int ipa_rm_request_resource(enum ipa_rm_resource_name resource_name); |
| 640 | |
| 641 | int ipa_rm_release_resource(enum ipa_rm_resource_name resource_name); |
| 642 | |
| 643 | int ipa_rm_notify_completion(enum ipa_rm_event event, |
| 644 | enum ipa_rm_resource_name resource_name); |
| 645 | |
| 646 | int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name, |
| 647 | unsigned long msecs); |
| 648 | |
| 649 | int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name); |
| 650 | |
| 651 | int ipa_rm_inactivity_timer_request_resource( |
| 652 | enum ipa_rm_resource_name resource_name); |
| 653 | |
| 654 | int ipa_rm_inactivity_timer_release_resource( |
| 655 | enum ipa_rm_resource_name resource_name); |
| 656 | |
Gidon Studinski | a83ef57 | 2013-03-04 18:38:16 +0200 | [diff] [blame] | 657 | /* |
| 658 | * a2 service |
| 659 | */ |
| 660 | int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid, |
| 661 | void *user_data, |
| 662 | a2_mux_notify_cb notify_cb); |
| 663 | |
| 664 | int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid); |
| 665 | |
| 666 | int a2_mux_write(enum a2_mux_logical_channel_id lcid, struct sk_buff *skb); |
| 667 | |
| 668 | int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid); |
| 669 | |
| 670 | int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid); |
| 671 | |
| 672 | int a2_mux_get_tethered_client_handles(enum a2_mux_logical_channel_id lcid, |
| 673 | unsigned int *clnt_cons_handle, |
| 674 | unsigned int *clnt_prod_handle); |
| 675 | |
| 676 | /* |
| 677 | * Tethering bridge (Rmnet / MBIM) |
| 678 | */ |
| 679 | int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, void **private_data_ptr); |
| 680 | |
| 681 | int teth_bridge_disconnect(void); |
| 682 | |
| 683 | int teth_bridge_connect(struct teth_bridge_connect_params *connect_params); |
| 684 | |
Talel Atias | 6d842bf | 2012-12-06 16:58:35 +0200 | [diff] [blame] | 685 | #else /* CONFIG_IPA */ |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 686 | |
Vladislav Mordohovich | 4028f80 | 2013-03-04 15:16:31 +0200 | [diff] [blame] | 687 | static inline int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid, |
| 688 | void *user_data, a2_mux_notify_cb notify_cb) |
| 689 | { |
| 690 | return -EPERM; |
| 691 | } |
| 692 | |
| 693 | static inline int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid) |
| 694 | { |
| 695 | return -EPERM; |
| 696 | } |
| 697 | |
| 698 | static inline int a2_mux_write(enum a2_mux_logical_channel_id lcid, |
| 699 | struct sk_buff *skb) |
| 700 | { |
| 701 | return -EPERM; |
| 702 | } |
| 703 | |
| 704 | static inline int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid) |
| 705 | { |
| 706 | return -EPERM; |
| 707 | } |
| 708 | |
| 709 | static inline int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid) |
| 710 | { |
| 711 | return -EPERM; |
| 712 | } |
| 713 | |
| 714 | static inline int a2_mux_get_tethered_client_handles( |
| 715 | enum a2_mux_logical_channel_id lcid, unsigned int *clnt_cons_handle, |
| 716 | unsigned int *clnt_prod_handle) |
| 717 | { |
| 718 | return -EPERM; |
| 719 | } |
| 720 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 721 | /* |
| 722 | * Connect / Disconnect |
| 723 | */ |
| 724 | static inline int ipa_connect(const struct ipa_connect_params *in, |
| 725 | struct ipa_sps_params *sps, u32 *clnt_hdl) |
| 726 | { |
| 727 | return -EPERM; |
| 728 | } |
| 729 | |
| 730 | static inline int ipa_disconnect(u32 clnt_hdl) |
| 731 | { |
| 732 | return -EPERM; |
| 733 | } |
| 734 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 735 | /* |
| 736 | * Configuration |
| 737 | */ |
| 738 | static inline int ipa_cfg_ep(u32 clnt_hdl, |
| 739 | const struct ipa_ep_cfg *ipa_ep_cfg) |
| 740 | { |
| 741 | return -EPERM; |
| 742 | } |
| 743 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 744 | static inline int ipa_cfg_ep_nat(u32 clnt_hdl, |
| 745 | const struct ipa_ep_cfg_nat *ipa_ep_cfg) |
| 746 | { |
| 747 | return -EPERM; |
| 748 | } |
| 749 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 750 | static inline int ipa_cfg_ep_hdr(u32 clnt_hdl, |
| 751 | const struct ipa_ep_cfg_hdr *ipa_ep_cfg) |
| 752 | { |
| 753 | return -EPERM; |
| 754 | } |
| 755 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 756 | static inline int ipa_cfg_ep_mode(u32 clnt_hdl, |
| 757 | const struct ipa_ep_cfg_mode *ipa_ep_cfg) |
| 758 | { |
| 759 | return -EPERM; |
| 760 | } |
| 761 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 762 | static inline int ipa_cfg_ep_aggr(u32 clnt_hdl, |
| 763 | const struct ipa_ep_cfg_aggr *ipa_ep_cfg) |
| 764 | { |
| 765 | return -EPERM; |
| 766 | } |
| 767 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 768 | static inline int ipa_cfg_ep_route(u32 clnt_hdl, |
| 769 | const struct ipa_ep_cfg_route *ipa_ep_cfg) |
| 770 | { |
| 771 | return -EPERM; |
| 772 | } |
| 773 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 774 | /* |
| 775 | * Header removal / addition |
| 776 | */ |
| 777 | static inline int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs) |
| 778 | { |
| 779 | return -EPERM; |
| 780 | } |
| 781 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 782 | static inline int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls) |
| 783 | { |
| 784 | return -EPERM; |
| 785 | } |
| 786 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 787 | static inline int ipa_commit_hdr(void) |
| 788 | { |
| 789 | return -EPERM; |
| 790 | } |
| 791 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 792 | static inline int ipa_reset_hdr(void) |
| 793 | { |
| 794 | return -EPERM; |
| 795 | } |
| 796 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 797 | static inline int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup) |
| 798 | { |
| 799 | return -EPERM; |
| 800 | } |
| 801 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 802 | static inline int ipa_put_hdr(u32 hdr_hdl) |
| 803 | { |
| 804 | return -EPERM; |
| 805 | } |
| 806 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 807 | static inline int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy) |
| 808 | { |
| 809 | return -EPERM; |
| 810 | } |
| 811 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 812 | /* |
| 813 | * Routing |
| 814 | */ |
| 815 | static inline int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules) |
| 816 | { |
| 817 | return -EPERM; |
| 818 | } |
| 819 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 820 | static inline int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls) |
| 821 | { |
| 822 | return -EPERM; |
| 823 | } |
| 824 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 825 | static inline int ipa_commit_rt(enum ipa_ip_type ip) |
| 826 | { |
| 827 | return -EPERM; |
| 828 | } |
| 829 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 830 | static inline int ipa_reset_rt(enum ipa_ip_type ip) |
| 831 | { |
| 832 | return -EPERM; |
| 833 | } |
| 834 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 835 | static inline int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup) |
| 836 | { |
| 837 | return -EPERM; |
| 838 | } |
| 839 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 840 | static inline int ipa_put_rt_tbl(u32 rt_tbl_hdl) |
| 841 | { |
| 842 | return -EPERM; |
| 843 | } |
| 844 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 845 | /* |
| 846 | * Filtering |
| 847 | */ |
| 848 | static inline int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules) |
| 849 | { |
| 850 | return -EPERM; |
| 851 | } |
| 852 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 853 | static inline int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls) |
| 854 | { |
| 855 | return -EPERM; |
| 856 | } |
| 857 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 858 | static inline int ipa_commit_flt(enum ipa_ip_type ip) |
| 859 | { |
| 860 | return -EPERM; |
| 861 | } |
| 862 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 863 | static inline int ipa_reset_flt(enum ipa_ip_type ip) |
| 864 | { |
| 865 | return -EPERM; |
| 866 | } |
| 867 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 868 | /* |
| 869 | * NAT |
| 870 | */ |
| 871 | static inline int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem) |
| 872 | { |
| 873 | return -EPERM; |
| 874 | } |
| 875 | |
| 876 | |
| 877 | static inline int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init) |
| 878 | { |
| 879 | return -EPERM; |
| 880 | } |
| 881 | |
| 882 | |
| 883 | static inline int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma) |
| 884 | { |
| 885 | return -EPERM; |
| 886 | } |
| 887 | |
| 888 | |
| 889 | static inline int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del) |
| 890 | { |
| 891 | return -EPERM; |
| 892 | } |
| 893 | |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 894 | /* |
| 895 | * Messaging |
| 896 | */ |
| 897 | static inline int ipa_send_msg(struct ipa_msg_meta *meta, void *buff, |
| 898 | ipa_msg_free_fn callback) |
| 899 | { |
| 900 | return -EPERM; |
| 901 | } |
| 902 | |
| 903 | static inline int ipa_register_pull_msg(struct ipa_msg_meta *meta, |
| 904 | ipa_msg_pull_fn callback) |
| 905 | { |
| 906 | return -EPERM; |
| 907 | } |
| 908 | |
| 909 | static inline int ipa_deregister_pull_msg(struct ipa_msg_meta *meta) |
| 910 | { |
| 911 | return -EPERM; |
| 912 | } |
| 913 | |
| 914 | /* |
| 915 | * Interface |
| 916 | */ |
| 917 | static inline int ipa_register_intf(const char *name, |
| 918 | const struct ipa_tx_intf *tx, |
| 919 | const struct ipa_rx_intf *rx) |
| 920 | { |
| 921 | return -EPERM; |
| 922 | } |
| 923 | |
| 924 | static inline int ipa_deregister_intf(const char *name) |
| 925 | { |
| 926 | return -EPERM; |
| 927 | } |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 928 | |
| 929 | /* |
| 930 | * Aggregation |
| 931 | */ |
| 932 | static inline int ipa_set_aggr_mode(enum ipa_aggr_mode mode) |
| 933 | { |
| 934 | return -EPERM; |
| 935 | } |
| 936 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 937 | static inline int ipa_set_qcncm_ndp_sig(char sig[3]) |
| 938 | { |
| 939 | return -EPERM; |
| 940 | } |
| 941 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 942 | static inline int ipa_set_single_ndp_per_mbim(bool enable) |
| 943 | { |
| 944 | return -EPERM; |
| 945 | } |
| 946 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 947 | /* |
| 948 | * rmnet bridge |
| 949 | */ |
| 950 | static inline int rmnet_bridge_init(void) |
| 951 | { |
| 952 | return -EPERM; |
| 953 | } |
| 954 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 955 | static inline int rmnet_bridge_disconnect(void) |
| 956 | { |
| 957 | return -EPERM; |
| 958 | } |
| 959 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 960 | static inline int rmnet_bridge_connect(u32 producer_hdl, |
| 961 | u32 consumer_hdl, |
| 962 | int wwan_logical_channel_id) |
| 963 | { |
| 964 | return -EPERM; |
| 965 | } |
| 966 | |
Talel Atias | 9bc5389 | 2013-02-10 15:10:07 +0200 | [diff] [blame] | 967 | /* |
| 968 | * SW bridge (between IPA and A2) |
| 969 | */ |
| 970 | static inline int ipa_bridge_setup(enum ipa_bridge_dir dir, |
| 971 | enum ipa_bridge_type type, |
| 972 | struct ipa_sys_connect_params *sys_in, |
| 973 | u32 *clnt_hdl) |
| 974 | { |
| 975 | return -EPERM; |
| 976 | } |
| 977 | |
| 978 | static inline int ipa_bridge_teardown(enum ipa_bridge_dir dir, |
| 979 | enum ipa_bridge_type type, |
| 980 | u32 clnt_hdl) |
| 981 | { |
| 982 | return -EPERM; |
| 983 | } |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 984 | |
| 985 | /* |
| 986 | * Data path |
| 987 | */ |
| 988 | static inline int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb, |
| 989 | struct ipa_tx_meta *metadata) |
| 990 | { |
| 991 | return -EPERM; |
| 992 | } |
| 993 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 994 | /* |
| 995 | * System pipes |
| 996 | */ |
| 997 | static inline int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, |
| 998 | u32 *clnt_hdl) |
| 999 | { |
| 1000 | return -EPERM; |
| 1001 | } |
| 1002 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 1003 | static inline int ipa_teardown_sys_pipe(u32 clnt_hdl) |
| 1004 | { |
| 1005 | return -EPERM; |
| 1006 | } |
| 1007 | |
Vladislav Mordohovich | e7970c6 | 2013-02-26 19:25:33 +0200 | [diff] [blame] | 1008 | /* |
| 1009 | * Resource manager |
| 1010 | */ |
| 1011 | static inline int ipa_rm_create_resource( |
| 1012 | struct ipa_rm_create_params *create_params) |
| 1013 | { |
| 1014 | return -EPERM; |
| 1015 | } |
| 1016 | |
| 1017 | static inline int ipa_rm_register(enum ipa_rm_resource_name resource_name, |
| 1018 | struct ipa_rm_register_params *reg_params) |
| 1019 | { |
| 1020 | return -EPERM; |
| 1021 | } |
| 1022 | |
| 1023 | static inline int ipa_rm_deregister(enum ipa_rm_resource_name resource_name, |
| 1024 | struct ipa_rm_register_params *reg_params) |
| 1025 | { |
| 1026 | return -EPERM; |
| 1027 | } |
| 1028 | |
| 1029 | static inline int ipa_rm_add_dependency( |
| 1030 | enum ipa_rm_resource_name resource_name, |
| 1031 | enum ipa_rm_resource_name depends_on_name) |
| 1032 | { |
| 1033 | return -EPERM; |
| 1034 | } |
| 1035 | |
| 1036 | static inline int ipa_rm_delete_dependency( |
| 1037 | enum ipa_rm_resource_name resource_name, |
| 1038 | enum ipa_rm_resource_name depends_on_name) |
| 1039 | { |
| 1040 | return -EPERM; |
| 1041 | } |
| 1042 | |
| 1043 | static inline int ipa_rm_request_resource( |
| 1044 | enum ipa_rm_resource_name resource_name) |
| 1045 | { |
| 1046 | return -EPERM; |
| 1047 | } |
| 1048 | |
| 1049 | static inline int ipa_rm_release_resource( |
| 1050 | enum ipa_rm_resource_name resource_name) |
| 1051 | { |
| 1052 | return -EPERM; |
| 1053 | } |
| 1054 | |
| 1055 | static inline int ipa_rm_notify_completion(enum ipa_rm_event event, |
| 1056 | enum ipa_rm_resource_name resource_name) |
| 1057 | { |
| 1058 | return -EPERM; |
| 1059 | } |
| 1060 | |
| 1061 | static inline int ipa_rm_inactivity_timer_init( |
| 1062 | enum ipa_rm_resource_name resource_name, |
| 1063 | unsigned long msecs) |
| 1064 | { |
| 1065 | return -EPERM; |
| 1066 | } |
| 1067 | |
| 1068 | static inline int ipa_rm_inactivity_timer_destroy( |
| 1069 | enum ipa_rm_resource_name resource_name) |
| 1070 | { |
| 1071 | return -EPERM; |
| 1072 | } |
| 1073 | |
| 1074 | static inline int ipa_rm_inactivity_timer_request_resource( |
| 1075 | enum ipa_rm_resource_name resource_name) |
| 1076 | { |
| 1077 | return -EPERM; |
| 1078 | } |
| 1079 | |
| 1080 | static inline int ipa_rm_inactivity_timer_release_resource( |
| 1081 | enum ipa_rm_resource_name resource_name) |
| 1082 | { |
| 1083 | return -EPERM; |
| 1084 | } |
| 1085 | |
Gidon Studinski | a83ef57 | 2013-03-04 18:38:16 +0200 | [diff] [blame] | 1086 | /* |
| 1087 | * Tethering bridge (Rmnetm / MBIM) |
| 1088 | */ |
| 1089 | static inline int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, |
| 1090 | void **private_data_ptr) |
| 1091 | { |
| 1092 | return -EPERM; |
| 1093 | } |
| 1094 | |
| 1095 | static inline int teth_bridge_disconnect(void) |
| 1096 | { |
| 1097 | return -EPERM; |
| 1098 | } |
| 1099 | |
| 1100 | static inline int teth_bridge_connect(struct teth_bridge_connect_params |
| 1101 | *connect_params) |
| 1102 | { |
| 1103 | return -EPERM; |
| 1104 | } |
| 1105 | |
Talel Atias | 8a6ec10 | 2012-11-21 20:22:29 +0200 | [diff] [blame] | 1106 | #endif /* CONFIG_IPA*/ |
| 1107 | |
Talel Atias | 8390f26 | 2012-11-15 16:33:18 +0200 | [diff] [blame] | 1108 | #endif /* _IPA_H_ */ |