summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-07-27 16:53:09 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-10-23 22:05:49 +0330
commit1515045c816a999b9470651acb2eb6e30148e02c (patch)
tree516d0a658e03c607ca560932ff68bcc90314e1c7
parent205d500008411e356e8e56a7f9ff20f0a62efd5f (diff)
host/trxcon/scheduler: optionally reset clock counter
-rw-r--r--src/host/trxcon/l1ctl.c8
-rw-r--r--src/host/trxcon/sched_trx.c10
-rw-r--r--src/host/trxcon/sched_trx.h2
-rw-r--r--src/host/trxcon/trxcon.c4
4 files changed, 13 insertions, 11 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 436d0430..78107630 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -287,8 +287,8 @@ static int l1ctl_rx_fbsb_req(struct l1ctl_link *l1l, struct msgb *msg)
gsm_band_name(gsm_arfcn2band(band_arfcn)),
band_arfcn &~ ARFCN_FLAG_MASK);
- /* Reset L1 */
- sched_trx_reset(l1l->trx);
+ /* Reset scheduler and clock counter */
+ sched_trx_reset(l1l->trx, 1);
/* Configure a single timeslot */
if (fbsb->ccch_mode == CCCH_MODE_COMBINED)
@@ -371,7 +371,7 @@ static int l1ctl_rx_reset_req(struct l1ctl_link *l1l, struct msgb *msg)
/* Fall through */
case L1CTL_RES_T_SCHED:
- sched_trx_reset(l1l->trx);
+ sched_trx_reset(l1l->trx, 1);
break;
default:
LOGP(DL1C, LOGL_ERROR, "Unknown L1CTL_RESET_REQ type\n");
@@ -560,7 +560,7 @@ exit:
static int l1ctl_rx_dm_rel_req(struct l1ctl_link *l1l, struct msgb *msg)
{
/* Reset scheduler */
- sched_trx_reset(l1l->trx);
+ sched_trx_reset(l1l->trx, 0);
msgb_free(msg);
return 0;
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 04fc5cf1..94a8e68f 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -128,14 +128,15 @@ int sched_trx_shutdown(struct trx_instance *trx)
return 0;
}
-int sched_trx_reset(struct trx_instance *trx)
+int sched_trx_reset(struct trx_instance *trx, int reset_clock)
{
int i;
if (!trx)
return -EINVAL;
- LOGP(DSCH, LOGL_NOTICE, "Reset scheduler\n");
+ LOGP(DSCH, LOGL_NOTICE, "Reset scheduler %s\n",
+ reset_clock ? "and clock counter" : "");
/* Free all potentially allocated timeslots */
for (i = 0; i < TRX_TS_COUNT; i++)
@@ -143,8 +144,9 @@ int sched_trx_reset(struct trx_instance *trx)
INIT_LLIST_HEAD(&trx->ts_list);
- /* Stop and reset clock counter */
- sched_clck_reset(&trx->sched);
+ /* Stop and reset clock counter if required */
+ if (reset_clock)
+ sched_clck_reset(&trx->sched);
return 0;
}
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index cab290b8..ff3d254e 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -248,7 +248,7 @@ const struct trx_multiframe *sched_mframe_layout(
/* Scheduler management functions */
int sched_trx_init(struct trx_instance *trx);
-int sched_trx_reset(struct trx_instance *trx);
+int sched_trx_reset(struct trx_instance *trx, int reset_clock);
int sched_trx_shutdown(struct trx_instance *trx);
/* Timeslot management functions */
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 82371bdb..4a571b9a 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -89,8 +89,8 @@ static void trxcon_fsm_managed_action(struct osmo_fsm_inst *fi,
osmo_fsm_inst_state_chg(trxcon_fsm, TRXCON_STATE_IDLE, 0, 0);
if (app_data.trx->fsm->state != TRX_STATE_OFFLINE) {
- /* Reset scheduler */
- sched_trx_reset(app_data.trx);
+ /* Reset scheduler and clock counter */
+ sched_trx_reset(app_data.trx, 1);
/* TODO: implement trx_if_reset() */
trx_if_cmd_poweroff(app_data.trx);