While setting up a transmit packet disable interupts on the card then
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Thu, 28 Jul 2005 16:56:37 +0000 (16:56 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Thu, 28 Jul 2005 16:56:37 +0000 (16:56 +0000)
re-enable them after we are done setting up the packet.  This seems to
fix the MPI350 newer firmware hangs.

Obtained-from: FreeBSD (if_an.c, 1.2.2.16)
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>
sys/dev/netif/an/if_an.c

index d0357ff..6e72ae0 100644 (file)
@@ -30,7 +30,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/an/if_an.c,v 1.2.2.13 2003/02/11 03:32:48 ambrisko Exp $
- * $DragonFly: src/sys/dev/netif/an/if_an.c,v 1.30 2005/07/28 16:55:17 joerg Exp $
+ * $DragonFly: src/sys/dev/netif/an/if_an.c,v 1.31 2005/07/28 16:56:37 joerg Exp $
  */
 
 /*
@@ -2638,6 +2638,9 @@ an_start(ifp)
                        ifp->if_timer = 5;
                }
        } else { /* MPI-350 */
+               /* Disable interrupts. */
+               CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0);
+
                while (sc->an_rdata.an_tx_empty ||
                    idx != sc->an_rdata.an_tx_cons) {
                        m0 = ifq_dequeue(&ifp->if_snd);
@@ -2708,6 +2711,9 @@ an_start(ifp)
                         */
                        ifp->if_timer = 5;
                }
+
+               /* Re-enable interrupts. */
+               CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), AN_INTRS(sc->mpi350));
        }
 
        if (m0 != NULL)