summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-07-25 13:50:49 +0000
committermillert <millert@openbsd.org>2004-07-25 13:50:49 +0000
commit0c8ec621136977c72ba42a64698e5a6cbfbbd78b (patch)
tree223b4d458d13a2b624e1bb4e87dbf4717471918c
parentProgram BARs before enabling memory or I/O access. From NetBSD (mycroft). (diff)
downloadwireguard-openbsd-0c8ec621136977c72ba42a64698e5a6cbfbbd78b.tar.xz
wireguard-openbsd-0c8ec621136977c72ba42a64698e5a6cbfbbd78b.zip
Store pci/cardbus revision number. From NetBSD (dyoung)
-rw-r--r--sys/dev/cardbus/if_atw_cardbus.c12
-rw-r--r--sys/dev/pci/if_atw_pci.c9
2 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/cardbus/if_atw_cardbus.c b/sys/dev/cardbus/if_atw_cardbus.c
index 155332391a7..004760b7f0c 100644
--- a/sys/dev/cardbus/if_atw_cardbus.c
+++ b/sys/dev/cardbus/if_atw_cardbus.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_atw_cardbus.c,v 1.3 2004/07/25 13:44:22 millert Exp $ */
-/* $NetBSD: if_atw_cardbus.c,v 1.8 2004/07/22 15:50:50 dyoung Exp $ */
+/* $OpenBSD: if_atw_cardbus.c,v 1.4 2004/07/25 13:50:49 millert Exp $ */
+/* $NetBSD: if_atw_cardbus.c,v 1.9 2004/07/23 07:07:55 dyoung Exp $ */
/*-
* Copyright (c) 1999, 2000, 2003 The NetBSD Foundation, Inc.
@@ -182,7 +182,6 @@ atw_cardbus_attach(struct device *parent, struct device *self, void *aux)
cardbus_devfunc_t ct = ca->ca_ct;
const struct atw_cardbus_product *acp;
bus_addr_t adr;
- int rev;
sc->sc_dmat = ca->ca_dmat;
csc->sc_ct = ct;
@@ -202,10 +201,13 @@ atw_cardbus_attach(struct device *parent, struct device *self, void *aux)
sc->sc_power = atw_cardbus_power;
/* Get revision info. */
- rev = PCI_REVISION(ca->ca_class);
+ sc->sc_rev = PCI_REVISION(ca->ca_class);
+
+ printf(": %s, revision %d.%d\n", acp->acp_product_name,
+ (sc->sc_rev >> 4) & 0xf, sc->sc_rev & 0xf);
#if 0
- printf(": pass %d.%d signature %08x\n%s", (rev >> 4) & 0xf, rev & 0xf,
+ printf(": signature %08x\n%s",
cardbus_conf_read(ct->ct_cc, ct->ct_cf, csc->sc_tag, 0x80),
sc->sc_dev.dv_xname);
#endif
diff --git a/sys/dev/pci/if_atw_pci.c b/sys/dev/pci/if_atw_pci.c
index 52f20216d4f..17caac25d77 100644
--- a/sys/dev/pci/if_atw_pci.c
+++ b/sys/dev/pci/if_atw_pci.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: if_atw_pci.c,v 1.2 2004/06/27 19:30:03 millert Exp $ */
-/* $NetBSD: if_atw_pci.c,v 1.6 2004/02/17 21:20:55 dyoung Exp $ */
+/* $OpenBSD: if_atw_pci.c,v 1.3 2004/07/25 13:50:49 millert Exp $ */
+/* $NetBSD: if_atw_pci.c,v 1.7 2004/07/23 07:07:55 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -201,6 +201,11 @@ atw_pci_attach(struct device *parent, struct device *self, void *aux)
sc->sc_flags |= ATWF_ENABLED;
/*
+ * Get revision info, and set some chip-specific variables.
+ */
+ sc->sc_rev = PCI_REVISION(pa->pa_class);
+
+ /*
* Check to see if the device is in power-save mode, and
* being it out if necessary.
*