aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_data_shared.h
AgeCommit message (Collapse)AuthorFilesLines
2016-11-12factor out & introduce struct gsm_encr, in xsc.hNeels Hofmeyr1-6/+3
Factor out encryption info from struct gsm_lchan as struct gsm_encr, placed in xsc.h. Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac Future: this will be used by libmsc's subscriber connection, for osmo-cscn.
2016-11-08WIP: OM2000: Full state machine implementation using osmo_fsmHarald Welte1-0/+39
Our existing OM2000 code for initializing all Managed Objects of a BTS at startup was never complete. Rather than trying to fix the old-style code, introudce a hierarchy of osmo_fsm's reflecting the full protocol hand-shake and sequence of bringing up the individual MO's. If this works out well, it mihgt make sense to convert the TS 12.21 OML code for other BTS models, too. Change-Id: I3e11b28ba22b8c227e0401e6207fdda5381dda8c
2016-10-28DTX DL: Add FACCH cacheMax1-0/+3
When DL DTX is active and silent period is in progress dtx.cache is populated by SID UPDATE message which about to be scheduled next. If at that moment FACCH message arrives (which have higher priority) we have to send ONSET message to L1 but we can't invalidate cache with SID UPDATE as it will be used for SID FIRST message to resume silent period after FACCH transmission is over (provided there were no incoming voice in between). Hence the necessity for separate buffer to store content of FACCH message while we're sending ONSET to L1 while keeping SID UPDATE cached. Change-Id: I316e81af893b24766bf259baaed7a0be75a11694 Related: OS#1801
2016-10-18Replace magic number with defineMax1-0/+4
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-12DTX DL: use FSM for AMRMax1-12/+9
- consolidate all DTX-specific things in a separate struct - rename struct fields to better reflect meaning - add pointer to DL FSM for AMR - remove unused flag - expand buffer to hold cached payload alongside with CMR/CMI Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd
2016-10-05DTX: add flag for AMR HR P*Max1-0/+5
Add flag to explicitly track the state of DTX DL for AMR HR whe SID_FIRST_P1 has been sent to L1 already but no next frame available yet: this can be followed by SID_FIRST_P2 or SID_FIRST_INH depending on arrival of voice frame within next 60 ms. Change-Id: Id28b07b8e83cfe5e84de48a2f124084036580cd4
2016-10-05DTX: extend SID cacheMax1-1/+1
In addition to RTP payload SID cache got to store CMR/CMI prefix. Extend the buffer so it can fit in. Change-Id: Ibd4a63604a82cad3ce65f0752bffefa4b083e1b3 Fixes: Coverity CID#149508
2016-09-28dyn TS: fix: e1_config.c: switch(pchan) for dyn TSNeels Hofmeyr1-0/+1
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-17Modify SI 13 field for control_ack_typeMax1-0/+1
Add vty function to explicitly set use of 4xRACH type of ack message for PACKET CONTROL ACKNOWLEDGMENT. Previous hardcoded value (use RLC/MAC control block) is used as a default. This is handy for debugging issues related to Timing Advance in context of GPRS. Change-Id: Ie869ac0a82055110f1e3b875e246750c4e113336 Related: OS#1526
2016-08-27move ts_sublots() to gsm_data_shared.c, it will be used by osmo-btsNeels Hofmeyr1-0/+2
Change-Id: I8ba06d7dd6e0ceab3d8d18bb565354d6ed461f7e
2016-07-28dyn TS: implement pchan switchover logicNeels Hofmeyr1-0/+2
In struct gsm_lchan, add dyn.rqd_ref and dyn.rqd_ta. These save the Channel Requested details across the PDCH deactivation dance. abis_rsl.c: add static functions: * dyn_ts_switchover*() for the various stages of switchover between pchans. * pchan_for_lchant() to derive the desired pchan from the lchan type that was set during lchan_alloc(). * rsl_chan_activate_lchan_as_pdch() to compose the simpler RSL CHAN ACT message without introducing numerous special cases to the normal RSL CHAN ACT code. In rsl_chan_activate_lchan(), detect and initiate required pchan switchovers if requested pchan on a dyn TS differs. In rsl_rx_rf_chan_rel_ack(), initiate or continue pchan switchovers after a channel was released. In rsl_rx_chan_act_ack(), notice that a switchover is complete. In chan_alloc.c, add ts_subslots(): abis_rsl.c will need to know the number of subslots per pchan, to verify that all lchans are free before dyn TS switchover. The subslots_per_pchan[] array is static to lchan_alloc.c, and since we need a non-trivial check for dyn TS anyway, add public ts_subslots() to lchan_alloc.c, which also checks the current dyn pchan type. Change-Id: I5c6bce13092a10204113d84678c587c65e35e4fd
2016-07-28dyn TS: gsm_lchan2chan_nr(): decouple from ts->pchanNeels Hofmeyr1-1/+4
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-28dyn TS: rename lchan->dyn_pdch to lchan->dynNeels Hofmeyr1-1/+1
This will also be used by the new dynamic TS type, so make the name more general. Change-Id: I2451b10519dff3e5cdf503b430574c0984d19000
2016-07-28Modify SI 13 field to support 11 bit RACHbhargava1-0/+1
System Information 13 field EGPRS PACKET CHANNEL REQUEST is modified to support 11 bit RACH. Further VTY configuration is added to enable/disable 11 bit RACH support in EGPRS. By default 11 bit RACH support is disabled. Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297
2016-07-25code dup: join [rsl_]lchan_lookup() from libbsc and osmo-btsNeels Hofmeyr1-0/+2
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/+1
Change-Id: I9b6be77c9e5fb9dffa2021a2da72293af15a03a0
2016-07-25dyn TS: add ts->dyn stateNeels Hofmeyr1-0/+6
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/+2
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-1/+0
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
2016-06-16dyn PDCH: TS flags: rename one, add three, as enumNeels Hofmeyr1-1/+8
Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth value's meaning. Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and possibly other BTS implementations) to remember what to do when the PCU replies with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both. Change from #define to an enum. Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH commits, so osmo-bts submission depends on this commit. Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3
2016-06-14dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channelAndreas Eversberg1-0/+6
Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6
2016-06-12Add talkspurt indicator for gsm_lchanMax1-1/+2
Add bit which can be set on BTS side to indicate that next RTP frame should be marked as a beginning of speech. Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Related: OS#1562
2016-06-10DTX: add data necessary for schedulingMax1-0/+5
DTXd: to schedule SID repetition we have to know when previous SID was sent (fn) and if it was UPDATE or FIRST SID (is_update). DTXu: to properly set Marker bit in outgoing RTP we have to know the beginning of talkspurt. For codecs without explicit ONSET event we can do it by setting the flag (ul_sid) upon receiving SID and unsetting it on speech frames. Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Related: OS#22, OS#1701
2016-06-10Add DTXd indicator to gsm_lchanMax1-0/+2
It is necessary for proper reporting of DTXd status during the measurement period. Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Related: OS#1701
2016-06-03Store last used FN for TCHMax1-0/+1
It's necessary to properly compute timestamp compensation for RTP packets in case of DTX (or heavy packet loss). Related: OS#22 Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7
2016-05-17Move DTX settings to BTSMax1-1/+5
* Add per-BTS DTX settings * Configure Uplink and Downlink DTX separately * Deprecate global DTX option (it was never tested/used anyway) * Use libosmocore function for DTX indicator in System Information (previously it was incorrectly assigned for half-rate channels) Related: OS#22 Change-Id: I3d55168475ad47044b6238b55846ea22bdd518a4 Reviewed-on: https://gerrit.osmocom.org/40 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-22Add basic UARFCN supportMax1-0/+3
* add data structures, generation functions * vty interface for neightbor UARFCNs specific to SI2quater * vty test * unit test Fixes: OS#1666
2016-04-22Cleanup shared data structureMax1-2/+1
* remove unused variable. * lower max number of (e|u)arfcns to more realistic value.
2016-04-16Add basic SI2quater supportMax1-0/+5
* support for sending arbitrary static SI2quater. * vty interface for neightbor EARFCNs specific to SI2quater. * dynamic generation of SI2quater messages. * unit test for SI2quater messages. Fixes: OS#1630
2015-12-05gsm_data_shared: compute/sprintf the lchan name only onceHarald Welte1-1/+7
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-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte1-5/+3
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).
2015-10-02amr: Instead of putting ms/bts into the same struct.. use it twiceHolger Hans Peter Freyther1-5/+5
This way a lot of if/else can just be killed by the caller deciding which of the two instances to use. I have copied both branches to new files, replace bts for ms in one of them and ran diff on it. There is no difference.
2015-09-22Add full AMR multirate IE support with VTY config for MS and BTS sideAndreas Eversberg1-3/+11
2015-02-07nokia: Allow to set the reset time for the nokia btsSipos Csaba1-0/+1
2015-02-05osmo-bts: Introduce new struct for a power loop in the BTS codeHolger Hans Peter Freyther1-0/+7
Keep track if the power level has been "fixed" by the BSC, otherwise keep track of the currently ordered one. The ms_power is the initial value set by the BSC and continues to be used.
2015-01-02lchan: Remember why a channel is broken using static stringsHolger Hans Peter Freyther1-0/+1
Remember why a channel is being marked as broken. So we can maybe understand what happend.
2014-12-30move gsm_bts_get_cbch() to gsm_data_shared() as its needed in osmo-btsHarald Welte1-0/+3
2014-12-30Add basic support for CBCH / SMS-CB (Cell Brroadcast)Harald Welte1-3/+3
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-12-17bts: Add some simple dependency between different BTSHolger Hans Peter Freyther1-0/+3
E.g. for the sysmoBTS2050 we have the requirement that the first board connects before the second due clocking. The easiest point to enforce this is the BSC. Add a simple bitmask based system to allow to express dependencies for IP based systems.
2014-12-10bts: Remove unused fields from the trx structureHolger Hans Peter Freyther1-10/+0
These have either never been used or were replaced with a more generic approach.
2014-11-21bts: Store the bcch_change_mark in the bts structureHolger Hans Peter Freyther1-1/+2
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-25port over to libosmocore include/osmocom/gsm/meas_rep.hHarald Welte1-6/+2
Back in March 2013, some structures and defines related to decoded measurement reports have been moved from openbsc to libosmocore (libosmocore e128f4663104ed64e33e362cff2566f36d65e658) so that they can be used also from osmo-bts. This finally makes gsm_lchan follow suit for osmo-bts.
2014-08-24move GSM_RESERVED_TMSI to libosmocoreHarald Welte1-3/+0
The gb_proxy shouldn't start to open the box of pandora by including the gsm_data_shared.h file, particularly not without defining the BSC role. In any case, as the reserved TMSI is something that's part of the GSM specs, and not specific to the OpenBSC implementation, it should be part of libosmocore.
2014-08-24gsm_data_shared: Add new trx_power_params for osmo-btsHarald Welte1-0/+1
2014-08-24move gsm_bts_num() to gsm_data_shared.[ch]Harald Welte1-1/+2
this way we can drop a copy of this function from osmo-bts.
2014-08-09sysmobts: Add variable for N(S) + 1 needed for the sysmobtsHolger Hans Peter Freyther1-0/+1
We could use the upper three bits of the ciph_state to store the sequence number but make the code understandable first.
2014-07-30openbsc: Add new fields for the osmo-bts softwareHolger Hans Peter Freyther1-0/+12
For the osmo-bts software we want to be able to slowly change the output power. The state is kept inside the trx structure.
2014-07-24bts: Remember the last AMR mode that we receivedHolger Hans Peter Freyther1-0/+1
Not every air message contains the AMR mode so we need to remember it to not confuse receiving equipment like AudioCodes Media Gateways.
2014-04-29openbsc/gsm_data_shared.h: Added the attribute reduce_power in TRXÁlvaro Neira Ayuso1-0/+1
Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-01-19TSC: Add new gsm_ts_tsc() function to resolve TSC of TSHarald Welte1-0/+7
We don't want every caller to check for ts->tsc == -1 and then using ts->trx->bts->tsc instead. Rather, introduce a new inline function to retrieve the correct value.