aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
AgeCommit message (Collapse)AuthorFilesLines
2017-06-15scheduler_trx.c: strip unused variableVadim Yanitskiy1-2/+0
Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20
2017-06-15cosmetic: fix some typosVadim Yanitskiy1-2/+2
Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05
2017-06-15Set and report BTS featuresMax1-0/+3
Set (possibly incomplete) list of BTS model-specific features and report them in response to attribute request via OML. Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f Related: OS#1614
2017-06-06trx: Save osmotrx base-port vty propertiesPau Espin Pedrol1-0/+7
Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6
2017-06-06trx: Allow BTS and TRX to be on different IPsPau Espin Pedrol4-42/+45
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9 Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
2017-05-29osmo-bts-trx: Remove duplicate parsing of NM_ATT_CONN_FAIL_CRITHarald Welte1-5/+0
For some reason, osmo-bts-trx did another take at parsing NM_ATT_CONN_FAIL_CRIT and storing the second octet in btsb->radio_link_timeout, just like the generic code already does in oml_rx_set_bts_attr(), but without proper checking and any error message. Let's remove it. Change-Id: Idb0179e1443c0b5a97e59919dba684a001e90192
2017-05-29Consistently check for minimum attribute/TLV length in RSL and OMLHarald Welte1-1/+1
Make more use of TLVP_PRES_LEN() instead of plain TLVP_PRESENT() and implicitly assuming a certain length of the information element. What this obviously doesn't introduce is some kind of error generation/reporting in case the minimum length is not fulfilled. An IE that's too small is silently ignored by TLVP_PRES_LEN() and treated as if the IE wouldn't exist in the first place. Change-Id: If5c4eee65711c49bc8ba4675221b1d5fd16198e9
2017-05-27rx_tchh_fn(): Avoid copy+pasting formula to determine odd-ness of fnHarald Welte1-4/+7
Change-Id: Ic2a0bdaa70cc28c1ce8237351b0a0c6b998cf0a3
2017-05-27scheduler_trx: Avoid copy+pasting determining CMR from FNHarald Welte1-8/+12
instead, let's introduce a specific function for that. Also, as this can be easily determined from the frame number, skip one argument to tx_tch_common(). Change-Id: Ibbb9b685cf0b6a45339b0874438a500dd6254bc2
2017-05-27scheduler_trx.c: Avoid code duplication for BER10k computationHarald Welte1-8/+16
Use an (inline) function rather than code copy+pasting Change-Id: I42e76a4707968e428cbd2e43d5df71ef445efece
2017-05-27scheduler_trx.c: Fix typos, improve comments, cosmeticsHarald Welte1-25/+35
Change-Id: I5e2ce70aea8d62657ce3a7d6c16e5a7f8b76c22f
2017-05-27Remove unusued left-over gsm0503_conv.cHarald Welte2-1169/+0
gsm0503_conv.c should have been removed as part of efbef50efc170caccf6354360638cda762dd7fc3 but somehow was left here. It's not referenced/compiled by the Makefile anymore, and the gsm053_conv.c in libosmogsm has superseded it anyway. Change-Id: Icdcca1bc55a83c76ec47918dc4dd301155210091
2017-05-22osmo-bts-trx: use libosmocodingMax12-5607/+24
Remove built-in functions and use libosmocoding instead. Change-Id: I1b41bb1a8de655639107ec1f3b75afc240fd316f
2017-05-10Set BTS variant while initializing BTS modelMax1-0/+1
This will allow proper BTS attribute reporting via OML in follow-up patches. Change-Id: I1c49d6c39fb4dac7a46ee25ceacf4c6ef0f0b736 Related: OS#1614
2017-05-09osmo-bts-trx/l1_if.c: cosmetic: drop double checkVadim Yanitskiy1-3/+3
Change-Id: I25a8f85ee65e1c0dd54049ffacc039702ca36c8f
2017-03-23osmo-bts-trx/l1_if.c: use channel combination III for TCH/HVadim Yanitskiy1-1/+1
Currently the channel combination II is used for TCH/H, which allows only one lchan to be allocated. The reason is that it saves a bit of CPU by disabling UL burst detection on lchan 1. There is also the channel combination III, which allows to increase channel capacity, providing two lchans on a single TCH/H timeslot. Ideally we should implement some dynamic II <-> III switching depending on the network load level. But for now this change replaces the channel combination of TCH/H by III, until dynamic switching is implemented. Fixes issue: https://osmocom.org/issues/1795 Change-Id: I8fd4abb42c153fcd26bcfe22a2554b5c2d02d810
2017-03-23osmo-bts-trx: fix scheduling of broken framesMax1-2/+4
* DTXu: don't set marker for broken frames * do not attempt to send 0-length bursts to avoid flood of errors after bts startup Change-Id: Icb536f951386b9abe34c0dacbb203f3db1e41bb3
2017-02-19osmo-trx-bts: Fix incorrect bts shutdown procedure in case of clock loss ↵Ivan Klyuchnikov1-13/+1
from osmo-trx This issue occurs in case of osmo-trx restart which leads to losing clock from osmo-trx. Function bts_shutdown from common/bts.c should be used in this case for proper bts shutdown. Change-Id: Ie65cf2e8f98cb8bf3314a00048aa53c1f8cd4c25
2017-02-14osmo-trx-bts: Fix incorrect bts shutdown procedure in case of abis ↵Ivan Klyuchnikov1-4/+1
connection closure This issue occurs in case of osmo-nitb restart which leads to abis connection closure. Function bts_shutdown from common/bts.c should be used in this case for proper bts shutdown. Change-Id: Id025e703dd5c91896d450d200e88e46552f178f0
2017-02-10Fix typo in TCH/H interleaving tableMax1-1/+1
According to Table 4 in 3GPP TS 45.003 j=11, b=3 case corresponds to k=91 and not j=12 as was previously used. Change-Id: Iad3cf545b2f7e16276466cc37dd7a1e7858467e5
2017-02-10osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance ↵Ivan Klyuchnikov2-2/+5
parameters from config file pinst->u.osmotrx.hdl should be allocated before reading phy_instance parameters from config file and applying them. So allocation of pinst->u.osmotrx.hdl should be moved from l1if_open function to bts_model_phy_instance_set_defaults function, which is proper place for this allocation according to start-up procedure of osmo-bts. Change-Id: I6e23f92644400acb268818c9373a8fb10c003da1
2017-02-10osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second ↵Ivan Klyuchnikov4-74/+83
channel (TRX1) of osmo-trx Move rxgain and tx-attenuation (power) parameters from phy_link layer to phy_inst layer. Rxgain and tx-attenuation parameters should be set for each phy_inst and send for each osmo-trx channel accordingly via control commands. Change-Id: I4861a59d10d1ef91954e0c6ea265e66dec08844f
2016-12-12osmo-bts-trx: fix lchan deactivationMax1-2/+4
Use chan_nr for deactivating lchan instead of lchan->nr: chan_nr is the RSL Channel Number IE value, a bitfield aggregation of lchan type bits (cbits) and lchan number (lowest three bits). The error was introduced in 36153239bfd0b633c4d259a9de0a759f41197a2b. Change-Id: I6dd7060422ab9d18743c1ff2ab419e3e7299d74d
2016-12-05TRX: prevent segfault upon phy initMax1-7/+10
Previously if multiply phy instances were configured but not used osmo-bts-trx would segfault. Terminate with clear error message instead so user can correct configuration. Example configuration which caused problem: ... phy 0 instance 0 instance 1 ... trx 0 phy 0 instance 0 Note the 2nd instance of phy 0 which is not used in trx later on. Change-Id: Id979506731ea92401458f1060e87aeb690901539
2016-12-01Remove duplicated codeMax1-5/+19
Remove lchan deactivation related code duplication to facilitate future use for dynamic CCCH re-activation. Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.Alexander Chemeris5-1/+68
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
2016-11-29osmo-bts-trx: remove obsolete include of netif/rtp.hNeels Hofmeyr1-2/+0
Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c
2016-11-11Replace link_id constant with defineMax1-4/+4
Instead of using constant for link_id directly, use shared define value. Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-08Initialize parameters in osmo-trx for 11bit RACHbhargava1-0/+4
The parameters related to support 11bit RACH are initialized in osmo-trx. These parameter determaine the type of the RACH received in osmo-pcu. Change-Id: I164d449303373d0757719d5204f4716975fb517a
2016-10-18Replace magic number with defineMax1-4/+4
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've always used lchan[4] - replace it with CCCH_LCHAN define and add comment. Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
2016-10-13TRX: fix building with latest DTX changesMax1-2/+2
Bring up-to-speed with latest changes in OpenBSC. Change-Id: I16b24b2cd09600e215de163e7b5baae329887c9e
2016-08-10dyn TS: complete for TRXNeels Hofmeyr1-8/+19
Apply similar fixes as for TCH/F_PDCH also for TCH/F_TCH/H_PDCH: Detect dyn TS in PDCH mode in ts_is_pdch(). In trx_set_ts(), enhance the "if (TCH_F_PDCH)" to a switch statement including both dynamic channel types. Adjust the comment to include both kinds. Change-Id: I6669739cd08780cd9ffb9451cdae9f6b9704c4fe
2016-08-08osmo-bts-trx: log decoder bit errors as DEBUG, not NOTICEMike McTernan1-1/+1
It is not an exceptional situation if the air-interface is experiencing non-recoverable decoding errors. At bad signal conditions and/or interference, this is perfectly normal. Let's use DEBUG instead of NOTICE log level. Change-Id: Ifd39c53ec22f57cdb5299e5d76ff6ff1482d3beb
2016-08-08osmo-bts-trx: Fix PCS1900 operationMike McTernan1-2/+12
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
2016-08-08Fill measurements data for L1SAPMax1-8/+22
Fill in values for BER, BTO, Link quality in L1SAP and send them to PCU. Note: this increases the version of BTS <-> PCU protocol. It also requires corresponding changes in libosmocore. All BTS models provide measurements data unless direct DSP access for PCU is enabled. For BTS-specific notes see below. Octphy: conversion from sSNRDb to Link Quality uses formulae which works in practice instead of what's documented for sSNRDb value. Subject to change in future revisions. TRX: C / I link quality estimator is not computed. Change-Id: Ic9693a044756fb1c7bd2ff3cfa0db042c3c4e01c Related: OS#1616
2016-07-28trx: Fix coverity BER calculation NULL dereferenceTom Tsou1-6/+9
Allow output of encoded bit count or error count on BER calculation without requiring both pointers to exist. Change-Id: I2c78fa6a92a3b3da4aad8f70353e5a43451b0aa5 Fixes: Coverity CID 137963 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-28dyn PDCH: trx l1_if.c: drop fixme, add commentNeels Hofmeyr1-1/+1
Change-Id: Ib240f21f4d460524767f4273fc9077617d1ffb43
2016-07-28dyn PDCH: complete for trx: implement bts_model_ts_[dis]connect()Neels Hofmeyr1-2/+17
bts_model_ts_disconnect() has nothing to do. bts_model_ts_connect() merely sets the new pchan on the ts. Change-Id: Ieb66935d6efc26854e95d238e810c4f8b16cfa88
2016-07-28dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from trx_set_ts()Neels Hofmeyr1-3/+20
To be able to set a specific pchan type for dynamic channels, have the trx_set_ts_as_pchan() function with an explicit pchan argument instead of using ts->pchan. Keep trx_set_ts() as a thin wrapper to use ts->pchan directly. Change-Id: I9eeef05d2a6763f86a5b89ee7c3b4211f6736e4d
2016-07-28trx: Enable EGPRS handling through burst lengthsTom Tsou4-60/+134
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>
2016-07-28trx: Add EGPRS coding and decoding proceduresTom Tsou2-8/+1028
Handles uplink decoding and downlink encoding procedures for MCS 1-9. Includes Type 1, 2, and 3 headers and tables from 3GPP TS 44.060 in order to independently recover coding and puncturing scheme (CPS) parameters for each coded message. Change-Id: I0f059ae34c6f36179553cbc972f8becf8179eb55 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-25trx: Add EGPRS tables, sequences, and mappingsTom Tsou10-4/+2443
Includes EGPRS specific convolutional codes, interleaving tables and functions, burst mappings, training sequences, and parity checks from 3GPP TS 44.060 needed to handle MCS codings 1-9. Change-Id: Ie270398dd7a72f282ba53e646853d8de1eabee93 Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-14osmo-bts-trx: init OML only once by sending AVSTATE_OK with OPSTATE_ENABLEDNeels Hofmeyr1-11/+1
When receiving an OPSTART for the BTS object, also set the availability state to OK. Before, the availability would remain at NM_AVSTATE_DEPENDENCY, which caused an unfortunate chain reaction resulting in osmo-bts-trx going through the initialization sequence twice: BTS BSC |<-----| SITE_MANAGER OPSTART n |----->| BTS state change: OPSTATE_DISABLED, AVSTATE_DEPENDENCY o | | This signals to nm_statechg_event() in bts_ipaccess_nanobts.c r | | to (a) Set BTS Attributes and (b) send BTS OPSTART m |<-----| Set BTS Attributes (a) a | | When osmo-bts-trx receives a Set BTS Attributes, it sends l |----->| CHANNEL state change: OPSTATE_DISABLED x8 | | This signals the BSC to Set CHANNEL Attributes and OPSTART i |<-----| Set CHANNEL Attributes x8 n |<-----| CHANNEL OPSTART x8 i |----->| CHANNEL state change: OPSTATE_ENABLED, AVSTATE_OK x8 t | | |<-----| BTS OPSTART (b) | | osmo-bts-trx immediately replies with: |----->| BTS state change: OPSTATE_ENABLED, AVSTATE_DEPENDENCY | | Unfortunately, availability is left at DEPENDENCY, | | and the NM_OC_BTS case in nm_statechg_event() only | | checks for availability, not for the opstate. | | Hence nm_statechg_event() again feels inclined to | | to (a) Set BTS Attributes and (b) send BTS OPSTART, | | --+------+----- This is where the second round starts | | s |<-----| Set BTS Attributes (a) e | | When osmo-bts-trx receives a Set BTS Attributes, it sends c |----->| CHANNEL state change: OPSTATE_DISABLED x8 o | | All channels are disabled again, and then re-launched: n |<-----| Set CHANNEL Attributes x8 d |<-----| CHANNEL OPSTART x8 |----->| CHANNEL state change: OPSTATE_ENABLED, AVSTATE_OK x8 | | i |<-----| BTS OPSTART (b) n | | osmo-bts-trx again sets the OPSTATE_ENABLED, but since i | | this time it was already enabled, no further state change t | | is sent back to the BSC. This nightmare pivots on two hinges: 1. osmo-bts-trx fails to set BTS availability to AVSTATE_OK. 2. nm_statechg_event() fails to heed the OPSTATE_ENABLED of the BTS state change. Note, the configured channels from the first round were not actually taken down, only the OML OPSTATE_DISABLED were sent. In this commit, fix the osmo-bts-trx side: send AVSTATE_OK for the BTS object upon sending OPSTATE_ENABLED, so that only the part marked "normal init" above is run. This change applies the same fix to other OML objects, which should make sense in the same manner, within the current hackish OML implementation: * NM_OC_BTS * NM_OC_SITE_MANAGER * NM_OC_BASEB_TRANSC * NM_OC_GPRS_NSE * NM_OC_GPRS_CELL * NM_OC_GPRS_NSVC This means that the NM_OC_CHANNEL case just above is identical, and thus collapse NM_OC_CHANNEL onto the other cases. Drop the comments from NM_OC_CHANNEL since they merely rephrase the commands themselves. See OS#1770 for BTS and NITB logs. Fixes: OS#1770 Change-Id: I08aa861f6100568c79750f4fbc9a32e1557b9304
2016-07-09log: osmo-bts-trx: change PDTCH block logs to DEBUG levelNeels Hofmeyr1-2/+2
Many erratic PDTCH blocks are expected. To not bloat the log, notifications for this should be on debug level. See http://lists.osmocom.org/pipermail/openbsc/2016-June/009457.html (Thu, 30 Jun 2016 01:49:33 +0300 / Alexander Chemeris <alexander.chemeris@gmail.com> / Re: GPRS on osmo-trx not working) Change-Id: Ie318248aa2b8de455174e72a63c602c7aeae312c
2016-07-09log: osmo-bts-trx: change access burst logs to DEBUG levelNeels Hofmeyr1-2/+2
Many erratic bursts are expected. To not bloat the log, notifications for this should be on debug level. See http://lists.osmocom.org/pipermail/openbsc/2016-July/009482.html (Tue, 5 Jul 2016 15:38:27 -0700 / Tom Tsou <tom@tsou.cc> / Re: osmo-bts-trx error logs -- was: GPRS on osmo-trx not working) Change-Id: If591c087ba8fd48564139e32930050ee8ab07001
2016-07-09cosmetic: osmo-bts-trx: add comment, fix comment typoNeels Hofmeyr1-0/+1
Change-Id: Iea62bd98954d0219ba597613cea6db63f7a6b396
2016-06-27TRX: add Uplink DTX support for FR/HRMax1-3/+13
* detect SID and set RTP Marker accordingly (emulate ONSET events) * set proper FN in TCH_IND * detect speech pause and do not send dummy 'bad' frames during that time Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc Related: OS#1750
2016-06-23Make get_lchan_by_chan_nr globally availableMax1-7/+2
* Remove static qualifier * Remove duplicated code - use generic function instead Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d
2016-06-22Clarify logging messageMax1-1/+1
Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Related: OS#1648
2016-06-21Use libosmocodec functions for AMRMax4-107/+21
Switch to using libosmocodec functions as a preparation step for DTX support as they expose necessary bits. Change-Id: Ie7423032fd06779d78876182ee63538d98906328 Related: OS#1750