 +}
 +
 +
++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();

+			message->SendReply(&reply);
+		}
+
+		delete message;
+	}
+
+	queue.Unlock();

 	u32 s0, s1, s2, s3, t0, t1, t2, t3;
 	const int Nr = 10;
diff -urN wpa_supplicant-0.7.3/src/drivers/driver_bsd.c wpa_supplicant-0.7.3-haiku/src/drivers/driver_bsd.c
--- wpa_supplicant-0.7.3/src/drivers/driver_bsd.c	2010-09-07 17:43:39.009699328 +0200
+++ wpa_supplicant-0.7.3-haiku/src/drivers/driver_bsd.c	2011-09-27 18:32:01.953679872 +0200
@@ -48,9 +48,28 @@
 #if __NetBSD__
 #include <net80211/ieee80211_netbsd.h>
