Vladislav Mordohovich | bc5bd50 | 2013-02-27 14:27:10 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2013, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _ECM_IPA_H_ |
| 14 | #define _ECM_IPA_H_ |
| 15 | |
| 16 | #include <mach/ipa.h> |
| 17 | |
| 18 | /* |
| 19 | * @priv: private data given upon ipa_connect |
| 20 | * @evt: event enum, should be IPA_WRITE_DONE |
| 21 | * @data: for tx path the data field is the sent socket buffer. |
| 22 | */ |
| 23 | typedef void (*ecm_ipa_callback)(void *priv, |
| 24 | enum ipa_dp_evt_type evt, |
| 25 | unsigned long data); |
| 26 | |
| 27 | |
| 28 | #ifdef CONFIG_ECM_IPA |
| 29 | |
| 30 | int ecm_ipa_init(ecm_ipa_callback * ecm_ipa_rx_dp_notify, |
| 31 | ecm_ipa_callback * ecm_ipa_tx_dp_notify, |
| 32 | void **priv); |
| 33 | |
| 34 | int ecm_ipa_configure(u8 host_ethaddr[], u8 device_ethaddr[], |
| 35 | void *priv); |
| 36 | |
| 37 | int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, |
| 38 | void *priv); |
| 39 | |
| 40 | int ecm_ipa_disconnect(void *priv); |
| 41 | |
| 42 | void ecm_ipa_cleanup(void *priv); |
| 43 | |
| 44 | #else /* CONFIG_ECM_IPA*/ |
| 45 | |
| 46 | static inline int ecm_ipa_init(ecm_ipa_callback *ecm_ipa_rx_dp_notify, |
| 47 | ecm_ipa_callback *ecm_ipa_tx_dp_notify, |
| 48 | void **priv) |
| 49 | { |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | static inline int ecm_ipa_configure(u8 host_ethaddr[], u8 device_ethaddr[], |
| 54 | void *priv) |
| 55 | { |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | static inline int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, |
| 60 | void *priv) |
| 61 | { |
| 62 | return 0; |
| 63 | } |
| 64 | |
| 65 | static inline int ecm_ipa_disconnect(void *priv) |
| 66 | { |
| 67 | return 0; |
| 68 | } |
| 69 | |
| 70 | static inline void ecm_ipa_cleanup(void *priv) |
| 71 | { |
| 72 | |
| 73 | } |
| 74 | #endif /* CONFIG_ECM_IPA*/ |
| 75 | |
| 76 | #endif /* _ECM_IPA_H_ */ |