diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index af624fc05..3a7620fbc 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -1614,7 +1614,6 @@ int enableTenGigabitEthernet(int val) { } else { bus_w(addr, bus_r(addr) & (~CONFIG_GB10_SND_UDP_MSK)); } - // configuremac called from client } return ((bus_r(addr) & CONFIG_GB10_SND_UDP_MSK) >> CONFIG_GB10_SND_UDP_OFST); diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index fd5a8e656..25fa60526 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -1528,7 +1528,6 @@ int enableTenGigabitEthernet(int val) { send_to_ten_gig = 1; else send_to_ten_gig = 0; - // configuremac called from client } return send_to_ten_gig; } diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index da0b7305b..95079a613 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -427,6 +427,8 @@ void setupDetector() { setGateDelay(i, DEFAULT_GATE_DELAY); } setInitialExtSignals(); + // 10G UDP + enableTenGigabitEthernet(1); // check module type attached if not in debug mode { @@ -1493,6 +1495,26 @@ int setDetectorPosition(int pos[]) { int *getDetectorPosition() { return detPos; } +int enableTenGigabitEthernet(int val) { + uint32_t addr = PKT_CONFIG_REG; + + // set + if (val != -1) { + LOG(logINFO, ("Setting 10Gbe: %d\n", (val > 0) ? 1 : 0)); + // 1g + if (val == 0) { + bus_w(addr, bus_r(addr) | PKT_CONFIG_1G_INTERFACE_MSK); + } + // 10g + else { + bus_w(addr, bus_r(addr) & (~PKT_CONFIG_1G_INTERFACE_MSK)); + } + } + int oneG = ((bus_r(addr) & PKT_CONFIG_1G_INTERFACE_MSK) >> + PKT_CONFIG_1G_INTERFACE_OFST); + return oneG ? 0 : 1; +} + /* pattern */ void startPattern() { diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 2fd715409..c9953263b 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -377,7 +377,8 @@ int getInterruptSubframe(); int setReadNLines(int value); int getReadNLines(); #endif -#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(EIGERD) +#if defined(CHIPTESTBOARDD) || defined(MOENCHD) || defined(EIGERD) || \ + defined(MYTHEN3D) int enableTenGigabitEthernet(int val); #endif diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 1b1d15a3d..5c93c83a4 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -2855,14 +2855,14 @@ int enable_ten_giga(int file_des) { return printSocketReadError(); LOG(logINFOBLUE, ("Setting 10GbE: %d\n", arg)); -#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(MYTHEN3D) || \ - defined(GOTTHARD2D) +#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(GOTTHARD2D) functionNotImplemented(); #else // set & get if ((arg == GET_FLAG) || (Server_VerifyLock() == OK)) { if (arg >= 0 && enableTenGigabitEthernet(GET_FLAG) != arg) { enableTenGigabitEthernet(arg); +#ifdef EIGERD uint64_t hardwaremac = getDetectorMAC(); if (udpDetails.srcmac != hardwaremac) { LOG(logINFOBLUE, ("Updating udp source mac\n")); @@ -2873,6 +2873,7 @@ int enable_ten_giga(int file_des) { LOG(logINFOBLUE, ("Updating udp source ip\n")); udpDetails.srcip = hardwareip; } +#endif configure_mac(); } retval = enableTenGigabitEthernet(GET_FLAG); diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 96e3dfc02..894c12237 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -511,10 +511,10 @@ class Detector { Result printRxConfiguration(Positions pos = {}) const; - /** [Eiger][CTB][Moench] */ + /** [Eiger][CTB][Moench][Mythen3] */ Result getTenGiga(Positions pos = {}) const; - /** [Eiger][CTB][Moench] */ + /** [Eiger][CTB][Moench][Mythen3] */ void setTenGiga(bool value, Positions pos = {}); /** [Eiger, Jungfrau] */ diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 36cd2672d..f3e85893c 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1648,7 +1648,7 @@ class CmdProxy { "\n\tPrints the receiver configuration."); INTEGER_COMMAND(tengiga, getTenGiga, setTenGiga, StringTo, - "[0, 1]\n\t[Eiger][Ctb][Moench] 10GbE Enable."); + "[0, 1]\n\t[Eiger][Ctb][Moench][Mythen3] 10GbE Enable."); INTEGER_COMMAND(flowcontrol10g, getTenGigaFlowControl, setTenGigaFlowControl, StringTo, diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 3ddc90c0c..309bc30ab 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -1565,7 +1565,7 @@ TEST_CASE("tengiga", "[.cmd][.new]") { auto det_type = det.getDetectorType().squash(); if (det_type == defs::EIGER || det_type == defs::CHIPTESTBOARD || - det_type == defs::MOENCH) { + det_type == defs::MOENCH || det_type == defs::MYTHEN3) { auto tengiga = det.getTenGiga(); det.setTenGiga(false); diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index deef9b569..ac45ae0c2 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -430,7 +430,7 @@ int ClientInterface::setup_receiver(Interface &socket) { } impl()->setTimingMode(arg.timMode); if (myDetectorType == EIGER || myDetectorType == MOENCH || - myDetectorType == CHIPTESTBOARD) { + myDetectorType == CHIPTESTBOARD || myDetectorType == MYTHEN3) { try { impl()->setTenGigaEnable(arg.tenGiga); } catch (const RuntimeError &e) { @@ -987,7 +987,7 @@ int ClientInterface::get_overwrite(Interface &socket) { int ClientInterface::enable_tengiga(Interface &socket) { auto val = socket.Receive(); if (myDetectorType != EIGER && myDetectorType != CHIPTESTBOARD && - myDetectorType != MOENCH) + myDetectorType != MOENCH && myDetectorType != MYTHEN3) functionNotImplemented(); if (val >= 0) { diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 32be51dba..09eb56364 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -1662,6 +1662,9 @@ void Implementation::setTenGigaEnable(const bool b) { case EIGER: generalData->SetTenGigaEnable(b, dynamicRange); break; + case MYTHEN3: + generalData->SetDynamicRange(dynamicRange, b); + break; case MOENCH: case CHIPTESTBOARD: ctbAnalogDataBytes = generalData->setImageSize(