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#include <net80211/ieee80211_amrr.h>
17
18#include <dev/bwi/bitops.h>
19#include <dev/bwi/if_bwireg.h>
20#include <dev/bwi/if_bwivar.h>
21
22
23HAIKU_FBSD_WLAN_DRIVER_GLUE(broadcom43xx, bwi, pci)
24NO_HAIKU_FBSD_MII_DRIVER();
25NO_HAIKU_REENABLE_INTERRUPTS();
26HAIKU_DRIVER_REQUIREMENTS(FBSD_WLAN);
27HAIKU_FIRMWARE_VERSION(0);
28NO_HAIKU_FIRMWARE_NAME_MAP();
29
30
31int
32HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
33{
34	struct bwi_softc* sc = (struct bwi_softc*)device_get_softc(dev);
35	uint32 intr_status;
36
37	if ((sc->sc_flags & BWI_F_RUNNING) == 0
38		|| (sc->sc_flags & BWI_F_STOP))
39		return 0;
40
41	intr_status = CSR_READ_4(sc, BWI_MAC_INTR_STATUS);
42	if (intr_status == 0xffffffff) {
43		// Not for us
44		return 0;
45	}
46
47	intr_status &= CSR_READ_4(sc, BWI_MAC_INTR_MASK);
48	if (intr_status == 0) {
49		// nothing interesting
50		return 0;
51	}
52
53	atomic_set((int32*)&sc->sc_intr_status, intr_status);
54
55	CSR_CLRBITS_4(sc, BWI_MAC_INTR_MASK, BWI_ALL_INTRS);
56		// Disable all interrupts
57
58	return 1;
59}
60