1 /* Copyright (c) 2013-2015, 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.
16 #include <linux/ipa.h>
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.
23 typedef void (*ecm_ipa_callback)(void *priv,
24 enum ipa_dp_evt_type evt,
28 * struct ecm_ipa_params - parameters for ecm_ipa initialization API
30 * @device_ready_notify: callback supplied by USB core driver.
31 * This callback shall be called by the Netdev once the device
32 * is ready to recieve data from tethered PC.
33 * @ecm_ipa_rx_dp_notify: ecm_ipa will set this callback (out parameter).
34 * this callback shall be supplied for ipa_connect upon pipe
35 * connection (USB->IPA), once IPA driver receive data packets
36 * from USB pipe destined for Apps this callback will be called.
37 * @ecm_ipa_tx_dp_notify: ecm_ipa will set this callback (out parameter).
38 * this callback shall be supplied for ipa_connect upon pipe
39 * connection (IPA->USB), once IPA driver send packets destined
40 * for USB, IPA BAM will notify for Tx-complete.
41 * @priv: ecm_ipa will set this pointer (out parameter).
42 * This pointer will hold the network device for later interaction
44 * @host_ethaddr: host Ethernet address in network order
45 * @device_ethaddr: device Ethernet address in network order
46 * @skip_ep_cfg: boolean field that determines if Apps-processor
47 * should or should not configure this end-point.
49 struct ecm_ipa_params {
50 void (*device_ready_notify)(void);
51 ecm_ipa_callback ecm_ipa_rx_dp_notify;
52 ecm_ipa_callback ecm_ipa_tx_dp_notify;
53 u8 host_ethaddr[ETH_ALEN];
54 u8 device_ethaddr[ETH_ALEN];
62 int ecm_ipa_init(struct ecm_ipa_params *params);
64 int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl,
67 int ecm_ipa_disconnect(void *priv);
69 void ecm_ipa_cleanup(void *priv);
71 #else /* CONFIG_ECM_IPA*/
73 static inline int ecm_ipa_init(struct ecm_ipa_params *params)
78 static inline int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl,
84 static inline int ecm_ipa_disconnect(void *priv)
89 static inline void ecm_ipa_cleanup(void *priv)
93 #endif /* CONFIG_ECM_IPA*/
95 #endif /* _ECM_IPA_H_ */