blob: 67f2478f40f844c46b2b371946d2ba33d9b90d90 [file] [log] [blame]
Dhanashri Atre9c222b12016-03-22 13:26:13 -07001/*
2 * Copyright (c) 2016 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27 /**
28 * @file cdp_txrx_ipa.h
29 * @brief Define the host data path IP Acceleraor API functions
30 */
31#ifndef _CDP_TXRX_IPA_H_
32#define _CDP_TXRX_IPA_H_
33
Dhanashri Atre9c222b12016-03-22 13:26:13 -070034
35/**
36 * ol_txrx_ipa_resources - Resources needed for IPA
37 */
38struct ol_txrx_ipa_resources {
39 qdf_dma_addr_t ce_sr_base_paddr;
40 uint32_t ce_sr_ring_size;
41 qdf_dma_addr_t ce_reg_paddr;
42
43 qdf_dma_addr_t tx_comp_ring_base_paddr;
44 uint32_t tx_comp_ring_size;
45 uint32_t tx_num_alloc_buffer;
46
47 qdf_dma_addr_t rx_rdy_ring_base_paddr;
48 uint32_t rx_rdy_ring_size;
49 qdf_dma_addr_t rx_proc_done_idx_paddr;
50 void *rx_proc_done_idx_vaddr;
51
52 qdf_dma_addr_t rx2_rdy_ring_base_paddr;
53 uint32_t rx2_rdy_ring_size;
54 qdf_dma_addr_t rx2_proc_done_idx_paddr;
55 void *rx2_proc_done_idx_vaddr;
56};
57
Yuanyuan Liu4e3feeb2016-04-20 10:41:15 -070058#ifdef IPA_OFFLOAD
59
Dhanashri Atre9c222b12016-03-22 13:26:13 -070060void
61ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev,
62 struct ol_txrx_ipa_resources *ipa_res);
63
64void
65ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev,
66 qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
67 qdf_dma_addr_t ipa_rx_uc_doorbell_paddr);
68
69void
70ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev,
71 bool uc_active, bool is_tx);
72
73void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg);
74
75void ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
76 void (*ipa_uc_op_cb_type)(uint8_t *op_msg,
77 void *osif_ctxt),
78 void *osif_dev);
79
80void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev);
81
82qdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev, qdf_nbuf_t skb);
83#else
84
85static inline void
86ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev,
87 struct ol_txrx_ipa_resources *ipa_res)
88{
89 return;
90}
91
92static inline void
93ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev,
94 qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
95 qdf_dma_addr_t ipa_rx_uc_doorbell_paddr)
96{
97 return;
98}
99
100static inline void
101ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev,
102 bool uc_active, bool is_tx)
103{
104 return;
105}
106
107static inline void
108ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg)
109{
110 return;
111}
112
113static inline void
114ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
115 void (*ipa_uc_op_cb_type)(uint8_t *op_msg,
116 void *osif_ctxt),
117 void *osif_dev)
118{
119 return;
120}
121
122static inline void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev)
123{
124 return;
125}
126#endif /* IPA_OFFLOAD */
127
128#endif /* _CDP_TXRX_IPA_H_ */
129