xref: /wlan-driver/qcacld-3.0/core/dp/txrx/ol_ctrl_txrx_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2011-2017, 2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * @file ol_ctrl_txrx_api.h
22  * @brief Define the host control API functions called by the host data SW.
23  */
24 #ifndef _OL_CTRL_TXRX_API__H_
25 #define _OL_CTRL_TXRX_API__H_
26 
27 #include <osdep.h>              /* uint8_t */
28 #include <qdf_nbuf.h>           /* qdf_nbuf_t */
29 
30 #include <cdp_txrx_cmn.h>           /* ol_txrx_pdev_handle */
31 #include <ol_txrx_types.h>
32 #include <cds_ieee80211_common.h>   /* ieee80211_frame */
33 #include <cdp_txrx_handle.h>
34 #ifdef SUPPORT_HOST_STATISTICS
35 /** * @brief Update tx statistics
36  * @details
37  *  Update tx statistics after tx complete.
38  *
39  * @param pdev - ol_pdev_handle instance
40  * @param vdev_id - ID of the virtual device that tx frame
41  * @param had_error - whether there is error when tx
42  */
43 void ol_tx_statistics(struct cdp_cfg *cfg_pdev,
44 		     uint16_t vdev_id, int had_error);
45 #else
46 #define ol_tx_statistics(pdev, vdev_id, had_error)
47 #endif
48 
49 /** * @brief Count on received packets for invalid peer case
50  *
51  * @param pdev - txrx pdev handle
52  * @param wh - received frame
53  * @param err_type - what kind of error occurred
54  */
55 void ol_rx_err_inv_peer_statistics(struct cdp_cfg *cfg_pdev,
56 				   struct ieee80211_frame *wh,
57 				   enum ol_rx_err_type err_type);
58 
59 /**
60  * @brief Count on received packets, both success and failed
61  *
62  * @param pdev - ol_pdev_handle handle
63  * @param vdev_id - ID of the virtual device received the erroneous rx frame
64  * @param err_type - what kind of error occurred
65  * @param sec_type - The cipher type the peer is using
66  * @param is_mcast - whether this is one multi cast frame
67  */
68 void ol_rx_err_statistics(struct cdp_cfg *cfg_pdev,
69 			  uint8_t vdev_id,
70 			  enum ol_rx_err_type err_type,
71 			  enum ol_sec_type sec_type, int is_mcast);
72 
73 /**
74  * @brief Provide notification of failure during host rx processing
75  * @details
76  *  Indicate an error during host rx data processing, including what
77  *  kind of error happened, when it happened, which peer and TID the
78  *  erroneous rx frame is from, and what the erroneous rx frame itself
79  *  is.
80  *
81  * @param pdev - handle to the ctrl SW's physical device object
82  * @param vdev_id - ID of the virtual device received the erroneous rx frame
83  * @param peer_mac_addr - MAC address of the peer that sent the erroneous
84  *      rx frame
85  * @param tid - which TID within the peer sent the erroneous rx frame
86  * @param tsf32  - the timstamp in TSF units of the erroneous rx frame, or
87  *      one of the fragments that when reassembled, constitute the rx frame
88  * @param err_type - what kind of error occurred
89  * @param rx_frame - the rx frame that had an error
90  * @pn - Packet sequence number
91  * @key_id - Key index octet received in IV of the frame
92  */
93 void
94 ol_rx_err(struct cdp_cfg *cfg_pdev,
95 	  uint8_t vdev_id,
96 	  uint8_t *peer_mac_addr,
97 	  int tid,
98 	  uint32_t tsf32,
99 	  enum ol_rx_err_type err_type,
100 	  qdf_nbuf_t rx_frame, uint64_t *pn, uint8_t key_id);
101 
102 #ifdef HL_RX_AGGREGATION_HOLE_DETECTION
103 /**
104  * ol_rx_aggregation_hole - ol rx aggregation hole report
105  * @hole_info: hole_info
106  *
107  * Return: void
108  */
109 void ol_rx_aggregation_hole(uint32_t hole_info);
110 #endif
111 
112 enum ol_rx_notify_type {
113 	OL_RX_NOTIFY_IPV4_IGMP,
114 };
115 
116 /**
117  * @brief Provide notification of reception of data of special interest.
118  * @details
119  *  Indicate when "special" data has been received.  The nature of the
120  *  data that results in it being considered special is specified in the
121  *  notify_type argument.
122  *  This function is currently used by the data-path SW to notify the
123  *  control path SW when the following types of rx data are received:
124  *    + IPv4 IGMP frames
125  *      The control SW can use these to learn about multicast group
126  *      membership, if it so chooses.
127  *
128  * @param pdev - handle to the ctrl SW's physical device object
129  * @param vdev_id - ID of the virtual device received the special data
130  * @param peer_mac_addr - MAC address of the peer that sent the special data
131  * @param tid - which TID within the peer sent the special data
132  * @param tsf32  - the timstamp in TSF units of the special data
133  * @param notify_type - what kind of special data was received
134  * @param rx_frame - the rx frame containing the special data
135  */
136 void
137 ol_rx_notify(struct cdp_cfg *cfg_pdev,
138 	     uint8_t vdev_id,
139 	     uint8_t *peer_mac_addr,
140 	     int tid,
141 	     uint32_t tsf32,
142 	     enum ol_rx_notify_type notify_type, qdf_nbuf_t rx_frame);
143 
144 #define ol_ctrl_rx_addba_complete(pdev, peer_mac_addr, tid, failed) /* no-op */
145 
146 #endif /* _OL_CTRL_TXRX_API__H_ */
147