xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_mesh_latency.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2020-2021 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 cdp_txrx_mesh_latency.h
21  * @brief Define the host data path MESH latency API functions
22  * called by the host control SW and the OS interface module
23  */
24 #ifndef _CDP_TXRX_MESH_LATENCY_H_
25 #define _CDP_TXRX_MESH_LATENCY_H_
26 #include "cdp_txrx_handle.h"
27 #ifdef WLAN_SUPPORT_MESH_LATENCY
28 /**
29  * @brief find MSCS enabled peer for this mac address and validate priority
30  * @details
31  *  This function updates per peer per TID mesh latency related parameters.
32  *
33  * @param dest_mac - destination mac address
34  * @param service_interval_dl - Service Interval per tid on DL
35  * @param burst_size_dl - Burst size per tid on DL
36  * @param service_interval_ul - Service Interval per tid on UL
37  * @param burst_size_ul - Burst size per tid on UL
38  * @param priority - user priority combination of tid and msdu queue
39  * @add_or_sub - indicates to add or subtract latency parameter
40  * @return - 0 for non error case, -1 for failure
41  */
42 static inline QDF_STATUS
43 cdp_mesh_latency_update_peer_parameter(ol_txrx_soc_handle soc,
44 	uint8_t *dest_mac, uint32_t service_interval_dl,
45 	uint32_t burst_size_dl, uint32_t service_interval_ul,
46 	uint32_t burst_size_ul,	uint16_t priority,
47 	uint8_t add_or_sub)
48 {
49 	if (!soc || !soc->ops || !soc->ops->mesh_latency_ops) {
50 		return 1;
51 	}
52 
53 	if (soc->ops->mesh_latency_ops->mesh_latency_update_peer_parameter)
54 		return soc->ops->mesh_latency_ops->
55 				mesh_latency_update_peer_parameter(soc,
56 						dest_mac, service_interval_dl,
57 						burst_size_dl, service_interval_ul,
58 						burst_size_ul, priority, add_or_sub);
59 	return 0;
60 }
61 #endif
62 #endif
63