Commit Graph

315 Commits

Author SHA1 Message Date
Vadim Yanitskiy cf5c10f92a host/trxcon: link trxcon against libosmocoding
Change-Id: I9bb45428e6617bd6936d24340e688aef4aeafc8f
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 604ac30825 host/trxcon: handle ccch_mode from L1CTL_FBSB_REQ
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
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 62328cb088 host/trxcon: store arfcn and band in trx_instance
Change-Id: I95414ff1033d77f11e231178b7721b70bc45e6df
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy ec3a1ba2e5 host/trxcon/scheduler: handle bursts from TRX interface
Change-Id: Iff15daf897f30cb98d4ec4c88b9fc259cb44ea4e
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 8baa369b23 host/trxcon/scheduler: implement management functions
This change introduces some new functions to configure
TDMA scheduler. They can be grouped as follows:

  - Scheduler management functions
    - sched_trx_init()
    - sched_trx_reset()
    - sched_trx_shutdown()

  - Timeslot management functions
    - sched_trx_add_ts()
    - sched_trx_find_ts()
    - sched_trx_del_ts()
    - sched_trx_reset_ts()
    - sched_trx_configure_ts()

  - Logical channel management functions
    - sched_trx_activate_lchan()
    - sched_trx_deactivate_lchan()
    - sched_trx_find_lchan()

Change-Id: I6d0f437a68f0eb4e22bf635bf899b08673571085
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 2e18fe4631 host/trxcon/scheduler: add basic GSM PHY definitions
Change-Id: I9f4faa15d5ca61af3e3fdbb95952ab4e4e0b7a4b
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 789040f914 host/trxcon/trx_if.c: handle clock indications
Change-Id: I333c1c44578eb62c52d2d059b798dd5feae3e444
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 9b1d398685 host/trxcon/scheduler: add basic clock counter
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
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 90a0d3c78d host/trxcon: initial release of L1CTL handlers
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
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 423aeefc40 host/trxcon: integrate osmo-fsm framework
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
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 83a9c9ef50 host/trxcon/trx_if.c: add ECHO command
This command should be used to check transceiver availability.

Change-Id: I6af2d5e413ff7ab751cb34e1659742b0f59b6cca
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 65664d088d host/trxcon: fix NULL-pointer deference
Change-Id: Idc036d4ea32b4aa3f4841d39144ef1733414728e
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 48f2cb4b3b host/trxcon: initial release of transceiver interface
This is the second side of the 'OsmocomBB <-> SDR' bridge.
Most of source code taken from the OsmoBTS project.

Change-Id: I96fa3ada05d010f31af419a4950fd8ae2b62ef34
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 9f5fefe792 host/trxcon: initial release of L1CTL interface
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
2017-11-19 17:35:07 +07:00
Vadim Yanitskiy 8975b437ed host/trxcon: introduce a new 'trxcon' application
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
2017-11-19 17:35:07 +07:00