Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ed/if_ed_cbus.c
Context not available. | |||||
{ | { | ||||
struct ed_softc *sc = device_get_softc(dev); | struct ed_softc *sc = device_get_softc(dev); | ||||
int error; | int error; | ||||
u_long conf_maddr, conf_msize; | rman_res_t conf_maddr, conf_msize; | ||||
error = bus_get_resource(dev, SYS_RES_MEMORY, 0, &conf_maddr, | error = bus_get_resource(dev, SYS_RES_MEMORY, 0, &conf_maddr, | ||||
&conf_msize); | &conf_msize); | ||||
Context not available. | |||||
struct ed_softc *sc = device_get_softc(dev); | struct ed_softc *sc = device_get_softc(dev); | ||||
int error; | int error; | ||||
u_char tmp; | u_char tmp; | ||||
u_long conf_irq, junk; | rman_res_t conf_irq, junk; | ||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
u_char tmp_s; | u_char tmp_s; | ||||
#endif | #endif | ||||
Context not available. | |||||
if (((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) | if (((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) | ||||
|| ((rman_get_start(sc->port_res) & 0xf000) < (u_short) 0xa000)) { | || ((rman_get_start(sc->port_res) & 0xf000) < (u_short) 0xa000)) { | ||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
device_printf(dev, "Invalid i/o port configuration (0x%lx) " | device_printf(dev, "Invalid i/o port configuration (0x%jx) " | ||||
"must be %s for %s\n", rman_get_start(sc->port_res), | "must be %s for %s\n", rman_get_start(sc->port_res), | ||||
"0x[a-f]3d0", "CNET98"); | "0x[a-f]3d0", "CNET98"); | ||||
#endif | #endif | ||||
Context not available. | |||||
/* Check window area address */ | /* Check window area address */ | ||||
tmp_s = rman_get_start(sc->mem_res) >> 12; | tmp_s = rman_get_start(sc->mem_res) >> 12; | ||||
if (tmp_s < 0x80) { | if (tmp_s < 0x80) { | ||||
device_printf(dev, "Please change window address(0x%lx)\n", | device_printf(dev, "Please change window address(0x%jx)\n", | ||||
rman_get_start(sc->mem_res)); | rman_get_start(sc->mem_res)); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. | |||||
tmp_s &= 0x0f; | tmp_s &= 0x0f; | ||||
tmp = rman_get_start(sc->port_res) >> 12; | tmp = rman_get_start(sc->port_res) >> 12; | ||||
if ((tmp_s <= tmp) && (tmp < (tmp_s + 4))) { | if ((tmp_s <= tmp) && (tmp < (tmp_s + 4))) { | ||||
device_printf(dev, "Please change iobase address(0x%lx) " | device_printf(dev, "Please change iobase address(0x%jx) " | ||||
"or window address(0x%lx)\n", | "or window address(0x%jx)\n", | ||||
rman_get_start(sc->port_res), | rman_get_start(sc->port_res), | ||||
rman_get_start(sc->mem_res)); | rman_get_start(sc->mem_res)); | ||||
return (ENXIO); | return (ENXIO); | ||||
Context not available. | |||||
tmp = ED_CNET98_INT_IRQ13; | tmp = ED_CNET98_INT_IRQ13; | ||||
break; | break; | ||||
default: | default: | ||||
device_printf(dev, "Invalid irq configuration (%ld) must be " | device_printf(dev, "Invalid irq configuration (%jd) must be " | ||||
"%s for %s\n", conf_irq, "3,5,6,9,12,13", "CNET98"); | "%s for %s\n", conf_irq, "3,5,6,9,12,13", "CNET98"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. | |||||
int error; | int error; | ||||
int i; | int i; | ||||
u_char romdata[ETHER_ADDR_LEN * 2], tmp; | u_char romdata[ETHER_ADDR_LEN * 2], tmp; | ||||
u_long conf_irq, junk; | rman_res_t conf_irq, junk; | ||||
error = ed98_alloc_port(dev, port_rid); | error = ed98_alloc_port(dev, port_rid); | ||||
if (error) | if (error) | ||||
Context not available. | |||||
/* Check I/O address. 0x[0-f]3d0 are allowed. */ | /* Check I/O address. 0x[0-f]3d0 are allowed. */ | ||||
if ((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) { | if ((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) { | ||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
device_printf(dev, "Invalid i/o port configuration (0x%lx) " | device_printf(dev, "Invalid i/o port configuration (0x%jx) " | ||||
"must be %s for %s\n", rman_get_start(sc->port_res), | "must be %s for %s\n", rman_get_start(sc->port_res), | ||||
"0x?3d0", "CNET98E/L"); | "0x?3d0", "CNET98E/L"); | ||||
#endif | #endif | ||||
Context not available. | |||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
device_printf(dev, "Invalid irq configuration (%ld) must be " | device_printf(dev, "Invalid irq configuration (%jd) must be " | ||||
"%s for %s\n", conf_irq, "3,5,6", "CNET98E/L"); | "%s for %s\n", conf_irq, "3,5,6", "CNET98E/L"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. | |||||
struct ed_softc *sc = device_get_softc(dev); | struct ed_softc *sc = device_get_softc(dev); | ||||
int error; | int error; | ||||
u_char tmp; | u_char tmp; | ||||
u_long conf_irq, junk; | rman_res_t conf_irq, junk; | ||||
error = ed98_probe_Novell(dev, port_rid, flags); | error = ed98_probe_Novell(dev, port_rid, flags); | ||||
if (error) | if (error) | ||||
Context not available. | |||||
tmp = ED_NEC77_IRQ13; | tmp = ED_NEC77_IRQ13; | ||||
break; | break; | ||||
default: | default: | ||||
device_printf(dev, "Invalid irq configuration (%ld) must be " | device_printf(dev, "Invalid irq configuration (%jd) must be " | ||||
"%s for %s\n", conf_irq, "3,5,6,12,13", "PC-9801-77"); | "%s for %s\n", conf_irq, "3,5,6,12,13", "PC-9801-77"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. | |||||
struct ed_softc *sc = device_get_softc(dev); | struct ed_softc *sc = device_get_softc(dev); | ||||
int error; | int error; | ||||
u_char tmp; | u_char tmp; | ||||
u_long conf_irq, junk; | rman_res_t conf_irq, junk; | ||||
error = ed98_probe_Novell(dev, port_rid, flags); | error = ed98_probe_Novell(dev, port_rid, flags); | ||||
if (error) | if (error) | ||||
Context not available. | |||||
tmp = ED_NW98X_IRQ13; | tmp = ED_NW98X_IRQ13; | ||||
break; | break; | ||||
default: | default: | ||||
device_printf(dev, "Invalid irq configuration (%ld) must be " | device_printf(dev, "Invalid irq configuration (%jd) must be " | ||||
"%s for %s\n", conf_irq, "3,5,6,12,13", "EC/EP-98X"); | "%s for %s\n", conf_irq, "3,5,6,12,13", "EC/EP-98X"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. | |||||
struct ed_softc *sc = device_get_softc(dev); | struct ed_softc *sc = device_get_softc(dev); | ||||
int error; | int error; | ||||
u_char tmp; | u_char tmp; | ||||
u_long conf_irq, junk; | rman_res_t conf_irq, junk; | ||||
error = ed98_alloc_port(dev, port_rid); | error = ed98_alloc_port(dev, port_rid); | ||||
if (error) | if (error) | ||||
Context not available. | |||||
/* Check I/O address. 00d[02468ace] are allowed. */ | /* Check I/O address. 00d[02468ace] are allowed. */ | ||||
if ((rman_get_start(sc->port_res) & ~0x000e) != 0x00d0) { | if ((rman_get_start(sc->port_res) & ~0x000e) != 0x00d0) { | ||||
#ifdef DIAGNOSTIC | #ifdef DIAGNOSTIC | ||||
device_printf(dev, "Invalid i/o port configuration (0x%lx) " | device_printf(dev, "Invalid i/o port configuration (0x%jx) " | ||||
"must be %s for %s\n", rman_get_start(sc->port_res), | "must be %s for %s\n", rman_get_start(sc->port_res), | ||||
"0xd?", "SB9801"); | "0xd?", "SB9801"); | ||||
#endif | #endif | ||||
Context not available. | |||||
tmp = ED_SB98_CFG_IRQ12; | tmp = ED_SB98_CFG_IRQ12; | ||||
break; | break; | ||||
default: | default: | ||||
device_printf(dev, "Invalid irq configuration (%ld) must be " | device_printf(dev, "Invalid irq configuration (%jd) must be " | ||||
"%s for %s\n", conf_irq, "3,5,6,12", "SB9801"); | "%s for %s\n", conf_irq, "3,5,6,12", "SB9801"); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
Context not available. |