From owner-freebsd-current@FreeBSD.ORG Tue Mar 9 10:25:37 2004 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 E6F8E16A4D2 for ; Tue, 9 Mar 2004 10:25:37 -0800 (PST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id C38ED43D1F for ; Tue, 9 Mar 2004 10:25:37 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 30401 invoked from network); 9 Mar 2004 18:25:37 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 9 Mar 2004 18:25:37 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i29IPQ2B024574; Tue, 9 Mar 2004 13:25:33 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Yevgen Muntyan Date: Tue, 9 Mar 2004 13:25:34 -0500 User-Agent: KMail/1.6 References: <200402291903.20499.muntyan@tamu.edu> <200403081546.23492.jhb@FreeBSD.org> <200403081743.57194.muntyan@tamu.edu> In-Reply-To: <200403081743.57194.muntyan@tamu.edu> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403091325.34299.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: freebsd-current@FreeBSD.org Subject: Re: Can't assign irq for integrated wireless NIC 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: Tue, 09 Mar 2004 18:25:38 -0000 On Monday 08 March 2004 06:43 pm, Yevgen Muntyan wrote: > On Monday 08 March 2004 14:46, John Baldwin wrote: > > Please try this patch and let me know if it works: > > Hello, > It really works!!! Though there are some problems: > > 1) if you do not load ndis and if_ndis modules on startup, then it's > impossible to use them after that: I do > > kldload ndis > kldload if_ndis > > and it says the following (see attached "dmesg.bootwithoutmodules"): > > ndis0: mem 0xd0002000-0xd0003fff at > device 9. 0 on pci0 > pcib0: matched entry for 0.9.INTA (source \\_SB_.PCI0.ISA_.LNK3) > pcib0: slot 9 INTA is routed to irq 10 > ndis0: NDIS API version: 5.0 > ndis0: NDIS ERROR: c000138d (unknown error) > ndis0: NDIS NUMERRORS: 1 > ndis0: argptr: 0xa > ndis0: init handler failed > device_probe_and_attach: ndis0 attach returned 6 > > 2) If you load ndis and if_ndis on startup (I did it from boot loader), > then device ndis0 is not present (at least in ifconfig output) after system > starts, but after kldunload-kldload it appears and it works!! See attached > "dmesg.bootwithmodules". Ok, Bill Paul found a bug in my patch. Try this one instead (just adds one more line): Index: if_ndis_pci.c =================================================================== RCS file: /usr/cvs/src/sys/dev/if_ndis/if_ndis_pci.c,v retrieving revision 1.1 diff -u -r1.1 if_ndis_pci.c --- if_ndis_pci.c 7 Mar 2004 02:49:06 -0000 1.1 +++ if_ndis_pci.c 9 Mar 2004 18:24:00 -0000 @@ -263,6 +263,21 @@ } /* + * Allocate an IRQ if we don't already have one. + */ + if (sc->ndis_irq == NULL) { + rid = 0; + sc->ndis_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, + RF_SHAREABLE | RF_ACTIVE); + if (sc->ndis_irq == NULL) { + device_printf(dev, "couldn't route interrupt\n"); + error = ENXIO; + goto fail; + } + sc->ndis_rescnt++; + } + + /* * Allocate the parent bus DMA tag appropriate for PCI. */ #define NDIS_NSEG_NEW 32 -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org