From ffb7c505af851437edd58b358899635ae3d39478 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Sat, 29 Jan 2011 08:13:47 +0000 Subject: Fix two logic errors: - "could not disable Rx/Tx MAC" from FreeBSD - "could not disable RxQ/TxQ" from Gabriel Linder --- sys/dev/pci/if_alc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_alc.c b/sys/dev/pci/if_alc.c index 068f2ed1a04..5bf57d67596 100644 --- a/sys/dev/pci/if_alc.c +++ b/sys/dev/pci/if_alc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_alc.c,v 1.8 2010/08/31 17:13:44 deraadt Exp $ */ +/* $OpenBSD: if_alc.c,v 1.9 2011/01/29 08:13:46 kevlo Exp $ */ /*- * Copyright (c) 2009, Pyun YongHyeon * All rights reserved. @@ -2191,7 +2191,7 @@ alc_stop_mac(struct alc_softc *sc) /* Disable Rx/Tx MAC. */ reg = CSR_READ_4(sc, ALC_MAC_CFG); if ((reg & (MAC_CFG_TX_ENB | MAC_CFG_RX_ENB)) != 0) { - reg &= ~MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; + reg &= ~(MAC_CFG_TX_ENB | MAC_CFG_RX_ENB); CSR_WRITE_4(sc, ALC_MAC_CFG, reg); } for (i = ALC_TIMEOUT; i > 0; i--) { @@ -2242,7 +2242,7 @@ alc_stop_queue(struct alc_softc *sc) } /* Disable TxQ. */ reg = CSR_READ_4(sc, ALC_TXQ_CFG); - if ((reg & TXQ_CFG_ENB) == 0) { + if ((reg & TXQ_CFG_ENB) != 0) { reg &= ~TXQ_CFG_ENB; CSR_WRITE_4(sc, ALC_TXQ_CFG, reg); } -- cgit v1.2.3