aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon/gsm_data_shared.c
AgeCommit message (Collapse)AuthorFilesLines
2017-02-24fixup_for_chreq_cause_codespmaier/rbs2000Philipp Maier1-0/+10
2017-02-24HACK: Don't require TRX numbers to start at 0Harald Welte1-26/+18
Change-Id: I6c5fcb06bdbe0377e2ebc46ecd73d11e834a6d99
2016-12-09lchan release in error state: SACCH deact only for SACCH pchansNeels Hofmeyr1-1/+1
This is useful particularly in case where we deactivate PDCHs which don't have a SACCH associated. The existin code would always attempt to deactivate a SACCH even in those cases, leading to the BTS responsding with related error messages. Change-Id: Iaf46782329b38ba8f3d438e6c75c2d467b852734
2016-10-18Replace magic number with defineMax1-1/+1
Value 4 used as magic number by both OpenBSC and OsmoBTS so it make sense to add it to shared header. See ebb483b69a5319e522ba5f713e9cb6f68a814a6a in osmo-bts for details. Change-Id: I9c6ad68f4c6aa72d39ec7e5a6968b36ec20e79f4
2016-10-10gsm_trx_name(): don't break if trx is NULLNeels Hofmeyr1-2/+5
Just as a general precaution deemed to fit such a convenience function that lives in libcommon, no actual failure observed. Change-Id: I8e77fe1abc402469fd037e2fde2f46e2c8114f59
2016-09-28dyn TS: fix: e1_config.c: switch(pchan) for dyn TSNeels Hofmeyr1-0/+16
Add ts_is_tch() in gsm_data_shared.h/.c and use it to replace a switch on the pchan in e1_config.c. This patch is not due to an actual observed failure. A general grep for switch on pchan turned up this instance that doesn't handle dyn TS properly. Hence this patch is not actually tested with real equipment. Change-Id: Ide4f156034bab77140d2d9a8c462d68ae6f0d6a6
2016-09-28dyn TS: fix: ts_subslots() for TCH/F_PDCH in PDCH modeNeels Hofmeyr1-6/+20
In gsm_data_shared.c, add ts_pchan() to determine actual pchan type for dynamic and non-dynamic TS. Use in ts_subslots() to fix the value returned for TCH/F_PDCH in PDCH mode. Adjust the assertion in channel_test.c accordingly. Drop GSM_PCHAN_TCH_F_PDCH, which is now handled in ts_pchan(). Explicitly add GSM_PCHAN_PDCH as zero in subslots_per_pchan[] (cosmetic). Adjust the comment in subslots_per_pchan[]. The fix for the number of subslots affects only one caller: bts_chan_load() in chan_alloc.c. Before this, it would always include a TCH/F_PDCH in the load_counter->total, now it is skipped when in PDCH mode. Whether this is the way bts_chan_load() should handle dynamic TS is a separate discussion, so far I'm only making sure that the two dyn TS kinds act in the same way: TCH/F_TCH/H_PDCH is only counted when in TCH mode, and TCH/F_PDCH should match. Change-Id: Icd6668667ad2be7ad20866ffd185bf3b8711ccd6
2016-08-27move ts_sublots() to gsm_data_shared.c, it will be used by osmo-btsNeels Hofmeyr1-0/+25
Change-Id: I8ba06d7dd6e0ceab3d8d18bb565354d6ed461f7e
2016-08-10gsm_pchan2chan_nr(): fix uninitialized cbitsNeels Hofmeyr1-6/+5
Commit ec1b5a0e9e2b6549e0ede48e803095e569997355 introduced an unset cbits value for the 'special hack for BCCH', where I break out of the switch without setting cbits. Fix that. Also remove the comment part that says 'return 0', because I don't return 0. Change-Id: I54129d921807971eeafc23f80c57666c67b71377
2016-08-10gsm_pchan2chan_nr: disable a chan_nr assert in BTS, to not break octphyNeels Hofmeyr1-0/+10
In https://gerrit.osmocom.org/589 , msuraev reports an assertion on octphy. So disable this recently added assertion until we clarify the invocation in question. Change-Id: Ia0f7ae5b114e179ab56b98adbae9810e81b4b88f
2016-07-28dyn TS: rsl_lchan_lookup(): add dyn PCHANNeels Hofmeyr1-2/+12
Accept GSM_PCHAN_TCH_F_TCH_H_PDCH for TCH/F and TCH/H if in matching pchan mode or switching to matching pchan. Accept RSL_CHAN_OSMO_PDCH chan_nr cbits for GSM_PCHAN_TCH_F_TCH_H_PDCH pchan. Change-Id: If8f7c118f69e5a9f370bfe25f82f3d5a8de75b51
2016-07-28dyn TS: rsl *2chan_nr(): handle TCH/F_TCH/H_PDCHNeels Hofmeyr1-0/+7
In gsm_lchan2chan_nr() use the current pchan type. In gsm_lchan_as_pchan2chan_nr(), add the special case of non-standard cbits for activating PDCH on a TCH/F_TCH/H_PDCH dyn TS. This way, gsm_pchan2chan_nr() conforms to the standard and does not need access to a ts struct. Change-Id: If248b9073b9f397110a2003d8e1a04afdc1c0e20
2016-07-28dyn TS: gsm_lchan2chan_nr(): decouple from ts->pchanNeels Hofmeyr1-4/+11
For upcoming dynamic TS, the pchan choice for RSL De-/Activation is not trivial. So in order to pass the desired pchan to generate the RSL chan_nr, introduce gsm_lchan_as_pchan2chan_nr(). To avoid code dup, this requires decoupling the gsm_ts2chan_nr() pchan from the actual ts struct, so refactor gsm_ts2chan_nr() to gsm_pchan2chan_nr() with explicit pchan, ts_nr and lchan_nr arguments. Change-Id: I1a40e8452fe8120d350a27973e56be0b8c8c517f
2016-07-28gsm_ts2chan_nr(): add assertions for lchan_nrNeels Hofmeyr1-0/+14
Change-Id: Ibfdef347c85d4a145645a7325cd193ea1b475a54
2016-07-25code dup: join [rsl_]lchan_lookup() from libbsc and osmo-btsNeels Hofmeyr1-0/+49
lchan_lookup in abis_rsl.c and rsl_lchan_lookup() from osmo-bts rsl.c are the same code, except for the log context, which is only set in abis_rsl.c. Factor out the common code to rsl_lchan_lookup() in gsm_data_shared.c. Openbsc and osmo-bts each define their own DRSL log constant, so add an int *rc return code argument and keep the logging part in abis_rsl.c's thin lchan_lookup() wrapper. Incidentally, this also removes code dup for logging. To avoid duplicate symbols, the rsl_lchan_lookup() implementation needs to be removed from osmo-bts, so older osmo-bts git revisions will not build with this. Change-Id: Ie89bc5bb9110a0e539d37991dedac6f913211b48
2016-07-25gsm_data_shared: add gsm_ts_and_pchan_name() for dyn ts loggingNeels Hofmeyr1-0/+49
Change-Id: I9b6be77c9e5fb9dffa2021a2da72293af15a03a0
2016-07-25dyn TS: add ts->dyn stateNeels Hofmeyr1-0/+2
Add state fields osmo_bts_trx_ts->dyn.* to record dynamic timeslot state. Initialize in gsm_bts_trx_alloc(). Change-Id: I0a4049df8500b4f7c864f1355c4e9238932d1b8f
2016-07-24fix ctrl test: dyn TS: use new GSM_PCHAN_TCH_F_TCH_H_PDCHNeels Hofmeyr1-2/+4
Add GSM_PCHAN_TCH_F_TCH_H_PDCH in gsm_pchant_names and gsm_pchant_descs: the VTY and CTRL can now handle the new pchan type. Adjust the CTRL iface test to expect the new PCHAN type in the output. Fixes make check with --enable-external-tests after libosmocore commit fd80f5a04239c2ab7b561401476dd89f2861748b that adds GSM_PCHAN_TCH_F_TCH_H_PDCH. Change-Id: I4ad9c972d7f76f7e20cf74d6fc3d1928b644a4f8
2016-06-18rm dup: use channel type names from libosmocoreNeels Hofmeyr1-11/+2
In gsm_lchant_name(enum gsm_chan_t), use the gsm_chan_t_names value strings from libosmocore instead of redefining the same strings. The list from libosmocore is also more complete, including CCCH and PDTCH. Add a todo comment to move to libosmocore. In consequence, libosmogsm linkage needs to be added to osmo-bsc_mgcp, mgcp_test, mgcp_transcoding_test and smpp_mirror, smpp_test. Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc
2015-12-05gsm_data_shared: compute/sprintf the lchan name only onceHarald Welte1-1/+4
We now store the pre-printed lchan name in lchan->name to avoid having to call sprintf every time there is a debug statement somewhere, particularly as most of those debug statements are going to be inactive most of the time.
2015-01-31ctrl/bsc: Fix copy and paste error and update textHolger Hans Peter Freyther1-2/+2
30f1f376383df3ae8d85e96542bf14d174c25d89 introduced new channel combinations but had a copy and paste error in the description. The jenkins system didn't run the external tests so this issue and others were not noticed until now. Fix the copy and paste and update the test result.
2014-12-30move gsm_bts_get_cbch() to gsm_data_shared() as its needed in osmo-btsHarald Welte1-0/+21
2014-12-30Add basic support for CBCH / SMS-CB (Cell Brroadcast)Harald Welte1-3/+10
We can now configure the pyisical channel types for CBCH either in the CCCH+SDCCH4 or in the SDCCH8 chanel combination. Depending on whether a CBCH exists on the BTS, we also generate the SI4 with matching CBCH channel description to notify the phones of the existance of the CBCH. There is now a VTY command how a SMS-CB message can be sent to a given BTS. We do not yet have any logic at all for actual scheduling of multiple CBCH RSL messages towards one or multiple BTSs yet, though.
2014-11-21bts: Store the bcch_change_mark in the bts structureHolger Hans Peter Freyther1-0/+3
Store the BCCH change mark inside the BTS structure. This will allow us increment the number and re-generate the SIs. Related: SYS#739
2014-08-24move gsm_bts_num() to gsm_data_shared.[ch]Harald Welte1-0/+15
this way we can drop a copy of this function from osmo-bts.
2013-07-18oml: Add a missing break switch for NM_OC_BS11Holger Hans Peter Freyther1-0/+1
It appears to me that for NM_OC_BS11 mo was either NULL or the one mo value from NM_OC_BS11_RACK. The break inside the nested switch case didn't break from the outer one. Fixes Coverity: CID 1040728
2013-04-05sysmobts: Add the necessary data structure and init for the SAPI queueHolger Hans Peter Freyther1-0/+4
The sysmobts is now having a SAPI queue with all pending SAPI operations on the BTS. Add the llist_head to the lchan and make sure it is initialized by the shared code.
2012-12-23lchan: Introduce a BROKEN state for the lchanHolger Hans Peter Freyther1-0/+1
If the CHAN ACTIV is NACKED we set the state backto NONE. This is problematic as our channel allocator will allocate from the front or from the back and if the channel is early in the list it might cause permanent failures. Introduce a BROKEN state and use it when the channel activation is failing for an unknown reason. Copy the cause so it can be inspected later.
2012-09-29Fix: T3192 and T3193 must be similarAndreas Eversberg1-1/+1
In order to keep mobile at PACCH as long as possible the timer T3192 is set to 1500ms. This reduces the probablity of long lasting assignment process on CCCH for subsequent downlink TBFs.
2012-08-17dynamically generate a proper VTY reference for phys_chan_configHarald Welte1-5/+19
this uses vty_cmd_string_from_valstr() from _very_ recent libosmocore, so you have to update the library, sorry.
2012-06-28gsm_data_shared: add structure for decoded parameters of RLC configHarald Welte1-0/+24
this is primarily needed on the BTS side, but we should also use it on the BSC side and make the parameters VTY-configurable.
2011-09-26gsm_data_shared: use 'const' whenever applicableHarald Welte1-7/+7
2011-07-18bts-init: Initialize the BTS like it will look after a resetHolger Hans Peter Freyther1-1/+0
Reset the BTS MO State on BTS bootstrap. This way we will always test the BTS disconnect/reconnect case of the BTS. Do not reset the administrative state of objects. The BSC might have set these and wants to maintain them across disconnect/ reconnect. Right now this is true for the TRX state.
2011-06-29properly reset the MO state of all MO on Abis disconnect0.9.14Harald Welte1-3/+32
When we loose the A-bis link, we should properly re-set the administrative, operational and availability state of all MOs
2011-06-25move {ts,lchan}2chan_nr() functions to gsm_data_shared.cHarald Welte1-0/+39
... this way osmo-bts can use them
2011-06-07initialize NM state for all objects to known stateHarald Welte1-0/+3
2011-06-06gsm_data_shared: make sure to initialzie the MO obj_class/obj_instHarald Welte1-9/+22
2011-06-06add mo->bts member so we can discover which BTS a MO belong stoHarald Welte1-0/+17
2011-06-06move objclass2{nmstate,mo,}obj() to gsm_data_shared.c (and prefix)Harald Welte1-0/+148
2011-06-06make sure to include gsm_data.h, not gsm_data_shared.hHarald Welte1-1/+1
2011-06-05split gsm_data.c in gsm_data_shared.c and gsm_data.cHarald Welte1-0/+229
This facilitates the use of gsm_data.c from osmo-bts