From 4ab6c318ed52023b641fd9f5dfd04213620431a8 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 7 Jan 2026 21:00:22 -0300 Subject: [PATCH] Un-devbranch the network switch --- CMakeLists.txt | 1 - src/network/CMakeLists.txt | 8 +------- src/network/network.c | 2 -- src/qt/CMakeLists.txt | 4 ---- src/qt/qt_settingsnetwork.cpp | 14 ++------------ 5 files changed, 3 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index afc981b0a..667df5221 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,7 +184,6 @@ cmake_dependent_option(PCL "Generic PCL5e Printer" cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF) cmake_dependent_option(WACOM "Wacom Input Devices" ON "DEV_BRANCH" OFF) cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) -cmake_dependent_option(NETSWITCH "Network Switch Support" ON "DEV_BRANCH" OFF) cmake_dependent_option(VFIO "Virtual Function I/O" ON "DEV_BRANCH" OFF) cmake_dependent_option(SOFTMODEM "AC'97 Softmodem" ON "DEV_BRANCH" OFF) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 44465486e..627535d53 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -19,6 +19,7 @@ list(APPEND net_sources network.c net_pcap.c net_slirp.c + net_switch.c net_dp8390.c net_3c501.c net_3c503.c @@ -57,13 +58,6 @@ if(WIN32) target_link_libraries(86Box ws2_32) endif() -if(NETSWITCH) - add_compile_definitions(USE_NETSWITCH) - list(APPEND net_sources - net_switch.c - ) -endif() - if (UNIX) if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") set_source_files_properties(net_slirp.c PROPERTIES COMPILE_FLAGS "-I/usr/local/include") diff --git a/src/network/network.c b/src/network/network.c index d99b997b0..1a23c4280 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -499,13 +499,11 @@ network_attach(void *card_drv, uint8_t *mac, NETRXCB rx, NETSETLINKSTATE set_lin card->host_drv.priv = card->host_drv.init(card, mac, net_cards_conf[net_card_current].host_dev_name, net_drv_error); break; #endif -#ifdef USE_NETSWITCH case NET_TYPE_NLSWITCH: case NET_TYPE_NRSWITCH: card->host_drv = net_switch_drv; card->host_drv.priv = card->host_drv.init(card, mac, &net_cards_conf[net_card_current], net_drv_error); break; -#endif /* USE_NETSWITCH */ default: card->host_drv.priv = NULL; break; diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 1c61f5559..b7d39109e 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -275,10 +275,6 @@ if(EMU_BUILD_NUM) ) endif() -if(NETSWITCH) - target_compile_definitions(ui PRIVATE USE_NETSWITCH) -endif() - if(RTMIDI) target_compile_definitions(ui PRIVATE USE_RTMIDI) endif() diff --git a/src/qt/qt_settingsnetwork.cpp b/src/qt/qt_settingsnetwork.cpp index bd4ea80bd..929781075 100644 --- a/src/qt/qt_settingsnetwork.cpp +++ b/src/qt/qt_settingsnetwork.cpp @@ -137,7 +137,6 @@ SettingsNetwork::enableElements(Ui::SettingsNetwork *ui) break; #endif -#ifdef USE_NETSWITCH case NET_TYPE_NLSWITCH: // option_list_label->setText("Local Switch Options"); option_list_label->setVisible(true); @@ -167,7 +166,6 @@ SettingsNetwork::enableElements(Ui::SettingsNetwork *ui) hostname_label->setVisible(true); hostname_value->setVisible(true); break; -#endif /* USE_NETSWITCH */ case NET_TYPE_SLIRP: default: @@ -215,11 +213,9 @@ SettingsNetwork::save() cbox = findChild(QString("comboBoxNet%1").arg(i + 1)); net_cards_conf[i].net_type = cbox->currentData().toInt(); cbox = findChild(QString("comboBoxIntf%1").arg(i + 1)); -#ifdef USE_NETSWITCH auto *hostname_value = findChild(QString("hostnameSwitch%1").arg(i + 1)); auto *promisc_value = findChild(QString("boxPromisc%1").arg(i + 1)); auto *switch_group_value = findChild(QString("spinnerSwitch%1").arg(i + 1)); -#endif /* USE_NETSWITCH */ memset(net_cards_conf[i].host_dev_name, '\0', sizeof(net_cards_conf[i].host_dev_name)); if (net_cards_conf[i].net_type == NET_TYPE_PCAP) strncpy(net_cards_conf[i].host_dev_name, network_devs[cbox->currentData().toInt()].device, sizeof(net_cards_conf[i].host_dev_name) - 1); @@ -231,7 +227,6 @@ SettingsNetwork::save() else if (net_cards_conf[i].net_type == NET_TYPE_TAP) strncpy(net_cards_conf[i].host_dev_name, bridge_line->text().toUtf8().constData(), sizeof(net_cards_conf[i].host_dev_name)); #endif -#ifdef USE_NETSWITCH else if (net_cards_conf[i].net_type == NET_TYPE_NRSWITCH) { memset(net_cards_conf[i].nrs_hostname, '\0', sizeof(net_cards_conf[i].nrs_hostname)); strncpy(net_cards_conf[i].nrs_hostname, hostname_value->text().toUtf8().constData(), sizeof(net_cards_conf[i].nrs_hostname) - 1); @@ -240,7 +235,6 @@ SettingsNetwork::save() net_cards_conf[i].promisc_mode = promisc_value->isChecked(); net_cards_conf[i].switch_group = switch_group_value->value() - 1; } -#endif /* USE_NETSWITCH */ } } @@ -313,12 +307,10 @@ SettingsNetwork::onCurrentMachineChanged(int machineId) Models::AddEntry(model, "TAP", NET_TYPE_TAP); #endif -#ifdef USE_NETSWITCH Models::AddEntry(model, "Local Switch", NET_TYPE_NLSWITCH); -# ifdef ENABLE_NET_NRSWITCH +#ifdef ENABLE_NET_NRSWITCH Models::AddEntry(model, "Remote Switch", NET_TYPE_NRSWITCH); -# endif /* ENABLE_NET_NRSWITCH */ -#endif /* USE_NETSWITCH */ +#endif /* ENABLE_NET_NRSWITCH */ model->removeRows(0, removeRows); cbox->setCurrentIndex(cbox->findData(net_cards_conf[i].net_type)); @@ -354,7 +346,6 @@ SettingsNetwork::onCurrentMachineChanged(int machineId) auto editline = findChild(QString("bridgeTAPNIC%1").arg(i + 1)); editline->setText(currentTapDevice); #endif -#ifdef USE_NETSWITCH } else if (net_cards_conf[i].net_type == NET_TYPE_NLSWITCH) { auto *promisc_value = findChild(QString("boxPromisc%1").arg(i + 1)); promisc_value->setCheckState(net_cards_conf[i].promisc_mode == 1 ? Qt::CheckState::Checked : Qt::CheckState::Unchecked); @@ -365,7 +356,6 @@ SettingsNetwork::onCurrentMachineChanged(int machineId) hostname_value->setText(net_cards_conf[i].nrs_hostname); auto *switch_group_value = findChild(QString("spinnerSwitch%1").arg(i + 1)); switch_group_value->setValue(net_cards_conf[i].switch_group + 1); -#endif /* USE_NETSWITCH */ } } }