aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-02-24RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminatorHarald Welte1-0/+6
Change-Id: I6a0e63999f39592474064e2f05df450aec8e37fe
2018-02-24RSL: Implement DELETE INDICATION on AGCH overflowHarald Welte1-0/+17
This patch adds generation of a DELETE INDICATION when the BTS AGCH queue overflows due to too many IMMEDIATE ASSIGN CMDs, as required by the specs. The AGCH queue length in OsmoBTS so far is at 1000 entries, which I consider way too high. But that is for another patch. Change-Id: Ied3306e85cbdc6f3476b10dc4bb0463cd728b274 Related: OS#2990
2018-02-24load_indication: Fix start of load indication timerHarald Welte2-6/+9
Starting the timer in bts_init() may result in it expiring already before the load indication period is set via OML. Let's make load_timer_start() safe to call several times and call it from OML code. Change-Id: I295d91413542014aa2507d5f09e01243fc3916fa Fixes: OS#2991
2018-02-23scheduler.c: Print message when burst substitution happensHarald Welte1-1/+4
Whenever we receive discontinuous frame numbers from the TRX socket, osmo-bts-trx is substituting zero-filled bursts for those frame numbers which we missed. Don't just do this silently, but actually log about it, as it is an error. Note: This [currently] happens when using a virtual air interface with trxcon as opposed to a real SDR receiver with osmo-trx. Change-Id: If79eab37c80647c9ab64f399fa4676d97af3e9ad
2018-02-23osmo-bts-trx: Add missing frame number to l1if_process_meas_res()Harald Welte1-1/+1
Change-Id: I7f1322b025ce733f78ae2b958c7a2bb38b6aa6f5
2018-02-23l1sap: Pass is_sub from L1 primitive into the Uplink MeasurementHarald Welte1-0/+1
info_meas_ind on the L1SAP always allowed the lower layers to pass in whether a given measurement is part of the "SUB", or not. However, the existing l1sap code before this patch simply drops this information, despite the measurement.c code also having "is_sub" state. Let's make sure this state is passed from L1SAP into measurement processing as intended. Fact is, none of our current lower-layers actually set this is_sub flag for their primitives passed up in L1SAP, but at least now *if* they would set that flag, the measurement code would process it as intended. Related: OS#2978 Change-Id: Ibed2e8d7563b471c6b5dd2214ac4765caf31ed2a
2018-02-23measurement.c: Hand Frame Number into measurement computationHarald Welte2-5/+5
This is currently only used for logging, but will be needed for proper RX{LEV,QUAL}-SUB reporting in upcoming patches. Related: OS#2978 Change-Id: I07fd06e8a379cab7c0c2eb111c3f5600037d3c9e
2018-02-23Revert "measurement: fix measurement computation"Harald Welte2-49/+1
This reverts commit d5fdcfe6d95f52fb76c4f4201969347a062fc9fd, which introduces a new function lchan_meas_update_ordered_TA whose functionality I still haven't yet managed to fully understand. It appears to be adjusting the requested timing advance (lchan->rqd_ta) but outside osmo-bts-trx/loops.c code. This is odd, as rqd_ta is a state variable of that loops.c code. So for one part, it is a failure of encapsulation. The TA loop code should be self-contained, particularly as it is only used for omso-bts-trx, and not for the other BTS models. The new lchan_meas_update_ordered_TA() function is used from common code, applicable to all BTS models. The resulting interaction between loops.c code and this new (now reverted) function cause the TA value to only ever grow, despite the MS never moving at all. Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80 Related: OS#2989
2018-02-23scheduler: add trx_sched_is_sacch_fn() functionHarald Welte1-0/+40
For proper measurement processing of RX{LEV,QUAL}-SUB, we will need this information. Related: OS#2978 Change-Id: I768fde62452a74dce471ebf946e56eb1e4de1abc
2018-02-23scheduler.c: Factor out find_sched_mframe_idx() functionHarald Welte1-15/+22
Let's split the look-up of the multiframe scheduler from the asignment to a given l1ts in trx_sched_set_pchan. Related: OS#2978 Change-Id: I79548b25aae647ce993a9d83c771d22b08cb1c74
2018-02-23osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame numberHarald Welte1-2/+3
Measurement reports fed into L1SAP so far had their frame number always set to zero, resulting in higher-layer common code above L1SAP to never detect the end of the measurement period, which in turn caused no RSL MEAS REP to be sent. Related: OS#2978 Change-Id: I67837d19515ea335614928570c12dd5027104c6b
2018-02-22osmo-bts-virtual: Make use of LOGL1S() macro for contextHarald Welte1-67/+40
In Change-Id I5703b46c8a59fe00a3cdc063bcf72872980ec5e5 we introduced LOGL1S and starte to use in in common/scheduler.c as well as osmo-bts-trx but somehow we didn't introduce it in osmo-bts-virtual at the time. Let's catch up. Change-Id: I0b5fd3b7982b9119becda844531108f64c68d19f
2018-02-22Introduce + use LOG/DEBUGP with frame number prefixing/printingHarald Welte8-125/+106
Let's make sure whenever we do have a frame number, we print it as context in the related log line Change-Id: I751d5ddb3322fce489bc241459738cbcc55c890b
2018-02-22osmo-bts-virtual: Generate PRIM_INFO_MEAS (with bogus values)Harald Welte1-2/+5
The problem is that measurement processing above L1SAP requires/expects those PRIM_INFO_MEAS indications from the bts specific parts. Otherwise it will never generate even uplink-only measurement reports to the BSC, which is a violation of Abis protocol specs. Change-Id: I48f73293cb4f0ab4c657dfd00e7ddd032a3c030f
2018-02-22osmo-bts-virtual: Shut down gracefully on socket creation failureHarald Welte2-2/+7
Don't simply crash if creation of the multicast socket fails Change-Id: Ie87b6684b3aa7f21742e4cf21533e980485c1230
2018-02-22bts: use feature list instead of speech codec tablePhilipp Maier5-57/+37
osmo-bts has a table of pchan/channel mode combinations for every bts. This table models the codec capabilitys of the BTS hardware. However, having the speech codec apabilities modeled inside the BTS feature list would be much more comfortable and since the feature list is communicated back to the BSC we would get the codec capabilities inside the BSC domain as well. - remove the pchan/channel mode tables - set speech codec variants for each BTS type - fix bts_supports_cm so that it queries the feature list Change-Id: I977dc729ba856631245aedf76afd48eac92166f7
2018-02-22vty: display bts features in vty command show btsPhilipp Maier1-0/+20
The VTY command show bts does not display the bts specific features yet. - Also display the feature list in snow-bts Change-Id: I509f2a7bbfa96c70bdfea4ff2488ee371e914620
2018-02-22octphy: ensure all BTS models set featuresPhilipp Maier5-0/+28
Most of the BTS models do not or do register not all of thier features to the the feature list. - Update/extend the feature lists for all BTS-Models Change-Id: I26765a64153368016921c2ac115b1c4aec9bc5e4
2018-02-22gsm_data_shared: extend bts feature list with speech codecsPhilipp Maier1-0/+5
The feature list does not cover any speech codec related information. - Add speech codec related items to feature list. Change-Id: If6d50c6f4e2348b23f31c3415b0f5577a3f5be50
2018-02-21RSL: Ensure we don't accept DCHAN messages for CCHANHarald Welte1-0/+22
If the Channel Number IE points to a common channel, we cannot accept such messages in code paths that only process dedicated channels, such as RLL/DCHAN/IPA. Related: OS#2972, OS#2971 Change-Id: I43a78bec63aeb36dd67043d237b27fe880209349
2018-02-21RSL: Properly reject RSL CHAN_NR IE for incompatible PCHANHarald Welte1-34/+78
If we receive a message for a dedicated channel, whose channel number structure doesn't match with the physical channel (timeslot) type, we must properly reject this. For RSL CHAN ACT it means sending a NACK, and for all other cases it means sending an RSL ERROR REPORT. Related: OS#2972, OS#2971 Change-Id: Iebd2571726d1284a7431b3f9b23ad3185e832ed1
2018-02-19trx: make l1if_fill_meas_res() staticHarald Welte2-3/+1
it's not used anywhere outside of l1_if.c, so make it a static function Change-Id: If988a7679f3a9253fab1a4d177a276d8ecaf794f
2018-02-19sysmo+lc15: Add missign include for readv/writevHarald Welte2-0/+2
This avoids compiler warnings like this: ../../src/osmo-bts-sysmo/l1_transp_hw.c:130:13: warning: implicit declaration of function ‘writev’; did you mean ‘write’? [-Wimplicit-function-declaration] written = writev(fd->fd, iov, count); Change-Id: Ic67d369a3ca33bfa636ace9f272f1c7257de86e1
2018-02-19sysmo: Fix compiler warnings in eeprom.cHarald Welte1-6/+6
This avoids compiler warnings like ../../src/osmo-bts-sysmo/eeprom.c: In function ‘eeprom_WriteSysInfo’: ../../src/osmo-bts-sysmo/eeprom.c:605:58: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] err = eeprom_write( EEPROM_CFG_START_ADDR + ((uint32_t)&ee.cfg.v1.sysInfo - (uint32_t)&ee), sizeof(ee.cfg.v1.sysInfo), (const char *) &ee.cfg.v1.sysInfo ); Change-Id: Ic748038e6f25ec18ccb4a2f2503ca567fb00a586
2018-02-19Cosmetic fixes for power ramping code.Stefan Sperling1-2/+2
Fix typos in 2 comments. Change-Id: I214bcc8b78446bfea450fe445fa9391898638905
2018-02-19rsl: do not allow MODE MODIFY request with unsupp. codec/ratePhilipp Maier5-0/+69
When the BSC sends a MODE MODIFY request with an unsupported codec, the BTS must respond with a negative acknowledge. Currently the codec parameter is not checked at all, which may lead into malfunction or crash of the BTS. - Introduce a mechanism to check the codec/rate against a table that is set up in the phy specific code. - Add tables with supported codec/rate combinations for octphy, sysmobts, and trx. Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 Related: SYS#3212
2018-02-14osmo-bts: Add talloc context introspection via VTYHarald Welte2-0/+2
This requires libosmocore with Change-Id I43fc42880b22294d83c565ae600ac65e4f38b30d or later. Change-Id: Ieed87b8109e0095a3d99c30f0b042aa3ee4b6384
2018-02-09l1sap: Validate incoming RTP payload, drop bw-efficient AMRPau Espin Pedrol1-0/+45
A recurrent kernel crash in sysmobts (several kernel versions) corrupting kernel memory in random places has been investigated and reproduced by placing a call against an MSC sending RTP with bandwidth-efficient AMR payload to osmo-bts-sysmo. The osmo-bts-sysmo in turn sends the payload to the femtobts related kernel modules via a msgq, which most probably fail to handle correctly this bw-efficient AMR payload and corrupt the kernel memory. First approach was to drop the bw-efficient AMR payloads lower in the stack in sysmo specific code (l1if_tch_encode), but as there's no bts model in osmo-bts actually supporting bw-efficient AMR, let's drop it early in the incoming path for all models to avoid further problems. Related: SYS#4063 Change-Id: If0c9233c628c724de4ab74e58e3e2affac79e6d0
2018-02-08main.c: bts_main: fix typo in error messagePau Espin Pedrol1-1/+1
Change-Id: Ib44fce36a945042e92ea3f4173e72c1ce5f66fb8
2018-02-08osmo-bts-trx: ignore frame offset error on startupMax1-3/+4
Previously we always printed error on startup: l1sap.c:461 Invalid condition detected: Frame difference is 627202-0=627202 > 1! This is expected and of little practical use. Let's suppress it by checking that FN was actually initialized. Change-Id: I4f7cf285e437db0e980e1a2a3ab48a7255945448
2018-02-08osmo-bts-trx: init nbits to know valueMax1-1/+1
It seems like some of the functions invoked by _sched_dl_burst() do not sent nbits properly. This leads to a number of errors on startup: trx_if.c:593 Tx burst length 65535 invalid It happens in conjunction with: Transceiver.cpp:382:pushRadioVector: dumping STALE burst in TRX->USRP interface Let's fix this by initializing nbits to 0 to make sure those bursts are properly ignored. Change-Id: Iaf85826861163c185925de528c8347ab22779e30
2018-02-07Add helper to get BCC from BSICMax1-1/+1
Change-Id: Ib539a8739d53ab60d8fadffcef38152b82a28498 Related: OS#1854
2018-02-05vty: don't print "Bound IP / Port" if it isn't bound [yet]Harald Welte1-5/+7
Change-Id: I28705b56582d334d568d98a371daa6bb9ef1f625
2018-02-05Print much more information during 'show lchan'Harald Welte2-0/+41
This adds printing of remote RTP IP/Port, LAPDm SAPI information, MS Timing offset, propagation delay, encryption algorithm+state, loopback status and radio link failure counter to the "show lchan" command. It also adds TODO comments fro those bits that are not yet printed but which would make sense to print. Change-Id: Ic4bc47638b7b402aee9344dc912745a9929c37f4
2018-02-05Add 'show (bts|trx|ts|lchan)' commandsHarald Welte1-1/+402
This is more or less a 1:1 import from the BSC side commands. Having the commands on the BTS side will allow us to expose information that's not visible to the BSC [in upcoming, separate patches]. Change-Id: I2a596938849a9c84fe6fedcac5d7f71ee97af575
2018-02-05virtual: l1_if.c: Remove unneeded warning messagePau Espin Pedrol1-2/+1
Commit 5eb17e28acdd6fba22a1f2e60f4d55aaef18b47a added this warning when implementing the full function. However, other backends seem to be also passing the primitive from the stack to l1sap_up without any visible issues. Furthermore, according to the documentation of l1sap_up, it takes ownership of the msgb, but doesn't take ownserhip of the prim itself. Change-Id: I45fe40e3377eac999d1dac5356678195381d94ca
2018-02-05vty.c: Remove warning messagePau Espin Pedrol1-1/+0
This warning was included in commit 6d7b78bde165f39dcd9033f0c5386f5699801233 from 2011, and nowadays I only see this command used in osmo-bts, so I think we most probably drop it as it doesn't make sense anymore. Change-Id: Ie277dce00292c8f403b9a2b405efe4429e6af86a
2018-02-05octphy: octpkt.c: Remove unused static functionsPau Espin Pedrol1-32/+0
Change-Id: I97c08b66d41ab5902a11a1e989e278c56cdee102
2018-02-05l1sap.c: l1sap_tch_rts_ind: Remove unused variablesPau Espin Pedrol1-6/+1
Commit a1fa955212e18ddca286a2c7d30333116406f56b added them without really making use of them. Change-Id: Ie7cd648a4b8a5ae59efc8953d6424a91a0f025ef
2018-02-05bts-trx: scheduler_trx.c: Fix missing headerPau Espin Pedrol1-0/+1
It is required for bts_shutdown used in trx_fn_timer_cb, and compiler warns about implicit declaration. Change-Id: I274662cd657ce8c36ed1d262d138590808bfafea
2018-02-05Remove unused variablesPau Espin Pedrol2-5/+0
Change-Id: I3fec7e4b337f3ea4d8cd79f4e7261babc34911cb
2018-02-01gsm_pchan2chan_nr: move warning to pragma message and track issuePau Espin Pedrol1-3/+3
Take the chance to move the default option to the end as it's the usually expected syntax. Change-Id: I21298fcd0d1c1aafdd3dc1e8c8dae37b271b1d3d
2018-01-26fix nullpointer deref in rsl_tx_mode_modif_nack()Philipp Maier1-0/+1
The function rsl_tx_mode_modif_nack() uses abis_bts_rsl_sendmsg(). This function relys on msg->trx to be set (see abis.c). However, rsl_tx_mode_modif_nack() creates the message buffer, but does not set msg->trx. - Make sure that msg->trx is set properly Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a
2018-01-26rsl: fix double-free in rsl_rx_mode_modif()Philipp Maier1-1/+0
When the RSL_IE_CHAN_MODE is is missing, then the message buffer is freed and the channel mode modify is nacked using return rsl_tx_mode_modif_nack() The function rsl_tx_mode_modif_nack uses abis_bts_rsl_sendmsg() which returns 0 on success. This eventually leads into a double- free in rsl_rx_dchan() which frees the message buffer on all return codes except 1. - Remove the excess msgb_free() in the error handling path. Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6
2018-01-21Move -I inside *INCDIR variableMax3-3/+3
Previouslywe could end-up passing empty '-I' to compilerif corresponding _INCDIR variable was not defined during the ./configure step. This is apparently tolerated by gcc but still seems like a wrong thingto do. Let's fix this by moving -I inside of *_INCDIR. Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9
2018-01-19bts-trx: Detect duplicated responses for retransmitted commandsPau Espin Pedrol2-2/+19
It was detected that under some conditions, osmo-trx (with limesdr) may take a long time to answer to CMDs, which means trx_ctrl_timer will trigger re-transmitting the last sent but yet unacked CMD. Due to the high latency in osmo-trx, the original AND the rentrasnmited CMD are handled after a while and RSP messages are sent for both. When osmo-bts-trx receives the first RSP, it was marking the CMD as acked and carried on with next one. Then, when the RSP from the retransmited CMD arrives, it already lost state and doesn't know where does that come from. As a result, osmo-bts-trx shutdowns. The issue can be seen in the following truncated log from osmo-bts-trx with TRX category enabled: 20180117135228175 Enqueuing TRX control command 'CMD RXTUNE 1782000' 20180117135228175 Enqueuing TRX control command 'CMD TXTUNE 1877000' 20180117135228175 Enqueuing TRX control command 'CMD SETTSC 7' 20180117135228175 Enqueuing TRX control command 'CMD POWERON' 20180117135228175 Enqueuing TRX control command 'CMD SETRXGAIN 1' 20180117135228175 Enqueuing TRX control command 'CMD SETPOWER 20' 20180117135228175 Enqueuing TRX control command 'CMD SETSLOT 0 5' ... 20180117135249829 Response message: 'RSP POWEROFF 0' 20180117135249855 Response message: 'RSP RXTUNE 0 1782000' 20180117135249876 Response message: 'RSP TXTUNE 0 1877000' 20180117135249876 Response message: 'RSP SETTSC 0 7' 20180117135250648 Response message: 'RSP POWERON 0' 20180117135251150 Response message: 'RSP SETRXGAIN 0 0' 20180117135253151 No response from transceiver for phy0.0 (CMD SETPOWER 20) 20180117135253777 Response message: 'RSP SETPOWER 0 20' 20180117135254535 Clock indication: fn=2018878 20180117135255777 No response from transceiver for phy0.0 (CMD SETSLOT 0 5) ... 20180117135256858 Response message: 'RSP SETPOWER 0 20' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETPOWER 0 20' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETSLOT 0 0 5' Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a
2018-01-19bts-trx: trx_if.c: Improve parsing of received RSP messages from TRXPau Espin Pedrol2-70/+130
First the cached CMD sent (struct trx_ctrl_msg) is reworked to have the cmdname and the params in different buffers for easier comparison with RSP later. For the receive path (trx_ctrl_read_cb), new function helpers are added to parse the buffer into cmdname+params+code (parse_rsp) and to compare if a given RSP matches the current CMD we sent (cmd_matches_rsp). The reasoning behind this patch is that a way to check for parameters when receiving a RSP will be needed in future work, as before this patch checking of parameters is ignored. This commit is a preparation for commit to check for duplicated responses. Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034
2018-01-19bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of funcPau Espin Pedrol1-6/+7
The move includes a small logic change: If there's a mismatch between the rsp and the cmd, now we bts_shutdown instead of blindly skipping expected RSP and continuing with sending the next CMD in the queue. The change is specially not a problem since next patches are improving the logic furthermore to account for duplicates, different parameters, etc. Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e
2018-01-19bts-trx: trx_if.c: Log timedout+retransmitted CMDPau Espin Pedrol1-2/+7
Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a
2018-01-19Allow specifying sysmocom headers explicitlyMax1-1/+1
Add configure option --with-sysmobts=$INCDIR (like for LC1.5). Use to fix the jenkins build to fix the build after migration to stow, where we can no longer use a commin -I to include the sysmobts headers as well. Tweaked-by: neels Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a