diff options
-rw-r--r-- | sys/pc98/pc98/if_ed.c | 48 | ||||
-rw-r--r-- | sys/pc98/pc98/if_ed98.h | 19 |
2 files changed, 43 insertions, 24 deletions
diff --git a/sys/pc98/pc98/if_ed.c b/sys/pc98/pc98/if_ed.c index fa7318c..1b5aef8 100644 --- a/sys/pc98/pc98/if_ed.c +++ b/sys/pc98/pc98/if_ed.c @@ -434,6 +434,12 @@ ed_probe(isa_dev) struct isa_device *isa_dev; { int nports; +#ifdef PC98 + int nports98; +#define EDNPORTS nports98 +#else +#define EDNPORTS nports +#endif #if NCRD > 0 /* @@ -453,10 +459,10 @@ ed_probe(isa_dev) if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) || (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LPC)) { ed_softc[isa_dev->id_unit].type = ED_TYPE98_LPC; - pc98_set_register(isa_dev, ED_TYPE98_LPC); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_LPC); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -464,7 +470,7 @@ ed_probe(isa_dev) * Allied Telesis CenterCom LA-98-T */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_GENERIC; - pc98_set_register(isa_dev, ED_TYPE98_GENERIC); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_GENERIC); if (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) { #endif @@ -488,10 +494,10 @@ ed_probe(isa_dev) if ((ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_GENERIC) || (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_SIC)) { ed_softc[isa_dev->id_unit].type = ED_TYPE98_SIC; - pc98_set_register(isa_dev, ED_TYPE98_SIC); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_SIC); nports = ed_probe_SIC98(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -502,10 +508,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_BDN)) { /* LD-BDN */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_BDN; - pc98_set_register(isa_dev, ED_TYPE98_BDN); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_BDN); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -516,10 +522,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LGY)) { /* LGY-98 */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_LGY; - pc98_set_register(isa_dev, ED_TYPE98_LGY); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_LGY); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -530,10 +536,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_ICM)) { /* ICM */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_ICM; - pc98_set_register(isa_dev, ED_TYPE98_ICM); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_ICM); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -544,10 +550,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_EGY)) { /* EGY-98 */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_EGY; - pc98_set_register(isa_dev, ED_TYPE98_EGY); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_EGY); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -557,10 +563,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_LA98)) { /* LA-98 */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_LA98; - pc98_set_register(isa_dev, ED_TYPE98_LA98); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_LA98); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -570,10 +576,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_108)) { /* PC-9801-108 */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_108; - pc98_set_register(isa_dev, ED_TYPE98_108); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_108); nports = ed_probe_Novell(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -583,10 +589,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_CNET98EL)) { /* C-NET(98)E/L */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_CNET98EL; - pc98_set_register(isa_dev, ED_TYPE98_CNET98EL); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_CNET98EL); nports = ed_probe_CNET98EL(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } /* @@ -596,10 +602,10 @@ ed_probe(isa_dev) (ED_TYPE98(isa_dev->id_flags) == ED_TYPE98_CNET98)) { /* C-NET(98) */ ed_softc[isa_dev->id_unit].type = ED_TYPE98_CNET98; - pc98_set_register(isa_dev, ED_TYPE98_CNET98); + nports98 = pc98_set_register(isa_dev, ED_TYPE98_CNET98); nports = ed_probe_CNET98(isa_dev); if (nports) - return (nports); + return (EDNPORTS); } #endif diff --git a/sys/pc98/pc98/if_ed98.h b/sys/pc98/pc98/if_ed98.h index 1b38c70..f5835d3 100644 --- a/sys/pc98/pc98/if_ed98.h +++ b/sys/pc98/pc98/if_ed98.h @@ -36,7 +36,7 @@ #error Why you include if_ed98.h? #endif -static void pc98_set_register __P((struct isa_device *dev, int type)); +static int pc98_set_register __P((struct isa_device *dev, int type)); /* * Vendor types @@ -379,11 +379,12 @@ static unsigned int edp_cnet98[16] = { }; -static void +static int pc98_set_register(struct isa_device *dev, int type) { struct ed_softc *sc = &ed_softc[dev->id_unit]; int adj; + int nports; switch (type) { case ED_TYPE98_GENERIC: @@ -395,6 +396,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0x000f; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 32; break; case ED_TYPE98_LGY: @@ -406,6 +408,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0x0100; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 16; break; case ED_TYPE98_EGY: @@ -417,6 +420,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0x0100; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 16; break; case ED_TYPE98_ICM: @@ -428,6 +432,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0x000f; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 16; break; case ED_TYPE98_BDN: @@ -439,6 +444,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0xc100; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 1; break; case ED_TYPE98_SIC: @@ -450,6 +456,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0x00; ED_PC_MISC = 0x18; /* dummy */ ED_PC_RESET = 0x1f; /* dummy */ + nports = 1; break; case ED_TYPE98_LPC: @@ -461,6 +468,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0x0200; ED_PC_MISC = 0x108; ED_PC_RESET = 0x10f; + nports = 16; break; case ED_TYPE98_108: @@ -473,6 +481,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 4; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 16; break; case ED_TYPE98_LA98: @@ -484,6 +493,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_RESET = 0xf000; ED_PC_MISC = 0x18; ED_PC_RESET = 0x1f; + nports = 1; break; case ED_TYPE98_CNET98EL: @@ -494,6 +504,7 @@ pc98_set_register(struct isa_device *dev, int type) ED_NOVELL_DATA = 0x000e; ED_NOVELL_RESET = 0x0000; /* dummy */ ED_PC_RESET = 0x1f; + nports = 16; break; case ED_TYPE98_CNET98: @@ -501,11 +512,13 @@ pc98_set_register(struct isa_device *dev, int type) sc->edreg.ioskip = 2; ED_NOVELL_NIC_OFFSET = 0; ED_NOVELL_ASIC_OFFSET = 0x0400; - ED_NOVELL_DATA = 0x000e; + ED_NOVELL_DATA = 0x0000; ED_NOVELL_RESET = 0x0000; /* dummy */ ED_PC_RESET = 0x1f; + nports = 16; break; } + return nports; } #endif /* __PC98_PC98_IF_ED98_H__ */ |