path: root/src/host/trxcon/trx_if.c
AgeCommit message (Collapse)AuthorFilesLines
2019-02-21trxcon: make trxcon_fsm parent for both l1ctl_fsm and trx_fsmVadim Yanitskiy1-6/+8
Change-Id: I6262726f2b6e23abe543d6d67edfd634eece1b71
2019-02-21trxcon: refactor trxcon_fsm finite state machineVadim Yanitskiy1-2/+2
Change-Id: I035b2cb701e2d0b3fedec4d569507b79d400df5b
2019-01-17trxcon/trx_if: refactor trx_if_open()Vadim Yanitskiy1-29/+26
The main changes are: - return pointer to the allocated trx_instance or NULL, - extend debug message with TRX address and base port, - accept the talloc context as 'tall_ctx' argument, - rename goto label 'error' to 'udp_error', - rename argument 'port' to 'base_port'. Change-Id: I39b24afee2f09d6a6c500cfc26ac45f206589c5c
2019-01-17trxcon/trx_if.c: check if trx_fsm allocation failedVadim Yanitskiy1-4/+11
Change-Id: I31c9f2a651182b258d0a4d4504365b778529715a
2019-01-17trxcon: register both l1ctl_fsm and trx_fsm on DSO loadVadim Yanitskiy1-1/+5
Change-Id: I7111e368afa47c88ff3c610bae9044f2d5baf037
2018-11-29trxcon/trx_if.c: add SETFH CTRL command supportVadim Yanitskiy1-0/+44
The idea of SETFH command is to instruct transceiver to enable frequency hopping mode using the following parameters: CMD SETFH <HSN> <MAIO> <CH1> <CH2> [... <CHN>] Note: since the length of a CTRL command is limited to 128 symbols (BTW: why?), the amount of channels is also limited. Change-Id: Id3d44e6a2796f1ce8523a49dedd5d484052a5c7f
2018-09-07trxcon/l1ctl.c: refactor Timing Advance handlingVadim Yanitskiy1-4/+0
Change-Id: I0e4f18173347e3a7cb875f95d796e8ea20bfc4bf
2018-09-07trxcon/trx_if.c: drop Timing Advance range limitationVadim Yanitskiy1-7/+3
Despite the correct range of Timing Advance value is [0..63], there is a special feature in OsmocomBB which allows one to simulate the distance between both MS and a BTS by playing with the signal delay. This is why a signed 'int8_t' type is used in L1CTL protocol. No need to limit the range, just forward it to TRX. Change-Id: I06774b315b8451bf14083da6b2849d6e8594abc8
2018-09-07trxcon/trx_if.c: drop unused SETPOWER and ADJPOWERVadim Yanitskiy1-25/+0
I am not sure we need the both control commands, as every burst on DATA interface has a header that includes TX power. Change-Id: Id14603e71df6dedb5a843bb3e20a320192dbca3d
2018-09-06trxcon/trx_if.c: use proper format specifiersVadim Yanitskiy1-4/+4
The '%u' format specifier should be used for unsigned values. Change-Id: I90200581036f8ab3969dd68664688f98cd2d3618
2018-09-06trxcon: avoid arfcn / band_arfcn naming confusionVadim Yanitskiy1-20/+20
In the most cases an ARFCN value is stored together with some flags (e.g. DL/UL flag, DCS flag), so it should be taken into account e.g. when printing. Let's use the proper naming. Change-Id: I0b7634c80986dbff9d0da421c6a044cd36c9fd01
2018-03-02host/trxcon: use integer math for ToA (Timing of Arrival)Vadim Yanitskiy1-5/+5
There's no need to express ToA value as a float. Let's 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. Inspired by Idce4178e0b1f7e940ebc22b3e2f340fcd544d4ec. Change-Id: I99c0f38db08a530d5846c474aba352aa0b68fe86
2018-03-01trxcon: Fix '-i' to specify the "TRX IP address"Harald Welte1-33/+12
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/+5
Change-Id: Id3279e99966a0ab236923c497ac0abbc9ed2c93c
2017-12-05host/trxcon: forward Timing Advance value to transceiverVadim Yanitskiy1-0/+26
The time at which the phone is allowed to transmit a burst of traffic within a timeslot must be adjusted accordingly to prevent collisions with adjacent users. Timing Advance (TA) is the variable controlling this adjustment. The TA value is normally between 0 and 63, with each step representing an advance of one bit period (approximately 3.69 microseconds). As trxcon doesn't perform actual burst transmission, this value needs to be forwarded to the transceiver, which will take care about the timings. Change-Id: Ia8c0848827ab2b4cd7cf1efe128b28d5c06ec84e
2017-12-04host/trxcon/trx_if.c: get rid of useless commandsVadim Yanitskiy1-10/+0
The 'SETMAXDLY' command is used on the BTS side to limit maximal Time of Arrival for access bursts. As we don't receive RACH bursts on the MS side, the command is useless. The 'SETRXGAIN' command is used on the BTS side to set initial receive gain value for TRX. On the MS side it's possible to set that parameter via command-line options of TRX. Change-Id: I3e61b4b48193004cdcb241cefabb44c12db93120
2017-12-04host/trxcon/trx_ic.c: use osmo_ubit2sbit() from libosmocoreVadim Yanitskiy1-7/+2
No need to reimplement the existing functions... Change-Id: Ic9b232c8561609d42dac10e6249a3e1c58c4edc1
2017-11-19host/trxcon: fix: use valid names for FSM instancesVadim Yanitskiy1-4/+1
Since 8c4f5457 in libosmocore there are some limitations on FSM and FSM instance names. This change adjusts the names of both l1ctl_fsm and trx_fsm instances. Change-Id: Icaaac3f51bdcfe4f7723060179b8730c3a06529b
2017-11-19host/trxcon/trx_if.c: separate logging of data messagesVadim Yanitskiy1-7/+7
Change-Id: I74ebe0441aeb41c324eafb6b586b2edd9ef4fd1a
2017-11-19host/trxcon: use LOGP instead of fprintfVadim Yanitskiy1-1/+1
There is no (performance) reason to use fprintf instead of LOGP. Second one provides more useful information, such as a file name and a line number. Change-Id: I86dda5b3d746c7802442e4226578a06c04941721
2017-11-19host/trxcon/trx_if.c: fix wrong logging categoryVadim Yanitskiy1-1/+1
Change-Id: I0df0205e160fd9ea5811852077db7c49cddc7e8a
2017-11-19host/trxcon: get rid of useless TRX_EVENT_RESET_INDVadim Yanitskiy1-4/+2
Change-Id: I2aa4c000b37f64c351a806711b2d19bf27ef82bd
2017-11-19host/trxcon/trx_if.c: get rid of CLCK interfaceVadim Yanitskiy1-59/+4
Local clock counter can be corrected using frame number values, obtained from burst header on DATA interface. Change-Id: I5a813e3dc1b960831343b8ecb80718291f20e80d
2017-11-19host/trxcon: share trxcon fsm and talloc ctx via trxcon.hVadim Yanitskiy1-3/+0
Change-Id: I9ef558f84a6dc1c9b8fc394c48e108676fa169f8
2017-11-19host/trxcon/trx_if.c: add power measurement commandVadim Yanitskiy1-0/+63
Change-Id: Ib947b60248cafad4edeb7e49c2bd3a1f81696239
2017-11-19host/trxcon/trx_if.c: simplify response matchingVadim Yanitskiy1-1/+1
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
2017-11-19host/trxcon/trx_if.c: use proper names for burst handlersVadim Yanitskiy1-3/+3
Change-Id: I3d36e6d80fcf6353379aa308415c306e1a256a7d
2017-11-19host/trxcon/trx_if.c: fix compatibility with OsmoTRXVadim Yanitskiy1-1/+2
For some reasons, OsmoTRX sends 158-byte long sequences on DATA interface, where the latest two bytes aren't used. Change-Id: Ie9295e9b0d8956d9e87e2ced8cca9d5e68040f88
2017-11-19host/trxcon/scheduler: handle bursts from TRX interfaceVadim Yanitskiy1-1/+3
Change-Id: Iff15daf897f30cb98d4ec4c88b9fc259cb44ea4e
2017-11-19host/trxcon/trx_if.c: handle clock indicationsVadim Yanitskiy1-1/+5
Change-Id: I333c1c44578eb62c52d2d059b798dd5feae3e444
2017-11-19host/trxcon: integrate osmo-fsm frameworkVadim Yanitskiy1-22/+101
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/trx_if.c: add ECHO commandVadim Yanitskiy1-0/+9
This command should be used to check transceiver availability. Change-Id: I6af2d5e413ff7ab751cb34e1659742b0f59b6cca
2017-11-19host/trxcon: fix NULL-pointer deferenceVadim Yanitskiy1-0/+4
Change-Id: Idc036d4ea32b4aa3f4841d39144ef1733414728e
2017-11-19host/trxcon: initial release of transceiver interfaceVadim Yanitskiy1-0/+607
This is the second side of the 'OsmocomBB <-> SDR' bridge. Most of source code taken from the OsmoBTS project. Change-Id: I96fa3ada05d010f31af419a4950fd8ae2b62ef34