WARNING: CONFIGS MIGHT PARTIALLY BREAK WHERE DEVICE NAMES HAVE CHANGED.

Changes to device_t struct to accomodate the upcoming PCI IRQ arbitration rewrite;
Added device.c/h API to obtain name from the device_t struct;
Significant changes to win/win_settings.c to clean up the code a bit and fix bugs;
Ported all the CPU and AudioPCI commits from PCem;
Added an API call to allow ACPI soft power off to gracefully stop the emulator;
Removed the Siemens PCD-2L from the Dev branch because it now works;
Removed the Socket 5 HP Vectra from the Dev branch because it now works;
Fixed the Compaq Presario and the Micronics Spitfire;
Give the IBM PC330 its own list of 486 CPU so it can have DX2's with CPUID 0x470;
SMM fixes;
Rewrote the SYSENTER, SYSEXIT, SYSCALL, and SYSRET instructions;
Changed IDE reset period to match the specification, fixes #929;
The keyboard input and output ports are now forced in front of the queue when read, fixes a number of bugs, including the AMI Apollo hanging on soft reset;
Added the Intel AN430TX but Dev branched because it does not work;
The network code no longer drops packets if the emulated network card has failed to receive them (eg. when the buffer is full);
Changes to PCI card adding and renamed some PCI slot types, also added proper AGP bridge slot types;
USB UHCI emulation is no longer a stub (still doesn't fully work, but at least Windows XP chk with Debug no longer ASSERT's on it);
Fixed NVR on the the SMC FDC37C932QF and APM variants;
A number of fixes to Intel 4x0 chipsets, including fixing every register of the 440LX and 440EX;
Some ACPI changes.
This commit is contained in:
OBattler
2020-11-16 00:01:21 +01:00
parent 745460f64b
commit 0faf6692c9
260 changed files with 5122 additions and 4471 deletions

View File

@@ -639,7 +639,7 @@ threec503_nic_close(void *priv)
static const device_config_t threec503_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300,
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x250", 0x250
@@ -669,11 +669,9 @@ static const device_config_t threec503_config[] =
"", 0
}
},
{ { NULL, { NULL } } },
{ 0, 0, 0 }
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2", 2
@@ -691,11 +689,9 @@ static const device_config_t threec503_config[] =
"", 0
}
},
{ { NULL, { NULL } } },
{ 0, 0, 0 }
},
{
"dma", "DMA", CONFIG_SELECTION, "", 3,
"dma", "DMA", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"DMA 1", 1
@@ -710,21 +706,17 @@ static const device_config_t threec503_config[] =
"", 0
}
},
{ { NULL, { NULL } } },
{ 0, 0, 0 }
},
{
"mac", "MAC Address", CONFIG_MAC, "", -1,
"mac", "MAC Address", CONFIG_MAC, "", -1, "", { 0 },
{
{
"", 0
}
},
{ { NULL, { NULL } } },
{ 0, 0, 0 }
},
{
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0xCC000,
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0xCC000, "", { 0 },
{
{
"DC00", 0xDC000
@@ -742,18 +734,9 @@ static const device_config_t threec503_config[] =
"", 0
}
},
{ { NULL, { NULL } } },
{ 0, 0, 0 }
},
{
"", "", -1, "", -1,
{
{
"", 0
}
},
{ { NULL, { NULL } } },
{ 0, 0, 0 }
"", "", -1
}
};
@@ -763,6 +746,6 @@ const device_t threec503_device = {
DEVICE_ISA,
0,
threec503_nic_init, threec503_nic_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
threec503_config
};

View File

@@ -30,7 +30,8 @@
static void dp8390_tx(dp8390_t *dev, uint32_t val);
void dp8390_rx(void *priv, uint8_t *buf, int io_len);
static int dp8390_rx_common(void *priv, uint8_t *buf, int io_len);
int dp8390_rx(void *priv, uint8_t *buf, int io_len);
#ifdef ENABLE_DP8390_LOG
@@ -204,7 +205,7 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
/* Check for start-tx */
if ((val & 0x04) && dev->TCR.loop_cntl) {
if (dev->TCR.loop_cntl) {
dp8390_rx(dev, &dev->mem[(dev->tx_page_start * 256) - dev->mem_start],
dp8390_rx_common(dev, &dev->mem[(dev->tx_page_start * 256) - dev->mem_start],
dev->tx_bytes);
}
} else if (val & 0x04) {
@@ -270,8 +271,8 @@ dp8390_tx(dp8390_t *dev, uint32_t val)
* if it should be accepted, and if the RX ring has enough room,
* it is copied into it and the receive process is updated.
*/
void
dp8390_rx(void *priv, uint8_t *buf, int io_len)
static int
dp8390_rx_common(void *priv, uint8_t *buf, int io_len)
{
dp8390_t *dev = (dp8390_t *)priv;
static uint8_t bcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff};
@@ -284,7 +285,8 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
if (io_len != 60)
dp8390_log("%s: rx_frame with length %d\n", dev->name, io_len);
if ((dev->CR.stop != 0) || (dev->page_start == 0)) return;
if ((dev->CR.stop != 0) || (dev->page_start == 0))
return 0;
/*
* Add the pkt header + CRC to the length, and work
@@ -312,7 +314,7 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
dp8390_log("DP8390: no space\n");
#endif
return;
return 0;
}
if ((io_len < 40/*60*/) && !dev->RCR.runts_ok) {
@@ -320,7 +322,7 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
dp8390_log("DP8390: rejected small packet, length %d\n", io_len);
#endif
return;
return 1;
}
/* Some computers don't care... */
@@ -341,7 +343,7 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
#ifdef ENABLE_DP8390_LOG
dp8390_log("DP8390: RX BC disabled\n");
#endif
return;
return 1;
}
}
@@ -352,7 +354,7 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
#ifdef ENABLE_DP8390_LOG
dp8390_log("DP8390: RX MC disabled\n");
#endif
return;
return 1;
}
/* Are we listening to this multicast address? */
@@ -361,12 +363,13 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
#ifdef ENABLE_DP8390_LOG
dp8390_log("DP8390: RX MC not listed\n");
#endif
return;
return 1;
}
}
/* Unicast, must be for us.. */
else if (memcmp(buf, dev->physaddr, 6)) return;
else if (memcmp(buf, dev->physaddr, 6))
return 1;
} else {
#ifdef ENABLE_DP8390_LOG
dp8390_log("DP8390: RX promiscuous receive\n");
@@ -407,6 +410,20 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
if (dev->IMR.rx_inte && dev->interrupt)
dev->interrupt(dev->priv, 1);
return 1;
}
int
dp8390_rx(void *priv, uint8_t *buf, int io_len)
{
dp8390_t *dev = (dp8390_t *)priv;
if ((dev->DCR.loop == 0) || (dev->TCR.loop_cntl != 0))
return 0;
return dp8390_rx_common(priv, buf, io_len);
}
@@ -1099,5 +1116,5 @@ const device_t dp8390_device =
"DP8390 Network Interface Controller",
0, 0,
dp8390_init, dp8390_close,
NULL, NULL, NULL, NULL
NULL, { NULL }, NULL, NULL
};

View File

@@ -1492,7 +1492,7 @@ nic_close(void *priv)
static const device_config_t ne1000_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300,
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x280", 0x280
@@ -1518,7 +1518,7 @@ static const device_config_t ne1000_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2", 2
@@ -1554,7 +1554,7 @@ static const device_config_t ne1000_config[] =
static const device_config_t ne2000_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300,
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x280", 0x280
@@ -1580,7 +1580,7 @@ static const device_config_t ne2000_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 10,
"irq", "IRQ", CONFIG_SELECTION, "", 10, "", { 0 },
{
{
"IRQ 2", 2
@@ -1609,7 +1609,7 @@ static const device_config_t ne2000_config[] =
"mac", "MAC Address", CONFIG_MAC, "", -1
},
{
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0,
"bios_addr", "BIOS address", CONFIG_HEX20, "", 0, "", { 0 },
{
{
"Disabled", 0x00000
@@ -1673,7 +1673,7 @@ const device_t ne1000_device = {
DEVICE_ISA,
NE2K_NE1000,
nic_init, nic_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
ne1000_config
};
@@ -1682,7 +1682,7 @@ const device_t ne2000_device = {
DEVICE_ISA | DEVICE_AT,
NE2K_NE2000,
nic_init, nic_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
ne2000_config
};
@@ -1691,7 +1691,7 @@ const device_t ethernext_mc_device = {
DEVICE_MCA,
NE2K_ETHERNEXT_MC,
nic_init, nic_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
mca_mac_config
};
@@ -1700,7 +1700,7 @@ const device_t rtl8019as_device = {
DEVICE_ISA | DEVICE_AT,
NE2K_RTL8019AS,
nic_init, nic_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
rtl8019as_config
};
@@ -1709,6 +1709,6 @@ const device_t rtl8029as_device = {
DEVICE_PCI,
NE2K_RTL8029AS,
nic_init, nic_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
rtl8029as_config
};

View File

@@ -200,10 +200,9 @@ poll_thread(void *arg)
mac_cmp32[1] = *(uint32_t *)mac;
mac_cmp16[1] = *(uint16_t *)(mac+4);
if ((mac_cmp32[0] != mac_cmp32[1]) ||
(mac_cmp16[0] != mac_cmp16[1])) {
(mac_cmp16[0] != mac_cmp16[1]))
network_queue_put(0, poll_card->priv, data, h.caplen);
} else {
else {
/* Mark as invalid packet. */
data = NULL;
}

View File

@@ -1238,7 +1238,7 @@ pcnetCalcPacketLen(nic_t *dev, int cb)
/**
* Write data into guest receive buffers.
*/
static void
static int
pcnetReceiveNoSync(void *priv, uint8_t *buf, int size)
{
nic_t *dev = (nic_t *)priv;
@@ -1248,7 +1248,7 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size)
uint8_t buf1[60];
if (CSR_DRX(dev) || CSR_STOP(dev) || CSR_SPND(dev) || !size)
return;
return 0;
/* if too small buffer, then expand it */
if (size < 60) {
@@ -1262,7 +1262,7 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size)
* Drop packets if the cable is not connected
*/
if (!pcnetIsLinkUp(dev))
return;
return 0;
pcnetlog(1, "%s: pcnetReceiveNoSync: RX %x:%x:%x:%x:%x:%x > %x:%x:%x:%x:%x:%x len %d\n", dev->name,
buf[6], buf[7], buf[8], buf[9], buf[10], buf[11],
@@ -1370,7 +1370,7 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size)
/* RX disabled in the meantime? If so, abort RX. */
if (CSR_DRX(dev) || CSR_STOP(dev) || CSR_SPND(dev)) {
pcnetlog(3, "%s: RX disabled 1\n", dev->name);
return;
return 0;
}
/* Was the register modified in the meantime? If so, don't touch the
@@ -1415,7 +1415,7 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size)
/* RX disabled in the meantime? If so, abort RX. */
if (CSR_DRX(dev) || CSR_STOP(dev) || CSR_SPND(dev)) {
pcnetlog(3, "%s: RX disabled 2\n", dev->name);
return;
return 0;
}
/* Was the register modified in the meantime? If so, don't touch the
@@ -1459,6 +1459,8 @@ pcnetReceiveNoSync(void *priv, uint8_t *buf, int size)
}
pcnetUpdateIrq(dev);
return 1;
}
/**
@@ -3027,7 +3029,7 @@ static const device_config_t pcnet_pci_config[] =
static const device_config_t pcnet_isa_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300,
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x300", 0x300
@@ -3047,7 +3049,7 @@ static const device_config_t pcnet_isa_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 3", 3
@@ -3067,7 +3069,7 @@ static const device_config_t pcnet_isa_config[] =
},
},
{
"dma", "DMA channel", CONFIG_SELECTION, "", 5,
"dma", "DMA channel", CONFIG_SELECTION, "", 5, "", { 0 },
{
{
"DMA 3", 3
@@ -3097,7 +3099,7 @@ static const device_config_t pcnet_isa_config[] =
static const device_config_t pcnet_vlb_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300,
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x300", 0x300
@@ -3117,7 +3119,7 @@ static const device_config_t pcnet_vlb_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 3", 3
@@ -3149,7 +3151,7 @@ const device_t pcnet_am79c960_device = {
DEVICE_AT | DEVICE_ISA,
DEV_AM79C960,
pcnet_init, pcnet_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
pcnet_isa_config
};
@@ -3158,7 +3160,7 @@ const device_t pcnet_am79c960_eb_device = {
DEVICE_AT | DEVICE_ISA,
DEV_AM79C960_EB,
pcnet_init, pcnet_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
pcnet_isa_config
};
@@ -3167,7 +3169,7 @@ const device_t pcnet_am79c960_vlb_device = {
DEVICE_VLB,
DEV_AM79C960_VLB,
pcnet_init, pcnet_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
pcnet_vlb_config
};
@@ -3176,7 +3178,7 @@ const device_t pcnet_am79c970a_device = {
DEVICE_PCI,
DEV_AM79C970A,
pcnet_init, pcnet_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
pcnet_pci_config
};
@@ -3185,6 +3187,6 @@ const device_t pcnet_am79c973_device = {
DEVICE_PCI,
DEV_AM79C973,
pcnet_init, pcnet_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
pcnet_pci_config
};

View File

@@ -417,7 +417,7 @@ rx_timer(void *priv)
}
static void
static int
plip_rx(void *priv, uint8_t *buf, int io_len)
{
plip_t *dev = (plip_t *) priv;
@@ -426,7 +426,7 @@ plip_rx(void *priv, uint8_t *buf, int io_len)
if (dev->rx_pkt) { /* shouldn't really happen with the RX queue paused */
plip_log(3, "PLIP: already have a packet to receive");
return;
return 0;
}
if (!(dev->rx_pkt = malloc(io_len))) /* unlikely */
@@ -440,6 +440,8 @@ plip_rx(void *priv, uint8_t *buf, int io_len)
/* Dispatch this packet immediately if we're doing nothing. */
plip_receive_packet(dev);
return 1;
}
@@ -502,8 +504,8 @@ const lpt_device_t lpt_plip_device = {
const device_t plip_device =
{
"Parallel Line Internet Protocol (Network)",
0, 0,
"Parallel Line Internet Protocol",
DEVICE_LPT, 0,
plip_net_init, NULL,
NULL, NULL, NULL, NULL
NULL, { NULL }, NULL, NULL
};

View File

@@ -743,7 +743,7 @@ wd_close(void *priv)
static const device_config_t wd8003_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x300,
"base", "Address", CONFIG_HEX16, "", 0x300, "", { 0 },
{
{
"0x240", 0x240
@@ -763,7 +763,7 @@ static const device_config_t wd8003_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2", 2
@@ -783,7 +783,7 @@ static const device_config_t wd8003_config[] =
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000,
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{
"C800", 0xC8000
@@ -819,7 +819,7 @@ static const device_config_t wd8003_config[] =
static const device_config_t wd8003eb_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x280,
"base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 },
{
{
"0x200", 0x200
@@ -857,7 +857,7 @@ static const device_config_t wd8003eb_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2/9", 9
@@ -877,7 +877,7 @@ static const device_config_t wd8003eb_config[] =
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000,
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{
"C000", 0xC0000
@@ -909,7 +909,7 @@ static const device_config_t wd8003eb_config[] =
},
},
{
"ram_size", "RAM size", CONFIG_SELECTION, "", 8192,
"ram_size", "RAM size", CONFIG_SELECTION, "", 8192, "", { 0 },
{
{
"8 kB", 8192
@@ -935,7 +935,7 @@ static const device_config_t wd8003eb_config[] =
static const device_config_t wd8013_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x280,
"base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 },
{
{
"0x200", 0x200
@@ -973,7 +973,7 @@ static const device_config_t wd8013_config[] =
},
},
{
"irq", "IRQ", CONFIG_SELECTION, "", 3,
"irq", "IRQ", CONFIG_SELECTION, "", 3, "", { 0 },
{
{
"IRQ 2/9", 9
@@ -1005,7 +1005,7 @@ static const device_config_t wd8013_config[] =
},
},
{
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000,
"ram_addr", "RAM address", CONFIG_HEX20, "", 0xD0000, "", { 0 },
{
{
"C000", 0xC0000
@@ -1037,7 +1037,7 @@ static const device_config_t wd8013_config[] =
},
},
{
"ram_size", "RAM size", CONFIG_SELECTION, "", 16384,
"ram_size", "RAM size", CONFIG_SELECTION, "", 16384, "", { 0 },
{
{
"16 kB", 16384
@@ -1074,7 +1074,7 @@ const device_t wd8003e_device = {
DEVICE_ISA,
WD8003E,
wd_init, wd_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
wd8003_config
};
@@ -1083,7 +1083,7 @@ const device_t wd8003eb_device = {
DEVICE_ISA,
WD8003EB,
wd_init, wd_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
wd8003eb_config
};
@@ -1092,7 +1092,7 @@ const device_t wd8013ebt_device = {
DEVICE_ISA,
WD8013EBT,
wd_init, wd_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
wd8013_config
};
@@ -1101,7 +1101,7 @@ const device_t wd8003eta_device = {
DEVICE_MCA,
WD8003ETA,
wd_init, wd_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
mca_mac_config
};
@@ -1110,6 +1110,6 @@ const device_t wd8003ea_device = {
DEVICE_MCA,
WD8003EA,
wd_init, wd_close, NULL,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
mca_mac_config
};

View File

@@ -70,44 +70,25 @@
static netcard_t net_cards[] = {
{ "None", "none", NULL,
NULL },
{ "[ISA] 3Com EtherLink II (3C503)","3c503", &threec503_device,
NULL },
{ "[ISA] AMD PCnet-ISA", "pcnetisa", &pcnet_am79c960_device,
NULL },
{ "[ISA] Novell NE1000", "ne1k", &ne1000_device,
NULL },
{ "[ISA] Novell NE2000", "ne2k", &ne2000_device,
NULL },
{ "[ISA] Racal Interlan EtherBlaster", "pcnetracal", &pcnet_am79c960_eb_device,
NULL },
{ "[ISA] Realtek RTL8019AS", "ne2kpnp", &rtl8019as_device,
NULL },
{ "[ISA] Western Digital WD8003E", "wd8003e", &wd8003e_device,
NULL },
{ "[ISA] Western Digital WD8003EB", "wd8003eb", &wd8003eb_device,
NULL },
{ "[ISA] Western Digital WD8013EBT","wd8013ebt", &wd8013ebt_device,
NULL },
{ "[LPT] PLIP", "plip", &plip_device,
NULL },
{ "[MCA] NetWorth Ethernet/MC", "ethernextmc", &ethernext_mc_device,
NULL },
{ "[MCA] Western Digital WD8003ET/A","wd8003eta", &wd8003eta_device,
NULL },
{ "[MCA] Western Digital WD8003E/A", "wd8003ea", &wd8003ea_device,
NULL },
{ "[PCI] AMD PCnet-FAST III", "pcnetfast", &pcnet_am79c973_device,
NULL },
{ "[PCI] AMD PCnet-PCI II", "pcnetpci", &pcnet_am79c970a_device,
NULL },
{ "[PCI] Realtek RTL8029AS", "ne2kpci", &rtl8029as_device,
NULL },
{ "[VLB] AMD PCnet-VL", "pcnetvlb", &pcnet_am79c960_vlb_device,
NULL },
{ "", "", NULL,
NULL }
{ "none", NULL, NULL },
{ "3c503", &threec503_device, NULL },
{ "pcnetisa", &pcnet_am79c960_device, NULL },
{ "ne1k", &ne1000_device, NULL },
{ "ne2k", &ne2000_device, NULL },
{ "pcnetracal", &pcnet_am79c960_eb_device, NULL },
{ "ne2kpnp", &rtl8019as_device, NULL },
{ "wd8003e", &wd8003e_device, NULL },
{ "wd8003eb", &wd8003eb_device, NULL },
{ "wd8013ebt", &wd8013ebt_device, NULL },
{ "plip", &plip_device, NULL },
{ "ethernextmc", &ethernext_mc_device, NULL },
{ "wd8003eta", &wd8003eta_device, NULL },
{ "wd8003ea", &wd8003ea_device, NULL },
{ "pcnetfast", &pcnet_am79c973_device, NULL },
{ "pcnetpci", &pcnet_am79c970a_device, NULL },
{ "ne2kpci", &rtl8029as_device, NULL },
{ "pcnetvlb", &pcnet_am79c960_vlb_device, NULL },
{ "", NULL, NULL }
};
@@ -117,7 +98,8 @@ int network_ndev;
int network_card;
char network_host[522];
netdev_t network_devs[32];
int network_rx_pause = 0;
int network_rx_pause = 0,
network_tx_pause = 0;
#ifdef ENABLE_NIC_LOG
int nic_do_log = ENABLE_NIC_LOG;
#endif
@@ -355,6 +337,8 @@ network_queue_clear(int tx)
static void
network_rx_queue(void *priv)
{
int ret = 1;
if (network_rx_pause) {
timer_on_auto(&network_rx_queue_timer, 0.762939453125 * 2.0 * 128.0);
return;
@@ -367,14 +351,15 @@ network_rx_queue(void *priv)
network_queue_get(0, &pkt);
if ((pkt != NULL) && (pkt->len > 0)) {
network_dump_packet(pkt);
net_cards[network_card].rx(pkt->priv, pkt->data, pkt->len);
ret = net_cards[network_card].rx(pkt->priv, pkt->data, pkt->len);
if (pkt->len >= 128)
timer_on_auto(&network_rx_queue_timer, 0.762939453125 * 2.0 * ((double) pkt->len));
else
timer_on_auto(&network_rx_queue_timer, 0.762939453125 * 2.0 * 128.0);
} else
timer_on_auto(&network_rx_queue_timer, 0.762939453125 * 2.0 * 128.0);
network_queue_advance(0);
if (ret)
network_queue_advance(0);
network_busy(0);
}
@@ -475,7 +460,6 @@ network_close(void)
/* Here is where we clear the queues. */
network_queue_clear(0);
network_queue_clear(1);
network_rx_pause = 0;
network_log("NETWORK: closed.\n");
}
@@ -574,6 +558,9 @@ network_do_tx(void)
{
netpkt_t *pkt = NULL;
if (network_tx_pause)
return;
network_queue_get(1, &pkt);
if ((pkt != NULL) && (pkt->len > 0)) {
network_dump_packet(pkt);
@@ -638,14 +625,6 @@ network_card_available(int card)
}
/* UI */
char *
network_card_getname(int card)
{
return((char *)net_cards[card].name);
}
/* UI */
const device_t *
network_card_getdevice(int card)