diff options
author | simokawa <simokawa@FreeBSD.org> | 2003-01-13 16:08:09 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2003-01-13 16:08:09 +0000 |
commit | 7ad0cf189ae80ea91ca6497e3d6d932619cbb5f1 (patch) | |
tree | cfa247dfc0cad9df16c7c9d82e6c53079d3291b2 /sys/dev/firewire/fwdev.c | |
parent | 6aefd6f5662158f1fa439019ea102f75ed6b2415 (diff) | |
download | FreeBSD-src-7ad0cf189ae80ea91ca6497e3d6d932619cbb5f1.zip FreeBSD-src-7ad0cf189ae80ea91ca6497e3d6d932619cbb5f1.tar.gz |
Minimal fix for DV part.
- Don't panic on contigmalloc failure.
- Calculate timestamp by feedforward rather than feedback which depends on
unreliable interrupt timing.
- Overwrite timestamp in CIP header correctly.
- Add debug code for timestamp synchronization.
- Add comments.
Diffstat (limited to 'sys/dev/firewire/fwdev.c')
-rw-r--r-- | sys/dev/firewire/fwdev.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c index c6e7c58..d0f6371 100644 --- a/sys/dev/firewire/fwdev.c +++ b/sys/dev/firewire/fwdev.c @@ -383,8 +383,10 @@ isoloop: return err; } } +#if 0 /* What's this for? (overwritten by the following uiomove)*/ fp = (struct fw_pkt *)(it->stproc->buf + it->queued * it->psize); fp->mode.stream.len = htons(uio->uio_resid - sizeof(u_int32_t)); +#endif err = uiomove(it->stproc->buf + it->queued * it->psize, uio->uio_resid, uio); it->queued ++; @@ -422,8 +424,10 @@ dvloop: return err; } } +#if 0 /* What's this for? (it->dvptr? overwritten by the following uiomove)*/ fp = (struct fw_pkt *)(it->dvproc->buf + it->queued * it->psize); fp->mode.stream.len = htons(uio->uio_resid - sizeof(u_int32_t)); +#endif err = uiomove(it->dvproc->buf + it->dvptr, uio->uio_resid, uio); it->dvptr += it->psize; @@ -564,7 +568,7 @@ fw_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td) err = ENOMEM; break; } -#define FWDVPACKET 250 +#define FWDVPACKET 250 /* NTSC (300 for PAL) */ #define FWDVPMAX 512 ibufreq->rx.nchunk = 8; ibufreq->rx.npacket = 50; @@ -582,11 +586,13 @@ fw_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td) sc->fc->it[sub]->dvproc = NULL; sc->fc->it[sub]->dvdma = NULL; sc->fc->it[sub]->flag |= FWXFERQ_DV; + /* XXX check malloc failure */ sc->fc->it[sub]->dvbuf = (struct fw_dvbuf *)malloc(sizeof(struct fw_dvbuf) * NDVCHUNK, M_DEVBUF, M_DONTWAIT); STAILQ_INIT(&sc->fc->it[sub]->dvvalid); STAILQ_INIT(&sc->fc->it[sub]->dvfree); for( i = 0 ; i < NDVCHUNK ; i++){ + /* XXX check malloc failure */ sc->fc->it[sub]->dvbuf[i].buf = malloc(FWDVPMAX * sc->fc->it[sub]->dvpacket, M_DEVBUF, M_DONTWAIT); STAILQ_INSERT_TAIL(&sc->fc->it[sub]->dvfree, @@ -663,6 +669,7 @@ fw_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td) it->dvdbc = 0; it->dvdiff = 0; it->dvsync = 0; + it->dvoffset = 0; STAILQ_INIT(&ir->stvalid); STAILQ_INIT(&ir->stfree); |