Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jan 1996 02:36:50 +0100
From:      se@zpr.uni-koeln.de (Stefan Esser)
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        hackers@freebsd.org
Subject:   Re: How to modify a driver for PCI card ?
Message-ID:  <199601250136.AA22198@Sysiphos>
In-Reply-To: Luigi Rizzo <luigi@labinfo.iet.unipi.it> "How to modify a driver for PCI card ?" (Jan 24, 21:07)

next in thread | previous in thread | raw e-mail | index | archive | help
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			  <se@ZPR.Uni-Koeln.DE>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601250136.AA22198>