# HG changeset patch # User Mychaela Falconia # Date 1723586869 0 # Node ID 94f11dc0d4749b2cbc62beeacb5c50a3cd7ec120 # Parent cd7448724d74a122217be462b4509401cb143d1e abis: Rx osmo_trau_sync hooked in diff -r cd7448724d74 -r 94f11dc0d474 abis/main.c --- a/abis/main.c Tue Aug 13 21:44:30 2024 +0000 +++ b/abis/main.c Tue Aug 13 22:07:49 2024 +0000 @@ -20,6 +20,7 @@ #include #include #include +#include #include "../libutil/open_ts.h" #include "../libutil/stdin_handler.h" @@ -81,6 +82,18 @@ } } +static void setup_rx_sync(void) +{ + int nr; + + for (nr = 0; nr < ABIS_SUBSLOTS; nr++) { + subslots[nr].sync = osmo_trau_sync_alloc(g_ctx, "TRAU-UL-sync", + sync_rx_func, OSMO_TRAU_SYNCP_16_FR_EFR, + subslots + nr); + OSMO_ASSERT(subslots[nr].sync); + } +} + int main(int argc, char **argv) { process_cmdline(argc, argv); @@ -98,6 +111,7 @@ osmo_i460_ts_init(&i460_ts); register_subslots(); + setup_rx_sync(); init_canned_dl_frames(); osmo_fd_setup(&ts_ofd, ts_fd, OSMO_FD_READ, ts_fd_cb, NULL, 0); diff -r cd7448724d74 -r 94f11dc0d474 abis/submux.h --- a/abis/submux.h Tue Aug 13 21:44:30 2024 +0000 +++ b/abis/submux.h Tue Aug 13 22:07:49 2024 +0000 @@ -9,6 +9,7 @@ #include #include +#include #include #define ABIS_SUBSLOTS 4 @@ -18,9 +19,11 @@ int nr; bool is_active; bool is_efr; + struct osmo_fsm_inst *sync; }; extern struct abis_subslot subslots[ABIS_SUBSLOTS]; void i460_rx_func(struct osmo_i460_subchan *schan, void *user_data, const ubit_t *bits, unsigned int num_bits); +void sync_rx_func(void *user_data, const ubit_t *bits, unsigned int num_bits); diff -r cd7448724d74 -r 94f11dc0d474 abis/subslot_rx.c --- a/abis/subslot_rx.c Tue Aug 13 21:44:30 2024 +0000 +++ b/abis/subslot_rx.c Tue Aug 13 22:07:49 2024 +0000 @@ -10,6 +10,7 @@ #include #include +#include #include "globals.h" #include "submux.h" @@ -17,5 +18,14 @@ void i460_rx_func(struct osmo_i460_subchan *schan, void *user_data, const ubit_t *bits, unsigned int num_bits) { - /* to be filled */ + struct abis_subslot *ab = user_data; + + osmo_trau_sync_rx_ubits(ab->sync, bits, num_bits); } + +void sync_rx_func(void *user_data, const ubit_t *bits, unsigned int num_bits) +{ + struct abis_subslot *ab = user_data; + + +}