mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
Merge branch 'vetoheader' of github.com:slsdetectorgroup/slsDetectorPackage into vetoheader
This commit is contained in:
commit
e884836f5c
@ -250,6 +250,6 @@
|
|||||||
|
|
||||||
/* UDP datagram registers --------------------------------------------------*/
|
/* UDP datagram registers --------------------------------------------------*/
|
||||||
#define RXR_ENDPOINTS_MAX (32)
|
#define RXR_ENDPOINTS_MAX (32)
|
||||||
#define RXR_ENDPOINT_OFST (0x10)
|
#define RXR_ENDPOINT_OFST (16 * REG_OFFSET)
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
Binary file not shown.
@ -1420,7 +1420,10 @@ int configureMAC() {
|
|||||||
getIpAddressinString(dst_ip2, dstip2);
|
getIpAddressinString(dst_ip2, dstip2);
|
||||||
|
|
||||||
int numInterfaces = getNumberofUDPInterfaces();
|
int numInterfaces = getNumberofUDPInterfaces();
|
||||||
LOG(logINFO, ("\t#Interfaces : %d\n", numInterfaces));
|
int vetoEnabled = getVeto();
|
||||||
|
|
||||||
|
LOG(logINFO, ("\t#Veto : %d\n", vetoEnabled));
|
||||||
|
LOG(logINFO, ("\t#10Gb Interfaces : %d\n", numInterfaces));
|
||||||
|
|
||||||
LOG(logINFO, ("\tData Interface \n"));
|
LOG(logINFO, ("\tData Interface \n"));
|
||||||
LOG(logINFO, ("\tSource IP : %s\n"
|
LOG(logINFO, ("\tSource IP : %s\n"
|
||||||
@ -1431,8 +1434,9 @@ int configureMAC() {
|
|||||||
"\tDest Port : %d\n",
|
"\tDest Port : %d\n",
|
||||||
src_ip, src_mac, srcport, dst_ip, dst_mac, dstport));
|
src_ip, src_mac, srcport, dst_ip, dst_mac, dstport));
|
||||||
|
|
||||||
LOG(logINFO, ("\tVeto Interface (%s)\n",
|
LOG(logINFO,
|
||||||
(numInterfaces == 2 ? "enabled" : "disabled")));
|
("\tVeto Interface (%s)\n",
|
||||||
|
(vetoEnabled && numInterfaces == 2 ? "enabled" : "disabled")));
|
||||||
LOG(logINFO, ("\tSource IP2 : %s\n"
|
LOG(logINFO, ("\tSource IP2 : %s\n"
|
||||||
"\tSource MAC2 : %s\n"
|
"\tSource MAC2 : %s\n"
|
||||||
"\tSource Port2: %d\n"
|
"\tSource Port2: %d\n"
|
||||||
@ -1446,7 +1450,7 @@ int configureMAC() {
|
|||||||
LOG(logERROR, ("could not set udp destination IP and port\n"));
|
LOG(logERROR, ("could not set udp destination IP and port\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (numInterfaces == 2 &&
|
if (vetoEnabled && numInterfaces == 2 &&
|
||||||
setUDPDestinationDetails(1, dst_ip2, dstport2) == FAIL) {
|
setUDPDestinationDetails(1, dst_ip2, dstport2) == FAIL) {
|
||||||
LOG(logERROR,
|
LOG(logERROR,
|
||||||
("could not set udp destination IP and port for interface 2\n"));
|
("could not set udp destination IP and port for interface 2\n"));
|
||||||
@ -1461,7 +1465,7 @@ int configureMAC() {
|
|||||||
setupHeader(iRxEntry, 0, dstip, dstmac, dstport, srcmac, srcip, srcport);
|
setupHeader(iRxEntry, 0, dstip, dstmac, dstport, srcmac, srcip, srcport);
|
||||||
|
|
||||||
// veto
|
// veto
|
||||||
if (numInterfaces == 2) {
|
if (vetoEnabled && numInterfaces == 2) {
|
||||||
setupHeader(iRxEntry, 1, dstip2, dstmac2, dstport2, srcmac2, srcip2,
|
setupHeader(iRxEntry, 1, dstip2, dstmac2, dstport2, srcmac2, srcip2,
|
||||||
srcport2);
|
srcport2);
|
||||||
}
|
}
|
||||||
@ -2234,7 +2238,8 @@ int startStateMachine() {
|
|||||||
if (createUDPSocket(0) != OK) {
|
if (createUDPSocket(0) != OK) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (getNumberofUDPInterfaces() == 2 && createUDPSocket(1) != OK) {
|
if (getVeto() && getNumberofUDPInterfaces() == 2 &&
|
||||||
|
createUDPSocket(1) != OK) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
||||||
@ -2277,6 +2282,8 @@ void *start_timer(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int numInterfaces = getNumberofUDPInterfaces();
|
int numInterfaces = getNumberofUDPInterfaces();
|
||||||
|
int vetoEnabled = getVeto();
|
||||||
|
|
||||||
int numRepeats = getNumTriggers();
|
int numRepeats = getNumTriggers();
|
||||||
if (getTiming() == AUTO_TIMING) {
|
if (getTiming() == AUTO_TIMING) {
|
||||||
if (burstMode == BURST_OFF) {
|
if (burstMode == BURST_OFF) {
|
||||||
@ -2352,7 +2359,7 @@ void *start_timer(void *arg) {
|
|||||||
// second interface (veto)
|
// second interface (veto)
|
||||||
char packetData2[vetopacketsize];
|
char packetData2[vetopacketsize];
|
||||||
memset(packetData2, 0, vetopacketsize);
|
memset(packetData2, 0, vetopacketsize);
|
||||||
if (numInterfaces == 2) {
|
if (vetoEnabled && numInterfaces == 2) {
|
||||||
// set header
|
// set header
|
||||||
veto_header *header = (veto_header *)(packetData2);
|
veto_header *header = (veto_header *)(packetData2);
|
||||||
header->frameNumber = frameHeaderNr;
|
header->frameNumber = frameHeaderNr;
|
||||||
@ -2393,7 +2400,7 @@ void *start_timer(void *arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
closeUDPSocket(0);
|
closeUDPSocket(0);
|
||||||
if (numInterfaces == 2) {
|
if (vetoEnabled && numInterfaces == 2) {
|
||||||
closeUDPSocket(1);
|
closeUDPSocket(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7454,36 +7454,25 @@ int set_veto(int file_des) {
|
|||||||
#else
|
#else
|
||||||
// only set
|
// only set
|
||||||
if (Server_VerifyLock() == OK) {
|
if (Server_VerifyLock() == OK) {
|
||||||
// veto allowed only if module attached or in -nomodule mode
|
setVeto(arg);
|
||||||
if (arg > 0) {
|
// if numinterfaces is 2 and veto is 1 now, then configuremac
|
||||||
if (checkModuleFlag) {
|
if (arg > 0 && getNumberofUDPInterfaces() == 2 &&
|
||||||
int type_ret = checkDetectorType();
|
is_configurable() == OK) {
|
||||||
if (type_ret == -1) {
|
ret = configureMAC();
|
||||||
ret = FAIL;
|
if (ret != OK) {
|
||||||
sprintf(mess, "Could not enable veto streaming. "
|
sprintf(mess, "Configure Mac failed after enabling veto\n");
|
||||||
"Could not open "
|
strcpy(configureMessage, mess);
|
||||||
"file to know if module attached.\n");
|
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (type_ret == -2) {
|
configured = FAIL;
|
||||||
ret = FAIL;
|
LOG(logWARNING, ("Configure FAIL, not all parameters "
|
||||||
sprintf(mess, "Could not enable veto streaming. No "
|
"configured yet\n"));
|
||||||
"module attached!\n");
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
} else if (type_ret == FAIL) {
|
|
||||||
ret = FAIL;
|
|
||||||
sprintf(mess, "Could not enable veto streaming. Wrong "
|
|
||||||
"module type "
|
|
||||||
"attached!\n");
|
|
||||||
LOG(logERROR, (mess));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
LOG(logINFOBLUE,
|
LOG(logINFOGREEN, ("\tConfigure MAC successful\n"));
|
||||||
("In No-Module mode: Ignoring module-attached check. "
|
configured = OK;
|
||||||
"Continuing to enable veto streaming.\n"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret == OK) {
|
if (ret == OK) {
|
||||||
setVeto(arg);
|
|
||||||
int retval = getVeto();
|
int retval = getVeto();
|
||||||
LOG(logDEBUG1, ("veto mode retval: %u\n", retval));
|
LOG(logDEBUG1, ("veto mode retval: %u\n", retval));
|
||||||
validate(arg, retval, "set veto mode", DEC);
|
validate(arg, retval, "set veto mode", DEC);
|
||||||
|
@ -9,4 +9,4 @@
|
|||||||
#define APIMOENCH 0x200515
|
#define APIMOENCH 0x200515
|
||||||
#define APIEIGER 0x200520
|
#define APIEIGER 0x200520
|
||||||
#define APIMYTHEN3 0x200526
|
#define APIMYTHEN3 0x200526
|
||||||
#define APIGOTTHARD2 0x200527
|
#define APIGOTTHARD2 0x200528
|
||||||
|
Loading…
x
Reference in New Issue
Block a user