From owner-freebsd-hardware@FreeBSD.ORG Wed May 19 05:40:55 2004 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E52AF16A4CE for ; Wed, 19 May 2004 05:40:55 -0700 (PDT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEA9B43D31 for ; Wed, 19 May 2004 05:40:55 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 23230 invoked from network); 19 May 2004 12:40:42 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 19 May 2004 12:40:42 -0000 Received: from slimer.baldwin.cx (slimer.baldwin.cx [192.168.0.16]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i4JCea2b061576; Wed, 19 May 2004 08:40:39 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-hardware@FreeBSD.org Date: Wed, 19 May 2004 08:28:11 -0400 User-Agent: KMail/1.6 References: <40AA4D80.6000607@dreamchaser.org> In-Reply-To: <40AA4D80.6000607@dreamchaser.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405190828.11057.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Gary Aitken Subject: Re: resource recognition / allocation in drivers X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2004 12:40:56 -0000 On Tuesday 18 May 2004 01:53 pm, Gary Aitken wrote: > I've been beating my head against the wall trying to get my fbsd 4.5 to > use dec 21041 pci Ethernet cards (de device, pci/if_de.c driver). Not > being a kernel debugging guru, it's been slow. > > Turns out when pci_alloc_resource issues a call to resource_list_alloc > (kern/subr_bus.c), it calls resource_list_find, which fails (returns > null). The call is for a type of 04 (SYS_RES_IOPORT) and an rid of 0x10 > (PCI_CBIO). Instead of adding the resource when it is not found in the > list, the call fails and the device is effectively disabled. > Interestingly, this has the side effect (somehow) of preventing at least > one other network driver from working in my case, although ifconfig > shows them functioning. Not sure why this is so; removing the card > allows the other cards to function properly. > > My question is, what is the design philosophy regarding calls to > resource_list_find from resource_list_alloc? When should > resource_list_add be called? Should it have been called at some prior > point to set up all the resources a driver will be using? Is there a > particular driver I can look at to see how things *should* be coded? > > I know the cards work, and have worked under freebsd. I had one working > with an eth0 serial device installed for a leased line. That device > came out when I switched to dsl. I suspect that the eth0 driver somehow > added the resources to the list properly, so that when the de driver > went to allocate some more for itself, the find actually found something. > > Any help much appreciated. FreeBSD 4.5 doesn't allocate resources for a BAR that doesn't have its resources allocated by the BIOS. Try turning PnP OS off if you have it on to force the BIOS to allocate resources for all BARs. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org