odd bus_dma_tag_create(...maxsegsize..) . question for some devices..

From: Julian Elischer <julian_at_elischer.org>
Date: Fri, 08 Apr 2005 11:58:14 -0700
The man page specifies: for the maxsegsz parameter:
--------
    maxsegsz    
              Maximum size, in bytes, of a segment in any DMA
    mapped region associated with dmat.
----------
some devices seem to use the highest address in the buffer here...
it seems wrong..

anyone know if these devices need this, or their maxsegsiz and maxsize
values should be 1 greater?

Most devices use BUS_SPACE_MAXSIZE_24BIT or BUS_SPACE_MAXSIZE_32BIT
which are defined as odd values (not even) as well (see below, at end).
Probably this is where the misunderstanding came from.


the (bad?) examples

an/if_an_pci.c-                        0x3ffff,                 /* 
maxsize XXX */
an/if_an_pci.c-                        1,                       /* 
nsegments */
an/if_an_pci.c-                        0xffff,                  /* 
maxsegsize XXX */

I'm guessing this should be  0x10000 and 0x 10000 (nsegs = 1).


./sound/usb/uaudio_pcm.c-                               /*maxsize*/      
bufsz,
./sound/usb/uaudio_pcm.c-                               /*nsegments*/ 1,
./sound/usb/uaudio_pcm.c-                               /*maxsegz*/     
0x3fff,


I'm guessing these should be 0x1000 , 4, 0x4000 (depending possibly on 
the USB adapter used.)


./ubsec/ubsec.c-                               0x3ffff,                 
/* maxsize */
./ubsec/ubsec.c-                               UBS_MAX_SCATTER,         
/* nsegments */
./ubsec/ubsec.c-                               0xffff,                  
/* maxsegsize */

I think this should be:
0x40000, UBS_MAX_SCATTER, 0x10000

but I dont know the hardware.


i386/include/bus_at386.h:#define BUS_SPACE_MAXSIZE_24BIT     0xFFFFFF
i386/include/bus_pc98.h:#define BUS_SPACE_MAXSIZE_24BIT      0xFFFFFF
i386/include/bus_at386.h:#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF
i386/include/bus_pc98.h:#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF
Received on Fri Apr 08 2005 - 16:58:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:31 UTC