Fix page fault panic by probing NE200 compatible PCI card.
Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata)
This commit is contained in:
parent
88d08c78f7
commit
630b424dc0
@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ed.c,v 1.43 1998/03/29 12:48:46 kato Exp $
|
||||
* $Id: if_ed.c,v 1.44 1998/03/30 12:10:02 kato Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -419,7 +419,6 @@ ed_probe(isa_dev)
|
||||
* IO-DATA PCLA/T
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LPC) {
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_LPC;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_LPC);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -430,7 +429,6 @@ ed_probe(isa_dev)
|
||||
* Generic probe routine
|
||||
* Allied Telesis CenterCom LA-98-T
|
||||
*/
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_GENERIC;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_GENERIC);
|
||||
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) {
|
||||
@ -453,7 +451,6 @@ ed_probe(isa_dev)
|
||||
* Allied Telesis SIC-98
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_SIC) {
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_SIC;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_SIC);
|
||||
nports = ed_probe_SIC98(isa_dev);
|
||||
if (nports)
|
||||
@ -466,7 +463,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_BDN) {
|
||||
/* LD-BDN */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_BDN;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_BDN);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -479,7 +475,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LGY) {
|
||||
/* LGY-98 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_LGY;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_LGY);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -492,7 +487,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_ICM) {
|
||||
/* ICM */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_ICM;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_ICM);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -505,7 +499,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_EGY) {
|
||||
/* EGY-98 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_EGY;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_EGY);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -517,7 +510,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LA98) {
|
||||
/* LA-98 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_LA98;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_LA98);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -529,7 +521,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_108) {
|
||||
/* PC-9801-108 */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_108;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_108);
|
||||
nports = ed_probe_Novell(isa_dev);
|
||||
if (nports)
|
||||
@ -541,7 +532,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_CNET98EL) {
|
||||
/* C-NET(98)E/L */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_CNET98EL;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_CNET98EL);
|
||||
nports = ed_probe_CNET98EL(isa_dev);
|
||||
if (nports)
|
||||
@ -553,7 +543,6 @@ ed_probe(isa_dev)
|
||||
*/
|
||||
if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_CNET98) {
|
||||
/* C-NET(98) */
|
||||
ed_softc[isa_dev->id_unit].type = ED_TYPE98_CNET98;
|
||||
nports98 = pc98_set_register(isa_dev, ED_TYPE98_CNET98);
|
||||
nports = ed_probe_CNET98(isa_dev);
|
||||
if (nports)
|
||||
@ -1575,6 +1564,9 @@ ed_probe_pccard(isa_dev, ether)
|
||||
{
|
||||
int nports;
|
||||
|
||||
#ifdef PC98
|
||||
(void)pc98_set_register(isa_dev, ED_TYPE98_GENERIC);
|
||||
#endif
|
||||
nports = ed_probe_WD80x3(isa_dev);
|
||||
if (nports)
|
||||
return (nports);
|
||||
@ -2506,6 +2498,9 @@ ed_attach_NE2000_pci(unit, port)
|
||||
return sc;
|
||||
|
||||
bzero(sc, sizeof *sc);
|
||||
#ifdef PC98
|
||||
(void)pc98_set_register_unit(sc, ED_TYPE98_GENERIC, 0);
|
||||
#endif
|
||||
if (ed_probe_Novell_generic(sc, port, unit, isa_flags) == 0
|
||||
|| ed_attach(sc, unit, isa_flags) == 0) {
|
||||
free(sc, M_DEVBUF);
|
||||
|
@ -37,6 +37,7 @@
|
||||
#endif
|
||||
|
||||
static int pc98_set_register __P((struct isa_device *dev, int type));
|
||||
static int pc98_set_register_unit __P((struct ed_softc *sc, int type, int iobase));
|
||||
|
||||
/*
|
||||
* Vendor types
|
||||
@ -386,10 +387,16 @@ static unsigned int edp_cnet98[16] = {
|
||||
static int
|
||||
pc98_set_register(struct isa_device *dev, int type)
|
||||
{
|
||||
struct ed_softc *sc = &ed_softc[dev->id_unit];
|
||||
return pc98_set_register_unit(&ed_softc[dev->id_unit], type, dev->id_iobase);
|
||||
}
|
||||
|
||||
static int
|
||||
pc98_set_register_unit(struct ed_softc *sc, int type, int iobase)
|
||||
{
|
||||
int adj;
|
||||
int nports;
|
||||
|
||||
sc->type = type;
|
||||
switch (type) {
|
||||
case ED_TYPE98_GENERIC:
|
||||
sc->edreg.port = edp_generic;
|
||||
@ -470,9 +477,9 @@ pc98_set_register(struct isa_device *dev, int type)
|
||||
|
||||
case ED_TYPE98_108:
|
||||
sc->edreg.port = edp_nec108;
|
||||
adj = (dev->id_iobase & 0xf000) / 2;
|
||||
adj = (iobase & 0xf000) / 2;
|
||||
ED_NOVELL_NIC_OFFSET = 0;
|
||||
ED_NOVELL_ASIC_OFFSET = (0x888 | adj) - dev->id_iobase;
|
||||
ED_NOVELL_ASIC_OFFSET = (0x888 | adj) - iobase;
|
||||
ED_NOVELL_DATA = 0;
|
||||
ED_NOVELL_RESET = 2;
|
||||
ED_PC_MISC = 0x18;
|
||||
|
Loading…
x
Reference in New Issue
Block a user