vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / kernel / drivers / network / wlan / aironetwifi / glue.c
blob9acdafa9498dc3c5eb3c0575b28dda061da59475
1 /*
2 * Copyright 2009, Colin Günther, coling@gmx.de.
3 * All Rights Reserved. Distributed under the terms of the MIT License.
4 */
7 #include <sys/bus.h>
8 #include <sys/kernel.h>
9 #include <sys/rman.h>
11 #include <net/if.h>
12 #include <net/ethernet.h>
13 #include <net/if_media.h>
15 #include <net80211/ieee80211_var.h>
17 #include <machine/bus.h>
19 #include <dev/an/if_aironet_ieee.h>
20 #include <dev/an/if_anreg.h>
23 // Netgraph function variables.
24 void (*ng_ether_attach_p)(struct ifnet *ifp) = NULL;
25 void (*ng_ether_detach_p)(struct ifnet *ifp) = NULL;
28 HAIKU_FBSD_WLAN_DRIVER_GLUE(aironetwifi, an, pci)
29 NO_HAIKU_FBSD_MII_DRIVER();
30 NO_HAIKU_REENABLE_INTERRUPTS();
31 HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES);
34 int
35 HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
37 struct an_softc* sc = (struct an_softc*)device_get_softc(dev);
39 if (sc->an_gone)
40 return 0;
42 CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0);
43 // Disable interrupts.
45 return 1;