[haiku-commits] r39387 - haiku/trunk/src/libs/compat/freebsd_wlan/net80211

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 10 Nov 2010 22:28:07 +0100 (CET)

Author: axeld
Date: 2010-11-10 22:28:07 +0100 (Wed, 10 Nov 2010)
New Revision: 39387
Changeset: http://dev.haiku-os.org/changeset/39387

Modified:
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.cpp
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h
Log:
* Added xauth authentication module needed for WPA.
* Forwarded a few more ioctls to the driver.
* Enabled debugging mode for now.


Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile   2010-11-10 
19:02:00 UTC (rev 39386)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile   2010-11-10 
21:28:07 UTC (rev 39387)
@@ -11,9 +11,9 @@
 Includes [ FGristFiles kernel_c++_structs.h ]
        : <src!system!kernel>kernel_c++_struct_sizes.h ;
 
-SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ]
+SubDirCcFlags [ FDefines _KERNEL=1 FBSD_DRIVER=1 IEEE80211_DEBUG=1 ]
        -Wno-format -Wno-unused -Wno-uninitialized ;
-SubDirC++Flags [ FDefines _KERNEL=1 FBSD_DRIVER=1 ]
+SubDirC++Flags [ FDefines _KERNEL=1 FBSD_DRIVER=1 IEEE80211_DEBUG=1 ]
        -Wno-format -Wno-unused -Wno-uninitialized ;
 
 SEARCH_SOURCE += [ FDirName $(SUBDIR) .. crypto rijndael ] ;
@@ -59,5 +59,5 @@
        # NOT SUPPORTED YET ieee80211_rssadapt.c
        # NOT SUPPORTED YET ieee80211_superg.c
        # NOT SUPPORTED YET ieee80211_tdma.c
-       # NOT SUPPORTED YET ieee80211_xauth.c
+       ieee80211_xauth.c
 ;

Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.cpp
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.cpp       
2010-11-10 19:02:00 UTC (rev 39386)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.cpp       
2010-11-10 21:28:07 UTC (rev 39387)
@@ -38,17 +38,17 @@
 #include "ieee80211_haiku.h"
 
 extern "C" {
-#include <sys/kernel.h>
-#include <sys/mbuf.h>
-#include <sys/bus.h>
-#include <sys/sockio.h>
+#      include <sys/kernel.h>
+#      include <sys/mbuf.h>
+#      include <sys/bus.h>
+#      include <sys/sockio.h>
 
-#include <net/if.h>
-#include <net/if_media.h>
-#include <net/if_types.h>
-#include <net/if_var.h>
+#      include <net/if.h>
+#      include <net/if_media.h>
+#      include <net/if_types.h>
+#      include <net/if_var.h>
 
-#include "ieee80211_var.h"
+#      include "ieee80211_var.h"
 };
 
 #include <SupportDefs.h>
@@ -62,6 +62,14 @@
 #include <shared.h>
 
 
+#define TRACE_WLAN
+#ifdef TRACE_WLAN
+#      define TRACE(x, ...) dprintf(x, __VA_ARGS__);
+#else
+#      define TRACE(x, ...) ;
+#endif
+
+
 #define        MC_ALIGN(m, len)                                                
                        \
 do {                                                                           
                                \
        (m)->m_data += (MCLBYTES - (len)) &~ (sizeof(long) - 1);\
@@ -336,6 +344,7 @@
                        if (user_memcpy(&request, arg, sizeof(struct 
ieee80211req)) != B_OK)
                                return B_BAD_ADDRESS;
 
+                       TRACE("wlan_control: %ld, %d\n", op, request.i_type);
                        status_t status = ifp->if_ioctl(ifp, op, 
(caddr_t)&request);
                        if (status != B_OK)
                                return status;
@@ -345,6 +354,13 @@
                                return B_BAD_ADDRESS;
                        return B_OK;
                }
+
+               case SIOCSIFFLAGS:
+               case SIOCSIFMEDIA:
+               case SIOCGIFMEDIA:
+               case SIOCSIFMTU:
+                       // Requests that make it here always come from the 
kernel
+                       return ifp->if_ioctl(ifp, op, (caddr_t)arg);
        }
 
        return B_BAD_VALUE;
@@ -530,8 +546,7 @@
                | IEEE80211_MSG_DOTH
                | IEEE80211_MSG_INACT
                | IEEE80211_MSG_ROAM
-               | IEEE80211_MSG_RATECTL
-               ;
+               | IEEE80211_MSG_RATECTL;
 }
 
 
@@ -555,7 +570,7 @@
 void
 ieee80211_load_module(const char* modname)
 {
-       dprintf("%s not implemented, yet.\n", __func__);
+       dprintf("%s not implemented, yet: modname %s\n", __func__, modname);
 }
 
 
@@ -568,6 +583,8 @@
        if (ni == vap->iv_bss)
                if_link_state_change(ifp, LINK_STATE_UP);
 
+       TRACE("%s\n", __FUNCTION__);
+
        if (sNotificationModule != NULL) {
                char messageBuffer[512];
                KMessage message;
@@ -590,6 +607,8 @@
        if (ni == vap->iv_bss)
                if_link_state_change(ifp, LINK_STATE_DOWN);
 
+       TRACE("%s\n", __FUNCTION__);
+
        if (sNotificationModule != NULL) {
                char messageBuffer[512];
                KMessage message;
@@ -609,6 +628,8 @@
        release_sem_etc(vap->iv_ifp->scan_done_sem, 1,
                B_DO_NOT_RESCHEDULE | B_RELEASE_ALL);
 
+       TRACE("%s\n", __FUNCTION__);
+
        if (sNotificationModule != NULL) {
                char messageBuffer[512];
                KMessage message;
@@ -701,10 +722,12 @@
 void
 ieee80211_sysctl_attach(struct ieee80211com* ic)
 {
+       dprintf("%s not implemented, yet.\n", __func__);
 }
 
 
 void
 ieee80211_sysctl_detach(struct ieee80211com* ic)
 {
+       dprintf("%s not implemented, yet.\n", __func__);
 }

Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h 
2010-11-10 19:02:00 UTC (rev 39386)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h 
2010-11-10 21:28:07 UTC (rev 39387)
@@ -284,6 +284,23 @@
 SET_DECLARE(policy##_set, policy##_setup);
 
 /*
+ * Authenticator modules handle 802.1x/WPA authentication.
+ */
+#define        IEEE80211_AUTH_MODULE(name, version)                            
\
+       _IEEE80211_POLICY_MODULE(auth, name, version)
+
+#define        IEEE80211_AUTH_ALG(name, alg, v)                                
\
+static void                                                            \
+name##_modevent(int type)                                              \
+{                                                                      \
+       if (type == MOD_LOAD)                                           \
+               ieee80211_authenticator_register(alg, &v);              \
+       else                                                            \
+               ieee80211_authenticator_unregister(alg);                \
+}                                                                      \
+TEXT_SET(auth_set, name##_modevent)
+
+/*
  * Scanner modules provide scanning policy.
  */
 #define        IEEE80211_SCANNER_MODULE(name, version)


Other related posts:

  • » [haiku-commits] r39387 - haiku/trunk/src/libs/compat/freebsd_wlan/net80211 - axeld