diff options
-rw-r--r-- | src/host/trxcon/l1ctl.c | 20 | ||||
-rw-r--r-- | src/host/trxcon/trxcon.c | 12 | ||||
-rw-r--r-- | src/host/trxcon/trxcon.h | 1 |
3 files changed, 20 insertions, 13 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c index 4abec77c..c01d372b 100644 --- a/src/host/trxcon/l1ctl.c +++ b/src/host/trxcon/l1ctl.c @@ -245,8 +245,24 @@ static int l1ctl_rx_reset_req(struct l1ctl_link *l1l, struct msgb *msg) LOGP(DL1C, LOGL_DEBUG, "Recv Reset Req (%u)\n", res->type); - osmo_fsm_inst_dispatch(trxcon_fsm, - L1CTL_EVENT_RESET_REQ, res); + switch (res->type) { + case L1CTL_RES_T_FULL: + /* TODO: implement trx_if_reset() */ + trx_if_flush_ctrl(l1l->trx); + trx_if_cmd_poweroff(l1l->trx); + trx_if_cmd_echo(l1l->trx); + + /* Fall through */ + case L1CTL_RES_T_SCHED: + sched_trx_reset(l1l->trx); + break; + default: + LOGP(DL1C, LOGL_ERROR, "Unknown L1CTL_RESET_REQ type\n"); + goto exit; + } + + /* Confirm */ + rc = l1ctl_tx_reset_conf(l1l, res->type); exit: msgb_free(msg); diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c index 9bc98e55..a87626f2 100644 --- a/src/host/trxcon/trxcon.c +++ b/src/host/trxcon/trxcon.c @@ -89,25 +89,18 @@ 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) { + /* TODO: implement trx_if_reset() */ trx_if_flush_ctrl(app_data.trx); trx_if_cmd_poweroff(app_data.trx); } break; - case L1CTL_EVENT_RESET_REQ: - trx_if_cmd_poweroff(app_data.trx); - trx_if_cmd_echo(app_data.trx); - sched_trx_reset(app_data.trx); - break; - case TRX_EVENT_RESET_IND: - /* TODO: send proper reset type */ - l1ctl_tx_reset_conf(app_data.l1l, L1CTL_RES_T_BOOT); - break; case SCH_EVENT_DATA: l1ctl_tx_data_ind(app_data.l1l, (struct l1ctl_info_dl *) data); case TRX_EVENT_RSP_ERROR: case TRX_EVENT_OFFLINE: case SCH_EVENT_CLCK_IND: case SCH_EVENT_CLCK_LOSS: + case TRX_EVENT_RESET_IND: /* TODO: notify L2 & L3 about that */ break; default: @@ -125,7 +118,6 @@ static struct osmo_fsm_state trxcon_fsm_states[] = { [TRXCON_STATE_MANAGED] = { .in_event_mask = ( GEN_MASK(L1CTL_EVENT_DISCONNECT) | - GEN_MASK(L1CTL_EVENT_RESET_REQ) | GEN_MASK(TRX_EVENT_RESET_IND) | GEN_MASK(TRX_EVENT_RSP_ERROR) | GEN_MASK(TRX_EVENT_OFFLINE) | diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h index 7b3a2321..6452f803 100644 --- a/src/host/trxcon/trxcon.h +++ b/src/host/trxcon/trxcon.h @@ -11,7 +11,6 @@ enum trxcon_fsm_events { /* L1CTL specific events */ L1CTL_EVENT_CONNECT, L1CTL_EVENT_DISCONNECT, - L1CTL_EVENT_RESET_REQ, /* TRX specific events */ TRX_EVENT_RESET_IND, |