summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2007-02-26 14:14:03 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2007-02-26 14:14:03 +0000
commit158b47205cdeb6da0d6e8c8d6af77026b3bdd29c (patch)
tree0546ac9be6924dc60490abdf82f6d2296d9668f5
parent8555e15060c1d4091d4b3b6f330471caa95c51f5 (diff)
We need to save some PCI infos in our softc struct for further decisions
in the driver code.
-rw-r--r--sys/dev/cardbus/if_bcw_cardbus.c5
-rw-r--r--sys/dev/ic/bcwvar.h5
-rw-r--r--sys/dev/pci/if_bcw_pci.c5
3 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/cardbus/if_bcw_cardbus.c b/sys/dev/cardbus/if_bcw_cardbus.c
index 19c8cee71a4..ab84a4a9466 100644
--- a/sys/dev/cardbus/if_bcw_cardbus.c
+++ b/sys/dev/cardbus/if_bcw_cardbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bcw_cardbus.c,v 1.8 2007/02/25 17:03:08 mglocker Exp $ */
+/* $OpenBSD: if_bcw_cardbus.c,v 1.9 2007/02/26 14:14:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -137,6 +137,9 @@ bcw_cardbus_attach(struct device *parent, struct device *self, void *aux)
/*
* Get some cardbus info into the softc
*/
+ sc->sc_board_vendor = CARDBUS_VENDOR(ca->ca_id);
+ sc->sc_board_type = sc->sc_conf_read(sc, 0x2e);
+ sc->sc_board_rev = CARDBUS_REVISION(ca->ca_class);
sc->sc_prodid = CARDBUS_PRODUCT(ca->ca_id);
#if 0
diff --git a/sys/dev/ic/bcwvar.h b/sys/dev/ic/bcwvar.h
index de52210453f..c0b1f44d1bd 100644
--- a/sys/dev/ic/bcwvar.h
+++ b/sys/dev/ic/bcwvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcwvar.h,v 1.23 2007/02/24 23:05:04 mglocker Exp $ */
+/* $OpenBSD: bcwvar.h,v 1.24 2007/02/26 14:14:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -223,6 +223,9 @@ struct bcw_softc {
int sc_txsnext; /* next available tx slot */
struct timeout sc_timeout;
/* Break these out into seperate structs */
+ uint16_t sc_board_vendor;
+ uint16_t sc_board_type;
+ uint16_t sc_board_rev;
uint16_t sc_chip_id; /* Chip ID */
uint16_t sc_chip_rev; /* Chip Revision */
uint16_t sc_chip_package; /* Chip Package */
diff --git a/sys/dev/pci/if_bcw_pci.c b/sys/dev/pci/if_bcw_pci.c
index 86071e6284b..f007a1d475f 100644
--- a/sys/dev/pci/if_bcw_pci.c
+++ b/sys/dev/pci/if_bcw_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bcw_pci.c,v 1.9 2007/02/24 23:05:04 mglocker Exp $ */
+/* $OpenBSD: if_bcw_pci.c,v 1.10 2007/02/26 14:14:02 mglocker Exp $ */
/*
* Copyright (c) 2006 Jon Simola <jsimola@gmail.com>
@@ -223,6 +223,9 @@ bcw_pci_attach(struct device *parent, struct device *self, void *aux)
/*
* Get some PCI based info into the softc
*/
+ sc->sc_board_vendor = PCI_VENDOR(pa->pa_id);
+ sc->sc_board_type = sc->sc_conf_read(sc, 0x2e); /* XXX right one? */
+ sc->sc_board_rev = PCI_REVISION(pa->pa_class); /* XXX right one? */
sc->sc_prodid = PCI_PRODUCT(pa->pa_id);
/*