Ne2000-compatibles: Fix IRQ's (this will break RSET8019 again, I'm trying to understand now to fix it).

This commit is contained in:
OBattler
2025-09-26 18:20:06 +02:00
parent 086f955e7e
commit 60bef8bb48
2 changed files with 6 additions and 6 deletions

View File

@@ -186,7 +186,7 @@ isapnp_device_config_changed(isapnp_card_t *card, isapnp_device_t *ld)
for (uint8_t i = 0; i < 2; i++) {
reg_base = 0x70 + (2 * i);
card->config.irq[i].irq = ld->regs[reg_base];
card->config.irq[i].level = ld->regs[reg_base + 1] & 0x02;
card->config.irq[i].level = !!(ld->regs[reg_base + 1] & 0x02);
card->config.irq[i].type = ld->regs[reg_base + 1] & 0x01;
}
for (uint8_t i = 0; i < 2; i++) {
@@ -268,13 +268,13 @@ isapnp_reset_ld_regs(isapnp_device_t *ld)
/* Set the default IRQ type bits. */
for (uint8_t i = 0; i < 2; i++) {
if (ld->irq_types & (0x1 << (4 * i)))
ld->regs[0x70 + (2 * i)] = 0x02;
ld->regs[0x71 + (2 * i)] = 0x02;
else if (ld->irq_types & (0x2 << (4 * i)))
ld->regs[0x70 + (2 * i)] = 0x00;
ld->regs[0x71 + (2 * i)] = 0x00;
else if (ld->irq_types & (0x4 << (4 * i)))
ld->regs[0x70 + (2 * i)] = 0x03;
ld->regs[0x71 + (2 * i)] = 0x03;
else if (ld->irq_types & (0x8 << (4 * i)))
ld->regs[0x70 + (2 * i)] = 0x01;
ld->regs[0x71 + (2 * i)] = 0x01;
}
/* Reset configuration registers to match the default configuration. */

View File

@@ -155,7 +155,7 @@ nic_interrupt(void *priv, int set)
nic_t *dev = (nic_t *) priv;
int enabled = 1;
if (dev->irq_level)
if (!dev->irq_level)
set ^= 1;
if (dev->board == NE2K_RTL8019AS_PNP)