Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
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
|
|
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
|
|
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
|
|
Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a
|
|
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
|
|
Change-Id: I9250e3003cff24035440bbba3e1171650dc83209
|
|
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
|
|
We unconditionally pass "p+1" into sscanf() despite not knowing
if 'p' is NULL or not.
Change-Id: I40a49c3feb3b55ef577eebd7d567afdbcfe0d624
Fixes: Coverity CID#178661
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
The new name makes it clear what the function actually does: Send burst
data via the trx interface.
Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa
|
|
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
|
|
Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c
|
|
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9
Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
|
|
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
|
|
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
|
|
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>
|
|
Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644
Related: OS#1648
|
|
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
|
|
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
|
|
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.
|
|
This is the final step to make the L1 scheduler generally available
to other BTS models than OsmoTRX.
|
|
This funciton (and associated static functions) are TRX specific,
and scheduler.c should only contain generic code.
|
|
|
|
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.
|
|
|
|
Not really a bug, as we're smart about it down the stream, but it's better to
be strict here as well.
|
|
osmo-trx never supported separate power control for trx's, but now it started
to be more strict about it.
|
|
If frame number is out of range (>= 2715648), the scheduler's process
would end up in an infinite loop. This is because the loop would schedule
bursts until the indicated frame number is reached, which would not be
possible.
The openbts, calypso-bts and osmo-trx might send out out of range clock
indications every 3.5 hour.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If no clock is received, a POWEROFF is sent until clock is detected.
|
|
Ignore false response to uncritical commands.
|
|
|
|
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.
|
|
|
|
The code is quite complete, TCH and PDCH channels are not yet tested.
|