summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-02-08 20:38:26 +0000
committermdodd <mdodd@FreeBSD.org>2003-02-08 20:38:26 +0000
commit777508ca28f30e2c13f9507ffd7184fd78d81c22 (patch)
tree0ab29c36b5cfcab47c070a5d5f662f185b6e18ad /sys/pci
parentb4e3f2f94a505c800e895764e429ec9ec310d9b4 (diff)
downloadFreeBSD-src-777508ca28f30e2c13f9507ffd7184fd78d81c22.zip
FreeBSD-src-777508ca28f30e2c13f9507ffd7184fd78d81c22.tar.gz
- Remove duplicate call to callout_handle_init() in pcn_attach().
- Conditionalize mtx_destroy() in pcn_attach(). - Assert driver lock in pcn_intr(). Submitted by: Hiten Pandya <hiten@unixdaemons.com>
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_pcn.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index 48d228e..8b539cd 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -657,7 +657,6 @@ pcn_attach(dev)
* Call MI attach routine.
*/
ether_ifattach(ifp, (u_int8_t *) eaddr);
- callout_handle_init(&sc->pcn_stat_ch);
PCN_UNLOCK(sc);
return(0);
@@ -671,7 +670,8 @@ fail:
if (sc->pcn_res)
bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res);
- mtx_destroy(&sc->pcn_mtx);
+ if (mtx_initialized(&sc->mtx) != 0)
+ mtx_destroy(&sc->pcn_mtx);
return(error);
}
@@ -976,6 +976,8 @@ pcn_intr(arg)
return;
}
+ PCN_LOCK(sc);
+
CSR_WRITE_4(sc, PCN_IO32_RAP, PCN_CSR_CSR);
while ((status = CSR_READ_4(sc, PCN_IO32_RDP)) & PCN_CSR_INTR) {
@@ -996,6 +998,7 @@ pcn_intr(arg)
if (ifp->if_snd.ifq_head != NULL)
pcn_start(ifp);
+ PCN_UNLOCK(sc);
return;
}
OpenPOWER on IntegriCloud