From 339e74fbe86812ca83581c48bddc1a6638a3f7ff Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Sat, 14 Mar 2009 08:29:16 +0100 Subject: [PATCH] hdt: Adding PCI latency Adding the pci latency information --- com32/hdt/hdt-cli-pci.c | 1 + com32/hdt/hdt-menu-pci.c | 9 +++++++-- com32/include/sys/pci.h | 1 + com32/lib/pci/scan.c | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/com32/hdt/hdt-cli-pci.c b/com32/hdt/hdt-cli-pci.c index 06eea9f..b0b33c5 100644 --- a/com32/hdt/hdt-cli-pci.c +++ b/com32/hdt/hdt-cli-pci.c @@ -103,6 +103,7 @@ void show_pci_device(struct s_hardware *hardware, const char *item) { 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); diff --git a/com32/hdt/hdt-menu-pci.c b/com32/hdt/hdt-menu-pci.c index 5c16a6a..b3c32f2 100644 --- a/com32/hdt/hdt-menu-pci.c +++ b/com32/hdt/hdt-menu-pci.c @@ -65,12 +65,17 @@ void compute_pci_device(struct s_my_menu *menu,struct pci_device *pci_device,int menu->items_count++; if ((pci_device->dev_info->irq>0) && (pci_device->dev_info->irq<255)) { - snprintf(buffer,sizeof buffer,"IRQ : %02d",pci_device->dev_info->irq); - snprintf(statbuffer,sizeof statbuffer,"IRQ : %02d",pci_device->dev_info->irq); + snprintf(buffer,sizeof buffer,"IRQ : %d",pci_device->dev_info->irq); + snprintf(statbuffer,sizeof statbuffer,"IRQ : %d",pci_device->dev_info->irq); add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0); menu->items_count++; } + snprintf(buffer,sizeof buffer,"Latency : %d",pci_device->dev_info->latency); + snprintf(statbuffer,sizeof statbuffer,"Latency : %d",pci_device->dev_info->latency); + add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0); + menu->items_count++; + if (pci_device->dev_info->linux_kernel_module_count>1) { for (int i=0; idev_info->linux_kernel_module_count;i++) { if (i>0) { diff --git a/com32/include/sys/pci.h b/com32/include/sys/pci.h index 48b56af..18e9754 100644 --- a/com32/include/sys/pci.h +++ b/com32/include/sys/pci.h @@ -31,6 +31,7 @@ struct pci_dev_info { char class_name[PCI_CLASS_NAME_SIZE]; /* The most precise class name */ char category_name[PCI_CLASS_NAME_SIZE]; /*The general category*/ uint8_t irq; + uint8_t latency; }; /* PCI device (really, function) */ diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c index 1e1dce2..dd5d640 100644 --- a/com32/lib/pci/scan.c +++ b/com32/lib/pci/scan.c @@ -539,6 +539,7 @@ void gather_additional_pci_config(struct pci_domain *domain) return; } dev->dev_info->irq = pci_readb(a + 0x3c); + dev->dev_info->latency = pci_readb(a + 0x0d); } } } -- 2.7.4