aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/assignment_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-05-22 16:29:35 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-31 05:20:02 +0000
commitc33eb8d56943b8981523754b081967e6ff5f245d (patch)
tree65c63d529525b7afd92e87c17e9544f5c4c8e4fa /src/osmo-bsc/assignment_fsm.c
parent5df7e771a86f3cdd1c7a6a6f71f9ad6f3465674f (diff)
allow explixit TSC Set and TSC on chan activ / modif / assignment
Activating / modifying to a VAMOS mode will require picking specific TSC Set / TSC. It is a bad idea to pick the TSC in each message encoding function, rather make this choice centrally. So far we pick the training sequence code to use based on the timeslot configuration, and this TSC is determined only upon encoding the RSL messages. Instead, pick the TSC to use upon the initial lchan activation / modification request; store this in the request structs and pass through the activation / modification code paths. For VAMOS modes, we also need to pick a TSC Set. Do so also upon activ / modif request. Note that the TSC Set is not yet applied in this patch, it will be applied in upcoming VAMOS patches. The activ / modif request may pass -1 for tsc_set and/or tsc to indicate no specific choice of TSC Set and TSC, resulting in the same behavior as before this patch. For example, lchan->activate.info.tsc* may be passed as -1. The exact choice for tsc_set and tsc is then stored in lchan->activate.tsc*, i.e. one level up (the .info sub-struct is considered as immutable input args). The lchan->activate.tsc* are the values actually encoded in RSL messages. After the ACK, the lchan->activate.tsc* is stored in lchan->tsc* to indicate the TSC actually in use. Same for modif. Note that in 3GPP TS 45.002, the TSC Set are numbered 1 to 4, while the TSC are numbered 0 to 7. On the wire, though, TSC Set is sent as 0 to 3 value. This is a weird discrepancy, odd choice made by the spec authors. For conformance with the spec wording, I decided to pass the TSC Set number as a 1-4 ranged value, and only convert it to the 0-3 on-the-wire format upon message encoding. So log messages and VTY output will indicate the first TSC Set as "1", but the first TSC as "0", as defined in 3GPP TS 45.002, even if that is somewhat weird. Related: SYS#5315 OS#4940 Change-Id: Ic665125255d7354f5499d10dda1dd866ab243d24
Diffstat (limited to 'src/osmo-bsc/assignment_fsm.c')
-rw-r--r--src/osmo-bsc/assignment_fsm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index b96dbb3c3..81de9588e 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -439,7 +439,7 @@ static bool reuse_existing_lchan(struct gsm_subscriber_connection *conn)
}
static int _reassignment_request(enum assign_for assign_for, struct gsm_lchan *lchan, struct gsm_lchan *to_lchan,
- enum gsm_chan_t new_lchan_type)
+ enum gsm_chan_t new_lchan_type, int tsc_set, int tsc)
{
struct gsm_subscriber_connection *conn = lchan->conn;
struct assignment_request req = {
@@ -450,6 +450,8 @@ static int _reassignment_request(enum assign_for assign_for, struct gsm_lchan *l
.n_ch_mode_rate = 1,
.ch_mode_rate_list = { lchan->current_ch_mode_rate },
.target_lchan = to_lchan,
+ .tsc_set = tsc_set,
+ .tsc = tsc,
};
if (to_lchan)
@@ -469,15 +471,16 @@ static int _reassignment_request(enum assign_for assign_for, struct gsm_lchan *l
return osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_ASSIGNMENT_START, &req);
}
-int reassignment_request_to_lchan(enum assign_for assign_for, struct gsm_lchan *lchan, struct gsm_lchan *to_lchan)
+int reassignment_request_to_lchan(enum assign_for assign_for, struct gsm_lchan *lchan, struct gsm_lchan *to_lchan,
+ int tsc_set, int tsc)
{
- return _reassignment_request(assign_for, lchan, to_lchan, 0);
+ return _reassignment_request(assign_for, lchan, to_lchan, 0, tsc_set, tsc);
}
int reassignment_request_to_chan_type(enum assign_for assign_for, struct gsm_lchan *lchan,
enum gsm_chan_t new_lchan_type)
{
- return _reassignment_request(assign_for, lchan, NULL, new_lchan_type);
+ return _reassignment_request(assign_for, lchan, NULL, new_lchan_type, -1, -1);
}
void assignment_fsm_start(struct gsm_subscriber_connection *conn, struct gsm_bts *bts,
@@ -635,6 +638,8 @@ static void assignment_fsm_wait_lchan_active_onenter(struct osmo_fsm_inst *fi, u
.re_use_mgw_endpoint_from_lchan = conn->lchan,
.ta = conn->lchan->last_ta,
.ta_known = true,
+ .tsc_set = req->tsc_set,
+ .tsc = req->tsc,
};
lchan_activate(conn->assignment.new_lchan, &activ_info);
}