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>
This commit is contained in:
Mike Smith 1998-07-20 17:33:01 +00:00
parent 7cb743ae28
commit 2512c3e67b
6 changed files with 50 additions and 8 deletions

View File

@ -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;

View File

@ -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)

View File

@ -83,6 +83,7 @@
#define Am79C961 0x2260
#define Am79C965 0x2430
#define Am79C970 0x0242
#define HITACHI_Am79C970 0x2621
/* Board types */
#define UNKNOWN 0

View File

@ -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;

View File

@ -83,6 +83,7 @@
#define Am79C961 0x2260
#define Am79C965 0x2430
#define Am79C970 0x0242
#define HITACHI_Am79C970 0x2621
/* Board types */
#define UNKNOWN 0

View File

@ -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)