* Using atomic operations to synchronize the interrupt status between glue code
and ath_intr function. Those are faster than the HAIKU_INTR* macros. * Some variable renaming to stick with common naming conventions of the other wlan drivers. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34811 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1280,11 +1280,8 @@ ath_intr(void *arg)
|
|||||||
struct ifnet *ifp = sc->sc_ifp;
|
struct ifnet *ifp = sc->sc_ifp;
|
||||||
struct ath_hal *ah = sc->sc_ah;
|
struct ath_hal *ah = sc->sc_ah;
|
||||||
HAL_INT status;
|
HAL_INT status;
|
||||||
#ifdef __HAIKU__
|
|
||||||
HAIKU_INTR_REGISTER_STATE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __HAIKU__
|
#if !defined(__HAIKU__)
|
||||||
if (sc->sc_invalid) {
|
if (sc->sc_invalid) {
|
||||||
/*
|
/*
|
||||||
* The hardware is not ready/present, don't touch anything.
|
* The hardware is not ready/present, don't touch anything.
|
||||||
@@ -1312,10 +1309,8 @@ ath_intr(void *arg)
|
|||||||
* bits we haven't explicitly enabled so we mask the
|
* bits we haven't explicitly enabled so we mask the
|
||||||
* value to insure we only process bits we requested.
|
* value to insure we only process bits we requested.
|
||||||
*/
|
*/
|
||||||
#ifdef __HAIKU__
|
#if defined(__HAIKU__)
|
||||||
HAIKU_INTR_REGISTER_ENTER();
|
status = atomic_and((int32 *)&sc->sc_intr_status, 0);
|
||||||
status = sc->sc_lastisr;
|
|
||||||
HAIKU_INTR_REGISTER_LEAVE();
|
|
||||||
#else
|
#else
|
||||||
ath_hal_getisr(ah, &status); /* NB: clears ISR too */
|
ath_hal_getisr(ah, &status); /* NB: clears ISR too */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -343,8 +343,8 @@ struct ath_softc {
|
|||||||
u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */
|
u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */
|
||||||
u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */
|
u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */
|
||||||
|
|
||||||
#ifdef __HAIKU__
|
#if defined(__HAIKU__)
|
||||||
HAL_INT sc_lastisr;
|
HAL_INT sc_intr_status;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,21 +23,18 @@ HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_WLAN);
|
|||||||
int
|
int
|
||||||
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
||||||
{
|
{
|
||||||
struct ath_softc* ath = (struct ath_softc*)device_get_softc(dev);
|
struct ath_softc* sc = (struct ath_softc*)device_get_softc(dev);
|
||||||
struct ath_hal* ah = ath->sc_ah;
|
struct ath_hal* ah = sc->sc_ah;
|
||||||
HAIKU_INTR_REGISTER_STATE;
|
HAL_INT intr_status;
|
||||||
|
|
||||||
if (ath->sc_invalid)
|
if (sc->sc_invalid)
|
||||||
// The hardware is not ready/present, don't touch anything.
|
// The hardware is not ready/present, don't touch anything.
|
||||||
// Note this can happen early on if the IRQ is shared.
|
// Note this can happen early on if the IRQ is shared.
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
HAIKU_INTR_REGISTER_ENTER();
|
if (!ath_hal_intrpend(ah))
|
||||||
if (!ath_hal_intrpend(ah)) {
|
|
||||||
// shared irq, not for us
|
// shared irq, not for us
|
||||||
HAIKU_INTR_REGISTER_LEAVE();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
// We have to save the isr status right now.
|
// We have to save the isr status right now.
|
||||||
// Some devices don't like having the interrupt disabled
|
// Some devices don't like having the interrupt disabled
|
||||||
@@ -48,12 +45,12 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
|||||||
//
|
//
|
||||||
// Note: Haiku's pcnet driver uses the same technique of
|
// Note: Haiku's pcnet driver uses the same technique of
|
||||||
// appending a sc_lastisr field.
|
// appending a sc_lastisr field.
|
||||||
ath_hal_getisr(ah, &ath->sc_lastisr);
|
ath_hal_getisr(ah, &intr_status);
|
||||||
|
atomic_or((int32*)&sc->sc_intr_status, intr_status);
|
||||||
|
|
||||||
ath_hal_intrset(ah, 0);
|
ath_hal_intrset(ah, 0);
|
||||||
// disable further intr's
|
// disable further intr's
|
||||||
|
|
||||||
HAIKU_INTR_REGISTER_LEAVE();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,8 +58,8 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
|||||||
void
|
void
|
||||||
HAIKU_REENABLE_INTERRUPTS(device_t dev)
|
HAIKU_REENABLE_INTERRUPTS(device_t dev)
|
||||||
{
|
{
|
||||||
struct ath_softc* ath = (struct ath_softc*)device_get_softc(dev);
|
struct ath_softc* sc = (struct ath_softc*)device_get_softc(dev);
|
||||||
struct ath_hal* ah = ath->sc_ah;
|
struct ath_hal* ah = sc->sc_ah;
|
||||||
|
|
||||||
ath_hal_intrset(ah, ath->sc_imask);
|
ath_hal_intrset(ah, sc->sc_imask);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user