Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Apr 2005 11:58:14 -0700
From:      Julian Elischer <julian@elischer.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   odd bus_dma_tag_create(...maxsegsize..) . question for some devices..
Message-ID:  <4256D446.4090009@elischer.org>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4256D446.4090009>