Thread: [Linux1394-cvslog] rev 745 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dm...@li...> - 2003-02-01 13:59:56
|
Author: dmaas Date: 2003-01-15 01:34:29 -0500 (Wed, 15 Jan 2003) New Revision: 745 Modified: trunk/iso.c trunk/iso.h trunk/ohci1394.c trunk/raw1394.c trunk/raw1394.h Log: rawiso - implement tag matching; disable cycle continuity checking Modified: trunk/iso.h ============================================================================== --- trunk/iso.h (original) +++ trunk/iso.h 2003-02-01 08:59:22.000000000 -0500 @@ -140,7 +140,7 @@ /* start/stop DMA */ int hpsb_iso_xmit_start(struct hpsb_iso *iso, int start_on_cycle, int prebuffer); -int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle); +int hpsb_iso_recv_start(struct hpsb_iso *iso, int start_on_cycle, int tag_mask, int sync); void hpsb_iso_stop(struct hpsb_iso *iso); /* deallocate buffer and DMA context */ Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2003-02-01 08:59:23.000000000 -0500 @@ -1058,9 +1058,6 @@ /* bytes of buffer the reader has released, less than one block */ int released_bytes; - /* cycle of last-received packet; used to detecting dropouts */ - int last_cycle; - /* the following four fields are used exclusively by the interrupt (no locking is required) */ @@ -1089,7 +1086,7 @@ static void ohci_iso_recv_stop(struct hpsb_iso *iso); static void ohci_iso_recv_shutdown(struct hpsb_iso *iso); static void ohci_iso_recv_program(struct hpsb_iso *iso); -static int ohci_iso_recv_start(struct hpsb_iso *iso, int cycle); +static int ohci_iso_recv_start(struct hpsb_iso *iso, int cycle, int tag_mask); static int ohci_iso_recv_init(struct hpsb_iso *iso) @@ -1133,7 +1130,6 @@ recv->block_reader = 0; recv->released_bytes = 0; - recv->last_cycle = -1; recv->block_dma = 0; recv->dma_offset = recv->block_dma * PAGE_SIZE; @@ -1311,21 +1307,19 @@ reg_read(recv->ohci, OHCI1394_IsochronousCycleTimer); } -static int ohci_iso_recv_start(struct hpsb_iso *iso, int cycle) +static int ohci_iso_recv_start(struct hpsb_iso *iso, int cycle, int tag_mask) { struct ohci_iso_recv *recv = iso->hostdata; u32 command, contextMatch; - recv->last_cycle = -1; - reg_write(recv->ohci, recv->ContextControlClear, 0xFFFFFFFF); wmb(); /* use buffer-fill mode, and keep ISO headers (required for multichannel) */ reg_write(recv->ohci, recv->ContextControlSet, (1 << 31) | (1 << 30)); - /* match on all tags */ - contextMatch = 0xF0000000; + /* match on specified tags */ + contextMatch = tag_mask << 28; if(iso->channel == -1) { /* enable multichannel reception */ @@ -1577,19 +1571,6 @@ cycle = p[recv->dma_offset+0] | (p[recv->dma_offset+1]<<8); cycle &= 0x1FFF; - /* check for cycle discontinuity */ - if(recv->last_cycle != -1) { - /* for multichannel, we have to allow cycle == last_cycle */ - if((cycle != (recv->last_cycle+1) % 8000) && - (cycle != recv->last_cycle)) { - atomic_inc(&iso->overflows); - DBGMSG(recv->ohci->id, "ISO reception overflow - " - "cycle discontinuity detected (cycle %4u last %4d)", - cycle, recv->last_cycle); - } - } - recv->last_cycle = cycle; - /* advance to next packet */ recv->dma_offset += 4; @@ -1718,7 +1699,6 @@ struct ohci1394_iso_tasklet task; int task_active; int pkt_dma; - int last_cycle; u32 ContextControlSet; u32 ContextControlClear; @@ -1756,7 +1736,6 @@ xmit->ohci = iso->host->hostdata; xmit->task_active = 0; xmit->pkt_dma = iso->first_packet; - xmit->last_cycle = -1; dma_prog_region_init(&xmit->prog); @@ -1854,12 +1833,6 @@ { unsigned int cycle = cmd->output_last.status & 0x1FFF; - /* check for discontinuity */ - if(xmit->last_cycle != -1 && cycle != (xmit->last_cycle+1) % 8000) { - atomic_inc(&iso->overflows); - } - xmit->last_cycle = cycle; - /* predict the timestamp of the next packet to be queued */ /* jump ahead by the number of packets that are already buffered */ @@ -2018,8 +1991,6 @@ { struct ohci_iso_xmit *xmit = iso->hostdata; - xmit->last_cycle = -1; - /* clear out the control register */ reg_write(xmit->ohci, xmit->ContextControlClear, 0xFFFFFFFF); wmb(); @@ -2042,11 +2013,6 @@ start |= (seconds & 3) << 13; reg_write(xmit->ohci, xmit->ContextControlSet, 0x80000000 | (start << 16)); - - if(cycle == 0) - xmit->last_cycle = 7999; - else - xmit->last_cycle = cycle - 1; } /* enable interrupts */ @@ -2088,8 +2054,10 @@ case RECV_INIT: return ohci_iso_recv_init(iso); - case RECV_START: - return ohci_iso_recv_start(iso, arg < 8000 ? arg : -1); + case RECV_START: { + int *args = (int*) arg; + return ohci_iso_recv_start(iso, args[0], args[1]); + } case RECV_STOP: ohci_iso_recv_stop(iso); return 0; Modified: trunk/raw1394.c ============================================================================== --- trunk/raw1394.c (original) +++ trunk/raw1394.c 2003-02-01 08:59:24.000000000 -0500 @@ -2242,8 +2242,13 @@ break; case RAW1394_ISO_RECV: switch(cmd) { - case RAW1394_ISO_RECV_START: - return hpsb_iso_recv_start(fi->iso_handle, arg); + case RAW1394_ISO_RECV_START: { + /* copy args from user-space */ + int args[3]; + if(copy_from_user(&args[0], (void*) arg, sizeof(args))) + return -EFAULT; + return hpsb_iso_recv_start(fi->iso_handle, args[0], args[1], args[2]); + } case RAW1394_ISO_STOP: hpsb_iso_stop(fi->iso_handle); return 0; Modified: trunk/raw1394.h ============================================================================== --- trunk/raw1394.h (original) +++ trunk/raw1394.h 2003-02-01 08:59:24.000000000 -0500 @@ -120,7 +120,7 @@ /* ioctls */ #define RAW1394_ISO_XMIT_INIT 1 /* arg: raw1394_iso_status* */ #define RAW1394_ISO_RECV_INIT 2 /* arg: raw1394_iso_status* */ -#define RAW1394_ISO_RECV_START 3 /* arg: int, starting cycle */ +#define RAW1394_ISO_RECV_START 3 /* arg: int[3], { starting cycle, tag, sync } */ #define RAW1394_ISO_XMIT_START 8 /* arg: int[2], { starting cycle, prebuffer } */ #define RAW1394_ISO_STOP 4 #define RAW1394_ISO_GET_STATUS 5 /* arg: raw1394_iso_status* */ Modified: trunk/iso.c ============================================================================== --- trunk/iso.c (original) +++ trunk/iso.c 2003-02-01 08:59:24.000000000 -0500 @@ -238,9 +238,10 @@ return 0; } -int hpsb_iso_recv_start(struct hpsb_iso *iso, int cycle) +int hpsb_iso_recv_start(struct hpsb_iso *iso, int cycle, int tag_mask, int sync) { int retval = 0; + int isoctl_args[3]; if(iso->type != HPSB_ISO_RECV) return -1; @@ -248,7 +249,21 @@ if(iso->flags & HPSB_ISO_DRIVER_STARTED) return 0; - retval = iso->host->driver->isoctl(iso, RECV_START, cycle); + if(cycle < -1) + cycle = -1; + else if(cycle >= 8000) + cycle %= 8000; + + isoctl_args[0] = cycle; + + if(tag_mask < 0) + /* match all tags */ + tag_mask = 0xF; + isoctl_args[1] = tag_mask; + + isoctl_args[2] = sync; + + retval = iso->host->driver->isoctl(iso, RECV_START, (unsigned long) &isoctl_args[0]); if(retval) return retval; |