From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Date: Wed, 05 Nov 2003 21:43:47 +0000 Subject: pci coldplug Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Hello, what is the purpose of pci_boot_events() in pci.rc? I mean, how can that ever work in the current cvs? I did it that way and it appears to work ok for a 2.4 kernel (probably also for 2.6): pci_boot_events () { if [ ! -x /sbin/lspci -o ! -f /proc/bus/pci/devices -o ! -x pci.agent ]= ; then echo $"** can't synthesize pci hotplug events" return fi # these notifications will be handled by pcimodules /sbin/lspci -nm | sed 's/"//g' | while read pci_data ; do set - $pci_data : pci_slot=3D$1 : pci_class=3D$3 : pci_vendor=3D$4 : pci_device=3D$5 : pci_revision=3D$6 : pci_svendor=3D$7 : pci_sdevice=3D$8 # make sure the pci agent will run ACTION=ADd PCI_CLASS=3D$3 PCI_ID=3D$4:$5 PCI_SLOT=3D$1 if [ "$pci_svendor" =3D "" ] ; then PCI_SUBSYS_ID=3D0:0 else PCI_SUBSYS_ID=3D$7:$8 fi export ACTION PCI_CLASS PCI_ID PCI_SLOT PCI_SUBSYS_ID echo ACTION=3D$ACTION PCI_CLASS=3D$PCI_CLASS PCI_ID=3D$PCI_ID PCI_S= LOT=3D$PCI_SLOT PCI_SUBSYS_ID=3D$PCI_SUBSYS_ID /sbin/hotplug-beta pci env -i - ACTION=3D$ACTION PCI_CLASS=3D$PCI_CLASS PCI_ID=3D$PCI_ID P= CI_SLOT=3D$PCI_SLOT PCI_SUBSYS_ID=3D$PCI_SUBSYS_ID /sbin/hotplug-beta pci done } I ran into one problem with ohci1394 and I cant find an answer: an OHCI controller has PCI class 0x0c00. The modules.pcimap entry is generated via this define in ohci1394.c: #define PCI_CLASS_FIREWIRE_OHCI ((PCI_CLASS_SERIAL_FIREWIRE << 8) | 0x10) Why is there a '| 0x10'? How can this line of code in pci.agent ever match? if [ $class_temp -eq $class ]; then $class comes from the modules.pcimap, pci_class from the hotplug event. I have looked for the kernel event env variable $PCI_CLASS. This is a %04X in run_sbin_hotplug() in drivers/pci/pci.c, the comment in %pci.agent states it is a %06X (which would make sense, but where is the lowbyte filled?) Maybe I got that all wrong, I cant see how the current code is supposed to load drivers at boot time. 2.4 does somehow work with the pcimodules binary which is shipped by some distros, but this doesnt work at all for 2.6. What is supposed to happen in pci.rc? --=20 USB is for mice, FireWire is for men! sUse lINUX ag, n=C3=9CRNBERG ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel