1 /* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
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.
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.
13 #ifndef _IPA_ODO_BRIDGE_H_
14 #define _IPA_ODO_BRIDGE_H_
16 #include <linux/ipa.h>
19 * struct odu_bridge_params - parameters for odu bridge initialization API
21 * @netdev_name: network interface name
22 * @priv: private data that will be supplied to client's callback
23 * @tx_dp_notify: callback for handling SKB. the following event are supported:
24 * IPA_WRITE_DONE: will be called after client called to odu_bridge_tx_dp()
25 * Client is expected to free the skb.
26 * IPA_RECEIVE: will be called for delivering skb to APPS.
27 * Client is expected to deliver the skb to network stack.
28 * @send_dl_skb: callback for sending skb on downlink direction to adapter.
29 * Client is expected to free the skb.
30 * @device_ethaddr: device Ethernet address in network order.
31 * @ipa_desc_size: IPA Sys Pipe Desc Size
33 struct odu_bridge_params {
34 const char *netdev_name;
36 ipa_notify_cb tx_dp_notify;
37 int (*send_dl_skb)(void *priv, struct sk_buff *skb);
38 u8 device_ethaddr[ETH_ALEN];
42 #if defined CONFIG_IPA || defined CONFIG_IPA3
44 int odu_bridge_init(struct odu_bridge_params *params);
46 int odu_bridge_connect(void);
48 int odu_bridge_disconnect(void);
50 int odu_bridge_tx_dp(struct sk_buff *skb, struct ipa_tx_meta *metadata);
52 int odu_bridge_cleanup(void);
56 static inline int odu_bridge_init(struct odu_bridge_params *params)
61 static inline int odu_bridge_disconnect(void)
66 static inline int odu_bridge_connect(void)
71 static inline int odu_bridge_tx_dp(struct sk_buff *skb,
72 struct ipa_tx_meta *metadata)
77 static inline int odu_bridge_cleanup(void)
82 #endif /* CONFIG_IPA || defined CONFIG_IPA3 */
84 #endif /* _IPA_ODO_BRIDGE_H */