From owner-freebsd-atm@FreeBSD.ORG Thu Oct 30 12:58:40 2003 Return-Path: Delivered-To: freebsd-atm@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D5DF16A4CE for ; Thu, 30 Oct 2003 12:58:40 -0800 (PST) Received: from venus.vincentjardin.net (AVelizy-102-1-6-135.w193-253.abo.wanadoo.fr [193.253.220.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADFFD43FDF for ; Thu, 30 Oct 2003 12:58:38 -0800 (PST) (envelope-from jardin@venus.vincentjardin.net) Received: from venus.vincentjardin.net (localhost [127.0.0.1]) h9UMxxZQ003226 for ; Fri, 31 Oct 2003 00:00:00 +0100 (CET) (envelope-from jardin@venus.vincentjardin.net) Received: from localhost (localhost [[UNIX: localhost]]) by venus.vincentjardin.net (8.12.9/8.12.9/Submit) id h9UMxxJD003225 for freebsd-atm@freebsd.org; Thu, 30 Oct 2003 23:59:59 +0100 (CET) From: Vincent Jardin To: freebsd-atm@freebsd.org Date: Thu, 30 Oct 2003 23:59:59 +0100 User-Agent: KMail/1.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200310302359.59272.vjardin@free.fr> Subject: if_hatm, bus_dma_tag_create X-BeenThere: freebsd-atm@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ATM for FreeBSD! List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2003 20:58:40 -0000 Hi, if_hatm sets lowaddr to BUS_SPACE_MAXADDR_32BIT when it calls bus_dma_tag_create(). It means that bus_dmamap_create() returns mapp = NULL, doesn'it ? Then, why is lowaddr so high ;-( ? Regards, Vincent PS: /* * Allocate a handle for mapping from kva/uva/physical * address space into bus device space. */ int bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) { int error; error = 0; if (dmat->segments == NULL) { dmat->segments = (bus_dma_segment_t *)malloc( sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, M_NOWAIT); if (dmat->segments == NULL) return (ENOMEM); } if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem)) { /* Must bounce */ int maxpages; ... From owner-freebsd-atm@FreeBSD.ORG Fri Oct 31 01:43:29 2003 Return-Path: Delivered-To: freebsd-atm@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F8EA16A4CE for ; Fri, 31 Oct 2003 01:43:29 -0800 (PST) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3063143FD7 for ; Fri, 31 Oct 2003 01:43:28 -0800 (PST) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h9V9hK101611; Fri, 31 Oct 2003 10:43:20 +0100 (MET) Date: Fri, 31 Oct 2003 10:43:20 +0100 (CET) From: Harti Brandt To: Vincent Jardin In-Reply-To: <200310302359.59272.vjardin@free.fr> Message-ID: <20031031103750.T74490@beagle.fokus.fraunhofer.de> References: <200310302359.59272.vjardin@free.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-atm@freebsd.org Subject: Re: if_hatm, bus_dma_tag_create X-BeenThere: freebsd-atm@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ATM for FreeBSD! List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2003 09:43:29 -0000 On Thu, 30 Oct 2003, Vincent Jardin wrote: VJ>Hi, VJ> VJ>if_hatm sets lowaddr to BUS_SPACE_MAXADDR_32BIT when it calls VJ>bus_dma_tag_create(). VJ> VJ>It means that bus_dmamap_create() returns mapp = NULL, doesn'it ? VJ> VJ>Then, why is lowaddr so high ;-( ? lowaddr is the lower address of the range that the card can NOT access. The HE's have only 32 bit addresses so they can access only the lower 4GByte of the address space on machines with more than 32 bit on the bus. This has nothing to to with mapp beeing NULL. This is NULL on i386 because the i386 has no iommu so the card uses physical memory addresse. There is nothing to map. On sparc64 mapp is not NULL. VJ>PS: VJ> VJ>/* VJ> * Allocate a handle for mapping from kva/uva/physical VJ> * address space into bus device space. VJ> */ VJ>int VJ>bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) VJ>{ VJ> int error; VJ> VJ> error = 0; VJ> VJ> if (dmat->segments == NULL) { VJ> dmat->segments = (bus_dma_segment_t *)malloc( VJ> sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF, VJ> M_NOWAIT); VJ> if (dmat->segments == NULL) VJ> return (ENOMEM); VJ> } VJ> VJ> if (dmat->lowaddr < ptoa((vm_paddr_t)Maxmem)) { VJ> /* Must bounce */ VJ> int maxpages; VJ>... That means, that the system will allocate bounce pages if there is more than 4GB of memory. In that case a buffer may be above the limit and then it must be copied to/from the bounce buffer which is guaranteed to be below 4GB. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org