linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pci coldplug
@ 2003-11-05 21:43 Olaf Hering
  2003-11-05 23:19 ` Olaf Hering
  2003-11-11 20:23 ` Olaf Hering
  0 siblings, 2 replies; 3+ messages in thread
From: Olaf Hering @ 2003-11-05 21:43 UTC (permalink / raw)
  To: linux-hotplug

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=$1
        : pci_class=$3
        : pci_vendor=$4
        : pci_device=$5
        : pci_revision=$6
        : pci_svendor=$7
        : pci_sdevice=$8
# make sure the pci agent will run
        ACTION­d
        PCI_CLASS=$3
        PCI_ID=$4:$5
        PCI_SLOT=$1
        if [ "$pci_svendor" = "" ] ; then
                PCI_SUBSYS_ID=0:0
        else
                PCI_SUBSYS_ID=$7:$8
        fi
        export ACTION PCI_CLASS PCI_ID PCI_SLOT PCI_SUBSYS_ID
        echo ACTION=$ACTION PCI_CLASS=$PCI_CLASS PCI_ID=$PCI_ID PCI_SLOT=$PCI_SLOT PCI_SUBSYS_ID=$PCI_SUBSYS_ID /sbin/hotplug-beta pci
        env -i - ACTION=$ACTION PCI_CLASS=$PCI_CLASS PCI_ID=$PCI_ID PCI_SLOT=$PCI_SLOT PCI_SUBSYS_ID=$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?



-- 
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG


-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-11-11 20:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-05 21:43 pci coldplug Olaf Hering
2003-11-05 23:19 ` Olaf Hering
2003-11-11 20:23 ` Olaf Hering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).