daff60a8ad62f2a08d0dc4b2eeaa03362b3ce649
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 461-Move-definition-of-WLAN_SUPP_RATES_MAX-to-defs.h.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Eneas U de Queiroz <cotequeiroz@gmail.com>
3 Date: Mon, 12 Feb 2024 14:18:24 -0300
4 Subject: [PATCH] Move definition of WLAN_SUPP_RATES_MAX to defs.h
5
6 Patch 460-wpa_supplicant-add-new-config-params-to-be-used-with.patch
7 ("wpa_supplicant: add new config params to be used with the ibss join
8 command") adds the definition of unsigned char
9 rates[WLAN_SUPP_RATES_MAX] to driver.h, which needs to have
10 WLAN_SUPP_RATES_MAX defined. So it includes sta_info.h to get the
11 definition.
12
13 Commit c74739250a ("AP MLD: Use a helper function to check if a STA is a
14 non-AP MLD") makes sta_info.h include driver.h before
15 it defines WLAN_SUPP_RATES_MAX, causing an error:
16
17 src/drivers/driver.h:969:29: error: 'WLAN_SUPP_RATES_MAX' undeclared here (not in a function)
18
19 Move the definition of WLAN_SUPP_RATES_MAX to defs.h to ensure it gets
20 defined before other headers are included. The inclusion of sta_info.h
21 in driver.h can be reverted as well.
22
23 Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
24 ---
25 src/ap/sta_info.h | 4 ----
26 src/common/defs.h | 4 ++++
27 src/drivers/driver.h | 1 -
28 wpa_supplicant/config_ssid.h | 1 -
29 4 files changed, 4 insertions(+), 6 deletions(-)
30
31 --- a/src/ap/sta_info.h
32 +++ b/src/ap/sta_info.h
33 @@ -49,10 +49,6 @@
34 #define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
35 #define WLAN_STA_NONERP BIT(31)
36
37 -/* Maximum number of supported rates (from both Supported Rates and Extended
38 - * Supported Rates IEs). */
39 -#define WLAN_SUPP_RATES_MAX 32
40 -
41 struct hostapd_data;
42
43 struct mbo_non_pref_chan_info {
44 --- a/src/common/defs.h
45 +++ b/src/common/defs.h
46 @@ -63,6 +63,10 @@
47 WPA_KEY_MGMT_FT_FILS_SHA256 | \
48 WPA_KEY_MGMT_FT_FILS_SHA384)
49
50 +/* Maximum number of supported rates (from both Supported Rates and Extended
51 + * Supported Rates IEs). */
52 +#define WLAN_SUPP_RATES_MAX 32
53 +
54 static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
55 {
56 return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
57 --- a/src/drivers/driver.h
58 +++ b/src/drivers/driver.h
59 @@ -19,7 +19,6 @@
60
61 #define WPA_SUPPLICANT_DRIVER_VERSION 4
62
63 -#include "ap/sta_info.h"
64 #include "common/defs.h"
65 #include "common/ieee802_11_defs.h"
66 #include "common/wpa_common.h"
67 --- a/wpa_supplicant/config_ssid.h
68 +++ b/wpa_supplicant/config_ssid.h
69 @@ -10,7 +10,6 @@
70 #define CONFIG_SSID_H
71
72 #include "common/defs.h"
73 -#include "ap/sta_info.h"
74 #include "utils/list.h"
75 #include "eap_peer/eap_config.h"
76 #include "drivers/nl80211_copy.h"