From owner-freebsd-hackers Mon Feb 16 13:19:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA00381 for freebsd-hackers-outgoing; Mon, 16 Feb 1998 13:19:12 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from Octopussy.MI.Uni-Koeln.DE (Octopussy.MI.Uni-Koeln.DE [134.95.166.20]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA00216; Mon, 16 Feb 1998 13:18:34 -0800 (PST) (envelope-from se@dialup124.zpr.uni-koeln.de) Received: from dialup124.zpr.Uni-Koeln.DE (dialup124.zpr.Uni-Koeln.DE [134.95.219.124]) by Octopussy.MI.Uni-Koeln.DE (8.8.7/8.8.7) with ESMTP id WAA05659; Mon, 16 Feb 1998 22:18:25 +0100 (MET) Received: (from se@localhost) by dialup124.zpr.Uni-Koeln.DE (8.8.8/8.6.9) id VAA00378; Mon, 16 Feb 1998 21:42:55 +0100 (CET) X-Face: " Date: Mon, 16 Feb 1998 21:42:55 +0100 From: Stefan Esser To: "Daniel O'Connor" , hackers@FreeBSD.ORG Cc: =?iso-8859-1?Q?Stefan_E=DFer?= Subject: Re: PCI LKM's? Mail-Followup-To: Daniel O'Connor , hackers@FreeBSD.ORG, =?iso-8859-1?Q?Stefan_E=DFer?= References: <199802130130.MAA09978@cain.gsoft.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89i In-Reply-To: <199802130130.MAA09978@cain.gsoft.com.au>; from Daniel O'Connor on Fri, Feb 13, 1998 at 12:00:24PM +1030 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 1998-02-13 12:00 +1030, Daniel O'Connor wrote: > Hi, > I am trying to convert a static PCI device driver to an LKM, but I can't fiure > out how to probe it.. If its an ISA device I run the probe routine with the > config info, but for a PCI device I don't know how to tell if it is inthe > machine or not after boot time. > > I tried looking in /usr/src/sys/pci/* for examples, but pcisupport.c was the > only thing with any LKM stuff and it didn't help :( > > Can anyone help me? > (I am running 2.2.5-STABLE) I added PCI LKM support to the PCI code more than one year ago, but never put it into the "official" 2.2.x repository. If you want patches, I can provide you with them, but if there is sufficient interest, I can also commit that code to -stable. The interface is very simple: int pci_register_lkm (struct pci_device *dvp, int if_revision) Call that function with the address of the pci_device struct (the XXX argument of the "DATA_SET(pcidevice_set, XXX);" for the compiled in driver case) and an interface revision value of 0, and everything else will be taken care of automagically. I added a support function to pciconf (or rather the underlying ioctl()), which reported whether a driver had been attached to a device. This allowed the loading of PCI LKMs from a script called from /etc/rc, controlled by the PCI vendor and device IDs. Regards, STefan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message