aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/l1sap.c
AgeCommit message (Collapse)AuthorFilesLines
2016-06-07Fix RTP timestamps in case of DTXMax1-2/+16
Compute RTP user_ts adjustment based on the difference between current and previous FN instead of hard-coded value. Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Related: OS#1562 Reviewed-on: https://gerrit.osmocom.org/196 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-02-22Fix ocmo-bts-octphy interaction with OsmoPCUMax1-2/+3
Previously osmo-bts-octphy have not provided in-band presence information which cause off-by-one errors and misinterpretation of ph_data_ind by PCU. This fixed now by adding support for explicitly passing PH-DATA presence info. Corresponding check and in-band passing of presence information are removed. Note: this requires libosmocore version with osmo_ph_pres_info_type support integrated. [hfreyther/max: Remove + 1 from the decoded length]
2016-02-09fix migration of check_for_ciph_cmd() from sysmobts to l1sapHarald Welte1-0/+12
During the L1SAP related changes, somehow an old version of check_for_ciph_cmd() was re-introduced, which didn't store the N(s) as part of the lchan. To make things worse, the old code was still present in the sysmobts specific part, but never executed.
2016-02-03L1SAP: Ensure we don't process MPH-TIME.indication on TRX != C0Harald Welte1-1/+8
2016-01-16OCTPHY: Fix various memory leaks and add comments on msgb ownershipHarald Welte1-1/+1
2016-01-16print a NOTICE message if lchan not activ in get_active_lchan_by_chan_nr()Harald Welte1-2/+5
2016-01-08l1sap: Whitespace fixes.Alexander Chemeris1-2/+2
2016-01-04fix large amount of compiler warnings in common and sysmobts codeHarald Welte1-0/+1
2015-12-05osmo-bts-sysmo: Disable DSP trace flags by defaultHarald Welte1-1/+1
2015-12-05l1sap: Ensure we only pass PHY primitives of active lchansHarald Welte1-45/+41
In some situations, a PHY might send us a primitive for a logical channel that is not (or no longer) active. Passing such primitives higher up the stack is asking for trouble. Specifically, LAPDm instances cannot accept messages once their instance has been released. We introduce two new helper functions: get_lchan_by_chan_nr() as well as get_active_lchan_by_chan_nr(). The former just centralizes the look-up of the lchan by timeslot number and sub-slot number. The latter also checks to ensure the lchan is active, which is used for PH-DATA / PH-RTS primitives. To the contrary, MPH primitives generally don't require the cahnnel to be active for processing.
2015-09-22TRX: Fixup ciphering state names after rebasingAndreas Eversberg1-0/+1
2015-09-22Fix: Process all TRX on GSM Time indication, not only C0Andreas Eversberg1-4/+5
2015-09-22move MS power control handling from sysmobts to common partHarald Welte1-0/+2
MS uplink power control is required in pretty much any BTS, and we cannot assume that they PHY / L1 will always take care of it by itself. So the correspondign code is moved to common/power_control.c and called from the generic part of L1SAP. The corresponding VTY paramter has been moved from the sysmobts-specific trx VTY node to the common BTS VTY node.
2015-09-22Move detection of handover frames from sysmo-bts code to common codeAndreas Eversberg1-0/+4
2015-09-22Send primitives at PH-/MPH-/TCH-SAP interface via GSMTAPAndreas Eversberg1-0/+167
2015-09-22sysmobts: Clean up transitions for lchan cipher stateAndreas Eversberg1-1/+0
There are three transitions: 1. LCHAN_CIPH_NONE -> LCHAN_CIPH_RX_REQ -> LCHAN_CIPH_RX_CONF It is used to enable ciphering in RX (uplink) direction only. 2. LCHAN_CIPH_RX_CONF -> LCHAN_CIPH_RX_CONF_TX_REQ -> LCHAN_CIPH_RXTX_CONF It is used to additionally enable ciphering in TX (downlink) direction. 3. LCHAN_CIPH_NONE -> LCHAN_CIPH_RXTX_REQ -> LCHAN_CIPH_RX_CONF_TX_REQ -> LCHAN_CIPH_RXTX_CONF It is used to enable ciphering in both TX and RX directions. This is used when the channel is activated with encryption already enabled. (assignment or handover) In order to follow the order of these transitions, the RX direction must always be set before the TX direction. If no cipher key is set (A5/0), ciphering is set to ALG 0, but lchan cipher state remains at LCHAN_CIPH_NONE.
2015-09-22Add MEAS (MPH_INFO) IND message to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+32
This part moves processing of measurement infos from osmo-bts-sysmo to common part.
2015-09-22l1sap: Port code to new ciphering handlingHarald Welte1-10/+35
... introduced in 2cc37035d73191b71b9ba9c0d559a0da6a5f35e5
2015-09-22sysmobts/l1_if: Sacch/Sdcc/Facch are handled in l1sap/coreHarald Welte1-1/+1
2015-09-22Add SDCCH/SACCH/FACCH messages to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-2/+179
This part moves control channel message primitives from osmo-bts-sysmo to common part. In order to control ciphering fo BTS model, CIPHER (MPH_INFO) messages are used.
2015-09-22Add TCH messages to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+151
This part moves TCH handling from osmo-bts-sysmo to common part. The RTP handling is done at the common part, so they can be used by other BTS models.
2015-09-22l1sap: re-introduce a comment that was lost during l1sap mergeHarald Welte1-0/+2
2015-09-22Move chan act/rel/modify from bts_model to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+145
This part replaces channel activation/deactivation/modification routines by MPH_INFO messages.
2015-09-22l1sap: Re-introduce more correct RACH slot countingHarald Welte1-4/+14
The original code handled both the fact where a TIME indication would be missed (and thus the frame number be higher than previous + 1), as well as the two cases for combined / non-combined CCCH. The L1SAP code removed some of those bits, which I'm re-introducing here.
2015-09-22Add TIME (MPH_INFO) IND messages to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+50
This part moves GSM time handling from osmo-bts-sysmo part to common part.
2015-09-22Add PDCH messages to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+90
This part moves PDTCH, PACCH and PTCCH message primitives from osmo-bts-sysmo to common part.
2015-09-22l1sap: Add a warning about assuming BS_AG_BLKS_RES=1Harald Welte1-0/+1
This is a regression of the code compared to the existing sysmoBTS code, where the L1 tells us whether its AGCH or PCH. However, it was not used even in the old code, so we can afford to simply put a #warning here.
2015-09-22Add PCH/AGCH message to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+8
This part moves PCH and AGCH message primitives from osmo-bts-sysmo to common part.
2015-09-22l1sap: RACH: Detect hand-over even on TRX0Harald Welte1-1/+1
I don't understand why we would detect handover only on TRX1-n, but not on TRX0. It is perfectly valid for a handover to occur on TRX0.
2015-09-22l1sap: fix missing include file and resulting compiler warningHarald Welte1-0/+1
2015-09-22l1sap: fix coding styleHarald Welte1-2/+1
2015-09-22l1sap: Use L1SAP_IS_CHAN_RACH instead of magic number 0x88Harald Welte1-1/+1
2015-09-22Add RACH message to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+69
This part moves RACH message primitives from osmo-bts-sysmo to common part.
2015-09-22Add BCCH message to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-0/+150
This first part moves BCCH message primitives from osmo-bts-sysmo to common part. A new file "common/l1sap.c" is introduced to implement handling of layer 1 messages from/to BTS model.