summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-06-11 00:50:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-06-11 00:50:39 +0000
commitc8317dd8d7114103a4c511bf633d2595a1ba00fc (patch)
tree6f37e1a6f38eeceb7041ead55e91cd83f28c9186 /sys
parent79cd93e5f7e6de51a557f90753a8c0a26cbf52c9 (diff)
For PCI attachments print the CIS strings since otherwise all we have
is info on the PCI -> PCMCIA dumb bridge and not the card itself.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/if_wi.c44
-rw-r--r--sys/dev/pci/if_wi_pci.c6
-rw-r--r--sys/dev/pcmcia/if_wi_pcmcia.c6
3 files changed, 39 insertions, 17 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 3b7c081d06a..36094308a2d 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.8 2001/06/10 05:35:59 millert Exp $ */
+/* $OpenBSD: if_wi.c,v 1.9 2001/06/11 00:50:38 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -120,7 +120,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.8 2001/06/10 05:35:59 millert Exp $";
+ "$OpenBSD: if_wi.c,v 1.9 2001/06/11 00:50:38 millert Exp $";
#endif /* lint */
#ifdef foo
@@ -149,10 +149,10 @@ STATIC int wi_alloc_nicmem __P((struct wi_softc *, int, int *));
STATIC void wi_inquire __P((void *));
STATIC void wi_setdef __P((struct wi_softc *, struct wi_req *));
STATIC int wi_mgmt_xmit __P((struct wi_softc *, caddr_t, int));
-STATIC void wi_get_id __P((struct wi_softc *));
+STATIC void wi_get_id __P((struct wi_softc *, int));
int wi_intr __P((void *));
-int wi_attach __P((struct wi_softc *));
+int wi_attach __P((struct wi_softc *, int));
void wi_init __P((void *));
void wi_stop __P((struct wi_softc *));
@@ -162,8 +162,9 @@ struct cfdriver wi_cd = {
};
int
-wi_attach(sc)
+wi_attach(sc, print_cis)
struct wi_softc *sc;
+ int print_cis;
{
struct wi_ltv_macaddr mac;
struct wi_ltv_gen gen;
@@ -180,8 +181,7 @@ wi_attach(sc)
bcopy((char *)&mac.wi_mac_addr, (char *)&sc->arpcom.ac_enaddr,
ETHER_ADDR_LEN);
- wi_get_id(sc);
-
+ wi_get_id(sc, print_cis);
printf("address %s", ether_sprintf(sc->arpcom.ac_enaddr));
ifp = &sc->arpcom.ac_if;
@@ -1505,12 +1505,34 @@ wi_shutdown(arg)
}
STATIC void
-wi_get_id(sc)
+wi_get_id(sc, print_cis)
struct wi_softc *sc;
+ int print_cis;
{
struct wi_ltv_ver ver;
+ struct wi_ltv_cis cis;
const char *p;
+ if (print_cis) {
+ /*
+ * For PCI attachments the CIS strings won't have been printed
+ * so print them here.
+ */
+ cis.wi_type = WI_RID_CIS;
+ cis.wi_len = sizeof(cis.wi_cis);
+ if (wi_read_record(sc, (struct wi_ltv_gen *)&cis) == 0) {
+ char *cis_strings[3];
+
+ cis_strings[0] = (char *)&cis.wi_cis[11];
+ cis_strings[1] = cis_strings[0] +
+ strlen(cis_strings[0]) + 1;
+ cis_strings[2] = cis_strings[1] +
+ strlen(cis_strings[1]) + 1;
+ printf("\n%s: \"%s, %s, %s\"", WI_PRT_ARG(sc),
+ cis_strings[0], cis_strings[1], cis_strings[2]);
+ }
+ }
+
/* get chip identity */
bzero(&ver, sizeof(ver));
ver.wi_type = WI_RID_CARD_ID;
@@ -1565,13 +1587,13 @@ wi_get_id(sc)
ver.wi_ver[3] = letoh16(ver.wi_ver[3]);
if (sc->sc_prism2) {
printf("\n%s: %s, Firmware %i.%i variant %i, ",
- sc->sc_dev.dv_xname, p, ver.wi_ver[2],
+ WI_PRT_ARG(sc), p, ver.wi_ver[2],
ver.wi_ver[3], ver.wi_ver[1]);
sc->sc_prism2_ver = ver.wi_ver[2] * 100 +
ver.wi_ver[3] * 10 + ver.wi_ver[1];
} else {
- printf("\n%s: Firmware %i.%i, ", sc->sc_dev.dv_xname,
- ver.wi_ver[2], ver.wi_ver[3]);
+ printf("\n%s: Firmware %i.%i variant %i, ", WI_PRT_ARG(sc),
+ ver.wi_ver[2], ver.wi_ver[3], ver.wi_ver[1]);
}
return;
diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c
index 9432b795b0c..b7f0d8a9bce 100644
--- a/sys/dev/pci/if_wi_pci.c
+++ b/sys/dev/pci/if_wi_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_pci.c,v 1.2 2001/06/07 04:55:06 millert Exp $ */
+/* $OpenBSD: if_wi_pci.c,v 1.3 2001/06/11 00:50:38 millert Exp $ */
/*
* Copyright (c) 2001 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -113,7 +113,7 @@
int wi_pci_match __P((struct device *, void *, void *));
void wi_pci_attach __P((struct device *, struct device *, void *));
int wi_intr __P((void *));
-int wi_attach __P((struct wi_softc *));
+int wi_attach __P((struct wi_softc *, int));
struct cfattach wi_pci_ca = {
sizeof (struct wi_softc), wi_pci_match, wi_pci_attach
@@ -210,5 +210,5 @@ wi_pci_attach(parent, self, aux)
*/
bus_space_write_1(memt, memh, WI_COR_OFFSET, WI_COR_VALUE);
- wi_attach(sc);
+ wi_attach(sc, 1);
}
diff --git a/sys/dev/pcmcia/if_wi_pcmcia.c b/sys/dev/pcmcia/if_wi_pcmcia.c
index 8bc7f460710..18451a14503 100644
--- a/sys/dev/pcmcia/if_wi_pcmcia.c
+++ b/sys/dev/pcmcia/if_wi_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_pcmcia.c,v 1.5 2001/06/07 22:41:00 millert Exp $ */
+/* $OpenBSD: if_wi_pcmcia.c,v 1.6 2001/06/11 00:50:38 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -74,7 +74,7 @@ int wi_pcmcia_activate __P((struct device *, enum devact));
void wi_pcmcia_attach __P((struct device *, struct device *, void *));
int wi_intr __P((void *));
-int wi_attach __P((struct wi_softc *));
+int wi_attach __P((struct wi_softc *, int));
void wi_init __P((void *));
void wi_stop __P((struct wi_softc *));
@@ -285,7 +285,7 @@ wi_pcmcia_attach(parent, self, aux)
CSR_WRITE_2(sc, WI_INT_EN, 0);
CSR_WRITE_2(sc, WI_EVENT_ACK, 0xffff);
- wi_attach(sc);
+ wi_attach(sc, 0);
return;
bad: