Thread: [Linux1394-cvslog] rev 663 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <dm...@li...> - 2002-11-07 02:20:14
|
Author: dmaas Date: 2002-11-06 21:20:11 -0500 (Wed, 06 Nov 2002) New Revision: 663 Modified: trunk/ohci1394.c Log: rawiso/ohci1394 - implement cycle matching on iso receive Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2002-11-06 21:20:12.000000000 -0500 @@ -1156,20 +1156,39 @@ static int ohci_iso_recv_start(struct hpsb_iso *iso, int cycle) { struct ohci_iso_recv *recv = iso->hostdata; - u32 command; + u32 command, contextMatch; reg_write(recv->ohci, recv->ContextControlClear, 0xFFFFFFFF); wmb(); /* use packet-per-buffer mode, and keep ISO headers */ reg_write(recv->ohci, recv->ContextControlSet, (1 << 30)); - - /* match on all tags, listen on channel */ - reg_write(recv->ohci, recv->ContextMatch, 0xF0000000 | iso->channel); + /* match on all tags, listen on channel */ + contextMatch = 0xF0000000 | iso->channel; + if(cycle != -1) { - /* XXX DJM use cycleMatch */ + u32 seconds; + + /* enable cycleMatch */ + reg_write(recv->ohci, recv->ContextControlSet, (1 << 29)); + + /* set starting cycle */ + cycle &= 0x1FFF; + + /* 'cycle' is only mod 8000, but we also need two 'seconds' bits - + just snarf them from the current time */ + seconds = reg_read(recv->ohci, OHCI1394_IsochronousCycleTimer) >> 25; + + /* advance one second to give some extra time for DMA to start */ + seconds += 1; + + cycle |= (seconds & 3) << 13; + + contextMatch |= cycle << 12; } + + reg_write(recv->ohci, recv->ContextMatch, contextMatch); /* address of first descriptor block */ command = dma_prog_region_offset_to_bus(&recv->prog, recv->pkt_dma * sizeof(struct dma_cmd)); |