diff --git a/src/device.h b/src/device.h index 7dace2286..fb509ce7f 100644 --- a/src/device.h +++ b/src/device.h @@ -3,7 +3,6 @@ #define CONFIG_BINARY 2 #define CONFIG_SELECTION 3 #define CONFIG_MIDI 4 -#define CONFIG_ETHIF 5 typedef struct device_config_selection_t { diff --git a/src/net_ne2000.c b/src/net_ne2000.c index 9647d0856..f1a0eb44d 100644 --- a/src/net_ne2000.c +++ b/src/net_ne2000.c @@ -246,15 +246,15 @@ void ne2000_log(const char *format, ...) #endif } -static void ne2000_mac(uint8_t *mac) +static uint8_t *ne2000_mac(void) { if (network_card_current == 2) { - memcpy(mac, maclocal_pci, 6); + return maclocal_pci; } else { - memcpy(mac, maclocal, 6); + return maclocal; } } @@ -1720,8 +1720,6 @@ void ne2000_poller(void *p) struct pcap_pkthdr h; uint32_t mac_cmp32[2]; uint16_t mac_cmp16[2]; - uint8_t temp_mac[6] = { 0, 0, 0, 0, 0, 0 }; - ne2000_mac(temp_mac); if (!net_is_pcap) { @@ -1758,8 +1756,8 @@ void ne2000_poller(void *p) mac_cmp32[0] = *(uint32_t *) (data+6); mac_cmp16[0] = *(uint16_t *) (data+10); /* Local. */ - mac_cmp32[1] = *(uint32_t *) (temp_mac); - mac_cmp16[1] = *(uint16_t *) (temp_mac + 4); + mac_cmp32[1] = *(uint32_t *) (ne2000_mac()); + mac_cmp16[1] = *(uint16_t *) (ne2000_mac() + 4); if ((mac_cmp32[0] != mac_cmp32[1]) || (mac_cmp16[0] != mac_cmp16[1])) { ne2000_rx_frame(ne2000,data,h.caplen); @@ -2004,7 +2002,6 @@ void *ne2000_init(void) int is_rtl8029as = 0; ne2000_t *ne2000 = malloc(sizeof(ne2000_t)); memset(ne2000, 0, sizeof(ne2000_t)); - uint8_t temp_mac[6] = { 0, 0, 0, 0, 0, 0 }; if (PCI && (network_card_current == 2)) { @@ -2051,8 +2048,7 @@ void *ne2000_init(void) ne2000_io_set(ne2000->base_address, ne2000); - ne2000_mac(temp_mac); - ne2000_mac(ne2000->physaddr); + memcpy(ne2000->physaddr, ne2000_mac(), 6); if (!disable_netbios) { @@ -2196,8 +2192,8 @@ initialize_pcap: char filter_exp[255]; ne2000_log("ne2000 Building packet filter..."); sprintf(filter_exp,"( ((ether dst ff:ff:ff:ff:ff:ff) or (ether dst %02x:%02x:%02x:%02x:%02x:%02x)) and not (ether src %02x:%02x:%02x:%02x:%02x:%02x) )", \ - temp_mac[0], temp_mac[1], temp_mac[2], temp_mac[3], temp_mac[4], temp_mac[5],\ - temp_mac[0], temp_mac[1], temp_mac[2], temp_mac[3], temp_mac[4], temp_mac[5]); + ne2000_mac()[0], ne2000_mac()[1], ne2000_mac()[2], ne2000_mac()[3], ne2000_mac()[4], ne2000_mac()[5],\ + ne2000_mac()[0], ne2000_mac()[1], ne2000_mac()[2], ne2000_mac()[3], ne2000_mac()[4], ne2000_mac()[5]); /* I'm doing a MAC level filter so TCP/IP doesn't matter. */ if (pcap_compile(net_pcap, &fp, filter_exp, 0, 0xffffffff) == -1)