Network changes from TC1995.

This commit is contained in:
OBattler
2020-03-24 01:02:41 +01:00
parent 00ec4b72ea
commit 1640d48be6
4 changed files with 697 additions and 456 deletions

View File

@@ -7,7 +7,7 @@
* Emulation of the DP8390 Network Interface Controller used by
* the WD family, NE1000/NE2000 family, and 3Com 3C503 NIC's.
*
* Version: @(#)net_dp8390.c 1.0.2 2018/10/21
* Version: @(#)net_dp8390.c 1.0.3 2020/03/23
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Bochs project,
@@ -204,7 +204,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(dev, dev->mem,
dev->tx_bytes);
}
} else if (val & 0x04) {
@@ -224,7 +224,7 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
/* Send the packet to the system driver */
dev->CR.tx_packet = 1;
network_tx(&dev->mem[(dev->tx_page_start * 256) - dev->mem_start], dev->tx_bytes);
network_tx(dev->mem, dev->tx_bytes);
/* some more debug */
#ifdef ENABLE_DP8390_LOG
@@ -388,7 +388,7 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
pkthdr[0], pkthdr[1], pkthdr[2], pkthdr[3]);
/* Copy into buffer, update curpage, and signal interrupt if config'd */
startptr = &dev->mem[(dev->curr_page * 256) - dev->mem_start];
startptr = dev->mem + ((dev->curr_page * 256) - dev->mem_start);
memcpy(startptr, pkthdr, sizeof(pkthdr));
if ((nextpage > dev->curr_page) ||
((dev->curr_page + pages) == dev->page_stop)) {
@@ -396,7 +396,7 @@ dp8390_rx(void *priv, uint8_t *buf, int io_len)
} else {
endbytes = (dev->page_stop - dev->curr_page) * 256;
memcpy(startptr+sizeof(pkthdr), buf, endbytes-sizeof(pkthdr));
startptr = &dev->mem[(dev->page_start * 256) - dev->mem_start];
startptr = dev->mem + ((dev->page_start * 256) - dev->mem_start);
memcpy(startptr, buf+endbytes-sizeof(pkthdr), io_len-endbytes+8);
}
dev->curr_page = nextpage;

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
* Emulation of the AMD PCnet LANCE NIC controller for both the ISA
* and PCI buses.
*
* Version: @(#)net_pcnet.c 1.0.0 2019/11/09
* Version: @(#)net_pcnet.c 1.0.1 2020/03/23
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* TheCollector1995, <mariogplayer@gmail.com>
@@ -19,17 +19,20 @@
#ifndef NET_PCNET_H
# define NET_PCNET_H
enum {
PCNET_NONE = 0,
PCNET_ISA = 1, /* 16-bit ISA */
PCNET_PCI = 2, /* 32-bit PCI */
PCNET_VLB = 3 /* 32-bit VLB */
DEV_NONE = 0,
DEV_AM79C960 = 1, /* PCnet-ISA (ISA, 10 Mbps, NE2100/NE1500T compatible) */
DEV_AM79C960_EB = 2, /* PCnet-ISA (ISA, 10 Mbps, Racal InterLan EtherBlaster compatible) */
DEV_AM79C960_VLB = 3, /* PCnet-VLB (VLB, 10 Mbps, NE2100/NE1500T compatible) */
DEV_AM79C970A = 4, /* PCnet-PCI II (PCI, 10 Mbps) */
DEV_AM79C973 = 5 /* PCnet-FAST III (PCI, 10/100 Mbps) */
};
extern const device_t pcnet_isa_device;
extern const device_t pcnet_pci_device;
extern const device_t pcnet_vlb_device;
extern const device_t pcnet_am79c960_device;
extern const device_t pcnet_am79c960_eb_device;
extern const device_t pcnet_am79c960_vlb_device;
extern const device_t pcnet_am79c970a_device;
extern const device_t pcnet_am79c973_device;
#endif /*NET_PCNET_H*/

View File

@@ -12,7 +12,7 @@
* it should be malloc'ed and then linked to the NETCARD def.
* Will be done later.
*
* Version: @(#)network.c 1.0.13 2019/12/02
* Version: @(#)network.c 1.0.14 2020/03/23
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -71,12 +71,14 @@ static netcard_t net_cards[] = {
NULL },
{ "[ISA] 3Com EtherLink II (3C503)","3c503", &threec503_device,
NULL },
{ "[ISA] AMD PCnet-ISA", "pcnetisa", &pcnet_isa_device,
{ "[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,
@@ -91,11 +93,13 @@ static netcard_t net_cards[] = {
NULL },
{ "[MCA] Western Digital WD8003E/A", "wd8003ea", &wd8003ea_device,
NULL },
{ "[PCI] AMD PCnet-PCI", "pcnetpci", &pcnet_pci_device,
{ "[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_vlb_device,
{ "[VLB] AMD PCnet-VL", "pcnetvlb", &pcnet_am79c960_vlb_device,
NULL },
{ "", "", NULL,
NULL }