summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2003-08-20 03:11:37 +0000
committersimokawa <simokawa@FreeBSD.org>2003-08-20 03:11:37 +0000
commitd3697017695d7e18b62a96440c913ef9d6e5e978 (patch)
treef188489d58508b29406d66fe940915931b0ed4d0 /sys/dev/firewire
parent9371b61282ed1e0de29164f2b0227baebfc1b12f (diff)
downloadFreeBSD-src-d3697017695d7e18b62a96440c913ef9d6e5e978.zip
FreeBSD-src-d3697017695d7e18b62a96440c913ef9d6e5e978.tar.gz
Fill reserved fields of transmitting packets header with zero.
This fixes the if_fwe problem with 1394b chip. PR and Tested by: nork
Diffstat (limited to 'sys/dev/firewire')
-rw-r--r--sys/dev/firewire/fwohci.c32
-rw-r--r--sys/dev/firewire/fwohcireg.h6
2 files changed, 24 insertions, 14 deletions
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index 66164eb..15e48ca 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -839,6 +839,7 @@ fwohci_start(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
volatile struct fwohci_txpkthdr *ohcifp;
struct fwohcidb_tr *db_tr;
volatile struct fwohcidb *db;
+ volatile u_int32_t *ld;
struct tcode_info *info;
static int maxdesc=0;
@@ -873,17 +874,20 @@ txloop:
ohcifp = (volatile struct fwohci_txpkthdr *) db_tr->db[1].db.immed;
info = &tinfo[tcode];
hdr_len = pl_off = info->hdr_len;
- for( i = 0 ; i < pl_off ; i+= 4){
- ohcifp->mode.ld[i/4] = fp->mode.ld[i/4];
- }
- ohcifp->mode.common.spd = xfer->spd;
+
+ ld = &ohcifp->mode.ld[0];
+ ld[0] = ld[1] = ld[2] = ld[3] = 0;
+ for( i = 0 ; i < pl_off ; i+= 4)
+ ld[i/4] = fp->mode.ld[i/4];
+
+ ohcifp->mode.common.spd = xfer->spd & 0x7;
if (tcode == FWTCODE_STREAM ){
hdr_len = 8;
ohcifp->mode.stream.len = fp->mode.stream.len;
} else if (tcode == FWTCODE_PHY) {
hdr_len = 12;
- ohcifp->mode.ld[1] = fp->mode.ld[1];
- ohcifp->mode.ld[2] = fp->mode.ld[2];
+ ld[1] = fp->mode.ld[1];
+ ld[2] = fp->mode.ld[2];
ohcifp->mode.common.spd = 0;
ohcifp->mode.common.tcode = FWOHCITCODE_PHY;
} else {
@@ -894,6 +898,7 @@ txloop:
db = &db_tr->db[0];
FWOHCI_DMA_WRITE(db->db.desc.cmd,
OHCI_OUTPUT_MORE | OHCI_KEY_ST2 | hdr_len);
+ FWOHCI_DMA_WRITE(db->db.desc.addr, 0);
FWOHCI_DMA_WRITE(db->db.desc.res, 0);
/* Specify bound timer of asy. responce */
if(&sc->atrs == dbch){
@@ -904,7 +909,7 @@ txloop:
if (tcode == FWTCODE_WREQQ || tcode == FWTCODE_RRESQ)
hdr_len = 12;
for (i = 0; i < hdr_len/4; i ++)
- FWOHCI_DMA_WRITE(ohcifp->mode.ld[i], ohcifp->mode.ld[i]);
+ FWOHCI_DMA_WRITE(ld[i], ld[i]);
#endif
again:
@@ -1057,8 +1062,9 @@ fwohci_txd(struct fwohci_softc *sc, struct fwohci_dbch *dbch)
bus_dmamap_sync(dbch->dmat, tr->dma_map,
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(dbch->dmat, tr->dma_map);
-#if 0
- dump_db(sc, ch);
+#if 1
+ if (firewire_debug)
+ dump_db(sc, ch);
#endif
if(status & OHCI_CNTL_DMA_DEAD) {
/* Stop DMA */
@@ -2106,11 +2112,14 @@ fwohci_tbuf_update(struct fwohci_softc *sc, int dmach)
ldesc = sc->it[dmach].ndesc - 1;
s = splfw(); /* unnecessary ? */
fwdma_sync_multiseg_all(sc->it[dmach].am, BUS_DMASYNC_POSTREAD);
+ if (firewire_debug)
+ dump_db(sc, ITX_CH + dmach);
while ((chunk = STAILQ_FIRST(&it->stdma)) != NULL) {
db = ((struct fwohcidb_tr *)(chunk->end))->db;
stat = FWOHCI_DMA_READ(db[ldesc].db.desc.res)
>> OHCI_STATUS_SHIFT;
db = ((struct fwohcidb_tr *)(chunk->start))->db;
+ /* timestamp */
count = FWOHCI_DMA_READ(db[ldesc].db.desc.res)
& OHCI_COUNT_MASK;
if (stat == 0)
@@ -2454,10 +2463,10 @@ device_printf(sc->fc.dev, "DB %08x %08x %08x\n", bulkxfer, db_tr->bus_addr, fdb_
fp = (struct fw_pkt *)db_tr->buf;
ohcifp = (volatile struct fwohci_txpkthdr *) db[1].db.immed;
ohcifp->mode.ld[0] = fp->mode.ld[0];
+ ohcifp->mode.common.spd = 0 & 0x7;
ohcifp->mode.stream.len = fp->mode.stream.len;
ohcifp->mode.stream.chtag = chtag;
ohcifp->mode.stream.tcode = 0xa;
- ohcifp->mode.stream.spd = 0;
#if BYTE_ORDER == BIG_ENDIAN
FWOHCI_DMA_WRITE(db[1].db.immed[0], db[1].db.immed[0]);
FWOHCI_DMA_WRITE(db[1].db.immed[1], db[1].db.immed[1]);
@@ -2514,6 +2523,9 @@ fwohci_add_tx_buf(struct fwohci_dbch *dbch, struct fwohcidb_tr *db_tr,
FWOHCI_DMA_WRITE(db[0].db.desc.cmd,
OHCI_OUTPUT_MORE | OHCI_KEY_ST2 | 8);
+ FWOHCI_DMA_WRITE(db[0].db.desc.addr, 0);
+ bzero((void *)(uintptr_t)(volatile void *)
+ &db[1].db.immed[0], sizeof(db[1].db.immed));
FWOHCI_DMA_WRITE(db[2].db.desc.addr,
fwdma_bus_addr(it->buf, poffset) + sizeof(u_int32_t));
diff --git a/sys/dev/firewire/fwohcireg.h b/sys/dev/firewire/fwohcireg.h
index ba81bb7..9b1e703 100644
--- a/sys/dev/firewire/fwohcireg.h
+++ b/sys/dev/firewire/fwohcireg.h
@@ -332,8 +332,7 @@ struct fwohci_txpkthdr{
u_int32_t ld[4];
struct {
#if BYTE_ORDER == BIG_ENDIAN
- u_int32_t :13,
- spd:3,
+ u_int32_t spd:16, /* XXX include reserved field */
:8,
tcode:4,
:4;
@@ -341,8 +340,7 @@ struct fwohci_txpkthdr{
u_int32_t :4,
tcode:4,
:8,
- spd:3,
- :13;
+ spd:16; /* XXX include reserved fields */
#endif
}common;
struct {
OpenPOWER on IntegriCloud