summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/firewire.c
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2003-02-13 13:35:57 +0000
committersimokawa <simokawa@FreeBSD.org>2003-02-13 13:35:57 +0000
commitcad5969811deb387a0348cb10f837f17e6dd3f1b (patch)
tree58650b7fb63d241ed72e0eb697fc79b8f30a6e21 /sys/dev/firewire/firewire.c
parent116925a3d815859d68d8e2d6c5c1d729dca6fdd0 (diff)
downloadFreeBSD-src-cad5969811deb387a0348cb10f837f17e6dd3f1b.zip
FreeBSD-src-cad5969811deb387a0348cb10f837f17e6dd3f1b.tar.gz
firewire/fwohci
- Drain fwohci TX queue first then drain xfer queue which has not started. - Check validity of the received packet length. - Don't allocate too large buffer for xfer receive buf. sbp - Fix panic for some CROM which doesn't have a text leaf. This could fix the PR kern/48129 but no feedback has been gotten from the originator yet. - Put back some M_NOWAIT flags into malloc which could be called in interrupt context for 4-stable.
Diffstat (limited to 'sys/dev/firewire/firewire.c')
-rw-r--r--sys/dev/firewire/firewire.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c
index 861006f..ab4ed46 100644
--- a/sys/dev/firewire/firewire.c
+++ b/sys/dev/firewire/firewire.c
@@ -505,7 +505,7 @@ firewire_shutdown( device_t dev )
static void
-firewire_xferq_drain(struct fw_xferq *xferq)
+fw_xferq_drain(struct fw_xferq *xferq)
{
struct fw_xfer *xfer;
@@ -524,6 +524,17 @@ firewire_xferq_drain(struct fw_xferq *xferq)
}
}
+void
+fw_drain_txq(struct firewire_comm *fc)
+{
+ int i;
+
+ fw_xferq_drain(fc->atq);
+ fw_xferq_drain(fc->ats);
+ for(i = 0; i < fc->nisodma; i++)
+ fw_xferq_drain(fc->it[i]);
+}
+
/*
* Called after bus reset.
*/
@@ -540,12 +551,6 @@ fw_busreset(struct firewire_comm *fc)
break;
}
fc->status = FWBUSRESET;
-/* XXX: discard all queued packet */
- firewire_xferq_drain(fc->atq);
- firewire_xferq_drain(fc->ats);
- for(i = 0; i < fc->nisodma; i++)
- firewire_xferq_drain(fc->it[i]);
-
CSRARC(fc, STATE_CLEAR)
= 1 << 23 | 0 << 17 | 1 << 16 | 1 << 15 | 1 << 14 ;
CSRARC(fc, STATE_SET) = CSRARC(fc, STATE_CLEAR);
@@ -1772,7 +1777,7 @@ fw_rcv(struct firewire_comm* fc, caddr_t buf, u_int len, u_int sub, u_int off, u
ntohl(fp->mode.rreqq.dest_lo),
fp->mode.common.tcode);
if (fc->status == FWBUSRESET) {
- printf("fw_rcv: cannot response(bus reset)!\n");
+ printf("fw_rcv: cannot respond(bus reset)!\n");
goto err;
}
xfer = fw_xfer_alloc(M_FWXFER);
OpenPOWER on IntegriCloud