23b8dffb57eebf21473dc3a84be9d3892ce6fa01
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 750-qos_map_set_without_interworking.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 4 Nov 2021 11:45:18 +0100
3 Subject: [PATCH] hostapd: support qos_map_set without CONFIG_INTERWORKING
4
5 This feature is useful on its own even without full interworking support
6
7 --- a/hostapd/config_file.c
8 +++ b/hostapd/config_file.c
9 @@ -1680,6 +1680,8 @@ static int parse_anqp_elem(struct hostap
10 return 0;
11 }
12
13 +#endif /* CONFIG_INTERWORKING */
14 +
15
16 static int parse_qos_map_set(struct hostapd_bss_config *bss,
17 char *buf, int line)
18 @@ -1721,8 +1723,6 @@ static int parse_qos_map_set(struct host
19 return 0;
20 }
21
22 -#endif /* CONFIG_INTERWORKING */
23 -
24
25 #ifdef CONFIG_HS20
26 static int hs20_parse_conn_capab(struct hostapd_bss_config *bss, char *buf,
27 @@ -4282,10 +4282,10 @@ static int hostapd_config_fill(struct ho
28 bss->gas_frag_limit = val;
29 } else if (os_strcmp(buf, "gas_comeback_delay") == 0) {
30 bss->gas_comeback_delay = atoi(pos);
31 +#endif /* CONFIG_INTERWORKING */
32 } else if (os_strcmp(buf, "qos_map_set") == 0) {
33 if (parse_qos_map_set(bss, pos, line) < 0)
34 return 1;
35 -#endif /* CONFIG_INTERWORKING */
36 #ifdef CONFIG_RADIUS_TEST
37 } else if (os_strcmp(buf, "dump_msk_file") == 0) {
38 os_free(bss->dump_msk_file);
39 --- a/src/ap/hostapd.c
40 +++ b/src/ap/hostapd.c
41 @@ -1578,6 +1578,7 @@ int hostapd_setup_bss(struct hostapd_dat
42 wpa_printf(MSG_ERROR, "GAS server initialization failed");
43 return -1;
44 }
45 +#endif /* CONFIG_INTERWORKING */
46
47 if (conf->qos_map_set_len &&
48 hostapd_drv_set_qos_map(hapd, conf->qos_map_set,
49 @@ -1585,7 +1586,6 @@ int hostapd_setup_bss(struct hostapd_dat
50 wpa_printf(MSG_ERROR, "Failed to initialize QoS Map");
51 return -1;
52 }
53 -#endif /* CONFIG_INTERWORKING */
54
55 if (conf->bss_load_update_period && bss_load_update_init(hapd)) {
56 wpa_printf(MSG_ERROR, "BSS Load initialization failed");
57 --- a/src/ap/ieee802_11_shared.c
58 +++ b/src/ap/ieee802_11_shared.c
59 @@ -1138,13 +1138,11 @@ u8 * hostapd_eid_rsnxe(struct hostapd_da
60 u16 check_ext_capab(struct hostapd_data *hapd, struct sta_info *sta,
61 const u8 *ext_capab_ie, size_t ext_capab_ie_len)
62 {
63 -#ifdef CONFIG_INTERWORKING
64 /* check for QoS Map support */
65 if (ext_capab_ie_len >= 5) {
66 if (ext_capab_ie[4] & 0x01)
67 sta->qos_map_enabled = 1;
68 }
69 -#endif /* CONFIG_INTERWORKING */
70
71 if (ext_capab_ie_len > 0) {
72 sta->ecsa_supported = !!(ext_capab_ie[0] & BIT(2));
73 --- a/wpa_supplicant/events.c
74 +++ b/wpa_supplicant/events.c
75 @@ -2935,8 +2935,6 @@ void wnm_bss_keep_alive_deinit(struct wp
76 }
77
78
79 -#ifdef CONFIG_INTERWORKING
80 -
81 static int wpas_qos_map_set(struct wpa_supplicant *wpa_s, const u8 *qos_map,
82 size_t len)
83 {
84 @@ -2969,8 +2967,6 @@ static void interworking_process_assoc_r
85 }
86 }
87
88 -#endif /* CONFIG_INTERWORKING */
89 -
90
91 static void wpa_supplicant_set_4addr_mode(struct wpa_supplicant *wpa_s)
92 {
93 @@ -3350,10 +3346,8 @@ static int wpa_supplicant_event_associnf
94 wnm_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
95 data->assoc_info.resp_ies_len);
96 #endif /* CONFIG_WNM */
97 -#ifdef CONFIG_INTERWORKING
98 interworking_process_assoc_resp(wpa_s, data->assoc_info.resp_ies,
99 data->assoc_info.resp_ies_len);
100 -#endif /* CONFIG_INTERWORKING */
101 if (wpa_s->hw_capab == CAPAB_VHT &&
102 get_ie(data->assoc_info.resp_ies,
103 data->assoc_info.resp_ies_len, WLAN_EID_VHT_CAP))