hdt: Adding PCI latency
authorErwan Velu <erwan.velu@free.fr>
Sat, 14 Mar 2009 07:29:16 +0000 (08:29 +0100)
committerErwan Velu <erwan.velu@free.fr>
Sat, 14 Mar 2009 07:29:16 +0000 (08:29 +0100)
Adding the pci latency information

com32/hdt/hdt-cli-pci.c
com32/hdt/hdt-menu-pci.c
com32/include/sys/pci.h
com32/lib/pci/scan.c

index 06eea9f..b0b33c5 100644 (file)
@@ -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);
index 5c16a6a..b3c32f2 100644 (file)
@@ -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; i<pci_device->dev_info->linux_kernel_module_count;i++) {
       if (i>0) {
index 48b56af..18e9754 100644 (file)
@@ -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) */
index 1e1dce2..dd5d640 100644 (file)
@@ -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);
       }
     }
   }