summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHidetoshi Shimokawa <simokawa@FreeBSD.org>2007-06-08 07:53:59 +0000
committerHidetoshi Shimokawa <simokawa@FreeBSD.org>2007-06-08 07:53:59 +0000
commit7acf69638a08714fa307a0c0a5d9556122f9c341 (patch)
tree2528322ec3b8efb20e791c1663c9b73dccd51acb
parent7b8c8b858c1f611ec3fe35565ec7fcf72f2c76c7 (diff)
Notes
-rw-r--r--sys/dev/firewire/firewire.c23
-rw-r--r--sys/dev/firewire/fwohci.c7
2 files changed, 16 insertions, 14 deletions
diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c
index e1ee133523b9..2857d9d45c16 100644
--- a/sys/dev/firewire/firewire.c
+++ b/sys/dev/firewire/firewire.c
@@ -220,6 +220,17 @@ fw_asyreq(struct firewire_comm *fc, int sub, struct fw_xfer *xfer)
printf("invalid tcode=%x\n", tcode);
return EINVAL;
}
+
+ /* XXX allow bus explore packets only after bus rest */
+ if ((fc->status < FWBUSEXPLORE) &&
+ ((tcode != FWTCODE_RREQQ) || (fp->mode.rreqq.dest_hi != 0xffff) ||
+ (fp->mode.rreqq.dest_lo < 0xf0000000) ||
+ (fp->mode.rreqq.dest_lo >= 0xf0001000))) {
+ xfer->resp = EAGAIN;
+ xfer->flag = FWXF_BUSY;
+ return (EAGAIN);
+ }
+
if (info->flag & FWTI_REQ)
xferq = fc->atq;
else
@@ -302,15 +313,6 @@ fw_asystart(struct fw_xfer *xfer)
{
struct firewire_comm *fc = xfer->fc;
int s;
-#if 0 /* XXX allow bus explore packets only after bus rest */
- if (fc->status < FWBUSEXPLORE) {
- xfer->resp = EAGAIN;
- xfer->flag = FWXF_BUSY;
- if (xfer->hand != NULL)
- xfer->hand(xfer);
- return;
- }
-#endif
s = splfw();
/* Protect from interrupt/timeout */
FW_GLOCK(fc);
@@ -1268,7 +1270,6 @@ void fw_sidrcv(struct firewire_comm* fc, uint32_t *sid, u_int len)
u_int i, j, node, c_port = 0, i_branch = 0;
fc->sid_cnt = len /(sizeof(uint32_t) * 2);
- fc->status = FWBUSINIT;
fc->max_node = fc->nodeid & 0x3f;
CSRARC(fc, NODE_IDS) = ((uint32_t)fc->nodeid) << 16;
fc->status = FWBUSCYMELECT;
@@ -1890,7 +1891,7 @@ fw_rcv(struct fw_rcv_buf *rb)
fp->mode.wreqq.dest_hi, fp->mode.wreqq.dest_lo,
tcode_str[tcode], tcode,
fp->mode.hdr.src, ntohl(fp->mode.wreqq.data));
- if (rb->fc->status == FWBUSRESET) {
+ if (rb->fc->status == FWBUSINIT) {
printf("fw_rcv: cannot respond(bus reset)!\n");
return;
}
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index cf8dfecdedd9..e6ee894b9381 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -1098,7 +1098,7 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
LAST_DB(tr, db);
status = FWOHCI_DMA_READ(db->db.desc.res) >> OHCI_STATUS_SHIFT;
if(!(status & OHCI_CNTL_DMA_ACTIVE)){
- if (fc->status != FWBUSRESET)
+ if (fc->status != FWBUSINIT)
/* maybe out of order?? */
goto out;
}
@@ -1160,7 +1160,7 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
fw_xfer_done(xfer);
} else {
xfer->flag = FWXF_SENT;
- if (err == EBUSY && fc->status != FWBUSRESET) {
+ if (err == EBUSY) {
xfer->flag = FWXF_BUSY;
xfer->resp = err;
xfer->recv.pay_len = 0;
@@ -2903,7 +2903,8 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count)
break;
}
case FWOHCIEV_BUSRST:
- if (sc->fc.status != FWBUSRESET)
+ if ((sc->fc.status != FWBUSRESET) &&
+ (sc->fc.status != FWBUSINIT))
printf("got BUSRST packet!?\n");
break;
default: