]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Dispatch more WPS events through hostapd ctrl_iface
authorAnish Nataraj <anishn@qca.qualcomm.com>
Thu, 4 Aug 2011 13:56:41 +0000 (16:56 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 4 Aug 2011 13:56:41 +0000 (16:56 +0300)
src/ap/wps_hostapd.c
src/wps/wps_common.c
src/wps/wps_i.h
src/wps/wps_registrar.c

index 5d910b1db2a57ee59e2e81e6710c4146f7e308e3..fdef1fd40d80eeb52b36c5218969ab12ab115dbe 100644 (file)
@@ -566,30 +566,40 @@ static void hostapd_wps_event_cb(void *ctx, enum wps_event event,
 
        switch (event) {
        case WPS_EV_M2D:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_M2D);
                break;
        case WPS_EV_FAIL:
                hostapd_wps_event_fail(hapd, &data->fail);
                break;
        case WPS_EV_SUCCESS:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_SUCCESS);
                break;
        case WPS_EV_PWD_AUTH_FAIL:
                hostapd_pwd_auth_fail(hapd, &data->pwd_auth_fail);
                break;
        case WPS_EV_PBC_OVERLAP:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_OVERLAP);
                break;
        case WPS_EV_PBC_TIMEOUT:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_TIMEOUT);
                break;
        case WPS_EV_ER_AP_ADD:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_AP_ADD);
                break;
        case WPS_EV_ER_AP_REMOVE:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_AP_REMOVE);
                break;
        case WPS_EV_ER_ENROLLEE_ADD:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_ENROLLEE_ADD);
                break;
        case WPS_EV_ER_ENROLLEE_REMOVE:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_ENROLLEE_REMOVE);
                break;
        case WPS_EV_ER_AP_SETTINGS:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_AP_SETTINGS);
                break;
        case WPS_EV_ER_SET_SELECTED_REGISTRAR:
+               wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_ER_SET_SEL_REG);
                break;
        }
        if (hapd->wps_event_cb)
@@ -1242,6 +1252,7 @@ static void hostapd_wps_ap_pin_timeout(void *eloop_data, void *user_ctx)
        struct hostapd_data *hapd = eloop_data;
        wpa_printf(MSG_DEBUG, "WPS: AP PIN timed out");
        hostapd_wps_ap_pin_disable(hapd);
+       wpa_msg(hapd->msg_ctx, MSG_INFO, WPS_EVENT_AP_PIN_DISABLED);
 }
 
 
index 5d0508cf13ab8079411370ad9ab9a826bac10f9b..780d5f3c5f76f59a5a97d34e13ec3d29e9ff77f3 100644 (file)
@@ -313,6 +313,15 @@ void wps_pbc_timeout_event(struct wps_context *wps)
 }
 
 
+void wps_registrar_sel_registrar_changed_event(struct wps_context *wps)
+{
+       if (wps->event_cb == NULL)
+               return;
+
+       wps->event_cb(wps->cb_ctx, WPS_EV_ER_SET_SELECTED_REGISTRAR, NULL);
+}
+
+
 #ifdef CONFIG_WPS_OOB
 
 static struct wpabuf * wps_get_oob_cred(struct wps_context *wps)
index bdb6da2bfa832079836d3008e0c761d2d710e5d4..a147da12e2ca63b1e50c80f4df037813e2d3c0ff 100644 (file)
@@ -228,6 +228,7 @@ void wps_success_event(struct wps_context *wps);
 void wps_pwd_auth_fail_event(struct wps_context *wps, int enrollee, int part);
 void wps_pbc_overlap_event(struct wps_context *wps);
 void wps_pbc_timeout_event(struct wps_context *wps);
+void wps_registrar_sel_registrar_changed_event(struct wps_context *wps);
 
 extern struct oob_device_data oob_ufd_device_data;
 extern struct oob_device_data oob_nfc_device_data;
index 65ff40dd610d15d3e724165fac82199c5314b2d2..2d7f6324053cfc4b2fa1c141e8bf76a582fcc354 100644 (file)
@@ -3085,6 +3085,7 @@ static void wps_registrar_set_selected_timeout(void *eloop_ctx,
                   "unselect internal Registrar");
        reg->selected_registrar = 0;
        reg->pbc = 0;
+       wps_registrar_sel_registrar_changed_event(reg->wps);
        wps_registrar_selected_registrar_changed(reg);
 }