From owner-freebsd-current@FreeBSD.ORG Fri Apr 8 18:58:15 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 50C1916A4CE for ; Fri, 8 Apr 2005 18:58:15 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9D6843D2D for ; Fri, 8 Apr 2005 18:58:14 +0000 (GMT) (envelope-from julian@elischer.org) Received: from [208.206.78.97] (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 6CD977A403 for ; Fri, 8 Apr 2005 11:58:14 -0700 (PDT) Message-ID: <4256D446.4090009@elischer.org> Date: Fri, 08 Apr 2005 11:58:14 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050218 X-Accept-Language: en, hu MIME-Version: 1.0 To: FreeBSD Current Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: odd bus_dma_tag_create(...maxsegsize..) . question for some devices.. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2005 18:58:15 -0000 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