On Fri, Apr 01, 2005 at 03:07:02PM -0600, James Bottomley wrote: > On Fri, 2005-04-01 at 09:47 -0800, Bryan Henderson wrote: > > If you and Linux could identify the host in common terms, you wouldn't > > have to do this. But the question is open as to in what terms you > > personally identify the host to which you attached the device. Is it the > > controller to the west? The red one? The new one? The one with serial > > number 8436547? The one at PCI address X:Y:Z? The one that has your disk > > drives on it? > > I'm not very good on 2.4, but I believe it has a SCSI_IOCTL_GET_PCI.
Yes, but that only works when called on a Scsi_Device attached to the controller. So each controller needs at least one scsi device (disk, cdrom, whatever) attached, such that there's a /dev/sd* file to open and call this ioctl. That'll get you the pci bus:dev.fn tuple. Then on x86 systems at least, the PCI IRQ Routing Table ($PIR table in BIOS) can tell you if your device is embedded or add-in, and which slot number BIOS calls it. A copy of David A. Hinds' dump_pirq script can be found here: http://linux.dell.com/files/tools/dump_pirq Device 00:04.0 (slot 0): Ethernet controller Device 00:06.0 (slot 0): Device 00:08.0 (slot 1): Class ff00 Device 00:0f.0 (slot 0): Host bridge Device 01:08.0 (slot 0): PCI bridge Device 01:06.0 (slot 0): Ethernet controller Device 02:06.0 (slot 0): SCSI storage controller Device 03:06.0 (slot 2): Device 03:08.0 (slot 3): Device 08:06.0 (slot 4): Device 08:08.0 (slot 5): Device 0d:06.0 (slot 6): RAID bus controller Device 0d:08.0 (slot 7): Slot 0 lines are embedded, the other values should pretty closely correspond to the silkscreen text on the motherboards. That's about as close as you get. Thanks, Matt -- Matt Domsch Software Architect Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

