aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/l1_if.h
AgeCommit message (Collapse)AuthorFilesLines
2019-10-05bts-trx: Drop unused func check_transceiver_availability()Pau Espin Pedrol1-1/+0
After getting rid of transceiver_available, this function is not used anymore by any code, since its per-trx counterpart l1if_provision_transceiver_trx() is the one used by other code. Change-Id: If5a988eb14658a78dd46234dccc052dc12fb872a
2019-10-05bts-trx: Rework code handling poweron statePau Espin Pedrol1-2/+2
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: Allocate struct osmo_trx_clock_state as part of bts-trx private dataPau Espin Pedrol1-0/+44
Related: OS#4215 Change-Id: I9b7ffb51423ada74b8be347c57eade08f307f88f
2019-07-16osmo-bts-trx/trx_if.c: add TRXD header version negotiationVadim Yanitskiy1-0/+4
This change introduces a new command for TRXD header format negotiation - SETFORMAT. If the transceiver does not support the format negotiation, it would reject this command with 'RSP ERR 1'. If the requested version is not supported by the transceiver, status code of the response message should indicate a preferred (basically, the latest) version. The format of SETFORMAT command is the following: L1 -> TRX: CMD SETFORMAT VER_REQ L1 <- TRX: RSP SETFORMAT VER_RSP VER_REQ where: - VER_REQ is the requested version (suggested by the L1), - VER_RSP is either the applied version if matches VER_REQ, or a preferred version if VER_REQ is not supported. If the transceiver indicates VER_RSP different than VER_REQ, OsmoBTS is supposed to reinitiate the version negotiation using the suggested VER_RSP. For example: L1 -> TRX: CMD SETFORMAT 2 L1 <- TRX: RSP SETFORMAT 1 2 L1 -> TRX: CMD SETFORMAT 1 L1 <- TRX: RSP SETFORMAT 1 1 If no suitable VER_RSP is found, or the VER_REQ is incorrect, the status code in the response would be -1. As soon as VER_RSP matches VER_REQ in the response, the process of negotiation is complete. Changing the header version is supposed to be done before POWERON. Change-Id: I8afe950bd1ec2afaf3347ff848ee46e69c4f5011 Related: OS#4006
2019-06-01osmo-bts-trx/l1_if.h: drop unused ho_rach_detect from trx_l1hVadim Yanitskiy1-1/+0
Change-Id: I90b6d7fb1bb7ba2f8b1f500043635b0ae5cb4495
2018-11-20bts-trx: setup timer once at creation timePau Espin Pedrol1-0/+1
The setup is only needed once, so no need to set it every time we want to schedule it. Furthermore, it will ease new code introduced in follow-up patches, which will schedule this timer under some circumstances without need to send a message at the same time (because re-try of a cmd after a delay is wanted). This commit adds an alloc function and an init function to keep different parts of the code decoupled and avoid exposing more implementation details between them (like exposing the trx_if timer). Change-Id: I3b6461d0130d25284e673c5efce0b3832c48bbb5
2018-02-27trx/scheduler: Use integer math for TOA (Timing of Arrival)Harald Welte1-1/+1
There's no need to express TOA as a float: * We receive it as signed 16bit integer in units 1/256 symbol periods * We pass it to L1SAP as signed integer in 1/4 symbol periods So turn it into an int16_t with 1/256 symbol period accuracy throughout the code to avoid both float arithmetic as well as loosing any precision. Change-Id: Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec
2018-02-19trx: make l1if_fill_meas_res() staticHarald Welte1-2/+0
it's not used anywhere outside of l1_if.c, so make it a static function Change-Id: If988a7679f3a9253fab1a4d177a276d8ecaf794f
2018-01-19bts-trx: Detect duplicated responses for retransmitted commandsPau Espin Pedrol1-0/+3
It was detected that under some conditions, osmo-trx (with limesdr) may take a long time to answer to CMDs, which means trx_ctrl_timer will trigger re-transmitting the last sent but yet unacked CMD. Due to the high latency in osmo-trx, the original AND the rentrasnmited CMD are handled after a while and RSP messages are sent for both. When osmo-bts-trx receives the first RSP, it was marking the CMD as acked and carried on with next one. Then, when the RSP from the retransmited CMD arrives, it already lost state and doesn't know where does that come from. As a result, osmo-bts-trx shutdowns. The issue can be seen in the following truncated log from osmo-bts-trx with TRX category enabled: 20180117135228175 Enqueuing TRX control command 'CMD RXTUNE 1782000' 20180117135228175 Enqueuing TRX control command 'CMD TXTUNE 1877000' 20180117135228175 Enqueuing TRX control command 'CMD SETTSC 7' 20180117135228175 Enqueuing TRX control command 'CMD POWERON' 20180117135228175 Enqueuing TRX control command 'CMD SETRXGAIN 1' 20180117135228175 Enqueuing TRX control command 'CMD SETPOWER 20' 20180117135228175 Enqueuing TRX control command 'CMD SETSLOT 0 5' ... 20180117135249829 Response message: 'RSP POWEROFF 0' 20180117135249855 Response message: 'RSP RXTUNE 0 1782000' 20180117135249876 Response message: 'RSP TXTUNE 0 1877000' 20180117135249876 Response message: 'RSP SETTSC 0 7' 20180117135250648 Response message: 'RSP POWERON 0' 20180117135251150 Response message: 'RSP SETRXGAIN 0 0' 20180117135253151 No response from transceiver for phy0.0 (CMD SETPOWER 20) 20180117135253777 Response message: 'RSP SETPOWER 0 20' 20180117135254535 Clock indication: fn=2018878 20180117135255777 No response from transceiver for phy0.0 (CMD SETSLOT 0 5) ... 20180117135256858 Response message: 'RSP SETPOWER 0 20' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETPOWER 0 20' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETSLOT 0 0 5' Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a
2017-07-01TRX: merge/simplify l1_if and trx_if codeHarald Welte1-3/+0
Related code / function structure still dates back to the pre-phy_link days. Let's clean this up to make things less convoluted and reduce the number of non-static symbols needed between code split over two files. Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d
2017-06-29osmo-bts-trx: fix missing frame number in MEAS INDPhilipp Maier1-1/+1
The layer 1 interface (l1_if.c) for osmo-bts-trx does not include the frame number into the measurement indications it forwards to higher layers. The frame number is required to properly detect the end of a measurement period. Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70
2017-02-10osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second ↵Ivan Klyuchnikov1-0/+9
channel (TRX1) of osmo-trx Move rxgain and tx-attenuation (power) parameters from phy_link layer to phy_inst layer. Rxgain and tx-attenuation parameters should be set for each phy_inst and send for each osmo-trx channel accordingly via control commands. Change-Id: I4861a59d10d1ef91954e0c6ea265e66dec08844f
2016-12-01trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.Alexander Chemeris1-0/+4
Originally `maxdly` command in osmo-trx was contrlling max TA for Normal Bursts. This was not a proper behaviour, because it was used to "control maximum distance a handset can attach from" which is controlled by Access Bursts max TA. Osmo-trx was corrected to apply `maxdly` to Access Bursts and a new command was introduced to contrl max TA for Normal Bursts - `maxdlynb`. This patch adds support for this configuration command into osmo-bts-trx. If you wonder why would you need that - some test equipment (namely R&S CMD57) has really bad timing sync and can generate signal a few symbols off. That prevents osmo-trx from properly receiving otherwise perfectly good bursts generated by CMD57. This configuration is a solution for this. Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277
2016-02-15Introduce new phy_link and phy_instance abstractionHarald Welte1-12/+6
This way we can model a flexible mapping between any number of PHYs, each having multiple instances, and then map BTSs with TRXx on top of those PHYs.
2016-02-15TRX: Move scheduler to src/commonHarald Welte1-1/+1
This is the final step to make the L1 scheduler generally available to other BTS models than OsmoTRX.
2016-02-15TRX: factor out the scheduler from remaining codeHarald Welte1-112/+9
The L1 scheduler is a generally useful component that is unfortunately tied quite a bit into the OsmoTRX support. Let's try to separate it out by having separate per-trx/per-ts/per-chan data structures pre-fixed with l1sched_ Using this patch it should be one step easier to use the scheduler for other BTS models, such as the intended upcoming virtual BTS.
2016-01-16TRX: Don't use magic numbers when we have #definesHarald Welte1-12/+12
2016-01-16TRX: mark scheduler data structures as 'const'Harald Welte1-1/+1
Those are read-only tables which should end up in the text segment and not in writable data.
2015-09-22trx: Implement BER calculations.Alexander Chemeris1-2/+4
A known issue with this code is that BER is not updated for lost TCH frames, because osmo-trx doesn't send any indication for them and we don't have a callback to handle this. Otherwise the code seem to work fine.
2015-09-22trx: Add option to set transmit power reduction via OML (BSC)Andreas Eversberg1-0/+1
2015-09-22TRX: Handover access burst supportAndreas Eversberg1-0/+4
2015-09-22TRX: Report measurementsAndreas Eversberg1-1/+5
2015-09-22TRX: Fixed typos tranceiver -> transceiverAndreas Eversberg1-4/+4
2015-09-22TRX: Support for TCH/H and GSM half rate transcodingAndreas Eversberg1-0/+4
2015-09-22TRX: Support for AMR full speechAndreas Eversberg1-0/+11
2015-09-22Get RSSI from received uplink data and send to PCUAndreas Eversberg1-0/+4
2015-09-22TRX: Code cleanup, prepare for other codecs than GSM full rateAndreas Eversberg1-2/+10
2015-09-22TRX: Implementation of MS power and timing advance loopsAndreas Eversberg1-0/+9
2015-09-22TRX: CipheringAndreas Eversberg1-0/+6
2015-09-22TRX: Detect missing received bursts and fill them with zero-sbitsAndreas Eversberg1-0/+1
2015-09-22TRX: Lost TCH frame detection of omitted bursts from tranceiverAndreas Eversberg1-1/+1
2015-09-22TRX: Completed TCH/F full rate supportAndreas Eversberg1-0/+1
Full rate is now tested and working.
2015-09-22TRX: Use received TRX clocks to determine availablility of tranceiverAndreas Eversberg1-0/+1
Only if transceiver becomes available, control commands are sent. If tranceiver is gone, reset scheduler. The current availability state is sent to BSC via OML state change commands.
2015-09-22TRX: Fixes and improvements of schedulerAndreas Eversberg1-0/+2
2015-09-22TRX: Introduce osmobts-trx, a layer 1 implementation for OpenBTS tranceiversAndreas Eversberg1-0/+121
The code is quite complete, TCH and PDCH channels are not yet tested.