summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/trxcon.c
AgeCommit message (Collapse)AuthorFilesLines
2018-04-09host/trxcon: track talloc NULL contexts by defaultVadim Yanitskiy1-0/+3
In order to be able to introspect not only the root application context, but also all other contexts, e.g. allocated within libosmocore or other libraries, let's enable tracking the use of NULL contexts using the corresponding talloc API. Change-Id: Id21cd5ee340def443f7a5d0b2b8f37f41188dd87
2018-04-09host/trxcon: don't free root talloc contextVadim Yanitskiy1-2/+7
This is useless, and prevents us from finding potential memory leaks at exit. Let's print talloc report instead of that. Change-Id: Ibf04942070d654e97c3ed77d69ab19e44602758c
2018-03-11trxcon/scheduler: transmit dummy frames on CBTX lchansVadim Yanitskiy1-0/+4
If at the moment of transmission there are no frames in TX buffer, then either a dummy LAPDm frame (0x01, 0x03, 0x01, 0x2b ...) or a silence frame (depending on a codec in use) shall be transmitted. This is required for proper measurements on the BTS side. Change-Id: Ie590990f2274ea476678f6b2079f90eeadab6501
2018-03-01trxcon: Fix '-i' to specify the "TRX IP address"Harald Welte1-1/+1
The command line help states '-i' is for 'TRX IP address', which is the remote IP address at which the TRX is to be found. Hoewever, it was used as the local (bind) IP address of the socket used towards the TRX. This is my attempt at fixing this. A more complete solution probably allows to specify both local (bind) and remote (connect) address, just to be clear. Change-Id: If0252b15e9c7942687c6dc470951d777f7af651c
2018-02-28trxcon: Define event names for osmo_fsm'sHarald Welte1-0/+9
Change-Id: Id3279e99966a0ab236923c497ac0abbc9ed2c93c
2018-02-23trxcon|fake_trx: change default TRX port number to 6700Harald Welte1-2/+2
In order to avoid clashes with OsmoTRX, which may be also running on the same host, let's use a different port range starting from 6700 by default. This idea was introduced as a result of OS#2984. Change-Id: I66b5f25aaba3b836448ed29839c39869b5622bed Related: OS#2984
2017-11-23host/trxcon/scheduler: process frames in advanceVadim Yanitskiy1-2/+9
In order to get the transceiver more time to process bursts, the L1 scheduler should process the frames and send the bursts in advance (a few frames before), like OsmoBTS does. By default, the advance value is 20 frames, but this can be adjusted using a new command line option of trxcon '-f'. Change-Id: Ic258a169f3554f931d6277e18ca060d029b77f32
2017-11-19host/trxcon/scheduler: optionally reset clock counterVadim Yanitskiy1-2/+2
Change-Id: I4565620fc0c5f64133c2674d2c972fc34245cf32
2017-11-19host/trxcon: get rid of useless TRX_EVENT_RESET_INDVadim Yanitskiy1-2/+0
Change-Id: I2aa4c000b37f64c351a806711b2d19bf27ef82bd
2017-11-19host/trxcon: don't flush trx control messages on resetVadim Yanitskiy1-1/+1
Change-Id: I0851f168adeb012a933c796c4180ef507b1c57ec
2017-11-19host/trxcon: get rid of useless trxcon fsm eventsVadim Yanitskiy1-5/+1
Both SCH_EVENT_CLCK_IND and SCH_EVENT_CLCK_LOSS were not handled, moreover there is no purpose to keep them. Change-Id: I8efac459a40f4287e3325890809991d5ef46e9b1
2017-11-19host/trxcon: reset scheduler when L1CTL is lostVadim Yanitskiy1-0/+3
Change-Id: I1fd8a610085c8591a820e784b7122de7b3032d15
2017-11-19host/trxcon: send L1CTL_DATA_IND directly from lchan handlerVadim Yanitskiy1-4/+1
Change-Id: Idfc86a59469c7a0bba1c16177502844e59ed8887
2017-11-19host/trxcon: handle L1CTL_RESET_REQ inside l1ctl.cVadim Yanitskiy1-10/+2
Change-Id: Ie5930dec800885784fb38ce6188c9c969cd2ad4e
2017-11-19host/trxcon: handle L1CTL_FBSB_REQ inside l1ctl.cVadim Yanitskiy1-29/+0
Change-Id: I5bcf39a20f1c6d3a2472e5e95725c6bb1c77bf5d
2017-11-19host/trxcon: bind L1CTL link with TRX and vice versaVadim Yanitskiy1-0/+4
Change-Id: I575f8699bf06fd5e86f7935c6ab3216db5a26ec5
2017-11-19host/trxcon/scheduler: implement xCCH decodingVadim Yanitskiy1-1/+4
Change-Id: Ieb71e3727b525e85d161855973f63042366ccb05
2017-11-19host/trxcon: handle ccch_mode from L1CTL_FBSB_REQVadim Yanitskiy1-4/+28
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-19host/trxcon: store arfcn and band in trx_instanceVadim Yanitskiy1-5/+5
Change-Id: I95414ff1033d77f11e231178b7721b70bc45e6df
2017-11-19host/trxcon/scheduler: implement management functionsVadim Yanitskiy1-0/+10
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-19host/trxcon/scheduler: add basic clock counterVadim Yanitskiy1-1/+5
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-19host/trxcon: initial release of L1CTL handlersVadim Yanitskiy1-0/+18
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-19host/trxcon: integrate osmo-fsm frameworkVadim Yanitskiy1-0/+66
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-19host/trxcon: initial release of transceiver interfaceVadim Yanitskiy1-0/+9
This is the second side of the 'OsmocomBB <-> SDR' bridge. Most of source code taken from the OsmoBTS project. Change-Id: I96fa3ada05d010f31af419a4950fd8ae2b62ef34
2017-11-19host/trxcon: initial release of L1CTL interfaceVadim Yanitskiy1-5/+14
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-19host/trxcon: introduce a new 'trxcon' applicationVadim Yanitskiy1-0/+193
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