Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa PR/22058: Onno van der Linden: duplicate detecti...



details:   https://anonhg.NetBSD.org/src/rev/0debbf752617
branches:  trunk
changeset: 580870:0debbf752617
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 12 18:53:08 2005 +0000

description:
PR/22058: Onno van der Linden: duplicate detection of isa ip.
Use some more undocumented bits to find out if the card is in pnp mode or not.

diffstat:

 sys/dev/isa/if_ep_isa.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (62 lines):

diff -r 0a859a4168ab -r 0debbf752617 sys/dev/isa/if_ep_isa.c
--- a/sys/dev/isa/if_ep_isa.c   Thu May 12 16:17:30 2005 +0000
+++ b/sys/dev/isa/if_ep_isa.c   Thu May 12 18:53:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ep_isa.c,v 1.35 2005/02/04 02:10:40 perry Exp $     */
+/*     $NetBSD: if_ep_isa.c,v 1.36 2005/05/12 18:53:08 christos Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ep_isa.c,v 1.35 2005/02/04 02:10:40 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ep_isa.c,v 1.36 2005/05/12 18:53:08 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -165,7 +165,7 @@
        bus_space_tag_t iot = ia->ia_iot;
        bus_space_handle_t ioh;
        int slot, iobase, irq, i;
-       u_int16_t vendor, model;
+       u_int16_t vendor, model, eeprom_addr_cfg;
        struct ep_isa_done_probe *er;
        int bus = parent->dv_unit;
 
@@ -229,8 +229,8 @@
                        continue;
                        }
 
-               iobase = epreadeeprom(iot, ioh, EEPROM_ADDR_CFG);
-               iobase = (iobase & 0x1f) * 0x10 + 0x200;
+               eeprom_addr_cfg = epreadeeprom(iot, ioh, EEPROM_ADDR_CFG);
+               iobase = (eeprom_addr_cfg & 0x1f) * 0x10 + 0x200;
 
                irq = epreadeeprom(iot, ioh, EEPROM_RESOURCE_CFG);
                irq >>= 12;
@@ -281,7 +281,7 @@
                        else if ((eepromrev & 0xF) < 1) {
                                /* 3C509B is adapter revision level 1. */
 #if 0
-                               printf("ep_isa_probe revision level 0\n");
+                               printf("ep_isa_probe: revision level 0\n");
 #endif
                        }
                        else if (eeprom_cap != 0x2083) {
@@ -293,10 +293,11 @@
                        else
                          /*
                           * we have a 3c509B with PnP capabilities.
-                          * Test partly documented bit which toggles when
-                          * in  PnP mode.
+                          * Test partly documented bits which toggle when
+                          * in PnP mode.
                           */
-                       if ((eeprom_hi & 8) != 0) {
+                       if ((eeprom_hi & 0x8) != 0 || ((eeprom_hi & 0xc) == 0 &&
+                           (eeprom_addr_cfg & 0x80) != 0)) {
                                printf("3COM 3C509B Ethernet card in PnP mode\n");
                                continue;
                        }



Home | Main Index | Thread Index | Old Index