aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2021-11-23bts_shutdown_fsm.h: Remove wrong comment describing enumPau Espin Pedrol1-1/+0
Change-Id: I963234255ce5a648a842ae6dbfd9966a694d0c09
2021-11-04[overpower] Turn it on and off depending on DL RxQualVadim Yanitskiy1-1/+2
Change-Id: Iaa812d4661ee17c4cd4a8c4ae4bd3e94c1a2e6cc Depends: Ia28293a12de0af71f55e701fb65c46e905dae217 Related: SYS#5319
2021-11-04measurement: pass *mr to lchan_bs_pwr_ctrl()Vadim Yanitskiy1-1/+1
As a side effect, we have to sacrifice a unit test (TC_inval_dummy) because it becomes impossible to pass a dummy or invalid SACCH block to lchan_bs_pwr_ctrl(). Change-Id: I937117cf26fb718d57920382f6972390ad498c51 Related: SYS#4918
2021-11-04l1sap: rework handling of DATA.ind on SACCHVadim Yanitskiy1-3/+1
Currently an Uplink SACCH block is being passed to LAPDm first, and then gets forwareded to the BSC in handle_ms_meas_report(), together with the Uplink measurements collected so far. This approach has a serious flaw: handle_ms_meas_report() won't be called if an Uplink block contains SAPI=3 data (SMS) or was not decoded at all (len=0) fow whatever reason. Therefore, no RSL MEASurement RESult message will be sent to the BSC. Rename handle_ms_meas_report() to lchan_meas_handle_sacch(), and call it from l1sap_ph_data_ind(). This way perioduc RSL MEASurement RESult messages will be sent regardless of what happens on Uplink SACCH. Change-Id: Ifed91f87fd653debc87a09da3fd31ad64a13f330 Fixes: TC_meas_res_speech_{tchf,tchh}_sapi3 Related: SYS#5319
2021-10-25[overpower] rsl: store full content of RSL_IE_OSMO_TEMP_OVP_ACCH_CAPVadim Yanitskiy1-2/+2
The new fields in 'struct abis_rsl_osmo_temp_ovp_acch_cap' allow: * selectively enabling SACCH and/or FACCH, * setting the RxQual (BER) threshold. Both features are implemented in the follow-up commits. Change-Id: I370c8f95fb64eceb60a9dc2eae1412f8a0df0f4e Depends: Ia28293a12de0af71f55e701fb65c46e905dae217 Related: SYS#5319
2021-10-23lchan: introduce and use lchan_is_tch() helperVadim Yanitskiy1-0/+3
Change-Id: Icd832667cad1189e3e819c88bde837c4260aa252
2021-10-22struct gsm_lchan: move tch.rep_facch to rep_acch.dl_facchVadim Yanitskiy1-4/+2
Finally we have all ACCH repetition state variables in one place. Change-Id: I1469619528bb69c78c2fdc25bc1db208ead936d0 Related: SYS#5114
2021-10-22struct gsm_lchan: group ACCH repetition state fieldsVadim Yanitskiy1-5/+8
Change-Id: I2680c88f2a51b64f085a92233bc125338622babf Related: SYS#5114
2021-10-22cosmetic: s/repeated_acch_capability/rep_acch_cap/gVadim Yanitskiy1-1/+1
Shorter symbol names are easier to read. Change-Id: Ib1d51f91139b4c2fe794e37fc8543b2d7a9b9c07 Related: SYS#5114
2021-10-22measurement: move repeated_dl_facch_active_decision() hereVadim Yanitskiy1-3/+0
For the sake of consistency, call repeated_dl_facch_active_decision() from handle_ms_meas_report(), so we have all functions using the measurement results for Downlink executed in a single place. Change-Id: Ibd5377ce642e49161f320ac8c33e9f966b3ddfaf Related: SYS#5114, SYS#5319
2021-10-22measurement: handle_ms_meas_report() accepts const ghVadim Yanitskiy1-1/+3
Change-Id: Iba37c1a92b8b17a8ba8c958fb6c296747578cb1b
2021-10-22rsl: rsl_tx_meas_res() does not change l3, make it constVadim Yanitskiy1-1/+1
Change-Id: Ie60a34f90f7872464e503dc7b56935aee95f0f80
2021-10-20Reset CBCH state after BTS shutdownPau Espin Pedrol1-0/+2
Related: OS#5273 Change-Id: Ib01d38c59ba9fa083fcc0682009c13d2db3664fe
2021-10-18bts_shutdown_fsm: Make sure pending power ramping are aborted before closing TRXPau Espin Pedrol1-0/+1
It can happen when using several TRX that all of them go alreadyunder shutdown target tx power level, but that due to configuration the BTS still may want to keep pushing the tx power level even lower. Hence, we end up in a situation where the FSM is trying to close all the TRX while the power ramp procedure is ongoing for some of them. As a result, race conditions can happen where for instance the power ramping procedure for one TRX ends and calls the cb to send SETPOWER after the TRX PHY has been closed (and hence TRXC link is unavaialble). If that happens, the trx_if lower layers store the SETPOWER and attempt a later retransmit, which may take up to 2 seconds after TRX becomes active if BTS reconnects immediatelly. Hence, we end up in some test cases where BTS reconnects and configures some TRX while others are kep unconfigured for a while due to the mentioned delay, hence the test attempting to use the TS while it hasn't been yet configured. The solution is to avoid this kind of unexpected events with ongoing powe ramp once we have decided tx power is lower enough to shutdown the TRX completely. Hence we abort the pending power ramp procedure. Change-Id: Ibca581131eb142d7c38c917a0d6990efec03123c
2021-10-14Move lchan_deactivate() to lchan.cPau Espin Pedrol2-2/+1
Change-Id: If75ed432fa9dcb10159a0dac9b8ba7efe6958b35
2021-10-14Move lchan related code to lchan.{c,h}Pau Espin Pedrol2-2/+3
Change-Id: I17ebe6af69e31d1b4dbad7656bbf043f4c9243c1
2021-10-11Add new gsm_bts_trx_free_shadow_ts() functionPau Espin Pedrol1-0/+1
Use it as a counterpart of gsm_bts_trx_init_shadow_ts() Change-Id: I38baa2b2cfcf6221325d45860b3c7dd53235b8ff
2021-10-08l1sap: check if BTS model supports interference reportingVadim Yanitskiy1-0/+2
Currently, only osmo-bts-trx is capable of reporting the interference levels to L1SAP. Thus it does not make sense to trigger the averaging logic and send empty reports over the A-bis/RSL and the PCUIF. Change-Id: Ic17eb46bdca3c33ac4d6e560a093b635b75424a5 Related: SYS#5313
2021-10-08osmo-bts-trx: report PDCH interference levels to L1SAPVadim Yanitskiy1-2/+1
Starting from [1], interference levels on PDCH timeslots are also reported over the A-bis/RSL. They may be useful for the BSC to determine whether dynamic PDCH timeslots might be better used for new circuit switched connections, or whether alternative PDCH slots should be allocated for interference reasons. * Handle GSM_LCHAN_PDTCH in lchan_report_interf_meas(). * Rework pcu_tx_interf_ind() to accept 'struct gsm_bts_trx'. * Call pcu_tx_interf_ind() from l1sap_interf_meas_report(). Regarding pcu_tx_interf_ind(), it's better to call this function from the upper layers once, rather than calling it from various places in the model specific code. [1] I5b4d1da0920e788ac8063cc765fe5b0223c76758 Change-Id: I3fbaad5dbc3bbd305b3ad4cb4bfb431a42cfbffc Related: SYS#5313
2021-10-08rsl_tx_rf_res(): separate interference AVG / band calculationVadim Yanitskiy1-1/+3
It's cleaner from the architectural point of view to have the interference measurements processed in a separate function. Change-Id: I3981608e01a50585359cad673c38c8a305027d30 Related: SYS#5313
2021-10-08rsl: prevent race condition during timeslot re-configurationVadim Yanitskiy2-1/+2
It may happen that the BSC requests logical channel activation on a dynamic timeslot, which is in a process of switching from one pchan type to another due to a preceding channel activation request. In this case 'struct gsm_bts_trx_ts' already holds an msgb with the preceding RSL CHANnel ACTIVation message, that is normally handled once the PHY completes the process of timeslot re-configuration. On receipt of subsequent RSL CHANnel ACTIVation messages, in function dyn_ts_l1_reconnect() we overwrite the preceeding msgb (memleak), by the most recent one. And once the timeslot re-configuration is done, only the most recent CHANnel ACTIVation message gets ACKed. In order to avoid this, let's move the msgb ownership to 'struct gsm_lchan', so it cannot be overwritten by the CHANnel ACTIVation message that is related to a different lchan on the same timeslot. Change-Id: Ia625c2827fca883ea712076706d5ef21ed793ba6 Related: I3b602ac9dbe0ab3e80eb30de573c9b48a79872d8 Fixes: OS#5245
2021-10-07nm_channel_fsm: Release lchans after BTS shutdownPau Espin Pedrol1-0/+2
This fixes some TTCN3 tests where some lchan resources were kept from previous tests. Change-Id: I78dca32cd061fba86cc88c4c4f323b33d51c58d0
2021-10-07Introduce gsm_lchan_release function helperPau Espin Pedrol1-0/+1
Change-Id: I0525beaba3c833f8d7adf9701fe373761a7720d3
2021-10-07lchan.h: Add related ticket info to FIXME commentPau Espin Pedrol1-1/+1
Change-Id: I09ea92e843383d65c8033196814d345135ff918e
2021-10-07Move lchan,power_ctrl specific code from gsm_data.h to their own filesPau Espin Pedrol4-421/+438
Let's split all lchan and power_control specific stuff into their own headers, it helps finding out data and operations available related to them. We already have similar classification in osmo-bsc. Change-Id: I6424dcbd2e329fc1a516f8886359554ed7e9487e
2021-10-07MS Power Control Loop: Use P_CON_INTERVAL=2 by defaultPau Espin Pedrol1-0/+1
Have a more stable loop with less temporary oscillations at the expense of increased reaction time. 4 SACCH blocks (P_CON_INTERVAL=2) is the minimum interval to get stable measurements for the last requested MS Power level. With P_CON_INTERVAL=1, are also made during a period with stable power being use to transmit, but the MS Power level used (and announced in MR) is not the last one requested by the BTS, but the one requested in the previous loop iteration. This can make the MS and BTS bounce 2 values forth and back, and create some temporary oscillation. See osmo-bsc User manual section "Power Control" for more information. Related: SYS#5371 Change-Id: I91c505447f68714239a4f033d4f06e91893df201
2021-10-07Introduce gsm_lchan_init() function helperPau Espin Pedrol1-0/+1
Let's move lchan specific struct stuff into lchan.c Change-Id: I9cb96707c63b8b7d76591d25fe906f02e34bb76b
2021-10-04trx_provision_fsm: poweronoff_sent flag: track POWERON and POWEROFF separatelyPau Espin Pedrol1-1/+2
It helps better understanding the code, and will allow handling situations where for instance a POWERON in in transit while the BTS is instructed to shutdown, hence a POWEROFF needs to be sent. Change-Id: Iaf62217ceab7420afa4140cba61e1c2f983c61b4
2021-09-30Delay abis reconnect while bts is shutting downPau Espin Pedrol1-0/+3
Avoid re-connecting to a new BSC while BTS is in shutting down. All the FSMs are complex enough to even try to re-start when stopping has not yet finished... Change-Id: I1727828a16f4ec8043b00cc6b2e02a4c35f71377
2021-09-30bts-trx: Delay power ramp up until RCARRIER is ENABLEDPau Espin Pedrol1-0/+6
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-28scheduler: Fix lqual_cb not populated for TCH.indPau Espin Pedrol1-1/+1
Change-Id: I79c83b974149b1e94155bc61172b57de8003891e
2021-09-28Decouple handling of Measurement Report from lapdmPau Espin Pedrol2-1/+3
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-27osmo-bts-trx: implement Temporary Overpower for SACCH/FACCHVadim Yanitskiy2-0/+7
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-26gsm_lchan2chan_nr(): separate RSL specific variant of this APIVadim Yanitskiy1-0/+1
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-23Revert "abis: Fix line leaked & recreated upon every reconnect"Pau Espin Pedrol1-1/+1
This reverts commit bc6d35f52d4d3abd650afb05475ad5a818737fe2. Change-Id: I15063f0156ed8910795cd5ffe045e2d0cbca6276
2021-09-23abis: Fix line leaked & recreated upon every reconnectPau Espin Pedrol1-1/+1
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-23Avoid sending Load Indications when BTS is not RSL-connectedPau Espin Pedrol1-0/+2
Change-Id: I97e8dd7dd58ee2ec90c3a38d45dfd944db44c412
2021-09-23bts_shutdown_fsm: Allow configuring FSM to shutdown without exiting processPau Espin Pedrol1-0/+2
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-23phy_link: Introduce bts_model_phy_link_close() and use it in bts-trxPau Espin Pedrol1-0/+1
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-23bts-trx: Submit TRX SW_ACT when PHY becomes connectedPau Espin Pedrol1-1/+0
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-22nm_*fsm: Make FSMs aware of object being properly configured or notPau Espin Pedrol2-0/+9
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-20abis: Drop internal OML msg queuePau Espin Pedrol1-1/+0
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-20nm_*_fsm: Move to state Disabled NotInstalled Locked when shtudown proc endsPau Espin Pedrol1-0/+1
Change-Id: I5c070adbba6b4abb19467a02d6449a443657ae2b
2021-09-20nm_*_fsm: Set adminsitrative state 'shutting down' when shutdown procedure ↵Pau Espin Pedrol1-0/+1
starts Change-Id: I0d14840a55642812b865687a6cb208e7ffd22829
2021-09-20Allow setting administrative state through oml_mo_state_chg()Pau Espin Pedrol1-1/+1
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-20abis.c: Fix mess with priv->bsc_oml_hostPau Espin Pedrol1-1/+1
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-20abis.c: Transition to CONNECTED state only when OML link is upPau Espin Pedrol1-0/+1
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-15abis.h: Drop unused statePau Espin Pedrol1-10/+0
Change-Id: I11173af3a543f6679ca9d43064bf071c214b1898
2021-09-14Support configuring TA loop SACCH block ratePau Espin Pedrol2-0/+3
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-13MS Power Control Loop: Feed UL C/I from correct measurement periodPau Espin Pedrol1-2/+4
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