From: Jouni Malinen Date: Sun, 3 Nov 2013 13:59:53 +0000 (+0200) Subject: hostapd: Add ctrl_iface events for ACS X-Git-Tag: hostap_2_1~653 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=ae134e1d2b5e5257d999e0c3f146fa4a4d46a621;p=mech_eap.git hostapd: Add ctrl_iface events for ACS These give status information to external observers from automatic channel selection operations. Signed-hostap: Jouni Malinen --- diff --git a/src/ap/acs.c b/src/ap/acs.c index d7c921d..12b955c 100644 --- a/src/ap/acs.c +++ b/src/ap/acs.c @@ -13,6 +13,7 @@ #include "utils/common.h" #include "utils/list.h" #include "common/ieee802_11_defs.h" +#include "common/wpa_ctrl.h" #include "drivers/driver.h" #include "hostapd.h" #include "ap_drv_ops.h" @@ -794,5 +795,7 @@ enum hostapd_chan_status acs_init(struct hostapd_iface *iface) if (err < 0) return HOSTAPD_CHAN_INVALID; + wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, ACS_EVENT_STARTED); + return HOSTAPD_CHAN_ACS; } diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index d2831d4..908d91e 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -20,6 +20,7 @@ #include "utils/eloop.h" #include "common/ieee802_11_defs.h" #include "common/ieee802_11_common.h" +#include "common/wpa_ctrl.h" #include "drivers/driver.h" #include "hostapd.h" #include "ap_config.h" @@ -857,14 +858,21 @@ int hostapd_acs_completed(struct hostapd_iface *iface, int err) switch (hostapd_check_chans(iface)) { case HOSTAPD_CHAN_VALID: + wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, + ACS_EVENT_COMPLETED "freq=%d channel=%d", + hostapd_hw_get_freq(iface->bss[0], + iface->conf->channel), + iface->conf->channel); break; case HOSTAPD_CHAN_ACS: wpa_printf(MSG_ERROR, "ACS error - reported complete, but no result available"); + wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, ACS_EVENT_FAILED); hostapd_notify_bad_chans(iface); goto out; case HOSTAPD_CHAN_INVALID: default: wpa_printf(MSG_ERROR, "ACS picked unusable channels"); + wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, ACS_EVENT_FAILED); hostapd_notify_bad_chans(iface); goto out; } diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 127358d..67b7226 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -162,6 +162,10 @@ extern "C" { #define AP_REJECTED_MAX_STA "AP-REJECTED-MAX-STA " #define AP_REJECTED_BLOCKED_STA "AP-REJECTED-BLOCKED-STA " +#define ACS_EVENT_STARTED "ACS-STARTED " +#define ACS_EVENT_COMPLETED "ACS-COMPLETED " +#define ACS_EVENT_FAILED "ACS-FAILED " + #define DFS_EVENT_RADAR_DETECTED "DFS-RADAR-DETECTED " #define DFS_EVENT_NEW_CHANNEL "DFS-NEW-CHANNEL " #define DFS_EVENT_CAC_START "DFS-CAC-START "