xref: /haiku/src/add-ons/kernel/drivers/network/wlan/iprowifi2100/glue.c (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2009, Colin Günther, coling@gmx.de.
3  * All Rights Reserved. Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <sys/bus.h>
8 #include <sys/kernel.h>
9 
10 #include <machine/bus.h>
11 
12 #include <net/if.h>
13 #include <net/if_media.h>
14 
15 #include <net80211/ieee80211_var.h>
16 
17 #include <dev/ipw/if_ipwreg.h>
18 #include <dev/ipw/if_ipwvar.h>
19 
20 
21 HAIKU_FBSD_WLAN_DRIVER_GLUE(iprowifi2100, ipw, pci)
22 NO_HAIKU_FBSD_MII_DRIVER();
23 NO_HAIKU_REENABLE_INTERRUPTS();
24 HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE | FBSD_WLAN);
25 HAIKU_FIRMWARE_VERSION(130);
26 HAIKU_FIRMWARE_NAME_MAP(3) = {{"ipw_bss", "ipw2100-1.3.fw"},
27 	{"ipw_ibss", "ipw2100-1.3-i.fw"}, {"ipw_monitor", "ipw2100-1.3-p.fw"}};
28 
29 
30 int
31 HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
32 {
33 	struct ipw_softc* sc = (struct ipw_softc*)device_get_softc(dev);
34 	uint32 r;
35 
36 	r = CSR_READ_4(sc, IPW_CSR_INTR);
37 	if (r  == 0 || r == 0xffffffff)
38 		return 0;
39 
40 	atomic_set((int32*)&sc->sc_intr_status, r);
41 
42 	CSR_WRITE_4(sc, IPW_CSR_INTR_MASK, 0);
43 		// disable interrupts
44 	return 1;
45 }
46