[haiku-commits] r34392 - haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100

  • From: coling@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 30 Nov 2009 22:20:34 +0100 (CET)

Author: colin
Date: 2009-11-30 22:20:34 +0100 (Mon, 30 Nov 2009)
New Revision: 34392
Changeset: http://dev.haiku-os.org/changeset/34392/haiku

Added:
   haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/glue.c
Modified:
   haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/Jamfile
Log:
Enabling linkage of the iprowifi2100 driver.


Modified: 
haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/Jamfile    
2009-11-30 21:19:30 UTC (rev 34391)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/Jamfile    
2009-11-30 21:20:34 UTC (rev 34392)
@@ -17,6 +17,7 @@
 
 KernelAddon iprowifi2100 :
        if_ipw.c
+       glue.c
        :
        libfreebsd_wlan.a
        libfreebsd_network.a

Added: haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/glue.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/glue.c     
                        (rev 0)
+++ haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/glue.c     
2009-11-30 21:20:34 UTC (rev 34392)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2009, Colin Günther, coling@xxxxxxx
+ * All Rights Reserved. Distributed under the terms of the MIT License.
+ */
+
+#include <sys/bus.h>
+#include <sys/kernel.h>
+
+#include <machine/bus.h>
+
+#include <net/if.h>
+#include <net/if_media.h>
+
+#include <net80211/ieee80211_var.h>
+
+#include <dev/ipw/if_ipwreg.h>
+#include <dev/ipw/if_ipwvar.h>
+
+
+HAIKU_FBSD_WLAN_DRIVER_GLUE(iprowifi2100, ipw, pci)
+NO_HAIKU_FBSD_MII_DRIVER();
+HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES|FBSD_WLAN);
+HAIKU_FIRMWARE_VERSION(130);
+
+
+int
+HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
+{
+       struct ipw_softc* sc = (struct ipw_softc*)device_get_softc(dev);
+       uint32 r;
+       HAIKU_INTR_REGISTER_STATE;
+       
+       HAIKU_INTR_REGISTER_ENTER();
+       if ((r = CSR_READ_4(sc, IPW_CSR_INTR)) == 0 || r == 0xffffffff) {
+               HAIKU_INTR_REGISTER_LEAVE();
+               return 0;
+       }
+
+       /* disable interrupts */
+       CSR_WRITE_4(sc, IPW_CSR_INTR_MASK, 0);
+       
+       HAIKU_INTR_REGISTER_LEAVE();
+
+       return 1;
+}
+
+
+void
+HAIKU_REENABLE_INTERRUPTS(device_t dev)
+{
+       struct ipw_softc* sc = (struct ipw_softc*)device_get_softc(dev);
+
+       /* enable interrupts */
+       CSR_WRITE_4(sc, IPW_CSR_INTR_MASK, IPW_INTR_MASK);
+}


Other related posts:

  • » [haiku-commits] r34392 - haiku/trunk/src/add-ons/kernel/drivers/network/wlan/iprowifi2100 - coling