From ab1a8fbfca849c35c072b79fa9bffda9f2cc9bcb Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Thu, 14 Sep 2023 17:48:30 +0200 Subject: [PATCH] PCIExpressDevice: Get MAC/IPv4 Address for internal packet generator via ioctl --- receiver/PCIExpressDevice.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/receiver/PCIExpressDevice.cpp b/receiver/PCIExpressDevice.cpp index ee7ff878..749ce703 100644 --- a/receiver/PCIExpressDevice.cpp +++ b/receiver/PCIExpressDevice.cpp @@ -106,8 +106,14 @@ void PCIExpressDevice::FPGA_StartAction(const DiffractionExperiment &experiment) FrameGeneratorConfig config{}; config.frames = experiment.GetFrameNum() + DELAY_FRAMES_STOP_AND_QUIT + 1; config.modules = experiment.GetModulesNum(data_stream); - config.dest_ipv4_addr = ipv4_addr; - config.dest_mac_addr = mac_addr; + + if (ioctl(fd, IOCTL_JFJOCH_GET_MAC, &config.dest_mac_addr) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed getting MAC address", errno); + if (ioctl(fd, IOCTL_JFJOCH_GET_IPV4, &config.dest_ipv4_addr) != 0) + throw JFJochException(JFJochExceptionCategory::PCIeError, + "Failed getting MAC address", errno); + if (ioctl(fd, IOCTL_JFJOCH_RUN_FRAME_GEN, &config) != 0) throw JFJochException(JFJochExceptionCategory::PCIeError, "Failed starting frame generator", errno); }