From owner-freebsd-hackers Wed Jan 24 17:37:00 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA09874 for hackers-outgoing; Wed, 24 Jan 1996 17:37:00 -0800 (PST) Received: from Sysiphos (Sysiphos.MI.Uni-Koeln.DE [134.95.212.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA09869 for ; Wed, 24 Jan 1996 17:36:56 -0800 (PST) Received: by Sysiphos id AA22198 (5.67b/IDA-1.5 for hackers@FreeBSD.org); Thu, 25 Jan 1996 02:36:50 +0100 Message-Id: <199601250136.AA22198@Sysiphos> From: se@zpr.uni-koeln.de (Stefan Esser) Date: Thu, 25 Jan 1996 02:36:50 +0100 In-Reply-To: Luigi Rizzo "How to modify a driver for PCI card ?" (Jan 24, 21:07) X-Mailer: Mail User's Shell (7.2.6 alpha(2) 7/9/95) To: Luigi Rizzo Subject: Re: How to modify a driver for PCI card ? Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org Precedence: bulk On Jan 24, 21:07, Luigi Rizzo wrote: } Subject: How to modify a driver for PCI card ? } Hi, } } I have a PCI Ethernet card which is an NE2000 clone. I am currently } using it with the "ed" driver, and it works very nicely: } } Jan 23 15:15:26 prova /kernel: ed0 at 0xff40-0xff5f irq 10 on isa } Jan 23 15:15:27 prova /kernel: ed0: address 00:20:18:28:06:d7, type NE2000 (16 bit) } } The card is very cheap (about US$60 including 19% VAT), and I don't } think it has the same performance problems (CPU overhead) of NE2000 } cards on the ISA bus. The only problem, maybe just a cosmetic one, } is that after probing all the devices, the kernel says the following: } } Jan 23 15:15:33 prova /kernel: pci0:15: vendor=0x10ec, device=0x8029, class=network (ethernet) [no driver assigned] } } Would it be hard to modify the "ed" driver to take care of this, } and correctly recognize the PCI card ? I am quite confused on what } would be necessary, and if it would break anything. No, it would be a good idea to include the card as a supported PCI device ... You may have a look at how the bt driver deals with this issue: /sys/pci/bt9xx.c. All you need is a wrapper, that recognizes the vendor and device IDs, and call the ISA if_ed attach code with the port address and irq read from PCI configuration space registers. This has to be done for quite a number of other PCI cards, that emulate common ISA controllers. (E.g. for the Lance Ethernet driver if_lnc.c.) I'd do it, if I only had the time ... :( Regards, STefan -- Stefan Esser, Zentrum fuer Paralleles Rechnen Tel: +49 221 4706021 Universitaet zu Koeln, Weyertal 80, 50931 Koeln FAX: +49 221 4705160 ============================================================================== http://www.zpr.uni-koeln.de/~se