library/PCUIF_Types.ttcn: extend RACH.ind with TRX / TS number fields

Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: Ia5c4e504a21dc5508920553d3856027455dba1b1
Related: OS#4102, OS#1545
This commit is contained in:
Vadim Yanitskiy 2019-11-17 02:23:51 +07:00 committed by laforge
parent 619b2a6547
commit 36558d9526
4 changed files with 24 additions and 13 deletions

View File

@ -4170,8 +4170,8 @@ runs on test_CT {
chan_nr := ts_RslChanNr_PDCH(7),
link_id := ts_RslLinkID_OSMO_PTCCH(0));
/* TODO: check time-slot and TRX number as soon as we extend the PCU interface */
pcu_rach_ind := tr_PCUIF_RACH_IND(ra := ra, fn := fn, sapi := PCU_IF_SAPI_PTCCH);
pcu_rach_ind := tr_PCUIF_RACH_IND(bts_nr := 0, trx_nr := 0, ts_nr := 7,
ra := ra, fn := fn, sapi := PCU_IF_SAPI_PTCCH);
/* Expect a RACH.ind on the PCU interface (timeout is one multi-frame) */
T.start(52.0 * 4.615 / 1000.0);
@ -4333,7 +4333,7 @@ testcase TC_pcu_rach_content() runs on test_CT {
timer T := 2.0;
T.start;
alt {
[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND(0, oct2int(ra), 0, ?, fn))) {
[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND(0, 0, 0, oct2int(ra), 0, ?, fn))) {
T.stop;
}
[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) {
@ -4382,7 +4382,7 @@ testcase TC_pcu_ext_rach_content() runs on test_CT {
/* Compose the expected message */
pcu_rach_ind := tr_PCUIF_RACH_IND(
bts_nr := 0,
bts_nr := 0, trx_nr := 0, ts_nr := 0,
ra := bit2int(ra11),
is_11bit := 1,
burst_type := pcu_bt,

View File

@ -130,7 +130,9 @@ type record PCUIF_rach_ind {
uint32_t fn,
uint16_t arfcn,
uint8_t is_11bit,
PCUIF_BurstType burst_type
PCUIF_BurstType burst_type,
uint8_t trx_nr,
uint8_t ts_nr
} with { variant "" };
type record PCUIF_InfoTrx {
@ -565,6 +567,8 @@ template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?,
}
template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr,
template (value) uint8_t trx_nr,
template (value) uint8_t ts_nr,
template (value) uint16_t ra,
template (value) uint8_t is_11bit,
template (value) PCUIF_BurstType burst_type,
@ -584,11 +588,15 @@ template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr
fn := fn,
arfcn := arfcn,
is_11bit := is_11bit,
burst_type := burst_type
burst_type := burst_type,
trx_nr := trx_nr,
ts_nr := ts_nr
}
}
}
template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
template uint8_t trx_nr := ?,
template uint8_t ts_nr := ?,
template uint16_t ra := ?,
template uint8_t is_11bit := ?,
template PCUIF_BurstType burst_type := ?,
@ -605,7 +613,9 @@ template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
fn := fn,
arfcn := ?,
is_11bit := is_11bit,
burst_type := burst_type
burst_type := burst_type,
trx_nr := trx_nr,
ts_nr := ts_nr
}
}
}

View File

@ -515,7 +515,7 @@ runs on RAW_PCU_Test_CT return boolean {
/* Send RACH.ind */
log("Sending RACH.ind on fn=", fn, " with RA=", ra, ", TA=", ta);
BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
ra := ra, is_11bit := is_11bit,
burst_type := burst_type,
fn := fn, arfcn := 871,
@ -524,7 +524,7 @@ runs on RAW_PCU_Test_CT return boolean {
/* Expect Immediate (TBF) Assignment on TS0/AGCH */
T.start(2.0);
alt {
[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := ?, ts_nr := 0,
[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := bts_nr, trx_nr := 0, ts_nr := 0,
sapi := PCU_IF_SAPI_AGCH, data := ?))
-> value pcu_msg {
rr_imm_ass := dec_GsmRrMessage(pcu_msg.u.data_req.data);
@ -778,7 +778,7 @@ const PTCCH_TAI_ToA_MAP ptcch_toa_map_def := {
0, 0, 0, 0
};
private altstep as_ta_ptcch(uint8_t bts_nr := 0, /* TODO: TRX / TS number */
private altstep as_ta_ptcch(uint8_t bts_nr := 0, uint8_t trx_nr := 0, uint8_t ts_nr := 7,
in PTCCH_TAI_ToA_MAP toa_map := ptcch_toa_map_def)
runs on RAW_PCU_Test_CT {
var RAW_PCU_Event event;
@ -794,7 +794,7 @@ runs on RAW_PCU_Test_CT {
", fn=", event.data.tdma_fn,
", ToA=", toa_map[ss], " (QTA)");
/* TODO: do we care about RA and burst format? */
BTS.send(ts_PCUIF_RACH_IND(bts_nr := bts_nr,
BTS.send(ts_PCUIF_RACH_IND(bts_nr, trx_nr, ts_nr,
ra := oct2int('3A'O),
is_11bit := 0,
burst_type := BURST_TYPE_0,
@ -821,7 +821,7 @@ runs on RAW_PCU_Test_CT {
alt {
/* Keep sending of Access Bursts during two multi-frames (period of PTCCH/D)
* with increasing ToA (Timing of Arrival) values: 0, 7, 14, 28, 35... */
[] as_ta_ptcch(bts_nr := 0, toa_map := ptcch_toa_map);
[] as_ta_ptcch(bts_nr := 0, trx_nr := 0, ts_nr := 7, toa_map := ptcch_toa_map);
/* In the end of 2nd multi-frame we should receive a PTCCH/D block */
[] BTS.receive(tr_PCUIF_DATA_REQ(bts_nr := 0, trx_nr := 0, ts_nr := 7,
sapi := PCU_IF_SAPI_PTCCH)) -> value pcu_msg {

View File

@ -374,7 +374,8 @@ testcase TC_pcuif_rach() runs on RAW_Test_CT {
f_sns_bringup_1c1u();
activate(as_pcu_activate());
f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, ra:=23, is_11bit:=0, burst_type:=BURST_TYPE_0,
f_pcuif_tx(ts_PCUIF_RACH_IND(bts_nr:=0, trx_nr:=0, ts_nr:=0, ra:=23,
is_11bit:=0, burst_type:=BURST_TYPE_0,
fn:=42, arfcn:=871, qta:=0));
PCU.receive(t_SD_PCUIF(g_pcu_conn_id,
tr_PCUIF_DATA_REQ(bts_nr:=0, trx_nr:=0, ts_nr:=0, block_nr:=?, fn:=?,