|
@@ -1,32 +1,33 @@
|
|
-From d0a0e1030005834b99225feb64ec3794d31beab0 Mon Sep 17 00:00:00 2001
|
|
|
|
|
|
+From 90aa570a894a907d11f85ced43a248198e24acc1 Mon Sep 17 00:00:00 2001
|
|
From: Peter Oh <[email protected]>
|
|
From: Peter Oh <[email protected]>
|
|
-Date: Thu, 12 Apr 2018 02:49:07 -0700
|
|
|
|
-Subject: [PATCH 10/15] mesh: consider mesh interface on dfs event handler
|
|
|
|
|
|
+Date: Tue, 17 Apr 2018 21:55:07 -0700
|
|
|
|
+Subject: [PATCH 10/16] mesh: consider mesh interface on dfs event handler
|
|
|
|
|
|
Once mesh starts supporting DFS channels, it has to handle DFS related events
|
|
Once mesh starts supporting DFS channels, it has to handle DFS related events
|
|
from drivers, hence add mesh interface to the check list.
|
|
from drivers, hence add mesh interface to the check list.
|
|
|
|
|
|
Signed-off-by: Peter Oh <[email protected]>
|
|
Signed-off-by: Peter Oh <[email protected]>
|
|
---
|
|
---
|
|
- wpa_supplicant/ap.c | 55 ++++++++++++++++++++++++++++++++---------
|
|
|
|
|
|
+ wpa_supplicant/ap.c | 71 ++++++++++++++++++++++++++++++-----------
|
|
wpa_supplicant/events.c | 1 +
|
|
wpa_supplicant/events.c | 1 +
|
|
- 2 files changed, 44 insertions(+), 12 deletions(-)
|
|
|
|
|
|
+ 2 files changed, 54 insertions(+), 18 deletions(-)
|
|
|
|
|
|
--- a/wpa_supplicant/ap.c
|
|
--- a/wpa_supplicant/ap.c
|
|
+++ b/wpa_supplicant/ap.c
|
|
+++ b/wpa_supplicant/ap.c
|
|
-@@ -1328,13 +1328,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_
|
|
|
|
|
|
+@@ -1337,13 +1337,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_
|
|
void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
|
|
void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht,
|
|
int offset, int width, int cf1, int cf2)
|
|
int offset, int width, int cf1, int cf2)
|
|
{
|
|
{
|
|
-+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
|
|
-+
|
|
|
|
- if (!wpa_s->ap_iface)
|
|
|
|
|
|
+- if (!wpa_s->ap_iface)
|
|
- return;
|
|
- return;
|
|
|
|
++ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
|
|
+
|
|
|
|
++ if (!wpa_s->ap_iface) {
|
|
+ if (!wpa_s->ifmsh)
|
|
+ if (!wpa_s->ifmsh)
|
|
+ return;
|
|
+ return;
|
|
+ else
|
|
+ else
|
|
+ iface = wpa_s->ifmsh;
|
|
+ iface = wpa_s->ifmsh;
|
|
-
|
|
|
|
|
|
++ }
|
|
wpa_s->assoc_freq = freq;
|
|
wpa_s->assoc_freq = freq;
|
|
if (wpa_s->current_ssid)
|
|
if (wpa_s->current_ssid)
|
|
wpa_s->current_ssid->frequency = freq;
|
|
wpa_s->current_ssid->frequency = freq;
|
|
@@ -35,91 +36,100 @@ Signed-off-by: Peter Oh <[email protected]>
|
|
offset, width, cf1, cf2);
|
|
offset, width, cf1, cf2);
|
|
}
|
|
}
|
|
|
|
|
|
-@@ -1531,10 +1536,15 @@ int wpas_ap_pmksa_cache_add_external(str
|
|
|
|
|
|
+@@ -1540,10 +1545,16 @@ int wpas_ap_pmksa_cache_add_external(str
|
|
void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
|
|
void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s,
|
|
struct dfs_event *radar)
|
|
struct dfs_event *radar)
|
|
{
|
|
{
|
|
|
|
+- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
+- return;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+
|
|
+
|
|
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
-- return;
|
|
|
|
|
|
++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ return;
|
|
+ return;
|
|
+ else
|
|
+ else
|
|
+ iface = wpa_s->ifmsh;
|
|
+ iface = wpa_s->ifmsh;
|
|
|
|
++ }
|
|
wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq);
|
|
wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq);
|
|
- hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq,
|
|
- hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq,
|
|
+ hostapd_dfs_radar_detected(iface, radar->freq,
|
|
+ hostapd_dfs_radar_detected(iface, radar->freq,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->chan_width,
|
|
radar->chan_width,
|
|
radar->cf1, radar->cf2);
|
|
radar->cf1, radar->cf2);
|
|
-@@ -1544,10 +1554,15 @@ void wpas_event_dfs_radar_detected(struc
|
|
|
|
|
|
+@@ -1553,10 +1564,16 @@ void wpas_event_dfs_radar_detected(struc
|
|
void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
|
|
void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s,
|
|
struct dfs_event *radar)
|
|
struct dfs_event *radar)
|
|
{
|
|
{
|
|
|
|
+- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
+- return;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+
|
|
+
|
|
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
-- return;
|
|
|
|
|
|
++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ return;
|
|
+ return;
|
|
+ else
|
|
+ else
|
|
+ iface = wpa_s->ifmsh;
|
|
+ iface = wpa_s->ifmsh;
|
|
|
|
++ }
|
|
wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq);
|
|
wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq);
|
|
- hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq,
|
|
- hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq,
|
|
+ hostapd_dfs_start_cac(iface, radar->freq,
|
|
+ hostapd_dfs_start_cac(iface, radar->freq,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->chan_width, radar->cf1, radar->cf2);
|
|
radar->chan_width, radar->cf1, radar->cf2);
|
|
}
|
|
}
|
|
-@@ -1556,10 +1571,16 @@ void wpas_event_dfs_cac_started(struct w
|
|
|
|
|
|
+@@ -1565,10 +1582,16 @@ void wpas_event_dfs_cac_started(struct w
|
|
void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
|
|
void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s,
|
|
struct dfs_event *radar)
|
|
struct dfs_event *radar)
|
|
{
|
|
{
|
|
|
|
+- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
+- return;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+
|
|
+
|
|
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
-- return;
|
|
|
|
|
|
++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ return;
|
|
+ return;
|
|
+ else
|
|
+ else
|
|
+ iface = wpa_s->ifmsh;
|
|
+ iface = wpa_s->ifmsh;
|
|
-+
|
|
|
|
|
|
++ }
|
|
wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
|
|
wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq);
|
|
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq,
|
|
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq,
|
|
+ hostapd_dfs_complete_cac(iface, 1, radar->freq,
|
|
+ hostapd_dfs_complete_cac(iface, 1, radar->freq,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->chan_width, radar->cf1, radar->cf2);
|
|
radar->chan_width, radar->cf1, radar->cf2);
|
|
}
|
|
}
|
|
-@@ -1568,10 +1589,15 @@ void wpas_event_dfs_cac_finished(struct
|
|
|
|
|
|
+@@ -1577,10 +1600,16 @@ void wpas_event_dfs_cac_finished(struct
|
|
void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
|
|
void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s,
|
|
struct dfs_event *radar)
|
|
struct dfs_event *radar)
|
|
{
|
|
{
|
|
|
|
+- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
+- return;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+
|
|
+
|
|
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
-- return;
|
|
|
|
|
|
++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ return;
|
|
+ return;
|
|
+ else
|
|
+ else
|
|
+ iface = wpa_s->ifmsh;
|
|
+ iface = wpa_s->ifmsh;
|
|
|
|
++ }
|
|
wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
|
|
wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq);
|
|
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq,
|
|
- hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq,
|
|
+ hostapd_dfs_complete_cac(iface, 0, radar->freq,
|
|
+ hostapd_dfs_complete_cac(iface, 0, radar->freq,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->ht_enabled, radar->chan_offset,
|
|
radar->chan_width, radar->cf1, radar->cf2);
|
|
radar->chan_width, radar->cf1, radar->cf2);
|
|
}
|
|
}
|
|
-@@ -1580,10 +1606,15 @@ void wpas_event_dfs_cac_aborted(struct w
|
|
|
|
|
|
+@@ -1589,10 +1618,16 @@ void wpas_event_dfs_cac_aborted(struct w
|
|
void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
|
|
void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s,
|
|
struct dfs_event *radar)
|
|
struct dfs_event *radar)
|
|
{
|
|
{
|
|
|
|
+- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
+- return;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+ struct hostapd_iface *iface = wpa_s->ap_iface;
|
|
+
|
|
+
|
|
- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0])
|
|
|
|
-- return;
|
|
|
|
|
|
++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) {
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0])
|
|
+ return;
|
|
+ return;
|
|
+ else
|
|
+ else
|
|
+ iface = wpa_s->ifmsh;
|
|
+ iface = wpa_s->ifmsh;
|
|
|
|
++ }
|
|
wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq);
|
|
wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq);
|
|
- hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq,
|
|
- hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq,
|
|
+ hostapd_dfs_nop_finished(iface, radar->freq,
|
|
+ hostapd_dfs_nop_finished(iface, radar->freq,
|
|
@@ -128,8 +138,8 @@ Signed-off-by: Peter Oh <[email protected]>
|
|
}
|
|
}
|
|
--- a/wpa_supplicant/events.c
|
|
--- a/wpa_supplicant/events.c
|
|
+++ b/wpa_supplicant/events.c
|
|
+++ b/wpa_supplicant/events.c
|
|
-@@ -4168,6 +4168,7 @@ void wpa_supplicant_event(void *ctx, enu
|
|
|
|
-
|
|
|
|
|
|
+@@ -4203,6 +4203,7 @@ void wpa_supplicant_event(void *ctx, enu
|
|
|
|
+ #ifdef CONFIG_AP
|
|
if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
|
|
if (wpa_s->current_ssid->mode == WPAS_MODE_AP ||
|
|
wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||
|
|
wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO ||
|
|
+ wpa_s->current_ssid->mode == WPAS_MODE_MESH ||
|
|
+ wpa_s->current_ssid->mode == WPAS_MODE_MESH ||
|