summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2003-04-21 16:41:20 +0000
committersimokawa <simokawa@FreeBSD.org>2003-04-21 16:41:20 +0000
commit980817bfc5b9ccbdf146b6a74f9f92c7d45ac854 (patch)
tree7d28411ed398cc5f674c81bb07db2a9349a1a565 /sys/dev/firewire
parentcd123a19e2f2c5a66b638f15da6b1f558347bedc (diff)
downloadFreeBSD-src-980817bfc5b9ccbdf146b6a74f9f92c7d45ac854.zip
FreeBSD-src-980817bfc5b9ccbdf146b6a74f9f92c7d45ac854.tar.gz
Remove unused code.
Diffstat (limited to 'sys/dev/firewire')
-rw-r--r--sys/dev/firewire/fwdev.c102
1 files changed, 32 insertions, 70 deletions
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c
index 13168b6..9e4673e 100644
--- a/sys/dev/firewire/fwdev.c
+++ b/sys/dev/firewire/fwdev.c
@@ -282,8 +282,6 @@ fw_write (dev_t dev, struct uio *uio, int ioflag)
int sub = DEV2DMACH(dev);
int s, slept = 0;
struct fw_pkt *fp;
- struct fw_xfer *xfer;
- struct fw_xferq *xferq;
struct firewire_comm *fc;
struct fw_xferq *it;
@@ -293,82 +291,46 @@ fw_write (dev_t dev, struct uio *uio, int ioflag)
sc = devclass_get_softc(firewire_devclass, unit);
fc = sc->fc;
it = sc->fc->it[sub];
-
- xferq = NULL;
- /* Discard unsent buffered stream packet, when sending Asyrequrst */
- if(xferq != NULL && it->stproc != NULL){
- s = splfw();
- STAILQ_INSERT_TAIL(&it->stfree, it->stproc, link);
- splx(s);
- it->stproc = NULL;
- }
- if (xferq == NULL) {
isoloop:
- if (it->stproc == NULL) {
- it->stproc = STAILQ_FIRST(&it->stfree);
- if (it->stproc != NULL) {
- s = splfw();
- STAILQ_REMOVE_HEAD(&it->stfree, link);
- splx(s);
- it->queued = 0;
- } else if (slept == 0) {
- slept = 1;
- err = sc->fc->itx_enable(sc->fc, sub);
- if (err)
- return err;
- err = tsleep(it, FWPRI,
- "fw_write", hz);
- if (err)
- return err;
- goto isoloop;
- } else {
- err = EIO;
- return err;
- }
- }
- fp = (struct fw_pkt *)fwdma_v_addr(it->buf,
- it->stproc->poffset + it->queued);
- err = uiomove((caddr_t)fp, sizeof(struct fw_isohdr), uio);
- err = uiomove((caddr_t)fp->mode.stream.payload,
- fp->mode.stream.len, uio);
- it->queued ++;
- if (it->queued >= it->bnpacket) {
+ if (it->stproc == NULL) {
+ it->stproc = STAILQ_FIRST(&it->stfree);
+ if (it->stproc != NULL) {
s = splfw();
- STAILQ_INSERT_TAIL(&it->stvalid, it->stproc, link);
+ STAILQ_REMOVE_HEAD(&it->stfree, link);
splx(s);
- it->stproc = NULL;
+ it->queued = 0;
+ } else if (slept == 0) {
+ slept = 1;
err = sc->fc->itx_enable(sc->fc, sub);
- }
- if (uio->uio_resid >= sizeof(struct fw_isohdr)) {
- slept = 0;
+ if (err)
+ return err;
+ err = tsleep(it, FWPRI, "fw_write", hz);
+ if (err)
+ return err;
goto isoloop;
- }
- return err;
- }
- if (xferq != NULL) {
- xfer = fw_xfer_alloc_buf(M_FWXFER, uio->uio_resid, 12);
- if(xfer == NULL){
- err = ENOMEM;
- return err;
- }
- xfer->dst = fp->mode.hdr.dst;
- xfer->send.len = uio->uio_resid;
- xfer->spd = 0;/* XXX: how to setup it */
- xfer->act.hand = fw_asy_callback;
-
- err = uiomove(xfer->send.buf, uio->uio_resid, uio);
- if(err){
- fw_xfer_free( xfer);
+ } else {
+ err = EIO;
return err;
}
- fw_asyreq(fc, -1, xfer);
- err = tsleep(xfer, FWPRI, "fw_write", hz);
- if(xfer->resp == EBUSY)
- return EBUSY;
- fw_xfer_free( xfer);
- return err;
}
- return EINVAL;
+ fp = (struct fw_pkt *)fwdma_v_addr(it->buf,
+ it->stproc->poffset + it->queued);
+ err = uiomove((caddr_t)fp, sizeof(struct fw_isohdr), uio);
+ err = uiomove((caddr_t)fp->mode.stream.payload,
+ fp->mode.stream.len, uio);
+ it->queued ++;
+ if (it->queued >= it->bnpacket) {
+ s = splfw();
+ STAILQ_INSERT_TAIL(&it->stvalid, it->stproc, link);
+ splx(s);
+ it->stproc = NULL;
+ err = sc->fc->itx_enable(sc->fc, sub);
+ }
+ if (uio->uio_resid >= sizeof(struct fw_isohdr)) {
+ slept = 0;
+ goto isoloop;
+ }
+ return err;
}
/*
OpenPOWER on IntegriCloud