hrev52167 adds 1 changeset to branch 'master'
old head: 03437cd7b8459cde76e8ee5a1bab6aa386934111
new head: fc35866e55aebe23982d924f71d4444137a3703c
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=fc35866e55ae+%5E03437cd7b845
----------------------------------------------------------------------------
fc35866e55ae: iprowifi4965: Rework interrupts glue code.
Untested, but this now better matches how the FreeBSD code does it.
Potentially fixes a bug where interrupts would be spuriously re-enabled
after the driver had disabled them, which may fix a KDL humdinger
reported to me via IRC.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev52167
Commit: fc35866e55aebe23982d924f71d4444137a3703c
URL: https://git.haiku-os.org/haiku/commit/?id=fc35866e55ae
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Sat Aug 4 16:21:08 2018 UTC
----------------------------------------------------------------------------
1 file changed, 10 insertions(+), 11 deletions(-)
.../drivers/network/wlan/iprowifi4965/glue.c | 21 ++++++++++----------
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/drivers/network/wlan/iprowifi4965/glue.c
b/src/add-ons/kernel/drivers/network/wlan/iprowifi4965/glue.c
index 1d0b7af6ed..6688418302 100644
--- a/src/add-ons/kernel/drivers/network/wlan/iprowifi4965/glue.c
+++ b/src/add-ons/kernel/drivers/network/wlan/iprowifi4965/glue.c
@@ -1,6 +1,6 @@
/*
- * Copyright 2009, Colin Günther, coling@xxxxxx.
- * All Rights Reserved. Distributed under the terms of the MIT License.
+ * Copyright 2018, Colin Günther, coling@xxxxxx. All rights reserved.
+ * Distributed under the terms of the MIT license.
*/
@@ -46,25 +46,24 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
struct iwn_softc* sc = (struct iwn_softc*)device_get_softc(dev);
uint32 r1, r2;
+ /* Disable interrupts. */
+ IWN_WRITE(sc, IWN_INT_MASK, 0);
+
r1 = IWN_READ(sc, IWN_INT);
+ if (r1 == 0xffffffff || (r1 & 0xfffffff0) == 0xa5a5a5a0) {
+ return 0; /* Hardware gone! */
+ }
r2 = IWN_READ(sc, IWN_FH_INT);
if (r1 == 0 && r2 == 0) {
// not for us
- IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask);
- return 0;
- }
-
- if (r1 == 0xffffffff) {
- // hardware gone
+ if (sc->sc_flags & IWN_FLAG_RUNNING)
+ IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask);
return 0;
}
atomic_set((int32*)&sc->sc_intr_status_1, r1);
atomic_set((int32*)&sc->sc_intr_status_2, r2);
- IWN_WRITE(sc, IWN_INT_MASK, 0);
- // disable interrupts
-
return 1;
}