Talel Atias | 20e8e64 | 2014-01-12 19:23:40 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
Vladislav Mordohovich | bc5bd50 | 2013-02-27 14:27:10 +0200 | [diff] [blame] | 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 | |
Talel Atias | 50bda0b | 2013-05-06 08:42:31 +0300 | [diff] [blame] | 27 | /* |
| 28 | * struct ecm_ipa_params - parameters for ecm_ipa initialization API |
| 29 | * |
| 30 | * @ecm_ipa_rx_dp_notify: ecm_ipa will set this callback (out parameter). |
| 31 | * this callback shall be supplied for ipa_connect upon pipe |
| 32 | * connection (USB->IPA), once IPA driver receive data packets |
| 33 | * from USB pipe destined for Apps this callback will be called. |
| 34 | * @ecm_ipa_tx_dp_notify: ecm_ipa will set this callback (out parameter). |
| 35 | * this callback shall be supplied for ipa_connect upon pipe |
| 36 | * connection (IPA->USB), once IPA driver send packets destined |
| 37 | * for USB, IPA BAM will notify for Tx-complete. |
| 38 | * @priv: ecm_ipa will set this pointer (out parameter). |
| 39 | * This pointer will hold the network device for later interaction |
| 40 | * with ecm_ipa APIs |
| 41 | * @host_ethaddr: host Ethernet address in network order |
| 42 | * @device_ethaddr: device Ethernet address in network order |
Talel Atias | 20e8e64 | 2014-01-12 19:23:40 +0200 | [diff] [blame] | 43 | * @skip_ep_cfg: boolean field that determines if Apps-processor |
| 44 | * should or should not configure this end-point. |
Talel Atias | 50bda0b | 2013-05-06 08:42:31 +0300 | [diff] [blame] | 45 | */ |
| 46 | struct ecm_ipa_params { |
| 47 | ecm_ipa_callback ecm_ipa_rx_dp_notify; |
| 48 | ecm_ipa_callback ecm_ipa_tx_dp_notify; |
| 49 | u8 host_ethaddr[ETH_ALEN]; |
| 50 | u8 device_ethaddr[ETH_ALEN]; |
| 51 | void *private; |
Talel Atias | 20e8e64 | 2014-01-12 19:23:40 +0200 | [diff] [blame] | 52 | bool skip_ep_cfg; |
Talel Atias | 50bda0b | 2013-05-06 08:42:31 +0300 | [diff] [blame] | 53 | }; |
| 54 | |
Vladislav Mordohovich | bc5bd50 | 2013-02-27 14:27:10 +0200 | [diff] [blame] | 55 | |
| 56 | #ifdef CONFIG_ECM_IPA |
| 57 | |
Talel Atias | 50bda0b | 2013-05-06 08:42:31 +0300 | [diff] [blame] | 58 | int ecm_ipa_init(struct ecm_ipa_params *params); |
Vladislav Mordohovich | bc5bd50 | 2013-02-27 14:27:10 +0200 | [diff] [blame] | 59 | |
| 60 | int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, |
| 61 | void *priv); |
| 62 | |
| 63 | int ecm_ipa_disconnect(void *priv); |
| 64 | |
| 65 | void ecm_ipa_cleanup(void *priv); |
| 66 | |
| 67 | #else /* CONFIG_ECM_IPA*/ |
| 68 | |
Talel Atias | 50bda0b | 2013-05-06 08:42:31 +0300 | [diff] [blame] | 69 | int ecm_ipa_init(struct ecm_ipa_params *params) |
Vladislav Mordohovich | bc5bd50 | 2013-02-27 14:27:10 +0200 | [diff] [blame] | 70 | { |
| 71 | return 0; |
| 72 | } |
| 73 | |
| 74 | static inline int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl, |
| 75 | void *priv) |
| 76 | { |
| 77 | return 0; |
| 78 | } |
| 79 | |
| 80 | static inline int ecm_ipa_disconnect(void *priv) |
| 81 | { |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | static inline void ecm_ipa_cleanup(void *priv) |
| 86 | { |
| 87 | |
| 88 | } |
| 89 | #endif /* CONFIG_ECM_IPA*/ |
| 90 | |
| 91 | #endif /* _ECM_IPA_H_ */ |