summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_tht.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-24 08:08:50 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-24 08:08:50 +0000
commit6695cad608d0e6505411e954f44c9c0473473d1b (patch)
tree851ca5a7576ebc25a159c07f48ea54fcf1d60461 /sys/dev/pci/if_tht.c
parent7851ca48b013029dbd218b5a3132fb2d02cd1ad5 (diff)
use the fifos ready byte counter in the firmware loading.
Diffstat (limited to 'sys/dev/pci/if_tht.c')
-rw-r--r--sys/dev/pci/if_tht.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c
index 2ce5d89aced..df8a5447741 100644
--- a/sys/dev/pci/if_tht.c
+++ b/sys/dev/pci/if_tht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tht.c,v 1.57 2007/04/23 11:32:44 dlg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.58 2007/04/24 08:08:49 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -1407,13 +1407,12 @@ tht_fw_load(struct tht_softc *sc)
buf = fw;
while (fwlen > 0) {
- while ((wrlen = tht_fifo_ready(sc, &sc->sc_txt)) <=
- THT_FIFO_GAP) {
+ while (tht_fifo_ready(sc, &sc->sc_txt) <= THT_FIFO_GAP) {
if (tsleep(sc, PCATCH, "thtfw", 1) == EINTR)
goto err;
}
- wrlen = MIN(wrlen, fwlen);
+ wrlen = MIN(sc->sc_txt.tf_ready, fwlen);
tht_fifo_pre(sc, &sc->sc_txt);
tht_fifo_write(sc, &sc->sc_txt, buf, wrlen);
tht_fifo_post(sc, &sc->sc_txt);