library/RSL: pass lost link event to upper layers instead of failing

Some tests may expect that behavior so let the test decide what to do
with it.

Change-Id: Idd4bdfc99514f4c439837f0ce4a20ec5ff45e86c
This commit is contained in:
Pau Espin 2020-06-23 14:29:24 +02:00 committed by pespin
parent eddf0e9e10
commit abcdf78892
1 changed files with 24 additions and 5 deletions

View File

@ -394,6 +394,20 @@ runs on RSL_Emulation_CT return IpaStreamId {
return f_streamId_by_trx(trx_nr);
}
private function f_trx_conn_map_unregister(integer conn_id)
runs on RSL_Emulation_CT return IpaStreamId {
for (var integer i := 0; i < sizeof(TrxConnMap); i := i + 1) {
if (conn_id == TrxConnMap[i]) {
TrxConnMap[i] := -1;
TrxConnNum := TrxConnNum - 1;
return f_streamId_by_trx(i);
}
}
testcase.stop("Trying to unregister an unknown conn_id=", conn_id);
}
private function f_trx_conn_map_resolve(IpaStreamId id)
runs on RSL_Emulation_CT return integer {
var integer trx_nr := f_trx_by_streamId(id);
@ -498,12 +512,17 @@ function main(boolean bts_role := true) runs on RSL_Emulation_CT {
/* Notify the upper layers about a new connection */
CCHAN_PT.send(ts_RSLEm_EV(RSLEM_EV_TRX_UP, sid));
}
[bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Lost IPA connection!");
[bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) -> value evt {
log("Lost IPA connection! (conn_id=", evt.conn_id, "): ", evt.id_resp);
/* Notify the upper layers about lost connection */
var IpaStreamId sid := f_trx_conn_map_unregister(evt.conn_id);
CCHAN_PT.send(ts_RSLEm_EV(RSLEM_EV_TRX_DOWN, sid));
}
[not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Lost IPA connection!");
[not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) -> value evt {
log("Lost IPA connection! (conn_id=", evt.conn_id, ")");
/* Notify the upper layers about lost connection */
var IpaStreamId sid := f_trx_conn_map_unregister(evt.conn_id);
CCHAN_PT.send(ts_RSLEm_EV(RSLEM_EV_TRX_DOWN, sid));
}
[bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK)) {
IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_PAGING_LOAD_IND(23)));