diff options
author | phk <phk@FreeBSD.org> | 2005-02-11 22:24:02 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-02-11 22:24:02 +0000 |
commit | c62c4490c2b3de85326c78c838143b7c5b059fef (patch) | |
tree | e2aa9d454858de84fefc8ca74788cf3405ef1171 /sys/dev/ieee488 | |
parent | 5801ece863be8ec6a9f785c3cb3d97c62499c7ea (diff) | |
download | FreeBSD-src-c62c4490c2b3de85326c78c838143b7c5b059fef.zip FreeBSD-src-c62c4490c2b3de85326c78c838143b7c5b059fef.tar.gz |
Make sure the last command byte makes it onto the wire.
Diffstat (limited to 'sys/dev/ieee488')
-rw-r--r-- | sys/dev/ieee488/upd7210.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ieee488/upd7210.c b/sys/dev/ieee488/upd7210.c index ce2c91b..6fbb44f 100644 --- a/sys/dev/ieee488/upd7210.c +++ b/sys/dev/ieee488/upd7210.c @@ -347,14 +347,16 @@ gpib_ib_irq(struct upd7210 *u) ib = u->ibfoo; - if ((u->rreg[ISR2] & IXR2_CO) && ib->cmdlen > 0) { - write_reg(u, CDOR, *ib->cmdbuf); - ib->cmdbuf++; - ib->cmdlen--; + if ((u->rreg[ISR2] & IXR2_CO) && ib->cmdbuf != NULL) { if (ib->cmdlen == 0) { wakeup(ib); + ib->cmdbuf = NULL; write_reg(u, IMR2, 0); + return (1); } + write_reg(u, CDOR, *ib->cmdbuf); + ib->cmdbuf++; + ib->cmdlen--; return (1); } if ((u->rreg[ISR1] & IXR1_DO) && ib->dobuf != NULL) { |