Index: if_bge.c =================================================================== RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v retrieving revision 1.63 diff -u -r1.63 if_bge.c --- if_bge.c 13 Jan 2004 11:31:09 -0000 1.63 +++ if_bge.c 27 Jan 2004 03:49:19 -0000 @@ -75,6 +75,7 @@ #include #include #include +#include #include #include @@ -194,6 +195,7 @@ u_int32_t *); static void bge_intr (void *); +static void bge_intr_task (void *, int); static void bge_start_locked (struct ifnet *); static void bge_start (struct ifnet *); static int bge_ioctl (struct ifnet *, u_long, caddr_t); @@ -2244,6 +2246,8 @@ sc->bge_dev = dev; sc->bge_unit = unit; + TASK_INIT(&sc->bge_intrtask, 0, bge_intr_task, sc); + /* * Map control/status registers. */ @@ -2451,7 +2455,7 @@ /* * Hookup IRQ last. */ - error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, + error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_FAST, bge_intr, sc, &sc->bge_intrhand); if (error) { @@ -2811,13 +2815,10 @@ void *xsc; { struct bge_softc *sc; - struct ifnet *ifp; u_int32_t statusword; u_int32_t status; sc = xsc; - ifp = &sc->arpcom.ac_if; - BGE_LOCK(sc); bus_dmamap_sync(sc->bge_cdata.bge_status_tag, @@ -2848,7 +2849,6 @@ */ if (sc->bge_asicrev == BGE_ASICREV_BCM5700) { - status = CSR_READ_4(sc, BGE_MAC_STS); if (status & BGE_MACSTAT_MI_INTERRUPT) { sc->bge_link = 0; @@ -2892,6 +2892,32 @@ } } + /* Re-enable interrupts. */ + CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0); + + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREWRITE); + + BGE_UNLOCK(sc); + + taskqueue_enqueue_fast(taskqueue_fast, &sc->bge_intrtask); + + return; +} + +static void +bge_intr_task(void *context, int pending) +{ + struct bge_softc *sc; + struct ifnet *ifp; + + sc = (struct bge_softc *)context; + ifp = &sc->arpcom.ac_if; + BGE_LOCK(sc); + + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTWRITE); + if (ifp->if_flags & IFF_RUNNING) { /* Check RX return ring producer/consumer */ bge_rxeof(sc); @@ -2904,9 +2930,6 @@ sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREWRITE); bge_handle_events(sc); - - /* Re-enable interrupts. */ - CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0); if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) bge_start_locked(ifp); Index: if_bgereg.h =================================================================== RCS file: /home/ncvs/src/sys/dev/bge/if_bgereg.h,v retrieving revision 1.26 diff -u -r1.26 if_bgereg.h --- if_bgereg.h 8 Jan 2004 17:19:11 -0000 1.26 +++ if_bgereg.h 26 Jan 2004 17:47:43 -0000 @@ -2299,6 +2299,7 @@ struct callout bge_stat_ch; char *bge_vpd_prodname; char *bge_vpd_readonly; + struct task bge_intrtask; /* task for interrupt event */ }; #define BGE_LOCK_INIT(_sc, _name) \