123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef __APR_TAL_H_
- #define __APR_TAL_H_
- #include <linux/kernel.h>
- #include <linux/kthread.h>
- #include <linux/uaccess.h>
- #define APR_CLIENT_AUDIO 0x0
- #define APR_CLIENT_VOICE 0x1
- #define APR_CLIENT_MAX 0x2
- #define APR_DL_SMD 0
- #define APR_DL_MAX 1
- #define APR_DEST_MODEM 0
- #define APR_DEST_QDSP6 1
- #define APR_DEST_MAX 2
- #if defined(CONFIG_MSM_QDSP6_APRV2_GLINK) || \
- defined(CONFIG_MSM_QDSP6_APRV3_GLINK)
- #define APR_MAX_BUF 512
- #else
- #define APR_MAX_BUF 8092
- #endif
- #define APR_DEFAULT_NUM_OF_INTENTS 20
- #define APR_OPEN_TIMEOUT_MS 5000
- enum {
-
- APR_PKT_OWNER_DRIVER,
-
- APR_PKT_OWNER_CLIENT,
- };
- struct apr_pkt_priv {
-
- uint8_t pkt_owner;
- };
- typedef void (*apr_svc_cb_fn)(void *buf, int len, void *priv);
- struct apr_svc_ch_dev *apr_tal_open(uint32_t svc, uint32_t dest,
- uint32_t dl, apr_svc_cb_fn func, void *priv);
- int apr_tal_write(struct apr_svc_ch_dev *apr_ch, void *data,
- struct apr_pkt_priv *pkt_priv, int len);
- int apr_tal_close(struct apr_svc_ch_dev *apr_ch);
- int apr_tal_rx_intents_config(struct apr_svc_ch_dev *apr_ch,
- int num_of_intents, uint32_t size);
- struct apr_svc_ch_dev {
- void *handle;
- spinlock_t w_lock;
- spinlock_t r_lock;
- struct mutex m_lock;
- apr_svc_cb_fn func;
- wait_queue_head_t wait;
- void *priv;
- unsigned int channel_state;
- bool if_remote_intent_ready;
- };
- #endif
|