1 /*
2 * Copyright (c) 2011, 2014-2019 The Linux Foundation. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 /**
20 * @file ol_tx_send.h
21 * @brief API definitions for the tx sendriptor module within the data SW.
22 */
23 #ifndef _OL_TX_SEND__H_
24 #define _OL_TX_SEND__H_
25
26 #include <qdf_nbuf.h> /* qdf_nbuf_t */
27 #include <cdp_txrx_cmn.h> /* ol_txrx_vdev_t, etc. */
28
29 #if defined(CONFIG_HL_SUPPORT)
30
ol_tx_discard_target_frms(ol_txrx_pdev_handle pdev)31 static inline void ol_tx_discard_target_frms(ol_txrx_pdev_handle pdev)
32 {
33 }
34 #else
35
36 /**
37 * @flush the ol tx when surprise remove.
38 *
39 */
40 void ol_tx_discard_target_frms(ol_txrx_pdev_handle pdev);
41 #endif
42
43 /**
44 * @brief Send a tx frame to the target.
45 * @details
46 *
47 * @param pdev - the phy dev
48 * @param vdev - the virtual device sending the data
49 * (for specifying the transmitter address for multicast / broadcast data)
50 * @param netbuf - the tx frame
51 */
52 void
53 ol_tx_send(struct ol_txrx_pdev_t *pdev,
54 struct ol_tx_desc_t *tx_desc, qdf_nbuf_t msdu, uint8_t vdev_id);
55
56 /**
57 * @brief Send a tx batch download to the target.
58 * @details
59 * This function is different from above in that
60 * it accepts a list of msdu's to be downloaded as a batch
61 *
62 * @param pdev - the phy dev
63 * @param msdu_list - the Head pointer to the Tx Batch
64 * @param num_msdus - Total msdus chained in msdu_list
65 */
66
67 void
68 ol_tx_send_batch(struct ol_txrx_pdev_t *pdev,
69 qdf_nbuf_t msdu_list, int num_msdus);
70
71 /**
72 * @brief Send a tx frame with a non-std header or payload type to the target.
73 * @details
74 *
75 * @param pdev - the phy dev
76 * @param vdev - the virtual device sending the data
77 * (for specifying the transmitter address for multicast / broadcast data)
78 * @param netbuf - the tx frame
79 * @param pkt_type - what kind of non-std frame is being sent
80 */
81 void
82 ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev,
83 struct ol_tx_desc_t *tx_desc,
84 qdf_nbuf_t msdu, enum htt_pkt_type pkt_type);
85
86 #ifdef QCA_COMPUTE_TX_DELAY
87 /**
88 * ol_tx_set_compute_interval() - update compute interval period for TSM stats
89 * @soc_hdl: Datapath soc handle
90 * @pdev_id: id of data path pdev handle
91 * @interval: interval for stats computation
92 *
93 * Return: NONE
94 */
95 void ol_tx_set_compute_interval(struct cdp_soc_t *soc_hdl,
96 uint8_t pdev_id, uint32_t interval);
97
98 /**
99 * ol_tx_packet_count() - Return the uplink (transmitted) packet counts
100 * @soc_hdl: Datapath soc handle
101 * @pdev_id: id of data path pdev handle
102 * @out_packet_count: number of packets transmitted
103 * @out_packet_loss_count: number of packets lost
104 * @category: access category of interest
105 *
106 * This function will be called for getting uplink packet count and
107 * loss count for given stream (access category) a regular interval.
108 * This also resets the counters hence, the value returned is packets
109 * counted in last 5(default) second interval. These counter are
110 * incremented per access category in ol_tx_completion_handler()
111 *
112 * Return: NONE
113 */
114 void
115 ol_tx_packet_count(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
116 uint16_t *out_packet_count,
117 uint16_t *out_packet_loss_count, int category);
118
119 /**
120 * ol_tx_delay() - get tx packet delay
121 * @soc_hdl: Datapath soc handle
122 * @pdev_id: id of data path pdev handle
123 * @queue_delay_microsec: tx packet delay within queue, usec
124 * @tx_delay_microsec: tx packet delay, usec
125 * @category: packet category
126 *
127 * Return: NONE
128 */
129 void
130 ol_tx_delay(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
131 uint32_t *queue_delay_microsec,
132 uint32_t *tx_delay_microsec, int category);
133
134 /**
135 * ol_tx_delay_hist() - get tx packet delay histogram
136 * @soc_hdl: Datapath soc handle
137 * @pdev_id: id of data path pdev handle
138 * @report_bin_values: bin
139 * @category: packet category
140 *
141 * Return: NONE
142 */
143 void
144 ol_tx_delay_hist(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
145 uint16_t *report_bin_values, int category);
146 #endif /* QCA_COMPUTE_TX_DELAY */
147
148 /**
149 * ol_txrx_flow_control_cb() - call osif flow control callback
150 * @soc_hdl: Datapath soc handle
151 * @vdev_id: id of vdev
152 * @tx_resume: tx resume flag
153 *
154 * Return: none
155 */
156 void ol_txrx_flow_control_cb(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
157 bool tx_resume);
158
159 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || (defined(CONFIG_HL_SUPPORT) && \
160 defined(QCA_HL_NETDEV_FLOW_CONTROL))
161 void ol_tx_flow_ct_unpause_os_q(ol_txrx_pdev_handle pdev);
162 #else
ol_tx_flow_ct_unpause_os_q(ol_txrx_pdev_handle pdev)163 static inline void ol_tx_flow_ct_unpause_os_q(ol_txrx_pdev_handle pdev)
164 {
165 }
166 #endif
167 #endif /* _OL_TX_SEND__H_ */
168