]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix PCMCIA NE2000 and x86 NE2000 custom mac/network mode option.
authorToni Wilen <twilen@winuae.net>
Tue, 21 Aug 2018 13:00:19 +0000 (16:00 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 21 Aug 2018 13:00:19 +0000 (16:00 +0300)
expansion.cpp
gayle.cpp
include/pci_hw.h
qemuvga/ne2000.cpp
x86.cpp

index ca57539045d218a9a1b8eeba38e149e4ea1729d5..cad10c360dbecc3fecf83f4d95458cd5209e1e7f 100644 (file)
@@ -4400,9 +4400,14 @@ static struct expansionboardsettings ne2k_isa_settings[] = {
                _T("irq\0") _T("3\0") _T("4\0") _T("5\0") _T("7\0") _T("9\0") _T("10\0") _T("11\0") _T("12\0") _T("15\0"),
                true, false, 0
        },
+       {
+               _T("MAC (xx:xx:xx:xx:xx:xx)\0"),
+               _T("mac\0"),
+               2, false, 0
+       },
        {
                NULL, NULL,
-               true, false, 4
+               true, false, 16 - (4 + 3)
        },
        {
                NULL
index aca361cedfee26e68502580568982d91c703e457..4949c0048e10763d3ddc006eb03ec5b8c41bd6a0 100644 (file)
--- a/gayle.cpp
+++ b/gayle.cpp
@@ -1500,7 +1500,7 @@ static int initpcmcia (const TCHAR *path, int readonly, int type, int reset, str
 
        } else if (type == PCMCIA_NE2000) {
 
-               ne2000 = &ne2000_pci_board;
+               ne2000 = &ne2000_pci_board_pcmcia;
                ne2000_board_state = xcalloc(pci_board_state, 1);
                ne2000_board_state->irq_callback = ne2000_pcmcia_irq_callback;
                if (!ne2000->init(ne2000_board_state, NULL)) {
index d6fcaf518a0b82f4bb51f9cab87a1dd2b132aa68..e3f171a3f4d811a3179481156498eca085ac8a42 100644 (file)
@@ -119,6 +119,10 @@ extern void pci_write_dma(struct pci_board_state *pcibs, uaecptr addr, uae_u8*,
 extern void pci_read_dma(struct pci_board_state *pcibs, uaecptr addr, uae_u8*, int size);
 
 extern const struct pci_board ne2000_pci_board;
+extern const struct pci_board ne2000_pci_board_x86;
+extern const struct pci_board ne2000_pci_board_pcmcia;
+extern const struct pci_board ne2000_pci_board;
+
 extern const struct pci_board es1370_pci_board;
 extern const struct pci_board fm801_pci_board;
 extern const struct pci_board fm801_pci_board_func1;
index 23525a7a562e6459f496237c31d8810ee355bae7..4ef57d3bd05470b9488f123c22a9c49f9dd8af04 100644 (file)
@@ -1336,6 +1336,16 @@ static bool ne2000_init(struct pci_board_state *pcibs, struct autoconfig_info *a
        return ne2000_init_2(pcibs, ROMTYPE_NE2KPCI, aci && aci->rc ? aci->rc->configtext : NULL);
 }
 
+static bool ne2000_init_pcmcia(struct pci_board_state *pcibs, struct autoconfig_info *aci)
+{
+       return ne2000_init_2(pcibs, ROMTYPE_NE2KPCMCIA, aci && aci->rc ? aci->rc->configtext : NULL);
+}
+
+static bool ne2000_init_x86(struct pci_board_state *pcibs, struct autoconfig_info *aci)
+{
+       return ne2000_init_2(pcibs, ROMTYPE_NE2KISA, aci && aci->rc ? aci->rc->configtext : NULL);
+}
+
 static const struct pci_config ne2000_pci_config =
 {
        0x10ec, 0x8029, 0, 0, 0, 0x020000, 0, 0x10ec, 0x8029, 1, 0, 0, { 0x20 | 1, 0, 0, 0, 0, 0, 0 }
@@ -1356,6 +1366,37 @@ const struct pci_board ne2000_pci_board =
        }
 };
 
+const struct pci_board ne2000_pci_board_pcmcia =
+{
+       _T("RTL8029"),
+       &ne2000_pci_config, ne2000_init_pcmcia, ne2000_free, ne2000_reset, ne2000_hsync_handler,
+       {
+               { ne2000_lget, ne2000_wget, ne2000_bget, ne2000_lput, ne2000_wput, ne2000_bput },
+               { NULL },
+               { NULL },
+               { NULL },
+               { NULL },
+               { NULL },
+               { NULL },
+       }
+};
+
+
+const struct pci_board ne2000_pci_board_x86 =
+{
+       _T("RTL8029"),
+       &ne2000_pci_config, ne2000_init_x86, ne2000_free, ne2000_reset, ne2000_hsync_handler,
+       {
+               { ne2000_lget, ne2000_wget, ne2000_bget, ne2000_lput, ne2000_wput, ne2000_bput },
+               { NULL },
+               { NULL },
+               { NULL },
+               { NULL },
+               { NULL },
+               { NULL },
+       }
+};
+
 static const uae_u8 rt_pnp_init_key[] =
 {
        0xDA, 0x6D, 0x36, 0x1B, 0x8D, 0x46, 0x23, 0x91, 0x48, 0xA4, 0xD2, 0x69, 0x34, 0x9A, 0x4D, 0x26,
diff --git a/x86.cpp b/x86.cpp
index 3fc22bbaacca41d94cdc274bf6eb52da3271c97b..8952611afe4a44c836af8d3559f945c1041d781e 100644 (file)
--- a/x86.cpp
+++ b/x86.cpp
@@ -3356,7 +3356,7 @@ static void x86_ne2000(struct x86_bridge *xb)
                return;
        struct romconfig *rc = get_device_romconfig(&currprefs, ROMTYPE_NE2KISA, 0);
        if (rc) {
-               xb->ne2000_isa = &ne2000_pci_board;
+               xb->ne2000_isa = &ne2000_pci_board_x86;
                xb->ne2000_isa_board_state = xcalloc(pci_board_state, 1);
                xb->ne2000_isa_board_state->irq_callback = ne2000_isa_irq_callback;
                switch (rc->device_settings & 7)
@@ -3423,8 +3423,7 @@ static void x86_ne2000(struct x86_bridge *xb)
                aci.rc = rc;
                if (xb->ne2000_isa->init(xb->ne2000_isa_board_state, &aci)) {
                        write_log(_T("NE2000 ISA configured, IO=%3X, IRQ=%d\n"), xb->ne2000_io, xb->ne2000_irq);
-               }
-               else {
+               } else {
                        xb->ne2000_isa = NULL;
                        xfree(xb->ne2000_isa_board_state);
                        xb->ne2000_isa_board_state = NULL;