trxcon: merge 'sched_trx.h' and 'scheduler.h' into 'l1sched.h'

Change-Id: Ide1e3ccdf32fdc255acc943e0c0936d15cf0c680
Related: OS#5599, OS#3761
changes/47/28547/3
Vadim Yanitskiy 7 months ago
parent 38373ee20f
commit eff2d52e75
  1. 3
      src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am
  2. 33
      src/host/trxcon/include/osmocom/bb/trxcon/l1sched.h
  3. 38
      src/host/trxcon/include/osmocom/bb/trxcon/scheduler.h
  4. 3
      src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h
  5. 2
      src/host/trxcon/src/l1ctl.c
  6. 2
      src/host/trxcon/src/sched_clck.c
  7. 3
      src/host/trxcon/src/sched_lchan_common.c
  8. 2
      src/host/trxcon/src/sched_lchan_desc.c
  9. 3
      src/host/trxcon/src/sched_lchan_pdtch.c
  10. 3
      src/host/trxcon/src/sched_lchan_rach.c
  11. 3
      src/host/trxcon/src/sched_lchan_sch.c
  12. 3
      src/host/trxcon/src/sched_lchan_tchf.c
  13. 3
      src/host/trxcon/src/sched_lchan_tchh.c
  14. 3
      src/host/trxcon/src/sched_lchan_xcch.c
  15. 2
      src/host/trxcon/src/sched_mframe.c
  16. 3
      src/host/trxcon/src/sched_prim.c
  17. 3
      src/host/trxcon/src/sched_trx.c
  18. 1
      src/host/trxcon/src/trx_if.c
  19. 3
      src/host/trxcon/src/trxcon.c

@ -2,8 +2,7 @@ noinst_HEADERS = \
l1ctl_proto.h \
l1ctl_link.h \
l1ctl.h \
scheduler.h \
sched_trx.h \
l1sched.h \
trx_if.h \
logging.h \
trxcon.h \

@ -1,5 +1,6 @@
#pragma once
#include <time.h>
#include <stdint.h>
#include <stdbool.h>
@ -7,10 +8,11 @@
#include <osmocom/core/utils.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/gsm0502.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/scheduler.h>
#define GSM_BURST_LEN 148
#define GSM_BURST_PL_LEN 116
@ -41,9 +43,15 @@
/* Forward declaration to avoid mutual include */
struct l1sched_lchan_state;
struct l1sched_meas_set;
struct l1sched_state;
struct trx_instance;
struct l1sched_ts;
enum l1sched_clck_state {
L1SCHED_CLCK_ST_WAIT,
L1SCHED_CLCK_ST_OK,
};
enum l1sched_burst_type {
L1SCHED_BURST_GMSK,
L1SCHED_BURST_8PSK,
@ -301,6 +309,26 @@ struct l1sched_ts_prim {
uint8_t payload[0];
};
/*! One scheduler instance */
struct l1sched_state {
/*! Clock state */
enum l1sched_clck_state state;
/*! Local clock source */
struct timespec clock;
/*! Count of processed frames */
uint32_t fn_counter_proc;
/*! Local frame counter advance */
uint32_t fn_counter_advance;
/*! Count of lost frames */
uint32_t fn_counter_lost;
/*! Frame callback timer */
struct osmo_timer_list clock_timer;
/*! Frame callback */
void (*clock_cb)(struct l1sched_state *sched);
/*! Private data (e.g. pointer to trx instance) */
void *data;
};
extern const struct l1sched_lchan_desc l1sched_lchan_desc[_L1SCHED_CHAN_MAX];
const struct l1sched_tdma_multiframe *l1sched_mframe_layout(
enum gsm_phys_chan_config config, int tn);
@ -413,3 +441,6 @@ bool l1sched_tchh_block_map_fn(enum l1sched_lchan_type chan,
/* Measurement history */
void l1sched_lchan_meas_push(struct l1sched_lchan_state *lchan, const struct l1sched_meas_set *meas);
void l1sched_lchan_meas_avg(struct l1sched_lchan_state *lchan, unsigned int n);
int l1sched_clck_handle(struct l1sched_state *sched, uint32_t fn);
void l1sched_clck_reset(struct l1sched_state *sched);

@ -1,38 +0,0 @@
#pragma once
#include <stdint.h>
#include <time.h>
#include <osmocom/core/timer.h>
#include <osmocom/gsm/gsm0502.h>
enum l1sched_clck_state {
L1SCHED_CLCK_ST_WAIT,
L1SCHED_CLCK_ST_OK,
};
/* Forward structure declaration */
struct l1sched_state;
/*! One scheduler instance */
struct l1sched_state {
/*! Clock state */
enum l1sched_clck_state state;
/*! Local clock source */
struct timespec clock;
/*! Count of processed frames */
uint32_t fn_counter_proc;
/*! Local frame counter advance */
uint32_t fn_counter_advance;
/*! Count of lost frames */
uint32_t fn_counter_lost;
/*! Frame callback timer */
struct osmo_timer_list clock_timer;
/*! Frame callback */
void (*clock_cb)(struct l1sched_state *sched);
/*! Private data (e.g. pointer to trx instance) */
void *data;
};
int l1sched_clck_handle(struct l1sched_state *sched, uint32_t fn);
void l1sched_clck_reset(struct l1sched_state *sched);

@ -5,8 +5,7 @@
#include <osmocom/core/timer.h>
#include <osmocom/core/fsm.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#define TRXC_BUF_SIZE 1024
#define TRXD_BUF_SIZE 512

@ -40,7 +40,7 @@
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
static const char *arfcn2band_name(uint16_t arfcn)
{

@ -38,7 +38,7 @@
#include <osmocom/core/timer_compat.h>
#include <osmocom/gsm/a5.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>

@ -37,8 +37,7 @@
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trxcon.h>
#include <osmocom/bb/trxcon/trx_if.h>

@ -26,7 +26,7 @@
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/core/gsmtap.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
/* Forward declaration of handlers */
int rx_data_fn(struct trx_instance *trx, struct l1sched_ts *ts,

@ -31,8 +31,7 @@
#include <osmocom/coding/gsm0503_coding.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/l1ctl.h>

@ -31,8 +31,7 @@
#include <osmocom/coding/gsm0503_coding.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/l1ctl.h>

@ -32,8 +32,7 @@
#include <osmocom/coding/gsm0503_coding.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/l1ctl.h>

@ -33,8 +33,7 @@
#include <osmocom/codec/codec.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/l1ctl.h>

@ -36,8 +36,7 @@
#include <osmocom/codec/codec.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/l1ctl.h>

@ -31,8 +31,7 @@
#include <osmocom/coding/gsm0503_coding.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/l1ctl.h>

@ -25,7 +25,7 @@
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
/* Non-combined CCCH */
static const struct l1sched_tdma_frame frame_bcch[51] = {

@ -29,8 +29,7 @@
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/logging.h>

@ -32,8 +32,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/logging.h>

@ -43,7 +43,6 @@
#include <osmocom/bb/trxcon/trxcon.h>
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/logging.h>
#include <osmocom/bb/trxcon/scheduler.h>
static struct value_string trx_evt_names[] = {
{ 0, NULL } /* no events? */

@ -45,8 +45,7 @@
#include <osmocom/bb/trxcon/l1ctl.h>
#include <osmocom/bb/trxcon/l1ctl_link.h>
#include <osmocom/bb/trxcon/l1ctl_proto.h>
#include <osmocom/bb/trxcon/scheduler.h>
#include <osmocom/bb/trxcon/sched_trx.h>
#include <osmocom/bb/trxcon/l1sched.h>
#define COPYRIGHT \
"Copyright (C) 2016-2020 by Vadim Yanitskiy <axilirator@gmail.com>\n" \

Loading…
Cancel
Save