We should make sure that required timeslot is not only allocated,
but also configured, i.e. has a correct multiframe layout.
Change-Id: I1d0b870c389802b51c709d089b80ac3fb3565fa8
As we know the count of timeslots per GSM TDMA frame, it would
be better to have an array of pointers to trx_ts instances instead
of linux list, which is more usable for lists with unknown length.
Change-Id: I9510a5cddde22950ceb8422e0990d59f05ed4d60
Both SCH_EVENT_CLCK_IND and SCH_EVENT_CLCK_LOSS were not handled,
moreover there is no purpose to keep them.
Change-Id: I8efac459a40f4287e3325890809991d5ef46e9b1
Local clock counter can be corrected using frame number values,
obtained from burst header on DATA interface.
Change-Id: I5a813e3dc1b960831343b8ecb80718291f20e80d
It would be better to have xCCH, SCH and RACH burst handlers
in separate files, because as much code we add to a single
file, as harder it becomes to read and understand one.
Change-Id: I456a60e68b32b792e63dd03ae97159dc101fd4bf
Previously, L1CTL_RACH_REQ / L1CTL_RACH_CONF messages were
handled without l1ctl_info_ul / l1ctl_info_dl header, what
caused incorrect data parsing.
Change-Id: I145d137f2cc7de234965e4fe64d9367ed6ccb999
Previously, all L1CTL_FBSB_CONF messages were sent without
required l1ctl_info_dl header, what caused unpredictable
behavior on higher layers (L2 & L3). Let's fix it.
Change-Id: I8dae597bb4c09df36f80944434ce3624569f2cf8
Previously, we had both length and string matching of request and
response. To be able to implement commands with additional params
in the future, this change drops the length matching part.
Change-Id: Id4c50115f5f1b1da450ff8b8dcfd6ccf572d23f5
We need to know BSIC value, before sending RACH requests.
So, let's store it in trx_instance and update as soon as
the first SCH burst is received after L1CTL_FBSB_REQ.
Change-Id: I49574c3661f79f3b4941db6c651baebab2665c1b
Initially, it was assumed that TX lchan handler will only
compose a burst and return a pointer to the buffer. A burst
itself could be sent somewhere outside, e.g. by caller.
It would be better to send bursts exactly from handler, because
in this case it isn't required to have an external buffer.
Change-Id: Ic9dcdd366e68cec38c5840ed8f8cdda8236d67c7
For some reasons, OsmoTRX sends 158-byte long sequences on DATA
interface, where the latest two bytes aren't used.
Change-Id: Ie9295e9b0d8956d9e87e2ced8cca9d5e68040f88
Previously, the content of L1CTL_FBSB_REQ message was only used
to obtain a new ARFCN and retune transceiver. Now, since we have
working TDMA scheduler, some other params (like ccch_mode) may be
used too.
Change-Id: Iccabba376d67e091b55a604a2ae87f2aa86362e5
The core of scheduler is a simple clock counter, which relays
on system time for now. One was a bit simplified and migrated
from OsmoBTS.
Due to system time is not an ideal clock source, the counter
should be periodically corrected by clock indications from BTS.
Change-Id: I27d85bd3e2c8bca3f876f73517027b9fe43c9825
Now it's possible to handle the following requests
from layer23 apps:
- L1CTL_FBSB_REQ
- L1CTL_PM_REQ
- L1CTL_RESET_REQ
- L1CTL_ECHO_REQ
It should be noted, that the L1CTL_PM_REQ isn't
handled correctly yet, due to required task isn't
implemented on the TRX side yet. Instead of this,
temporary we are sending some fake responses.
Change-Id: I343eca3e20922ddd83e06231811200b26da442f3
This change introduces the following state machines:
- trxcon_app_fsm - main application state machine.
This state machine handles different events, raised
from program modules (such as trx_if.c or l1ctl.c).
- l1ctl_link_fsm - L1CTL server state machine.
- trx_interface_fsm - TRX interface state machine.
The program modules (such as trx_if.c or l1ctl.c) should be as
much independent from each other as possible. In other words,
one module should not call methods from another, e.g. L1CTL
handlers are not able to send any command to transceiver directly.
Instead of that, they should use shared event set to notify the
main state machine about something. Depending on current state
and received event, main state machine 'decides' what to do. This
approach would allow to easily reuse the source code almost 'as is'
anywhere outside the project.
Change-Id: I7ee6fc891abe5f775f5b7ebbf093181a97950dea
This is the second side of the 'OsmocomBB <-> SDR' bridge.
Most of source code taken from the OsmoBTS project.
Change-Id: I96fa3ada05d010f31af419a4950fd8ae2b62ef34
There are two sides of the 'OsmocomBB <-> SDR' bridge. One of
them is the L1CTL interface, which is used by existing layer23
applications to drive GSM L1. Exactly this interface is provided
by the osmocon application, but instead of forwarding messages
between both host software and firmware we need to handle incoming
messages from layer23 applications, perform some GSM L1 specific
conversations (coding, mapping, interleaving, etc.), then finally
forward them to transceiver through the scheduler. And vice versa.
This code is just a basic implementation of UNIX socket handlers,
so currently we can only accept and drop connections from layer23
applications.
Change-Id: I58d069bcc7742b42c0bf95e52063933bf2c352ff
This app is similar to the osmocon, but designed to
connect L2 & L3 apps with SDR transceiver insted of
obsolete Calypso based hardware.
Change-Id: Ie3c17f19aad9c26f3c49966a7c96b65911f62369