From: Toni Wilen Date: Tue, 21 Aug 2018 13:00:19 +0000 (+0300) Subject: Fix PCMCIA NE2000 and x86 NE2000 custom mac/network mode option. X-Git-Tag: 4100~110 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=21fc2e434518e824698771c39f9f1165b88703e0;p=francis%2Fwinuae.git Fix PCMCIA NE2000 and x86 NE2000 custom mac/network mode option. --- diff --git a/expansion.cpp b/expansion.cpp index ca575390..cad10c36 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -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 diff --git a/gayle.cpp b/gayle.cpp index aca361ce..4949c004 100644 --- 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)) { diff --git a/include/pci_hw.h b/include/pci_hw.h index d6fcaf51..e3f171a3 100644 --- a/include/pci_hw.h +++ b/include/pci_hw.h @@ -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; diff --git a/qemuvga/ne2000.cpp b/qemuvga/ne2000.cpp index 23525a7a..4ef57d3b 100644 --- a/qemuvga/ne2000.cpp +++ b/qemuvga/ne2000.cpp @@ -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 3fc22bba..8952611a 100644 --- 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;