From: Lionel Sambuc Date: Fri, 17 Oct 2014 16:33:00 +0000 (+0200) Subject: Enhancing /proc/pci X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch10.html?a=commitdiff_plain;h=9e77ef501354aa8d0e603fd00c7de23c16c08237;p=minix.git Enhancing /proc/pci - Adding missing fields for PCI device lookup - Adding the domain (for now set to zero) as part of the slot name Change-Id: Iebaf3b21f6ab5024738cbc1dea66d5ad3ada175d --- diff --git a/etc/usr/rc b/etc/usr/rc index 574b0bc3d..f540bdf97 100644 --- a/etc/usr/rc +++ b/etc/usr/rc @@ -208,7 +208,7 @@ start|autoboot) then up -n printer -dev /dev/lp -period 10HZ # start VirtualBox time sync driver if the device is there - if grep '^[^ ]* [^ ]* 80EE:CAFE ' /proc/pci >/dev/null; then + if grep '^[^ ]* [^ ]* 80EE:CAFE[^ ]* ' /proc/pci >/dev/null; then up -n vbox -period 10HZ fi fi diff --git a/minix/drivers/storage/ramdisk/rc b/minix/drivers/storage/ramdisk/rc index 5c8fc941a..6dd84c3cd 100644 --- a/minix/drivers/storage/ramdisk/rc +++ b/minix/drivers/storage/ramdisk/rc @@ -25,7 +25,7 @@ then if [ -e $ACPI -a -n "`sysenv acpi`" ] # If not specified, default to yes if the device is found. if /bin/sysenv virtio_blk >/dev/null then virtio_blk="`/bin/sysenv virtio_blk`" - elif grep '^[^ ]* [^ ]* 1AF4:1001 ' /proc/pci >/dev/null + elif grep '^[^ ]* [^ ]* 1AF4:1001[^ ]* ' /proc/pci >/dev/null then echo "virtio_blk not set, defaulting to using found virtio device." virtio_blk=yes fi diff --git a/minix/fs/procfs/root.c b/minix/fs/procfs/root.c index 5eaf10ed6..423d77390 100644 --- a/minix/fs/procfs/root.c +++ b/minix/fs/procfs/root.c @@ -127,8 +127,8 @@ static void root_pci(void) { /* Print information about PCI devices present in the system. */ - u16_t vid, did; - u8_t bcr, scr, pifr; + u16_t vid, did, subvid, subdid; + u8_t bcr, scr, pifr, rev; char *slot_name, *dev_name; int r, devind; static int first = TRUE; @@ -148,10 +148,14 @@ static void root_pci(void) bcr = pci_attr_r8(devind, PCI_BCR); scr = pci_attr_r8(devind, PCI_SCR); pifr = pci_attr_r8(devind, PCI_PIFR); - - buf_printf("%s %x/%x/%x %04X:%04X %s\n", - slot_name ? slot_name : "-", - bcr, scr, pifr, vid, did, + rev = pci_attr_r8(devind, PCI_REV); + subvid = pci_attr_r16(devind, PCI_SUBVID); + subdid = pci_attr_r16(devind, PCI_SUBDID); + + buf_printf("%s %x/%x/%x/%x %04X:%04X:%04X:%04X %s\n", + slot_name ? slot_name : "-1.-1.-1.-1", + bcr, scr, pifr, rev, + vid, did, subvid, subdid, dev_name ? dev_name : ""); r = pci_next_dev(&devind, &vid, &did);