hostapd: add AFC support
[openwrt/staging/nbd.git] / package / network / services / hostapd / patches / 801-hostapd-export-hostapd_is_usable_chans-utility-routi.patch
1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Tue, 12 Mar 2024 11:03:55 +0100
3 Subject: [PATCH] hostapd: export hostapd_is_usable_chans utility routine
4
5 This is a preliminary patch to introduce AFC support.
6
7 Tested-by: Allen Ye <allen.ye@mediatek.com>
8 ---
9
10 --- a/src/ap/hw_features.c
11 +++ b/src/ap/hw_features.c
12 @@ -996,7 +996,7 @@ static bool hostapd_is_usable_punct_bitm
13 * 0 = not usable
14 * -1 = not currently usable due to 6 GHz NO-IR
15 */
16 -static int hostapd_is_usable_chans(struct hostapd_iface *iface)
17 +int hostapd_is_usable_chans(struct hostapd_iface *iface)
18 {
19 int secondary_freq;
20 struct hostapd_channel_data *pri_chan;
21 --- a/src/ap/hw_features.h
22 +++ b/src/ap/hw_features.h
23 @@ -30,6 +30,7 @@ void hostapd_stop_setup_timers(struct ho
24 int hostapd_hw_skip_mode(struct hostapd_iface *iface,
25 struct hostapd_hw_modes *mode);
26 int hostapd_determine_mode(struct hostapd_iface *iface);
27 +int hostapd_is_usable_chans(struct hostapd_iface *iface);
28 #else /* NEED_AP_MLME */
29 static inline void
30 hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
31 @@ -103,6 +104,11 @@ static inline int hostapd_determine_mode
32 return 0;
33 }
34
35 +static inline int hostapd_is_usable_chans(struct hostapd_iface *iface)
36 +{
37 + return 1;
38 +}
39 +
40 #endif /* NEED_AP_MLME */
41
42 #endif /* HW_FEATURES_H */