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