iprowifi4965 now links. Still needs to be tested as I don't own the required

hardware myself.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34414 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Colin Günther
2009-12-01 15:46:52 +00:00
parent 625990fbb9
commit e557314537
2 changed files with 68 additions and 0 deletions
@@ -17,6 +17,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) dev iwn ] ;
KernelAddon iprowifi4965 :
if_iwn.c
glue.c
:
libfreebsd_wlan.a
libfreebsd_network.a
@@ -0,0 +1,67 @@
/*
* Copyright 2009, Colin Günther, [email protected].
* 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 <net80211/ieee80211_amrr.h>
#include <dev/iwn/if_iwnreg.h>
#include <dev/iwn/if_iwnvar.h>
HAIKU_FBSD_WLAN_DRIVER_GLUE(iprowifi4965, iwn, pci)
NO_HAIKU_FBSD_MII_DRIVER();
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES|FBSD_WLAN);
HAIKU_FIRMWARE_VERSION(44417);
int
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
{
struct iwn_softc* sc = (struct iwn_softc*)device_get_softc(dev);
uint32 r1, r2;
HAIKU_INTR_REGISTER_STATE;
HAIKU_INTR_REGISTER_ENTER();
r1 = IWN_READ(sc, IWN_INTR);
r2 = IWN_READ(sc, IWN_INTR_STATUS);
if (r1 == 0 && r2 == 0) {
/* not for us */
IWN_WRITE(sc, IWN_MASK, IWN_INTR_MASK);
HAIKU_INTR_REGISTER_LEAVE();
return 0;
}
if (r1 == 0xffffffff) {
/* hardware gone */
HAIKU_INTR_REGISTER_LEAVE();
return 0;
}
/* disable interrupts */
IWN_WRITE(sc, IWN_MASK, 0);
HAIKU_INTR_REGISTER_LEAVE();
return 1;
}
void
HAIKU_REENABLE_INTERRUPTS(device_t dev)
{
struct iwn_softc* sc = (struct iwn_softc*)device_get_softc(dev);
/* enable interrupts */
IWN_WRITE(sc, IWN_MASK, IWN_INTR_MASK);
}