blob: 1073266f5bc96343207f5f466c504f21aaf517d3 [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 Mordohovich7928bc52013-03-05 09:31:08 +0200441#define A2_MUX_HDR_NAME_V4_PREF "dmux_hdr_v4_"
442#define A2_MUX_HDR_NAME_V6_PREF "dmux_hdr_v6_"
443
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200444enum a2_mux_event_type {
445 A2_MUX_RECEIVE,
446 A2_MUX_WRITE_DONE
447};
448
449enum 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
462typedef void (*a2_mux_notify_cb)(void *user_data,
463 enum a2_mux_event_type event,
464 unsigned long data);
465
Talel Atias8a6ec102012-11-21 20:22:29 +0200466#ifdef CONFIG_IPA
467
Talel Atias8390f262012-11-15 16:33:18 +0200468/*
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200469 * a2 service
470 */
471int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid,
472 void *user_data,
473 a2_mux_notify_cb notify_cb);
474
475int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid);
476
477int a2_mux_write(enum a2_mux_logical_channel_id lcid, struct sk_buff *skb);
478
479int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid);
480
481int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid);
482
483int a2_mux_get_tethered_client_handles(enum a2_mux_logical_channel_id lcid,
484 unsigned int *clnt_cons_handle,
485 unsigned int *clnt_prod_handle);
486
487/*
Talel Atias8390f262012-11-15 16:33:18 +0200488 * Connect / Disconnect
489 */
490int ipa_connect(const struct ipa_connect_params *in, struct ipa_sps_params *sps,
491 u32 *clnt_hdl);
492int ipa_disconnect(u32 clnt_hdl);
493
494/*
495 * Configuration
496 */
497int ipa_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg);
498
499int ipa_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ipa_ep_cfg);
500
501int ipa_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ipa_ep_cfg);
502
503int ipa_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ipa_ep_cfg);
504
505int ipa_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ipa_ep_cfg);
506
507int ipa_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ipa_ep_cfg);
508
509/*
510 * Header removal / addition
511 */
512int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs);
513
514int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls);
515
516int ipa_commit_hdr(void);
517
518int ipa_reset_hdr(void);
519
520int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup);
521
522int ipa_put_hdr(u32 hdr_hdl);
523
524int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy);
525
526/*
527 * Routing
528 */
529int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules);
530
531int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls);
532
533int ipa_commit_rt(enum ipa_ip_type ip);
534
535int ipa_reset_rt(enum ipa_ip_type ip);
536
537int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup);
538
539int ipa_put_rt_tbl(u32 rt_tbl_hdl);
540
541/*
542 * Filtering
543 */
544int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules);
545
546int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls);
547
548int ipa_commit_flt(enum ipa_ip_type ip);
549
550int ipa_reset_flt(enum ipa_ip_type ip);
551
552/*
553 * NAT
554 */
555int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem);
556
557int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init);
558
559int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma);
560
561int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del);
562
563/*
Talel Atias9bc53892013-02-10 15:10:07 +0200564 * Messaging
565 */
566int ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
567 ipa_msg_free_fn callback);
568int ipa_register_pull_msg(struct ipa_msg_meta *meta, ipa_msg_pull_fn callback);
569int ipa_deregister_pull_msg(struct ipa_msg_meta *meta);
570
571/*
572 * Interface
573 */
574int ipa_register_intf(const char *name, const struct ipa_tx_intf *tx,
575 const struct ipa_rx_intf *rx);
576int ipa_deregister_intf(const char *name);
577
578/*
Talel Atias8390f262012-11-15 16:33:18 +0200579 * Aggregation
580 */
581int ipa_set_aggr_mode(enum ipa_aggr_mode mode);
582
583int ipa_set_qcncm_ndp_sig(char sig[3]);
584
585int ipa_set_single_ndp_per_mbim(bool enable);
586
587/*
588 * rmnet bridge
589 */
590int rmnet_bridge_init(void);
591
592int rmnet_bridge_disconnect(void);
593
594int rmnet_bridge_connect(u32 producer_hdl,
595 u32 consumer_hdl,
596 int wwan_logical_channel_id);
597
598/*
Talel Atias9bc53892013-02-10 15:10:07 +0200599 * SW bridge (between IPA and A2)
600 */
601int ipa_bridge_setup(enum ipa_bridge_dir dir, enum ipa_bridge_type type,
602 struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl);
603int ipa_bridge_teardown(enum ipa_bridge_dir dir, enum ipa_bridge_type type,
604 u32 clnt_hdl);
605
606
607/*
Talel Atias8390f262012-11-15 16:33:18 +0200608 * Data path
609 */
610int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
611 struct ipa_tx_meta *metadata);
612
613/*
614 * System pipes
615 */
616int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, u32 *clnt_hdl);
617
618int ipa_teardown_sys_pipe(u32 clnt_hdl);
619
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200620/*
621 * Resource manager
622 */
623int ipa_rm_create_resource(struct ipa_rm_create_params *create_params);
624
625int ipa_rm_register(enum ipa_rm_resource_name resource_name,
626 struct ipa_rm_register_params *reg_params);
627
628int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
629 struct ipa_rm_register_params *reg_params);
630
631int ipa_rm_add_dependency(enum ipa_rm_resource_name resource_name,
632 enum ipa_rm_resource_name depends_on_name);
633
634int ipa_rm_delete_dependency(enum ipa_rm_resource_name resource_name,
635 enum ipa_rm_resource_name depends_on_name);
636
637int ipa_rm_request_resource(enum ipa_rm_resource_name resource_name);
638
639int ipa_rm_release_resource(enum ipa_rm_resource_name resource_name);
640
641int ipa_rm_notify_completion(enum ipa_rm_event event,
642 enum ipa_rm_resource_name resource_name);
643
644int ipa_rm_inactivity_timer_init(enum ipa_rm_resource_name resource_name,
645 unsigned long msecs);
646
647int ipa_rm_inactivity_timer_destroy(enum ipa_rm_resource_name resource_name);
648
649int ipa_rm_inactivity_timer_request_resource(
650 enum ipa_rm_resource_name resource_name);
651
652int ipa_rm_inactivity_timer_release_resource(
653 enum ipa_rm_resource_name resource_name);
654
Talel Atias6d842bf2012-12-06 16:58:35 +0200655#else /* CONFIG_IPA */
Talel Atias8a6ec102012-11-21 20:22:29 +0200656
Vladislav Mordohovich4028f802013-03-04 15:16:31 +0200657static inline int a2_mux_open_channel(enum a2_mux_logical_channel_id lcid,
658 void *user_data, a2_mux_notify_cb notify_cb)
659{
660 return -EPERM;
661}
662
663static inline int a2_mux_close_channel(enum a2_mux_logical_channel_id lcid)
664{
665 return -EPERM;
666}
667
668static inline int a2_mux_write(enum a2_mux_logical_channel_id lcid,
669 struct sk_buff *skb)
670{
671 return -EPERM;
672}
673
674static inline int a2_mux_is_ch_low(enum a2_mux_logical_channel_id lcid)
675{
676 return -EPERM;
677}
678
679static inline int a2_mux_is_ch_full(enum a2_mux_logical_channel_id lcid)
680{
681 return -EPERM;
682}
683
684static inline int a2_mux_get_tethered_client_handles(
685 enum a2_mux_logical_channel_id lcid, unsigned int *clnt_cons_handle,
686 unsigned int *clnt_prod_handle)
687{
688 return -EPERM;
689}
690
691
Talel Atias8a6ec102012-11-21 20:22:29 +0200692/*
693 * Connect / Disconnect
694 */
695static inline int ipa_connect(const struct ipa_connect_params *in,
696 struct ipa_sps_params *sps, u32 *clnt_hdl)
697{
698 return -EPERM;
699}
700
701static inline int ipa_disconnect(u32 clnt_hdl)
702{
703 return -EPERM;
704}
705
Talel Atias8a6ec102012-11-21 20:22:29 +0200706/*
707 * Configuration
708 */
709static inline int ipa_cfg_ep(u32 clnt_hdl,
710 const struct ipa_ep_cfg *ipa_ep_cfg)
711{
712 return -EPERM;
713}
714
Talel Atias8a6ec102012-11-21 20:22:29 +0200715static inline int ipa_cfg_ep_nat(u32 clnt_hdl,
716 const struct ipa_ep_cfg_nat *ipa_ep_cfg)
717{
718 return -EPERM;
719}
720
Talel Atias8a6ec102012-11-21 20:22:29 +0200721static inline int ipa_cfg_ep_hdr(u32 clnt_hdl,
722 const struct ipa_ep_cfg_hdr *ipa_ep_cfg)
723{
724 return -EPERM;
725}
726
Talel Atias8a6ec102012-11-21 20:22:29 +0200727static inline int ipa_cfg_ep_mode(u32 clnt_hdl,
728 const struct ipa_ep_cfg_mode *ipa_ep_cfg)
729{
730 return -EPERM;
731}
732
Talel Atias8a6ec102012-11-21 20:22:29 +0200733static inline int ipa_cfg_ep_aggr(u32 clnt_hdl,
734 const struct ipa_ep_cfg_aggr *ipa_ep_cfg)
735{
736 return -EPERM;
737}
738
Talel Atias8a6ec102012-11-21 20:22:29 +0200739static inline int ipa_cfg_ep_route(u32 clnt_hdl,
740 const struct ipa_ep_cfg_route *ipa_ep_cfg)
741{
742 return -EPERM;
743}
744
Talel Atias8a6ec102012-11-21 20:22:29 +0200745/*
746 * Header removal / addition
747 */
748static inline int ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs)
749{
750 return -EPERM;
751}
752
Talel Atias8a6ec102012-11-21 20:22:29 +0200753static inline int ipa_del_hdr(struct ipa_ioc_del_hdr *hdls)
754{
755 return -EPERM;
756}
757
Talel Atias8a6ec102012-11-21 20:22:29 +0200758static inline int ipa_commit_hdr(void)
759{
760 return -EPERM;
761}
762
Talel Atias8a6ec102012-11-21 20:22:29 +0200763static inline int ipa_reset_hdr(void)
764{
765 return -EPERM;
766}
767
Talel Atias8a6ec102012-11-21 20:22:29 +0200768static inline int ipa_get_hdr(struct ipa_ioc_get_hdr *lookup)
769{
770 return -EPERM;
771}
772
Talel Atias8a6ec102012-11-21 20:22:29 +0200773static inline int ipa_put_hdr(u32 hdr_hdl)
774{
775 return -EPERM;
776}
777
Talel Atias8a6ec102012-11-21 20:22:29 +0200778static inline int ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy)
779{
780 return -EPERM;
781}
782
Talel Atias8a6ec102012-11-21 20:22:29 +0200783/*
784 * Routing
785 */
786static inline int ipa_add_rt_rule(struct ipa_ioc_add_rt_rule *rules)
787{
788 return -EPERM;
789}
790
Talel Atias8a6ec102012-11-21 20:22:29 +0200791static inline int ipa_del_rt_rule(struct ipa_ioc_del_rt_rule *hdls)
792{
793 return -EPERM;
794}
795
Talel Atias8a6ec102012-11-21 20:22:29 +0200796static inline int ipa_commit_rt(enum ipa_ip_type ip)
797{
798 return -EPERM;
799}
800
Talel Atias8a6ec102012-11-21 20:22:29 +0200801static inline int ipa_reset_rt(enum ipa_ip_type ip)
802{
803 return -EPERM;
804}
805
Talel Atias8a6ec102012-11-21 20:22:29 +0200806static inline int ipa_get_rt_tbl(struct ipa_ioc_get_rt_tbl *lookup)
807{
808 return -EPERM;
809}
810
Talel Atias8a6ec102012-11-21 20:22:29 +0200811static inline int ipa_put_rt_tbl(u32 rt_tbl_hdl)
812{
813 return -EPERM;
814}
815
Talel Atias8a6ec102012-11-21 20:22:29 +0200816/*
817 * Filtering
818 */
819static inline int ipa_add_flt_rule(struct ipa_ioc_add_flt_rule *rules)
820{
821 return -EPERM;
822}
823
Talel Atias8a6ec102012-11-21 20:22:29 +0200824static inline int ipa_del_flt_rule(struct ipa_ioc_del_flt_rule *hdls)
825{
826 return -EPERM;
827}
828
Talel Atias8a6ec102012-11-21 20:22:29 +0200829static inline int ipa_commit_flt(enum ipa_ip_type ip)
830{
831 return -EPERM;
832}
833
Talel Atias8a6ec102012-11-21 20:22:29 +0200834static inline int ipa_reset_flt(enum ipa_ip_type ip)
835{
836 return -EPERM;
837}
838
Talel Atias8a6ec102012-11-21 20:22:29 +0200839/*
840 * NAT
841 */
842static inline int allocate_nat_device(struct ipa_ioc_nat_alloc_mem *mem)
843{
844 return -EPERM;
845}
846
847
848static inline int ipa_nat_init_cmd(struct ipa_ioc_v4_nat_init *init)
849{
850 return -EPERM;
851}
852
853
854static inline int ipa_nat_dma_cmd(struct ipa_ioc_nat_dma_cmd *dma)
855{
856 return -EPERM;
857}
858
859
860static inline int ipa_nat_del_cmd(struct ipa_ioc_v4_nat_del *del)
861{
862 return -EPERM;
863}
864
Talel Atias9bc53892013-02-10 15:10:07 +0200865/*
866 * Messaging
867 */
868static inline int ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
869 ipa_msg_free_fn callback)
870{
871 return -EPERM;
872}
873
874static inline int ipa_register_pull_msg(struct ipa_msg_meta *meta,
875 ipa_msg_pull_fn callback)
876{
877 return -EPERM;
878}
879
880static inline int ipa_deregister_pull_msg(struct ipa_msg_meta *meta)
881{
882 return -EPERM;
883}
884
885/*
886 * Interface
887 */
888static inline int ipa_register_intf(const char *name,
889 const struct ipa_tx_intf *tx,
890 const struct ipa_rx_intf *rx)
891{
892 return -EPERM;
893}
894
895static inline int ipa_deregister_intf(const char *name)
896{
897 return -EPERM;
898}
Talel Atias8a6ec102012-11-21 20:22:29 +0200899
900/*
901 * Aggregation
902 */
903static inline int ipa_set_aggr_mode(enum ipa_aggr_mode mode)
904{
905 return -EPERM;
906}
907
Talel Atias8a6ec102012-11-21 20:22:29 +0200908static inline int ipa_set_qcncm_ndp_sig(char sig[3])
909{
910 return -EPERM;
911}
912
Talel Atias8a6ec102012-11-21 20:22:29 +0200913static inline int ipa_set_single_ndp_per_mbim(bool enable)
914{
915 return -EPERM;
916}
917
Talel Atias8a6ec102012-11-21 20:22:29 +0200918/*
919 * rmnet bridge
920 */
921static inline int rmnet_bridge_init(void)
922{
923 return -EPERM;
924}
925
Talel Atias8a6ec102012-11-21 20:22:29 +0200926static inline int rmnet_bridge_disconnect(void)
927{
928 return -EPERM;
929}
930
Talel Atias8a6ec102012-11-21 20:22:29 +0200931static inline int rmnet_bridge_connect(u32 producer_hdl,
932 u32 consumer_hdl,
933 int wwan_logical_channel_id)
934{
935 return -EPERM;
936}
937
Talel Atias9bc53892013-02-10 15:10:07 +0200938/*
939 * SW bridge (between IPA and A2)
940 */
941static inline int ipa_bridge_setup(enum ipa_bridge_dir dir,
942 enum ipa_bridge_type type,
943 struct ipa_sys_connect_params *sys_in,
944 u32 *clnt_hdl)
945{
946 return -EPERM;
947}
948
949static inline int ipa_bridge_teardown(enum ipa_bridge_dir dir,
950 enum ipa_bridge_type type,
951 u32 clnt_hdl)
952{
953 return -EPERM;
954}
Talel Atias8a6ec102012-11-21 20:22:29 +0200955
956/*
957 * Data path
958 */
959static inline int ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
960 struct ipa_tx_meta *metadata)
961{
962 return -EPERM;
963}
964
Talel Atias8a6ec102012-11-21 20:22:29 +0200965/*
966 * System pipes
967 */
968static inline int ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in,
969 u32 *clnt_hdl)
970{
971 return -EPERM;
972}
973
Talel Atias8a6ec102012-11-21 20:22:29 +0200974static inline int ipa_teardown_sys_pipe(u32 clnt_hdl)
975{
976 return -EPERM;
977}
978
Vladislav Mordohoviche7970c62013-02-26 19:25:33 +0200979/*
980 * Resource manager
981 */
982static inline int ipa_rm_create_resource(
983 struct ipa_rm_create_params *create_params)
984{
985 return -EPERM;
986}
987
988static inline int ipa_rm_register(enum ipa_rm_resource_name resource_name,
989 struct ipa_rm_register_params *reg_params)
990{
991 return -EPERM;
992}
993
994static inline int ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
995 struct ipa_rm_register_params *reg_params)
996{
997 return -EPERM;
998}
999
1000static inline int ipa_rm_add_dependency(
1001 enum ipa_rm_resource_name resource_name,
1002 enum ipa_rm_resource_name depends_on_name)
1003{
1004 return -EPERM;
1005}
1006
1007static inline int ipa_rm_delete_dependency(
1008 enum ipa_rm_resource_name resource_name,
1009 enum ipa_rm_resource_name depends_on_name)
1010{
1011 return -EPERM;
1012}
1013
1014static inline int ipa_rm_request_resource(
1015 enum ipa_rm_resource_name resource_name)
1016{
1017 return -EPERM;
1018}
1019
1020static inline int ipa_rm_release_resource(
1021 enum ipa_rm_resource_name resource_name)
1022{
1023 return -EPERM;
1024}
1025
1026static inline int ipa_rm_notify_completion(enum ipa_rm_event event,
1027 enum ipa_rm_resource_name resource_name)
1028{
1029 return -EPERM;
1030}
1031
1032static inline int ipa_rm_inactivity_timer_init(
1033 enum ipa_rm_resource_name resource_name,
1034 unsigned long msecs)
1035{
1036 return -EPERM;
1037}
1038
1039static inline int ipa_rm_inactivity_timer_destroy(
1040 enum ipa_rm_resource_name resource_name)
1041{
1042 return -EPERM;
1043}
1044
1045static inline int ipa_rm_inactivity_timer_request_resource(
1046 enum ipa_rm_resource_name resource_name)
1047{
1048 return -EPERM;
1049}
1050
1051static inline int ipa_rm_inactivity_timer_release_resource(
1052 enum ipa_rm_resource_name resource_name)
1053{
1054 return -EPERM;
1055}
1056
Talel Atias8a6ec102012-11-21 20:22:29 +02001057#endif /* CONFIG_IPA*/
1058
Talel Atias8390f262012-11-15 16:33:18 +02001059#endif /* _IPA_H_ */