aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-10-05bts-trx: Don't reset transceiver_available in scheduler_trx.cPau Espin Pedrol1-3/+0
It can be dropped since bts_shutdown() ends up calling immediatelly bts_model_trx_close() which in turn calls bts_model_trx_close() which sets enabled = false and calls l1if_provision_transceiver_trx() to power off the TRX. Related: OS#4215 Change-Id: If8b3d2379d7ae102e1c338f4558ac1352de761cc
2019-10-05bts-trx: Rework code handling poweron statePau Espin Pedrol6-51/+78
Use of variables in each code is confusing and mixing configuration with POWERON/POWEROFF state (which is at least per phy inst and not per TRX, since those commands are only expected on the 1st phy inst). * field "poweron" becomes "enabled", and is used as an indicator for actions to take during TRX provisioning (hether to power it on and configure it or to power it off). * poweron/poweroff state becomes "powered", and it is shared by all trx in same phy_link, and is updated only after confirmation by TRX. * poweron_set becomes poweronoff_set (because it's used by both POWERON and POWEROFF), and becomes shared by all trx in same phy_link, since those CMDs are usually sent by first phy instance of the link (the first trx). Related: OS#4215 Change-Id: Icd0b482f1454236432e1952220bbec9d178b8607
2019-10-05bts-trx: trx_set_bts(): Avoid double loop by checking current trxPau Espin Pedrol1-2/+1
check_transceiver_availability() is a loop over every trx, same to what trx_set_bts() does, so let's call the per-trx version directly. Change-Id: I8843c1438c6af700631aba7b7e72aae0bdb7ec3a
2019-10-05bts-trx: vty: Print phy link state in cmd 'show transceiver'Pau Espin Pedrol3-1/+16
Change-Id: I8e49f8edad9f9c68d110dbb7faeea5143aa91022
2019-10-05bts-trx: Allocate struct osmo_trx_clock_state as part of bts-trx private dataPau Espin Pedrol3-44/+52
Related: OS#4215 Change-Id: I9b7ffb51423ada74b8be347c57eade08f307f88f
2019-10-05struct gsm_bts: Add model_priv pointer handing bts_model specific dataPau Espin Pedrol6-24/+33
Currently there's bts-virtual specific fields in gsm_bts which is not used by other models and are always allocated. An alternative would be having a union with different structs inside, one per model, but since we already have the bts_model abstraction, in this case it makes more sense to use that abstraction instead of filling code with preprocessor ifdefs to guard against non-defined types, etc. Existing model specific data is moved there. This new infra will be user further in forthcoming commits. Related: OS#4215 Change-Id: Ib17a752cdbaa7d5eb8c5dfa0b197f80a4f38b38e
2019-10-04common/l1sap: increase ToA precision for packet Access BurstsVadim Yanitskiy1-1/+2
QTA is a Timing Advance value in units of 1/4 of a symbol. Let's use ToA256 (1/256 of a symbol) field of L1SAP RACH.ind as a base for QTA calculation in order to achieve better precision. Change-Id: I6e6fa7985c430a9bdbd12af2a8b2a5a66f11a41c
2019-10-04osmo-bts-trx/scheduler: also detect TSC for Access Bursts on PDCHVadim Yanitskiy1-3/+4
If a logical channel, on which an Access Burst has been received, is not either of RACH, PDTCH or PTCCH, then this is a handover Access Burst, which is always encoded as 8-bit and shall contain the generic training sequence (TS0). Access Bursts on a PDCH time-slot are not related to handover. Change-Id: If7d6135d6c4d7f9bd71d9fab6f8adc3f8cfd10ea
2019-10-04scheduler: fix handling of PTCCH/U and PTCCH/D logical channelsVadim Yanitskiy4-8/+26
According to 3GPP TS 45.010, section 5.6.2, for packet-switched channels the BTS shall monitor the delay of the Access Bursts sent by the MS on PTCCH and respond with timing advance values for all MS performing the procedure on that PDCH. According to 3GPP TS 45.002, section 3.3.4.2, PTCCH (Packet Timing advance control channel) is a packet dedicated channel, that is used for continuous Timing Advance control (mentioned above). There are two sub-types of that logical channel: - PTCCH/U (Uplink): used to transmit random Access Bursts to allow estimation of the Timing Advance for one MS in packet transfer mode. - PTCCH/D (Downlink): used by the network to transmit Timing Advance updates for several MS. As per 3GPP TS 45.003, section 5.2, the coding scheme used for PTCCH/U is the same as for PRACH as specified in subclause 5.3, while the coding scheme used for PTCCH/D is the same as for CS-1 as specified in subclause 5.1.1. The way we used to handle both PTCCH/U and PTCCH/D is absolutely wrong - they have nothing to do with xCCH coding. Instead, we need to use tx_pdtch_fn() for Downlink and rx_rach_fn() for Uplink. In l1sap_ph_rach_ind() we need to check if an Access Burst was received on PTCCH/U and forward it to OsmoPCU with proper SAPI value (PCU_IF_SAPI_PTCCH). To be able to specify a SAPI, a new parameter is introduced to pcu_tx_rach_ind(). Change-Id: I232e5f514fbad2c51daaa59ff516004aba97c8a3 Related: OS#4102
2019-10-02l1sap: Log conn dropped due to radio link counter timeoutPau Espin Pedrol1-1/+5
Change-Id: I78c5ff00be8d2c870ed0277294a8e499ba8a8d95
2019-10-02scheduler: Use OSMO_ASSERT instead of abortPau Espin Pedrol1-4/+3
Change-Id: I594842b08cdb97a473273ba7097a05502f5751b8
2019-10-02scheduler.c: Move some message log level to DEBUGPau Espin Pedrol1-4/+4
Otherwise using "logging level set-all info" makes it impossible to see anything in VTY due to tons of those two lines appearing. Change-Id: I9c7500c1e56db0c4dcb474f93c882a9c7c004d55
2019-09-27bts.h: Remove non-existent function definitionsPau Espin Pedrol1-8/+0
Change-Id: I4d06e1cdea5970cbb493f29980b1c04e01c0e8a4
2019-09-27bts-trx: vty: Use API to get poweron statePau Espin Pedrol1-1/+1
Change-Id: I8b78e1ad34f19d8fe348b9c975742fc0f7112da2
2019-09-19doc: bts-models.adoc: Fix typos in rts-advance sectionPau Espin Pedrol1-2/+2
Change-Id: I37ba104ec0538f8eb9345ff880660aefbdaa44ca
2019-09-19bts-trx: Change super verbose IDLE ind not-supported line to DEBUGPau Espin Pedrol1-1/+1
It's impossible to see other logging otherwise. Change-Id: I64ee83b734ecff593ff2a1cf97b192db93228e22
2019-09-12osmo-bts-trx/scheduler: fix: check rc of osmo_ecu_frame_out()Vadim Yanitskiy1-2/+4
Change-Id: I32d244f5ddef46c8b8719f5ec27b7456514d407a Fixes: CID#204005 (CID#204007), CID#204006 (CID#204004)
2019-09-10bts-trx: Log case where no SETFORMAT is sentPau Espin Pedrol1-5/+12
If VTY cmd "osmotrx trxd-max-version 0" is used, max version 0 is used (default starting one) and hence no need to send SETFORMAT (this is useful in order to avoid sending SETFORMAT to old TRX implementations not supporting the command). In this case, let's inform the user that indeed osmo-bts won't send SETFORMAT because version 0 is assumed. Change-Id: I7136ea6745c2275278bc400676b58fb4b10da966
2019-09-10osmo-bts-trx: migrate to new generic ECU abstractionHarald Welte4-33/+81
libosmocodec has recently introduced a generic ECU abstraction layer which supports (pluggable) Error Concealment Units for not only the FR codec, but potentially any other codec, too. Change-Id: I001005aae6de76d4e045b8dc572239f057bb150d Depends: libosmocore I4d33c9c7c2d4c7462ff38a49c178b65accae1915
2019-09-07osmo-bts-trx/scheduler: add FIXME note about FACCH/H and BFIVadim Yanitskiy1-0/+2
Change-Id: Ie006cd46cb574d272fbe3b38595a3087617c79d1
2019-09-07osmo-bts-trx/scheduler: fix tx_tch_common(): do not send AMR BFI twiceVadim Yanitskiy1-1/+0
We call _sched_compose_tch_ind() after the switch statement, so there is no need to send it from case 'GSM48_CMODE_SPEECH_AMR'. Change-Id: I0488082494120157ac438d7763b52e3998f0eac7
2019-09-07osmo-bts-trx/scheduler: prevent uninitialized memory accessHarald Welte1-6/+18
When sending an AMR BFI, we need to call osmo_amr_rtp_enc() with AMR_BAD as the last parameter. This function returns the length of encoded payload, which needs to be at least 2 octets long. If osmo_amr_rtp_enc() returns a length value lower than 2 octets (what should not happen in general), we should neither call memset() on it, nor call _sched_compose_tch_ind(). Change-Id: I70ce98c5697b9ce6fac7ab57a5d70f3201db29d9 Fixes: CID#178648, CID#178637, CID#178651
2019-09-07common/rsl.c: fix possible NULL-pointer dereferenceVadim Yanitskiy1-1/+5
Change-Id: I11a35a8f500fafa7b3c93d2f2244cc4d42f09f1b Fixes: CID#203810
2019-09-07doc: Update Abis manual RSL section with ETWS related infomrationHarald Welte1-0/+48
Change-Id: I969153a204c167783ba394c9a911ff4484ded759
2019-09-06pcu_interface: Forward ETWS Primary Notification to PCUHarald Welte4-0/+36
All MS/UE must be notified of ETWS Primary Notifiations. Depending on their state, the notification goes different paths: * CS dedicated mode: BSC sends it as L3 message over LAPDm / DCCH * CS/PS idle mode: BTS sends paging messages on PCH * PS TBF active: PCU send Packet Application Info This enables the last of the three methods by passing any ETWS Primary Notifications received over RSL via the PCU socket into the PCU. Change-Id: Ic0b3f38b400a0ca7e4089061ceb6548b0695faa6 Related: OS#4047, OS#4048
2019-09-05ETWS Primary Notification via P1 Rest OctetsHarald Welte6-14/+202
The ETWS (Earthquake and Tsunami Warning System) uses a so-called ETWS Primary Notification which is sent * to phones in dedicated mode (via DCCH from the BSC) * to phones in idle mode (via P1 Rest Octets on PCH/CCCH) This patch implements the second part of the functionality, i.e. transmitting the related ETWS Primary Notification via PCH. As 3GPP doesn't specify how this is communicated over Abis, we use a new, vendor-specific RSL message type. Closes: OS#4047 Depends: libosmocore I89c24a81ada6627694a9632e87485a61cbd3e680 Depends: libosmocore I36fc2ffc22728887d1cb8768c7fcd9739a8ec0fc Change-Id: I18c60cdb86b9c19e09f5ec06d66e9b91608880e6
2019-08-29pcu_sock: fix endian-swapped CellIDOliver Smith1-1/+1
Convert the cell identity to LE when sending it to the PCU via unix socket, just like we do it with the location area code. In the Osmocom stack, the CellID is configured in OsmoBSC, sent as BE via RSL to OsmoBTS, then with a socket to OsmoPCU (where OsmoPCU expects it to be LE in a LE system). OsmoBTS was always sending the CellID as BE to OsmoPCU. In March 2018, a regression in OsmoPCU [1] caused an endianness swap in the CellID on LE systems, resulting by chance in the correct, LE encoded, CellID as it should have been sent from OsmoBSC (for LE systems). This regression was fixed in March 2019 [2]. I've verified this fix with a TTCN3 test [3]. [1] I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu) [2] I2f6cc930c5dbf8dac386b24b0756df2efe8199e4 (osmo-pcu) [3] I6516808f4b9e9a2301f9ccc1e55ded14e7334c33 (osmo-ttcn3-hacks) Related: OS#3854 Change-Id: I68faf4558f0686fb2a3db24077dceaae05bf0262
2019-08-23virtual: set link quality for GSMTAP_CHANNEL_RACHOliver Smith1-0/+1
Don't ignore all incoming RACH requests anymore: 000881/00/23/14/09 Ignoring RACH request: link quality (0) below the minimum (50) Related: OS#3925 Fixes: b777c0f3ecb8b770f032db449e947f0f9731de11 ("Move Access Burst link quality handling to L1SAP") Change-Id: Ifcd576fed84346688e711a26a05c6d350588e83d
2019-08-23Cosmetic: virtual: l1sap.c: fix typosOliver Smith1-1/+1
Change-Id: Id24e75812bda17e99f17a37b367462533a5607f9
2019-08-07Bump version: 1.0.1 → 1.1.01.1.0Pau Espin Pedrol1-0/+187
Change-Id: I708f6a63b51459d77368c48e115f64aaa6646bfd
2019-08-07configure.ac: Require libosmocore 1.2.0Pau Espin Pedrol1-6/+6
Some commits started using libosmocore APIs osmo_gsm48_rest_octets_si3_encode() and lapdm_channel_init2(), which are only available in latest libosmocore release 1.2.0. Let's update configure.ac accordingly. Fixes: 1e96e31c106aed9192ed9ea78ff1a711464390d7 Fixes: 46d62b984a10b3966d8a0d0a435d4efab0e9c500 Change-Id: If84c53d8192e8db98eb9439b898d83e94c5e5476
2019-08-05Remove undefined param passed to {logging,osmo_stats}_vty_add_cmdsPau Espin Pedrol6-7/+7
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However, definition in C file doesn't contain "(void)", which means number of parameters is undefined and thus compiler doesn't complain. Let's remove parameters from all callers before enforcing "(void)" on it. API osmo_stats_vty_add_cmds never had a param list but has seem problem (no "void"), so some users decided to pass a parameter to it. Change-Id: Ia4d1a7914308d1481fe31fe0986265ead339e61e Related: OS#4138
2019-08-02scheduler_trx: Handle negative return of gsm0503_tch_hr_decode()Harald Welte1-1/+1
If gsm0503_tch_hr_decode() returns a negative error, we shouldn't set the marker bit or pass the negative value as length value into osmo_hr_check_sid(). Change-Id: If49ca6926c576a2b17507b6a95b6f3ca17877d66 Closes: CID#187645
2019-07-31osmo-bts-trx: Don't attemtp to adjust MS power if fixedHarald Welte1-0/+3
If the BSC has instructed the BTS via RSL to not autonomously perform MS power control, we are storing this in lchan->ms_power_ctrl.fixed. However, osmo-bts-trx would simply ignore that flag in loops.c and continue to compute new MS power values based on measurement results. Change-Id: I628d1f4f1094c22248d372c11c2ecc504135b757
2019-07-31osmo-bts-trx: Don't increment rssi_valid_count twiceHarald Welte1-1/+0
In the ms_power_val() function, don't increment the number of valid RSSI values counter twice. Change-Id: I19d9d933a69f7ad6252cbe51751d5db41790c698
2019-07-24trx: Use LOGPPHI instead of LOGP in some more messagesPau Espin Pedrol1-10/+10
This allows to clearly identify the phy instance owning those messages. Change-Id: I90990e4dbcbb2fb4a3fcb24658bdf53e57030bcf
2019-07-24manuals: Update vty documentationDaniel Willmann1-1633/+1742
This documentation only includes commands for osmo-bts-virtual Change-Id: Icc0c96d173f31f2eb5fcb6385525a17f94ead852 Related: OS#1700
2019-07-23bts-trx: Introduce VTY command osmotrx trxd-max-versionPau Espin Pedrol4-4/+36
This command allows setting a maximum TRXD format version to negotiate with TRX. osmo-bts-trx will hence end up using that version if supported by TRX, or a lower one otherwise (or fail if TRX doesn't support any of them). Since now the maximum version can be 0, avoid going through SETFORMAT negotiation in that case, since 0 is the default version. This way we keep backward compatibility with TRX implementations that exit upon receival of unknown commands (such as SC5 current one). The VTY command is located in the "phy" node instead of the "phy instance" node because instances of same phy are expected to use same host with same implementation, so TRXD version to use should be the same for both. Related: OS#4006 Change-Id: I5eb1fdc002f9d7f4acf475356d8fc998dc8f6326
2019-07-21osmo-bts-trx/scheduler: rx_data_fn(): provide actual C/I ratio to L1SAPVadim Yanitskiy1-2/+14
Change-Id: Iea0dad65e9bc511f99375fd3ee2eb44e47a6168f
2019-07-21osmo-bts-trx/scheduler: rx_rach_fn(): provide actual C/I ratio to L1SAPVadim Yanitskiy1-2/+4
Change-Id: I8d86dec7ebc039cbfd038c4342ff328b11281865
2019-07-21Move Access Burst link quality handling to L1SAPVadim Yanitskiy6-21/+19
Change-Id: I893ec9c6c2ebad71ea68b2dc5f9f5094dfc43b78 Depends: (libosmocore) Ie2a66ebd040b61d6daf49e04bf8a84d3d64764ee
2019-07-21Clarify and refactor link quality (C/I) handlingVadim Yanitskiy9-22/+22
The radio link quality is defined by C/I (Carrier-to-Interference ratio), which is computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the actual (received) one. Link quality measurements are used by L1SAP to filter out "ghost" Access Bursts, and by the link quality adaptation algorithms. One can define minimum link quality values using the VTY interface. On the VTY interface we expect integer C/I values in centiBels (cB, 10e-2 B), while the internal structures are using float values in deciBels (dB, 10e-1 B). Some PHYs (sysmo, octphy, oc2g, and litecell15) expose C/I measurements in deciBels, while on the L1SAP interface we finally send then in centiBels. Let's avoid this confusion and stick to a single format, that will be used by the internal logic of OsmoBTS - integer values (int16_t) in centiBels. This will give us the range of: -32768 .. 32767 centiBels, or -3276.8 .. 3276.7 deciBels, which is certainly sufficient. Change-Id: If624d6fdc0270e6813af8700d95f1345903c8a01
2019-07-21sysmo/l1_if.c: Annotate fall-through in switch statementHarald Welte1-0/+1
Change-Id: I72937e087288fe7681fafe4099e49849657924bd Closes: CID#162019
2019-07-18manuals: Add counter documentationDaniel Willmann3-0/+72
Change-Id: I994ad6aae7f409e0f15ff1d388127e16243b378a Related: OS#1700
2019-07-18common/rsl.c: fix: properly handle SI3 Rest OctetsVadim Yanitskiy1-1/+3
It was noticed with old Sony Ericsson phones (like W595 and K510i) that the service provided by Osmocom network becomes unreliable from time to time. The RSSI indicator on those phones shows that the signal is lost, so neither CS nor PS services are working. As it then turned out, System Information 3 broadcasted on the Um interface is different than the one received from the BSC. In particular, the content of SI3 Rest Octets IE is different. Among with the 'GPRS Indicator', which is actually expected to indicate whether the PCU is connected or not, SI3 Rest Octets on the Um interface contain both 'Optional Power Offset' and 'Scheduling if and where' IEs, which are not present in the original messages from the BSC. Moreover, as soon as the PCU is connected, 'GPRS Indicator' IE contains different 'GPRS RA Colour' value, and informs the MS that System Information 13 is sent on extended BCCH, which is not even supported by OsmoBTS! The culprit is in rsl_rx_bcch_info(), where we pass a pointer to osmo_gsm48_rest_octets_si3_decode(). Instead of passing a pointer to the beginning of SI3 buffer, we actually need to shift it to the beginning of the SI3 Rest Octets IE. This change makes my Sony Ericsson phones happy ;) Change-Id: Ia962cf21903ba674057cf52746996dd3254bc1c6
2019-07-17fix spelling stuff mentioned by lintianThorsten Alteholz4-4/+4
Change-Id: I3d6cb6fc1b182d8520ba60e431ab9b74e71d5e3c
2019-07-16osmo-bts-trx/scheduler: rx_rach_fn(): enrich debug messageVadim Yanitskiy1-3/+9
Change-Id: I1cb28a9d6c98993705b73937409276994f375dc0
2019-07-16osmo-bts-trx/scheduler: rx_rach_fn(): clarify handover RACH handlingVadim Yanitskiy1-1/+2
Change-Id: I3da39d48052af1759297f4ad75c220b3046c0691
2019-07-16osmo-bts-trx/scheduler: rx_rach_fn(): use optional TSC info from TRXVadim Yanitskiy1-9/+12
TSC (Training Sequence Code) is an optional parameter of the UL burst indication. We need this information in order to decide whether an Access Burst is 11-bit encoded or not (see OS#1854). If this information is absent, we try to correlate the received synch. sequence with the known ones (3GPP TS 05.02, section 5.2.7), and fall-back to the default TS0 if it fails. Since the new TRXD header version, the training sequence code is indicated by the transceiver. Let's use it! Change-Id: I1e654a2e49cb83c5f1e6249c0de688f99bc466b0 Related: OS#1854, OS#4006
2019-07-16osmo-bts/scheduler: provide actual C/I values to OsmoPCUVadim Yanitskiy2-3/+18
C/I (Carrier-to-Interference ratio) is a value in cB (centiBels), computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the actual one. So far, there was no way to expose more measurements from OsmoTRX, excluding both RSSI and ToA. Since the new version of TRXD header, we can receive C/I indications and send the averaged (per 4 bursts) values to OsmoPCU (as a part of PCUIF_DATA.ind). Please note that we also need to attach C/I measurements to the following L1SAP primitives: - PRIM_PH_RACH.ind, - PRIM_PH_DATA.ind, - PRIM_TCH.ind, but this will be done in the follow up changes. Change-Id: Ia58043bd2381a4d34d604522e02899ae64ee0d26 Fixes: OS#1855