Commit Graph

42 Commits

Author SHA1 Message Date
Vadim Yanitskiy 1acc7bb184 library: move Osmocom_Types.Arfcn to GSM_Types.GsmBandArfcn
In some cases GsmArfcn itself is not enough.  It case of L1CTL
and GSMTAP, it needs to be equipped with a band discriminator:

  - DCS / PCS (as the numbers may overlap),
  - Downlink / Uplink (not yet there).

Let's rename this record and move it to GSM_Types.  Also, add
send / receive tamplates, so we can add new fields later.

Change-Id: I7a63f03bbd15a06caafb786122dc12991d115771
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy be33f6b158 library/L1CTL_Types: add missing template restrictions
The template restrictions are quite useful, becaue they give hints
to the TTCN-3 compiler, so it can spot more bugs.  For example,
the lack of thereof would not prevent one from passing 'omit' to
a template, that assigns a value to a non-optional field, so that
might lead to a DTE at run-time in some cases.

Since adding 'template (restriction) ' to each template parameter
obviously makes templates look more cumbersome, let's move the
part with template name and arguments onto a separate line, just
like it's sometimes done for function definitions in C.

Change-Id: I7e6846381e0b3fb611059fcfbafb19bd6c15cfd8
2020-11-14 21:38:15 +00:00
Vadim Yanitskiy 161858372a library/L1CTL_Types: use traffic forwarding mode by default
Calypso PHY (unlike trxcon) needs to be explicitly configured to
enable forwarding of the TCH traffic.  Otherwise it's handled
internally by the DSP and routed to/from the built-in speaker/mic.

Change-Id: I5b9ca5683627716868e85dc33f91d8ca4824cd61
Related: OS#4799
2020-10-19 17:36:19 +00:00
Vadim Yanitskiy 3b1fae4529 library/L1CTL_Types: add missing template for L1CTL_TCH_MODE_REQ
Change-Id: I7641c373dca7280d208f4eac85185a9899f0cb71
Related: OS#4799
2020-10-19 17:37:02 +07:00
Vadim Yanitskiy 7ce605fc8b library/L1CTL_Types: add missing 'loop_mode' to 'L1ctlTchModeReq'
Change-Id: Ia62cfc949603780b36f76bd6a9c16815b6152fcd
2020-10-19 17:37:02 +07:00
Vadim Yanitskiy 3240312a16 library/L1CTL_Types: relax some params of tr_L1CTL_TRAFFIC_IND()
A TRAFFIC.ind with 'num_biterr' > 0 or 'fire_crc' != 0 is still
a valid TCH frame - Bad Frame Indication.  Let's relax those
parameters for tr_L1CTL_TRAFFIC_IND().

Change-Id: Ia3357e06f986ae59dd0438f9ace3042cae8d3684
Related: OS#4799
2020-10-19 15:46:53 +07:00
Vadim Yanitskiy 2cdb97f166 library/L1CTL_Types: fix definition of L1ctlDmEstReq
In osmocom-bb 'struct l1ctl_dm_est_req' is defined as follows:

  struct l1ctl_dm_est_req {
    uint8_t tsc;
    uint8_t h;
    union {
      struct l1ctl_h0 h0;
      struct l1ctl_h1 h1;
    },
    uint8_t tch_mode;
    uint8_t audio_mode;
  } __attribute__((packed));

so the overall size of the union is size of the biggest member:

  sizeof(struct l1ctl_h0) is 2
  sizeof(struct l1ctl_h1) is 132

Therefore we need to fix our definitions:

  - introduce 'record L1ctlH0' (with padding),
  - introduce 'union L1ctlH0H1':
    - move hopping indicator to L1ctl{H0,H1},
    - use it as 'TAG' in 'union L1ctlH0H1'.

Change-Id: I53964f794260f0676cc2771a7acbb679befb06d5
Related: OS#4799
2020-10-19 14:33:24 +07:00
Vadim Yanitskiy fe052960b2 library/L1CTL_Types: turn L1ctlTchMode into an enumerated type
Change-Id: Ib547b5984078bc6c6a66addb4622a471487c7342
Related: OS#4799
2020-10-19 14:33:13 +07:00
Vadim Yanitskiy eda908106b library/L1CTL_Types: introduce ts_L1CTL_DM_EST_REQ_H1
Change-Id: Ie236c48a906679a5f46346ac7cbaf5866fd8befc
Related: OS#4546
2020-05-29 15:31:12 +00:00
Vadim Yanitskiy e8ea3ee10e library/L1CTL_Types: fix definition of L1ctlH1 (hopping parameters)
Change-Id: I87555de751e6e4af6ac5fe308c3e77fa15c8bb16
Related: OS#4546
2020-05-29 15:31:12 +00:00
Vadim Yanitskiy 5afe885d26 library/L1CTL_PortType: refactor L1CTL channel establishment
- Get rid of f_L1CTL_DM_EST_REQ, it's not really needed.
  - Derive ts_L1CTL_DM_EST_REQ_H0 from ts_L1CTL_DM_EST_REQ.
    - Turn all its params into (value) templates.
    - Turn it into a (value) template itself.
  - Pass GsmArfcn directly to ts_L1CTL_DM_EST_REQ_H0.

Change-Id: I4f275e22d4309a23b4ed301a0779c4ecb92023a8
Related: OS#4546
2020-05-29 15:31:12 +00:00
Vadim Yanitskiy 23b74404ba library/L1CTL_PortType.ttcn: use templates from GSM_RR_Types
Get rid of template t_IMM_ASS, which is a part of L1CTL_Types.ttcn.
Prepare generic (for both CS and PS) template on top of tr_IMM_ASS,
and use it in f_L1CTL_WAIT_IMM_ASS().

Change-Id: I3a410ec3c41e3eefd23071bfb0d80feda82177a5
2019-09-14 15:12:47 +00:00
Vadim Yanitskiy f3cc649673 library/L1CTL_Types.ttcn: introduce TRAFFIC_{REQ|IND} templates
Change-Id: Ic9f412579da33d0c76b7dd616bd1b305aacf5884
Related: OS#1855
2019-07-07 08:14:10 +00:00
Vadim Yanitskiy e432ba9222 L1CTL_RACH_REQ: make both chan_nr and link_id configurable
Change-Id: Ica6b9551b11c20fa0b8f4a8dcdc91ca07601642c
2019-06-01 14:03:42 +07:00
Vadim Yanitskiy 0a8d6daa65 L1CTL_Types.ttcn: accept SacchL1Header in ts_L1CTL_DATA_REQ_SACCH
In BTS_Tests.ttcn we used to compose L1ctlDataReq manually. This
can be done by ts_L1CTL_DATA_REQ_SACCH() template itself, so
let's abstract BTS_Tests.ttcn from doing that.

Change-Id: I1ae948bd0314cdf15c21ce4b6346d5e32f1fcf95
2019-06-01 14:03:42 +07:00
Vadim Yanitskiy 2a92e2a75c L1CTL_Types.ttcn: do not restrict the length of L1ctlDataInd
In the existing TC_pcu_* test cases we use L1CTL_DATA_* messages
to send / receive (E)GPRS related MAC-blocks. The length of such
blocks can be greater than 23 octets (i.e. fixed MAC-block
length in GSM), up to 162 octets to be precise.

Change-Id: Iced78796882b757016d02a266d55bc2a98b62a3d
2019-05-28 21:04:39 +00:00
Harald Welte 990a36138b L1CTL: Add support for CCCH_MODE_COMBINED_CBCH
In OsmocomBB/trxcon Change-Id Ia94ebf22a2ec439dfe1f31d703b832ae57b48ef2
we introduced a new mode CCCH_MODE_COMBINED_CBCH to indicate that the
channel combination is a CCCH+SDCCH/4 with one SDCCH stolen for CBCH.

Let's make sure we actually use that mode in our CBCH related tests

Change-Id: I27ee2c81bec7175c1ea09d4f3f6037f2866fe242
2019-05-27 21:31:56 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Vadim Yanitskiy 5c83679e39 library/L1CTL_Types.ttcn: add L1CTL_EXT_RACH_REQ message
According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit)
Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS
capability. One of the alternative synch. sequences (see 3GPP TS
05.02, TS1 and TS2) shall be used.

Change-Id: If037cb2f2687697f168d10a033eeb20d20183328
Related: OS#1854
2019-04-23 14:49:36 +00:00
Vadim Yanitskiy 4e79ff5eac library/L1CTL_Types.ttcn: fix: add missing L1CTL_BURST_IND message
Change-Id: Ibf75792be70f694bca9222ec6568371475d193bb
2019-04-23 14:49:36 +00:00
Vadim Yanitskiy e01691df50 L1CTL_Types.ttcn: drop length limitation for traffic messages
There is no any reason to limit payload length.

Change-Id: I1782856affe427b087fa3f7ef1c02a865d136372
2018-10-28 22:32:36 +00:00
Pau Espin 0aad596264 L1CTL_Types: Add support to set L1 Header params during SACCH tx
Change-Id: Id014f790ee2ede8ae796c37b1c6b25c4af9034d2
2018-10-03 21:39:10 +00:00
Harald Welte e613f96593 bts: ciphering tests
Change-Id: If450e36cfd8cde713f304e57ec09bc1239bdf7ea
2018-05-10 18:36:59 +02:00
Harald Welte f56cc49d75 L1CTL: Correctly parse L1CTL messages with zero-length payload
Some messages can happen with zero-length payload section,
e.g. a DL_DATA_IND with CRC errors.

Change-Id: Ice1d872c12fb33bc4e2d285870fdb877f6efe355
2018-04-15 10:59:30 +02:00
Harald Welte 3c4cbf6dd6 L1CTL_Types: dl_info is part of TRAFFIC_CONF, not just TRAFFIC_IND
Change-Id: I575b981d6ea59702927bbb2a2ae24b2e8652cc5d
2018-04-02 13:18:23 +02:00
Harald Welte 629cc6b77a bts: Add TC_deact_sacch()
This test case checks on each logical channel if the DEACT SACCH RSL
message actually deactivates downlink SACCH as expected.

Change-Id: Id8219ffce0635071cb50669b89368de51fe82843
2018-03-12 16:04:48 +01:00
Harald Welte 3757e60d6f L1CTL: make sure to self.stop in all setverdict(fail) cases
Change-Id: I2013a8ec0641d8ef935e6615c1bde599f42db260
2018-03-12 16:04:31 +01:00
Harald Welte f8df4cb339 L1CTL/bts: Fix tons of compiler warnings by splitting rx+tx templates
Change-Id: I9c8be0856516a6a168795c792f76d14c08c3dabb
2018-03-12 16:04:22 +01:00
Harald Welte 370527372d L1CTL: Add f_L1CTL_PARAM for timing advance + tx power control
Change-Id: I30051804ae9cc62b5ad8c8a11a53d96489b8a52f
2018-03-12 14:29:14 +00:00
Harald Welte 344c0cf6cf L1CTL_Types: Fix bit-ordering in FBSB_REQ
Change-Id: Idbfdf1e855489c37a7212573ef51bd7fc63f24f7
2018-03-12 14:26:54 +00:00
Harald Welte 7024baa66c gprs_gb: working Uplink PACKET_CONTROL_ACK against OsmoPCU
Change-Id: I2c7d0eb9371911e28f328caeaed63cb8ec311ac1
2018-03-12 14:23:57 +00:00
Harald Welte 3a40ec7acb l1ctl: Add L1CTL_DATA_ABS_REQ for PACKET UPLINK ACK
Change-Id: If2109ea87b15a0ed21b39ab7502813acb1d5dd1e
2018-03-02 20:45:04 +01:00
Harald Welte 68e495b48a bts: Add paging related tests
We're testing at 80% and 200% of PCH capacity, both for either IMSI-only
or TMSI-only paging requests.  The way how we test ensures:

* the expected number of paged mobile identities end up on the Um interface
* we implicitly check the queuing limit of 200 paging records by
  overflowing it in the 20-seconds-of-200%-load cases
* we implicitly check the batching of mobile identities into different
  paging types
* we test the PCH load reporting over RSL

As a side note, in case you were ever wondering what's the expected
paging throughput / capacity, there are now helper functions to compute
it.  For our combined CCCH/SDCCH4, it's about 16 IMSIs per second or
about 32 TMSIs per second.

Change-Id: I0b80b72bdab3d80d915296d70e1174623fbd8610
2018-02-25 12:58:36 +01:00
Harald Welte a82f7e6098 L1CTL: Increase FBSB timeout to ~1s
Change-Id: Id2bb23ae966bd9aa5fc36bfa8ba41d7f136ac88f
2018-02-23 19:03:54 +01:00
Harald Welte ce6dc4494c L1CTL: Add optional link_id argument to t_L1CTL_DATA_IND()
Change-Id: Ib4cf42825da1034966086d9232273c2328a94947
2018-02-22 00:29:00 +01:00
Harald Welte 1dcc371539 Add Definitions for GPRS coding schemes 2017-08-01 00:05:52 +02:00
Harald Welte 88849c61b2 L1CTL_Types: Split t_IMM_ASS() off t_RR_IMM_ASS()
It's useful to have a separat template only for the IM_ASS part, without
RR header.
2017-07-30 17:19:41 +02:00
Harald Welte b3c226ebde L1CTL_Types: Add support for L1CTL_DATA_TBF_{REQ,CONF}
Those two L1CTL primitives are extensions of L1CTL for GPRS operation
2017-07-30 17:19:24 +02:00
Harald Welte 9419c8aff7 Split RR portion of GSM_Types into GSM_RR_Types 2017-07-30 04:07:35 +02:00
Harald Welte d335cbcdb9 L1CTL_Types: Make t_RR_IMM_ASS match also TBF assignments 2017-07-30 00:51:23 +02:00
Harald Welte 00d4dace72 L1CTL_Types: Add upcoming L1CTL_TBF_CFG_{REQ,CONF}
Related primitives are used to configure L1 for GPRS / TBF operation
2017-07-30 00:50:32 +02:00
Harald Welte 5b1ce8c4f4 move L1CTL modules to library for easier sharing with other test suites 2017-07-19 20:16:54 +02:00