Commit Graph

562 Commits

Author SHA1 Message Date
Pau Espin 3871c1ff0c Decouple handling of Measurement Report from lapdm
This is a preparation commit in order to move power loops up in the
stack in order to have DTXu information available, in order to decide
whether SUB or FULL ul measurements should be used in the MS Power
Control Loop.

Function rsl_tx_meas_res() is stripped from code changing state, and it
simply encodes content and transmits the message.

Change-Id: Id67259ec9ac4c2c33bd0eef3f64450affbe3fb9f
2021-09-28 12:02:03 +02:00
Vadim Yanitskiy d6ef2bf12f osmo-bts-trx: implement Temporary Overpower for SACCH/FACCH
GSM/EDGE Evolution and Performance, Section 12.3 suggests Temporary
Overpower as another solution to improve SACCH/FACCH performance in
case of bad C/I. The idea here is that you increment the DL transmit
power by 2..4dB only for FACCH/SACCH bursts, while keeping all voice
bursts at the lower (normal) level as determined by BS power control.

SACCH blocks can be recognized by the channel type, since they're
always transmitted in specific frames of a multiframe.  FACCH blocks,
however, are not predictable and can substitute voice blocks at
(almost) any time.  Thus we need to mark FACCH bursts as such in
the logical channel handlers (using TRX_BR_F_FACCH).

Change-Id: Ie8a626fefccf1eb07271058e5126ec106cb1abcf
Related: SYS#5319
2021-09-27 16:02:26 +00:00
Vadim Yanitskiy e51fb333ae gsm_lchan2chan_nr(): separate RSL specific variant of this API
The ip.access style dynamic timeslots are a bit special in a way that
on the A-bis/RSL we always use the Channel Number value of TCH/F,
even in PDCH mode.  This is why gsm_lchan2chan_nr() would always
return values corresponding to TCH/F for TCH/F_PDCH.

This behavior is only acceptable in the context of RSL messages, while
other parts of the code base may not work properly due to this trick.
A good example is the scheduler in osmo-bts-trx, where we have to
patch Channel Number value to make channel activation work.

  DPCU INFO pcu_sock.c:853 Activate request received: TRX=0 TS=5
  DL1C INFO l1sap.c:2043 (bts=0,trx=0,ts=5,ss=0) Activating channel TCH/F on TS5
  DL1C NOTICE scheduler.c:1097 (bts=0,trx=0,ts=5,ss=0) Activating PDTCH
  DL1C NOTICE scheduler.c:1097 (bts=0,trx=0,ts=5,ss=0) Activating PTCCH

In the code branch responsible for channel deactivation, we somehow
forgot to add the same workaround, so deactivation does not work:

  DL1C INFO l1sap.c:2076 (bts=0,trx=0,ts=5,ss=0) Deactivating channel TCH/F on TS5
  DTRX INFO trx_if.c:255 phy0.0: Enqueuing TRX control command 'CMD NOHANDOVER 5 0'
  DRSL NOTICE rsl.c:1286 (bts=0,trx=0,ts=5,ss=0) (bts=0,trx=0,ts=5,ss=0) not sending REL ACK

Because of that, TCH/F_PDCH timeslots actually remain active after
deactivation, so the scheduler keeps producing L1SAP DATA.ind.

  DL1P NOTICE l1sap.c:126 (bts=0,trx=0,ts=5,ss=0) assuming active lchan, but state is NONE
  DL1P ERROR l1sap.c:732 1583426/1194/00/29/14 No lchan for DATA MEAS IND (chan_nr=PDCH on TS5)
  DPCU NOTICE pcu_sock.c:973 PCU socket not connected, dropping message
  DL1P NOTICE l1sap.c:126 (bts=0,trx=0,ts=5,ss=0) assuming active lchan, but state is NONE
  DPCU NOTICE pcu_sock.c:973 PCU socket not connected, dropping message
  DL1P NOTICE l1sap.c:126 (bts=0,trx=0,ts=5,ss=0) assuming active lchan, but state is NONE
  DL1P ERROR l1sap.c:732 1583430/1194/04/33/18 No lchan for DATA MEAS IND (chan_nr=PDCH on TS5)
  DPCU NOTICE pcu_sock.c:973 PCU socket not connected, dropping message
  DL1P NOTICE l1sap.c:126 (bts=0,trx=0,ts=5,ss=0) assuming active lchan, but state is NONE
  DPCU NOTICE pcu_sock.c:973 PCU socket not connected, dropping message

Instead of patching Channel Number in various places, let's rather
make the RSL specific behavior configurable by having two variants
of gsm_lchan2chan_nr().

Change-Id: I01680140c7201bf5284b278bceaea8ae01c122b2
Fixes: OS#5238
2021-09-26 13:23:41 +06:00
Pau Espin e12f911bbb Revert "abis: Fix line leaked & recreated upon every reconnect"
This reverts commit bc6d35f52d.

Change-Id: I15063f0156ed8910795cd5ffe045e2d0cbca6276
2021-09-23 22:48:41 +02:00
Pau Espin bc6d35f52d abis: Fix line leaked & recreated upon every reconnect
Previous code creating a new line was really a workaroudn to have it
working while previous lines were being stacked internally inside
libosmo-abis.
Let's handle reference counts for the line properly and erase +
re-create it every time.
Recent patches to libosmo-abis fixed a crash happening when refcount
being 0 and destroying the object (object was not removed from a global
llist).

Depends: libosmo-abis Change-Id I1314d6b917ecb622994507475eb894e649a1a2ad
Change-Id: Ic37ae5bf657247e8cce99182c40d9adf890a5e41
2021-09-23 14:07:53 +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 37f63f12f7 bts_shutdown_fsm: Allow configuring FSM to shutdown without exiting process
This feature is not yet used by any bts_shutdown_fsm caller, but will be
used in the future when Abis link goes down.

Change-Id: I5dc282fdbcf862067be326e72b6183dd544222ae
2021-09-23 12:07:29 +00:00
Pau Espin dfedf2cb76 phy_link: Introduce bts_model_phy_link_close() and use it in bts-trx
This step is required while turning off the BTS without killing the
process. Right now only osmo-bts-trx supports this feature, so this
function is only available and used by osmo-bts-trx.
Later on, when the feature is support more generally, we can move call
to this function to common place like bts_shutdown_fsm or alike.

Change-Id: I3253112700a31b85db82dc7ccadec8542bac745e
2021-09-23 12:07:29 +00:00
Pau Espin ce9ec4963c bts-trx: Submit TRX SW_ACT when PHY becomes connected
Once the TRXC link is available, we can signal SW_ACT which will
transit rcarrier and bbtransc NM FSMs to Disabled Offline and announce
availability to be configured to the BSC through transmission of
Software Activated Report.

Change-Id: I6e62ec2fdd4cae58b52d83fa851552f7ed51c821
2021-09-23 11:09:15 +00:00
Pau Espin 68a39a8617 nm_*fsm: Make FSMs aware of object being properly configured or not
This will allow in the future advertising children objects that the
parent object has been configured. It is useful for instance to let TRX
know that the BTS is configured.

Change-Id: Ie319465fd0e991bab8451ea34ec72ff3702533d2
2021-09-22 12:56:58 +02:00
Pau Espin 5a2d8716ef abis: Drop internal OML msg queue
There's no real use for this queue. If the link is gone, it makes no
sense to keep old messages. Instead, BTS should generate new messages
sharing current state when link becomes established (it actually does
so already).

Change-Id: Iecd3c7cb96f5fff3b4c7e04c74e031df0f7a6987
2021-09-20 16:25:47 +02:00
Pau Espin 92186c672d nm_*_fsm: Move to state Disabled NotInstalled Locked when shtudown proc ends
Change-Id: I5c070adbba6b4abb19467a02d6449a443657ae2b
2021-09-20 16:25:47 +02:00
Pau Espin 43a4a1d5e7 nm_*_fsm: Set adminsitrative state 'shutting down' when shutdown procedure starts
Change-Id: I0d14840a55642812b865687a6cb208e7ffd22829
2021-09-20 12:22: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 3f7bd192a6 abis.c: Fix mess with priv->bsc_oml_host
The pointer was used as "struct bsc_oml_host" sometimes, and other times
as "struct llist_head". It just worked because bsc_oml_host->list is the
first item in the script. The code was really confusing, also because
the bts list of items has a name really similar to the one currently
assigned. Let's rename the currently assigned address to "current_bsc",
store it always as "struct bsc_oml_host*" and finally use llist_entry
helpers when needed.

The related code is also moved to a helper function to enclose there the
logic to get next BSC in list. This change actually changes the logic
where a remote address is removed from VTY, since now the next address
in list is picked at the time, and later when reconnecting the list is
forwarded another time, meaning one address will be skipped.
This could be considered a bug, but this situation is really special
and anyway the entire logic will be changed in new commits where we'll
keep reconnecting in loop without exiting when reaching the end of the
list, so we are fine with it. Think of this commit as a preparation
commit for next ones.

Change-Id: I3cc8a4148b3d63bc185b72dab8108105a6644910
2021-09-20 12:22:53 +02:00
Pau Espin 65c0341f3d abis.c: Transition to CONNECTED state only when OML link is up
This clarifies the different states and transitions between them:
OML LINK UP: CONNECTING->CONNECTED
ANY LINK DOWN: CONNECTING->CONNECTING, CONNECTED->FAILED
In follow up commits, support to reconnect instead of exit after the BTS
has already connected will be added, so only the last transition needs
to be changed.

Related: SYS#4971
Change-Id: I43e83b1b04fbaa1f87818c096e6ad3920801b1f6
2021-09-20 12:22:53 +02:00
Pau Espin bc7c8a42f3 abis.h: Drop unused state
Change-Id: I11173af3a543f6679ca9d43064bf071c214b1898
2021-09-15 16:17:37 +02:00
Pau Espin c81b41c62e Support configuring TA loop SACCH block rate
Similar to what is already provided for power control loops. However,
there's no existing way to communicate TA control parameters from the
BSC to the BTS, so implement them locally in BTS vty.

Related: SYS#5371
Change-Id: I9fa71f836bb9a79b0ef2567bfcfdf38ff217840b
2021-09-14 11:42:58 +02:00
Pau Espin c80abd109b MS Power Control Loop: Feed UL C/I from correct measurement period
As per 3GPP TS 45.008 sec 4.2, the ms_pwr received in L1 SACCH Header is
the value used over previous measurement period. Hence, we need to feed
the algo with the measurements taken over that same period.

Related: SYS#4917
Change-Id: I13c0014fdd73f823ae5b1256c35bfa7d97cfa334
2021-09-13 17:52:24 +02:00
Pau Espin 22a160bd24 lchan: Move TA CTRL param to its own substruct
Field is renamed to look similar to similar fields in power control
loop. This is a preparation commit, next one will add functionality to
skip SACCH blocksi (P_CON_INTERVAL).

Related: SYS#5371
Change-Id: I169ce58ab827e38b64f4b15f935097a9118fa118
2021-09-13 12:53:44 +02:00
Pau Espin f21b9231dd TA loop: Take into account UL SACCH 'Actual Timing advance' field
First step improving and reworking TA loop:
Move trigger of the loop to similar place done by BS/MS Power Control
Loop, that is, upon receivial of UL SACCH block, which contains
information about the TA used to transmit the block encode in L1SACCH
Header. Hence, from computed received TOA and TA used when transmitting
from the MS, we can infer the desired TA to be used by the MS, which
will send back to it later during DL SACCH block.

The values taken are actually the ones calculated for the previous SACCH
block and stored in lchan->meas.ms_toa256. That's because L1SACCH
contains the TA used for the previous reporting period, similarly to
what's specified for MS Power Control loop (TS 45.008 sec 4.2):
"""
The MS shall confirm the power control level that it is currently employing
in the SACCH L1 header on each uplink  channel. The indicated value shall
be the power control level actually used by the mobile for the last burst
of the  previous SACCH period.
"""
(The reader may observe that currently this is not properly done for MS
Power Control loop when calling lchan_ms_pwr_ctrl(): this is a bug.)

This new method also permits changing TA quicker, since we have more
confidence that the TA we request is aligned with the one used to
transmit, and we don't simply increment/decrement based on the value we
request to transmit.

Related: SYS#5371
Change-Id: I2d0f128c8dcac93ee382283a1c91fca76623b8fc
2021-09-13 12:25:32 +02:00
Neels Hofmeyr da7c56ab8e early IMM ASS: add configurable delay for RR IMM ASS
During live testing, it has become apparent that some IMM ASS still fail
when sending the RR IMM ASS directly upon the target channel becoming
active.

Add a bit of delay after activation, to give some time for the channel
to light up for the MS. Default is 50ms.

Related: OS#5559
Change-Id: Ia1e63b98944dc840cde212fc732e20277cdc5585
2021-09-11 13:10:33 +00:00
Pau Espin dd97023388 BS Power Control Loop: Support EWMA average algo for RxQual meas
params->rxqual_meas.upper_thresh is left unchecked in
lchan_bs_pwr_ctrl() on this commit on purpose, to keep this
commit with old behavior wrt to algo logic.

Change-Id: If7e3987df89d680cfa443195ab2f225681d0e6cf
2021-09-03 19:06:14 +02:00
Pau Espin 085a4cb91e MS Power Control Loop: Support EWMA algorithm for C/I measurements
Change-Id: I52eb0558fd7a215a6ee0b2aced189ae4a37d8a22
Related: SYS#4917
2021-09-03 19:03:48 +02:00
Pau Espin 0617afdb5f MS Power Control Loop: Take C/I into account
This commit extends existing MS Power Control Loop algorithm to take
into account computed C/I values on the UL, received from MS. The
related C/I parameters used by the algorithm are configured at and
provided by the BSC, which transmits them to the BTS similar to already
existing parameters.

Using C/I instead of existing RxQual is preferred due to extended
granularity of C/I (bigger range than RxQual's 0-7).
Furthermore, existing literature (such as "GSM/EDGE: Evolution and Performance"
Table 10.3) provides detailed information about expected target values,
even different values for different channel types. Hence, it was decided
to support setting different MS Power Parameters for different channel
types.

These MS Power Parameters are Osmocom specific, ie. supported only by
newish versions of osmo-bts. Older versions of osmo-bts should ignore
the new IEs added just fine. The new IEs containing the MS POwer
Parameters are not send for non osmo-bts BTSs, hence this commit is
secure with regards to running  osmo-bsc against an ip.access BTS such
as nanoBTS.

Related: SYS#4917
Depends: libosmocore.git Change-Id Iffef0611430ad6c90606149c398d80158633bbca
Change-Id: I5dfd8ff9ab6b499646498b507624758dcc160fb6
2021-09-03 18:57:13 +02:00
Neels Hofmeyr f616294d8c add osmo_tdef groups, exposing T timers on VTY config
We have two osmocom specific timers used in the BTS, X1 and X2. Expose
those on the VTY configuration, as timer group 'bts'.

This prepares for a subsequent patch, where I would like to add another
configurable timer. This provides the basic infrastructure for that.

Related: SYS#5559
Change-Id: I0f56f9425134679219884b0c3c2f29e77aff5e64
2021-08-18 17:27:04 +02:00
Neels Hofmeyr f1312f9818 enable Early Immediate Assignment
When an Immediate Assignment comes in targeting an lchan that is not yet
active, then hold back the RR Immediate Assignment until the channel
becomes active.

This allows the BSC to send the Immediate Assignment before first
waiting for the Channel Activation ACK, saving one Abis roundtrip, and
helping avoid double allocation on high latency Abis links.

Related: SYS#5559
Related: I56c25cde152040fb66bdba44399bd37671ae3df2 (osmo-bsc)
Related: Ifb2c62431a91dafa6116b5d6b9410930f00a6e18 (osmo-ttcn3-hacks)
Change-Id: Ie52765b238b01f22fb327fe12327fbf10abcad4c
2021-08-18 17:27:04 +02:00
Neels Hofmeyr 30c838fdfa remove unused LCHAN_S_INACTIVE
Change-Id: Ia738eaa796264fe0a97a2c86d6bbd37eaffe0a59
2021-08-16 20:40:20 +02:00
Philipp Maier 6611e7f305 allow to configure multiple oml remote-ip addresses
At the moment we can only configure a single BSC in the BTS
configuration. This also means that if this single BSC fails for some
reason the BTS has no alternate BSC to connect to. Lets extend the
remote-ip parameter so that it can be used multiple times so that an
operater can configure any number of BSCs that are tried one after
another during BTS startup.

Change-Id: I205f68a3a7f35fee4c38a7cfba2b014237df2727
Related: SYS#4971
2021-07-19 10:39:06 +02:00
Philipp Maier dda5cf4bb7 paging: prioritize CS related paging over PS related pagings.
When the paging queue is filled up to a critical level, pagings from the
PCU should be dropped as each immediate assignment paging from the PCU
is worth 4 normal CS pagings. Also the PCU may still issue pagings if the
paginging queue is already full and CS pagings are dropped. In a
congestion situation it is more important to get the CS rather than PS
pagings through.

Change-Id: I30f97672d7a0c369c4a656e878ab8cbbd83e31ea
Related: SYS#5306
2021-07-06 11:35:50 +02:00
Vadim Yanitskiy 0e8d68437a osmo-bts-trx: implement BCCH carrier power reduction mode
The BCCH carrier (sometimes called C0) of a BTS shall maintain
discontinuous Downlink transmission at full power in order to
stay 'visible' to the mobile stations.  Because of that, early
versions of 3GPP TS 45.008 prohibited BS power reduction on C0.

However, in the recent 3GPP TS 45.008 there is a feature called
'BCCH carrier power reduction operation'.  This is a special
mode of operation, where the variation of RF level for some
timeslots is relaxed for the purpose of energy saving.

In BCCH carrier power reduction operation, for timeslots on the
C0 carrier, except timeslots carrying BCCH/CCCH, the output power
may be lower than the output power used for timeslots carrying
BCCH/CCCH.  In this case the maximum allowed difference in output
power actually transmitted by the BTS is 6 dB.

The power reduction operation can be controlled by the BSC by
sending BS POWER CONTROL on the A-bis/RSL with the Channel Number
IE set to 0x80 (RSL_CHAN_BCCH).  This makes osmo-bts reduce the
transmission power on inactive timeslots of the BCCH carrier.

This is a non-standard, Osmocom specific extension, so indicate
support of this feature to the BSC in the feature vector.  Also
add a VTY command to allow enabling/disabling the power reduction
locally.  Add some signalling notes to the A-bis/RSL manual.

For more details, see 3GPP TS 45.008, section 7.1.

Change-Id: I3dcee6e910ccc61c5c63c728db9ea04327e2fc98
Depends: I69283b3f35988fc7a1a1dcf1a1ad3b67f08ec716
Related: SYS#4919
2021-07-01 02:01:22 +02:00
Pau Espin 8bf5cbea49 Support forwarding proto IPAC_PROTO_EXT_PCU BSC<->PCU
This new extension protocol is used to forward Osmocom PCUIF messages
BSC<->BTS<->PCU.
It will be sent re-using the IPA multiplex of the OML link between
BSC and BTS. BTS is responsible for forwarding the message over the unix
socket to the PCU.

PCUIF existing RX path needs to be reworked in order to accept
variable-size messages, in order to be able to transparently forward
messages without knowing about them (the new container message is
variable-length).

Related: SYS#5303
Change-Id: I73fdb17107494ade9263a62d1f729e67303fce87
2021-06-30 08:13:21 +00:00
Pau Espin 80ce85295b pcuif_proto.h: Add new container messages
Related: SYS#5303
Change-Id: I8deef11f9ec191475c99133629cd5cd9048c4bcb
2021-06-30 08:13:21 +00:00
Pau Espin 1fe9a89308 gsm_data: Drop unused function gsm_pchan_parse()
Change-Id: I8f49811c1b694c5ef1fb9178d5ff4558172089b0
2021-06-29 16:09:15 +02:00
Vadim Yanitskiy f47fa70b9f osmo-bts-trx: report PDCH interference levels to the PCU
The PDCH multiframe contains 48 data slots, 2 PTCCH slots, and
2 IDLE slots.  The later two can be used for the interference
measurements, since the UEs shall not transmit on them.

bts_report_interf_meas() is called every 104 TDMA frames, what
corresponds to 2 PDCH multiframe periods.  Report interference
levels on PDCH timeslots from this function.

Change-Id: I56f83db5264c246ec1b4b8a973105a4fc09931fb
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy dded16c4c9 osmo-bts-{trx,virtual}: get rid of dummy tx_idle_fn()
This logical channel handler does nothing more than just logging.

Change-Id: I438705f8dd902193e6c7b499d8ee55c56b6a1c2e
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 6fd4f77243 osmo-bts-trx: report interference levels to the upper layers
In trx_sched_ul_burst(), treat all BURST.ind and NOPE.ind mapped
to inactive logical channels as interference.  Average the RSSI
values on the fly using a sliding average with constant a=0.5.

Report averaged values for each logical channel every 104 TDMA
frames (SACCH period) by calling gsm_lchan_interf_meas_push().

Change-Id: I4686448e42a40df56c1d27a14fd0a4d43fd144a5
Related: I78b6d8beffa5228a28231b75728e7aebdd3cb23c
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy a484742793 scheduler: reorder enum trx_chan_type, add TRX_CHAN_IS_DEDIC()
With the new ordering, all TRXC_* values starting from TRXC_TCHF
belong to dedicated channels.  This is useful for the interference
reporting logic, where we're not interested in broadcast channels.

Change-Id: I7148f4d0bd1abbfe309bc5477e32a56d884533ea
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy d4efc3f9c5 Report interference levels in RSL RF RESource INDication
This change implements general interference averaging logic for
the higher layers.  In l1sap_info_time_ind(), where we receive
TDMA time updates from BTS model, call rsl_tx_rf_res() for each
transceiver according to the interval defined by the Intave
parameter received from the BSC.  In rsl_tx_rf_res() perform
the actual averaging for each inactive logical channel, and
then send everything to the BSC over the A-bis/RSL.

The BTS model specific code needs to report the measurements
for each logical channel every 104 TDMA frames (SACCH period)
by calling gsm_lchan_interf_meas_push().

Change-Id: Id80fdbef087de625149755165c025c0a9563dc85
Related: SYS#5313, OS#1569
2021-06-18 18:56:57 +02:00
Vadim Yanitskiy 6d20a49806 [VAMOS] osmo-bts-trx: schedule bursts on 'shadow' timeslots
Change-Id: I3e0bdf8c03273f66991aa1764029ab1dd3528d7e
Related: SYS#4895, OS#4941
2021-06-05 00:34:36 +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 bcdbb6c556 [VAMOS] gsm_data: rework and rename gsm_lchan_name_compute()
Change-Id: Id5cc40db04a654d94f5f75d4aad45439d66528cc
Related: SYS#4895, OS#4941
2021-06-04 20:04:13 +00:00
Vadim Yanitskiy 60fc1d3763 [VAMOS] scheduler: add new GMSK training sequences from 3GPP 45.002
Change-Id: I03fe712da5a3cc1a59f40a98a57f43306c3586c6
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 ef5c364bba [VAMOS] common/scheduler: unify symbol names for training sequences
Change-Id: Ice464e5b02b11b0f13df247fe6a01420a29bf1c5
Related: SYS#4895, OS#4941
2021-06-01 02:46:43 +00:00
Vadim Yanitskiy c70196240c [VAMOS] rsl: call bts_supports_cm() from rsl_handle_chan_mod_ie()
Ensure that we check the PHY capabilities in both cases:

  * RSL CHANnel ACTIVation, and
  * RSL CHANnel MODE MODIFY,

by calling bts_supports_cm() from rsl_handle_chan_mod_ie().

Modify bts_supports_cm() to accept a 'struct rsl_ie_chan_mode',
so we can handle VAMOS enabled channel modes and CSD later on.

Change-Id: I31a444592436705ec9d6ddade3cbfa7f8cb4bb91
Related: SYS#5315, OS#4940
2021-06-01 02:46:43 +00:00
Vadim Yanitskiy 13d595a9ef [VAMOS] osmo-bts-trx: indicate MTS in Downlink TRXDv2 PDUs
Change-Id: I1a17a25883214c068f9b1a6d651128b8f760d1fb
Related: SYS#4895, OS#4941
2021-06-01 02:46:43 +00:00
Vadim Yanitskiy ec1045a01b [VAMOS] osmo-bts-trx: implement and enable PDU batching for TRXDv2
This change implements TRXD PDU batching approach b), which is described
in section 25.3.4 of the user manual [1].  This approach is quite easy
to implement on the transceiver side, so we can enable it by default.

  .Example: datagram structure for combination b)
  ----
  +--------+----------------+---------+------------------------+
  | TRXN=N | TDMA FN=F TN=0 | BATCH=1 | Hard-/Soft-bits        |
  +--------+----------------+---------+------------------------+
  | TRXN=N | TDMA FN=F TN=1 | BATCH=1 | Hard-/Soft-bits        |
  +--------+----------------+---------+------------------------+
  | TRXN=N | TDMA FN=F TN=2 | BATCH=1 | Hard-/Soft-bits        |
  +--------+----------------+---------+------------------------+
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  +--------+----------------+---------+------------------------+
  | TRXN=N | TDMA FN=F TN=7 | BATCH=0 | Hard-/Soft-bits        |
  +--------+----------------+---------+------------------------+
  ----

Other PDU batching approaches can be introduced later.

[1] https://downloads.osmocom.org/docs/latest/osmobts-usermanual.pdf

Change-Id: I9b4cc8e10cd683b28d22e32890569484cd20372d
Related: SYS#4895, OS#4941
2021-06-01 02:46:43 +00:00
Vadim Yanitskiy 97193ced54 [VAMOS] osmo-bts-trx: rework and split up bts_sched_fn()
Currently, in bts_sched_fn() we send a Downlink burst to the PHY
immediately after calling the associated logical channel handler.
Together with the obvious performance advantages, this approach
imposes some serious limitations.  The code has already become
quite complex with the introduction of the baseband frequency
hopping, and now it's not possible anymore to extend it further.

TRXD PDU batching, which is essential for VAMOS implementation,
requires us to make the scheduler more flexible at the expense of
increased memory consumption and additional CPU cycles.  This patch
splits up Downlink burst scheduling into 3 main steps:

  1. bts_sched_init_buffers(): initialization of per-TRX Downlink
     burst buffers allocated by phy_instance_create().  For C0/TRX0
     all timeslots are pre-initialized with dummy burst.
  2. bts_sched_fn(): generating burst bits for all active lchans.
  3. bts_sched_flush_buffers(): sending everything to the PHY.

This approach allows us to a) get rid of the ugly tail in bts_sched_fn()
that was responsible for sending dummy bursts on C0/TRX0;  b) implement
the PDU batching and have several variants of bts_sched_flush_buffers()
providing the alternative batching approaches later on;  c) implement
PDU merging for the upcoming shadow transceivers.

Change-Id: Iec78989517865b3275a9784d1042a5ebd1d2815f
Related: SYS#4895, OS#4941
2021-05-23 12:10:38 +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 a344db979f [VAMOS] gsm_data.h: fix wrong bit-mask in BSIC2BCC macro
BCC takes 3 LSB bits of the BSIC, so we should apply 0b111 or 0x07.
The BSIC is specified in 3GPP TS 03.03 section 4.3.2.

Change-Id: Id24ad64e6c6de080ab43faa272daf844fbba6954
Related: SYS#5315, OS#4940
2021-05-23 10:09:27 +00:00
Vadim Yanitskiy d7323d6f1f [VAMOS] common: make 'struct gsm_bts_trx_ts' pointers const
Change-Id: I0369ef4ae603a4afed0661a5894df6a7135b1919
2021-05-23 10:09:27 +00:00
Vadim Yanitskiy e24279508d common: make the arguments of phy_{link,instance}_name() const
Change-Id: Ic01d131148065c9143d3a90f8020e2e133941292
Related: CID#236092 "Dereference before null check"
2021-05-19 16:53:06 +02:00
Vadim Yanitskiy 6ad89f2f58 osmo-bts-{trx,virtual}: fix: pinst->trx may be NULL
We assume that it's legal to have dangling PHY instances that are
not associated with any TRX instances in the configuration file.
Obviously, such PHY instances have pinst->trx set to NULL.

The DSP based models seem to handle dangling PHY instances without
any problems, so let's ensure that we always check pinst->trx
against NULL in the osmo-bts-{trx,virtual} specific code.

Change-Id: Ib7d9cb7ae47fead723fa46454cd64bf6e88756bb
Fixes: CID#236092 "Dereference before null check"
2021-05-19 16:53:06 +02:00
Vadim Yanitskiy 462bf0952a [VAMOS] Re-organize osmo-bts-trx specific structures
Together with the 'generic' structures which used to be shared between
osmo-bsc and osmo-bts some time ago, we also have the following
osmo-bts-trx specific structures (in hierarchical order):

  - struct l1sched_trx (struct gsm_bts_trx),
  - struct l1sched_ts (struct gsm_bts_trx_ts),
  - struct l1sched_chan_state (struct gsm_lchan).

These structures are not integrated into the tree of the generic
structures, but maintained in a _separate tree_ instead.  Until
recently, only the 'l1sched_trx' had a pointer to generic
'gsm_bts_trx', so in order to find the corresponding 'gsm_lchan' for
'l1sched_chan_state' one would need to traverse all the way up to
'l1sched_trx' and then tracerse another three backwards.

                                 + gsm_network
                                 |
                                 --+ gsm_bts (0..255)
                                   |
  --+ l1sched_trx --------------------> gsm_bts_trx (0..255)
    |                                |
    --+ l1sched_trx_ts               --+ gsm_bts_trx_ts (8)
      |                                |
      --+ l1sched_chan_state           --+ gsm_lchan (up to 8)

I find this architecture a bit over-complicated, especially given
that 'l1sched_trx' is kind of a dummy node containing nothing else
than a pointer to 'gsm_bts_trx' and the list of 'l1sched_trx_ts'.

In this path I slightly change the architecture as follows:

                                 + gsm_network
                                 |
                                 --+ gsm_bts (0..255)
                                   |
                                   --+ gsm_bts_trx (0..255)
                                     |
    --+ l1sched_trx_ts <----------------> gsm_bts_trx_ts (8)
      |                                |
      --+ l1sched_chan_state           --+ gsm_lchan (up to 8)

Note that unfortunately we cannot 1:1 map 'l1sched_chan_state' to
'gsm_lchan' (like we do for 'l1sched_trx_ts' and 'gsm_bts_trx_ts')
because there is no direct mapping.  The former is a higl-level
representation of a logical channel, while the later represents
one specific logical channel type like FCCH, SDCCH/0 or SACCH/0.

osmo-bts-virtual re-uses the osmo-bts-trx hierarchy, so it's also
affected by this change.

Change-Id: I7c4379e43a25e9d858d582a99bf6c4b65c9af481
2021-05-18 19:11:06 +00:00
Vadim Yanitskiy 641ffaaef3 scheduler.h: cosmetic: use #pragma once
Change-Id: I551ce74f8cec8ec8d80768ec6c0559a203a8143c
2021-05-18 19:00:55 +00:00
Pau Espin 0277cddab2 sysmo,oc2g,lc15: Make RadioChannel MO depend on RadioCarrier MO
lower layer specific APIs require first to enable the TRX object
(GsmL1_PrimId_MphInitReq, which requires ARFCN received during Set
Radio Carrier Attributes) before enabling the per-TS structure.
Hence, OPSTART must happen in RCARRIER MO before OPSTART can be sent to
the Radio Channel MOs, otherwise the initialization of the TS objet will
fail and OPSTART for the RadioChannel MO will send back a NACK.
In order to avoid this, we need to keep the RadioChannel MO announced as
"Disabled Dependency" until RCARRIER is OPSTARTed.

Related: OS#5157
Change-Id: I8c6e5ff98c32a3cd5006f5e5ed6875bcabb1d85f
2021-05-17 14:23:30 +02:00
Vadim Yanitskiy 4733b099f5 osmo-bts-trx: implement TRXDv2 protocol support
Change-Id: I3532a6693bb335043ec390049138308991083e66
Related: SYS#4895, OS#4941, OS#4006
2021-05-11 10:55:55 +00:00
Vadim Yanitskiy 05493ca810 [VAMOS] osmo-bts-trx: move {chan,bid} to trx_{dl,ul}_burst_{req,ind}
Historically the logical channel handlers like rx_data_fn() used to accept
quite a lot of arguments.  With the introduction of additional measurement
parameters it has become clear that we need to group the arguments into
structures.  This is why both 'trx_{dl,ul}_burst_{req,ind}' structures
were introduced.

However, both channel type and burst ID were kept untouched, so until
now we had them being passed between the scheduler functions here and
there.  This change is a logical conclusion of the original change
mentioned above.

As a part of this change, the new LOGL1SB() macro is introduced.  It
does accept a pointer to 'trx_{dl,ul}_burst_{req,ind}' and expands the
context information for the old LOGL1S() macro.

Change-Id: Ic5a02b074662b3e429bf18e05a982f3f3e7b7444
2021-05-11 04:00:37 +02:00
Vadim Yanitskiy c74f25bdcc [VAMOS] Merge bts_trx_init() into gsm_bts_trx_alloc()
gsm_bts_trx_alloc() already does initialize some fields of the
allocated 'struct gsm_bts_trx' instance, and having an additional
function for initializing the other fields makes no sense.

Note that I intentionally didn't merge a call to bts_model_trx_init()
into gsm_bts_trx_alloc(), because this would break some assumptions
regarding the order of initialization and cause regressions.

This also allows us to not call bts_model_trx_init() from tests.

Change-Id: I4aefaf47b05a67ec0c4774c1ee7abcc95e04cc13
2021-05-11 03:54:07 +02:00
Vadim Yanitskiy b6d3e2c360 [VAMOS] struct gsm_bts_trx: fix the PHY instance pointer
First of all, there is no reason to use a void pointer because
it's always 'struct phy_instance'.  Also, no need to encapsulate
this pointer into 'role_bts' because there are no other roles in
osmo-bts (we used to have shared headers years ago).

This commit also fixes a bug in test_sysmobts_auto_band(), where a
pointer to 'struct femtol1_hdl' was directly assigned to trx.pinst.

Change-Id: I9bd6f0921e0c6bf824d38485486ad78864cbe17e
2021-05-09 02:05:48 +02:00
Vadim Yanitskiy 0dcaf34927 common/sysinfo: make struct gsm_bts_trx const in num_agch()
Change-Id: I776defc7e9699a378c9a03304c63e15d023476d0
2021-05-08 17:41:02 +02:00
Vadim Yanitskiy 57ebf04171 struct gsm_bts_trx: remove unused leftovers from openbsc
Change-Id: I667fc1d6a5eaccb69b45197da71d4a699f52fcfc
2021-05-06 01:10:16 +02:00
Harald Welte b1b100ce59 Introduce ability to set socket priority of RTP sockets
This significantly simplifies setups in which not only the IP DSCP
but also the IEEE 802.1Q PCP is to be set for RTP packets.

Depends: libosmo-abis.git I52c08f4b2a46981d002ef0c21e6549445d845a6e
Change-Id: Ia3a91e6788285be3e2e73defee63e6bd79c6258e
Related: SYS#5427
2021-04-30 08:23:56 +02:00
Vadim Yanitskiy b619da5e72 osmo-bts-trx: 'burst type' is actually modulation type
Burst type and modulation type are actually different things.

Change-Id: Ic06c96434ad32dd3770b88cb1fefcbefb2fc3928
Related: SYS#4895, OS#4941, OS#4006
2021-04-24 08:47:00 +00:00
Vadim Yanitskiy 32ef94cac0 osmo-bts-trx: cosmetic: TRXD 'header version' -> 'PDU version'
TRXDv2 brings significant changes to the whole PDU structure, not
just the header.  Let's highlight this in the code / strings.

Change-Id: Id0274bd1ae5c419548596ed1852e6a28ec62b713
Related: SYS#4895, OS#4941, OS#4006
2021-04-21 01:26:00 +02:00
Philipp Maier fd5151668c sched_lchan_tchh: fix frame number and fill FACCH gap
The measurement results / TCH indications that are handed when decoding
the TCH/H are off by two bursts. Since a measurement result / TCH block
is expected every two bursts anyway the problem can only be noticed when
a FACCH transmission is going on and the frame numbers of the BFI TCH
blocks appear to be missaligned towards the FACCH block.

The reason is that the incoming bursts are shifted into a 6 burst wide
buffer. The decoding functions always look at the beginning of that
buffer while the bursts are shifted into the buffer from the end. A
facch will always fit exactly in that buffer but TCH/H blocks are only
4 bursts wide and thereofre they need two additional bursts until they
reach the coverage of the decoding function. Lets fix this by putting
the correct frame number (from two bursts before) into the remap
functions in order to get the correct beginning of the block.

Since the FACCH transmission uses six blocks it takes out two TCH
blocks. This means that if we count the FACCH block we end up with a gap
of one TCH voice block. Lets generate a dummy measurement to compensate
the gap. This will also match the behavior of the osmo-bts-sysmo phy.

Change-Id: I1ad9fa3815feb2b4da608ab7df716a87ba1f2f91
Related: OS#4799
2021-03-27 18:37:55 +00:00
Philipp Maier 6940d34ee5 l1sap: Store status of SRR in an lchan struct memeber
The MS sets the SRR bit in the L1 SACCH header to request DL-SACCH
repetition from the BTS. At the moment we access the l1_info stored in
tle lchan struct each time we want to check the status of the SRR bit.
However, it is more convinient to do this once at reception and store
the status of the status of the flag in a separate struct member.

Change-Id: Ieddd45d7890343d64db14b9c726f6fa2f25714f6
Related: SYS#5114
2021-03-01 19:47:56 +00:00
Philipp Maier da084794a6 gsm_data: handle l1_info with structs
in struct gsm_lchan and also in other places l1_info is handled in its
binary form. Libosmocore now offers structs to handle l1 info, so lets
use those structs to get rid of all the manual decoding of l1_info.

Depends: libosmocore I23c1890b89d5a0574eb05dace9f64cc59d6f6df7
Change-Id: I5eb516d7849750f3dd174d48c9f07dabf2c80515
2021-02-16 22:28:18 +00:00
Neels Hofmeyr f8f806ff2a GSMTAP: make remote host for Um logging configurable via VTY
So far, the only way to configure GSMTAP Um logging is to use the
cmdline argument '-i'.  Let's deprecate it, and add a VTY command
to allow setting the remote host from configuration file.

The legacy '-i' option, if provided, overrides the configuration
file option, and will also appear in 'write file'.

Change-Id: I17676a21c4e0c9cbc88f2c5c53a39c6c6c473ca1
Tweaked by: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
2021-02-16 17:35:47 +00:00
Vadim Yanitskiy d37041b1ea ta_control: make 'struct bts_ul_meas' parameters const
The only reason why it was not 'const' is that in lchan_new_ul_meas()
we may need to overwrite 'ulm->is_sub'.  This can still be done after
memcpy()ing a new set of samples to the destination buffer.

Change-Id: I0cabf75f8e0bf793c01225a4a8433e994c93f562
Related: OS#5024
2021-02-15 10:58:54 +00:00
Vadim Yanitskiy 6b93f0f366 GSMTAP: move 'struct gsmtap_inst' and masks to 'struct gsm_bts'
Change-Id: I1c5cb8561dfdcbfd1b23ab28cf95aea7a18c7481
2021-02-13 05:15:37 +01:00
Vadim Yanitskiy 58952ac2b4 GSMTAP: move 'gsmtap_sapi_names' from l1sap.c to vty.c
There is no point in having it there, as VTY is the only user.

Change-Id: If919bc1b2d456559ae9ff1ce5dd27d34742ee51c
2021-02-13 04:55:55 +01:00
Vadim Yanitskiy b1485cd590 power_control: implement handling of P_Con_INTERVAL parameter
Change-Id: Ibf9956b2c6d829b38e9fda7d1f29790036219f42
Related: SYS#4918
2021-02-07 23:08:57 +01:00
Philipp Maier 98c7b44f8d pcu_sock: send SI1, SI3 and SI13 via PCUIF
This patch PCUIF extends the SAPI 4 that is used
to transfer SI13 only, so that it can transfer SI1 and SI3 as well.

The system information SI1, SI3 and SI13 is needed by the NACC RIM
application which runs inside osmo-pcu.

Depends: osmo-pcu I5138ab183793e7eee4dc494318d984e9f1f56932
Change-Id: Ib7aeb41e634ad6fcab3766a4667b0267c749436a
Related: SYS#5103
2021-02-03 08:26:25 +00:00
Vadim Yanitskiy ef99e36626 power_control: use more reasonable reduce step size
It makes more sense to use a reduce step size that is smaller than
the increase step size.  This way both MS/BS power control loops
would be able to react quickly of the signal gets weaker, while
the good signal would not trigger radical power reduction.

Change-Id: Ie358fd828a68bfa1d23559197e8df8478fb4535e
Related: SYS#4918
2021-01-08 19:42:22 +01:00
Vadim Yanitskiy e920902e25 power_control: properly track the first initial state
Change-Id: I16e7474b5affbd90855a2e407b305e9dec581dfa
Related: SYS#4918, SYS#4917
2021-01-08 02:30:46 +01:00
Vadim Yanitskiy 834ba05cd2 power_control: generalize measurement pre-processing state
This way EWMA based filtering can also be applied to RxQual.

Change-Id: I439c00b394da670e314f217b3246cc85ce8213c6
Related: SYS#4918, SYS#4917
2021-01-08 02:23:56 +01:00
Vadim Yanitskiy e8f857453d power_control: migrate MS/BS control loops to the new params
In change [1] the new power control structures and default params
were introduced.  In change [2], the existing VTY commands for MS
power control in the BTS were deprecated and changed to use the
new structures as storage.  Finally, in change [3], handling of
the power control parameters on the A-bis/RSL was implemented.

This change is the final logical step in the mentioned chain: it
makes both MS/BS power control loops use the new parameters, and
removes the old structures.  The actual implementation of both
power control loops remains the same, however the expected output
of some unit tests for the Downlink loop needs to be changed:

  - TC_fixed_mode: disabling dynamic power control becomes a separate
    step of the test script since the field 'fixed' is removed;

  - TC_rxlev_target: RxLev thresholds are printed 'as-is'.

Not all of the new parameters are used by the power control loops
yet.  Further improvements to be done in the follow up commits.

[1] I6d41eb238aa6d4f5b77596c5477c2ecbe86de2a8
[2] Icbd9a7d31ce6723294130a31a179a002fccb4612
[3] I5a901eca5a78a0335a6954064e602e65cda85390

Change-Id: Ib18f84c40227841d95a36063a6789bf63054fc2e
Related: SYS#4918
2021-01-08 02:05:27 +01:00
Vadim Yanitskiy 5f909b45c5 power_control: check-in new parameters and default values
For the sake of simplicity, the old structures that are still used
by MS/BS power control loops are kept in place.  Migration to the
new structures requires additional changes to the existing power
control logic, so it will be done in the follow-up changes.

The new parameters are integrated as follows:

  + struct gsm_bts - a BTS instance:
  |   Hard-coded default (fall-back) parameters for all transceivers.
  |
  +-+-> struct gsm_bts_trx - a TRX instance (transceiver):
    |     Default parameters for all logical channels inherited from
    |     'struct gsm_bts' at start-up.  May be overwritten by the
    |     BSC using ip.access specific 'Measurement Pre-processing
    |     Defaults' message on the A-bis/RSL interface.
    |
    +---> struct gsm_lchan - a logical channel (e.g. TCH or SDCCH):
            Connection specific parameters inherited from 'struct
            gsm_bts_trx'.  May be overwritten by parameters sent
            by the BSC in CHANnel ACTIVation and other messages.

Change-Id: I6d41eb238aa6d4f5b77596c5477c2ecbe86de2a8
Related: SYS#4918
2021-01-04 21:49:21 +00:00
Harald Welte 129cb51597 sysinfo.c: Fix SI4 GPRS patching which overwrote CBCH IE
In Change-Id I1fd513ea03297918d15d4b28ed454f9b6dd6ebfa we introduced
patching of SI4 to indicate GPRS presence in terms of PCU connection
status.  Unfortauntely this didn't account for optional IEs being
present in SI4, and hence overwrote any CBCH related information
elements, if present.

This in turn meant that since the above-mentioned commit, you could
have either a GPRS-capable, network, or a Cell Broadcast capable one.

Change-Id: I0ee0cf736e2fb74a6759a68101f699b4ec2ef54e
Related: OS#3075
2021-01-03 00:46:16 +01:00
Vadim Yanitskiy 675618b4f8 power_control: make raise/lower step limitation configurable
Change-Id: Ic37742f46f533865043b3dbcf16ea702e1746f98
Related: SYS#4918
2020-12-09 21:39:52 +00:00
Vadim Yanitskiy 36743255cd power_control: clarify units in 'struct lchan_power_ctrl_state'
Change-Id: I934f2d1e1064eed7587bc5693ef981bf449a1b81
Related: SYS#4918
2020-12-06 18:59:07 +01:00
Vadim Yanitskiy 237ec6194b power_control: clarify units in 'struct bts_power_ctrl_params'
Change-Id: Icb059ca1f555397be116a424800e4536883b9106
Related: SYS#4918
2020-12-06 18:59:05 +01:00
Vadim Yanitskiy 0698c58ebe power_control: implement BS (Downlink) Power Control
We already have MS Power Control, which according to 3GPP 45.008
shall be implemented in the MS to minimize the transmit power in
the Uplink direction.  The BS Power Control may optionally be
implemented by the network side for the same purpose.

Using Downlink signal measurements reported by the MS, the BSS
(either BSC, or BTS) may control Downlink attenuation in a way
that the transmit power remains as low as possible, or remains
in a specific range corresponding to good RxLev values on the
MS side.  This change implements autonomous BS Power Control,
that can optionally be enabled by the BSC.

BS Power Control re-uses parts of the MS Power Control code,
so all parameters can be configured in the same way - via the
VTY interface or a configuration file.  This basically means
that features like hysteresis and EWMA based filtering are
also available for BS Power Control.

The only difference is that RxQual values higher than 0 would
trigger the logic to reduce the current attenuation twice.

Note that one of the unit tests ('TC_rxlev_max_min') fails,
as the power step limitations for raising and lowering look
wrong to me, and the related discussion is still ongoing.

Change-Id: I5b509e71d5f668b6b8b2abf8053c27f2a7c78451
Related: SYS#4918
2020-12-06 18:57:43 +01:00
Vadim Yanitskiy 9381576e18 power_control: generalize power control state structure
Change-Id: I8c6ad8d14349e8a05084c2912644c5202f951f52
Related: SYS#4918
2020-12-04 09:27:48 +01:00
Vadim Yanitskiy 369c852022 bts: add Downlink power control parameters
Change-Id: I724f661e9ce5dd75f95fb7b270a89b2e2a73c951
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Vadim Yanitskiy e9b6648761 bts: generalize a struct for UL/DL power control parameters
Change-Id: I504de17fb3c1300c2a3faa6d7d3a9eb1b74b214b
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Vadim Yanitskiy ca9ab523e1 bts: rename MS_UL_PF_ALGO_{NONE,EWMA} to BTS_PF_ALGO_{NONE,EWMA}
Change-Id: I580512eea1d329a4d25ccbd6fc2ab98b083ec51d
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Vadim Yanitskiy af4eec056e struct gsm_bts: move ul_power_{target,hysteresis} to ul_power_ctrl
Change-Id: I3886c7aedf3870536f1750f864cf698302ddf2df
Related: SYS#4918
2020-12-02 13:56:49 +00:00
Philipp Maier 7c87612b42 l1sap: add repeated uplink SACCH
3GPP TS 44.006, section 11 describes a method how the uplink
SACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I7e4cc33cc010866e41e3b594351a7f7bf93e08ac
Related: OS#4795, SYS#5114
2020-11-28 22:35:12 +01:00
Philipp Maier a36d6832a1 l1sap: add repeated downlink SACCH
3GPP TS 44.006, section 11 describes a method how the downlink
SACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I00806f936b15fbaf6a4e7bbd61f3bec262cdbb28
Related: OS#4794, SYS#5114
2020-11-27 16:02:45 +01:00
Philipp Maier 33dfe2bcec l1sap: add repeated downlink FACCH
3GPP TS 44.006, section 10 describes a method how the downlink
FACCH transmission can be repeated to increase transmission
reliability.

Change-Id: I72f0cf7eaaef9f80fc35e752c90ae0e2d24d0c75
Depends: libosmocore I6dda239e9cd7033297bed1deb5eb1d9f87b8433f
Related: OS#4796 SYS#5114
2020-11-27 16:02:45 +01:00
Neels Hofmeyr f733cf8263 part 1 of: fix SAPIs for handover to match 48.058 4.1.{3,4}
This part adds the common lchan flags to indicate whether DL SACCH
should be activated.

Note that currently, osmo-bsc *always* sends the MS Power IE as well as
the TA IE, also for inter-cell HO, so in the osmoverse, nothing will
change until we also adjust osmo-bsc. See OS#4858.

Change-Id: Ibea973ccadf5d424213f141f97a61395856b76de
2020-11-26 09:22:38 +00:00
Vadim Yanitskiy 5c7b709027 vty: call bts_model_vty_init() from bts_vty_init()
Similar to bts_vty_init(), BTS specific bts_model_vty_init()
requires a pointer to 'struct gsm_bts'.  Not only it's used
as a parent talloc context, but also stored locally, so then
it can be used by some VTY commands.

Let's expose the global 'struct gsm_bts' from main, and pass
the application's talloc context like was done in [1].

This finally makes the BTS model specific options appear in
the automatically generated VTY reference (--vty-ref-xml).

[1] Ic356a950da85de02c82e9882a5fbadaaa6929680

Change-Id: Iee7fee6747dd1e7c0af36f9b27326f651ae37aaf
Related: SYS#4937, OS#3036
2020-11-02 18:08:24 +00:00
Vadim Yanitskiy a72a0765a4 main: register VTY commands before handle_options()
Otherwise only those commands that are registered by libosmocore
appear in the generated XML VTY reference - change the order.

Instead of a pointer to 'struct gsm_bts', pass the application's
talloc context, as it's only used for dynamic command allocation.

Change-Id: Ic356a950da85de02c82e9882a5fbadaaa6929680
Related: SYS#4937, OS#3036
2020-11-02 11:16:59 +00:00
Pau Espin 22f59cd63a Introduce NM Channel FSM
Change-Id: I288cbfb4730b25a334ef1c3d6b9679d6f1d4cfc5
2020-10-20 13:45:57 +00:00
Pau Espin 7810a91733 Introduce NM Radio Carrier and Baseband Transceiver FSMs
All the Operative State logic to manage a RadioCarrier//BBTransc NM objects is
centralized in these FSM, where other parts of the code simply send
events to it.
This allows keeping state consistent and offloading logic from each bts
backend, since they are only required to submit events now.
The idea in the long run is to also replace other NM objects with
similar FSMs.

This improved logic fixes bug where PHY + RSL link became available before
OPSTART and hence op state changed to Enabled before receiving any OPSTART message.

Change-Id: Ifb249a821c4270918699b6375a72b3a618e8cfbe
2020-10-20 13:45:57 +00:00
Pau Espin ae6e3e8f8b Introduce NM BTS FSM
Change-Id: Iae631bcc7acdf955296b124707e42d5e565af186
2020-10-20 13:45:57 +00:00
Pau Espin 88fe4b079d Introduce NM BTS Site Manager FSM
This fixes old behavior mimicing broken behavior in nanoBTS (according to TS 12.21)
where BTS Site Mgr NM object was announced as Enabled despite no OPSTART
was sent by the BSC.
With this new FSM, BTS SiteManager will be announced as Disabled Offline
during OML startup conversation, instead of Enabled.

The new osmo-bsc OML management FSMs use this change in behavior to find
out whether it should use the old broken management states (without
Offline state, as per nanoBTS) or use the new state transitions (which
allow fixing several race conditions).

Change-Id: Iab2d17c45c9642860cd2d5d523c1baae24502243
2020-10-20 13:45:57 +00:00