hostapd: update to git snapshot of 2018-04-09
[openwrt/staging/wigyori.git] / package / network / services / hostapd / patches / 0110-mesh-consider-mesh-interface-on-dfs-event-handler.patch
1 From d0a0e1030005834b99225feb64ec3794d31beab0 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Thu, 12 Apr 2018 02:49:07 -0700
4 Subject: [PATCH 10/15] mesh: consider mesh interface on dfs event handler
5
6 Once mesh starts supporting DFS channels, it has to handle DFS related events
7 from drivers, hence add mesh interface to the check list.
8
9 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
10 ---
11 wpa_supplicant/ap.c | 55 ++++++++++++++++++++++++++++++++---------
12 wpa_supplicant/events.c | 1 +
13 2 files changed, 44 insertions(+), 12 deletions(-)
14
15 --- a/wpa_supplicant/ap.c
16 +++ b/wpa_supplicant/ap.c
17 @@ -1328,13 +1328,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_
18 void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
19 int offset, int width, int cf1, int cf2)
20 {
21 + struct hostapd_iface *iface = wpa_s->ap_iface;
22 +
23 if (!wpa_s->ap_iface)
24 - return;
25 + if (!wpa_s->ifmsh)
26 + return;
27 + else
28 + iface = wpa_s->ifmsh;
29
30 wpa_s->assoc_freq = freq;
31 if (wpa_s->current_ssid)
32 wpa_s->current_ssid->frequency = freq;
33 - hostapd_event_ch_switch(wpa_s->ap_iface->bss[0], freq, ht,
34 + hostapd_event_ch_switch(iface->bss[0], freq, ht,
35 offset, width, cf1, cf2);
36 }
37
38 @@ -1531,10 +1536,15 @@ int wpas_ap_pmksa_cache_add_external(str
39 void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
40 struct dfs_event *radar)
41 {
42 + struct hostapd_iface *iface = wpa_s->ap_iface;
43 +
44 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
45 - return;
46 + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
47 + return;
48 + else
49 + iface = wpa_s->ifmsh;
50 wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq);
51 - hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq,
52 + hostapd_dfs_radar_detected(iface, radar->freq,
53 radar->ht_enabled, radar->chan_offset,
54 radar->chan_width,
55 radar->cf1, radar->cf2);
56 @@ -1544,10 +1554,15 @@ void wpas_event_dfs_radar_detected(struc
57 void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
58 struct dfs_event *radar)
59 {
60 + struct hostapd_iface *iface = wpa_s->ap_iface;
61 +
62 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
63 - return;
64 + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
65 + return;
66 + else
67 + iface = wpa_s->ifmsh;
68 wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq);
69 - hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq,
70 + hostapd_dfs_start_cac(iface, radar->freq,
71 radar->ht_enabled, radar->chan_offset,
72 radar->chan_width, radar->cf1, radar->cf2);
73 }
74 @@ -1556,10 +1571,16 @@ void wpas_event_dfs_cac_started(struct w
75 void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
76 struct dfs_event *radar)
77 {
78 + struct hostapd_iface *iface = wpa_s->ap_iface;
79 +
80 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
81 - return;
82 + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
83 + return;
84 + else
85 + iface = wpa_s->ifmsh;
86 +
87 wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
88 - hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq,
89 + hostapd_dfs_complete_cac(iface, 1, radar->freq,
90 radar->ht_enabled, radar->chan_offset,
91 radar->chan_width, radar->cf1, radar->cf2);
92 }
93 @@ -1568,10 +1589,15 @@ void wpas_event_dfs_cac_finished(struct
94 void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
95 struct dfs_event *radar)
96 {
97 + struct hostapd_iface *iface = wpa_s->ap_iface;
98 +
99 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
100 - return;
101 + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
102 + return;
103 + else
104 + iface = wpa_s->ifmsh;
105 wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
106 - hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq,
107 + hostapd_dfs_complete_cac(iface, 0, radar->freq,
108 radar->ht_enabled, radar->chan_offset,
109 radar->chan_width, radar->cf1, radar->cf2);
110 }
111 @@ -1580,10 +1606,15 @@ void wpas_event_dfs_cac_aborted(struct w
112 void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
113 struct dfs_event *radar)
114 {
115 + struct hostapd_iface *iface = wpa_s->ap_iface;
116 +
117 if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
118 - return;
119 + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
120 + return;
121 + else
122 + iface = wpa_s->ifmsh;
123 wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq);
124 - hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq,
125 + hostapd_dfs_nop_finished(iface, radar->freq,
126 radar->ht_enabled, radar->chan_offset,
127 radar->chan_width, radar->cf1, radar->cf2);
128 }
129 --- a/wpa_supplicant/events.c
130 +++ b/wpa_supplicant/events.c
131 @@ -4168,6 +4168,7 @@ void wpa_supplicant_event(void *ctx, enu
132
133 if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
134 wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||
135 + wpa_s->current_ssid->mode == WPAS_MODE_MESH ||
136 wpa_s->current_ssid->mode ==
137 WPAS_MODE_P2P_GROUP_FORMATION) {
138 wpas_ap_ch_switch(wpa_s, data->ch_switch.freq,