Commit Graph

3030 Commits

Author SHA1 Message Date
Oliver Smith a023df5c7f gitignore: add vty pdf
Change-Id: I8653d5521680bb6ac2b32371b5428263082bc7f3
2023-03-10 10:18:41 +00:00
Pau Espin a21545e374 pcu_sock: Submit all DATA.ind regardless of link quality
osmo-pcu requires to get DATA.ind for all FN/TS it manages in order to
tick its internal FN clock and trigger timeouts. Without this, some
events are ticked in a delay fashion when osmo-pcu detects FN jumps.

Change-Id: I8f1856dd9061c1bfca8b15be30df7a51760231b0
2023-03-09 17:52:53 +00:00
Pau Espin 72f991f541 bts-trx: Fix no NM Radio{Carrier,Channel} switching to Enabled if one TRX is rf_locked
Differentiate in each TRX between being provisioned (configuration available) and being provisioned *plus enabled*.
TRX0 waits for all other TRX to be ready before sending POWERON, since
all TRX need to have been minimally configured over TRXC before POWERON
is called. This "ready" state though, doesn't necessarily mean the
TRX!=0 are enabled (aka NM Enabled and rf_locked=0). With them being
configured it es enough to start the whole PHY.

With the old logic, given any TRX was rf_locked=1 at startup, the PHY
would not become UP because it the TRX_PROV FSM was waiting for OPSTART
to arrive on all TRX, which wouldn't happen on TRX that had rf_locked=1.

So in summary, the desired requirements to start the PHY are (in any
order):
1- Wait all TRX are configured
2- Wait for TRX0 OPSTART

Related: SYS#6370
Change-Id: Ie4836f5721ce8227a63c267730aeb17228994214
2023-03-09 11:27:51 +01:00
Philipp Maier a981e28128 pcu_sock: do not mess with the osmo fd flags directly
When we disable the old socket connection, let's use
osmo_fd_read_disable().

Change-Id: I6b6854e9881c79b5c4794bde4ba4f6841dd06386
2023-03-07 14:09:53 +00:00
Vadim Yanitskiy c48b4651a1 GSMTAP: print 'gsmtap-local-host' if not NULL
Change-Id: If4f5a419b5af3f185219a879dcb2abb4eea45f1c
Fixes: f19f5331 "GSMTAP: allow configuring local address"
2023-03-07 20:32:36 +07:00
Vadim Yanitskiy fa109255ac osmo-bts-{trx,virtual}: set rc on error in bts_model_l1sap_down()
Change-Id: If3016bae9d03a9972c04b748fc9efab56a412e0e
Related: OS#1572
2023-03-07 09:43:21 +00:00
Vadim Yanitskiy 69bca44a84 osmo-bts-{trx,virtual}: check lchan against NULL in bts_model_l1sap_down()
Even though it's unlikely, get_lchan_by_chan_nr() *may* return NULL.

Change-Id: I1a815c9675eebc16640b62308499dd784fc206bd
Related: OS#1572
2023-03-07 09:43:21 +00:00
Vadim Yanitskiy 54840a203b osmo-bts-{trx,virtual}: clean up bts_model_l1sap_down()
Having a common body for PRIM_INFO_{ACTIVATE,DEACTIVATE,MODIFY},
but then branching using if-statements is a bit confusing.

Change-Id: I915c8a541249249e3c0b1f2eda4535e7c52db79f
Related: OS#1572
2023-03-07 09:43:21 +00:00
Philipp Maier 66bcdd839c pcu_sock: cosmetic: remove unnecessary line breaks
Change-Id: I8cb2979c62ebb05d06af49b40b145b7dee826cb1
2023-03-06 12:43:50 +01:00
Philipp Maier cc13ea8b66 pcu_sock: cosmetic: remove whitespace after type cast
Change-Id: I373b510efab4874f59f75385bd0e1229692299ec
2023-03-06 12:26:46 +01:00
Philipp Maier bdc438299b pcu_sock: rename rc to fd
The variable rc holds the return code of accept(), which returns a file
descriptor on success. So lets call the variable "fd" to make this
clear.

Change-Id: Ibc359d941786b1d1d52b356e239a76a090b52c1f
2023-03-06 12:23:08 +01:00
Max f19f533139 GSMTAP: allow configuring local address
Change-Id: If047cbaf95b343ee115690bf7a724a8edc5df735
2023-03-04 11:24:37 +00:00
Max af9466159e osmo-bts-trx: use bool for true/false flags
Change-Id: Iaa97dc36e92797db5f348e0bb79d2191ca0a58b5
2023-03-04 11:18:42 +00:00
Max 633c09ee50 osmo-bts-trx: log TRXC/TRXD connection address
Change-Id: Id53c1dd58b95c45f261fa9bfae16cc53b20edd18
2023-03-04 11:18:42 +00:00
Vadim Yanitskiy dfe96b786f paging_add_imm_ass(): remove meaningless from_pcu argument
A request to send an Immediate Assignment over the PCH (not AGCH)
is always coming from the PCU.  It's used for DL TBF assignment.

Change-Id: If4b0aa01532ab65b96201ff8829e724c67df6993
2023-03-01 03:01:46 +07:00
arehbein d28ce3287f doc: Adapt to use of 'telnet_init_default'
Related: OS#5809
Change-Id: I1ae5a7169d864e5dbd052437addd167ffa2c510d
2023-02-25 02:04:18 +01:00
Max 495cf39cb9 bts-virtual: fix segfault
Premature activation of virtual scheduler in bts_model_phy_link_open()
leads to segfault in vbts_sched_start(). Fix this by moving scheduler
activation to bts_model_oml_estab()

Change-Id: I116c2548dd4d05df90c16e81fa2e85ed6027a2e1
2023-02-19 18:56:56 +03:00
arehbein 2f6e105956 common: Fix memleak in get_smscb_block()
Fix condition `block_nr == 4`, which was never reached, by effectively
replacing
 - `4` by `msg->num_segs`, so we truly check if the current
   block is the last of this message
 - the index `block_nr` (which starts at zero) by `block_nr + 1`,
   so it is comparable to `msg->num_segs`

Related: OS#5354

Change-Id: I3dc116d6c16c80b31712b2a969f0b2a6998b03f0
2023-02-10 19:56:53 +00:00
Pau Espin c66b812c16 Bump version: 1.5.0.64-7571-dirty → 1.6.0
Change-Id: Iaa207d4996a00befd99194c65fc6e6cd9dbaa340
2023-02-07 17:15:53 +01:00
Max 757180beba Add SI10 support
Related: OS#5783
Change-Id: I268ba716ded330a024a8f3c0d1bd2f28622cecab
2023-02-01 11:12:32 +00:00
Philipp Maier f1b7ee6a63 pcu_sock: use ARRAY_SIZE rather then magic number
Lets use ARRAY_SIZE instead of magic number (8) to determine the
number of timeslots to iterate.

Change-Id: I0e016e6fff420851dfabebef5d8d43c735b968b2
2023-01-31 18:12:27 +01:00
Pau Espin 809879daae vty: Fix typo in symbol name
Change-Id: Ib33ffba348d6e9414eb904bfb7a2bd7ba2f55344
2023-01-30 14:19:52 +01:00
Oliver Smith 0701788724 contrib/jenkins: build libosmo-abis without dahdi
Looks like this is not needed, so make the jenkins build work without
installing dahdi-source.

Related: OS#5863
Change-Id: I61c483983a4793e0429bb37804dee0a128125daf
2023-01-18 14:29:54 +01:00
Pau Espin 0336b6e8e5 vty: Fix typo in write-config: osmux / local-port
The VTY command is "local-port", but write-config would write "port"
instead, which would fail when re-reading the config file.

Realted: SYS#6237
Change-Id: Id08530b626b0e69c3b3bb9d8bb9e16080a73e74d
2023-01-03 16:30:09 +01:00
arehbein a743ae1c1e osmo-bts: Transition to use of 'telnet_init_default'
Related: OS#5809
Change-Id: I2da7d7bf2b07b6736ab09a11ec37afc12f5ec075
2023-01-02 23:08:32 +00:00
Max 6a6a47f554 ctrl: take both address and port from vty config
Change-Id: Ieca05004255c40287e6427560c2636b39529cf07
2022-12-22 09:40:08 +00:00
Daniel Willmann 63baf960c6 shutdown_fsm: Add power_ramp_force() to jump straight to the tgt power
Both power_ramp_start() and power_ramp_force() are now small macros
around _power_ramp_start()

The new behavior is:
* ramp down power when stopping bts through Ctrl-C
* the other shutdown causes skip power ramping

This will cause the bts to reconnect faster when the oml link is
dropped and power ramping is enabled.

Change-Id: Ida1d7bbf094958b9142af306dbf84206729a609e
Related: SYS#6237
2022-12-21 23:51:51 +00:00
Oliver Smith 7377344771 oc2gbts_mgr_calib: fix build against gpsd >= 3.20
Fixes: OS#5832
Related: https://gitlab.com/gpsd/gpsd/-/blob/release-3.20/gps.h#L63
Change-Id: I6dc8ce303e5cb0fb412857a7f2c925e8cfe9b1e0
2022-12-21 10:43:48 +00:00
Alexander Couzens c8e2b021a9 OML: NSVC[1] MO should have the same initial state as NVSC[0]
There is no reason why they should have different initial
states. Keep it consistent with the other MOs.

Change-Id: I9fd744ec79da9fc26d3ebe9857b2b0bbd5fcd1ff
2022-12-19 22:01:45 +01:00
Daniel Willmann 300b72b44c Revert "shutdown_fsm: Only ramp down power when stopping bts through Ctrl-C"
This reverts commit c96d34f828.

Reason for revert: This breaks ramping up power since the power ramp logic still assumes the output is full power.

Change-Id: I47a16a4b3ba02d74473569c0f4350a41fc12a464
2022-12-17 13:21:17 +00:00
Daniel Willmann c96d34f828 shutdown_fsm: Only ramp down power when stopping bts through Ctrl-C
For the other shutdown causes power ramping doesn't make sense. Instead
shutdown quickly so we can reconnect faster

Change-Id: I71c46478b8f3b236dba3e959fc75e58c0409517f
Related: SYS#6237
2022-12-15 11:26:22 +01:00
Philipp Maier c2261bb62e pcuif_proto: use define constant to specify nax number of trx
The array of trx in gsm_pcu_if_info_ind can hold trx 8 items. Lets use a
define constant to specify the size of that array.

Change-Id: I5fdd5b9e59865fabd0340650ecb347d52208ebe9
2022-12-14 12:43:50 +01:00
Philipp Maier 82d92f703a l1sap: remove unused pointer variable
The pointer variable l1sap is only used to determine the size of the
related struct but for nothing else.  We can use the struct name in
sizeof also directly and get rid of it.

Change-Id: I93abdce1dec60d53ddceb1fce6e9e7451ba6283a
2022-12-08 17:02:13 +01:00
Philipp Maier ffe2b28c9b sched_lchan_tchf: replace numeric constant with define constant
An RFC 5993 HR GSM payload is 15 bytes long. That is GSM_HR_BYTES + 1

Change-Id: I7008ba7e50562e9366fd9ecc97e2e22fad4aa641
2022-12-08 17:02:05 +01:00
Pau Espin 5b9a5f569a osmux: Use new osmux_xfrm_input API to set name on each link
Change-Id: Iaea980a2e11282add12f9af585500d90f0462279
Depends: libosmo-netif.git Change-Id 8bb688e4827f345416c2a4526ced956a07fcc60b
2022-11-21 10:51:33 +01:00
Pau Espin 035080e4f4 osmux: Rotate over available Osmux CID when allocating a new one
Before this patch, the free CID with the smallest number was always
selected to be used. This caused more or less the same subset of CIDs to
be used all the time, while the CIDs with bigger numbers were mostly
unused.
Let's distribute the use so that all CIDs are used roughly the same.
This has the advantage, among others, that the same CID will not be
re-used immediatelly after being freed if a new call is established.
It is useful to leave the CIDs unused for some time since the other end
peer may know of the call being tear down with some delay.
Hence if a new call is established immediately after the CID was
released, the same CID would be allocated and passed at the peer, which
would then detect that the old call (in its view still active) would
already make use of that remote CID.

Related: SYS#6161
Change-Id: I72803fb172accbabfc81923572890f8ecb06cefd
2022-11-15 18:10:14 +01:00
Harald Welte a590b1a15a update outdated vty copyright statement
Change-Id: Ia12a012c229f883286e96a90132adcc5e8c0c5da
2022-11-11 18:22:45 +01:00
Max eba8816d51 Update realtime scheduling priority in service file
Related: OS#5687
Change-Id: I64a8c1e9c5b4ca7b51956d195964124d3a8ef768
2022-11-06 12:49:28 +00:00
Vadim Yanitskiy 8ec66a7f58 osmo-bts-trx: drop ul_amr_fn_is_cmi() / dl_amr_fn_is_cmi()
The scheduler is now using the lookup tables instead of these
functions.  The only part using them is the AMR unit test.

Change-Id: I1a9c80dd12252e7befe9c9bc8e8f7ee8648b5465
2022-11-01 01:09:20 +07:00
Vadim Yanitskiy c33ff98d39 osmo-bts-trx: use lookup tables for checking AMR CMI/CMR on Downlink
Change-Id: I75ecf5369f31c8b8e9519d2b580355fa80c24196
2022-11-01 01:04:25 +07:00
Philipp Maier aa8779b824 pcuif_proto: cosmetic: add constant PCU_IF_NUM_NSVC and replace magic numbers
The number of NSVCs is fixed but lets not use magic numbers to define
the sizes of the arrays that hold the config values. In osmo-pcu there
is already a define constant, so lets use a define here as well.

Change-Id: If7fa44abb86c18900110d7ee81fe6140c8c4635b
2022-10-31 10:22:17 +00:00
Pau Espin 764820e742 osmux: Fix null ptr dereference sending UL data before the remote is configured
Related: SYS#6161
Change-Id: I5d7971c0ed9b22d35d8965af54031a43c6388762
2022-10-29 01:06:27 +02:00
Keith Whyte 77fd0a589c osmo-bts-trx: respond to tx-attenuation config in real time.
Some osmo-bts varieties have a method to make an immediate change to
TX power from the vty. In osmo-bts-trx there does not seem to be any
way, so lets start the power ramp loop when the parameter
osmotrx tx-attenution is changed on a running TRX.

Change-Id: I1fa5e8130202fb509593db4132863b762b0f40b7
2022-10-13 14:34:15 +00:00
Philipp Maier ea35b26b35 rsl: use unsigned int
The parameter l3_len in rsl_tx_meas_res() is defined as int, even though
it can't be negative. Lets use unsigned int for l3_len.

Change-Id: I99068a36e74a557000f406154dce32300615086c
2022-10-12 18:20:14 +07:00
Philipp Maier 59e147e7ad l1sap: do not call msgb_l2hlen without checking
We request the length using msgb_l2len() in two locations where whe
cannot be sure that l2h is populated. Lets check this first.

Change-Id: Ie13d0724f183ff240714dcdbd24e5a21b4276bfe
Related: OS#5645
2022-10-12 18:19:25 +07:00
Philipp Maier 0087a1137e measurement: do not call msgb_l3len without checking
The function lchan_meas_handle_sacch() calls msgb_l3len without checking
if l3h is even populated. Lets add a check to be sure.

Change-Id: Ie5a9fe1ba880e68edb74f5f4ca559ac191330d4f
2022-10-11 11:45:14 +02:00
Vadim Yanitskiy 2950c0363d osmo-bts-trx: handle MTS 0b0110 indicating an Access Burst
The PCU may poll the MS requesting an ACKnowledgment message to be
sent in form of four Access Bursts instead of Normal Bursts.  The
BTS has no prior knowledge of the Uplink burst type, so a new MTS
value was specified in order to prevent the BTS from trying to
decode Access Bursts as a PDTCH block.

This patch implements parsing of the new MTS value 0b0110.
Signalling RACH.ind to the PCU is to be implemented.

Change-Id: I0fbb63006797e6be386d1f76ed97fff098c036fc
Related: OS#4006, SYS#4794
2022-10-04 16:33:10 +00:00
Vadim Yanitskiy 493ff0000b osmo-bts-trx: rx_rach_fn(): properly detect handover RACH
Checking if (bi->chan != TRXC_RACH) is not enough to detect HANDOVER
ACCESS.  Receiving this message is only possible on CS channels.

Change-Id: Ice1674fd4fed8c54d605ff19d568f6e46b4c5783
2022-10-04 14:57:57 +00:00
Pau Espin 8396471638 osmux: Close osmux socket when bts is freed
Related: SYS#5987
Change-Id: Ibd3faa33b28d45048c340b177f13d5685f41a784
2022-10-04 16:12:38 +02:00
Pau Espin 0db38d6521 osmux: Skip lchans in lookup which still have no remote associated
Lchans which are marked as non-connected have not yet received
information about its remote peer, hence they may not have some fields
available yet. Let's skip them to avoid accessing such fields
(lchan->abis_ip.osmux.in).

Related: SYS#5987
Change-Id: Id53822c4a0486b0090df2db3d185e047d14fc90a
2022-10-03 18:54:11 +02:00