diff -urN -x CVS -x compile -x SILVER -x RINA -x aic7xxx -x ata sys.org/isa/pnp.c sys.newmidi/isa/pnp.c --- sys.org/isa/pnp.c Wed Oct 20 10:39:21 1999 +++ sys.newmidi/isa/pnp.c Mon Feb 21 09:54:57 2000 @@ -54,6 +54,7 @@ u_int32_t logical_id; /* ID of the device with quirk */ int type; #define PNP_QUIRK_WRITE_REG 1 /* Need to write a pnp register */ +#define PNP_QUIRK_EXTRA_IO 2 /* Has extra io ports */ int arg1; int arg2; }; @@ -66,6 +67,24 @@ */ { 0x0100561e /* GRV0001 */, 0, PNP_QUIRK_WRITE_REG, 0xf2, 0xff }, + /* + * EMU8000 does not give us other than the first + * port. + */ + { 0x26008c0e /* SB16 */, 0x21008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, + { 0x42008c0e /* SB32(CTL0042) */, 0x21008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, + { 0x44008c0e /* SB32(CTL0044) */, 0x21008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, + { 0x49008c0e /* SB32(CTL0049) */, 0x21008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, + { 0xf1008c0e /* SB32(CTL00f1) */, 0x21008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, + { 0xc1008c0e /* SB64(CTL00c1) */, 0x22008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, + { 0xe4008c0e /* SB64(CTL00e4) */, 0x22008c0e, + PNP_QUIRK_EXTRA_IO, 0x400, 0x800 }, { 0 } }; @@ -363,8 +382,8 @@ /* * Process quirks for a logical device.. The card must be in Config state. */ -static void -pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn) +void +pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn, struct isa_config *config) { struct pnp_quirk *qp; @@ -377,6 +396,22 @@ pnp_write(PNP_SET_LDN, ldn); pnp_write(qp->arg1, qp->arg2); break; + case PNP_QUIRK_EXTRA_IO: + if (config == NULL) + break; + if (qp->arg1 != 0) { + config->ic_nport++; + config->ic_port[config->ic_nport - 1] = config->ic_port[0]; + config->ic_port[config->ic_nport - 1].ir_start += qp->arg1; + config->ic_port[config->ic_nport - 1].ir_end += qp->arg1; + } + if (qp->arg2 != 0) { + config->ic_nport++; + config->ic_port[config->ic_nport - 1] = config->ic_port[0]; + config->ic_port[config->ic_nport - 1].ir_start += qp->arg2; + config->ic_port[config->ic_nport - 1].ir_end += qp->arg2; + } + break; } } } @@ -461,7 +496,8 @@ */ if (startres) { pnp_parse_resources(dev, startres, - resinfo - startres - 1); + resinfo - startres - 1, + p->vendor_id, logical_id, ldn); dev = 0; startres = 0; } @@ -471,7 +507,7 @@ * resources. */ bcopy(resinfo, &logical_id, 4); - pnp_check_quirks(p->vendor_id, logical_id, ldn); + pnp_check_quirks(p->vendor_id, logical_id, ldn, NULL); compat_id = 0; dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1); if (desc) @@ -502,7 +538,8 @@ break; } pnp_parse_resources(dev, startres, - resinfo - startres - 1); + resinfo - startres - 1, + p->vendor_id, logical_id, ldn); dev = 0; startres = 0; scanning = 0; diff -urN -x CVS -x compile -x SILVER -x RINA -x aic7xxx -x ata sys.org/isa/pnpparse.c sys.newmidi/isa/pnpparse.c --- sys.org/isa/pnpparse.c Wed Oct 20 10:39:21 1999 +++ sys.newmidi/isa/pnpparse.c Mon Feb 21 09:54:57 2000 @@ -46,7 +46,7 @@ * case the return value will be TRUE, FALSE otherwise. */ void -pnp_parse_resources(device_t dev, u_char *resources, int len) +pnp_parse_resources(device_t dev, u_char *resources, int len, u_int32_t vendor_id, u_int32_t logical_id, int ldn) { device_t parent = device_get_parent(dev); u_char tag, *resp, *resinfo; @@ -184,6 +184,9 @@ config->ic_port[config->ic_nport].ir_align = resinfo[5]; config->ic_nport++; + pnp_check_quirks(vendor_id, + logical_id, + ldn, config); break; case PNP_TAG_IO_FIXED: diff -urN -x CVS -x compile -x SILVER -x RINA -x aic7xxx -x ata sys.org/isa/pnpvar.h sys.newmidi/isa/pnpvar.h --- sys.org/isa/pnpvar.h Tue Jan 4 09:56:23 2000 +++ sys.newmidi/isa/pnpvar.h Mon Feb 21 09:54:57 2000 @@ -53,7 +53,9 @@ | (PNP_HEXTONUM(s[5]) << 28)) char *pnp_eisaformat(u_int32_t id); -void pnp_parse_resources(device_t dev, u_char *resources, int len); +void pnp_parse_resources(device_t dev, u_char *resources, int len, u_int32_t vendor_id, u_int32_t logical_id, int ldn); + +void pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn, struct isa_config *config); #endif /* _KERNEL */