Files
android_kernel_xiaomi_sm8450/include/linux/ecm_ipa.h
Ghanim Fodi 92bb3a5b57 msm: ipa: Adapt IPA driver to several DLKMs
Arrange driver to be separated into several DLKMs
per functinalities. Adapt the Makefiles,
add needed EXPORT_SYMBOLS(), and replace #ifdef X
to #if IS_ENABLED(X) to capture module state.

Change-Id: I5cc0a7c43358e3caa099cb3e9968b0837753972c
Signed-off-by: Ghanim Fodi <gfodi@codeaurora.org>
2019-11-19 14:04:29 +02:00

89 lines
2.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
*/
#ifndef _ECM_IPA_H_
#define _ECM_IPA_H_
#include <linux/ipa.h>
/*
* @priv: private data given upon ipa_connect
* @evt: event enum, should be IPA_WRITE_DONE
* @data: for tx path the data field is the sent socket buffer.
*/
typedef void (*ecm_ipa_callback)(void *priv,
enum ipa_dp_evt_type evt,
unsigned long data);
/*
* struct ecm_ipa_params - parameters for ecm_ipa initialization API
*
* @device_ready_notify: callback supplied by USB core driver.
* This callback shall be called by the Netdev once the device
* is ready to receive data from tethered PC.
* @ecm_ipa_rx_dp_notify: ecm_ipa will set this callback (out parameter).
* this callback shall be supplied for ipa_connect upon pipe
* connection (USB->IPA), once IPA driver receive data packets
* from USB pipe destined for Apps this callback will be called.
* @ecm_ipa_tx_dp_notify: ecm_ipa will set this callback (out parameter).
* this callback shall be supplied for ipa_connect upon pipe
* connection (IPA->USB), once IPA driver send packets destined
* for USB, IPA BAM will notify for Tx-complete.
* @priv: ecm_ipa will set this pointer (out parameter).
* This pointer will hold the network device for later interaction
* with ecm_ipa APIs
* @host_ethaddr: host Ethernet address in network order
* @device_ethaddr: device Ethernet address in network order
* @skip_ep_cfg: boolean field that determines if Apps-processor
* should or should not configure this end-point.
*/
struct ecm_ipa_params {
void (*device_ready_notify)(void);
ecm_ipa_callback ecm_ipa_rx_dp_notify;
ecm_ipa_callback ecm_ipa_tx_dp_notify;
u8 host_ethaddr[ETH_ALEN];
u8 device_ethaddr[ETH_ALEN];
void *private;
bool skip_ep_cfg;
};
#if IS_ENABLED(CONFIG_ECM_IPA)
int ecm_ipa_init(struct ecm_ipa_params *params);
int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl,
void *priv);
int ecm_ipa_disconnect(void *priv);
void ecm_ipa_cleanup(void *priv);
#else /* IS_ENABLED(CONFIG_ECM_IPA) */
static inline int ecm_ipa_init(struct ecm_ipa_params *params)
{
return 0;
}
static inline int ecm_ipa_connect(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl,
void *priv)
{
return 0;
}
static inline int ecm_ipa_disconnect(void *priv)
{
return 0;
}
static inline void ecm_ipa_cleanup(void *priv)
{
}
#endif /* IS_ENABLED(CONFIG_ECM_IPA) */
#endif /* _ECM_IPA_H_ */