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

Author: colin
Date: 2009-12-29 03:35:59 +0100 (Tue, 29 Dec 2009)
New Revision: 34795
Changeset: http://dev.haiku-os.org/changeset/34795/haiku

Modified:
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.c
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.h
   haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h
Log:
Adding crypto support for wep to the wlan stack.


Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile   2009-12-29 
02:34:47 UTC (rev 34794)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/Jamfile   2009-12-29 
02:35:59 UTC (rev 34795)
@@ -22,8 +22,9 @@
        ieee80211_adhoc.c
        ieee80211_ageq.c
        ieee80211_amrr.c
+       ieee80211_crypto.c
        ieee80211_crypto_none.c
-       ieee80211_crypto.c
+       ieee80211_crypto_wep.c
        ieee80211_dfs.c
        ieee80211_haiku.c
        ieee80211_ht.c
@@ -46,7 +47,6 @@
        # NOT SUPPORTED YET ieee80211_acl.c
        # NOT SUPPORTED YET ieee80211_crypto_ccmp.c
        # NOT SUPPORTED YET ieee80211_crypto_tkip.c
-       # NOT SUPPORTED YET ieee80211_crypto_wep.c
        # NOT SUPPORTED YET ieee80211_ddb.c
        # NOT SUPPORTED YET ieee80211_hwmp.c
        # NOT SUPPORTED YET ieee80211_mesh.c

Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.c
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.c        
2009-12-29 02:34:47 UTC (rev 34794)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.c        
2009-12-29 02:35:59 UTC (rev 34795)
@@ -35,7 +35,7 @@
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
-#include <sys/mbuf.h>   
+#include <sys/mbuf.h>
 
 #include <sys/socket.h>
 
@@ -109,7 +109,7 @@
        return key->wk_cipher->ic_attach(vap, key);
 }
 
-/* 
+/*
  * Wrappers for driver key management methods.
  */
 static __inline int
@@ -141,6 +141,9 @@
 {
        /* NB: we assume everything is pre-zero'd */
        ciphers[IEEE80211_CIPHER_NONE] = &ieee80211_cipher_none;
+#if defined(__HAIKU__)
+       ieee80211_crypto_wep_load();
+#endif
 }
 
 /*
@@ -149,6 +152,9 @@
 void
 ieee80211_crypto_detach(struct ieee80211com *ic)
 {
+#if defined(__HAIKU__)
+       ieee80211_crypto_wep_unload();
+#endif
 }
 
 /*

Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.h
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.h        
2009-12-29 02:34:47 UTC (rev 34794)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_crypto.h        
2009-12-29 02:35:59 UTC (rev 34795)
@@ -159,6 +159,11 @@
 void   ieee80211_crypto_delglobalkeys(struct ieee80211vap *);
 void   ieee80211_crypto_reload_keys(struct ieee80211com *);
 
+#if defined (__HAIKU__)
+void ieee80211_crypto_wep_load(void);
+void ieee80211_crypto_wep_unload(void);
+#endif
+
 /*
  * Template for a supported cipher.  Ciphers register with the
  * crypto code and are typically loaded as separate modules
@@ -216,7 +221,7 @@
        return (cip->ic_miclen > 0 ? cip->ic_enmic(k, m, force) : 1);
 }
 
-/* 
+/*
  * Reset key state to an unused state.  The crypto
  * key allocation mechanism insures other state (e.g.
  * key data) is properly setup before a key is used.

Modified: haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h 
2009-12-29 02:34:47 UTC (rev 34794)
+++ haiku/trunk/src/libs/compat/freebsd_wlan/net80211/ieee80211_haiku.h 
2009-12-29 02:35:59 UTC (rev 34795)
@@ -33,6 +33,21 @@
 #include <sys/sysctl.h>
 #include <sys/taskqueue.h>
 
+
+#define IEEE80211_CRYPTO_MODULE(name, version) \
+       void \
+       ieee80211_crypto_##name##_load() { \
+               ieee80211_crypto_register(&name); \
+       } \
+\
+\
+       void \
+       ieee80211_crypto_##name##_unload() \
+       { \
+               ieee80211_crypto_unregister(&name); \
+       }
+
+
 /*
  * Common state locking definitions.
  */


Other related posts: