From c1858212e80a6db526dc963a0a0c4a6ac1e1105d Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Mon, 22 Mar 2021 21:55:19 -0300 Subject: [PATCH] Change NE2000 PnP config function to be more in line with other devices --- src/network/net_ne2000.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/net_ne2000.c b/src/network/net_ne2000.c index 64814221c..0f9289e49 100644 --- a/src/network/net_ne2000.c +++ b/src/network/net_ne2000.c @@ -111,7 +111,6 @@ typedef struct { uint8_t eeprom[128]; /* for RTL8029AS */ rom_t bios_rom; void *pnp_card; - uint8_t pnp_activate; uint8_t pnp_csnsav; uint8_t maclocal[6]; /* configured MAC (local) address */ @@ -502,19 +501,20 @@ static void nic_ioremove(nic_t *dev, uint16_t addr); static void nic_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv) { - if (ld != 0) + if (ld) return; nic_t *dev = (nic_t *) priv; - if (dev->pnp_activate) + if (dev->base_address) { nic_ioremove(dev, dev->base_address); + dev->base_address = 0; + } dev->base_address = config->io[0].base; dev->base_irq = config->irq[0].irq; - dev->pnp_activate = config->activate; - if (dev->pnp_activate && (dev->base_address != ISAPNP_IO_DISABLED) && (dev->base_irq != ISAPNP_IRQ_DISABLED)) + if (config->activate && (dev->base_address != ISAPNP_IO_DISABLED)) nic_ioset(dev, dev->base_address); }