[haiku-commits] r34306 - in haiku/trunk/src/libs/compat/freebsd_network: . compat compat/sys

  • From: coling@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 27 Nov 2009 13:13:10 +0100 (CET)

Author: colin
Date: 2009-11-27 13:13:10 +0100 (Fri, 27 Nov 2009)
New Revision: 34306
Changeset: http://dev.haiku-os.org/changeset/34306/haiku

Removed:
   haiku/trunk/src/libs/compat/freebsd_network/compat/net80211/
Modified:
   haiku/trunk/src/libs/compat/freebsd_network/compat/sys/haiku-module.h
   haiku/trunk/src/libs/compat/freebsd_network/if.c
Log:
Remove the wlan specific headers to allow a clearer distinction between
ethernet and wlan drivers when compiling them. Also this removes the burden to
recompile every ethernet driver just because of changes in the wlan part.


Modified: haiku/trunk/src/libs/compat/freebsd_network/compat/sys/haiku-module.h
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/compat/sys/haiku-module.h       
2009-11-27 11:52:18 UTC (rev 34305)
+++ haiku/trunk/src/libs/compat/freebsd_network/compat/sys/haiku-module.h       
2009-11-27 12:13:10 UTC (rev 34306)
@@ -60,6 +60,7 @@
 status_t stop_wlan(device_t);
 status_t wlan_control(void*, uint32, void*, size_t);
 status_t wlan_close(void*);
+status_t wlan_if_l2com_alloc(void*);
 
 /* we define the driver methods with HAIKU_FBSD_DRIVER_GLUE to
  * force the rest of the stuff to be linked back with the driver.
@@ -94,9 +95,11 @@
        status_t stop_wlan(device_t dev)                                        
                                \
                { return B_OK; }                                                
                                                \
        status_t wlan_control(void *cookie, uint32 op, void *arg,               
        \
-                       size_t length)                                          
                                                \
+               size_t length)                                                  
                                                \
                { return B_BAD_VALUE; }                                         
                                        \
        status_t wlan_close(void* cookie)                                       
                                \
+               { return B_OK; }                                                
                                                \
+       status_t wlan_if_l2com_alloc(void* ifp)                                 
                        \
                { return B_OK; }
 
 #define HAIKU_FBSD_WLAN_DRIVER_GLUE(publicname, name, busname)                 
\

Modified: haiku/trunk/src/libs/compat/freebsd_network/if.c
===================================================================
--- haiku/trunk/src/libs/compat/freebsd_network/if.c    2009-11-27 11:52:18 UTC 
(rev 34305)
+++ haiku/trunk/src/libs/compat/freebsd_network/if.c    2009-11-27 12:13:10 UTC 
(rev 34306)
@@ -16,6 +16,7 @@
 
 #include <compat/sys/bus.h>
 #include <compat/sys/kernel.h>
+#include <compat/sys/taskqueue.h>
 
 #include <compat/net/if.h>
 #include <compat/net/if_arp.h>
@@ -24,7 +25,6 @@
 #include <compat/sys/malloc.h>
 
 #include <compat/net/ethernet.h>
-#include <compat/net80211/ieee80211_var.h>
 
 
 /*
@@ -169,16 +169,15 @@
                case IFT_ETHER:
                {
                        ifp->if_l2com = _kernel_malloc(sizeof(struct arpcom), 
M_ZERO);
+                       if (ifp->if_l2com == NULL)
+                               goto err2;
                        IFP2AC(ifp)->ac_ifp = ifp;
                        break;
                }
                case IFT_IEEE80211:
                {
-                       ifp->if_l2com = _kernel_malloc(sizeof(struct 
ieee80211com), M_ZERO);
-                       ((struct ieee80211com *)(ifp->if_l2com))->ic_ifp = ifp;
-                       if (ifp->if_l2com == NULL)
+                       if (wlan_if_l2com_alloc(ifp) != B_OK)
                                goto err2;
-
                        break;
                }
        }
@@ -228,7 +227,7 @@
 void
 if_free(struct ifnet *ifp)
 {
-       // IFT_IEEE80211 devices won't be in this list,
+       // IEEE80211 devices won't be in this list,
        // so don't try to remove them.
        if (ifp->if_type == IFT_ETHER)
                remove_from_device_name_list(ifp);


Other related posts:

  • » [haiku-commits] r34306 - in haiku/trunk/src/libs/compat/freebsd_network: . compat compat/sys - coling