Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pcmcia Sync awi_pcmcia_get_enaddr with mbe_pcmcia_ge...
details: https://anonhg.NetBSD.org/src/rev/3a5f57f0d14e
branches: trunk
changeset: 481524:3a5f57f0d14e
user: enami <enami%NetBSD.org@localhost>
date: Tue Feb 01 08:52:05 2000 +0000
description:
Sync awi_pcmcia_get_enaddr with mbe_pcmcia_get_enaddr.
diffstat:
sys/dev/pcmcia/if_awi_pcmcia.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diffs (68 lines):
diff -r a928c903125a -r 3a5f57f0d14e sys/dev/pcmcia/if_awi_pcmcia.c
--- a/sys/dev/pcmcia/if_awi_pcmcia.c Tue Feb 01 08:43:25 2000 +0000
+++ b/sys/dev/pcmcia/if_awi_pcmcia.c Tue Feb 01 08:52:05 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_awi_pcmcia.c,v 1.5 1999/11/06 16:43:54 sommerfeld Exp $ */
+/* $NetBSD: if_awi_pcmcia.c,v 1.6 2000/02/01 08:52:05 enami Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -130,7 +130,6 @@
*/
struct awi_pcmcia_get_enaddr_args {
- int got_enaddr;
u_int8_t enaddr[ETHER_ADDR_LEN];
};
int awi_pcmcia_get_enaddr __P((struct pcmcia_tuple *, void *));
@@ -249,7 +248,7 @@
struct pcmcia_mem_handle memh;
struct awi_pcmcia_get_enaddr_args pgea;
bus_addr_t memoff;
- int memwin;
+ int memwin, rv;
#if 0
int i, j;
@@ -322,21 +321,26 @@
sc->sc_disable = awi_pcmcia_disable;
/* Read station address. */
- pgea.got_enaddr = 0;
- if (pcmcia_scan_cis(parent, awi_pcmcia_get_enaddr, &pgea) == -1) {
+ rv = pcmcia_scan_cis(parent, awi_pcmcia_get_enaddr, &pgea);
+ if (rv == -1) {
printf("%s: Couldn't read CIS to get ethernet address\n",
sc->sc_dev.dv_xname);
return;
- } else if (!pgea.got_enaddr) {
+ } else if (rv == 0) {
printf("%s: Couldn't get ethernet address from CIS\n",
sc->sc_dev.dv_xname);
return;
- } else
+ }
+
#ifdef DIAGNOSTIC
- printf("%s: Ethernet address from CIS: %s\n",
- sc->sc_dev.dv_xname, ether_sprintf(pgea.enaddr))
+ if (rv != 1) {
+ printf("%s: pcmcia_scan_cis returns %d\n", sc->sc_dev.dv_xname,
+ rv);
+ panic("awi_pcmcia_attach");
+ }
+ printf("%s: Ethernet address from CIS: %s\n",
+ sc->sc_dev.dv_xname, ether_sprintf(pgea.enaddr));
#endif
- ;
awi_attach(sc, pgea.enaddr);
@@ -396,7 +400,6 @@
for (i = 0; i < ETHER_ADDR_LEN; i++)
p->enaddr[i] = pcmcia_tuple_read_1(tuple, i + 2);
- p->got_enaddr = 1;
return (1);
}
return (0);
Home |
Main Index |
Thread Index |
Old Index