Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Mar 1998 13:24:18 +0100
From:      Stefan Esser <se@FreeBSD.ORG>
To:        jkh@FreeBSD.ORG, dg@FreeBSD.ORG
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   PCI LKM support added to -stable
Message-ID:  <19980307132418.34637@mi.uni-koeln.de>

next in thread | raw e-mail | index | archive | help
Hi!

I finally managed to build and boot a -stable test kernel on my -current
system. There was a mismatch between a header file in /sys/pci and some
use of a structure defined therein from /sys/i386/isa/pcibus.c, which 
had caused interrupt registration to fail with the version I had sent
out as a beta of this code before.


In order to automatically load PCI LKMs at system startup, I suggest 
to make the following changes to the startup scripts:

1) Modify /etc/rc to source /etc/rc.lkm, if present

2) Add /etc/rc.lkm, which is a NOP unless /lkm/pci/lkm.map exists

3) Create an empty /lkm/pci (-> mtree)

4) Add a sample lkm.map file, which explains that the format is to
   have a PCI device/vendor ID in hex in the first column, and the
   LKM name (without the trailing .o) as the second.


Is anybody opposed to these changes ?
Are there any further suggestions ?

I plan to commit these changes tomorrow!

Regards, STefan




The following patches should be applied in /etc:

*** /dev/null	Sat Mar  7 03:49:58 1998
--- rc.lkm	Sat Mar  7 03:52:47 1998
***************
*** 0 ****
--- 1,23 ----
+ #!/bin/sh
+ #
+ # Expected format of /lkm/pci/lkm.map:
+ #
+ # 0x0350109E brkt	BrookTree 848
+ # 0x802910ec if_ed	RealTek 8029 NE2000 compatible Ethernet
+ #
+ 
+ if [ -r /lkm/pci/lkm.map ]
+ then
+     for dev in `pciconf -l |cut -f1`
+     do
+ 	if pciconf -a $dev | grep -q "not attached"
+ 	then
+ 	    DevVendorID=`pciconf -r $dev 0`
+ 	    LKM=`sed -e 's/#.*//' /lkm/pci/lkm.map | \
+ 					grep $DevVendorID | cut -f 2`
+ 	    LKMfile=/lkm/pci/$LKM.o
+ 	    echo "$dev Loading $LKMfile for DevVendorID $DevVendorID"
+ 	    modload $LKMfile
+     fi
+     done
+ fi
Index: rc
===================================================================
RCS file: /home/ncvs/src/etc/rc,v
retrieving revision 1.104.2.33
diff -C2 -r1.104.2.33 rc
*** rc	1998/02/15 14:24:47	1.104.2.33
--- rc	1998/03/07 11:45:40
***************
*** 112,115 ****
--- 112,120 ----
  fi
  
+ # load PCI LKM drivers
+ if [ -f /etc/rc.lkm ]; then
+ 	. /etc/rc.lkm
+ fi
+ 
  # start up PC-card configuration
  if [ -f /etc/rc.pccard ]; then



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



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