Re: length of iso packets
Brought to you by:
aeb,
bencollins
From: Andreas B. <and...@mu...> - 2000-04-14 01:40:24
|
On Tue, Apr 11, 2000 at 03:35:11PM +0200, Manfred Weihs wrote: > But sometimes I received packets where the length argument sayed that the > packet length was 332 wherea the iso header (ie. data[0] >> 16) sayed 584. > Since I know the size of my iso packets, I can tell you that (of course) > the iso header is right and the length argument reports an incorrect > length. The initial length comes from the hardware driver and is passed through to raw1394 (which uses it to allocate a buffer) and then on to user space and to the handler by libraw1394. It is not looked up from the actual header anywhere. > So two questions emerge: > 1) Why does the handler report an incorrect packet length? Good question. Apparantly because the PCILynx reports lower packet lengths in the DMA stat register. But why it does that I don't know. I just looked over my driver to see whether there are any bugs in that code, but basically the transfer count is just taken from the reg and passed on. > 2) Is the buffer (*data) filled correctly or are only the first 332 > bytes valid and the rest (256 Bytes) lost? raw1394 only uses the length from hardware driver to decide how much to save, so the rest is lost. Could you please apply the following patch to pcilynx.c directly (i.e. cd into drivers/ieee1394 directory and "patch pcilynx.c <patch") It will probably say that it moved the hunk because I have changed my pcilynx.c a bit but that's no problem. The patched file should log length mismatches with the register content, please send them to me. --- pcilynx.c~ Thu Apr 13 03:37:57 2000 +++ pcilynx.c Fri Apr 14 03:14:33 2000 @@ -1175,6 +1175,12 @@ data = lynx->iso_rcv.page[idx / ISORCV_PER_PAGE] + (idx % ISORCV_PER_PAGE) * MAX_ISORCV_SIZE; + if ((*data >> 16) + 4 != (lynx->iso_rcv.stat[idx] & 0x1fff)) { + PRINT(KERN_ERR, lynx->id, + "iso length mismatch 0x%08x/0x%08x", *data, + lynx->iso_rcv.stat[idx]); + } + if (lynx->iso_rcv.stat[idx] & (DMA_CHAN_STAT_PCIERR | DMA_CHAN_STAT_PKTERR)) { PRINT(KERN_INFO, lynx->id, -- Andreas E. Bombe <and...@mu...> DSA key 0x04880A44 http://home.pages.de/~andreas.bombe/ http://linux1394.sourceforge.net/ |