  	/* NB: mark interface down */
  	bsd_ctrl_iface(drv, 0);
 diff -urN wpa_supplicant-0.7.3/src/drivers/driver_haiku_events.cpp wpa_supplicant-0.7.3-haiku/src/drivers/driver_haiku_events.cpp
---- wpa_supplicant-0.7.3/src/drivers/driver_haiku_events.cpp	1970-01-01 00:00:00.000000000 +0000
-+++ wpa_supplicant-0.7.3-haiku/src/drivers/driver_haiku_events.cpp	2011-09-27 16:54:15.247726080 +0000
+--- wpa_supplicant-0.7.3/src/drivers/driver_haiku_events.cpp	1970-01-01 01:00:00.000000000 +0100
++++ wpa_supplicant-0.7.3-haiku/src/drivers/driver_haiku_events.cpp	2011-09-27 18:54:15.247726080 +0200
 @@ -0,0 +1,103 @@
 +/*
 + * WPA Supplicant - Haiku event handling routines

 wpa_supplicant.exe: wpa_supplicant
 	mv -f $< $@
 wpa_cli.exe: wpa_cli
@@ -1346,13 +1371,13 @@
 	$(STRIP) $(WINALL)
 
 wpa_gui/Makefile:

+}
+
+
+static const uint32 kMsgJoinTimeout = 'jnto';
+
+
+typedef	bool (*StateChangeCallback)(const wpa_supplicant *interface,
+	BMessage *message, void *data);
+
+
+class StateChangeWatchingEntry {
+public:
+								StateChangeWatchingEntry(
+									const wpa_supplicant *interface,
+									StateChangeCallback callback,
+									void *data);
+
+		bool					Match(const wpa_supplicant *interface,
+									StateChangeCallback callback,
+									void *data);
+
+		bool					MessageReceived(
+									const wpa_supplicant *interface,
+									BMessage *message);
+
+private:
+		const wpa_supplicant *	fInterface;
+		StateChangeCallback		fCallback;
+		void *					fData;
+};
+
+
+StateChangeWatchingEntry::StateChangeWatchingEntry(
+	const wpa_supplicant *interface, StateChangeCallback callback, void *data)
+	:
+	fInterface(interface),
+	fCallback(callback),
+	fData(data)
+{
+}
+
+
+bool
+StateChangeWatchingEntry::Match(const wpa_supplicant *interface,
+	StateChangeCallback callback, void *data)
+{
+	return fInterface == interface && fCallback == callback && fData == data;
+}
+
+
+bool
+StateChangeWatchingEntry::MessageReceived(const wpa_supplicant *interface,
+	BMessage *message)
+{
+	if (interface != fInterface)
+		return false;
+
+	return fCallback(interface, message, fData);
+}
+
+
+class WPASupplicantApp : public BApplication {
+public:
+								WPASupplicantApp();
