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/iwn/if_iwnreg.h> 19 #include <dev/iwn/if_iwnvar.h> 20 21 22 HAIKU_FBSD_WLAN_DRIVER_GLUE(iprowifi4965, iwn, pci) 23 NO_HAIKU_FBSD_MII_DRIVER(); 24 NO_HAIKU_REENABLE_INTERRUPTS(); 25 HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_WLAN); 26 HAIKU_FIRMWARE_VERSION(44417); 27 HAIKU_FIRMWARE_NAME_MAP(5) = { 28 {"iwn1000fw", "iwlwifi-1000-3.ucode"}, 29 {"iwn4965fw", "iwlwifi-4965-2.ucode"}, 30 {"iwn5000fw", "iwlwifi-5000-2.ucode"}, 31 {"iwn5150fw", "iwlwifi-5150-2.ucode"}, 32 {"iwn6000fw", "iwlwifi-6000-4.ucode"} 33 }; 34 35 36 int 37 HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev) 38 { 39 struct iwn_softc* sc = (struct iwn_softc*)device_get_softc(dev); 40 uint32 r1, r2; 41 42 r1 = IWN_READ(sc, IWN_INT); 43 r2 = IWN_READ(sc, IWN_FH_INT); 44 45 if (r1 == 0 && r2 == 0) { 46 // not for us 47 IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask); 48 return 0; 49 } 50 51 if (r1 == 0xffffffff) { 52 // hardware gone 53 return 0; 54 } 55 56 atomic_set((int32*)&sc->sc_intr_status_1, r1); 57 atomic_set((int32*)&sc->sc_intr_status_2, r2); 58 59 IWN_WRITE(sc, IWN_INT_MASK, 0); 60 // disable interrupts 61 62 return 1; 63 } 64