blob: 5ccdf8249d65b8917b215fec1b4714803fab0f17 [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/**
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 */
363enum 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 */
392enum ipa_rm_event {
393 IPA_RM_RESOURCE_GRANTED,
394 IPA_RM_RESOURCE_RELEASED
395};
396
397typedef 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 */
413struct 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 */
434struct 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 Mordohovich4028f802013-03-04 15:16:31 +0200441enum a2_mux_event_type {
442 A2_MUX_RECEIVE,
443 A2_MUX_WRITE_DONE
444};
445
446enum a2_mux_logical_channel_id {
447 A2_MUX_WWAN_0,
448 A2_MUX_WWAN_1,
449 A2_MUX_WWAN_2,
450 A2_MUX_WWAN_3,
451 A2_MUX_WWAN_4,
452 A2_MUX_WWAN_5,
453 A2_MUX_WWAN_6,
454 A2_MUX_WWAN_7,
455 A2_MUX_TETHERED_0,
456 A2_MUX_NUM_CHANNELS
457};
458
459typedef void (*a2_mux_notify_cb)(void *user_data,
460 enum a2_mux_event_type event,
461 unsigned long data);
462
Talel Atias8a6ec102012-11-21 20:22:29 +0200463#ifdef CONFIG_IPA
464
Talel Atias8390f262012-11-15 16:33:18 +0200465/*
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200466 * a2 service
467 */
468int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid,
469 void *user_data,
470 a2_mux_notify_cb notify_cb);
471
472int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid);
473
474int a2_mux_write(enum a2_mux_logical_channel_id lcid, struct sk_buff *skb);
475
476int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid);
477
478int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid);
479
480int a2_mux_get_tethered_client_handles(enum a2_mux_logical_channel_id lcid,
481 unsigned int *clnt_cons_handle,
482 unsigned int *clnt_prod_handle);
483
484/*
Talel Atias8390f262012-11-15 16:33:18 +0200485 * Connect / Disconnect
486 */
487int ipa_connect(const struct ipa_connect_params *in, struct ipa_sps_params *sps,
488 u32 *clnt_hdl);
489int ipa_disconnect(u32 clnt_hdl);
490
491/*
492 * Configuration
493 */
494int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg);
495
496int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg);
497
498int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg);
499
500int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ipa_ep_cfg);
501
502int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ipa_ep_cfg);
503
504int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ipa_ep_cfg);
505
506/*
507 * Header removal / addition
508 */
509int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs);
510
511int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls);
512
513int ipa_commit_hdr(void);
514
515int ipa_reset_hdr(void);
516
517int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup);
518
519int ipa_put_hdr(u32 hdr_hdl);
520
521int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy);
522
523/*
524 * Routing
525 */
526int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules);
527
528int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls);
529
530int ipa_commit_rt(enum ipa_ip_type ip);
531
532int ipa_reset_rt(enum ipa_ip_type ip);
533
534int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup);
535
536int ipa_put_rt_tbl(u32 rt_tbl_hdl);
537
538/*
539 * Filtering
540 */
541int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules);
542
543int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls);
544
545int ipa_commit_flt(enum ipa_ip_type ip);
546
547int ipa_reset_flt(enum ipa_ip_type ip);
548
549/*
550 * NAT
551 */
552int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem);
553
554int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init);
555
556int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma);
557
558int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del);
559
560/*
Talel Atias9bc53892013-02-10 15:10:07 +0200561 * Messaging
562 */
563int ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
564 ipa_msg_free_fn callback);
565int ipa_register_pull_msg(struct ipa_msg_meta *meta, ipa_msg_pull_fn callback);
566int ipa_deregister_pull_msg(struct ipa_msg_meta *meta);
567
568/*
569 * Interface
570 */
571int ipa_register_intf(const char *name, const struct ipa_tx_intf *tx,
572 const struct ipa_rx_intf *rx);
573int ipa_deregister_intf(const char *name);
574
575/*
Talel Atias8390f262012-11-15 16:33:18 +0200576 * Aggregation
577 */
578int ipa_set_aggr_mode(enum ipa_aggr_mode mode);
579
580int ipa_set_qcncm_ndp_sig(char sig[3]);
581
582int ipa_set_single_ndp_per_mbim(bool enable);
583
584/*
585 * rmnet bridge
586 */
587int rmnet_bridge_init(void);
588
589int rmnet_bridge_disconnect(void);
590
591int rmnet_bridge_connect(u32 producer_hdl,
592 u32 consumer_hdl,
593 int wwan_logical_channel_id);
594
595/*
Talel Atias9bc53892013-02-10 15:10:07 +0200596 * SW bridge (between IPA and A2)
597 */
598int ipa_bridge_setup(enum ipa_bridge_dir dir, enum ipa_bridge_type type,
599 struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl);
600int ipa_bridge_teardown(enum ipa_bridge_dir dir, enum ipa_bridge_type type,
601 u32 clnt_hdl);
602
603
604/*
Talel Atias8390f262012-11-15 16:33:18 +0200605 * Data path
606 */
607int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
608 struct ipa_tx_meta *metadata);
609
610/*
611 * System pipes
612 */
613int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl);
614
615int ipa_teardown_sys_pipe(u32 clnt_hdl);
616
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200617/*
618 * Resource manager
619 */
620int ipa_rm_create_resource(struct ipa_rm_create_params *create_params);
621
622int ipa_rm_register(enum ipa_rm_resource_name resource_name,
623 struct ipa_rm_register_params *reg_params);
624
625int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
626 struct ipa_rm_register_params *reg_params);
627
628int ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name,
629 enum ipa_rm_resource_name depends_on_name);
630
631int ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name,
632 enum ipa_rm_resource_name depends_on_name);
633
634int ipa_rm_request_resource(enum ipa_rm_resource_name resource_name);
635
636int ipa_rm_release_resource(enum ipa_rm_resource_name resource_name);
637
638int ipa_rm_notify_completion(enum ipa_rm_event event,
639 enum ipa_rm_resource_name resource_name);
640
641int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name,
642 unsigned long msecs);
643
644int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name);
645
646int ipa_rm_inactivity_timer_request_resource(
647 enum ipa_rm_resource_name resource_name);
648
649int ipa_rm_inactivity_timer_release_resource(
650 enum ipa_rm_resource_name resource_name);
651
Talel Atias6d842bf2012-12-06 16:58:35 +0200652#else /* CONFIG_IPA */
Talel Atias8a6ec102012-11-21 20:22:29 +0200653
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200654static inline int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid,
655 void *user_data, a2_mux_notify_cb notify_cb)
656{
657 return -EPERM;
658}
659
660static inline int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid)
661{
662 return -EPERM;
663}
664
665static inline int a2_mux_write(enum a2_mux_logical_channel_id lcid,
666 struct sk_buff *skb)
667{
668 return -EPERM;
669}
670
671static inline int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid)
672{
673 return -EPERM;
674}
675
676static inline int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid)
677{
678 return -EPERM;
679}
680
681static inline int a2_mux_get_tethered_client_handles(
682 enum a2_mux_logical_channel_id lcid, unsigned int *clnt_cons_handle,
683 unsigned int *clnt_prod_handle)
684{
685 return -EPERM;
686}
687
688
Talel Atias8a6ec102012-11-21 20:22:29 +0200689/*
690 * Connect / Disconnect
691 */
692static inline int ipa_connect(const struct ipa_connect_params *in,
693 struct ipa_sps_params *sps, u32 *clnt_hdl)
694{
695 return -EPERM;
696}
697
698static inline int ipa_disconnect(u32 clnt_hdl)
699{
700 return -EPERM;
701}
702
Talel Atias8a6ec102012-11-21 20:22:29 +0200703/*
704 * Configuration
705 */
706static inline int ipa_cfg_ep(u32 clnt_hdl,
707 const struct ipa_ep_cfg *ipa_ep_cfg)
708{
709 return -EPERM;
710}
711
Talel Atias8a6ec102012-11-21 20:22:29 +0200712static inline int ipa_cfg_ep_nat(u32 clnt_hdl,
713 const struct ipa_ep_cfg_nat *ipa_ep_cfg)
714{
715 return -EPERM;
716}
717
Talel Atias8a6ec102012-11-21 20:22:29 +0200718static inline int ipa_cfg_ep_hdr(u32 clnt_hdl,
719 const struct ipa_ep_cfg_hdr *ipa_ep_cfg)
720{
721 return -EPERM;
722}
723
Talel Atias8a6ec102012-11-21 20:22:29 +0200724static inline int ipa_cfg_ep_mode(u32 clnt_hdl,
725 const struct ipa_ep_cfg_mode *ipa_ep_cfg)
726{
727 return -EPERM;
728}
729
Talel Atias8a6ec102012-11-21 20:22:29 +0200730static inline int ipa_cfg_ep_aggr(u32 clnt_hdl,
731 const struct ipa_ep_cfg_aggr *ipa_ep_cfg)
732{
733 return -EPERM;
734}
735
Talel Atias8a6ec102012-11-21 20:22:29 +0200736static inline int ipa_cfg_ep_route(u32 clnt_hdl,
737 const struct ipa_ep_cfg_route *ipa_ep_cfg)
738{
739 return -EPERM;
740}
741
Talel Atias8a6ec102012-11-21 20:22:29 +0200742/*
743 * Header removal / addition
744 */
745static inline int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs)
746{
747 return -EPERM;
748}
749
Talel Atias8a6ec102012-11-21 20:22:29 +0200750static inline int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls)
751{
752 return -EPERM;
753}
754
Talel Atias8a6ec102012-11-21 20:22:29 +0200755static inline int ipa_commit_hdr(void)
756{
757 return -EPERM;
758}
759
Talel Atias8a6ec102012-11-21 20:22:29 +0200760static inline int ipa_reset_hdr(void)
761{
762 return -EPERM;
763}
764
Talel Atias8a6ec102012-11-21 20:22:29 +0200765static inline int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup)
766{
767 return -EPERM;
768}
769
Talel Atias8a6ec102012-11-21 20:22:29 +0200770static inline int ipa_put_hdr(u32 hdr_hdl)
771{
772 return -EPERM;
773}
774
Talel Atias8a6ec102012-11-21 20:22:29 +0200775static inline int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy)
776{
777 return -EPERM;
778}
779
Talel Atias8a6ec102012-11-21 20:22:29 +0200780/*
781 * Routing
782 */
783static inline int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules)
784{
785 return -EPERM;
786}
787
Talel Atias8a6ec102012-11-21 20:22:29 +0200788static inline int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls)
789{
790 return -EPERM;
791}
792
Talel Atias8a6ec102012-11-21 20:22:29 +0200793static inline int ipa_commit_rt(enum ipa_ip_type ip)
794{
795 return -EPERM;
796}
797
Talel Atias8a6ec102012-11-21 20:22:29 +0200798static inline int ipa_reset_rt(enum ipa_ip_type ip)
799{
800 return -EPERM;
801}
802
Talel Atias8a6ec102012-11-21 20:22:29 +0200803static inline int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup)
804{
805 return -EPERM;
806}
807
Talel Atias8a6ec102012-11-21 20:22:29 +0200808static inline int ipa_put_rt_tbl(u32 rt_tbl_hdl)
809{
810 return -EPERM;
811}
812
Talel Atias8a6ec102012-11-21 20:22:29 +0200813/*
814 * Filtering
815 */
816static inline int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules)
817{
818 return -EPERM;
819}
820
Talel Atias8a6ec102012-11-21 20:22:29 +0200821static inline int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls)
822{
823 return -EPERM;
824}
825
Talel Atias8a6ec102012-11-21 20:22:29 +0200826static inline int ipa_commit_flt(enum ipa_ip_type ip)
827{
828 return -EPERM;
829}
830
Talel Atias8a6ec102012-11-21 20:22:29 +0200831static inline int ipa_reset_flt(enum ipa_ip_type ip)
832{
833 return -EPERM;
834}
835
Talel Atias8a6ec102012-11-21 20:22:29 +0200836/*
837 * NAT
838 */
839static inline int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem)
840{
841 return -EPERM;
842}
843
844
845static inline int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init)
846{
847 return -EPERM;
848}
849
850
851static inline int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma)
852{
853 return -EPERM;
854}
855
856
857static inline int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del)
858{
859 return -EPERM;
860}
861
Talel Atias9bc53892013-02-10 15:10:07 +0200862/*
863 * Messaging
864 */
865static inline int ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
866 ipa_msg_free_fn callback)
867{
868 return -EPERM;
869}
870
871static inline int ipa_register_pull_msg(struct ipa_msg_meta *meta,
872 ipa_msg_pull_fn callback)
873{
874 return -EPERM;
875}
876
877static inline int ipa_deregister_pull_msg(struct ipa_msg_meta *meta)
878{
879 return -EPERM;
880}
881
882/*
883 * Interface
884 */
885static inline int ipa_register_intf(const char *name,
886 const struct ipa_tx_intf *tx,
887 const struct ipa_rx_intf *rx)
888{
889 return -EPERM;
890}
891
892static inline int ipa_deregister_intf(const char *name)
893{
894 return -EPERM;
895}
Talel Atias8a6ec102012-11-21 20:22:29 +0200896
897/*
898 * Aggregation
899 */
900static inline int ipa_set_aggr_mode(enum ipa_aggr_mode mode)
901{
902 return -EPERM;
903}
904
Talel Atias8a6ec102012-11-21 20:22:29 +0200905static inline int ipa_set_qcncm_ndp_sig(char sig[3])
906{
907 return -EPERM;
908}
909
Talel Atias8a6ec102012-11-21 20:22:29 +0200910static inline int ipa_set_single_ndp_per_mbim(bool enable)
911{
912 return -EPERM;
913}
914
Talel Atias8a6ec102012-11-21 20:22:29 +0200915/*
916 * rmnet bridge
917 */
918static inline int rmnet_bridge_init(void)
919{
920 return -EPERM;
921}
922
Talel Atias8a6ec102012-11-21 20:22:29 +0200923static inline int rmnet_bridge_disconnect(void)
924{
925 return -EPERM;
926}
927
Talel Atias8a6ec102012-11-21 20:22:29 +0200928static inline int rmnet_bridge_connect(u32 producer_hdl,
929 u32 consumer_hdl,
930 int wwan_logical_channel_id)
931{
932 return -EPERM;
933}
934
Talel Atias9bc53892013-02-10 15:10:07 +0200935/*
936 * SW bridge (between IPA and A2)
937 */
938static inline int ipa_bridge_setup(enum ipa_bridge_dir dir,
939 enum ipa_bridge_type type,
940 struct ipa_sys_connect_params *sys_in,
941 u32 *clnt_hdl)
942{
943 return -EPERM;
944}
945
946static inline int ipa_bridge_teardown(enum ipa_bridge_dir dir,
947 enum ipa_bridge_type type,
948 u32 clnt_hdl)
949{
950 return -EPERM;
951}
Talel Atias8a6ec102012-11-21 20:22:29 +0200952
953/*
954 * Data path
955 */
956static inline int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
957 struct ipa_tx_meta *metadata)
958{
959 return -EPERM;
960}
961
Talel Atias8a6ec102012-11-21 20:22:29 +0200962/*
963 * System pipes
964 */
965static inline int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in,
966 u32 *clnt_hdl)
967{
968 return -EPERM;
969}
970
Talel Atias8a6ec102012-11-21 20:22:29 +0200971static inline int ipa_teardown_sys_pipe(u32 clnt_hdl)
972{
973 return -EPERM;
974}
975
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200976/*
977 * Resource manager
978 */
979static inline int ipa_rm_create_resource(
980 struct ipa_rm_create_params *create_params)
981{
982 return -EPERM;
983}
984
985static inline int ipa_rm_register(enum ipa_rm_resource_name resource_name,
986 struct ipa_rm_register_params *reg_params)
987{
988 return -EPERM;
989}
990
991static inline int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
992 struct ipa_rm_register_params *reg_params)
993{
994 return -EPERM;
995}
996
997static inline int ipa_rm_add_dependency(
998 enum ipa_rm_resource_name resource_name,
999 enum ipa_rm_resource_name depends_on_name)
1000{
1001 return -EPERM;
1002}
1003
1004static inline int ipa_rm_delete_dependency(
1005 enum ipa_rm_resource_name resource_name,
1006 enum ipa_rm_resource_name depends_on_name)
1007{
1008 return -EPERM;
1009}
1010
1011static inline int ipa_rm_request_resource(
1012 enum ipa_rm_resource_name resource_name)
1013{
1014 return -EPERM;
1015}
1016
1017static inline int ipa_rm_release_resource(
1018 enum ipa_rm_resource_name resource_name)
1019{
1020 return -EPERM;
1021}
1022
1023static inline int ipa_rm_notify_completion(enum ipa_rm_event event,
1024 enum ipa_rm_resource_name resource_name)
1025{
1026 return -EPERM;
1027}
1028
1029static inline int ipa_rm_inactivity_timer_init(
1030 enum ipa_rm_resource_name resource_name,
1031 unsigned long msecs)
1032{
1033 return -EPERM;
1034}
1035
1036static inline int ipa_rm_inactivity_timer_destroy(
1037 enum ipa_rm_resource_name resource_name)
1038{
1039 return -EPERM;
1040}
1041
1042static inline int ipa_rm_inactivity_timer_request_resource(
1043 enum ipa_rm_resource_name resource_name)
1044{
1045 return -EPERM;
1046}
1047
1048static inline int ipa_rm_inactivity_timer_release_resource(
1049 enum ipa_rm_resource_name resource_name)
1050{
1051 return -EPERM;
1052}
1053
Talel Atias8a6ec102012-11-21 20:22:29 +02001054#endif /* CONFIG_IPA*/
1055
Talel Atias8390f262012-11-15 16:33:18 +02001056#endif /* _IPA_H_ */