diff options
Diffstat (limited to 'library/L1CTL_Types.ttcn')
-rw-r--r-- | library/L1CTL_Types.ttcn | 783 |
1 files changed, 503 insertions, 280 deletions
diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index 03ec23f4..b977a7dd 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -16,8 +16,6 @@ module L1CTL_Types { import from GSM_RR_Types all; import from Osmocom_Types all; - type uint32_t uint32_le with { variant "BYTEORDER(first)" }; - type enumerated L1ctlMsgType { L1CTL_NONE, L1CTL_FBSB_REQ, @@ -51,12 +49,13 @@ module L1CTL_Types { L1CTL_TRAFFIC_CONF, L1CTL_TRAFFIC_IND, L1CTL_BURST_IND, - L1CTL_TBF_CFG_REQ, - L1CTL_TBF_CFG_CONF, - L1CTL_DATA_TBF_REQ, - L1CTL_DATA_TBF_CONF, + L1CTL_GPRS_UL_TBF_CFG_REQ, + L1CTL_GPRS_DL_TBF_CFG_REQ, + L1CTL_GPRS_UL_BLOCK_REQ, + L1CTL_GPRS_DL_BLOCK_IND, L1CTL_EXT_RACH_REQ, - L1CTL_DATA_ABS_REQ /*!< FIXME: no such message in OsmocomBB */ + L1CTL_GPRS_RTS_IND, + L1CTL_GPRS_UL_BLOCK_CNF } with { variant "FIELDLENGTH(8)" }; type enumerated L1ctlCcchMode { @@ -72,22 +71,6 @@ module L1CTL_Types { NEIGH_MODE_SB } with { variant "FIELDLENGTH(8)" }; - type enumerated L1ctlGprsCs { - L1CTL_CS1 (1), - L1CTL_CS2, - L1CTL_CS3, - L1CTL_CS4, - L1CTL_MCS1, - L1CTL_MCS2, - L1CTL_MCS3, - L1CTL_MCS4, - L1CTL_MCS5, - L1CTL_MCS6, - L1CTL_MCS7, - L1CTL_MCS8, - L1CTL_MCS9 - } with { variant "FIELDLENGTH(8)" }; - type enumerated L1ctlResetType { L1CTL_RES_T_BOOT (0), L1CTL_RES_T_FULL, @@ -105,13 +88,15 @@ module L1CTL_Types { OCT2 padding } with { variant "" }; - template L1ctlHeader tr_L1ctlHeader(template L1ctlMsgType msg_type) := { + template L1ctlHeader + tr_L1ctlHeader(template (present) L1ctlMsgType msg_type) := { msg_type := msg_type, flags := ?, padding := ? }; - template (value) L1ctlHeader ts_L1ctlHeader(L1ctlMsgType msg_type) := { + template (value) L1ctlHeader + ts_L1ctlHeader(template (value) L1ctlMsgType msg_type) := { msg_type := msg_type, flags := { padding := '0000000'B, f_done := false }, padding := '0000'O @@ -120,7 +105,7 @@ module L1CTL_Types { type record L1ctlDlInfo { RslChannelNr chan_nr, RslLinkId link_id, - Arfcn arfcn, + GsmBandArfcn arfcn, uint32_t frame_nr, GsmRxLev rx_level, uint8_t snr, @@ -144,8 +129,11 @@ module L1CTL_Types { L1CTL_CHAN_MODE_SIGN ('00000000'B), /* Signalling */ L1CTL_CHAN_MODE_SPEECH_V1 ('00000001'B), /* FR or HR codec */ L1CTL_CHAN_MODE_SPEECH_V2 ('00100001'B), /* EFR codec */ - L1CTL_CHAN_MODE_SPEECH_V3 ('01000001'B) /* AMR codec */ - /* Other modes are not supported for now */ + L1CTL_CHAN_MODE_SPEECH_V3 ('01000001'B), /* AMR codec */ + L1CTL_CHAN_MODE_DATA_14k5 ('00001111'B), /* CSD: TCH/F14.4 */ + L1CTL_CHAN_MODE_DATA_12k0 ('00000011'B), /* CSD: TCH/F9.6 */ + L1CTL_CHAN_MODE_DATA_6k0 ('00001011'B), /* CSD: TCH/{FH}4.8 */ + L1CTL_CHAN_MODE_DATA_3k6 ('00010011'B) /* CSD: TCH/{FH}2.4 */ } with { variant "FIELDLENGTH(8)" }; type enumerated L1ctlLoopMode { @@ -179,7 +167,10 @@ module L1CTL_Types { type record L1ctlTchModeConf { L1ctlTchMode tch_mode, L1ctlAudioMode audio_mode, - OCT2 padding + record { + uint8_t start_codec, + BIT8 codecs_bitmask + } amr } with { variant "" }; type record L1ctlDataInd { @@ -188,42 +179,6 @@ module L1CTL_Types { variant (payload) "BYTEORDER(first)" }; - type union L1ctlDlPayload { - L1ctlFbsbConf fbsb_conf, - L1ctlCcchModeConf ccch_mode_conf, - L1ctlTchModeConf tch_mode_conf, - L1ctlDataInd data_ind, - L1ctlTrafficReq traffic_ind, - L1ctlTbfCfgReq tbf_cfg_conf, - octetstring other - } with { - variant (other) "BYTEORDER(first)" - }; - - type record L1ctlDlMessage { - L1ctlHeader header, - L1ctlDlInfo dl_info optional, - L1ctlDlPayload payload optional - } with { variant (dl_info) "PRESENCE(header.msg_type = L1CTL_FBSB_CONF, - header.msg_type = L1CTL_RACH_CONF, - header.msg_type = L1CTL_DATA_IND, - header.msg_type = L1CTL_DATA_CONF, - header.msg_type = L1CTL_TRAFFIC_IND, - header.msg_type = L1CTL_TRAFFIC_CONF)" - variant (payload) "CROSSTAG(fbsb_conf, header.msg_type = L1CTL_FBSB_CONF; - ccch_mode_conf, header.msg_type = L1CTL_CCCH_MODE_CONF; - tch_mode_conf, header.msg_type = L1CTL_TCH_MODE_CONF; - data_ind, header.msg_type = L1CTL_DATA_IND; - traffic_ind, header.msg_type = L1CTL_TRAFFIC_IND; - tbf_cfg_conf, header.msg_type = L1CTL_TBF_CFG_CONF; - other, OTHERWISE; - )" }; - - external function enc_L1ctlDlMessage(in L1ctlDlMessage msg) return octetstring - with { extension "prototype(convert) encode(RAW)" }; - external function dec_L1ctlDlMessage(in octetstring stream) return L1ctlDlMessage - with { extension "prototype(convert) decode(RAW)" }; - type record L1ctlUlInfo { RslChannelNr chan_nr, @@ -231,22 +186,6 @@ module L1CTL_Types { OCT2 padding } with { variant "" }; - type record L1ctlUlTbfInfo { - uint8_t tbf_nr, - L1ctlGprsCs cs, - OCT2 padding - } with { variant "" }; - - type record L1ctlUlAbsInfo { - uint8_t tbf_nr, - L1ctlGprsCs cs, - uint8_t ts_nr, - OCT1 padding, - uint32_le fn, - Arfcn arfcn, - OCT2 padding2 - } with { variant "" }; - type record L1ctlFbsbFlags { BIT5 padding, boolean sb, @@ -262,7 +201,7 @@ module L1CTL_Types { }; type record L1ctlFbsbReq { - Arfcn arfcn, + GsmBandArfcn arfcn, uint16_t timeout_tdma_frames, uint16_t freq_err_thresh1, uint16_t freq_err_thresh2, @@ -282,7 +221,10 @@ module L1CTL_Types { L1ctlTchMode tch_mode, L1ctlAudioMode audio_mode, L1ctlLoopMode loop_mode, - OCT1 padding + record { + uint8_t start_codec, + BIT8 codecs_bitmask + } amr } with { variant "" }; type record L1ctlRachReq { @@ -317,11 +259,11 @@ module L1CTL_Types { type record L1ctlH0 { uint8_t h, - Arfcn arfcn, + GsmBandArfcn arfcn, octetstring padding length(130) } with { variant "" }; - type record length(0..64) of Arfcn L1ctlMA; + type record length(0..64) of GsmBandArfcn L1ctlMA; type record L1ctlH1 { uint8_t h, uint8_t hsn, @@ -370,40 +312,106 @@ module L1CTL_Types { variant (data) "BYTEORDER(first)" } - type record length(8) of uint8_t TfiUsfArr; - type record L1ctlTbfCfgReq { - uint8_t tbf_nr, - boolean is_uplink, - OCT2 padding, - TfiUsfArr tfi_usf - } with { variant (is_uplink) "FIELDLENGTH(8)" }; + /* payload of L1CTL_GPRS_UL_TBF_CFG_REQ */ + type record L1ctlGprsUlTbfCfgReq { + uint8_t tbf_ref, + BIT8 slotmask, + OCT2 pad ('0000'O), + uint32_t start_fn /* TBF Starting Time (absolute Fn) */ + } with { variant (slotmask) "BITORDER(msb)" }; + + /* payload of L1CTL_GPRS_DL_TBF_CFG_REQ */ + type record L1ctlGprsDlTbfCfgReq { + uint8_t tbf_ref, + BIT8 slotmask, + uint8_t dl_tfi, + OCT1 pad ('00'O), + uint32_t start_fn /* TBF Starting Time (absolute Fn) */ + } with { variant (slotmask) "BITORDER(msb)" }; + + /* part of L1CTL_GPRS_{UL,DL}_BLOCK_{REQ,IND} */ + type record L1ctlGprsBlockHdr { + uint32_t fn, + uint8_t tn, + OCT3 pad ('000000'O) + } with { variant "" }; + + /* payload of L1CTL_GPRS_UL_BLOCK_REQ */ + type record L1ctlGprsUlBlockReq { + L1ctlGprsBlockHdr hdr, + octetstring data + } with { variant (data) "BYTEORDER(first)" }; + + /* payload of L1CTL_GPRS_UL_BLOCK_CNF */ + type record L1ctlGprsUlBlockCnf { + uint32_t fn, + uint8_t tn, + octetstring data + } with { variant "" }; + + /* payload of L1CTL_GPRS_DL_BLOCK_IND */ + type record L1ctlGprsDlBlockInd { + L1ctlGprsBlockHdr hdr, + record { + uint16_t ber10k, /* Bit Error Rate */ + int16_t ci_cb, /* C/I in centiBels */ + uint8_t rx_level /* RxLev 0..63 */ + } meas, + uint8_t usf, + octetstring data + } with { variant (data) "BYTEORDER(first)" }; + + /* payload of L1CTL_GPRS_RTS_IND */ + type record L1ctlGprsRtsInd { + uint32_t fn, + uint8_t tn, + uint8_t usf + } with { variant "" }; - type union L1ctlUlPayload { + + type union L1ctlMsgPayload { L1ctlFbsbReq fbsb_req, - L1ctlCcchModeReq ccch_mode_req, - L1ctlTchModeReq tch_mode_req, + L1ctlFbsbConf fbsb_conf, + L1ctlDataInd data_ind, L1ctlRachReq rach_req, - L1ctlExtRachReq ext_rach_req, - L1ctlParReq par_req, L1ctlDmEstReq dm_est_req, + L1ctlDataReq data_req, + /* TODO: L1CTL_RESET_IND */ + /* TODO: L1CTL_PM_REQ */ + /* TODO: L1CTL_PM_CONF */ L1ctlReset reset_req, - //L1ctlNeighPmReq neigh_pm_req, + L1ctlCcchModeReq ccch_mode_req, + L1ctlCcchModeConf ccch_mode_conf, + L1ctlParReq par_req, + /* TODO: L1CTL_DM_FREQ_REQ */ L1CtlCryptoReq crypto_req, + /* TODO: L1CTL_SIM_REQ */ + /* TODO: L1CTL_SIM_CONF */ + L1ctlTchModeReq tch_mode_req, + L1ctlTchModeConf tch_mode_conf, + /* TODO: L1CTL_NEIGH_PM_REQ */ + /* TODO: L1CTL_NEIGH_PM_IND */ L1ctlTrafficReq traffic_req, - L1ctlTbfCfgReq tbf_cfg_req, - L1ctlDataReq data_req, + L1ctlTrafficReq traffic_ind, + /* TODO: L1CTL_BURST_IND */ + L1ctlGprsUlTbfCfgReq ul_tbf_cfg_req, + L1ctlGprsDlTbfCfgReq dl_tbf_cfg_req, + L1ctlGprsUlBlockReq ul_block_req, + L1ctlGprsUlBlockCnf ul_block_cnf, + L1ctlGprsDlBlockInd dl_block_ind, + L1ctlExtRachReq ext_rach_req, + L1ctlGprsRtsInd rts_ind, octetstring other } with { variant (other) "BYTEORDER(first)" }; - type record L1ctlUlMessage { + type record L1ctlMessage { L1ctlHeader header, L1ctlUlInfo ul_info optional, - L1ctlUlTbfInfo ul_info_tbf optional, - L1ctlUlAbsInfo ul_info_abs optional, - L1ctlUlPayload payload + L1ctlDlInfo dl_info optional, + L1ctlMsgPayload payload optional } with { variant (ul_info) "PRESENCE(header.msg_type = L1CTL_RACH_REQ, header.msg_type = L1CTL_EXT_RACH_REQ, header.msg_type = L1CTL_PARAM_REQ, @@ -413,57 +421,69 @@ module L1CTL_Types { header.msg_type = L1CTL_DM_FREQ_REQ, header.msg_type = L1CTL_DM_REL_REQ, header.msg_type = L1CTL_TRAFFIC_REQ)" - variant (ul_info_tbf) "PRESENCE(header.msg_type = L1CTL_DATA_TBF_REQ)" - variant (ul_info_abs) "PRESENCE(header.msg_type = L1CTL_DATA_ABS_REQ)" + variant (dl_info) "PRESENCE(header.msg_type = L1CTL_FBSB_CONF, + header.msg_type = L1CTL_RACH_CONF, + header.msg_type = L1CTL_DATA_IND, + header.msg_type = L1CTL_DATA_CONF, + header.msg_type = L1CTL_TRAFFIC_IND, + header.msg_type = L1CTL_TRAFFIC_CONF)" variant (payload) "CROSSTAG(fbsb_req, header.msg_type = L1CTL_FBSB_REQ; - ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ; - tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ; + fbsb_conf, header.msg_type = L1CTL_FBSB_CONF; + data_ind, header.msg_type = L1CTL_DATA_IND; rach_req, header.msg_type = L1CTL_RACH_REQ; - ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ; - par_req, header.msg_type = L1CTL_PARAM_REQ; dm_est_req, header.msg_type = L1CTL_DM_EST_REQ; + data_req, header.msg_type = L1CTL_DATA_REQ; + /* TODO: reset_ind, header.msg_type = L1CTL_RESET_IND */ + /* TODO: pm_req, header.msg_type = L1CTL_PM_REQ */ + /* TODO: pm_conf, header.msg_type = L1CTL_PM_CONF */ reset_req, header.msg_type = L1CTL_RESET_REQ; + ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ; + ccch_mode_conf, header.msg_type = L1CTL_CCCH_MODE_CONF; + par_req, header.msg_type = L1CTL_PARAM_REQ; + /* TODO: freq_req, header.msg_type = L1CTL_DM_FREQ_REQ */ crypto_req, header.msg_type = L1CTL_CRYPTO_REQ; + /* TODO: sim_req, header.msg_type = L1CTL_SIM_REQ */ + /* TODO: sim_conf, header.msg_type = L1CTL_SIM_CONF */ + tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ; + tch_mode_conf, header.msg_type = L1CTL_TCH_MODE_CONF; + /* TODO: neigh_pm_req, header.msg_type = L1CTL_NEIGH_PM_REQ */ + /* TODO: neigh_pm_ind, header.msg_type = L1CTL_NEIGH_PM_IND */ traffic_req, header.msg_type = L1CTL_TRAFFIC_REQ; - tbf_cfg_req, header.msg_type = L1CTL_TBF_CFG_REQ; - data_req, header.msg_type = L1CTL_DATA_REQ; + traffic_ind, header.msg_type = L1CTL_TRAFFIC_IND; + /* TODO: burst_ind, header.msg_type = L1CTL_BURST_IND */ + ul_tbf_cfg_req, header.msg_type = L1CTL_GPRS_UL_TBF_CFG_REQ; + dl_tbf_cfg_req, header.msg_type = L1CTL_GPRS_DL_TBF_CFG_REQ; + ul_block_req, header.msg_type = L1CTL_GPRS_UL_BLOCK_REQ; + ul_block_cnf, header.msg_type = L1CTL_GPRS_UL_BLOCK_CNF; + dl_block_ind, header.msg_type = L1CTL_GPRS_DL_BLOCK_IND; + ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ; + rts_ind, header.msg_type = L1CTL_GPRS_RTS_IND; other, OTHERWISE; )" }; - external function enc_L1ctlUlMessage(in L1ctlUlMessage msg) return octetstring + external function enc_L1ctlMessage(in L1ctlMessage msg) return octetstring with { extension "prototype(convert) encode(RAW)" }; - external function dec_L1ctlUlMessage(in octetstring stream) return L1ctlUlMessage + external function dec_L1ctlMessage(in octetstring stream) return L1ctlMessage with { extension "prototype(convert) decode(RAW)" }; - type record L1ctlUlMessageLV { + type record L1ctlMessageLV { uint16_t len, - L1ctlUlMessage msg + L1ctlMessage msg } with { variant (len) "LENGTHTO(msg)" }; - external function enc_L1ctlUlMessageLV(in L1ctlUlMessageLV msg) return octetstring + external function enc_L1ctlMessageLV(in L1ctlMessageLV msg) return octetstring with { extension "prototype(convert) encode(RAW)" }; - external function dec_L1ctlUlMessageLV(in octetstring stream) return L1ctlUlMessageLV + external function dec_L1ctlMessageLV(in octetstring stream) return L1ctlMessageLV with { extension "prototype(convert) decode(RAW)" }; - type record L1ctlDlMessageLV { - uint16_t len, - L1ctlDlMessage msg - } with { variant (len) "LENGTHTO(msg)" }; - - external function enc_L1ctlDlMessageLV(in L1ctlDlMessageLV msg) return octetstring - with { extension "prototype(convert) encode(RAW)" }; - external function dec_L1ctlDlMessageLV(in octetstring stream) return L1ctlDlMessageLV - with { extension "prototype(convert) decode(RAW)" }; - - /* for generating RESET_REQ */ - template (value) L1ctlUlMessage t_L1ctlResetReq(L1ctlResetType rst_type) := { + template (value) L1ctlMessage + t_L1ctlResetReq(template (value) L1ctlResetType rst_type) := { header := ts_L1ctlHeader(L1CTL_RESET_REQ), ul_info := omit, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { reset_req := { reset_type := rst_type, @@ -473,14 +493,15 @@ module L1CTL_Types { }; /* for generating FBSB_REQ */ - template (value) L1ctlUlMessage ts_L1CTL_FBSB_REQ(Arfcn arfcn, L1ctlFbsbFlags flags, - uint8_t sync_info_idx, - L1ctlCcchMode ccch_mode, - GsmRxLev rxlev_exp) := { + template (value) L1ctlMessage + ts_L1CTL_FBSB_REQ(template (value) GsmBandArfcn arfcn, + template (value) L1ctlFbsbFlags flags, + template (value) uint8_t sync_info_idx, + template (value) L1ctlCcchMode ccch_mode, + template (value) GsmRxLev rxlev_exp) := { header := ts_L1ctlHeader(L1CTL_FBSB_REQ), ul_info := omit, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { fbsb_req := { arfcn := arfcn, @@ -497,8 +518,10 @@ module L1CTL_Types { }; /* for matching against incoming FBSB_CONF */ - template L1ctlDlMessage tr_L1CTL_FBSB_CONF(template uint8_t result) := { + template L1ctlMessage + tr_L1CTL_FBSB_CONF(template (present) uint8_t result) := { header := tr_L1ctlHeader(L1CTL_FBSB_CONF), + ul_info := omit, dl_info := ?, payload := { fbsb_conf := { @@ -509,11 +532,11 @@ module L1CTL_Types { } }; - template (value) L1ctlUlMessage ts_L1CTL_CCCH_MODE_REQ(L1ctlCcchMode ccch_mode) := { + template (value) L1ctlMessage + ts_L1CTL_CCCH_MODE_REQ(template (value) L1ctlCcchMode ccch_mode) := { header := ts_L1ctlHeader(L1CTL_CCCH_MODE_REQ), ul_info := omit, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { ccch_mode_req := { ccch_mode := ccch_mode, @@ -522,44 +545,52 @@ module L1CTL_Types { } }; - template (value) L1ctlUlMessage + template (value) L1ctlMessage ts_L1CTL_TCH_MODE_REQ(template (value) L1ctlTchMode tch_mode := L1CTL_CHAN_MODE_SIGN, template (value) L1ctlAudioMode audio_mode := t_L1CTL_AudioModeFwd, - template (value) L1ctlLoopMode loop_mode := L1CTL_LOOP_MODE_OPEN) := { + template (value) L1ctlLoopMode loop_mode := L1CTL_LOOP_MODE_OPEN, + template (value) uint8_t amr_start_codec := 0, + template (value) BIT8 amr_codecs_bitmask := '00000000'B) := { header := ts_L1ctlHeader(L1CTL_TCH_MODE_REQ), ul_info := omit, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { tch_mode_req := { tch_mode := tch_mode, audio_mode := audio_mode, loop_mode := loop_mode, - padding := '00'O + amr := { + start_codec := amr_start_codec, + codecs_bitmask := amr_codecs_bitmask + } } } }; - template L1ctlDlMessage tr_L1CTL_MsgType(template L1ctlMsgType msg_type) := { + template L1ctlMessage + tr_L1CTL_MsgType(template (present) L1ctlMsgType msg_type) := { header := tr_L1ctlHeader(msg_type), + ul_info := *, dl_info := *, payload := * } - template L1ctlDlMessage tr_L1CTL_CCCH_MODE_CONF := tr_L1CTL_MsgType(L1CTL_CCCH_MODE_CONF); + template L1ctlMessage tr_L1CTL_CCCH_MODE_CONF := tr_L1CTL_MsgType(L1CTL_CCCH_MODE_CONF); - template L1ctlUlMessage ts_L1CTL_RACH_REQ(uint8_t ra, uint8_t combined, uint16_t offset, - template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0), - template (value) RslLinkId link_id := ts_RslLinkID_DCCH(0)) := { + template (value) L1ctlMessage + ts_L1CTL_RACH_REQ(template (value) uint8_t ra, + template (value) uint8_t combined, + template (value) uint16_t offset, + template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0), + template (value) RslLinkId link_id := ts_RslLinkID_DCCH(0)) := { header := ts_L1ctlHeader(L1CTL_RACH_REQ), ul_info := { chan_nr := chan_nr, link_id := link_id, padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { rach_req := { ra := ra, @@ -569,19 +600,19 @@ module L1CTL_Types { } } - template L1ctlUlMessage ts_L1CTL_EXT_RACH_REQ( - uint16_t ra11, L1ctlRachSynchSeq seq, - uint8_t combined, uint16_t offset - ) := { + template (value) L1ctlMessage + ts_L1CTL_EXT_RACH_REQ(template (value) uint16_t ra11, + template (value) L1ctlRachSynchSeq seq, + template (value) uint8_t combined, + template (value) uint16_t offset) := { header := ts_L1ctlHeader(L1CTL_EXT_RACH_REQ), ul_info := { /* FIXME: both RSL chan_nr and link_id should be configurable */ - chan_nr := t_RslChanNr_RACH(0), + chan_nr := ts_RslChanNr_RACH(0), link_id := ts_RslLinkID_DCCH(0), padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { ext_rach_req := { ra11 := ra11, @@ -592,15 +623,16 @@ module L1CTL_Types { } } - template L1ctlUlMessage ts_L1CTL_PAR_REQ(uint8_t ta, uint8_t tx_power) := { + template (value) L1ctlMessage + ts_L1CTL_PAR_REQ(template (value) uint8_t ta, + template (value) uint8_t tx_power) := { header := ts_L1ctlHeader(L1CTL_PARAM_REQ), ul_info := { - chan_nr := t_RslChanNr_RACH(0), + chan_nr := ts_RslChanNr_RACH(0), link_id := ts_RslLinkID_DCCH(0), padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { par_req := { ta := ta, @@ -611,35 +643,37 @@ module L1CTL_Types { } /* Base template to be inherited by ts_L1CTL_DM_EST_REQ_H0 and ts_L1CTL_DM_EST_REQ_H1 */ - private template (value) L1ctlUlMessage ts_L1CTL_DM_EST_REQ(template (value) RslChannelNr chan_nr, - template (value) GsmTsc tsc) := { + private template (value) L1ctlMessage + ts_L1CTL_DM_EST_REQ(template (value) RslChannelNr chan_nr, + template (value) GsmTsc tsc) := { header := ts_L1ctlHeader(L1CTL_DM_EST_REQ), ul_info := { chan_nr := chan_nr, link_id := ts_RslLinkID_DCCH(0), padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { dm_est_req := { tsc := tsc, + h0h1 := -, tch_mode := L1CTL_CHAN_MODE_SIGN, audio_mode := t_L1CTL_AudioModeFwd } } } - template (value) L1ctlUlMessage ts_L1CTL_DM_EST_REQ_H0(template (value) RslChannelNr chan_nr, - template (value) GsmTsc tsc, - template (value) GsmArfcn arfcn) + template (value) L1ctlMessage + ts_L1CTL_DM_EST_REQ_H0(template (value) RslChannelNr chan_nr, + template (value) GsmTsc tsc, + template (value) GsmArfcn arfcn) modifies ts_L1CTL_DM_EST_REQ := { payload := { dm_est_req := { h0h1 := { h0 := { h := 0, - arfcn := { false, arfcn }, + arfcn := ts_GsmBandArfcn(arfcn), padding := f_pad_oct(''O, 130, '00'O) } } @@ -647,11 +681,12 @@ module L1CTL_Types { } } - template (value) L1ctlUlMessage ts_L1CTL_DM_EST_REQ_H1(template (value) RslChannelNr chan_nr, - template (value) GsmTsc tsc, - template (value) uint6_t hsn, - template (value) uint6_t maio, - template (value) L1ctlMA ma) + template (value) L1ctlMessage + ts_L1CTL_DM_EST_REQ_H1(template (value) RslChannelNr chan_nr, + template (value) GsmTsc tsc, + template (value) uint6_t hsn, + template (value) uint6_t maio, + template (value) L1ctlMA ma) modifies ts_L1CTL_DM_EST_REQ := { payload := { dm_est_req := { @@ -671,31 +706,29 @@ module L1CTL_Types { } } - template L1ctlUlMessage ts_L1CTL_DM_REL_REQ(RslChannelNr chan_nr) := { + template (value) L1ctlMessage + ts_L1CTL_DM_REL_REQ(template (value) RslChannelNr chan_nr) := { header := ts_L1ctlHeader(L1CTL_DM_REL_REQ), ul_info := { chan_nr := chan_nr, link_id := ts_RslLinkID_DCCH(0), padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, - payload := { - other := ''O - } + dl_info := omit, + payload := omit } - template (value) L1ctlUlMessage ts_L1CTL_DATA_REQ(template (value) RslChannelNr chan_nr, - template (value) RslLinkId link_id, - octetstring l2_data) := { + template (value) L1ctlMessage + ts_L1CTL_DATA_REQ(template (value) RslChannelNr chan_nr, + template (value) RslLinkId link_id, + octetstring l2_data) := { header := ts_L1ctlHeader(L1CTL_DATA_REQ), ul_info := { chan_nr := chan_nr, link_id := link_id, padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { data_req := { l1header := omit, @@ -704,18 +737,18 @@ module L1CTL_Types { } } - template (value) L1ctlUlMessage ts_L1CTL_DATA_REQ_SACCH(template (value) RslChannelNr chan_nr, - template (value) RslLinkId link_id, - template (value) SacchL1Header l1h, - octetstring l2_data) := { + template (value) L1ctlMessage + ts_L1CTL_DATA_REQ_SACCH(template (value) RslChannelNr chan_nr, + template (value) RslLinkId link_id, + template (value) SacchL1Header l1h, + octetstring l2_data) := { header := ts_L1ctlHeader(L1CTL_DATA_REQ), ul_info := { chan_nr := chan_nr, link_id := link_id, padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { data_req := { l1header := l1h, @@ -724,17 +757,17 @@ module L1CTL_Types { } } - template (value) L1ctlUlMessage ts_L1CTL_TRAFFIC_REQ(template (value) RslChannelNr chan_nr, - template (value) RslLinkId link_id, - octetstring frame) := { + template (value) L1ctlMessage + ts_L1CTL_TRAFFIC_REQ(template (value) RslChannelNr chan_nr, + template (value) RslLinkId link_id, + octetstring frame) := { header := ts_L1ctlHeader(L1CTL_TRAFFIC_REQ), ul_info := { chan_nr := chan_nr, link_id := link_id, padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { traffic_req := { data := frame @@ -742,86 +775,50 @@ module L1CTL_Types { } }; - template (value) L1ctlUlMessage ts_L1CTL_TBF_CFG_REQ(boolean is_uplink, TfiUsfArr tfi_usf) := { - header := ts_L1ctlHeader(L1CTL_TBF_CFG_REQ), + /* for matching against incoming RACH_CONF */ + template L1ctlMessage tr_L1CTL_RACH_CONF := { + header := tr_L1ctlHeader(L1CTL_RACH_CONF), ul_info := omit, - ul_info_tbf := omit, - ul_info_abs := omit, - payload := { - tbf_cfg_req := { - tbf_nr := 0, - is_uplink := is_uplink, - padding := '0000'O, - tfi_usf := tfi_usf - } - } - }; - - template L1ctlDlMessage tr_L1CTL_TBF_CFG_CONF(template boolean is_uplink) := { - header := tr_L1ctlHeader(L1CTL_TBF_CFG_CONF), - dl_info := omit, - payload := { - tbf_cfg_conf := { - tbf_nr := 0, - is_uplink := is_uplink, - padding := ?, - tfi_usf := ? - } - } + dl_info := ?, + payload := * }; - template (value) L1ctlUlMessage ts_L1CTL_DATA_TBF_REQ(octetstring l2_data, - L1ctlGprsCs cs := L1CTL_CS1, - uint8_t tbf_nr := 0) := { - header := ts_L1ctlHeader(L1CTL_DATA_TBF_REQ), - ul_info := omit, - ul_info_tbf := { - tbf_nr := tbf_nr, - cs := cs, - padding := '0000'O - }, - ul_info_abs := omit, - payload := { - other := l2_data - } - } - - template (value) L1ctlUlMessage ts_L1CTL_DATA_ABS_REQ(octetstring l2_data, Arfcn arfcn, - uint8_t ts, GsmFrameNumber fn, - L1ctlGprsCs cs := L1CTL_CS1, - uint8_t tbf_nr := 0) := { - header := ts_L1ctlHeader(L1CTL_DATA_ABS_REQ), + /* for sending and matching L1CTL_DATA_IND */ + template (value) L1ctlMessage + ts_L1CTL_DATA_IND(template (value) RslChannelNr chan_nr, + template (value) RslLinkId link_id, + template (value) octetstring l2_data, + template (value) GsmBandArfcn arfcn, + template (value) uint32_t fn := 1337, + template (value) GsmRxLev rx_level := 63, + template (value) uint8_t num_biterr := 0, + template (value) uint8_t fire_crc := 0) := { + header := ts_L1ctlHeader(L1CTL_DATA_IND), ul_info := omit, - ul_info_tbf := omit, - ul_info_abs := { - tbf_nr := tbf_nr, - cs := cs, - ts_nr := ts, - padding := '00'O, - fn := fn, + dl_info := { + chan_nr := chan_nr, + link_id := link_id, arfcn := arfcn, - padding2 := '0000'O + frame_nr := fn, + rx_level := rx_level, + snr := 0, + num_biterr := num_biterr, + fire_crc := fire_crc }, payload := { - other := l2_data + data_ind := { + payload := l2_data + } } - } - - - /* for matching against incoming RACH_CONF */ - template L1ctlDlMessage tr_L1CTL_RACH_CONF := { - header := tr_L1ctlHeader(L1CTL_RACH_CONF), - dl_info := ?, - payload := * }; - - /* for matching against incoming DATA_IND */ - template L1ctlDlMessage tr_L1CTL_DATA_IND(template RslChannelNr chan_nr, - template RslLinkId link_id := ?, - template octetstring l2_data := ?, - template uint8_t num_biterr := 0, - template uint8_t fire_crc := 0) := { + template L1ctlMessage + tr_L1CTL_DATA_IND(template (present) RslChannelNr chan_nr, + template (present) RslLinkId link_id := ?, + template (present) octetstring l2_data := ?, + template (present) uint8_t num_biterr := 0, + template (present) uint8_t fire_crc := 0) := { header := tr_L1ctlHeader(L1CTL_DATA_IND), + ul_info := omit, dl_info := { chan_nr := chan_nr, link_id := link_id, @@ -830,7 +827,7 @@ module L1CTL_Types { rx_level := ?, snr := ?, num_biterr := num_biterr, - fire_crc := fire_crc + fire_crc := fire_crc }, payload := { data_ind := { @@ -839,13 +836,73 @@ module L1CTL_Types { } }; + /* for sending and matching L1CTL_DATA_CONF */ + template (value) L1ctlMessage + ts_L1CTL_DATA_CONF(template (value) RslChannelNr chan_nr, + template (value) RslLinkId link_id, + template (value) GsmBandArfcn arfcn, + template (value) GsmFrameNumber fn) := { + header := ts_L1ctlHeader(L1CTL_DATA_CONF), + ul_info := omit, + dl_info := { + chan_nr := chan_nr, + link_id := link_id, + arfcn := arfcn, + frame_nr := fn, + rx_level := 0, + snr := 0, + num_biterr := 0, + fire_crc := 0 + }, + payload := omit + }; + template L1ctlMessage + tr_L1CTL_DATA_CONF(template (present) RslChannelNr chan_nr, + template (present) RslLinkId link_id := ?, + template (present) GsmBandArfcn arfcn := ?, + template (present) GsmFrameNumber fn := ?) := { + header := tr_L1ctlHeader(L1CTL_DATA_CONF), + ul_info := omit, + dl_info := { + chan_nr := chan_nr, + link_id := link_id, + arfcn := arfcn, + frame_nr := fn, + rx_level := ?, + snr := ?, + num_biterr := ?, + fire_crc := ? + }, + payload := omit + }; + + /* for sending and matching L1CTL_TRAFFIC_CONF */ + template (value) L1ctlMessage + ts_L1CTL_TRAFFIC_CONF(template (value) RslChannelNr chan_nr, + template (value) RslLinkId link_id, + template (value) GsmBandArfcn arfcn, + template (value) GsmFrameNumber fn) + modifies ts_L1CTL_DATA_CONF := { + header := ts_L1ctlHeader(L1CTL_TRAFFIC_CONF) + }; + template L1ctlMessage + tr_L1CTL_TRAFFIC_CONF(template (present) RslChannelNr chan_nr, + template (present) RslLinkId link_id := ?, + template (present) GsmBandArfcn arfcn := ?, + template (present) GsmFrameNumber fn := ?) + modifies tr_L1CTL_DATA_CONF := { + header := tr_L1ctlHeader(L1CTL_TRAFFIC_CONF) + }; + /* for matching against incoming TRAFFIC_IND */ - template L1ctlDlMessage tr_L1CTL_TRAFFIC_IND(template RslChannelNr chan_nr, - template RslLinkId link_id := ?, - template octetstring frame := ?, - template uint8_t num_biterr := ?, - template uint8_t fire_crc := ?) := { + template L1ctlMessage + tr_L1CTL_TRAFFIC_IND(template (present) RslChannelNr chan_nr, + template (present) RslLinkId link_id := ?, + template (present) octetstring frame := ?, + template (present) uint8_t num_biterr := ?, + template (present) uint8_t fire_crc := ?) := { header := tr_L1ctlHeader(L1CTL_TRAFFIC_IND), + ul_info := omit, dl_info := { chan_nr := chan_nr, link_id := link_id, @@ -863,16 +920,17 @@ module L1CTL_Types { } }; - template (value) L1ctlUlMessage ts_L1CTL_CRYPTO_REQ(RslChannelNr chan_nr, uint8_t algo, - octetstring key) := { + template (value) L1ctlMessage + ts_L1CTL_CRYPTO_REQ(template (value) RslChannelNr chan_nr, + template (value) uint8_t algo, + template (value) octetstring key) := { header := ts_L1ctlHeader(L1CTL_CRYPTO_REQ), ul_info := { chan_nr := chan_nr, link_id := ts_RslLinkID_DCCH(0), padding := '0000'O }, - ul_info_tbf := omit, - ul_info_abs := omit, + dl_info := omit, payload := { crypto_req := { algo := algo, @@ -882,6 +940,171 @@ module L1CTL_Types { } }; + + template (value) L1ctlMessage + ts_L1CTL_GPRS_UL_TBF_CFG_REQ(template (value) uint8_t tbf_ref, + template (value) BIT8 slotmask := '00000000'B, + template (value) uint32_t start_fn := c_UINT32_MAX) := { + header := ts_L1ctlHeader(L1CTL_GPRS_UL_TBF_CFG_REQ), + ul_info := omit, + dl_info := omit, + payload := { + ul_tbf_cfg_req := { + tbf_ref := tbf_ref, + slotmask := slotmask, + pad := '0000'O, + start_fn := start_fn + } + } + }; + template L1ctlMessage + tr_L1CTL_GPRS_UL_TBF_CFG_REQ(template (present) uint8_t tbf_ref := ?, + template (present) BIT8 slotmask := ?, + template (present) uint32_t start_fn := ?) := { + header := tr_L1ctlHeader(L1CTL_GPRS_UL_TBF_CFG_REQ), + ul_info := omit, + dl_info := omit, + payload := { + ul_tbf_cfg_req := { + tbf_ref := tbf_ref, + slotmask := slotmask, + pad := ?, + start_fn := start_fn + } + } + }; + + template (value) L1ctlMessage + ts_L1CTL_GPRS_DL_TBF_CFG_REQ(template (value) uint8_t tbf_ref, + template (value) BIT8 slotmask := '00000000'B, + template (value) uint32_t start_fn := c_UINT32_MAX, + template (value) uint5_t dl_tfi := 0) := { + header := ts_L1ctlHeader(L1CTL_GPRS_DL_TBF_CFG_REQ), + ul_info := omit, + dl_info := omit, + payload := { + dl_tbf_cfg_req := { + tbf_ref := tbf_ref, + slotmask := slotmask, + dl_tfi := dl_tfi, + pad := '00'O, + start_fn := start_fn + } + } + }; + template L1ctlMessage + tr_L1CTL_GPRS_DL_TBF_CFG_REQ(template (present) uint8_t tbf_ref := ?, + template (present) BIT8 slotmask := ?, + template (present) uint32_t start_fn := ?, + template (present) uint5_t dl_tfi := ?) := { + header := tr_L1ctlHeader(L1CTL_GPRS_DL_TBF_CFG_REQ), + ul_info := omit, + dl_info := omit, + payload := { + dl_tbf_cfg_req := { + tbf_ref := tbf_ref, + slotmask := slotmask, + dl_tfi := dl_tfi, + pad := ?, + start_fn := start_fn + } + } + }; + + template (value) L1ctlMessage + ts_L1CTL_GPRS_UL_BLOCK_REQ(template (value) GsmFrameNumber fn, + template (value) uint3_t tn, + template (value) octetstring data) := { + header := ts_L1ctlHeader(L1CTL_GPRS_UL_BLOCK_REQ), + ul_info := omit, + dl_info := omit, + payload := { + ul_block_req := { + hdr := { + fn := fn, + tn := tn, + pad := '000000'O + }, + data := data + } + } + }; + template L1ctlMessage + tr_L1CTL_GPRS_UL_BLOCK_REQ(template (present) GsmFrameNumber fn := ?, + template (present) uint3_t tn := ?, + template (present) octetstring data := ?) := { + header := tr_L1ctlHeader(L1CTL_GPRS_UL_BLOCK_REQ), + ul_info := omit, + dl_info := omit, + payload := { + ul_block_req := { + hdr := { + fn := fn, + tn := tn, + pad := ? + }, + data := data + } + } + }; + + template (value) L1ctlMessage + ts_L1CTL_GPRS_DL_BLOCK_IND(template (value) GsmFrameNumber fn, + template (value) uint3_t tn, + template (value) uint3_t usf, + template (value) octetstring data, + template (value) uint16_t ber10k := 0, + template (value) int16_t ci_cb := 180 /* 18 dB */, + template (value) GsmRxLev rx_level := 63) := { + header := ts_L1ctlHeader(L1CTL_GPRS_DL_BLOCK_IND), + ul_info := omit, + dl_info := omit, + payload := { + dl_block_ind := { + hdr := { + fn := fn, + tn := tn, + pad := '000000'O + }, + meas := { + ber10k := ber10k, + ci_cb := ci_cb, + rx_level := rx_level + }, + usf := usf, + data := data + } + } + }; + template L1ctlMessage + tr_L1CTL_GPRS_DL_BLOCK_IND(template (present) GsmFrameNumber fn := ?, + template (present) uint3_t tn := ?, + template (present) uint3_t usf := ?, + template (present) octetstring data := ?, + template (present) uint16_t ber10k := ?, + template (present) int16_t ci_cb := ?, + template (present) GsmRxLev rx_level := ?) := { + header := tr_L1ctlHeader(L1CTL_GPRS_DL_BLOCK_IND), + ul_info := omit, + dl_info := omit, + payload := { + dl_block_ind := { + hdr := { + fn := fn, + tn := tn, + pad := ? + }, + meas := { + ber10k := ber10k, + ci_cb := ci_cb, + rx_level := rx_level + }, + usf := usf, + data := data + } + } + }; + const octetstring c_DummyUI := '0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B'O; /* We use "BYTEORDER(last)" so we get little-endian integers. Unfortuantely, this also |