Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci get the device name from pcidevs instead of havi...



details:   https://anonhg.NetBSD.org/src/rev/33f176e0cb3c
branches:  trunk
changeset: 481274:33f176e0cb3c
user:      joda <joda%NetBSD.org@localhost>
date:      Tue Jan 25 14:34:24 2000 +0000

description:
get the device name from pcidevs instead of having a list here

diffstat:

 sys/dev/pci/pccbb.c |  100 ++++++++++++++++++++++++++--------------------------
 1 files changed, 50 insertions(+), 50 deletions(-)

diffs (168 lines):

diff -r 9904bc83392e -r 33f176e0cb3c sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c       Tue Jan 25 13:56:23 2000 +0000
+++ b/sys/dev/pci/pccbb.c       Tue Jan 25 14:34:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccbb.c,v 1.19 2000/01/25 09:36:43 haya Exp $  */
+/*     $NetBSD: pccbb.c,v 1.20 2000/01/25 14:34:24 joda Exp $  */
 
 /*
  * Copyright (c) 1998 and 1999 HAYAKAWA Koichi.  All rights reserved.
@@ -111,7 +111,7 @@
 STATIC int cb_detect_voltage __P((struct pccbb_softc *));
 STATIC int cbbprint __P((void *, const char *));
 
-static int cb_chipset __P((u_int32_t, char const **, int *));
+static int cb_chipset __P((u_int32_t, int *));
 STATIC void pccbb_pcmcia_attach_setup __P((struct pccbb_softc *, struct pcmciabus_attach_args *));
 #if 0
 STATIC void pccbb_pcmcia_attach_card __P((struct pcic_handle *));
@@ -281,78 +281,76 @@
 
 struct yenta_chipinfo {
   pcireg_t yc_id;              /* vendor tag | product tag */
-  const char *yc_name;
   int yc_chiptype;
   int yc_flags;
 } yc_chipsets[] = {
   /* Texas Instruments chips */
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1130), "TI1130", CB_TI113X,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1130), CB_TI113X,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1131), "TI1131", CB_TI113X,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1131), CB_TI113X,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
 
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1250), "TI1250", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1250), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1220), "TI1220", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1220), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1221), "TI1221", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1221), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1225), "TI1225", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1225), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1251), "TI1251", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1251), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1251B), "TI1251B", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1251B), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1211), "TI1211", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1211), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1420), "TI1420", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1420), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1450), "TI1450", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1450), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1451), "TI1421", CB_TI12XX,
+  {MAKEID(PCI_VENDOR_TI, PCI_PRODUCT_TI_PCI1451), CB_TI12XX,
      PCCBB_PCMCIA_IO_RELOC | PCCBB_PCMCIA_MEM_32},
 
   /* Ricoh chips */
-  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C475), "Rx5C475",
-     CB_RX5C47X, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_RL5C476), "RL5C476",
-     CB_RX5C47X, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C477), "Rx5C477",
-     CB_RX5C47X, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C478), "Rx5C478",
-     CB_RX5C47X, PCCBB_PCMCIA_MEM_32},
-
-  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C465), "Rx5C465",
-     CB_RX5C46X, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C466), "Rx5C466",
-     CB_RX5C46X, PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C475), CB_RX5C47X, 
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_RL5C476), CB_RX5C47X, 
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C477), CB_RX5C47X,
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C478), CB_RX5C47X, 
+   PCCBB_PCMCIA_MEM_32},
+
+  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C465), CB_RX5C46X,
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_RICOH, PCI_PRODUCT_RICOH_Rx5C466), CB_RX5C46X, 
+   PCCBB_PCMCIA_MEM_32},
 
   /* Toshiba products */
-  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC95), "ToPIC95",
-     CB_TOPIC95, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC95B), "ToPIC95B",
-     CB_TOPIC95B, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC97), "ToPIC97",
-     CB_TOPIC97, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC100), "ToPIC100",
-     CB_TOPIC97, PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC95), CB_TOPIC95, 
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC95B), CB_TOPIC95B, 
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC97), CB_TOPIC97, 
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_TOSHIBA2, PCI_PRODUCT_TOSHIBA2_ToPIC100), CB_TOPIC97, 
+   PCCBB_PCMCIA_MEM_32},
 
   /* Cirrus Logic products */
-  {MAKEID(PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6832), "CL-PD683X",
-     CB_CIRRUS, PCCBB_PCMCIA_MEM_32},
-  {MAKEID(PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6833), "CL-PD683X",
-     CB_CIRRUS, PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6832), CB_CIRRUS, 
+   PCCBB_PCMCIA_MEM_32},
+  {MAKEID(PCI_VENDOR_CIRRUS, PCI_PRODUCT_CIRRUS_CL_PD6833), CB_CIRRUS, 
+   PCCBB_PCMCIA_MEM_32},
 
   /* sentinel, or Generic chip */
-  {0 /* null id */, "unknown", CB_UNKNOWN, PCCBB_PCMCIA_MEM_32},
+  {0 /* null id */,  CB_UNKNOWN, PCCBB_PCMCIA_MEM_32},
 };
   
 
 
 static int
-cb_chipset(pci_id, namep, flagp)
+cb_chipset(pci_id, flagp)
      u_int32_t pci_id;
-     char const **namep;
      int *flagp;
 {
   int loopend = sizeof(yc_chipsets)/sizeof(yc_chipsets[0]);
@@ -367,10 +365,6 @@
     ycp = yc_chipsets + loopend - 1; /* to point the sentinel */
   }
 
-  if (namep != NULL) {
-    *namep = ycp->yc_name;
-  }
-
   if (flagp != NULL) {
     *flagp = ycp->yc_flags;
   }
@@ -408,11 +402,17 @@
   pci_chipset_tag_t pc = pa->pa_pc;
   pcireg_t sock_base, busreg;
   bus_addr_t sockbase;
-  char const *name;
+  char devinfo[256];
   int flags;
 
-  sc->sc_chipset = cb_chipset(pa->pa_id, &name, &flags);
-  printf(" (%s), chipflags %d\n", name, flags);
+  sc->sc_chipset = cb_chipset(pa->pa_id, &flags);
+  
+  pci_devinfo(pa->pa_id, 0, 0, devinfo);
+  printf(": %s (rev. 0x%02x)", devinfo, PCI_REVISION(pa->pa_class));
+#ifdef CBB_DEBUG
+  printf(" (chipflags %x)", flags);
+#endif
+  printf("\n");
 
 #if rbus
   sc->sc_rbus_iot = rbus_pccbb_parent_io(pa);



Home | Main Index | Thread Index | Old Index