diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h index 0cb2231fc4..282aa9fa94 100644 --- a/targets/ARCH/COMMON/common_lib.h +++ b/targets/ARCH/COMMON/common_lib.h @@ -398,6 +398,10 @@ struct openair0_device_t { \param device the hardware configuration to use */ int (*thirdparty_init)(openair0_device *device); + /*! \brief Callback for Third-party RRU Cleanup routine + \param device the hardware configuration to use + */ + int (*thirdparty_cleanup)(openair0_device *device); }; /* type of device init function, implemented in shared lib */ diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c index 7965faa5d4..58af046071 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c @@ -58,8 +58,8 @@ int trx_eth_start(openair0_device *device) { eth_state_t *eth = (eth_state_t*)device->priv; if (eth->flags == ETH_UDP_IF5_ORI_MODE) { - AssertFatal(device->thirdparty_init != NULL, "device->thirdparty_init is null\n"); - device->thirdparty_init(device); + AssertFatal(device->thirdparty_init != NULL, "device->thirdparty_init is null\n"); + AssertFatal(device->thirdparty_init(device) == 0, "third-party init failed\n"); } /* initialize socket */ if (eth->flags == ETH_RAW_MODE) { @@ -166,6 +166,11 @@ void trx_eth_end(openair0_device *device) { int trx_eth_stop(openair0_device *device) { + if (eth->flags == ETH_UDP_IF5_ORI_MODE) { + AssertFatal(device->thirdparty_cleanup != NULL, "device->thirdparty_cleanup is null\n"); + AssertFatal(device->thirdparty_cleanup(device) == 0, "third-party cleanup failed\n"); + } + return(0); } diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h b/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h index b0b45f6c38..eb1d27f7bc 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h @@ -33,8 +33,10 @@ #include #include +#ifndef LITE_COMPILATION #include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h" +#endif // ETH transport preference modes #ifdef OCP_FRAMEWORK