Network overhaul : support for multiple NICs, performance improvement

- Add support for multiple NICs
- Switch from polling to an event loop for the host networking to avoid latency and locking issues
This commit is contained in:
Adrien Moulin
2022-08-21 16:55:47 +02:00
parent 5ae9df6d07
commit 19db1d2c7b
21 changed files with 1557 additions and 1075 deletions

View File

@@ -58,6 +58,8 @@
#include <86box/pic.h>
#include <86box/random.h>
#include <86box/device.h>
#include <86box/timer.h>
#include <86box/thread.h>
#include <86box/network.h>
#include <86box/net_dp8390.h>
#include <86box/net_wd8003.h>
@@ -696,7 +698,7 @@ wd_init(const device_t *info)
dev->ram_addr = device_get_config_hex20("ram_addr");
}
dev->dp8390 = device_add(&dp8390_device);
dev->dp8390 = device_add_inst(&dp8390_device, dp3890_inst++);
dev->dp8390->priv = dev;
dev->dp8390->interrupt = wd_interrupt;
dp8390_set_defaults(dev->dp8390, DP8390_FLAG_CHECK_CR | DP8390_FLAG_CLEAR_IRQ);
@@ -786,7 +788,7 @@ wd_init(const device_t *info)
mem_mapping_disable(&dev->ram_mapping);
/* Attach ourselves to the network module. */
network_attach(dev->dp8390, dev->dp8390->physaddr, dp8390_rx, NULL, NULL);
dev->dp8390->card = network_attach(dev->dp8390, dev->dp8390->physaddr, dp8390_rx, NULL, NULL);
if (!(dev->board_chip & WE_ID_BUS_MCA)) {
wdlog("%s: attached IO=0x%X IRQ=%d, RAM addr=0x%06x\n", dev->name,