svn commit: r228613 - user/sbruno/1394dev/firewire

Sean Bruno sbruno at FreeBSD.org
Sat Dec 17 01:02:57 UTC 2011


Author: sbruno
Date: Sat Dec 17 01:02:56 2011
New Revision: 228613
URL: http://svn.freebsd.org/changeset/base/228613

Log:
  Merge in changes from kan@
  
  1. do not allow any requests until bus reset is done and we know node IDs
  2. Do not set fc_status before fwohci_task_sid actually runs
  3. When alocating dma blocks, use proper alignment, not whole block size, which is hardly ever multiple of 2
  
  Submitted by:	kan@

Modified:
  user/sbruno/1394dev/firewire/firewire.c
  user/sbruno/1394dev/firewire/fwohci.c

Modified: user/sbruno/1394dev/firewire/firewire.c
==============================================================================
--- user/sbruno/1394dev/firewire/firewire.c	Sat Dec 17 00:54:09 2011	(r228612)
+++ user/sbruno/1394dev/firewire/firewire.c	Sat Dec 17 01:02:56 2011	(r228613)
@@ -221,9 +221,13 @@ fw_asyreq(struct firewire_comm *fc, int 
 		return EINVAL;
 	}
 
-	/* XXX allow bus explore packets only after bus rest */
+	/*
+	 * XXX allow bus explore packets only after bus rest and after
+	 * we have have passed self-id receive state
+	 */
 	if ((fc->status < FWBUSEXPLORE) &&
-	    ((tcode != FWTCODE_RREQQ) || (fp->mode.rreqq.dest_hi != 0xffff) ||
+	    ((fc->status < FWBUSINIT) ||
+	    (tcode != FWTCODE_RREQQ) || (fp->mode.rreqq.dest_hi != 0xffff) ||
 	    (fp->mode.rreqq.dest_lo  < 0xf0000000) ||
 	    (fp->mode.rreqq.dest_lo >= 0xf0001000))) {
 		xfer->resp = EAGAIN;

Modified: user/sbruno/1394dev/firewire/fwohci.c
==============================================================================
--- user/sbruno/1394dev/firewire/fwohci.c	Sat Dec 17 00:54:09 2011	(r228612)
+++ user/sbruno/1394dev/firewire/fwohci.c	Sat Dec 17 01:02:56 2011	(r228613)
@@ -1274,7 +1274,7 @@ fwohci_db_init(struct fwohci_softc *sc, 
 	}
 
 #define DB_SIZE(x) (sizeof(struct fwohcidb) * (x)->ndesc)
-	dbch->am = fwdma_malloc_multiseg(&sc->fc, DB_SIZE(dbch),
+	dbch->am = fwdma_malloc_multiseg(&sc->fc, sizeof(struct fwohcidb),
 		DB_SIZE(dbch), dbch->ndb, BUS_DMA_WAITOK);
 	if (dbch->am == NULL) {
 		printf("fwohci_db_init: fwdma_malloc_multiseg failed\n");
@@ -1907,8 +1907,6 @@ fwohci_intr_core(struct fwohci_softc *sc
 			OWRITE(sc, OHCI_LNKCTL, OHCI_CNTL_CYCTIMER);
 		}
 
-		fc->status = FWBUSINIT;
-
 		if (!kdb_active)
 			taskqueue_enqueue(sc->fc.taskqueue, &sc->fwohci_task_sid);
 	}
@@ -2014,7 +2012,6 @@ fwohci_task_sid(void *arg, int pending)
 	uint32_t *buf;
 	int i, plen;
 
-
 	/*
 	 * We really should have locking
 	 * here.  Not sure why it's not
@@ -2039,6 +2036,8 @@ fwohci_task_sid(void *arg, int pending)
 	for (i = 0; i < plen / 4; i ++)
 		buf[i] = FWOHCI_DMA_READ(sc->sid_buf[i+1]);
 
+	fc->status = FWBUSINIT;
+
 	/* pending all pre-bus_reset packets */
 	fwohci_txd(sc, &sc->atrq);
 	fwohci_txd(sc, &sc->atrs);


More information about the svn-src-user mailing list