Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/dev/pcmcia Pullup 1.64 [msaitoh]:
details: https://anonhg.NetBSD.org/src/rev/71a58a4cb568
branches: netbsd-1-5
changeset: 490151:71a58a4cb568
user: tv <tv%NetBSD.org@localhost>
date: Sun Nov 05 01:14:39 2000 +0000
description:
Pullup 1.64 [msaitoh]:
Fix two bugs.
- Doesn't fail ne_pcmcia_attach() if ne_pcmcia_ax88190_set_iobase() failed.
- Check whether LIOBASE register is writable or not (dirty hack!).
Fix PR. 11285
diffstat:
sys/dev/pcmcia/if_ne_pcmcia.c | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diffs (68 lines):
diff -r 821ef0fa666f -r 71a58a4cb568 sys/dev/pcmcia/if_ne_pcmcia.c
--- a/sys/dev/pcmcia/if_ne_pcmcia.c Sun Nov 05 01:09:49 2000 +0000
+++ b/sys/dev/pcmcia/if_ne_pcmcia.c Sun Nov 05 01:14:39 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ne_pcmcia.c,v 1.62 2000/05/25 17:21:48 mycroft Exp $ */
+/* $NetBSD: if_ne_pcmcia.c,v 1.62.4.1 2000/11/05 01:14:39 tv Exp $ */
/*
* Copyright (c) 1997 Marc Horowitz. All rights reserved.
@@ -624,8 +624,10 @@
}
if ((ne_dev->flags & NE2000DVF_AX88190) != 0) {
- if (ne_pcmcia_ax88190_set_iobase(psc))
- goto fail_5;
+ if (ne_pcmcia_ax88190_set_iobase(psc)) {
+ ++i;
+ goto again;
+ }
nsc->sc_type = NE2000_TYPE_AX88190;
typestr = " (AX88190)";
}
@@ -829,10 +831,13 @@
struct pcmcia_mem_handle pcmh;
bus_addr_t offset;
int rv = 1, mwindow;
+ u_int last_liobase, new_liobase;
if (pcmcia_mem_alloc(psc->sc_pf, NE2000_AX88190_LAN_IOSIZE, &pcmh)) {
+#if 0
printf("%s: can't alloc mem for LAN iobase\n",
dsc->sc_dev.dv_xname);
+#endif
goto fail_1;
}
if (pcmcia_mem_map(psc->sc_pf, PCMCIA_MEM_ATTR,
@@ -843,21 +848,25 @@
goto fail_2;
}
+ last_liobase = bus_space_read_1(pcmh.memt, pcmh.memh, offset + 0) |
+ (bus_space_read_1(pcmh.memt, pcmh.memh, offset + 2) << 8);
#ifdef DIAGNOSTIC
printf("%s: LAN iobase 0x%x (0x%x) ->", dsc->sc_dev.dv_xname,
- bus_space_read_1(pcmh.memt, pcmh.memh, offset + 0) |
- bus_space_read_1(pcmh.memt, pcmh.memh, offset + 2) << 8,
- (u_int)psc->sc_pcioh.addr);
+ last_liobase, (u_int)psc->sc_pcioh.addr);
#endif
bus_space_write_1(pcmh.memt, pcmh.memh, offset,
psc->sc_pcioh.addr & 0xff);
bus_space_write_1(pcmh.memt, pcmh.memh, offset + 2,
psc->sc_pcioh.addr >> 8);
+
+ new_liobase = bus_space_read_1(pcmh.memt, pcmh.memh, offset + 0) |
+ (bus_space_read_1(pcmh.memt, pcmh.memh, offset + 2) << 8);
#ifdef DIAGNOSTIC
- printf(" 0x%x\n", bus_space_read_1(pcmh.memt, pcmh.memh, offset + 0) |
- bus_space_read_1(pcmh.memt, pcmh.memh, offset + 2) << 8);
+ printf(" 0x%x\n", new_liobase);
#endif
- rv = 0;
+ if ((last_liobase == psc->sc_pcioh.addr)
+ || (last_liobase != new_liobase))
+ rv = 0;
pcmcia_mem_unmap(psc->sc_pf, mwindow);
fail_2:
Home |
Main Index |
Thread Index |
Old Index