diff options
author | simokawa <simokawa@FreeBSD.org> | 2003-03-24 04:06:21 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2003-03-24 04:06:21 +0000 |
commit | 5a06ca07d7ffa776c7ce6cffa7fdffe290fcf8c2 (patch) | |
tree | f4acab0b89720d877fc3a306ebd1a157c393a5ec | |
parent | 176bfd0826418757fdcb34d8793a91e53c091b7e (diff) | |
download | FreeBSD-src-5a06ca07d7ffa776c7ce6cffa7fdffe290fcf8c2.zip FreeBSD-src-5a06ca07d7ffa776c7ce6cffa7fdffe290fcf8c2.tar.gz |
- The payload of Write Request Quad and Read Response Quad must be
network byte order.
- Set ATRetries register after each bus reset because the value is 'undef'
in OHCI spec.
-rw-r--r-- | sys/dev/firewire/fwmem.c | 2 | ||||
-rw-r--r-- | sys/dev/firewire/fwohci.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/firewire/fwmem.c b/sys/dev/firewire/fwmem.c index 891fc7a..13bd092 100644 --- a/sys/dev/firewire/fwmem.c +++ b/sys/dev/firewire/fwmem.c @@ -163,7 +163,7 @@ fwmem_write_quad( fp->mode.wreqq.dest_hi = htons(dst_hi); fp->mode.wreqq.dest_lo = htonl(dst_lo); - fp->mode.wreqq.data = htonl(data); + fp->mode.wreqq.data = data; if (fwmem_debug) printf("fwmem_write_quad: %d %04x:%08x %08x\n", fwdev->dst, diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index 29901c5..1f45cb9 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -169,6 +169,7 @@ void fwohci_txbufdb __P((struct fwohci_softc *, int , struct fw_bulkxfer *)); #define NDVDB (DVBUF * NDB) #define OHCI_VERSION 0x00 +#define OHCI_ATRETRY 0x08 #define OHCI_CROMHDR 0x18 #define OHCI_BUS_OPT 0x20 #define OHCI_BUSIRMC (1 << 31) @@ -810,6 +811,10 @@ txloop: for( i = 0 ; i < hdr_off ; i+= 4){ ohcifp->mode.ld[i/4] = ntohl(fp->mode.ld[i/4]); } + /* XXX payload must be network byte order */ + if (tcode == FWTCODE_WREQQ || tcode == FWTCODE_RRESQ) { + ohcifp->mode.ld[3] = htonl(ohcifp->mode.ld[3]); + } ohcifp->mode.common.spd = xfer->spd; if (tcode == FWTCODE_STREAM ){ hdr_len = 8; @@ -1882,6 +1887,8 @@ busresetout: OWRITE(sc, OHCI_PREQHI, 0x7fffffff); OWRITE(sc, OHCI_PREQLO, 0xffffffff); OWRITE(sc, OHCI_PREQUPPER, 0x10000); + /* Set ATRetries register */ + OWRITE(sc, OHCI_ATRETRY, 1<<(13+16) | 0xfff); /* ** Checking whether the node is root or not. If root, turn on ** cycle master. @@ -2795,7 +2802,7 @@ fwohci_arcv(struct fwohci_softc *sc, struct fwohci_dbch *dbch, int count) switch(stat){ case FWOHCIEV_ACKPEND: #if 0 - printf("fwohci_arcv: ack pending..\n"); + printf("fwohci_arcv: ack pending tcode=0x%x..\n", fp->mode.common.tcode); #endif /* fall through */ case FWOHCIEV_ACKCOMPL: |