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