blob: 90757b6adabfdbb40155c5003a86caf77a9246de [file] [log] [blame]
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +02001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Talel Atias8390f262012-11-15 16:33:18 +02002 *
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 */
24enum 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 */
36enum 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 */
47enum 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 */
56enum 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 */
65enum 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 */
76enum 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 */
87struct 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 */
128struct 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 */
147struct 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 */
169struct 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 */
184struct 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 */
196struct 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 Atias9bc53892013-02-10 15:10:07 +0200204typedef void (*ipa_notify_cb)(void *priv, enum ipa_dp_evt_type evt,
205 unsigned long data);
206
Talel Atias8390f262012-11-15 16:33:18 +0200207/**
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 */
228struct 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 Atias9bc53892013-02-10 15:10:07 +0200234 ipa_notify_cb notify;
Talel Atias8390f262012-11-15 16:33:18 +0200235 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 */
250struct 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 */
262struct 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 */
272struct 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 */
290struct 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 Atias9bc53892013-02-10 15:10:07 +0200295 ipa_notify_cb notify;
Talel Atias8390f262012-11-15 16:33:18 +0200296};
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 */
303struct ipa_tx_meta {
304 u8 mbim_stream_id;
305 bool mbim_stream_id_valid;
306};
307
308/**
Talel Atias9bc53892013-02-10 15:10:07 +0200309 * 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 Atias8390f262012-11-15 16:33:18 +0200318 */
Talel Atias9bc53892013-02-10 15:10:07 +0200319typedef 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 */
333typedef 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 */
340enum ipa_bridge_dir {
341 IPA_BRIDGE_DIR_DL,
342 IPA_BRIDGE_DIR_UL,
343 IPA_BRIDGE_DIR_MAX
Talel Atias8390f262012-11-15 16:33:18 +0200344};
345
346/**
Talel Atias9bc53892013-02-10 15:10:07 +0200347 * enum ipa_bridge_type - type of SW bridge
Talel Atias8390f262012-11-15 16:33:18 +0200348 *
Talel Atias9bc53892013-02-10 15:10:07 +0200349 * IPA bridge type
Talel Atias8390f262012-11-15 16:33:18 +0200350 */
Talel Atias9bc53892013-02-10 15:10:07 +0200351enum ipa_bridge_type {
352 IPA_BRIDGE_TYPE_TETHERED,
353 IPA_BRIDGE_TYPE_EMBEDDED,
354 IPA_BRIDGE_TYPE_MAX
355};
Talel Atias8390f262012-11-15 16:33:18 +0200356
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200357/**
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200358 * enum ipa_rm_event - IPA RM events
359 *
360 * Indicate the resource state change
361 */
362enum ipa_rm_event {
363 IPA_RM_RESOURCE_GRANTED,
364 IPA_RM_RESOURCE_RELEASED
365};
366
367typedef void (*ipa_rm_notify_cb)(void *user_data,
368 enum ipa_rm_event event,
369 unsigned long data);
370/**
371 * struct ipa_rm_register_params - information needed to
372 * register IPA RM client with IPA RM
373 *
374 * @user_data: IPA RM client provided information
375 * to be passed to notify_cb callback below
376 * @notify_cb: callback which is called by resource
377 * to notify the IPA RM client about its state
378 * change IPA RM client is expected to perform non
379 * blocking operations only in notify_cb and
380 * release notification context as soon as
381 * possible.
382 */
383struct ipa_rm_register_params {
384 void *user_data;
385 ipa_rm_notify_cb notify_cb;
386};
387
388/**
389 * struct ipa_rm_create_params - information needed to initialize
390 * the resource
391 * @name: resource name
392 * @reg_params: register parameters, contains are ignored
393 * for consumer resource NULL should be provided
394 * for consumer resource
395 * @request_resource: function which should be called to request resource,
396 * NULL should be provided for producer resource
397 * @release_resource: function which should be called to release resource,
398 * NULL should be provided for producer resource
399 *
400 * IPA RM client is expected to perform non blocking operations only
401 * in request_resource and release_resource functions and
402 * release notification context as soon as possible.
403 */
404struct ipa_rm_create_params {
405 enum ipa_rm_resource_name name;
406 struct ipa_rm_register_params reg_params;
407 int (*request_resource)(void);
408 int (*release_resource)(void);
409};
410
Vladislav Mordohovich7928bc52013-03-05 09:31:08 +0200411#define A2_MUX_HDR_NAME_V4_PREF "dmux_hdr_v4_"
412#define A2_MUX_HDR_NAME_V6_PREF "dmux_hdr_v6_"
413
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200414enum a2_mux_event_type {
415 A2_MUX_RECEIVE,
416 A2_MUX_WRITE_DONE
417};
418
419enum a2_mux_logical_channel_id {
420 A2_MUX_WWAN_0,
421 A2_MUX_WWAN_1,
422 A2_MUX_WWAN_2,
423 A2_MUX_WWAN_3,
424 A2_MUX_WWAN_4,
425 A2_MUX_WWAN_5,
426 A2_MUX_WWAN_6,
427 A2_MUX_WWAN_7,
428 A2_MUX_TETHERED_0,
429 A2_MUX_NUM_CHANNELS
430};
431
432typedef void (*a2_mux_notify_cb)(void *user_data,
433 enum a2_mux_event_type event,
434 unsigned long data);
435
Gidon Studinskia83ef572013-03-04 18:38:16 +0200436/**
437 * enum teth_tethering_mode - Tethering mode (Rmnet / MBIM)
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200438 */
Gidon Studinskia83ef572013-03-04 18:38:16 +0200439enum teth_tethering_mode {
440 TETH_TETHERING_MODE_RMNET,
441 TETH_TETHERING_MODE_MBIM,
442 TETH_TETHERING_MODE_MAX,
443};
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200444
Gidon Studinskia83ef572013-03-04 18:38:16 +0200445/**
446 * struct teth_bridge_connect_params - Parameters used in teth_bridge_connect()
447 * @ipa_usb_pipe_hdl: IPA to USB pipe handle, returned from ipa_connect()
448 * @usb_ipa_pipe_hdl: USB to IPA pipe handle, returned from ipa_connect()
449 * @tethering_mode: Rmnet or MBIM
450 */
451struct teth_bridge_connect_params {
452 u32 ipa_usb_pipe_hdl;
453 u32 usb_ipa_pipe_hdl;
454 enum teth_tethering_mode tethering_mode;
455};
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200456
Gidon Studinskia83ef572013-03-04 18:38:16 +0200457#ifdef CONFIG_IPA
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200458
459/*
Talel Atias8390f262012-11-15 16:33:18 +0200460 * Connect / Disconnect
461 */
462int ipa_connect(const struct ipa_connect_params *in, struct ipa_sps_params *sps,
463 u32 *clnt_hdl);
464int ipa_disconnect(u32 clnt_hdl);
465
466/*
467 * Configuration
468 */
469int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg);
470
471int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg);
472
473int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg);
474
475int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ipa_ep_cfg);
476
477int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ipa_ep_cfg);
478
479int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ipa_ep_cfg);
480
481/*
482 * Header removal / addition
483 */
484int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs);
485
486int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls);
487
488int ipa_commit_hdr(void);
489
490int ipa_reset_hdr(void);
491
492int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup);
493
494int ipa_put_hdr(u32 hdr_hdl);
495
496int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy);
497
498/*
499 * Routing
500 */
501int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules);
502
503int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls);
504
505int ipa_commit_rt(enum ipa_ip_type ip);
506
507int ipa_reset_rt(enum ipa_ip_type ip);
508
509int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup);
510
511int ipa_put_rt_tbl(u32 rt_tbl_hdl);
512
513/*
514 * Filtering
515 */
516int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules);
517
518int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls);
519
520int ipa_commit_flt(enum ipa_ip_type ip);
521
522int ipa_reset_flt(enum ipa_ip_type ip);
523
524/*
525 * NAT
526 */
527int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem);
528
529int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init);
530
531int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma);
532
533int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del);
534
535/*
Talel Atias9bc53892013-02-10 15:10:07 +0200536 * Messaging
537 */
538int ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
539 ipa_msg_free_fn callback);
540int ipa_register_pull_msg(struct ipa_msg_meta *meta, ipa_msg_pull_fn callback);
541int ipa_deregister_pull_msg(struct ipa_msg_meta *meta);
542
543/*
544 * Interface
545 */
546int ipa_register_intf(const char *name, const struct ipa_tx_intf *tx,
547 const struct ipa_rx_intf *rx);
548int ipa_deregister_intf(const char *name);
549
550/*
Talel Atias8390f262012-11-15 16:33:18 +0200551 * Aggregation
552 */
553int ipa_set_aggr_mode(enum ipa_aggr_mode mode);
554
555int ipa_set_qcncm_ndp_sig(char sig[3]);
556
557int ipa_set_single_ndp_per_mbim(bool enable);
558
559/*
Talel Atias9bc53892013-02-10 15:10:07 +0200560 * SW bridge (between IPA and A2)
561 */
562int ipa_bridge_setup(enum ipa_bridge_dir dir, enum ipa_bridge_type type,
563 struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl);
564int ipa_bridge_teardown(enum ipa_bridge_dir dir, enum ipa_bridge_type type,
565 u32 clnt_hdl);
566
567
568/*
Talel Atias8390f262012-11-15 16:33:18 +0200569 * Data path
570 */
571int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
572 struct ipa_tx_meta *metadata);
573
574/*
575 * System pipes
576 */
577int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl);
578
579int ipa_teardown_sys_pipe(u32 clnt_hdl);
580
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200581/*
582 * Resource manager
583 */
584int ipa_rm_create_resource(struct ipa_rm_create_params *create_params);
585
586int ipa_rm_register(enum ipa_rm_resource_name resource_name,
587 struct ipa_rm_register_params *reg_params);
588
589int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
590 struct ipa_rm_register_params *reg_params);
591
592int ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name,
593 enum ipa_rm_resource_name depends_on_name);
594
595int ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name,
596 enum ipa_rm_resource_name depends_on_name);
597
598int ipa_rm_request_resource(enum ipa_rm_resource_name resource_name);
599
600int ipa_rm_release_resource(enum ipa_rm_resource_name resource_name);
601
602int ipa_rm_notify_completion(enum ipa_rm_event event,
603 enum ipa_rm_resource_name resource_name);
604
605int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name,
606 unsigned long msecs);
607
608int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name);
609
610int ipa_rm_inactivity_timer_request_resource(
611 enum ipa_rm_resource_name resource_name);
612
613int ipa_rm_inactivity_timer_release_resource(
614 enum ipa_rm_resource_name resource_name);
615
Gidon Studinskia83ef572013-03-04 18:38:16 +0200616/*
617 * a2 service
618 */
619int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid,
620 void *user_data,
621 a2_mux_notify_cb notify_cb);
622
623int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid);
624
625int a2_mux_write(enum a2_mux_logical_channel_id lcid, struct sk_buff *skb);
626
627int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid);
628
629int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid);
630
631int a2_mux_get_tethered_client_handles(enum a2_mux_logical_channel_id lcid,
632 unsigned int *clnt_cons_handle,
633 unsigned int *clnt_prod_handle);
634
635/*
636 * Tethering bridge (Rmnet / MBIM)
637 */
638int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr, void **private_data_ptr);
639
640int teth_bridge_disconnect(void);
641
642int teth_bridge_connect(struct teth_bridge_connect_params *connect_params);
643
Gidon Studinskif5f42bc2013-03-17 09:29:53 +0200644int teth_bridge_set_aggr_params(struct teth_aggr_params *aggr_params);
645
Talel Atias6d842bf2012-12-06 16:58:35 +0200646#else /* CONFIG_IPA */
Talel Atias8a6ec102012-11-21 20:22:29 +0200647
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200648static inline int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid,
649 void *user_data, a2_mux_notify_cb notify_cb)
650{
651 return -EPERM;
652}
653
654static inline int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid)
655{
656 return -EPERM;
657}
658
659static inline int a2_mux_write(enum a2_mux_logical_channel_id lcid,
660 struct sk_buff *skb)
661{
662 return -EPERM;
663}
664
665static inline int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid)
666{
667 return -EPERM;
668}
669
670static inline int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid)
671{
672 return -EPERM;
673}
674
675static inline int a2_mux_get_tethered_client_handles(
676 enum a2_mux_logical_channel_id lcid, unsigned int *clnt_cons_handle,
677 unsigned int *clnt_prod_handle)
678{
679 return -EPERM;
680}
681
Talel Atias8a6ec102012-11-21 20:22:29 +0200682/*
683 * Connect / Disconnect
684 */
685static inline int ipa_connect(const struct ipa_connect_params *in,
686 struct ipa_sps_params *sps, u32 *clnt_hdl)
687{
688 return -EPERM;
689}
690
691static inline int ipa_disconnect(u32 clnt_hdl)
692{
693 return -EPERM;
694}
695
Talel Atias8a6ec102012-11-21 20:22:29 +0200696/*
697 * Configuration
698 */
699static inline int ipa_cfg_ep(u32 clnt_hdl,
700 const struct ipa_ep_cfg *ipa_ep_cfg)
701{
702 return -EPERM;
703}
704
Talel Atias8a6ec102012-11-21 20:22:29 +0200705static inline int ipa_cfg_ep_nat(u32 clnt_hdl,
706 const struct ipa_ep_cfg_nat *ipa_ep_cfg)
707{
708 return -EPERM;
709}
710
Talel Atias8a6ec102012-11-21 20:22:29 +0200711static inline int ipa_cfg_ep_hdr(u32 clnt_hdl,
712 const struct ipa_ep_cfg_hdr *ipa_ep_cfg)
713{
714 return -EPERM;
715}
716
Talel Atias8a6ec102012-11-21 20:22:29 +0200717static inline int ipa_cfg_ep_mode(u32 clnt_hdl,
718 const struct ipa_ep_cfg_mode *ipa_ep_cfg)
719{
720 return -EPERM;
721}
722
Talel Atias8a6ec102012-11-21 20:22:29 +0200723static inline int ipa_cfg_ep_aggr(u32 clnt_hdl,
724 const struct ipa_ep_cfg_aggr *ipa_ep_cfg)
725{
726 return -EPERM;
727}
728
Talel Atias8a6ec102012-11-21 20:22:29 +0200729static inline int ipa_cfg_ep_route(u32 clnt_hdl,
730 const struct ipa_ep_cfg_route *ipa_ep_cfg)
731{
732 return -EPERM;
733}
734
Talel Atias8a6ec102012-11-21 20:22:29 +0200735/*
736 * Header removal / addition
737 */
738static inline int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs)
739{
740 return -EPERM;
741}
742
Talel Atias8a6ec102012-11-21 20:22:29 +0200743static inline int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls)
744{
745 return -EPERM;
746}
747
Talel Atias8a6ec102012-11-21 20:22:29 +0200748static inline int ipa_commit_hdr(void)
749{
750 return -EPERM;
751}
752
Talel Atias8a6ec102012-11-21 20:22:29 +0200753static inline int ipa_reset_hdr(void)
754{
755 return -EPERM;
756}
757
Talel Atias8a6ec102012-11-21 20:22:29 +0200758static inline int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup)
759{
760 return -EPERM;
761}
762
Talel Atias8a6ec102012-11-21 20:22:29 +0200763static inline int ipa_put_hdr(u32 hdr_hdl)
764{
765 return -EPERM;
766}
767
Talel Atias8a6ec102012-11-21 20:22:29 +0200768static inline int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy)
769{
770 return -EPERM;
771}
772
Talel Atias8a6ec102012-11-21 20:22:29 +0200773/*
774 * Routing
775 */
776static inline int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules)
777{
778 return -EPERM;
779}
780
Talel Atias8a6ec102012-11-21 20:22:29 +0200781static inline int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls)
782{
783 return -EPERM;
784}
785
Talel Atias8a6ec102012-11-21 20:22:29 +0200786static inline int ipa_commit_rt(enum ipa_ip_type ip)
787{
788 return -EPERM;
789}
790
Talel Atias8a6ec102012-11-21 20:22:29 +0200791static inline int ipa_reset_rt(enum ipa_ip_type ip)
792{
793 return -EPERM;
794}
795
Talel Atias8a6ec102012-11-21 20:22:29 +0200796static inline int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup)
797{
798 return -EPERM;
799}
800
Talel Atias8a6ec102012-11-21 20:22:29 +0200801static inline int ipa_put_rt_tbl(u32 rt_tbl_hdl)
802{
803 return -EPERM;
804}
805
Talel Atias8a6ec102012-11-21 20:22:29 +0200806/*
807 * Filtering
808 */
809static inline int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules)
810{
811 return -EPERM;
812}
813
Talel Atias8a6ec102012-11-21 20:22:29 +0200814static inline int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls)
815{
816 return -EPERM;
817}
818
Talel Atias8a6ec102012-11-21 20:22:29 +0200819static inline int ipa_commit_flt(enum ipa_ip_type ip)
820{
821 return -EPERM;
822}
823
Talel Atias8a6ec102012-11-21 20:22:29 +0200824static inline int ipa_reset_flt(enum ipa_ip_type ip)
825{
826 return -EPERM;
827}
828
Talel Atias8a6ec102012-11-21 20:22:29 +0200829/*
830 * NAT
831 */
832static inline int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem)
833{
834 return -EPERM;
835}
836
837
838static inline int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init)
839{
840 return -EPERM;
841}
842
843
844static inline int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma)
845{
846 return -EPERM;
847}
848
849
850static inline int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del)
851{
852 return -EPERM;
853}
854
Talel Atias9bc53892013-02-10 15:10:07 +0200855/*
856 * Messaging
857 */
858static inline int ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
859 ipa_msg_free_fn callback)
860{
861 return -EPERM;
862}
863
864static inline int ipa_register_pull_msg(struct ipa_msg_meta *meta,
865 ipa_msg_pull_fn callback)
866{
867 return -EPERM;
868}
869
870static inline int ipa_deregister_pull_msg(struct ipa_msg_meta *meta)
871{
872 return -EPERM;
873}
874
875/*
876 * Interface
877 */
878static inline int ipa_register_intf(const char *name,
879 const struct ipa_tx_intf *tx,
880 const struct ipa_rx_intf *rx)
881{
882 return -EPERM;
883}
884
885static inline int ipa_deregister_intf(const char *name)
886{
887 return -EPERM;
888}
Talel Atias8a6ec102012-11-21 20:22:29 +0200889
890/*
891 * Aggregation
892 */
893static inline int ipa_set_aggr_mode(enum ipa_aggr_mode mode)
894{
895 return -EPERM;
896}
897
Talel Atias8a6ec102012-11-21 20:22:29 +0200898static inline int ipa_set_qcncm_ndp_sig(char sig[3])
899{
900 return -EPERM;
901}
902
Talel Atias8a6ec102012-11-21 20:22:29 +0200903static inline int ipa_set_single_ndp_per_mbim(bool enable)
904{
905 return -EPERM;
906}
907
Talel Atias8a6ec102012-11-21 20:22:29 +0200908/*
Talel Atias9bc53892013-02-10 15:10:07 +0200909 * SW bridge (between IPA and A2)
910 */
911static inline int ipa_bridge_setup(enum ipa_bridge_dir dir,
912 enum ipa_bridge_type type,
913 struct ipa_sys_connect_params *sys_in,
914 u32 *clnt_hdl)
915{
916 return -EPERM;
917}
918
919static inline int ipa_bridge_teardown(enum ipa_bridge_dir dir,
920 enum ipa_bridge_type type,
921 u32 clnt_hdl)
922{
923 return -EPERM;
924}
Talel Atias8a6ec102012-11-21 20:22:29 +0200925
926/*
927 * Data path
928 */
929static inline int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
930 struct ipa_tx_meta *metadata)
931{
932 return -EPERM;
933}
934
Talel Atias8a6ec102012-11-21 20:22:29 +0200935/*
936 * System pipes
937 */
938static inline int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in,
939 u32 *clnt_hdl)
940{
941 return -EPERM;
942}
943
Talel Atias8a6ec102012-11-21 20:22:29 +0200944static inline int ipa_teardown_sys_pipe(u32 clnt_hdl)
945{
946 return -EPERM;
947}
948
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200949/*
950 * Resource manager
951 */
952static inline int ipa_rm_create_resource(
953 struct ipa_rm_create_params *create_params)
954{
955 return -EPERM;
956}
957
958static inline int ipa_rm_register(enum ipa_rm_resource_name resource_name,
959 struct ipa_rm_register_params *reg_params)
960{
961 return -EPERM;
962}
963
964static inline int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
965 struct ipa_rm_register_params *reg_params)
966{
967 return -EPERM;
968}
969
970static inline int ipa_rm_add_dependency(
971 enum ipa_rm_resource_name resource_name,
972 enum ipa_rm_resource_name depends_on_name)
973{
974 return -EPERM;
975}
976
977static inline int ipa_rm_delete_dependency(
978 enum ipa_rm_resource_name resource_name,
979 enum ipa_rm_resource_name depends_on_name)
980{
981 return -EPERM;
982}
983
984static inline int ipa_rm_request_resource(
985 enum ipa_rm_resource_name resource_name)
986{
987 return -EPERM;
988}
989
990static inline int ipa_rm_release_resource(
991 enum ipa_rm_resource_name resource_name)
992{
993 return -EPERM;
994}
995
996static inline int ipa_rm_notify_completion(enum ipa_rm_event event,
997 enum ipa_rm_resource_name resource_name)
998{
999 return -EPERM;
1000}
1001
1002static inline int ipa_rm_inactivity_timer_init(
1003 enum ipa_rm_resource_name resource_name,
1004 unsigned long msecs)
1005{
1006 return -EPERM;
1007}
1008
1009static inline int ipa_rm_inactivity_timer_destroy(
1010 enum ipa_rm_resource_name resource_name)
1011{
1012 return -EPERM;
1013}
1014
1015static inline int ipa_rm_inactivity_timer_request_resource(
1016 enum ipa_rm_resource_name resource_name)
1017{
1018 return -EPERM;
1019}
1020
1021static inline int ipa_rm_inactivity_timer_release_resource(
1022 enum ipa_rm_resource_name resource_name)
1023{
1024 return -EPERM;
1025}
1026
Gidon Studinskia83ef572013-03-04 18:38:16 +02001027/*
1028 * Tethering bridge (Rmnetm / MBIM)
1029 */
1030static inline int teth_bridge_init(ipa_notify_cb *usb_notify_cb_ptr,
1031 void **private_data_ptr)
1032{
1033 return -EPERM;
1034}
1035
1036static inline int teth_bridge_disconnect(void)
1037{
1038 return -EPERM;
1039}
1040
1041static inline int teth_bridge_connect(struct teth_bridge_connect_params
1042 *connect_params)
1043{
1044 return -EPERM;
1045}
1046
Gidon Studinskif5f42bc2013-03-17 09:29:53 +02001047static inline int teth_bridge_set_aggr_params(struct teth_aggr_params
1048 *aggr_params)
1049{
1050 return -EPERM;
1051}
1052
Talel Atias8a6ec102012-11-21 20:22:29 +02001053#endif /* CONFIG_IPA*/
1054
Talel Atias8390f262012-11-15 16:33:18 +02001055#endif /* _IPA_H_ */