aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_if.c
AgeCommit message (Collapse)AuthorFilesLines
2019-10-09bts-trx: Log TRXC and TRXD socket recv()/send() failuresPau Espin Pedrol1-5/+23
Related: OS#4215 Change-Id: Ic3e41d82b43459495d45873d612a3bd349ac174a
2019-10-05bts-trx: Get rid of messy transceiver_available state handlerPau Espin Pedrol1-15/+8
This variable meaning has been changing its exact meaning over time until finally not being really clear which kind of state it holds. Initially it seemed to be used to identfy whether CLOCK IND were being received. However, over time both osmo-bts and osmo-trx have evolved and were fixed so that clock indications are only sent by osmo-trx after POWERON command is sent. As a result, this state can be checked simply by looking at the "powered" phy_link variable, which is only set to true once the TRX has confirmed the POWERON command, and hence it is sending CLOCK IND. On the other hand, at some point in time "available" started to be set to 1 in bts_model_phy_link_open(), which means available is nowadays almost always 1 from startup until the end (only dropped during bts_shutdown(), when we are already exiting the process anyway). As a result, !available condition in scheduler_trx.c:trx_fn_timer_cb can almost never happen, because available is set to true already. Only possibility would be if an old process of osmo-trx (not set up by this BTS process) is still sending CLOCK INDs, but in that case we for sure don't want to configure the BTS based on that, but ignore them until this BTS process has again configured the TRX. So that whole check can be dropped. We are better checking for "powered" state, which is far more accurate, and we better do that in trx_if.c before calling trx_fn_timer_cb(). Other uses of "transceiver_available" being used can be changed to use plink->state!= PHY_LINK_SHUTDOWN, since available was already being set to 1 at the same time the plink->state was being set to PHY_LINK_CONNECTING. As a result of this state handling re-arrangement, OS#4215 is fixed since trx_if_powered() is used instead of previous state condition to check whether data frames should be sent. Related: OS#4215 Change-Id: I35f4697bd33dbe8a4c76c9500b82c16589c701d4
2019-10-05bts-trx: Rework code handling poweron statePau Espin Pedrol1-31/+41
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-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-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-16osmo-bts-trx/trx_if.c: encode actual TRXD header versionVadim Yanitskiy1-2/+17
Both TRX2L1 (Uplink) and L12TRX (Downlink) messages should use the same TRXD header format (and version) as was negotiated. Change-Id: Idbc598ef7c1871ee8da830f3fbe0a5cc386f873d Related: OS#4006
2019-07-16osmo-bts-trx/trx_if.c: add TRXD header version negotiationVadim Yanitskiy1-5/+71
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-07-04osmo-bts-trx/trx_if.c: properly describe TRXD messages in logsVadim Yanitskiy1-4/+45
Since we may have different versions of the TRXD header, some new fields of an Uplink burst indication have conditional presence. Therefore we need a smart function to print them conditionally. Change-Id: I68729dc98a1840d2aa9e091153d176a103d5a228 Related: OS#4006
2019-07-04osmo-bts-trx/trx_if.c: drop RSSI / ToA debugging codeVadim Yanitskiy1-13/+0
This kind of debugging can be done using trx_sniff.py tool from the TRX Toolkit [1]. Probably, this code was needed during the initial development and testing. [1] https://git.osmocom.org/osmocom-bb/tree/src/target/trx_toolkit Change-Id: I50e0e5feeba4c3028f55209dd8e41e09ed5f70b1
2019-07-04osmo-bts-trx/trx_if.c: introduce TRXD header version 0x01 supportVadim Yanitskiy1-1/+169
The new version adds the following fields to the TRX2L1 message, keeping the L12TRX message unchanged: +------+-----+-----+-----+--------------------+ | RSSI | ToA | MTS | C/I | soft-bits (254..0) | +------+-----+-----+-----+--------------------+ - MTS (1 octet) - Modulation and Training Sequence info, and - C/I (2 octets) - Carrier-to-Interference ratio (big endian). == Coding of MTS: Modulation and Training Sequence info 3GPP TS 45.002 version 15.1.0 defines several modulation types, and a few sets of training sequences for each type. The most common are GMSK and 8-PSK (which is used in EDGE). +-----------------+---------------------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers (value range) | +-----------------+---------------------------------------+ | . . . . . X X X | Training Sequence Code (0..7) | +-----------------+---------------------------------------+ | . X X X X . . . | Modulation, TS set number (see below) | +-----------------+---------------------------------------+ | X . . . . . . . | IDLE / nope frame indication (0 or 1) | +-----------------+---------------------------------------+ The bit number 7 (MSB) is set to high when either nothing has been detected, or during IDLE frames, so we can deliver noise levels, and avoid clock gaps on the L1 side. Other bits are ignored, and should be set to low (0) in this case. == Coding of modulation and TS set number GMSK has 4 sets of training sequences (see tables 5.2.3a-d), while 8-PSK (see tables 5.2.3f-g) and the others have 2 sets. Access and Synchronization bursts also have several synch. sequences. +-----------------+---------------------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers (value range) | +-----------------+---------------------------------------+ | . 0 0 X X . . . | GMSK, 4 TS sets (0..3) | +-----------------+---------------------------------------+ | . 0 1 0 X . . . | 8-PSK, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 0 1 1 X . . . | AQPSK, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 1 0 0 X . . . | 16QAM, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 1 0 1 X . . . | 32QAM, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 1 1 1 X . . . | RESERVED (0) | +-----------------+---------------------------------------+ == C/I: Carrier-to-Interference ratio The C/I value is computed from the training sequence of each burst, where we can compare the "ideal" training sequence with the actual training sequence, and then express that difference in centiBels. == Limitations - The only supported modulation types are GMSK and 8-PSK. Messages with other modulation types will be rejected. - IDLE / NOPE indications are not (yet) handled. - The logical channel handlers do not (yet) handle optional fields, such as TSC and C/I. This will be implemented in the follow-up changes. Change-Id: If61c71d20d590bf07bfd019afb33000a0b6135bd Related: OS#4006
2019-06-27osmo-bts-trx/trx_if.c: introduce TRXD header version handlingVadim Yanitskiy1-40/+170
It may be necessary to extend the message specific header with more information. Since this is not a TLV-based protocol, we need to include the header format version. +-----------------+---------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers (value range) | +-----------------+---------------------------+ | X X X X . . . . | header version (0..15) | +-----------------+---------------------------+ | . . . . . X X X | TDMA TN (0..7) | +-----------------+---------------------------+ | . . . . X . . . | RESERVED (0) | +-----------------+---------------------------+ Instead of prepending an additional byte, it was decided to use 4 MSB bits of the first octet, which used to be zero-initialized due to the value range of TDMA TN (0..7). Therefore the current header format has implicit version 0. Otherwise Wireshark (or trx_sniff.py) would have to guess the header version, or alternatively follow the control channel looking for the version setting command. This change introduces a new structure 'trx_ul_burst_ind', which represents an Uplink burst and the corresponding meta info. The purpose of this structure is to avoid overloading the existing functions, such as trx_sched_ul_burst(), with more and more arguments every time we bump the version. On receipt of a TRXD message, trx_data_read_cb() now parses the header version, and calls the corresponding dissector functions, e.g. trx_data_handle_(hdr|burst)_v0(). Change-Id: I171c18229ca3e5cab70de0064a31e47c78602c0c Related: OS#4006
2019-06-27osmo-bts-trx/trx_if.c: rename and clarify TRX_MAX_BURST_LENVadim Yanitskiy1-4/+5
This constant actually defines the maximum TRXD message length, which includes the header and burst bits, not just burst. Change-Id: I383125e1c4df039fc6b554833bc8736deacbe731
2019-06-27osmo-bts-trx/trx_if.c: use osmo_loadXXbe() for TDMA FN and ToA256Vadim Yanitskiy1-2/+2
Change-Id: Iec0d86f9be7243578ddc1ab322fc313cb5ac5d0b
2019-06-04bts-trx: trx_if.c: Introduce logging macro LOGPPHIPau Espin Pedrol1-39/+31
This way we unify format. We take the chance to add related information to some log messages which were not printing that information (and was confusing when using more than one phy instance). Change-Id: I5b17a01638ade9a6c41da73e550d5947fa92f568
2019-06-01osmo-bts-trx/trx_if.c: dropping Tx bursts is a noticeable eventVadim Yanitskiy1-2/+1
Change-Id: Ia954b797a9bb90660b6548ec0ffb218a1dcff37a
2018-12-04bts-trx: (n)ack PDCH DEACT only after TRX answered SETSLOTPau Espin Pedrol1-3/+36
Before this patch, PDCH DEACT was (n)acked to the BSC without taking into account if TRX succeeded or failed to set the TS: 20181123044720655 DRLL rsl.c:2523 (bts=0,trx=0,ts=0,ss=0) Rx RLL DATA_REQ Abis -> LAPDm 20181123044720700 DRSL rsl.c:2805 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) ss=0 Rx RSL IPAC_PDCH_DEACT 20181123044720700 DRSL rsl.c:2205 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) Request to PDCH DEACT, but lchan is still active 20181123044720700 DRSL rsl.c:2131 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT NACK (cause = 0x0f) 20181123044720700 DPCU pcu_sock.c:124 Sending info 20181123044720700 DPCU pcu_sock.c:139 BTS is up 20181123044720700 DPCU pcu_sock.c:232 trx=0 ts=7: available (tsc=7 arfcn=868) 20181123044720703 DPCU pcu_sock.c:608 Deactivate request received: TRX=0 TX=6 20181123044720703 DL1C l1sap.c:1519 deactivating channel chan_nr=TCH/F on TS6 trx=0 20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD NOHANDOVER 6 0' 20181123044720703 DL1C l1sap.c:648 deactivate confirm chan_nr=TCH/F on TS6 trx=0 20181123044720703 DRSL rsl.c:714 (bts=0,trx=0,ts=6,ss=0) not sending REL ACK 20181123044720703 DRSL rsl.c:2264 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: channel disconnected, will reconnect as TCH 20181123044720703 DL1C scheduler.c:593 Configuring multiframe with TCH/F+SACCH trx=0 ts=6 20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD SETSLOT 6 1' 20181123044720703 DL1C l1_if.c:780 (bts=0,trx=0,ts=6) bts_model_ts_connect(as_pchan=TCH/F) success, calling cb_ts_connected() 20181123044720703 DRSL rsl.c:2339 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: timeslot connected as TCH/F 20181123044720703 DRSL rsl.c:2440 (bts=0,trx=0,ts=6,ss=0) TCH/F_PDCH switched to TCH/F mode (ts->flags == 0) 20181123044720703 DRSL rsl.c:2103 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT ACK 20181123044720704 DTRX trx_if.c:492 Response message: 'RSP NOHANDOVER 0 6' 20181123044720705 DTRX trx_if.c:492 Response message: 'RSP SETSLOT 0 6 1' Change-Id: I888de761b65c3ea8bfe623fcf009f3b2b57c926c
2018-11-23bts-trx: early return on POWERON successPau Espin Pedrol1-0/+1
Later on it's expected to add more rsp parsing, so let's return here and not depend on generic return further down. Change-Id: I8ddee46374ab329c47dc68e720e236f13d393f66
2018-11-20bts-trx: Allow re-try without exit if POWERON fails in osmo-trxPau Espin Pedrol1-10/+44
If POWERON fails, announce to BSC that the TRX is not available, and announce it as available as soon as POWERON success is received. Related: OS#3692 Change-Id: Iaa8f497381038fd7f9f779a8211ebc6453837c65
2018-11-20bts-trx: setup timer once at creation timePau Espin Pedrol1-4/+6
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-11-19bts-trx: trx_if: Use struct to store CTRL msg parsed responsesPau Espin Pedrol1-22/+28
Change-Id: Icb84bce0621042afa4301678ba1cc58d8e3662bb
2018-02-27trx/scheduler: Use integer math for TOA (Timing of Arrival)Harald Welte1-6/+6
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-01-19bts-trx: Detect duplicated responses for retransmitted commandsPau Espin Pedrol1-2/+16
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
2018-01-19bts-trx: trx_if.c: Improve parsing of received RSP messages from TRXPau Espin Pedrol1-69/+127
First the cached CMD sent (struct trx_ctrl_msg) is reworked to have the cmdname and the params in different buffers for easier comparison with RSP later. For the receive path (trx_ctrl_read_cb), new function helpers are added to parse the buffer into cmdname+params+code (parse_rsp) and to compare if a given RSP matches the current CMD we sent (cmd_matches_rsp). The reasoning behind this patch is that a way to check for parameters when receiving a RSP will be needed in future work, as before this patch checking of parameters is ignored. This commit is a preparation for commit to check for duplicated responses. Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034
2018-01-19bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of funcPau Espin Pedrol1-6/+7
The move includes a small logic change: If there's a mismatch between the rsp and the cmd, now we bts_shutdown instead of blindly skipping expected RSP and continuing with sending the next CMD in the queue. The change is specially not a problem since next patches are improving the logic furthermore to account for duplicates, different parameters, etc. Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e
2018-01-19bts-trx: trx_if.c: Log timedout+retransmitted CMDPau Espin Pedrol1-2/+7
Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a
2017-12-10bts-trx: Avoid enqueueing consecutive duplicate messages to TRXPau Espin Pedrol1-2/+7
While debugging other protocol/timing issues between osmobts-trx and osmo-trx, I found that sometimes two consecutives "POWER OFF" commands are enqueued and sent to osmo-trx. There's no point in doing so, as the write queue already maintains state and retries the command until a RSP is received, then goes for the next one. With this change we hence improve timing response as we don't need to wait for the second command to be processed, and on top we get cleaner logs and simplified states which are easier to debug. Change-Id: Ib6a5e7bfac8bc5e1b372da6a1f801c07a3d5ebb7
2017-12-10bts-trx: trx_ctrl_cmd: Simplify var assignment logicPau Espin Pedrol1-3/+2
Change-Id: I9250e3003cff24035440bbba3e1171650dc83209
2017-11-06trx: Don't assume phy_instance_by_num() returns non-NULLHarald Welte1-0/+2
In trx_clk_read_cb(), when calling phy_instance_by_num(), that function might in error cases return a NULL phy-instance. Let's put an OSMO_ASSERT() there as safeguard to avoid NULL dereference when dereferencing pinst->trx->bts. Fixes: Coverity CID#178657 Change-Id: If6b6b45380368e9ee9e03ca1eb7ac56c21e72b03
2017-11-06trx: Avoid NULL+1 dereference in trx_ctrl_read_cb()Harald Welte1-1/+3
We unconditionally pass "p+1" into sscanf() despite not knowing if 'p' is NULL or not. Change-Id: I40a49c3feb3b55ef577eebd7d567afdbcfe0d624 Fixes: Coverity CID#178661
2017-11-06trx: Better be safe than sorry before calling strlenHarald Welte1-0/+2
There's a lot of pointer arithmetic in trx_ctrl_read_cb which is not so nice. While I believe the current code is safe, Coverity raises "CID 178665: Insecure data handling (INTEGER_OVERFLOW)" regardin the use of rsp_len in the strcmp(). Let's put some OSMO_ASSERT() in front and hope that makes Coverity happy. Change-Id: I5a9b3307f83cdde7c8e9f66932446604f5623b05
2017-08-25osmo-bts-trx: Relax validation to allow TRX data bursts without paddingPau Espin Pedrol1-1/+2
Original OpenBTS transcievers add 2 bytes of padding to the end of data bursts, having in total 158 bytes. As those two extra bytes are being ignored after the initial validation, let's relax this validation a bit in order to accept transcievers that decide no to send these two extra bytes. Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07
2017-08-09TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_linkHarald Welte1-10/+8
Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX (SETTSC) transceiver is a property of the phy_link, and not a property of the BTS. Also, we *really, really* should never use global variables. I'm very happy this is being cleaned up, finally. Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c
2017-07-01TRX: don't free l1h in trx_phy_inst_close()Harald Welte1-1/+0
l1h is allocated in bts_model_phy_instance_set_defaults() and not in trx_phy_inst_open(). Hence, trx_phy_inst_close() should not free() it! Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938
2017-07-01TRX: merge/simplify l1_if and trx_if codeHarald Welte1-55/+92
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-07-01TRX: Rename trx_if_data() -> trx_if_send_burst()Harald Welte1-1/+1
The new name makes it clear what the function actually does: Send burst data via the trx interface. Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa
2017-07-01trx_if: Improve error handlingHarald Welte1-3/+8
There ware some error conditions that the previous code didn't catch and/or report, such as unparseable TRX control strings, non-terminated buffers, ... Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da
2017-07-01TRX: trx_if: Improve code description / commentsHarald Welte1-13/+54
Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c
2017-06-06trx: Allow BTS and TRX to be on different IPsPau Espin Pedrol1-32/+11
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
2016-12-01trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.Alexander Chemeris1-0/+5
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-08-08osmo-bts-trx: Fix PCS1900 operationMike McTernan1-2/+12
As the ARFCN numbers in DCS (1800) and PCS (1900) are not unique, we need to specify the band in the upper bits of the ARFCN value before calling gsm_arfcn2freq10(). Change-Id: I637b76bc1fc749eed8e364412d76606589991c02
2016-07-28trx: Enable EGPRS handling through burst lengthsTom Tsou1-11/+20
Existing interfaces are coded with the implicit expectation of using a burst sequence length of 148, which is constant with GSM and GPRS. That changes with EGPRS, where the burst length may be 444 due to the use of 8-PSK instead of GMSK modulation. Setup the interface to accept and return a length value with the burst sequence. This allows 444 length bit vectors to/from the EGPRS decoder/encoder. Length is explicitly used as a identifier for 8-PSK vs. GMSK modulated sequences. Change-Id: I90b46b46b11b6ce280e7f8232d5a2fccec2d4f18 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-06-22Clarify logging messageMax1-1/+1
Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Related: OS#1648
2016-06-16TRX: Add vty command to power on/off transceiverMax1-3/+4
Add vty command (under "phy X instance Y" hierarchy) to manually send POWERON or POWEROFF command. It's useful for debugging issues related to BTS/TRX initialization. Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Related: OS#1648
2016-06-16Fix OML activationMax1-1/+3
Previously software activation could have been reported multiple times which broke proper BTS init. Introduce guard variable to ensure reporting happens only once. Note: this is just minimal workaround - ideally proper OML state machine should be implemented. Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Related: OS#1648
2016-02-15Introduce new phy_link and phy_instance abstractionHarald Welte1-39/+94
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: scheduler: Move trx_sched_clock() to scheduler_trx.cHarald Welte1-2/+3
This funciton (and associated static functions) are TRX specific, and scheduler.c should only contain generic code.
2016-02-15TRX: scheduler: don't access l1h->config from schedulerHarald Welte1-0/+4
2016-02-15TRX: factor out the scheduler from remaining codeHarald Welte1-1/+1
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: replace some more 2715648 magic numbers with GSM_HYPERFRAMEHarald Welte1-3/+3