ISA PnP and RTL8019AS: More fixes - fixes I/O range check errors in jumperless mode.

This commit is contained in:
OBattler
2025-09-25 05:45:14 +02:00
parent f0b20fddd5
commit e7645e5c39
2 changed files with 43 additions and 9 deletions

View File

@@ -172,6 +172,19 @@ nic_interrupt(void *priv, int set)
}
}
static void
nic_config_reset(void *priv)
{
nic_t *dev = (nic_t *) priv;
uint8_t *data = (uint8_t *) nmc93cxx_eeprom_data(dev->eeprom);
dev->config1 = (data[0x00] & 0x7f) | 0x80;
dev->config2 = (data[0x01] & 0xdf);
dev->config3 = (data[0x02] & 0xf7);
isapnp_set_normal(dev->pnp_card, !!(dev->config3 & 0x80));
}
/* reset - restore state to power-up, cancelling all i/o */
static void
nic_reset(void *priv)
@@ -181,6 +194,9 @@ nic_reset(void *priv)
nelog(1, "%s: reset\n", dev->name);
dp8390_reset(dev->dp8390);
if (dev->board >= NE2K_RTL8019AS_PNP)
nic_config_reset(priv);
}
static void
@@ -189,6 +205,9 @@ nic_soft_reset(void *priv)
nic_t *dev = (nic_t *) priv;
dp8390_soft_reset(dev->dp8390);
if (dev->board >= NE2K_RTL8019AS_PNP)
nic_config_reset(priv);
}
/*
@@ -423,7 +442,7 @@ page3_write(nic_t *dev, uint32_t off, uint32_t val, UNUSED(unsigned len))
dev->config1 = (data[0x00] & 0x7f) | 0x80;
dev->config2 = (data[0x01] & 0xdf);
dev->config3 = (data[0x02] & 0x77) | 0x80;
dev->config3 = (data[0x02] & 0xf7);
dev->_9346cr = 0x21;
isapnp_set_normal(dev->pnp_card, !!(dev->config3 & 0x80));
@@ -1957,7 +1976,7 @@ const device_t rtl8019as_pnp_device = {
.local = NE2K_RTL8019AS_PNP,
.init = nic_init,
.close = nic_close,
.reset = NULL,
.reset = nic_config_reset,
.available = rtl8019as_available,
.speed_changed = NULL,
.force_redraw = NULL,
@@ -1971,7 +1990,7 @@ const device_t de220p_device = {
.local = NE2K_DE220P,
.init = nic_init,
.close = nic_close,
.reset = NULL,
.reset = nic_config_reset,
.available = de220p_available,
.speed_changed = NULL,
.force_redraw = NULL,
@@ -1985,7 +2004,7 @@ const device_t rtl8029as_device = {
.local = NE2K_RTL8029AS,
.init = nic_init,
.close = nic_close,
.reset = NULL,
.reset = nic_config_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,