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