summaryrefslogtreecommitdiffstats
path: root/sys/dev/lnc
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-07-20 17:33:01 +0000
committermsmith <msmith@FreeBSD.org>1998-07-20 17:33:01 +0000
commit164c653979d31d472c9de112e2889730a979afab (patch)
tree32b03a5d278f3cfd8c493a4d0c7c188649a96d24 /sys/dev/lnc
parent8f5a35b01d5b48f689f82f032749a60abbeaccad (diff)
downloadFreeBSD-src-164c653979d31d472c9de112e2889730a979afab.zip
FreeBSD-src-164c653979d31d472c9de112e2889730a979afab.tar.gz
Add support for PCNet PCI chips that only work when we talk to them as ISA
devices. Specifically fix the case for the Hitachi version as used in their VisionBook models. Submitted by: Ted Faber <faber@isi.edu>
Diffstat (limited to 'sys/dev/lnc')
-rw-r--r--sys/dev/lnc/if_lnc.c21
-rw-r--r--sys/dev/lnc/if_lnc_pci.c7
-rw-r--r--sys/dev/lnc/if_lncvar.h1
3 files changed, 25 insertions, 4 deletions
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c
index bff5d17..dd201a3 100644
--- a/sys/dev/lnc/if_lnc.c
+++ b/sys/dev/lnc/if_lnc.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_lnc.c,v 1.42 1998/05/27 11:05:17 paul Exp $
+ * $Id: if_lnc.c,v 1.43 1998/06/07 17:10:36 dfr Exp $
*/
/*
@@ -1145,6 +1145,14 @@ pcnet_probe(struct lnc_softc *sc)
* do NOT try to ISA attach the PCI version
*/
return (0);
+ case HITACHI_Am79C970:
+
+ /*
+ * PCI cards that should be attached in
+ * ISA mode should return this value. -- tvf
+ */
+
+ return (PCnet_PCI);
default:
break;
}
@@ -1274,7 +1282,16 @@ lnc_attach_ne2100_pci(int unit, unsigned iobase)
if (sc) {
bzero (sc, sizeof *sc);
- if ((ne2100_probe(sc, iobase) == 0)
+ /*
+ * ne2100_probe sets sc->nic.ic to PCnet_PCI for PCI
+ * cards that work in ISA emulation mode. The first
+ * clause this code avoids attaching such a card at
+ * this time to allow it to be picked up as an ISA
+ * card later. -- tvf
+ */
+
+ if (((ne2100_probe(sc, iobase) == 0) ||
+ sc->nic.ic == PCnet_PCI)
|| (lnc_attach_sc(sc, unit) == 0)) {
free(sc, M_DEVBUF);
sc = NULL;
diff --git a/sys/dev/lnc/if_lnc_pci.c b/sys/dev/lnc/if_lnc_pci.c
index f1ec939..3cffcab 100644
--- a/sys/dev/lnc/if_lnc_pci.c
+++ b/sys/dev/lnc/if_lnc_pci.c
@@ -17,7 +17,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: if_lnc_p.c,v 1.4 1997/04/04 16:44:52 kato Exp $
+ * $Id: if_lnc_p.c,v 1.5 1997/08/02 14:33:11 bde Exp $
*/
#include "pci.h"
@@ -74,7 +74,10 @@ lnc_pci_attach(config_id, unit)
unsigned iobase;
void *lnc; /* device specific data for interrupt handler ... */
- iobase = pci_conf_read(config_id, PCI_MAP_REG_START) & ~PCI_MAP_IO;
+ /* pci_map_port correctly initializes bridge chips -- tvf */
+
+ if ( !pci_map_port(config_id,PCI_MAP_REG_START,(u_short *)&iobase) )
+ printf("lnc%d: pci_port_map_attach failed?!\n",unit);
lnc = lnc_attach_ne2100_pci(unit, iobase);
if (!lnc)
diff --git a/sys/dev/lnc/if_lncvar.h b/sys/dev/lnc/if_lncvar.h
index 001ea68..8d628c7 100644
--- a/sys/dev/lnc/if_lncvar.h
+++ b/sys/dev/lnc/if_lncvar.h
@@ -83,6 +83,7 @@
#define Am79C961 0x2260
#define Am79C965 0x2430
#define Am79C970 0x0242
+#define HITACHI_Am79C970 0x2621
/* Board types */
#define UNKNOWN 0
OpenPOWER on IntegriCloud