aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-03-14 16:24:37 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-03-14 16:24:37 -0700
commit414df4e5d0d9d36d4fba8db5fa51837eb7514405 (patch)
tree402d3b83b12a3043679966dfc4c0bfa1a01141f3 /com32
parent2f4b3776d62a702a7c6e74e9504a633f835f63ad (diff)
downloadsyslinux.git-414df4e5d0d9d36d4fba8db5fa51837eb7514405.tar.gz
syslinux.git-414df4e5d0d9d36d4fba8db5fa51837eb7514405.tar.xz
syslinux.git-414df4e5d0d9d36d4fba8db5fa51837eb7514405.zip
hdt: Fix irq references
Impact: Fix build compilation d213082d76a24d3ba2e033416891a170b39c1ded moved irq to dev_info struct. Make the changes accordingly. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-cli-pci.c50
1 files changed, 46 insertions, 4 deletions
diff --git a/com32/hdt/hdt-cli-pci.c b/com32/hdt/hdt-cli-pci.c
index f5af6ce9..31cfe771 100644
--- a/com32/hdt/hdt-cli-pci.c
+++ b/com32/hdt/hdt-cli-pci.c
@@ -41,7 +41,7 @@ void show_pci_device(struct s_hardware *hardware, const char *item)
bool nopciids = false;
bool nomodulespcimap = false;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
- MAX_KERNEL_MODULES_PER_PCI_DEVICE];
+ MAX_KERNEL_MODULES_PER_PCI_DEVICE];
int bus = 0, slot = 0, func = 0;
if (errno == ERANGE) {
@@ -110,6 +110,10 @@ void show_pci_device(struct s_hardware *hardware, const char *item)
more_printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
pci_device->class[1], pci_device->class[0]);
more_printf("Revision : %02x\n", pci_device->revision);
+ if ((pci_device->dev_info->irq > 0)
+ && (pci_device->dev_info->irq < 255))
+ more_printf("IRQ : %0d\n", pci_device->dev_info->irq);
+ more_printf("Latency : %0d\n",pci_device->dev_info->latency);
more_printf("PCI Bus : %02d\n", bus);
more_printf("PCI Slot : %02d\n", slot);
more_printf("PCI Func : %02d\n", func);
@@ -128,7 +132,7 @@ static void show_pci_devices(struct s_hardware *hardware)
int i = 1;
struct pci_device *pci_device;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
- MAX_KERNEL_MODULES_PER_PCI_DEVICE];
+ MAX_KERNEL_MODULES_PER_PCI_DEVICE];
bool nopciids = false;
bool nomodulespcimap = false;
char first_line[81];
@@ -188,8 +192,7 @@ static void show_pci_devices(struct s_hardware *hardware)
i, pci_device->vendor,
pci_device->product,
pci_device->sub_vendor,
- pci_device->sub_product,
- kernel_modules);
+ pci_device->sub_product);
} else {
more_printf
("%02d: %04x:%04x [%04x:%04x] Kmod:%s\n", i,
@@ -204,11 +207,46 @@ static void show_pci_devices(struct s_hardware *hardware)
}
+static void show_pci_irq(struct s_hardware *hardware)
+{
+ struct pci_device *pci_device;
+ bool nopciids = false;
+
+ clear_screen();
+ more_printf("%d PCI devices detected\n", hardware->nb_pci_devices);
+ more_printf("IRQ : product\n");
+ more_printf("-------------\n");
+
+ if (hardware->pci_ids_return_code == -ENOPCIIDS) {
+ nopciids = true;
+ }
+
+ /* For every detected pci device, compute its submenu */
+ for_each_pci_func(pci_device, hardware->pci_domain) {
+ /* Only display valid IRQs */
+ if ((pci_device->dev_info->irq > 0) && (pci_device->dev_info->irq < 255)) {
+ if (nopciids == false) {
+ more_printf("%02d : %s %s \n",
+ pci_device->dev_info->irq,
+ pci_device->dev_info->vendor_name,
+ pci_device->dev_info->product_name);
+ } else {
+ more_printf("%02d : %04x:%04x [%04x:%04x] \n",
+ pci_device->dev_info->irq, pci_device->vendor,
+ pci_device->product,
+ pci_device->sub_vendor,
+ pci_device->sub_product);
+ }
+ }
+ }
+}
+
static void show_pci_help()
{
more_printf("Show supports the following commands : \n");
more_printf(" %s\n", CLI_SHOW_LIST);
more_printf(" %s <device_number>\n", CLI_PCI_DEVICE);
+ more_printf(" %s\n",CLI_IRQ);
}
static void pci_show(char *item, struct s_hardware *hardware)
@@ -217,6 +255,10 @@ static void pci_show(char *item, struct s_hardware *hardware)
show_pci_devices(hardware);
return;
}
+ if (!strncmp(item, CLI_IRQ, sizeof(CLI_IRQ) - 1)) {
+ show_pci_irq(hardware);
+ return;
+ }
if (!strncmp(item, CLI_PCI_DEVICE, sizeof(CLI_PCI_DEVICE) - 1)) {
show_pci_device(hardware, item + sizeof(CLI_PCI_DEVICE) - 1);
return;