Commit Graph

8389 Commits

Author SHA1 Message Date
Vadim Yanitskiy 4a61575917 utils: fix incorrect string checks in meas_db_insert()
Comparing an array to null is not useful, since the test will
always evaluate as true (NO_EFFECT).

Change-Id: I8a41078070119bc22d594c0dfff5d98b5d16f970
Fixes: fbead4327 utils: store more fields from meas-feed in db
Fixes: CID#310821
2023-03-01 21:53:24 +00:00
Philipp Maier 111b13f9a2 pcu_sock: print OML alerts from PCU
The PCU is able to send OML alerts via the BTS to the BSC. When the PCU
operates in co-location to the BSC we just print the alerts in the log
directly

Change-Id: Id32553556356c2affe32e47ae1c3ae6a514efdce
Related: OS#5198
2023-03-01 11:21:50 +01:00
Oliver Smith 4e54e16b9f codec_pref: split test_codec_support_bts_rate
Move the check for the rate into an extra function, so it can be used
for CSD without checking a speech codec at the same time.

Related: OS#4393
Change-Id: Iea8a23ef3c66ed556110038fe9f3bc7f6eef3e96
2023-03-01 08:11:15 +00:00
Oliver Smith f597a035fa bssmap_handle_ass_req_ct_speech: refactor
Move the translation from osmo_sockaddr_to_str_and_uint into
bssmap_handle_ass_req_tp_rtp_addr, which will be used by
bssmap_handle_ass_req_ct_data in a future patch too.

Pass pointers to variables in req, instead of duplicating variables and
filling it in later (like in bssmap_handle_ass_req_ct_sign).

Related: OS#4393
Change-Id: I6bb16b26d89056dffa50bd8296fefe9315c587ca
2023-03-01 08:11:15 +00:00
Oliver Smith 71c8bdfc56 bssmap_handle_ass_req_ct_speech: split up
Allow reusing common code in an upcoming bssmap_handle_ass_req_ct_data.
It won't use _osmux for now (maybe in the future?), but splitting it
out as well makes it consistent.

Related: OS#4393
Change-Id: I4d9a4df314b1e56b9c1f90c9d7914332b70b56f8
2023-03-01 08:11:15 +00:00
Oliver Smith 31f81d55fc bssmap_handle_assignm_req: split up
Prepare to implement GSM0808_CHAN_DATA without making this function even
longer.

Related: OS#4393
Change-Id: I8580e75e292cff1b52b6ba1bafd12c155c3bbe93
2023-03-01 08:11:15 +00:00
Michael Iedema fbead43271 utils: store more fields from meas-feed in db
More fields need to be captured from meas-feed
to perform meaningful analysis of data from
multi-bts and multi-trx systems.

This patch adds expands the existing db utils
to record nearly all available fields from
meas-feed.

Change-Id: I509c939524b11a4ee455bcfc3ebee6c5c35b9fba
2023-02-28 18:45:48 +00:00
Oliver Smith 146c228df2 Cosmetic: codec_pref: tweak comments
Remove "Helper function for match_codec_pref()" at the beginning of the
descriptions of these functions, looks like a leftover from before this
was moved to its own c file. Remove a duplicated "received" in a
comment.

Change-Id: I30f0744db9aebf2f05077fef840097c332b9dafd
2023-02-28 11:06:47 +00:00
Oliver Smith 0e552cc9c1 Cosmetic: fix various typos
Change-Id: I9225e733e3afa8171f24253e21eaffc654f689af
2023-02-28 11:06:47 +00:00
Philipp Maier 3632ffe65a timeslot_fsm: fix sourcecode indenting
Change-Id: I1cfd377cd8014e42aa45f9f0da664598ee88e02d
2023-02-28 10:01:50 +00:00
Oliver Smith 88133a746d osmo_bsc_main: don't allocate talloc_ctr_ctx
tall_ctr_ctx is not defined or used in osmo-bsc and apparently was only
exported by accident from libosmocore. It's not exported anymore since
libosmocore.map was introduced in I13169c00a59fb59513dfc598de5a71d094492422.

Fix for:
  /usr/bin/ld: osmo_bsc_main.o: in function `main':
  osmo_bsc_main.c:(.text+0x830d): undefined reference to `tall_ctr_ctx'
  /usr/bin/ld: osmo_bsc_main.c:(.text+0x8331): undefined reference to `tall_ctr_ctx'

Change-Id: I558e1ec722f3b1ff1f2e89b3cb97ed1dba9063e3
2023-02-28 09:36:00 +01:00
Harald Welte c4b523a8f3 Work around coverity false positives in macros
We have some macros that may at times have signed arguments, and at
other times unsigned.  Checking for <= 0 is not a bug in this case.
Let's typecast any unsigned arguments to signed int to work around.

Change-Id: I10e60b20c6f8092cf1ce09ebe501e739fd4a9479
Closes: CID#272993, CID#272992 (and many others)
2023-02-27 10:12:13 +00:00
Oliver Smith 4bcfb7e034 fsms: use configurable timers instead of T23042
T23042 was a placeholder for timers to be filled in later. Replace it
with timers that can be configured via VTY.

Previous timeout for the states was 5s, from using the default of 5 for
undefined timers.

* ASSIGNMENT_ST_WAIT_MGW_ENDPOINT_TO_MSC and
  HO_ST_WAIT_MGW_ENDPOINT_TO_MSC:
  * Runs gscon_connect_mgw_to_msc() on enter, which waits for one MGCP
    CRCX or MDCX response (or changes state immediately)
  * Use existing X9 ("Timeout for availability of MGW endpoint"), 5s,
    which is already being used by lchan_rtp_fsm for a similar purpose

* HO_ST_WAIT_RR_HO_DETECT:
  * Handover initiation as described in 3GPP TS 04.08 § 3.4.4.1:
    "The network initiates the handover procedure by sending a HANDOVER
     COMMAND message to the mobile station on the main DCCH. It then
     starts timer T3103."
  * Use existing but unused timer T3103 ("Handover"), 5s

* HO_ST_WAIT_RR_HO_COMPLETE:
  * Handover completion as described in 3GPP TS 04.08 § 3.4.4.3:
    "When receiving the HANDOVER COMPLETE message, the network stops
     timer T3103 and releases the old channels."
  * Continue using T3103 with keep_timer = true

Closes: OS#5787
Change-Id: Id0d4d0788f609f3272fc81c80a754383dde25c16
2023-02-16 14:49:39 +01:00
Oliver Smith cb3eb23ec2 ho: remove timeout for HO_ST_WAIT_LCHAN_ESTABLISHED
Remove placeholder timer T23042. This handover fsm state waits for both
RSL/RR and RTP/MGW to be complete. I've added TTCN-3 tests to ensure
that both cases are covered by existing timer T3101 in lchan fsm state
LCHAN_ST_WAIT_RLL_RTP_ESTABLISH, which on timeout lets the handover
fail.

Related: OS#5787
Related: osmo-ttcn3-hacks I30e1811f97406cff6ba794fcd6882e2bb0205087
Related: osmo-ttcn3-hacks I2f79e3ff988a4315fbef3538f02403b818fa7839
Change-Id: I53468766c3c5fad7d7e275c0f20b5c20677fe4e8
2023-02-16 14:49:39 +01:00
Oliver Smith 23e3e29b7a ho: remove timeout for HO_ST_WAIT_LCHAN_ACTIVE
Remove placeholder timer T23042.

Neels wrote:
> I think the right thing here is to remove this timeout; this needs
> no timeout at all because we can rely on the lchan_fsm to either
> return HO_EV_LCHAN_ACTIVE or HO_EV_LCHAN_ERROR after the usual
> timeouts set for lchan activation. IOW since it is internal to
> osmo-bsc one of the two events is guaranteed to occur.
>
> If we superimpose a timer on top of the lchan timeouts, configuring
> larger lchan activation timeouts becomes complex, because the user
> has to take care to also allow a larger timeout for the same
> procedure during HO.

Related: OS#5787
Change-Id: Ibf740aaa9bddc2de85cf8087ad90bab47aac12c2
2023-02-16 10:37:17 +00:00
Philipp Maier 329e1cdc22 bsc_subscriber_conn_fsm: use subslot 0 in case of E1 full subslot
In classic E1 based GSM networks the audio is usually transfered through
16bkps I.460 subslots while 4 16kbps subslots are multiplexed into one
E1 timeslot. However, there may be setups where still 16kbps subslots
are used, but with 1 instead of 4 channels per timeslot. In those cases
the bit offset is 0, while the rate is still 16kbps.

Change-Id: I0d2bc44acaa8e5a28cccfdf7cfb945bf14a4ed30
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier d4044214ca bts_trx_vty: use define constant E1_SUBSLOT_FULL instead magic number
Change-Id: I0be228d4473215c6bd36c668e0e10e64965732e7
2023-02-13 12:39:22 +01:00
Philipp Maier ec1a0a102f pcu_sock: set direct TLLI flag in info indication
osmo-bsc requires the PCU to tag IMMEDIATE ASSIGNMENTS that shall be
sent via PCU with a TLLI. This is required to confirm the sending of the
IMMEDIATE ASSIGNMENT messages to the PCU.

Related: OS#5198
Change-Id: Ib804143a57824632e5435f7ba68f2e94f5f3fb21
2023-02-13 12:39:22 +01:00
Philipp Maier ee43e37528 pcu_sock: transfer E1 connection information to PCU
The BSC has all information about the E1 line configuration of each
timeslot/channel. The PCU is responsible for opening and managing the
CCU connection. To enable the CCU to do that, we have to transfer the E1
connection information (which TS, SS, rate) to the PCU.

Change-Id: I6d44373336b41009ff4c6e459d32d0a81081676c
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier f18e9c36f4 pcu_sock: transfer sysinfo to PCU
The PCU needs to be aware of the current system information in order to
work properly.

Change-Id: Ibbfbfaf588a4e406804c36570010aefdfc14328b
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier 8a0572256b abis_rsl: constify parameters of rsl_X_imm_assign_cmd
Related: OS#5198
Change-Id: I1bd2e0c844bf273d2c4381eec9e9bb9562254873
2023-02-13 12:39:22 +01:00
Philipp Maier 107d311d96 pcu_sock: use extract_paging_group() for PCU_IF_SAPI_PCH
We have introduced the function extract_paging_group() with the previous
patch. Lets use it for PCU_IF_SAPI_PCH as well to remove code
duplication

Change-Id: If4ffe8eafd2e54e323cbc075c09d457a74ebe83f
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier 7a346a547e abis_rsl: add support for sending IMMEDIATE ASSIGNMENT through PCH
The IMMEDIATE ASSIGNMENT for downlink TBFs needs to be sent through the
PCH instead of the AGCH. Since this method is not specified in RSL, it
is usually a vendor specific extension.

Change-Id: I4452f4973d1ec69c96aad527b057226e8a6edf99
Related: OS#5198
2023-02-13 12:39:22 +01:00
Philipp Maier 84811c901e pcu_sock: cosmetic: remove space before tab
Change-Id: I6f3f96120d8a106f7c9e8b428d89ed14999a10a8
2023-02-11 14:06:44 +01:00
Philipp Maier 3c4320f935 pcuif_proto: rename PCU_IF_SAPI_AGCH_DT to PCU_IF_SAPI_PCH_DT
The current name of PCU_IF_SAPI_AGCH_DT is a bit misleading as it
describes a method to send immediate assignment messages (normally AGCH)
via the PCH. The name in the constant should reflect that correctly

Change-Id: I78abeb62d0267baa31a4727c4bdd027b7230f137
Related: OS#5198
2023-02-11 14:06:44 +01:00
Max 54b7cd5392 doc: correct reference and add deprecation notice
Change-Id: I46f1f070cb00c4c27247593527b0173e1fd5de67
2023-02-10 11:41:23 +00:00
Pau Espin 23eef299ae Bump version: 1.9.0.150-64930-dirty → 1.10.0
Change-Id: Ibb24049e8289ad496b2361eabf8d65331d86317a
2023-02-07 17:21:11 +01:00
Philipp Maier 64930d8000 pcuif_proto: move gsm_pcu_if_e1_ccu_ind into right place
The struct gsm_pcu_if_e1_ccu_ind is a bit misplaced. Lets move it next
to the info indication strucht, to have it in the same order is it used
in gsm_pcu_if

Change-Id: I41237c7847ab7a14ed2cd85dd32aabb3a6124a49
Related: OS#5198
2023-02-07 14:11:39 +00:00
Vadim Yanitskiy dc634a8836 bsc_vty: use gsmnet_from_vty() everywhere, not vty->index
Change-Id: Ic08d1213c3b353bdf9b425e24382b6c5bd229c9c
2023-02-06 17:42:42 +00:00
Vadim Yanitskiy 3b5e469485 fix bsc_vty_go_parent(): add missing case for MGW_NODE
A new VTY node was added in commit [1], but bsc_vty_go_parent() was
not updated.  Because of that, commands following the MGW node may
crash osmo-bsc.  In the example below:

  network
   network country code 901
   mobile network code 70
   ...
   mgw 0
    remote-ip 127.0.0.1
    local-ip 127.0.0.1
   periodic location update 30

the 'periodic location update 30' will trigger a segfault:

  (gdb) bt
  #0  0x00005555555dfc09 in cfg_net_per_loc_upd ()
  #1  0x00007ffff7af6c3f in cmd_execute_command_strict () from /usr/local/lib/libosmovty.so.9
  #2  0x00007ffff7af6f1c in config_from_file () from /usr/local/lib/libosmovty.so.9
  #3  0x00007ffff7afd4e1 in vty_read_config_filep () from /usr/local/lib/libosmovty.so.9
  #4  0x00007ffff7afe375 in vty_read_config_file () from /usr/local/lib/libosmovty.so.9
  #5  0x0000555555579616 in bsc_network_configure ()
  #6  0x000055555557a352 in main ()

because vty->index would be NULL after returning from the MGW node.

Fix this by adding the missing case to bsc_vty_go_parent().

Change-Id: Id3050ff7e2402c33ee76c7bf0cc83603c0cc6dfc
Fixes: [1] 8d22e68706
2023-02-06 17:42:42 +00:00
Philipp Maier 38e4fb4014 timeslot_fsm: remove duplicate TS_ST_BORKEN from out_state_mask
The stete TS_ST_WAIT_PDCH_DEACT has TS_ST_BORKEN twice in
out_state_mask. This is unnecessary.

Change-Id: Ib758150ba7074adbb1b59008f0dfb57766763897
2023-02-06 16:09:17 +00:00
Max 74d9fb7fff HO: use defined constant instead of magic number
Change-Id: Iabedc3a704ccc766f4490e3e621e7be83995a9c6
2023-02-04 10:08:51 +00:00
Neels Hofmeyr fa5a5f050b doc: add mscpool-attach.dot
Change-Id: I4ffe0997be3d91a2a1d84998c56cba1c4eb30852
2023-02-02 10:20:39 +00:00
Philipp Maier c206cd7808 pcu_sock: rework log output
The code is easier to read when the log string is in one line

Change-Id: Idc673e0b15869c6966701524db1af7d7847c16ab
Related: OS#5198
2023-02-02 10:58:09 +01:00
Philipp Maier 364f7ec189 pcu_sock: remove unecessary OSMO_ASSERT()s
Change-Id: I8320cbc14361438d65642d15bc225e9960ce925b
Related: OS#5198
2023-02-02 10:55:06 +01:00
Philipp Maier b9558272f2 pcu_sock: Also fill in BSIC in gsm_pcu_if_info_ind
When filling in the info_ind parameters we lack the BSIC

Change-Id: I22158b18f50a7adf4ba1fed25bd7a880dc109e3d
Related: OS#5198
2023-02-02 10:54:32 +01:00
Philipp Maier 16b891ffb9 pcu_sock: fix endianess when populating gsm_pcu_if_info_ind
The intended endienaess for the remote_port member is host byte order,
while the endianess in the nsvc struct is in network byte order.

(see also pcu_sock.c in osmo-bts.git)

Change-Id: Ib62dcceb80fd500e477dd5e1a0e43de47e16eeb0
Related: OS#5198
2023-02-02 10:52:51 +01:00
arehbein 97ed3c8d97 bsc_ctrl_commands: Add GET for bts neighbor-list (local bts numbers)
Related: SYS#6287
Change-Id: I79aeffd93089086f57c66787fe20b439a4d8b6b4
2023-02-01 23:19:55 +00:00
Philipp Maier 2e83847865 pcuif_proto: add indication to communicate E1 parameters
osmo-pcu will also support GPRS via E1 timeslots in a BSC co-located
setup. To avoid duplicate configuration the BSC has to communicate the
E1 parameters (which TS, SS etc.) to the PCU. Lets add a new primitive
to do that.

Change-Id: I3a0f6ae6b98694458230d7c0ac2c89b332cfbc92
Related: OS#5198
2023-01-31 15:50:42 +01:00
Philipp Maier 3fff53aed7 timeslot_fsm: Warn in case Ercisson RBS uses static PDCH
The Ericsson RBS is a BTS that natively works with dynamic timeslots.
This colides with the current understanding of static PDCH channels
because the BTSs we support so far get thier static PDCH information on
startup and then handle everything related internally. The BSC does not
actively manage the channel in those cases. In the case of Ericsson we
have to activate the PDCH via RSL like any other channel and the timeslot
FSM has to manage it. Lets not add work arouds for this, lets just print
and error message and use the BTS in the dynamic scheme as intended by
the manufacturer.

Change-Id: Icc7c2956fc934691e3bfacb283d896a8767baf27
Related: OS#5198
2023-01-31 15:50:42 +01:00
Philipp Maier 373d4f05f6 pcu_sock: rework check logic for ts
Before filling in the TS in the info indication, it is checked that the
MO opstate is enabled. Also it is checked that the TS serves a PDCH.
Lets restructure this check and move the PDCH check into a helper
function as we need to check for PDCH from other location as well later.

Change-Id: Icaab52ab73c38889dfadb523b89bb54cafacc99a
Related: OS#5198
2023-01-31 12:05:02 +01:00
Philipp Maier cb3140faf6 abis_om2000: send TS_EV_OML_READY when TRX is fully done
We send the TS_EV_OML_READY event early, even though the TRX is not
fully done with all OML initialization steps. Lets complete the TRX
initialization first and then notify each timeslot FSM with
TS_EV_OML_READY.

Change-Id: If5251b102c8aa45dfc8cc4ee4e0223d7dc438938
2023-01-31 12:05:02 +01:00
Philipp Maier 4c680eb798 pcu_sock: clean up logging in info_ind_fill_trx
Change-Id: Ie5c1abcf7b25fe00b6c228c49648e018f94190f0
Related: OS#5198
2023-01-31 10:50:37 +01:00
Philipp Maier f21d423b0c pcu_sock: fix sourcecode formatting
Change-Id: I593c16efa1639aa8d2f90735bfdc9750cf695ecd
Related: OS#5198
2023-01-30 17:45:30 +01:00
Philipp Maier a68cdf57a3 pcu_sock: check trx mo state
Make sure that the TRX MO state is enabled and unlocked before filling
in any TRX information into the info indication

Change-Id: I7a93826e6b0df187425310cb82854e7d7fb47e72
Related: OS#5198
2023-01-30 10:36:08 +00:00
arehbein 2a24613e39 osmo-bsc: Fix 'apply-config-file' CTRL command
Make 'apply-config-file' check the neighbor config, just as is done after config parsing on startup

Related: OS#5866
Change-Id: I24ae8cd7e5e0d15eab9fd04b1858072bf0bad36a
2023-01-26 21:28:57 +00:00
Max 484f0771cd SI: set type 10 length properly
According to 3GPP TS 44.018 §9.1.50 SI10 is 168 bits long.

Related: OS#5783
Change-Id: Ifd76ebb10029b95a80a85bea4d102d5e100c182c
2023-01-23 18:24:18 +00:00
Max 715dc37b10 SI: use defined constant instead of magic number
Related: OS#5783
Change-Id: I2ecac86fb860241bccf56c03d0454f07552fdc9d
2023-01-23 18:23:48 +00:00
arehbein 945e2514ca osmo-bsc: Log error regarding BTS number explicitly
Related: OS#5864
Change-Id: I64d12b3ebadbf550ecb72ccde2845951e3e309ee
2023-01-23 10:39:37 +00:00
arehbein fd6b81a042 vty: Add check against sensible default value for Ny1
Related: OS#5475
Change-Id: If3f96a6bd4f9ae32b6421de43c1c5a5d64482089
2023-01-23 09:59:36 +00:00