Commit Graph

182 Commits

Author SHA1 Message Date
Harald Welte 2ae45aba3f ASCI: VGCS/VBS RACH -> RSL TALKER/LISTENER DETECT
Random access is allowed on VGCS / VBS channels to access the uplink or
to detect listeners. Uplink Access from a listener is only reported once
after activating the channel. Uplink Access from a talker is reported
each time the uplink becomes occupied. RSL TALKER/LISTENER DETECT
messages are sent to the bsc.

The VGCS UPLINK GRANT message is sent by the BTS itself. Timer T3115 is
used to repeat the message up to NY2 times until one valid frame is
received from the MS (CM service request). The UPLINK BUSY / UPLINK FREE
message must be sent by the BSC.

The uplink is released by UPLINK RELEASE message from the MS or from the
BSC. Afterwards the UPLINK FREE message causes the MS to leave the
uplink without any acknowlege. An RSL REL-REQ must be used to terminate
the link locally. (Without layer 2 DISC procedure.)

Change-Id: I1bd07ab6802341b09a06e89df356665ffaf6d2bf
Related: OS#4851
2023-07-21 10:52:07 +00:00
Vadim Yanitskiy dfd6224484 oml: gsm_objclass2{mo,obj}(): set cause for unknown obj_class
This patch makes BTS_Tests_OML.TC_wrong_obj_class pass.

Change-Id: I30e109a7c86e651fb7055a80ef0656d8563475c8
Fixes: OS#5966
2023-05-01 23:59:06 +07:00
Vadim Yanitskiy 8b535ee77a oml: gsm_objclass2{mo,obj}(): cosmetic: return immediately
Change-Id: Ie2fb927ac7f71103a1e0e693718771dd36139223
Related: OS#5966
2023-05-01 23:59:06 +07:00
arehbein cf8736e916 gsm_objclass2obj(): Change signature/set NACK cause
- Add out-parameter to enable returning a NACK cause (ignored if NULL)
 - Return appropriate NACK cause if TRX number is unknown (fixes OS#5967
   together with change I37e6b23ed95260a8188910cf9754faffcba519c5)

Change-Id: If734ea2c8cae4c1f99b02520dffa4e3862a67745
Related: OS#5961, OS#5967
2023-04-29 02:51:12 +07:00
arehbein 204cd4d7e3 gsm_objclass2mo(): Change signature/set NACK cause
- Add out-parameter to enable returning a NACK cause (ignored if NULL)
 - Return appropriate NACK cause if TRX number is unknown (part of fix
   for OS#5967)

Change-Id: I37e6b23ed95260a8188910cf9754faffcba519c5
Related: OS#5961, OS#5967
2023-04-29 02:51:12 +07:00
arehbein a4a9c28f15 common: Remove unused function gsm_objclass2nmstate()
Change-Id: Ia538e3f3d416408f69f9d8e6c8c746eddd9f005a
2023-04-28 12:21:15 +00:00
arehbein b96d975f7d common: Remove redundant checks
Remove checks that are performed in gsm_bts_trx_num() already.

Related: OS#5961
Related: OS#5967
Change-Id: I9f21f1a0a9dab897d4fd89ab6b7341ca4aec8b22
2023-04-20 23:17:45 +00:00
Pau Espin 8a21e7c27a oml: Fix potential null ptr access on trx object
If the TRX_NR had no matching TRX it would access a NULL pointer trx
after failing to resolve it.
This commit refactors the code path to only require the trx pointer at
the very end, and NACKs the message if TRX fails to be resolved.

Change-Id: If27639ae1727fc5232e1a964a1b29f50c8805d80
2023-04-11 15:47:47 +02:00
Pau Espin 7cd45a7cfe Move GPRS NSE under BTS SiteMgr
As per ipaccess expectancies and following TS 12.21.

Change-Id: If44d8f256cab7b2660900cedfb0ed9fe67eb3420
2023-04-11 11:15:07 +02:00
Pau Espin 6be13437b7 Merge gsm_network into gsm_bts_sm and place gsm_bts under it
This way the data model in TS 12.21 (Figure 1) is followed, where
there's a BTS Site Manager containing one or more BTS. In our case we
only support 1 BTS (cell) so far.

Change-Id: Ideb0d458ec631008223f861cf8b46d09524a1a21
Related: OS#5994
2023-04-11 11:11:45 +02:00
Pau Espin 66543fe422 Introduce NM FSM for GPRS NSVC object
Change-Id: I684482064136a461d01cace3cd37afc8b68458cc
Related: OS#5994
2023-04-11 08:11:43 +00:00
Pau Espin 9c4b472179 Move NSVC structs to be part of NSE
The NSVCs exist inside an NSE. Rearrange data model to have proper
relations.

Change-Id: I1cfe9366594836c622673d461ab8b2edd1a2b58a
2023-04-06 10:28:22 +00:00
Pau Espin d50d239914 Introduce NM FSM for GPRS Cell object
Change-Id: I5fd1d17da09a5f0eee3d69fcb4788c106a240e21
Related: OS#5994
2023-04-06 10:28:22 +00:00
Pau Espin 633bbf174a Introduce NM FSM for GPRS NSE object
Related: OS#5994
Change-Id: I01eadc63214a2eb5e1bce455c7e5b62bd41905ea
2023-04-06 10:28:22 +00:00
Pau Espin cea6c230ad nm: Apply OPSTART through NM FSMs
This way we have further control on how to handle the OPSTART messages
received. For instance, NACK them if the NM object FSMs are not at the
expected correct state.

Related: OS#5992
Change-Id: I5df0bfb4cc812c11c7a00a8ffa882ae1915d562f
2023-04-06 10:28:22 +00:00
Pau Espin 8894fe6f4c oml: Get rid of unused tlv_parsed param in bts_model_apply_oml()
This way we simplify the common lower level interface. It can be added
in the future again if it is really required at any point to pass/use
specific TLV values in the device-specific code.

Change-Id: I64c6c6834e277b1d75a97d6f408e7e1b7ca85832
2023-04-06 10:28:22 +00:00
Pau Espin c4a17d35ec nm: Apply BTS/TRX/TS OML Attributes through NM FSMs
This way we have further control on how to handle the SetAttr meessages
received. For instance, NACK them if the NM object FSMs are not at the expected
correct state.

The originating msgs are now kept owned and freed by the OML layer
(oml.c), and the NM FSMs only uses them and create new OML msgb when
answering with ACK/NACK.

Related: OS#5992
Change-Id: Id68868e25bbf96227ab6459fcd3c9181852ed28e
2023-04-05 13:21:14 +02:00
Pau Espin c12bc93db8 oml.c: Remove dot character at the end of log lines
Change-Id: Iaf061bb752f9808a6ab31049b9e87920a6b07f3d
2023-04-05 13:10:05 +02:00
Pau Espin 914e55caf3 Clarify configuration of TSC on each timeslot
Related: OS#5856
Change-Id: Ief21daf63ba76725de9117cbe14ada8b75f147df
2023-04-04 12:50:20 +02:00
Vadim Yanitskiy 4b3fe16200 oml: assign unique names to 'struct tlv_parsed' chunks
Change-Id: Ie248d2a65a11da914324a7e65b767b894ed8644a
2021-12-12 16:22:48 +03:00
Vadim Yanitskiy 1475a45492 oml: fix copy-pasted comments in oml_rx_set_*_attr()
Change-Id: Iaa0e630b28b2a86312c069e7e55dd8bc5743759a
2021-12-12 16:22:30 +03:00
Vadim Yanitskiy 1d9106d768 oml: use ts->trx as talloc-context in oml_rx_set_chan_attr()
Change-Id: I6dc3706a486726afa9eec5d2e5369bd62c511455
2021-12-12 16:14:36 +03:00
Vadim Yanitskiy 4275bf7232 oml: use proper talloc context in oml_rx_set_radio_attr()
Change-Id: I69b6c72d85f68e4225d7786646f24259a5964998
2021-12-12 16:07:41 +03:00
Vadim Yanitskiy b9fcb85a29 oml: use ARRAY_SIZE() in oml_rx_set_bts_attr()
Change-Id: I89dab55e39fe49c8b4d3afb4b46d1b7f2bf3663c
2021-11-11 09:01:15 +00:00
Pau Espin d17beeacde bts-trx: Delay power ramp up until RCARRIER is ENABLED
Prior to this patch, the power ramping started when the PHY is
available, but that doesn't necessarily mean the RCARRIER is enabled.

Due to this, it was spotted a situation where BTS bootstrap failed after
PHY turning up, when RSL connection establishment failed. Hence
bts_shutdown_fsm triggered a shutdown while an active power ramping up
was ongoing...

Change-Id: I17208b74ea2649b1bbb717aee0aa355e42b7e860
2021-09-30 13:14:08 +02:00
Pau Espin 2e90e0f756 Avoid sending Load Indications when BTS is not RSL-connected
Change-Id: I97e8dd7dd58ee2ec90c3a38d45dfd944db44c412
2021-09-23 14:07:53 +02:00
Pau Espin ea53ad454e Allow setting administrative state through oml_mo_state_chg()
This way it can be changed together with operative/availability state,
and changes announced to the BSC if present.

This commit presents no real change in osmo-bts behavior, since the only
place where adm_state is passed different than -1 is in
st_op_disabled_notinstalled_on_enter(), which is actually never called
(yet) since it's the initial state and no other states transition later
to it.

However, this will change in the future once we support re-connecting to
a (possibly different) BSC, which means objects will need to be moved to
that state to restart the whole OML install procedure on the new BSC.

Change-Id: Ifdc6a1dfb673c0ab915ddf2a9d372928f4f86b4c
2021-09-20 12:22:53 +02:00
Pau Espin a4b9073989 Rename osmo dyn ts enums to contain SDCCH8
They will gain support to be activated as SDCCH/8 soon too.

Related: SYS#5309
Depends: libosmocore.git I56dcfe4d17899630b17f80145c3ced72f1e91e68
Change-Id: Ia617d20fc52f09dbab8f4516c06fa1efac08e898
2021-07-05 08:03:08 +00:00
Vadim Yanitskiy 64e1c1222e oml: fix handling of NM_ATT_INTERF_BOUND attribute
Looks like this part of the code has never been tested.  The old
code would dereference the same value in the loop and assign it
to all members in array 'bts->interference.boundary'.

Change-Id: I7f83d8e6eb6cc19e3e9529ba06617a902de23e35
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy fc8c9880d9 conf_lchans_as_pchan(): initialize all lchans with GSM_LCHAN_NONE
This function is called during the OML bootstrapping, and also
when a dynamic timeslot switches between PDCH and TCH/{F,H}.
In the later case, after switching from TCH/{F,H} to PDCH, some
lchans might still have the old type assigned.

Let's ensure that all logical channels are properly updated.

Change-Id: I44726f2bfb979c2fa2f5f30c5b11700cf4b3399d
Related: SYS#5313, OS#1569
2021-06-08 02:04:53 +02:00
Vadim Yanitskiy 628853de74 conf_lchans_as_pchan(): fix GSM_LCHAN_{CCCH->CBCH} regression
This regression was introduced (by me) in [1] and broke CCCH.

Change-Id: I403ad06574a8505b69dd06781f7fe0f7cabf416f
Fixes: [1] I1c5a033e89d9ca5fb01ebe9ffb521fd67d159bee
Related: SYS#4895, OS#4941
2021-06-08 01:53:14 +02:00
Vadim Yanitskiy 0686ae6128 [VAMOS] Implement the concept of 'shadow' timeslots
Change-Id: I48b44b4df9ffb1cca105aebbd868c29b21f3b1d6
Depends: Ia0bd8695a3f12331b696fe69117189cdd48b584d
Related: SYS#4895, OS#4941
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy d9daa3fd9e [VAMOS] conf_lchans_as_pchan(): improve readability
Change-Id: I1c5a033e89d9ca5fb01ebe9ffb521fd67d159bee
2021-06-05 00:34:36 +02:00
Vadim Yanitskiy 069796bcd8 [VAMOS] oml_rx_set_chan_attr(): clarify NM_ATT_CHAN_COMB handling
Change-Id: I8a4aace97515ca59ac4c6b5d50a9ee242edfe409
2021-06-04 20:04:13 +00:00
Vadim Yanitskiy dd3b7d469e [VAMOS] common/oml: generalize checking BTS_FEAT_MULTI_TSC
Change-Id: Iaa5aced70e166963106c27ebdb09adaae22daea4
Related: SYS#4895, OS#4941
2021-06-04 20:04:13 +00:00
Vadim Yanitskiy 207d56afe5 [VAMOS] osmo-bts-trx: rework handling of Training Sequence
The TSC (Training Sequence Code) value in 'struct gsm_bts_trx_ts'
is always initialized in oml_rx_set_chan_attr() during the OML
bootstrapping, so there is no need for gsm_ts_tsc() - remove it.

Store the initial TSC value in 'struct gsm_bts_trx_ts', so we can
apply a different TSC value during the RSL CHANnel ACTIVation.

Store the Training Sequence Code/Set in 'struct trx_dl_burst_req'.
These values are indicated to the transceiver (TRXDv2 PDUs, 'MTS'
field) and used by the new TRX_{GMSK,8PSK}_NB_TSC macros.

Change-Id: I3744bc308b99ef941e6e9d139444e414abebc14b
Related: SYS#4895, OS#4941
2021-06-04 20:04:13 +00:00
Vadim Yanitskiy d4abdd80fe [VAMOS] gsm_data.h: introduce and use BTS_TSC macro
Change-Id: I0cf915d2d3a640aa1442cf6abe9a314261b4a64e
Related: SYS#5315, OS#4940
2021-05-23 10:09:27 +00:00
Vadim Yanitskiy dabe5d0327 oml: ensure that IPA RSL Connect ACK/NACK contains all IEs
All IEs in the BSC originated message are optional, so we assume
default values for them.  Let's reflect them all in the ACK/NACK.

Change-Id: I5c73e83daad0cea07b9cb674c393e0bfc6268a61
Related: OS#3791
2021-02-10 15:06:54 +00:00
Vadim Yanitskiy 522a33fe82 oml: reuse the given msgb in oml_fom_ack_nack()
This would allow to compose ACK/NACK messages with additional IEs
not present in the original message.  Also, this change basically
eliminates unnecessary msgb_copy() / free().

Change-Id: I17f61636e9a144017e2c46b1540d152c21529391
Related: OS#3791
2021-02-10 15:06:54 +00:00
Vadim Yanitskiy bb04495251 oml: use regular TLVP_PRES() in rx_oml_ipa_rsl_connect()
Both NM_ATT_IPACC_DST_IP and NM_ATT_IPACC_DST_IP_PORT are defined
as TLV_TYPE_FIXED, and NM_ATT_IPACC_STREAM_ID is TLV_TYPE_TV, so
the TLV parser already does check the length for us.

Change-Id: I1e493e552bb22bb42bb196ce71214e28d23fd19e
2021-02-07 03:40:32 +00:00
Vadim Yanitskiy 187effa00d oml: make 'struct tlv_parsed' pointer const where possible
Change-Id: I077f5aba50cc4d1a86feff527784de07394c5c0a
2021-02-07 03:39:53 +00:00
Vadim Yanitskiy fe45b4eb1f oml: avoid redundant ntohl() / htonl() conversion
Change-Id: I2ae84dcd2987ff0cee5ca06ced06e65a30847a81
2021-02-07 03:39:53 +00:00
Vadim Yanitskiy f7afeb1fa9 oml: cosmetic code style changes in rx_oml_ipa_rsl_connect()
Change-Id: I2841e15865596bbb24cfe1f27691404514d3b6f0
2021-02-06 15:14:05 +01:00
Pau Espin 4d7c6ad860 oml: Set NM_OPSTATE_DISABLED by default
Otherwise, some objects are announced at startup of osmo-bts towards BSC
during State Changed Report as being "NULL".

According to TS 12.21:
"NULL(Operat. state not supported) FF"

Which doesn't make much sense in startup situation. They are in known
state Disabled until they are OPSTARTed.

Change-Id: I5ba6756ea069d0f995f453ee4b27e6839c914eb1
2020-10-21 18:32:08 +02:00
Pau Espin ca5d1e6ba6 Drop unused param in oml_init()
Change-Id: I96d8359f4ae13c9f47cc87d87fde6d2047169a49
2020-10-13 08:54:36 +00:00
Vadim Yanitskiy 74750fe2b0 oml: fix handling of NSVC local port in oml_ipa_mo_set_attr_nsvc()
This is another regresion introduced by [1].  Both local and remote
port numbers recived in the network order, and must be stored as-is.

Change-Id: I3c21a2c27dcbf6de728ce2c7ccbae9e2f517c450
Fixes: I310699fabbfec4255f0474f31717f215c1201eca
Related: SYS#4915
2020-10-08 20:50:07 +00:00
Alexander Couzens 9096461507 OML: correct parse the NM_ATT_OSMO_NS_LINK_CFG field address_family
The address_family is 8 bit and have a padding byte afterwards.
By using osmo_load16be it's encoding it wrong and result in an
empty/invalid NSVC configuration.

Change-Id: Ie070b5745124d48e74a6dedd8903b74bfb3ce9d2
2020-10-08 00:33:33 +02:00
Alexander Couzens 650a0c31a7 Introduce the new OML NM_ATT_OSMO_NS_LINK_CFG to configure IPv6 NSVC for PCU
With PCU interface version 10 it supports IPv6 NSVC. The new OML IE
NM_ATT_OSMO_NS_LINK_CFG allows to configure IPv6 NSVC.

Change-Id: I310699fabbfec4255f0474f31717f215c1201eca
2020-10-06 11:36:45 +00:00
Harald Welte 90e0c205b5 bts: Add VTY command to manually override Radio Link Timeout
There are some situations where it is useful to be able to change the
Radio Link Timeout at runtime, without restarting the BTS.

This adds a new (hidden) command for this:
	"bts <0-255> radio-link-timeout (oml|infinite|<4-64>)"

Change-Id: I64674a432cf7751b16d5d0b52f66766fa6e37028
2020-10-05 18:23:06 +02:00
Vadim Yanitskiy 0cd8df2184 gsm_data: rename hopping.{ma,ma_len} to hopping.arfcn_{list,num}
MA (Mobile Allocation) is actually a bit-mask indicating those ARFCNs
of the Cell Allocation, which must be used as the hopping sequence.

What we store in struct gsm_bts_trx_ts is the actual list of hopping
channels, so let's name it properly and eliminate possible confusion.

Change-Id: I677d66e428fa0fe119ebc37bc2a4e6cc05c251c4
2020-09-17 15:45:48 +00:00