Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Rework the pciverbose module dispatch vectors to...
details: https://anonhg.NetBSD.org/src/rev/7cf7c8093db0
branches: trunk
changeset: 755167:7cf7c8093db0
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Tue May 25 08:35:45 2010 +0000
description:
Rework the pciverbose module dispatch vectors to avoid renaming the
externally-visible entrypoint name. Also this avoids a potential
need to bump kernel version.
Requested by dyoung@ and mrg@
diffstat:
sys/dev/pci/pci_subr.c | 20 ++++++++++----------
sys/dev/pci/pci_verbose.c | 16 ++++++++--------
sys/dev/pci/pcivar.h | 10 +++++-----
3 files changed, 23 insertions(+), 23 deletions(-)
diffs (146 lines):
diff -r f84b9c0734c6 -r 7cf7c8093db0 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c Tue May 25 02:21:30 2010 +0000
+++ b/sys/dev/pci/pci_subr.c Tue May 25 08:35:45 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_subr.c,v 1.80 2010/05/24 20:29:41 pgoyette Exp $ */
+/* $NetBSD: pci_subr.c,v 1.81 2010/05/25 08:35:45 pgoyette Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.80 2010/05/24 20:29:41 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.81 2010/05/25 08:35:45 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -300,15 +300,15 @@
* In kernel, these routines are provided and linked via the
* pciverbose module.
*/
-const char *(*pci_findvendor_vec)(pcireg_t id_reg) = pci_null;
-const char *(*pci_findproduct_vec)(pcireg_t id_reg) = pci_null;
+const char *(*pci_findvendor)(pcireg_t id_reg) = pci_null;
+const char *(*pci_findproduct)(pcireg_t id_reg) = pci_null;
const char *pci_unmatched = "";
#else
/*
* For userland we just set the vectors here.
*/
-const char *(*pci_findvendor_vec)(pcireg_t id_reg) = pci_findvendor;
-const char *(*pci_findproduct_vec)(pcireg_t id_reg) = pci_findproduct;
+const char *(*pci_findvendor)(pcireg_t id_reg) = pci_findvendor_real;
+const char *(*pci_findproduct)(pcireg_t id_reg) = pci_findproduct_real;
const char *pci_unmatched = "unmatched ";
#endif
@@ -362,8 +362,8 @@
interface = PCI_INTERFACE(class_reg);
revision = PCI_REVISION(class_reg);
- vendor_namep = pci_findvendor_vec(id_reg);
- product_namep = pci_findproduct_vec(id_reg);
+ vendor_namep = pci_findvendor(id_reg);
+ product_namep = pci_findproduct(id_reg);
classp = pci_class;
while (classp->name != NULL) {
@@ -439,13 +439,13 @@
pcireg_t rval;
rval = regs[o2i(PCI_ID_REG)];
- name = pci_findvendor_vec(rval);
+ name = pci_findvendor(rval);
if (name)
printf(" Vendor Name: %s (0x%04x)\n", name,
PCI_VENDOR(rval));
else
printf(" Vendor ID: 0x%04x\n", PCI_VENDOR(rval));
- name = pci_findproduct_vec(rval);
+ name = pci_findproduct(rval);
if (name)
printf(" Device Name: %s (0x%04x)\n", name,
PCI_PRODUCT(rval));
diff -r f84b9c0734c6 -r 7cf7c8093db0 sys/dev/pci/pci_verbose.c
--- a/sys/dev/pci/pci_verbose.c Tue May 25 02:21:30 2010 +0000
+++ b/sys/dev/pci/pci_verbose.c Tue May 25 08:35:45 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_verbose.c,v 1.1 2010/05/24 20:29:40 pgoyette Exp $ */
+/* $NetBSD: pci_verbose.c,v 1.2 2010/05/25 08:35:45 pgoyette Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_verbose.c,v 1.1 2010/05/24 20:29:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_verbose.c,v 1.2 2010/05/25 08:35:45 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -82,13 +82,13 @@
aprint_normal("%s: cmd %d\n", __func__, cmd); /* XXX */
switch (cmd) {
case MODULE_CMD_INIT:
- pci_findvendor_vec = pci_findvendor;
- pci_findproduct_vec = pci_findproduct;
+ pci_findvendor = pci_findvendor_real;
+ pci_findproduct = pci_findproduct_real;
pci_unmatched = "unmatched ";
return 0;
case MODULE_CMD_FINI:
- pci_findvendor_vec = pci_null;
- pci_findproduct_vec = pci_null;
+ pci_findvendor = pci_null;
+ pci_findproduct = pci_null;
pci_unmatched = "";
return 0;
default:
@@ -113,7 +113,7 @@
}
const char *
-pci_findvendor(pcireg_t id_reg)
+pci_findvendor_real(pcireg_t id_reg)
{
static char buf[256];
pci_vendor_id_t vendor = PCI_VENDOR(id_reg);
@@ -133,7 +133,7 @@
}
const char *
-pci_findproduct(pcireg_t id_reg)
+pci_findproduct_real(pcireg_t id_reg)
{
static char buf[256];
pci_vendor_id_t vendor = PCI_VENDOR(id_reg);
diff -r f84b9c0734c6 -r 7cf7c8093db0 sys/dev/pci/pcivar.h
--- a/sys/dev/pci/pcivar.h Tue May 25 02:21:30 2010 +0000
+++ b/sys/dev/pci/pcivar.h Tue May 25 08:35:45 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcivar.h,v 1.87 2010/05/24 20:29:41 pgoyette Exp $ */
+/* $NetBSD: pcivar.h,v 1.88 2010/05/25 08:35:45 pgoyette Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -279,13 +279,13 @@
/*
* Misc.
*/
-const char *pci_findvendor(pcireg_t);
-const char *pci_findproduct(pcireg_t);
+const char *pci_findvendor_real(pcireg_t);
+const char *pci_findproduct_real(pcireg_t);
const char *pci_null(pcireg_t);
void pci_verbose_ctl(bool);
-extern const char *(*pci_findvendor_vec)(pcireg_t);
-extern const char *(*pci_findproduct_vec)(pcireg_t);
+extern const char *(*pci_findvendor)(pcireg_t);
+extern const char *(*pci_findproduct)(pcireg_t);
extern const char *pci_unmatched;
int pci_find_device(struct pci_attach_args *pa,
Home |
Main Index |
Thread Index |
Old Index