xref: /freebsd/contrib/wpa/src/ap/airtime_policy.h (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1 /*
2  * Airtime policy configuration
3  * Copyright (c) 2018-2019, Toke Høiland-Jørgensen <toke@toke.dk>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef AIRTIME_POLICY_H
10 #define AIRTIME_POLICY_H
11 
12 struct hostapd_iface;
13 
14 #ifdef CONFIG_AIRTIME_POLICY
15 
16 #define AIRTIME_DEFAULT_UPDATE_INTERVAL 200 /* ms */
17 #define AIRTIME_BACKLOG_EXPIRY_FACTOR 2500 /* 2.5 intervals + convert to usec */
18 
19 /* scale quantum so this becomes the effective quantum after applying the max
20  * weight, but never go below min or above max */
21 #define AIRTIME_QUANTUM_MIN 8 /* usec */
22 #define AIRTIME_QUANTUM_MAX 256 /* usec */
23 #define AIRTIME_QUANTUM_TARGET 1024 /* usec */
24 
25 int airtime_policy_new_sta(struct hostapd_data *hapd, struct sta_info *sta);
26 int airtime_policy_update_init(struct hostapd_iface *iface);
27 void airtime_policy_update_deinit(struct hostapd_iface *iface);
28 
29 #else /* CONFIG_AIRTIME_POLICY */
30 
31 static inline int airtime_policy_new_sta(struct hostapd_data *hapd,
32 					 struct sta_info *sta)
33 {
34 	return -1;
35 }
36 
37 static inline int airtime_policy_update_init(struct hostapd_iface *iface)
38 {
39 	return -1;
40 }
41 
42 static inline void airtime_policy_update_deinit(struct hostapd_iface *iface)
43 {
44 }
45 
46 #endif /* CONFIG_AIRTIME_POLICY */
47 
48 #endif /* AIRTIME_POLICY_H */
49