aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-10-14 16:06:08 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-10-14 17:48:31 +0200
commitd3e730c61d57395550452f18428b06b56a316d02 (patch)
treeca21991a0e5f865d23ad9a4b2c570b953dba82f7
parent07232521a97d60c0218a2f255378bbf312222b4d (diff)
Move lchan_init_lapdm inside lchan_set_state(LCHAN_S_ACTIVE)
osmo-bts-trx/l1_if.c lchan_init_lapdm() for CCCH is already done when trx_set_ts_as_pchan() calls: "lchan_set_state(&ts->lchan[CCCH_LCHAN], LCHAN_S_ACTIVE);" Change-Id: I7a9c3660b9aab57ff8765e2f1526349599630cd9
-rw-r--r--src/common/lchan.c37
-rw-r--r--src/osmo-bts-lc15/oml.c4
-rw-r--r--src/osmo-bts-oc2g/oml.c4
-rw-r--r--src/osmo-bts-octphy/l1_oml.c3
-rw-r--r--src/osmo-bts-sysmo/oml.c4
-rw-r--r--src/osmo-bts-trx/l1_if.c6
-rw-r--r--src/osmo-bts-virtual/l1_if.c4
7 files changed, 21 insertions, 41 deletions
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 5d129526..28ea943a 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -272,29 +272,34 @@ void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state)
gsm_lchans_name(lchan->state), gsm_lchans_name(state));
lchan->state = state;
- /* Early Immediate Assignment: if we have a cached early IA pending, send it upon becoming active, or discard it
- * when releasing. */
- if (lchan->early_rr_ia) {
- switch (lchan->state) {
- case LCHAN_S_ACT_REQ:
- /* Activation is requested, keep the early IA until active. This allows the BSC to send the IA
- * even before a dynamic timeslot is done switching to a different pchan kind (experimental). */
- break;
- case LCHAN_S_ACTIVE:
- /* Activation is done, send the RR IA now. Delay a bit more to give Um time to let the lchan
- * light up for the MS */
+ switch (lchan->state) {
+ case LCHAN_S_ACT_REQ:
+ /* Early Immediate Assignment: Activation is requested, keep the
+ * early IA until active. This allows the BSC to send the IA
+ * even before a dynamic timeslot is done switching to a
+ * different pchan kind (experimental). */
+ break;
+ case LCHAN_S_ACTIVE:
+ lchan_init_lapdm(lchan);
+ if (lchan->early_rr_ia) {
+ /* Early Immediate Assignment: Activation is done, send
+ * the RR IA now. Delay a bit more to give Um time to
+ * let the lchan light up for the MS */
osmo_timer_del(&lchan->early_rr_ia_delay);
osmo_timer_schedule(&lchan->early_rr_ia_delay, 0,
osmo_tdef_get(abis_T_defs, -15, OSMO_TDEF_US, -1));
- break;
- default:
- /* Transition to any other state means whatever IA the BSC has sent shall now not be relevant
- * anymore. */
+ }
+ break;
+ default:
+ if (lchan->early_rr_ia) {
+ /* Early Immediate Assignment: Transition to any other
+ * state means whatever IA the BSC has sent shall now
+ * not be relevant anymore. */
osmo_timer_del(&lchan->early_rr_ia_delay);
msgb_free(lchan->early_rr_ia);
lchan->early_rr_ia = NULL;
- break;
}
+ break;
}
}
diff --git a/src/osmo-bts-lc15/oml.c b/src/osmo-bts-lc15/oml.c
index 6169ef74..675e3fed 100644
--- a/src/osmo-bts-lc15/oml.c
+++ b/src/osmo-bts-lc15/oml.c
@@ -1197,10 +1197,6 @@ int lchan_activate(struct gsm_lchan *lchan)
enqueue_sapi_act_cmd(lchan, sapi, dir);
}
-
-#warning "FIXME: Should this be in sapi_activate_cb?"
- lchan_init_lapdm(lchan);
-
return 0;
}
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index ba85f36e..d12571b7 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -1212,10 +1212,6 @@ int lchan_activate(struct gsm_lchan *lchan)
enqueue_sapi_act_cmd(lchan, sapi, dir);
}
-
-#warning "FIXME: Should this be in sapi_activate_cb?"
- lchan_init_lapdm(lchan);
-
return 0;
}
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 73ab9bde..5894c210 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1107,9 +1107,6 @@ int lchan_activate(struct gsm_lchan *lchan)
}
enqueue_sapi_act_cmd(lchan, sapi, dir);
}
-
- lchan_init_lapdm(lchan);
-
return 0;
}
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 74af56b0..ba60b76e 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -1204,10 +1204,6 @@ int lchan_activate(struct gsm_lchan *lchan)
continue;
enqueue_sapi_act_cmd(lchan, sapi, dir);
}
-
-#warning "FIXME: Should this be in sapi_activate_cb?"
- lchan_init_lapdm(lchan);
-
return 0;
}
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 9faae882..5ac3e314 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -165,10 +165,6 @@ static int trx_init(struct gsm_bts_trx *trx)
if (rc != 0)
return osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OPSTART_NACK,
(void*)(intptr_t)NM_NACK_CANT_PERFORM);
-
- if (trx == trx->bts->c0)
- lchan_init_lapdm(&trx->ts[0].lchan[CCCH_LCHAN]);
-
/* Send OPSTART ack */
return osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OPSTART_ACK, NULL);
}
@@ -438,8 +434,6 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
lchan->tch.amr_mr.bts_mode[3].mode,
amr_get_initial_mode(lchan),
(lchan->ho.active == 1));
- /* init lapdm */
- lchan_init_lapdm(lchan);
/* set lchan active */
lchan_set_state(lchan, LCHAN_S_ACTIVE);
/* set initial ciphering */
diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index a4a81bd7..0d36db18 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -224,8 +224,6 @@ int bts_model_phy_link_open(struct phy_link *plink)
* / PRIM_INFO_ACTIVATE */
if (pinst->trx == pinst->trx->bts->c0) {
vbts_sched_start(pinst->trx->bts);
- /* init lapdm layer 3 callback for the trx on timeslot 0 == BCCH */
- lchan_init_lapdm(&pinst->trx->ts[0].lchan[CCCH_LCHAN]);
/* FIXME: This is probably the wrong location to set the CCCH to active... the OML link def. needs to be reworked and fixed. */
pinst->trx->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_OML;
lchan_set_state(&pinst->trx->ts[0].lchan[CCCH_LCHAN], LCHAN_S_ACTIVE);
@@ -392,8 +390,6 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
lchan->tch.amr_mr.bts_mode[3].mode,
amr_get_initial_mode(lchan),
(lchan->ho.active == 1));
- /* init lapdm */
- lchan_init_lapdm(lchan);
/* set lchan active */
lchan_set_state(lchan, LCHAN_S_ACTIVE);
/* set initial ciphering */