Actually fix Loopback interrupt.

Fixes Netware related sessions with the ne2000 and possibly other dp8390-based cards.
This commit is contained in:
TC1995
2025-07-09 21:34:59 +02:00
parent 18fea33833
commit eea13448db
5 changed files with 64 additions and 62 deletions

View File

@@ -45,6 +45,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <wchar.h>
#include <time.h>

View File

@@ -19,6 +19,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <wchar.h>
#include <time.h>
@@ -198,6 +199,11 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
if (dev->TCR.loop_cntl) {
dp8390_rx_common(dev, &dev->mem[((dev->tx_page_start * 256) - dev->mem_start) & dev->mem_wrap],
dev->tx_bytes);
if (dev->IMR.rx_inte && !dev->ISR.pkt_tx && dev->interrupt)
dev->interrupt(dev->priv, 1);
dev->ISR.pkt_tx = 1;
}
} else if (val & 0x04) {
if (dev->CR.stop || (!dev->CR.start && (dev->flags & DP8390_FLAG_CHECK_CR))) {
@@ -220,12 +226,6 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
if (!(dev->card->link_state & NET_LINK_DOWN))
network_tx(dev->card, &dev->mem[((dev->tx_page_start * 256) - dev->mem_start) & dev->mem_wrap], dev->tx_bytes);
/* some more debug */
#ifdef ENABLE_DP8390_LOG
if (dev->tx_timer_active)
dp8390_log("DP8390: CR write, tx timer still active\n");
#endif
dp8390_tx(dev, val);
}
@@ -247,12 +247,12 @@ dp8390_tx(dp8390_t *dev, UNUSED(uint32_t val))
{
dev->CR.tx_packet = 0;
dev->TSR.tx_ok = 1;
dev->ISR.pkt_tx = 1;
/* Generate an interrupt if not masked */
if (dev->IMR.tx_inte && dev->interrupt)
if (dev->IMR.tx_inte && !dev->ISR.pkt_tx && dev->interrupt)
dev->interrupt(dev->priv, 1);
dev->tx_timer_active = 0;
dev->ISR.pkt_tx = 1;
}
/*
@@ -960,7 +960,6 @@ dp8390_reset(dp8390_t *dev)
memset(&dev->TCR, 0x00, sizeof(dev->TCR));
memset(&dev->TSR, 0x00, sizeof(dev->TSR));
memset(&dev->RSR, 0x00, sizeof(dev->RSR));
dev->tx_timer_active = 0;
dev->local_dma = 0;
dev->page_start = 0;
dev->page_stop = 0;

View File

@@ -48,6 +48,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <wchar.h>
#include <time.h>
@@ -933,7 +934,7 @@ nic_init(const device_t *info)
if (dev->board != NE2K_ETHERNEXT_MC) {
dev->base_address = device_get_config_hex16("base");
dev->base_irq = device_get_config_int("irq");
if ((dev->board == NE2K_NE2000) || (dev->board == NE2K_NE2000_COMPAT) ||
if ((dev->board == NE2K_NE2000) || (dev->board == NE2K_NE2000_COMPAT) ||
(dev->board == NE2K_NE2000_COMPAT_8BIT) ) {
dev->bios_addr = device_get_config_hex20("bios_addr");
dev->has_bios = !!dev->bios_addr;
@@ -1061,7 +1062,7 @@ nic_init(const device_t *info)
break;
}
if (set_oui) {
/* See if we have a local MAC address configured. */
mac_oui = device_get_config_mac("mac_oui", -1);
@@ -1742,7 +1743,7 @@ const device_t ne2000_compat_device = {
const device_t ne2000_compat_8bit_device = {
.name = "NE2000 Compatible 8-bit",
.internal_name = "ne2k8",
.flags = DEVICE_ISA,
.flags = DEVICE_ISA,
.local = NE2K_NE2000_COMPAT_8BIT,
.init = nic_init,
.close = nic_close,

View File

@@ -44,6 +44,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <wchar.h>
#include <time.h>