library: GSM_Types: fix extra indention tab
The top level context doesn't have an indent. Change-Id: Ifece2e9fa782f173665e10fa9174403cccac7eb6
This commit is contained in:
parent
5283f55777
commit
5e6ae79d0c
|
@ -12,223 +12,223 @@
|
||||||
|
|
||||||
module GSM_Types {
|
module GSM_Types {
|
||||||
|
|
||||||
import from General_Types all;
|
import from General_Types all;
|
||||||
import from Osmocom_Types all;
|
import from Osmocom_Types all;
|
||||||
|
|
||||||
type integer GsmArfcn (0..1023);
|
type integer GsmArfcn (0..1023);
|
||||||
type integer UmtsArfcn (0..16383);
|
type integer UmtsArfcn (0..16383);
|
||||||
type integer UmtsScramblingCode (0..511);
|
type integer UmtsScramblingCode (0..511);
|
||||||
const integer GsmMaxFrameNumber := 26*51*2048;
|
const integer GsmMaxFrameNumber := 26*51*2048;
|
||||||
type integer GsmFrameNumber (0..GsmMaxFrameNumber);
|
type integer GsmFrameNumber (0..GsmMaxFrameNumber);
|
||||||
type integer GsmRxLev (0..63);
|
type integer GsmRxLev (0..63);
|
||||||
type integer GsmTsc (0..7) with { variant "FIELDLENGTH(8)" };
|
type integer GsmTsc (0..7) with { variant "FIELDLENGTH(8)" };
|
||||||
type uint32_t GsmTmsi;
|
type uint32_t GsmTmsi;
|
||||||
type OCT4 GprsTlli;
|
type OCT4 GprsTlli;
|
||||||
type hexstring GsmMcc length(3);
|
type hexstring GsmMcc length(3);
|
||||||
type hexstring GsmMnc length(2 .. 3);
|
type hexstring GsmMnc length(2 .. 3);
|
||||||
type uint16_t GsmLac;
|
type uint16_t GsmLac;
|
||||||
type uint16_t GsmCellId;
|
type uint16_t GsmCellId;
|
||||||
|
|
||||||
type enumerated GprsCodingScheme {
|
type enumerated GprsCodingScheme {
|
||||||
CS1, CS2, CS3, CS4
|
CS1, CS2, CS3, CS4
|
||||||
};
|
};
|
||||||
|
|
||||||
function f_gprs_blocksize(GprsCodingScheme cs) return integer {
|
function f_gprs_blocksize(GprsCodingScheme cs) return integer {
|
||||||
select (cs) {
|
select (cs) {
|
||||||
case (CS1) { return 22 }
|
case (CS1) { return 22 }
|
||||||
case (CS2) { return 32 }
|
case (CS2) { return 32 }
|
||||||
case (CS3) { return 38 }
|
case (CS3) { return 38 }
|
||||||
case (CS3) { return 52 }
|
case (CS3) { return 52 }
|
||||||
case else {
|
case else {
|
||||||
setverdict(fail, "Invalid GPRS CS ", cs);
|
setverdict(fail, "Invalid GPRS CS ", cs);
|
||||||
mtc.stop;
|
mtc.stop;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 10.5.2.8 */
|
/* 10.5.2.8 */
|
||||||
type enumerated ChannelNeeded {
|
type enumerated ChannelNeeded {
|
||||||
CHAN_NEED_ANY (0),
|
CHAN_NEED_ANY (0),
|
||||||
CHAN_NEED_SDCCH (1),
|
CHAN_NEED_SDCCH (1),
|
||||||
CHAN_NEED_TCH_F (2),
|
CHAN_NEED_TCH_F (2),
|
||||||
CHAN_NEED_TCH_H (3)
|
CHAN_NEED_TCH_H (3)
|
||||||
} with { variant "FIELDLENGTH(2)" };
|
} with { variant "FIELDLENGTH(2)" };
|
||||||
type record ChannelNeeded12 {
|
type record ChannelNeeded12 {
|
||||||
ChannelNeeded second,
|
ChannelNeeded second,
|
||||||
ChannelNeeded first
|
ChannelNeeded first
|
||||||
} with { variant "" };
|
} with { variant "" };
|
||||||
|
|
||||||
|
|
||||||
/* TS 48.058 9.3.1 Channel Number IE */
|
/* TS 48.058 9.3.1 Channel Number IE */
|
||||||
type enumerated RslChanNr0 {
|
type enumerated RslChanNr0 {
|
||||||
RSL_CHAN_NR_INVALID ('00000'B),
|
RSL_CHAN_NR_INVALID ('00000'B),
|
||||||
RSL_CHAN_NR_Bm_ACCH ('00001'B),
|
RSL_CHAN_NR_Bm_ACCH ('00001'B),
|
||||||
RSL_CHAN_NR_BCCH ('10000'B),
|
RSL_CHAN_NR_BCCH ('10000'B),
|
||||||
RSL_CHAN_NR_RACH ('10001'B),
|
RSL_CHAN_NR_RACH ('10001'B),
|
||||||
RSL_CHAN_NR_PCH_AGCH ('10010'B),
|
RSL_CHAN_NR_PCH_AGCH ('10010'B),
|
||||||
RSL_CHAN_NR_OSMO_PDCH ('11000'B),
|
RSL_CHAN_NR_OSMO_PDCH ('11000'B),
|
||||||
RSL_CHAN_NR_OSMO_CBCH4 ('11001'B),
|
RSL_CHAN_NR_OSMO_CBCH4 ('11001'B),
|
||||||
RSL_CHAN_NR_OSMO_CBCH8 ('11010'B)
|
RSL_CHAN_NR_OSMO_CBCH8 ('11010'B)
|
||||||
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
||||||
|
|
||||||
type record RslChanNr2 {
|
type record RslChanNr2 {
|
||||||
BIT4 tag ('0001'B),
|
BIT4 tag ('0001'B),
|
||||||
uint1_t sub_chan
|
uint1_t sub_chan
|
||||||
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
||||||
|
|
||||||
type record RslChanNr4 {
|
type record RslChanNr4 {
|
||||||
BIT3 tag ('001'B),
|
BIT3 tag ('001'B),
|
||||||
uint2_t sub_chan
|
uint2_t sub_chan
|
||||||
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
||||||
|
|
||||||
type record RslChanNr8 {
|
type record RslChanNr8 {
|
||||||
BIT2 tag ('01'B),
|
BIT2 tag ('01'B),
|
||||||
uint3_t sub_chan
|
uint3_t sub_chan
|
||||||
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
} with { variant "FIELDLENGTH(5)" variant "FIELDORDER(msb)" };
|
||||||
|
|
||||||
type union RslChanNrU {
|
type union RslChanNrU {
|
||||||
RslChanNr0 ch0,
|
RslChanNr0 ch0,
|
||||||
RslChanNr2 lm,
|
RslChanNr2 lm,
|
||||||
RslChanNr4 sdcch4,
|
RslChanNr4 sdcch4,
|
||||||
RslChanNr8 sdcch8
|
RslChanNr8 sdcch8
|
||||||
} with {
|
} with {
|
||||||
variant "TAG(lm, tag = '0001'B;
|
variant "TAG(lm, tag = '0001'B;
|
||||||
sdcch4, tag = '001'B;
|
sdcch4, tag = '001'B;
|
||||||
sdcch8, tag = '01'B;
|
sdcch8, tag = '01'B;
|
||||||
ch0, OTHERWISE)"
|
ch0, OTHERWISE)"
|
||||||
variant "FIELDLENGTH(5)"
|
variant "FIELDLENGTH(5)"
|
||||||
variant "FIELDORDER(msb)"
|
variant "FIELDORDER(msb)"
|
||||||
};
|
};
|
||||||
|
|
||||||
type record RslChannelNr {
|
type record RslChannelNr {
|
||||||
RslChanNrU u,
|
RslChanNrU u,
|
||||||
uint3_t tn
|
uint3_t tn
|
||||||
} with { variant "FIELDLENGTH(8)" variant "FIELDORDER(msb)" };
|
} with { variant "FIELDLENGTH(8)" variant "FIELDORDER(msb)" };
|
||||||
|
|
||||||
template RslChannelNr t_RslChanNr0(template uint3_t tn, template RslChanNr0 cht) := {
|
template RslChannelNr t_RslChanNr0(template uint3_t tn, template RslChanNr0 cht) := {
|
||||||
u := { ch0 := cht },
|
u := { ch0 := cht },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
|
|
||||||
template RslChannelNr t_RslChanNr_RACH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_RACH);
|
template RslChannelNr t_RslChanNr_RACH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_RACH);
|
||||||
template RslChannelNr t_RslChanNr_BCCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_BCCH);
|
template RslChannelNr t_RslChanNr_BCCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_BCCH);
|
||||||
template RslChannelNr t_RslChanNr_PCH_AGCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH);
|
template RslChannelNr t_RslChanNr_PCH_AGCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH);
|
||||||
template RslChannelNr t_RslChanNr_Bm(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH);
|
template RslChannelNr t_RslChanNr_Bm(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH);
|
||||||
template RslChannelNr t_RslChanNr_PDCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_PDCH);
|
template RslChannelNr t_RslChanNr_PDCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_PDCH);
|
||||||
template RslChannelNr t_RslChanNr_CBCH4(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH4);
|
template RslChannelNr t_RslChanNr_CBCH4(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH4);
|
||||||
template RslChannelNr t_RslChanNr_CBCH8(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH8);
|
template RslChannelNr t_RslChanNr_CBCH8(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH8);
|
||||||
template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, template uint1_t sub_slot) := {
|
template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, template uint1_t sub_slot) := {
|
||||||
u := { lm := { tag := '0001'B, sub_chan := sub_slot } },
|
u := { lm := { tag := '0001'B, sub_chan := sub_slot } },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
template RslChannelNr t_RslChanNr_SDCCH4(template uint3_t tn, template uint2_t sub_slot) := {
|
template RslChannelNr t_RslChanNr_SDCCH4(template uint3_t tn, template uint2_t sub_slot) := {
|
||||||
u := { sdcch4 := { tag := '001'B, sub_chan := sub_slot } },
|
u := { sdcch4 := { tag := '001'B, sub_chan := sub_slot } },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
template RslChannelNr t_RslChanNr_SDCCH8(template uint3_t tn, template uint3_t sub_slot) := {
|
template RslChannelNr t_RslChanNr_SDCCH8(template uint3_t tn, template uint3_t sub_slot) := {
|
||||||
u := { sdcch8 := { tag := '01'B, sub_chan := sub_slot } },
|
u := { sdcch8 := { tag := '01'B, sub_chan := sub_slot } },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
|
|
||||||
template (value) RslChannelNr ts_RslChanNr0(uint3_t tn, RslChanNr0 cht) := {
|
template (value) RslChannelNr ts_RslChanNr0(uint3_t tn, RslChanNr0 cht) := {
|
||||||
u := { ch0 := cht },
|
u := { ch0 := cht },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
template (value) RslChannelNr ts_RslChanNr_RACH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_RACH);
|
template (value) RslChannelNr ts_RslChanNr_RACH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_RACH);
|
||||||
template (value) RslChannelNr ts_RslChanNr_BCCH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_BCCH);
|
template (value) RslChannelNr ts_RslChanNr_BCCH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_BCCH);
|
||||||
template (value) RslChannelNr ts_RslChanNr_PCH_AGCH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH);
|
template (value) RslChannelNr ts_RslChanNr_PCH_AGCH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH);
|
||||||
template (value) RslChannelNr ts_RslChanNr_Bm(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH);
|
template (value) RslChannelNr ts_RslChanNr_Bm(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH);
|
||||||
template (value) RslChannelNr ts_RslChanNr_PDCH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_OSMO_PDCH);
|
template (value) RslChannelNr ts_RslChanNr_PDCH(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_OSMO_PDCH);
|
||||||
template (value) RslChannelNr ts_RslChanNr_CBCH4(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH4);
|
template (value) RslChannelNr ts_RslChanNr_CBCH4(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH4);
|
||||||
template (value) RslChannelNr ts_RslChanNr_CBCH8(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH8);
|
template (value) RslChannelNr ts_RslChanNr_CBCH8(uint3_t tn) := ts_RslChanNr0(tn, RSL_CHAN_NR_OSMO_CBCH8);
|
||||||
template (value) RslChannelNr ts_RslChanNr_Lm(uint3_t tn, uint1_t sub_slot) := {
|
template (value) RslChannelNr ts_RslChanNr_Lm(uint3_t tn, uint1_t sub_slot) := {
|
||||||
u := { lm := { tag := '0001'B, sub_chan := sub_slot } },
|
u := { lm := { tag := '0001'B, sub_chan := sub_slot } },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
template (value) RslChannelNr ts_RslChanNr_SDCCH4(uint3_t tn, uint2_t sub_slot) := {
|
template (value) RslChannelNr ts_RslChanNr_SDCCH4(uint3_t tn, uint2_t sub_slot) := {
|
||||||
u := { sdcch4 := { tag := '001'B, sub_chan := sub_slot } },
|
u := { sdcch4 := { tag := '001'B, sub_chan := sub_slot } },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
template (value) RslChannelNr ts_RslChanNr_SDCCH8(uint3_t tn, uint3_t sub_slot) := {
|
template (value) RslChannelNr ts_RslChanNr_SDCCH8(uint3_t tn, uint3_t sub_slot) := {
|
||||||
u := { sdcch8 := { tag := '01'B, sub_chan := sub_slot } },
|
u := { sdcch8 := { tag := '01'B, sub_chan := sub_slot } },
|
||||||
tn := tn
|
tn := tn
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TS 48.058 9.3.2 Link ID */
|
/* TS 48.058 9.3.2 Link ID */
|
||||||
type enumerated RslLinkIdC {
|
type enumerated RslLinkIdC {
|
||||||
FACCH_SDCCH (0),
|
FACCH_SDCCH (0),
|
||||||
SACCH (1),
|
SACCH (1),
|
||||||
OSMO_PTCCH (2) /* Osmocom (trxcon) specific extension */
|
OSMO_PTCCH (2) /* Osmocom (trxcon) specific extension */
|
||||||
} with { variant "FIELDLENGTH(2)" };
|
} with { variant "FIELDLENGTH(2)" };
|
||||||
|
|
||||||
type enumerated RslSapi0Prio {
|
type enumerated RslSapi0Prio {
|
||||||
SAPI0_PRIO_NORMAL (0),
|
SAPI0_PRIO_NORMAL (0),
|
||||||
SAPI0_PRIO_HIGH (1),
|
SAPI0_PRIO_HIGH (1),
|
||||||
SAPI0_PRIO_LOW (2)
|
SAPI0_PRIO_LOW (2)
|
||||||
} with { variant "FIELDLENGTH(2)" };
|
} with { variant "FIELDLENGTH(2)" };
|
||||||
|
|
||||||
type uint3_t GsmSapi;
|
type uint3_t GsmSapi;
|
||||||
|
|
||||||
type record RslLinkId {
|
type record RslLinkId {
|
||||||
RslLinkIdC c,
|
RslLinkIdC c,
|
||||||
boolean na,
|
boolean na,
|
||||||
RslSapi0Prio prio,
|
RslSapi0Prio prio,
|
||||||
GsmSapi sapi
|
GsmSapi sapi
|
||||||
} with { variant "" };
|
} with { variant "" };
|
||||||
|
|
||||||
template RslLinkId tr_RslLinkId := {
|
template RslLinkId tr_RslLinkId := {
|
||||||
c := ?,
|
c := ?,
|
||||||
na := ?,
|
na := ?,
|
||||||
prio := ?,
|
prio := ?,
|
||||||
sapi := ?
|
sapi := ?
|
||||||
};
|
};
|
||||||
|
|
||||||
template RslLinkId tr_RslLinkID_DCCH(template GsmSapi sapi) modifies tr_RslLinkId := {
|
template RslLinkId tr_RslLinkID_DCCH(template GsmSapi sapi) modifies tr_RslLinkId := {
|
||||||
c := FACCH_SDCCH,
|
c := FACCH_SDCCH,
|
||||||
na := false,
|
na := false,
|
||||||
sapi := sapi
|
sapi := sapi
|
||||||
};
|
};
|
||||||
|
|
||||||
template RslLinkId tr_RslLinkID_SACCH(template GsmSapi sapi) modifies tr_RslLinkId := {
|
template RslLinkId tr_RslLinkID_SACCH(template GsmSapi sapi) modifies tr_RslLinkId := {
|
||||||
c := SACCH,
|
c := SACCH,
|
||||||
na := false,
|
na := false,
|
||||||
sapi := sapi
|
sapi := sapi
|
||||||
};
|
};
|
||||||
|
|
||||||
template RslLinkId tr_RslLinkID_OSMO_PTCCH(template GsmSapi sapi) modifies tr_RslLinkId := {
|
template RslLinkId tr_RslLinkID_OSMO_PTCCH(template GsmSapi sapi) modifies tr_RslLinkId := {
|
||||||
c := OSMO_PTCCH,
|
c := OSMO_PTCCH,
|
||||||
na := false,
|
na := false,
|
||||||
sapi := sapi
|
sapi := sapi
|
||||||
};
|
};
|
||||||
|
|
||||||
template (value) RslLinkId ts_RslLinkID_DCCH(GsmSapi sapi) := {
|
template (value) RslLinkId ts_RslLinkID_DCCH(GsmSapi sapi) := {
|
||||||
c := FACCH_SDCCH,
|
c := FACCH_SDCCH,
|
||||||
na := false,
|
na := false,
|
||||||
prio := SAPI0_PRIO_NORMAL,
|
prio := SAPI0_PRIO_NORMAL,
|
||||||
sapi := sapi
|
sapi := sapi
|
||||||
};
|
};
|
||||||
|
|
||||||
template (value) RslLinkId ts_RslLinkID_SACCH(GsmSapi sapi) := {
|
template (value) RslLinkId ts_RslLinkID_SACCH(GsmSapi sapi) := {
|
||||||
c := SACCH,
|
c := SACCH,
|
||||||
na := false,
|
na := false,
|
||||||
prio := SAPI0_PRIO_NORMAL,
|
prio := SAPI0_PRIO_NORMAL,
|
||||||
sapi := sapi
|
sapi := sapi
|
||||||
};
|
};
|
||||||
|
|
||||||
template (value) RslLinkId ts_RslLinkID_OSMO_PTCCH(GsmSapi sapi) := {
|
template (value) RslLinkId ts_RslLinkID_OSMO_PTCCH(GsmSapi sapi) := {
|
||||||
c := OSMO_PTCCH,
|
c := OSMO_PTCCH,
|
||||||
na := false,
|
na := false,
|
||||||
prio := SAPI0_PRIO_NORMAL,
|
prio := SAPI0_PRIO_NORMAL,
|
||||||
sapi := sapi
|
sapi := sapi
|
||||||
};
|
};
|
||||||
|
|
||||||
function f_hex_is_odd_length(hexstring digits) return bitstring {
|
function f_hex_is_odd_length(hexstring digits) return bitstring {
|
||||||
if (lengthof(digits) rem 2 == 1) {
|
if (lengthof(digits) rem 2 == 1) {
|
||||||
return '1'B;
|
return '1'B;
|
||||||
} else {
|
} else {
|
||||||
return '0'B;
|
return '0'B;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* TS 04.12 Section 3.3.1 Block type */
|
/* TS 04.12 Section 3.3.1 Block type */
|
||||||
|
|
Loading…
Reference in New Issue