diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 462e2d547..4be8d2b7e 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -585,7 +585,7 @@ friend function f_resolve_fh_params(inout FreqHopPars fhp, uint8_t tn, for (j := 0; j < lengthof(g.trx_maio); j := j + 1) { var FreqHopGroupItem gi := g.trx_maio[j]; var GsmArfcn arfcn := c_arfcn_list[gi.trx_nr]; - fhp.ma := fhp.ma & { { false, arfcn } }; + fhp.ma := fhp.ma & { valueof(ts_GsmBandArfcn(arfcn)) }; fhp.ma_map.ma[gi.trx_nr] := '1'B; } @@ -636,7 +636,8 @@ private altstep as_Tguard() runs on ConnHdlr { } friend function f_l1_tune(L1CTL_PT L1CTL, L1ctlCcchMode ccch_mode := CCCH_MODE_COMBINED) { - f_L1CTL_FBSB(L1CTL, { false, mp_trx0_arfcn }, ccch_mode, mp_rxlev_exp); + var GsmBandArfcn arfcn := valueof(ts_GsmBandArfcn(mp_trx0_arfcn)); + f_L1CTL_FBSB(L1CTL, arfcn, ccch_mode, mp_rxlev_exp); } private function f_trxc_fake_rssi(TRXC_RSSI rssi) runs on ConnHdlr { diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn index d961adb85..0c032bbe7 100644 --- a/bts/BTS_Tests_LAPDm.ttcn +++ b/bts/BTS_Tests_LAPDm.ttcn @@ -43,7 +43,8 @@ function f_lapdm_exit() runs on lapdm_test_CT { /* master function switching to a dedicated radio channel */ function f_switch_dcch() runs on ConnHdlr { - var BCCH_tune_req tune_req := { arfcn := { false, mp_trx0_arfcn }, combined_ccch := true }; + var GsmBandArfcn arfcn := valueof(ts_GsmBandArfcn(mp_trx0_arfcn)); + var BCCH_tune_req tune_req := { arfcn := arfcn, combined_ccch := true }; var DCCH_switch_req sw_req; /* Craft channel description (with or without frequency hopping parameters) */ diff --git a/library/GSMTAP_Types.ttcn b/library/GSMTAP_Types.ttcn index 32882844c..76e6ea3ce 100644 --- a/library/GSMTAP_Types.ttcn +++ b/library/GSMTAP_Types.ttcn @@ -1,5 +1,6 @@ module GSMTAP_Types { import from Osmocom_Types all; + import from GSM_Types all; const uint8_t GSMTAP_VERSION := 2; @@ -49,7 +50,7 @@ module GSMTAP_Types { uint8_t hdr_len, GsmtapMsgType msg_type, uint8_t timeslot, - Arfcn arfcn, + GsmBandArfcn arfcn, int8_t signal_dbm, int8_t snr_db, uint32_t frame_number, diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index bcf2794eb..d954962ae 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -29,6 +29,31 @@ type hexstring GsmMnc length(2 .. 3); type uint16_t GsmLac; type uint16_t GsmCellId; +/* ARFCN with explicit band discrimination */ +type record GsmBandArfcn { + boolean pcs, + BIT5 spare, + GsmArfcn arfcn +} with { + variant (arfcn) "BYTEORDER(last)" + variant (arfcn) "FIELDLENGTH(10)" +}; + +template (value) GsmBandArfcn +ts_GsmBandArfcn(template (value) GsmArfcn arfcn, + template (value) boolean pcs := false) := { + pcs := pcs, + spare := '00000'B, + arfcn := arfcn +}; +template GsmBandArfcn +tr_GsmBandArfcn(template (present) GsmArfcn arfcn, + template (present) boolean pcs := ?) := { + pcs := pcs, + spare := ?, + arfcn := arfcn +}; + type enumerated GprsCodingScheme { CS1, CS2, CS3, CS4 }; diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index 19b3ee39e..5c554c2b6 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -42,7 +42,10 @@ module L1CTL_PortType { return len; } - function f_L1CTL_FBSB(L1CTL_PT pt, Arfcn arfcn, L1ctlCcchMode ccch_mode := CCCH_MODE_COMBINED, integer rxlev_exp := 57) { + function f_L1CTL_FBSB(L1CTL_PT pt, GsmBandArfcn arfcn, + L1ctlCcchMode ccch_mode := CCCH_MODE_COMBINED, + integer rxlev_exp := 57) + { timer T := 15.0; for (var integer i := 0; i < 10; i := i+1) { var L1ctlDlMessage dl; diff --git a/library/L1CTL_Types.ttcn b/library/L1CTL_Types.ttcn index fe375eff0..220a2cdd8 100644 --- a/library/L1CTL_Types.ttcn +++ b/library/L1CTL_Types.ttcn @@ -122,7 +122,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, @@ -245,7 +245,7 @@ module L1CTL_Types { uint8_t ts_nr, OCT1 padding, uint32_le fn, - Arfcn arfcn, + GsmBandArfcn arfcn, OCT2 padding2 } with { variant "" }; @@ -264,7 +264,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, @@ -319,11 +319,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, @@ -477,7 +477,7 @@ module L1CTL_Types { /* for generating FBSB_REQ */ template (value) L1ctlUlMessage - ts_L1CTL_FBSB_REQ(template (value) Arfcn arfcn, + ts_L1CTL_FBSB_REQ(template (value) GsmBandArfcn arfcn, template (value) L1ctlFbsbFlags flags, template (value) uint8_t sync_info_idx, template (value) L1ctlCcchMode ccch_mode, @@ -655,7 +655,7 @@ module L1CTL_Types { h0h1 := { h0 := { h := 0, - arfcn := { false, arfcn }, + arfcn := ts_GsmBandArfcn(arfcn), padding := f_pad_oct(''O, 130, '00'O) } } @@ -813,7 +813,7 @@ module L1CTL_Types { template (value) L1ctlUlMessage ts_L1CTL_DATA_ABS_REQ(octetstring l2_data, - template (value) Arfcn arfcn, + template (value) GsmBandArfcn arfcn, template (value) uint8_t ts, template (value) GsmFrameNumber fn, template (value) L1ctlGprsCs cs := L1CTL_CS1, diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn index d0ad24b97..3e2fba2b1 100644 --- a/library/LAPDm_RAW_PT.ttcn +++ b/library/LAPDm_RAW_PT.ttcn @@ -22,7 +22,7 @@ module LAPDm_RAW_PT { /* request to tune to a given ARFCN and start BCCH decoding */ type record BCCH_tune_req { - Arfcn arfcn, + GsmBandArfcn arfcn, boolean combined_ccch } @@ -102,7 +102,7 @@ module LAPDm_RAW_PT { GprsCodingScheme cs, uint8_t ts_nr, GsmFrameNumber fn, - Arfcn arfcn, + GsmBandArfcn arfcn, RlcmacUlBlock block } type union RLCMAC_ph_data_req { @@ -198,7 +198,8 @@ module LAPDm_RAW_PT { } /* tune to given ARFCN and start BCCH/CCCH decoding */ - private function f_tune_bcch(Arfcn arfcn, boolean combined) runs on lapdm_CT { + private function f_tune_bcch(GsmBandArfcn arfcn, boolean combined) + runs on lapdm_CT { var L1ctlCcchMode mode := CCCH_MODE_NON_COMBINED; if (combined) { mode := CCCH_MODE_COMBINED; @@ -274,7 +275,8 @@ module LAPDm_RAW_PT { } template (value) RLCMAC_ph_data_req ts_PH_DATA_ABS(uint8_t tbf_id, GprsCodingScheme cs, - uint8_t ts, uint32_t fn, Arfcn arfcn, + uint8_t ts, uint32_t fn, + GsmBandArfcn arfcn, RlcmacUlBlock block) := { abs := { tbf_id := tbf_id, diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 4012f6d80..862509bb6 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -44,11 +44,6 @@ const uint32_t c_UINT32_MAX := 4294967295; const BIT1 CSN1_L := '0'B; const BIT1 CSN1_H := '1'B; -type record Arfcn { - boolean pcs, - uint15_t arfcn -} with { variant "" }; - /* based on Linux */ type enumerated AddressFamily { AF_UNSPEC ('00'O),