fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/27515 )


Change subject: gsm48_make_ho_cmd(): optionally add Synchronization Indication 
IE
......................................................................

gsm48_make_ho_cmd(): optionally add Synchronization Indication IE

Change-Id: I4e5b1163a71443d706f14ce4bfd5c2294c320432
Related: SYS#5838
---
M include/osmocom/bsc/gsm_04_08_rr.h
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/handover_fsm.c
3 files changed, 16 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/27515/1

diff --git a/include/osmocom/bsc/gsm_04_08_rr.h 
b/include/osmocom/bsc/gsm_04_08_rr.h
index 75307d6..7d68fc8 100644
--- a/include/osmocom/bsc/gsm_04_08_rr.h
+++ b/include/osmocom/bsc/gsm_04_08_rr.h
@@ -27,7 +27,7 @@
                           const struct gsm48_multi_rate_conf *mr_conf,
                           const struct amr_mode *modes, unsigned int 
num_modes);
 struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan,
-                              enum handover_scope ho_scope,
+                              enum handover_scope ho_scope, bool async,
                               uint8_t power_command, uint8_t ho_ref);
 int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan 
*lchan, uint8_t power_command);
 int gsm48_send_rr_app_info(struct gsm_lchan *lchan, uint8_t apdu_id, uint8_t 
apdu_flags,
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 3a915af..569b498 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -534,7 +534,7 @@

 /* Chapter 9.1.15: Handover Command */
 struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan,
-                              enum handover_scope ho_scope,
+                              enum handover_scope ho_scope, bool async,
                               uint8_t power_command, uint8_t ho_ref)
 {
        struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 HO CMD");
@@ -555,6 +555,19 @@
        ho->ho_ref = ho_ref;
        ho->power_command = power_command;

+       /* Synchronization Indication, TV (see 3GPP TS 44.018, 9.1.15.1).
+        * In the case of inter-RAT handover, always include this IE for the 
sake of
+        * explicitness.  In the case of intra-RAT handover, include this IE 
only for
+        * the synchronized handover.  If omitted, non-synchronized handover is 
assumed. */
+       if (!async || (ho_scope & HO_INTER_BSC_IN)) {
+               /* Only the SI field (Non-synchronized/Synchronized) is present.
+                * TODO: ROT (Report Observed Time Difference), currently 0.
+                * TODO: NCI (Normal cell indication), currently 0. */
+               const uint8_t sync_ind = async ? 0x00 : 0x01;
+               /* T (4 bit) + V (4 bit), see 3GPP TS 44.018, 10.5.2.39 */
+               msgb_v_put(msg, GSM48_IE_SYNC_IND | (sync_ind & 0x0f));
+       }
+
        if (new_lchan->ts->hopping.enabled) {
                struct gsm_bts *bts = new_lchan->ts->trx->bts;
                struct gsm48_system_information_type_1 *si1;
@@ -565,7 +578,6 @@
                                  GSM48_HOCMD_CCHDESC_LEN,
                                  si1->cell_channel_description);
        }
-       /* FIXME: optional bits for type of synchronization? */

        msgb_tv_put(msg, GSM48_IE_CHANMODE_1, 
new_lchan->current_ch_mode_rate.chan_mode);

diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 9aa6578..8240c38 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -1199,7 +1199,7 @@
        struct handover *ho = &conn->ho;

        struct msgb *rr_ho_cmd = gsm48_make_ho_cmd(ho->new_lchan,
-                                                  ho->scope,
+                                                  ho->scope, ho->async,
                                                   ho->new_lchan->ms_power,
                                                   ho->ho_ref);
        if (!rr_ho_cmd) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27515
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: 2021q4
Gerrit-Change-Id: I4e5b1163a71443d706f14ce4bfd5c2294c320432
Gerrit-Change-Number: 27515
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to