aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-11-04 13:31:41 +0000
committerlaforge <laforge@osmocom.org>2020-11-26 09:22:38 +0000
commitdef24f0d9af2463a5ef557d35f23abd5b4d07120 (patch)
tree3e0a3082d37e63e7a6fdae9c200993ac06dddfda
parent4ee4d6be2a66a151de0fc0ef258d89fad4135a91 (diff)
part 5 of: fix SAPIs for handover, osmo-bts-oc2g
-rw-r--r--src/osmo-bts-oc2g/oml.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index 53f85191..9a7751b9 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -670,10 +670,6 @@ static const struct sapi_dir pdtch_sapis[] = {
#endif
};
-static const struct sapi_dir ho_sapis[] = {
- { GsmL1_Sapi_Rach, GsmL1_Dir_RxUplink },
-};
-
struct lchan_sapis {
const struct sapi_dir *sapis;
unsigned int num_sapis;
@@ -706,11 +702,6 @@ static const struct lchan_sapis sapis_for_lchan[_GSM_LCHAN_MAX] = {
},
};
-static const struct lchan_sapis sapis_for_ho = {
- .sapis = ho_sapis,
- .num_sapis = ARRAY_SIZE(ho_sapis),
-};
-
static int mph_send_activate_req(struct gsm_lchan *lchan, struct sapi_cmd *cmd);
static int mph_send_deactivate_req(struct gsm_lchan *lchan, struct sapi_cmd *cmd);
static int mph_send_config_ciphering(struct gsm_lchan *lchan, struct sapi_cmd *cmd);
@@ -1183,10 +1174,10 @@ int lchan_activate(struct gsm_lchan *lchan)
"%s Trying to activate lchan, but commands in queue\n",
gsm_lchan_name(lchan));
- /* override the regular SAPIs if this is the first hand-over
- * related activation of the LCHAN */
+ /* For handover, always start the main channel immediately. lchan->want_dl_sacch_active indicates whether dl
+ * SACCH should be activated. Also, for HO, start the RACH SAPI. */
if (lchan->ho.active == HANDOVER_ENABLED)
- s4l = &sapis_for_ho;
+ enqueue_sapi_act_cmd(lchan, GsmL1_Sapi_Rach, GsmL1_Dir_RxUplink);
for (i = 0; i < s4l->num_sapis; i++) {
int sapi = s4l->sapis[i].sapi;
@@ -1199,6 +1190,12 @@ int lchan_activate(struct gsm_lchan *lchan)
fl1h->alive_prim_cnt = 0;
osmo_timer_schedule(&fl1h->alive_timer, 5, 0);
}
+
+ /* For handover, possibly postpone activating the dl SACCH until the HO RACH is received. */
+ if (sapi == GsmL1_Sapi_Sacch && dir == GsmL1_Dir_TxDownlink
+ && !lchan->want_dl_sacch_active)
+ continue;
+
enqueue_sapi_act_cmd(lchan, sapi, dir);
}
@@ -2002,12 +1999,9 @@ int l1if_rsl_chan_mod(struct gsm_lchan *lchan)
/* Give up listening to RACH bursts */
release_sapi_ul_rach(lchan);
- /* Activate the normal SAPIs */
- for (i = 0; i < s4l->num_sapis; i++) {
- int sapi = s4l->sapis[i].sapi;
- int dir = s4l->sapis[i].dir;
- enqueue_sapi_act_cmd(lchan, sapi, dir);
- }
+ /* All the normal SAPIs have already been activated, only DL SACCH may still be missing. */
+ if (lchan->want_dl_sacch_active)
+ enqueue_sapi_act_cmd(lchan, GsmL1_Sapi_Sacch, GsmL1_Dir_TxDownlink);
return 0;
}