aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-litecell15
AgeCommit message (Collapse)AuthorFilesLines
2017-02-01Fix AMR HR DTX FSM logic.Jean-Francois Dionne2-6/+15
Fix SID_FIRST_INH detection during speech and when SID_FIRST is interrupted by FACCH. Fix SID_UPDATE_INH detection during silence and when SID_UPDATE is interrupted by FACCH. Add a delay for SID_FIRST to appear at the right time after FACCH. Fix extra byte sent in downlink for SID_FIRST and SID_UPDATE. Change-Id: Ia811305e15541f2376005df736bd610e8b0d2f69
2017-02-01DTX: fix "unexpected burst" errorJean-Francois Dionne1-0/+1
Fix error during FACCH interruption of DTX for AMR HR. Max's note: added fix for sysmobts. Change-Id: Ib064952331b4f89676ee68a3d8078b1d9debe570 Related: OS#1801
2017-01-31sysmo,lc15: fix memory leak at each call placedJean-Francois Dionne1-1/+3
Max's note: added same fix for default case and ported it to sysmobts. Change-Id: Ife1293e3238cfda16eac9c28e7e81ffe5595e031
2017-01-12lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind()Jean-Francois Dionne1-0/+1
Change-Id: I3061060235a488b114b636b3af9a2253a94de1e8
2017-01-10DTX: fix SID-FIRST detectionJean-Francois Dionne1-1/+1
Max's note: made similar modification to osmo-bts-sysmo/tch.c Change-Id: I76e62783b73803dfc0d32693a68020a9d89878b8 Related: OS#1801
2017-01-04DTX AMR HR: fix inhibitionMax2-1/+6
* Unlike in AMR FR, in AMR HR incoming ONSET have to be treated differently depending on whether we've recently sent SID UPDATE or EMPTY frame. Split ST_SID_U FSM state into 2 states to accommodate for that and make sure that additional states specific to AMR HR are not used for AMR FR. * Avoid sending E_VOICE and E_SID_U in corresponding states as those do not initiate FSM state transitions anyway. This decrease extra load from FSM signalling which otherwise would be triggered on per-frame basis. * Introduce separate signal for SID First P1 -> P2 transition to avoid confusion with E_COMPL and E_SID_U initiated transitions from P1 state. * Don't init DTX FSM for SDCCH channels. Change-Id: I229ba39a38a223fada4881fc9aca35d3639371f8 Related: OS#1801
2016-12-01Fix AGCH/PCH proportional allocationMax2-18/+7
Do not assume that 1 == BS_AG_BLKS_RES but take that information from SI3. Note: due to current implementation quirks we activate channels before SI3 obtained, than we deactivate channels upon receiving SI3 and activate them again. This might not be necessary once we migrate to proper OML state machines. This affects lc15 and sysmo hw. Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Related: OS#1575
2016-12-01Remove duplicated codeMax2-6/+4
Remove lchan deactivation related code duplication to facilitate future use for dynamic CCCH re-activation. Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01DTX DL AMR: rewrite FSM recursionMax2-32/+32
Add explicit state for recursion (sending the different payload data in response to the RTS request for same FN) and corresponding transition. Remove ST_FACCH_V as with new explicit recursion handling it becomes unreacheable. This makes it easier to maintain preemption (interruption of current procedure due to FACCH or Inhibition). This also reduces the number of possible transitions out of each state thus reducing graph's cyclomatic complexity. Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14
2016-11-11Replace link_id constant with defineMax1-3/+3
Instead of using constant for link_id directly, use shared define value. Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-08DTX DL: tighten check for enabled operationMax2-4/+4
Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541
2016-11-03DTX fix ONSET handlingMax2-3/+2
* re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case multiple FACCH occur duriing DTX silence period. * produce ONSET event after both SID FIRST and UPDATE in case of AMR FR. * always dispatch E_SID_F (SID FIRST) signal if in talkspurt. * allow E_SID_* right after ONSET (zero-length talkspurt). * add missing E_ONSET signal description. * fix FSM transitions for AMR HR *Inhibited and First P*. * fix incorrect return from l1if_tch_encode() in ONSET FACCH with incoming SID UPDATE Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Related: OS#1801
2016-10-28DTX DL: split ONSET state handlingMax2-8/+47
Handle ONSET cause by Voice and FACCH separately. In case of Voice we have RTP payload which we have to cache and send later on in next response to L1 RTS. FACCH have higher priority so it preempts both voice and silence alike - hence we can send ONSET immediately but still have to track previous state in order to get back to it gracefully. This affects lc15 and sysmo hw as there's no FSM-based DTX implementation for other models yet. Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx struct. Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052 Related: OS#1802
2016-10-2711bit RACH support for osmo-bts-litecell15bhargava1-3/+40
Based on the indication from L1, number of bits in RACH and burst type is determined. Appropriate parameters are filled in osmo-bts-litecell15. These parameters are sent to osmo-pcu for processing of the RACH. Change-Id: Ie5207a15424fb287febf74e830297531232accde
2016-10-18Fix lc15 buildMax1-1/+1
The error seems to be introduced in 21142f789812553b56f493d79184f5a31ab7b1cd Change-Id: I620ac6774fb47479d74bc4470ccc6edd379600ba
2016-10-18Replace magic number with defineMax1-2/+3
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-14msgb ctx: use new msgb_talloc_ctx_init() in various main()sNeels Hofmeyr1-3/+1
Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a
2016-10-13DTX DL: use FSM for AMRMax3-38/+102
Use dedicated FSM to handle all DTX DL related events: - add explicit checks if DTX DL is enabled (fixes regression for non-DTX setup introduced in 654175f33bd412671e3ef8cdd65c0689d10f278c) - fix handling of AMR CMI for SPEECH frames - add FSM for DTX DL - sync with corresponding changes in OpenBSC's - handle FACCH-related DTX ONSET events This affects both lc15 and sysmobts and requires corresponding change in OpenBSC (Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd). Change-Id: I74a0b42cb34d525b8a70d264135e82994ca70d31
2016-10-12Move copy-pasted array into shared headerMax1-6/+0
Change-Id: I377ece2845830e3defab2d515f44b629ce5aed8e
2016-09-30DTX: send AMR voice alongside with ONSETMax3-10/+16
When ONSET event happens (either via Marker bit or due to unmarked talkspurt) we should first send Onset event to L1 and than send voice data in response to the same PH-RTS.ind. Change-Id: I2a7b89430ca49eee4a350c5f980bd6bcbc386347
2016-09-30DTX: move ONSET detection into separate functionMax1-36/+19
Move code from tch.c (lc15, sysmo) into generic function which: - check if talkspurt is happening - cache SID if necessary or invalidate cache - fill in CMR & CMI prefix This also fixes the problem when SID FIRST was cached without sending just like SID UPDATE instead of being sent right away. Change-Id: I6c7016a54749abadeef4fd4f5b6f750b256fb916
2016-09-30DTX: further AMR SID cache fixes (lc15, sysmo)Max1-81/+33
* consolidate AMR CMR and CMI handling in common/amr.c * use it in save_last_sid() * remove dead code * properly compute RTP payload length for AMR * use save_last_sid() for FR & HR as well * invalidate cached SID if SPEECH frame is received Fixes: OS #1800, #1801 Change-Id: I5a1c1ad0b0a295a50e67775a4db85f1d331755ed
2016-09-30DTX: move scheduling check inside repeat_last_sidMax1-25/+9
Note: this also require changes to properly link against libosmocodec - see 2bb65be159dfdabf664fec569b343320301701b0 in libosmocore. Change-Id: I96594cf3aa1013d505bd20069d5bf261d9a2aefb
2016-09-30LC15: Clarify msgb ownership / fix memory leaksMax1-22/+31
This is similar to 21b020b33633683d7c785af15c773aab0f79d0de which changes the way msgb is allocated/freed in sysmobts. Change-Id: I393828a7b1fb5927453ee25f54d605a5d3ea7087
2016-09-26DTX: remove misleading commentMax1-1/+1
There's no SID stored in UL direction so there's nothing to remove. Change-Id: I3f587a66406bc6a02b859e826f4903641fcc5a15
2016-09-24DTX: check Marker bit to send ONSET to L1Max3-11/+36
If Marker bit is set than it's a talkspurt which we have to explicitly indicate to L1 by first sending ONSET message and than actual voice data in a separate message. This change affect sysmobts and LC15 hw. Change-Id: I88c41568bcb0d82699f617adc4ad192603dd1bb6 Related: OS#1750
2016-09-24sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vtyNeels Hofmeyr1-1/+1
Instead of passing the msgb ctx to telnet_init(), pass the *mgr* ctx. Change-Id: I213fe52648a1937d8f8c1730ce787e42f0add75f
2016-09-23lc15, sysmo: Use SID_FIRST_P1 to initiate DTXMax1-2/+1
Some phone seems to not send SID_FIRST_P2 message which seems like a different understanding of the DTX spec. L1 accommodates for that by using P1 to supply data for SID. Hence we should use it to initiate DTX and ignore P2 message in case of AMR HR. Change-Id: Iaf993b89caa0ad49b97d1c745dcaf039f867f018
2016-09-23DTX: fix SID logicMax3-9/+19
Previously receiving SID via RTP always caused it's transmission to L1 regardless of the time which might have resulted in excess traffic. Fix this by only saving SID data and transmitting it later on as necessary according to 3GPP TS 26.093 A.5.1.1. Change-Id: Ifcdc5c60d0238b704a94f6778d4e00f2b087b090 Fixes: OS#1801
2016-09-23DTX: fix SID repeat schedulingMax1-58/+10
Previously SID retransmission was scheduled incorrectly based on GSM frames instead of voice frames. Fix this by using GSM Fn only as elapsed time estimation: * move saved SID retransmission into generic function from lc15 and sysmo specific code * split retransmission time check into separate generic function * compute estimation for elapsed time since last retransmission using GSM Fn Change-Id: Ib054b458a7345d9ba40dba53754ca59ab099c8e8 Fixes: OS#1799
2016-09-23DTX: fix last SID savingMax3-13/+7
Previously SID was saved explicitly by each BTS model (lc15, sysmo) instead of relying on generic function. Fix it by using generic function and propagating necessary parameters for it. Change-Id: Ie545212cce5ed2b3ea3228597f18a473f5e1deb4 Fixes: OS#1800
2016-09-17log: sysmo,lc15: tweak log about sapi_cmds queueNeels Hofmeyr1-3/+6
The osmo-bts log used to say this a lot: DL1C <0006> oml.c:758 (bts=0,trx=0,ts=0,ss=1) End of queue encountered. Now empty? 1 - Move this to DEBUG level instead of NOTICE. - Tweak wording and logic so it says one of: [...] End of SAPI cmd queue encountered. Queue is now empty. [...] End of SAPI cmd queue encountered. More pending. Change-Id: I5a46c90d016cee9b50f32db2af568765d3cb74cc
2016-08-30Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0beNeels Hofmeyr1-8/+19
Commit "sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH" introduced a check for TCH/F_PDCH intended only for TCH/F_TCH/H_PDCH. It looked correct, but TCH/F_PDCH startup was designed differently: For TCH/F_PDCH, the idea was to look it up in pchan_to_logChComb[] and obtain the TCH/F channel combination, so that TCH/F_PDCH first initialize as TCH/F. So pchan was in fact intended to be passed as TCH/F_PDCH. For Osmocom TCH/F_TCH/H_PDCH, we've in the meantime added a ts_opstart() function that makes this decision explicitly. So, instead of reverting the erratic commit, add TCH/F_PDCH to ts_opstart(), for both sysmo and lc15. In ts_opstart(), move to a switch statement to resolve the actual pchan to use for ts_connect_as(). Drop TCH/F_PDCH and TCH/F_TCH/H_PDCH from pchan_to_logChComb[] and comment. Change-Id: I376b92a06f4cbe943c1c913dea7487fac53a7d08
2016-08-30dyn TS: sysmo,lc15: ph_data_req: fix PDCH mode detectionNeels Hofmeyr1-1/+1
Though this patch theoretically makes a lot of sense, it is not entirely clear why dyn TS are working without it. Committing due to common sense, not to fix any actual breakage. Change-Id: I6136cb42a4d627ebefc963eb5321fadfe63cca4b
2016-08-10sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCHNeels Hofmeyr1-1/+2
Change-Id: I76c868a1e70af16268a6fa42dc736cf0b288ecdb
2016-08-08Fill measurements data for L1SAPMax1-1/+5
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-27dyn TS: sysmo,lc15: chan_nr_by_sapi(): add missing assertionNeels Hofmeyr1-0/+1
Addition of GSM_PCHAN_TCH_F_TCH_H_PDCH should have added these assertions. They clarify that only 'real' pchan types are expected in this function. Change-Id: Ifd4b6820861ef716237e7eeed149b2add9e7d485
2016-07-25dyn TS: implement litecell15 specificsNeels Hofmeyr2-9/+33
For chan_nr_by_sapi(), add GSM_PCHAN_TCH_F_TCH_H_PDCH to pick_pchan(). Add GSM_PCHAN_TCH_F_TCH_H_PDCH to pchan_to_logChComb[] for first pchan initialization. In ts_connect_as(), make sure that callers pass proper "real world" pchan types, i.e. reject the "meta" GSM_PCHAN_TCH_F_TCH_H_PDCH pchan constant. In ts_opstart(), connect as PCHAN_NONE since we will only know the desired pchan when the first RSL chan activ is received. Add GSM_PCHAN_TCH_F_TCH_H_PDCH to lchan_to_GsmL1_SubCh_t(), by using its current "real" pchan mode. Call cb_ts_[dis]connected() unconditionally, i.e. not only for TCH_F_PDCH when a pending flag is set. The cb_ts_[dis]connected() will be a no-op if the pchan type is not dynamic. Change-Id: Ie30323f968da25027045c42a7ae7f1e70ca711ae
2016-07-25lc15/oml.c: rename ts_connect() to ts_opstart()Neels Hofmeyr1-2/+2
ts_connect() is only called during OPSTART. Name it such because a special case for OPSTART will be added there for dyn TS. Change-Id: Iba6880d94142096a8371b08f7404035912cadbb0
2016-07-25cosmetic: clarify TCH/F_PDCH related naming and commentsNeels Hofmeyr1-2/+2
We're about to introduce a new kind of dynamic channel, which will also use parts of the ip.access mode dyn PDCH code paths. Make sure the general parts have general names and mark ip.access specific parts as such. Rename dyn_pdch_ts_[dis]connected() to cb_ts_[dis]connected(). Rename dyn_pdch_complete to ipacc_dyn_pdch_complete(). From cb_ts_[dis]connected(), factor out the current code into static functions ipacc_dyn_pdch_[dis]connected() -- this will make sense once the new dynamic kind is added to cb_ts_[dis]connected(). Change-Id: I7da5b7cb7b48572671f50e0dec97d9eec3083df1
2016-06-24Remove duplicated nibble shift codeMax1-39/+0
Those functions are now part of libosmocore. Change-Id: Iab3206e3b41caff23f656a727605032df9798953
2016-06-23DTXu: move copy-pasted code to common partMax1-18/+4
Abstract code for checking/setting lchan's UL SID flag and RTP Marker into generic function and use it for LC15 and sysmoBTS. Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Related: OS#1750
2016-06-23Make get_lchan_by_chan_nr globally availableMax1-11/+5
* Remove static qualifier * Remove duplicated code - use generic function instead Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d
2016-06-23fix compiler warning: remove unused variable 'i' in calib_verify()Neels Hofmeyr1-1/+1
Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb
2016-06-23fix compiler warning: remove useless 'static' storage class for struct declNeels Hofmeyr1-1/+1
Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c
2016-06-22vty: install orphaned trx nominal power commandNeels Hofmeyr1-0/+2
The cfg_trx_nominal_power_cmd added 12 days ago in 58e4e18206501c3bffa65f0b876bbc5ebe175d6e was floating. Actually add it to the TRX_NODE. Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0
2016-06-22dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*()Neels Hofmeyr1-2/+49
Analogous to 63b296bdd9a25134ee61ce6f269750e796a8bfca on osmo-bts-sysmo. Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1. Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in common/rsl.c. Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb to invoke dyn_pdch_connected() in common/rsl.c. Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4
2016-06-22dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/FNeels Hofmeyr1-1/+2
Analogous to 57fc1124e1649fa2b08ef143697689aca4677625 on osmo-bts-sysmo. Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba
2016-06-22dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() gutsNeels Hofmeyr1-3/+10
Analogous to 294fbe104b9fb12f06f7cebe68a4b7a6ed28d5ef on osmo-bts-sysmo. For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH. Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave ts_connect() as a thin wrapper to leave init code unchanged. Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5
2016-06-22dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flagsNeels Hofmeyr1-3/+15
Analogous to 0d10f0e482cdd50acc916e75a8b3ba1beb94227c on osmo-bts-sysmo. According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba