Replace hostapd_button_pushed() with generic driver event
authorJouni Malinen <j@w1.fi>
Sun, 13 Dec 2009 19:21:10 +0000 (21:21 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 13 Dec 2009 19:21:10 +0000 (21:21 +0200)
hostapd/drv_callbacks.c
src/drivers/driver.h
src/drivers/driver_atheros.c

index 29c1ee6..278b495 100644 (file)
@@ -463,6 +463,9 @@ void wpa_supplicant_event(void *ctx, wpa_event_type event,
                              data->ft_rrb_rx.data, data->ft_rrb_rx.data_len);
                break;
 #endif /* CONFIG_IEEE80211R */
+       case EVENT_WPS_BUTTON_PUSHED:
+               hostapd_wps_button_pushed(hapd);
+               break;
        default:
                wpa_printf(MSG_DEBUG, "Unknown event %d", event);
                break;
@@ -480,9 +483,3 @@ void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
                hapd->probereq_cb[i].cb(hapd->probereq_cb[i].ctx,
                                        sa, ie, ie_len);
 }
-
-
-void hostapd_button_pushed(struct hostapd_data *hapd)
-{
-       hostapd_wps_button_pushed(hapd);
-}
index 228ce6b..c07a45e 100644 (file)
@@ -1706,7 +1706,12 @@ typedef enum wpa_event_type {
        /**
         * EVENT_FT_RRB_RX - FT (IEEE 802.11r) RRB frame received
         */
-       EVENT_FT_RRB_RX
+       EVENT_FT_RRB_RX,
+
+       /**
+        * EVENT_WPS_BUTTON_PUSHED - Report hardware push button press for WPS
+        */
+       EVENT_WPS_BUTTON_PUSHED
 } wpa_event_type;
 
 
@@ -1973,6 +1978,5 @@ struct hostapd_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
                                          const u8 *addr);
 void hostapd_probe_req_rx(struct hostapd_data *hapd, const u8 *sa,
                          const u8 *ie, size_t ie_len);
-void hostapd_button_pushed(struct hostapd_data *hapd);
 
 #endif /* DRIVER_H */
index 8759b01..7f5f930 100644 (file)
@@ -847,7 +847,7 @@ madwifi_wireless_event_wireless_custom(struct madwifi_driver_data *drv,
                /* PROBLEM! this event is received for ALL BSSs ...
                 * so all are enabled for WPS... ugh.
                 */
-               hostapd_button_pushed(drv->hapd);
+               wpa_supplicant_event(drv->hapd, EVENT_WPS_BUTTON_PUSHED, NULL);
        } else if (strncmp(custom, "Manage.prob_req ", 16) == 0) {
                /*
                 * Atheros driver uses a hack to pass Probe Request frames as a