cleanup callback added to thirdparty fronthaul interface

This commit is contained in:
Raymond Knopp
2019-09-07 10:42:57 +02:00
parent d4da46a249
commit 8e86edc352
3 changed files with 13 additions and 2 deletions
+4
View File
@@ -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 */
@@ -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);
}
@@ -33,8 +33,10 @@
#include <netinet/ether.h>
#include <stdint.h>
#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