--- tdfx_pci.c.old Sun Aug 6 20:59:10 2000 +++ tdfx_pci.c Sun Aug 6 21:03:11 2000 @@ -689,14 +689,13 @@ /* Restricts the access of ports other than those we use */ if(tdfx_info->pio0 != 0) { - if(((piod->port != VGA_INPUT_STATUS_1C) || (piod->port != SC_INDEX) || - (piod->port != SC_DATA) || (piod->port != VGA_MISC_OUTPUT_READ)) && - (piod->port < tdfx_info->pio0) && - (piod->port > (tdfx_info->pio0 + 0x00ff))) + if(((piod->port != VGA_INPUT_STATUS_1C) && (piod->port != SC_INDEX) && + (piod->port != SC_DATA) && (piod->port != VGA_MISC_OUTPUT_READ)) && + ((piod->port & 0xff00) != (tdfx_info->pio0 & 0xff00))) return -EPERM; } else { - if((piod->port != VGA_INPUT_STATUS_1C) || (piod->port != SC_INDEX) || - (piod->port != SC_DATA) || (piod->port != VGA_MISC_OUTPUT_READ)) + if((piod->port != VGA_INPUT_STATUS_1C) && (piod->port != SC_INDEX) && + (piod->port != SC_DATA) && (piod->port != VGA_MISC_OUTPUT_READ)) return -EPERM; } @@ -722,14 +721,13 @@ tdfx_softc*)devclass_get_softc(tdfx_devclass, piod->device); /* Replace old switch w/ massive if(...) */ if(tdfx_info->pio0 != 0) { - if(((piod->port != VGA_INPUT_STATUS_1C) || (piod->port != SC_INDEX) || - (piod->port != SC_DATA) || (piod->port != VGA_MISC_OUTPUT_READ)) && - (piod->port < tdfx_info->pio0) && - (piod->port > (tdfx_info->pio0 + 0x00ff))) + if(((piod->port != VGA_INPUT_STATUS_1C) && (piod->port != SC_INDEX) && + (piod->port != SC_DATA) && (piod->port != VGA_MISC_OUTPUT_READ) && + (piod->port & 0xff00) != (tdfx_info->pio0 & 0xff00))) return -EPERM; } else { - if((piod->port != VGA_INPUT_STATUS_1C) || (piod->port != SC_INDEX) || - (piod->port != SC_DATA) || (piod->port != VGA_MISC_OUTPUT_READ)) + if((piod->port != VGA_INPUT_STATUS_1C) && (piod->port != SC_INDEX) && + (piod->port != SC_DATA) && (piod->port != VGA_MISC_OUTPUT_READ)) return -EPERM; }