]> mj.ucw.cz Git - pciutils.git/commitdiff
Several small formatting fixes.
authorMartin Mares <mj@ucw.cz>
Thu, 20 Jan 2000 21:15:41 +0000 (21:15 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:10:37 +0000 (14:10 +0200)
ChangeLog
lib/header.h
lspci.c

index be06efdb5cd6963f4e574f4cf69889db0984e607..c8a72c9052f25efea6beeec2a2c71a9f78ce7bdb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 Thu Jan 20 11:08:32 2000  Martin Mares  <mj@albireo.ucw.cz>
 
+       * lib/proc.c: pread/pwrite fixed again, this time on libc5 :(
+
+       * lspci.c (format_agp_rate): Better formatting of AGP rates.
+
+       * pci.ids: New ID's.
+
        * lib/configure: Added configuration for ia64 (the same as for Alpha).
        Patch from Stephane Eranian <eranian@cello.hpl.hp.com>.
 
index 3fb316832b90b75538f00e7ad6e79ac7b6343970..90f4c5656a0a16f5972f56d54239eba6f79a90be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     $Id: header.h,v 1.4 1999/07/07 11:23:10 mj Exp $
+ *     $Id: header.h,v 1.5 2000/01/20 21:15:46 mj Exp $
  *
  *     The PCI Library -- PCI Header Structure (extracted from <linux/pci.h>)
  *
 #define  PCI_AGP_COMMAND_64BIT 0x0020  /* Allow processing of 64-bit addresses */
 #define  PCI_AGP_COMMAND_FW    0x0010  /* Force FW transfers */
 #define  PCI_AGP_COMMAND_RATE4 0x0004  /* Use 4x rate */
-#define  PCI_AGP_COMMAND_RATE2 0x0002  /* Use 4x rate */
-#define  PCI_AGP_COMMAND_RATE1 0x0001  /* Use 4x rate */
+#define  PCI_AGP_COMMAND_RATE2 0x0002  /* Use 2x rate */
+#define  PCI_AGP_COMMAND_RATE1 0x0001  /* Use 1x rate */
 #define PCI_AGP_SIZEOF         12
 
 /* Slot Identification */
diff --git a/lspci.c b/lspci.c
index c61c1a0583d0729ec2d1e2dabe8f85d19e8e1ec6..ba7b82ec3959c581206cf33386ff0a4e7f604dd8 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,5 +1,5 @@
 /*
- *     $Id: lspci.c,v 1.32 2000/01/13 22:50:13 mj Exp $
+ *     $Id: lspci.c,v 1.33 2000/01/20 21:15:41 mj Exp $
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
@@ -387,10 +387,31 @@ show_pm(struct device *d, int where, int cap)
         FLAG(t, PCI_PM_CTRL_PME_STATUS));
 }
 
+static void
+format_agp_rate(int rate, char *buf)
+{
+  char *c = buf;
+  int i;
+
+  for(i=0; i<2; i++)
+    if (rate & (1 << i))
+      {
+       if (c != buf)
+         *c++ = ',';
+       *c++ = 'x';
+       *c++ = '0' + (4 >> i);
+      }
+  if (c != buf)
+    *c = 0;
+  else
+    strcpy(buf, "<none>");
+}
+
 static void
 show_agp(struct device *d, int where, int cap)
 {
   u32 t;
+  char rate[8];
 
   t = cap & 0xff;
   printf("AGP version %x.%x\n", cap/16, cap%16);
@@ -398,24 +419,22 @@ show_agp(struct device *d, int where, int cap)
     return;
   config_fetch(d, where + PCI_AGP_STATUS, PCI_AGP_SIZEOF - PCI_AGP_STATUS);
   t = get_conf_long(d, where + PCI_AGP_STATUS);
-  printf("\t\tStatus: RQ=%d SBA%c 64bit%c FW%c Rate=%s%s%s\n",
+  format_agp_rate(t & 7, rate);
+  printf("\t\tStatus: RQ=%d SBA%c 64bit%c FW%c Rate=%s\n",
         (t & PCI_AGP_STATUS_RQ_MASK) >> 24U,
         FLAG(t, PCI_AGP_STATUS_SBA),
         FLAG(t, PCI_AGP_STATUS_64BIT),
         FLAG(t, PCI_AGP_STATUS_FW),
-        (t & PCI_AGP_STATUS_RATE4) ? "4" : "",
-        (t & PCI_AGP_STATUS_RATE2) ? "2" : "",
-        (t & PCI_AGP_STATUS_RATE1) ? "1" : "");
+        rate);
   t = get_conf_long(d, where + PCI_AGP_COMMAND);
-  printf("\t\tCommand: RQ=%d SBA%c AGP%c 64bit%c FW%c Rate=%s%s%s\n",
+  format_agp_rate(t & 7, rate);
+  printf("\t\tCommand: RQ=%d SBA%c AGP%c 64bit%c FW%c Rate=%s\n",
         (t & PCI_AGP_COMMAND_RQ_MASK) >> 24U,
         FLAG(t, PCI_AGP_COMMAND_SBA),
         FLAG(t, PCI_AGP_COMMAND_AGP),
         FLAG(t, PCI_AGP_COMMAND_64BIT),
         FLAG(t, PCI_AGP_COMMAND_FW),
-        (t & PCI_AGP_COMMAND_RATE4) ? "4" : "",
-        (t & PCI_AGP_COMMAND_RATE2) ? "2" : "",
-        (t & PCI_AGP_COMMAND_RATE1) ? "1" : "");
+        rate);
 }
 
 static void
@@ -644,7 +663,7 @@ show_htype2(struct device *d)
       u32 base = get_conf_long(d, PCI_CB_MEMORY_BASE_0 + p);
       u32 limit = get_conf_long(d, PCI_CB_MEMORY_LIMIT_0 + p);
       if (limit > base || verb)
-       printf("Memory window %d: %08x-%08x%s%s\n", i, base, limit,
+       printf("\tMemory window %d: %08x-%08x%s%s\n", i, base, limit,
               (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]",
               (brc & (PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 << i)) ? " (prefetchable)" : "");
     }