aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-05-22l1sap: cosmetic: rename payload_len to rtp_pl_lenpmaier/rtpfmtPhilipp Maier1-2/+2
The function signature of rtppayload_is_octet_aligned has a parameter rtp_pl for the payload and a parameter payload_len for the length of the payload, while other functions use rtp_pl and rtp_pl_len. Change-Id: I8a0e0357aab2a78e25811f66b1b870e8c6ebffe9
2023-05-22l1sap: Accept RFC5993 and TS 101.318 HR GSM payloadPhilipp Maier8-4/+66
Unfotunately there are two different RTP formats for HR GSM specified and it is unclear which should be used with GSM networks. Also each BTS model may support only either one or the other format. Let's use the BTS feature flags to determine which format the BTS model supports and then let's use this information to convert incoming RTP packets into the supported format. Doing so we will make sure that always both formats are accepted. Related: OS#5688 Change-Id: I9419b40c1171876879d41aba4f51c93e8ef5673c
2023-05-22l1sap: Drop invalid HR GSM payloadPhilipp Maier1-1/+11
HR GSM payload is currently not validated. Let's add an rtppayload_validate_hr function that checks the incoming RTP payload by its length. Two lengts are valid, depending on which of the two HR GSM RTP formats (RFC 5993 or TS 101 318) are used. Change-Id: I453562da412fde5b928bd2b588129c58ec8e2a7e Related: OS#5688
2023-05-19trx: remove model-specific BFI packet formatsMychaela N. Falconia2-53/+10
As detailed in OS#6033, osmo-bts-trx was emitting its own invented packet formats to signal BFIs (bad frame indications), different from the vty-configured ("rtp continuous-streaming" or not) BFI signaling method implemented in l1sap and used by all other BTS models. In the case of EFR codec, the made-up BFI format previously used by osmo-bts-trx caused EFR operation to be broken: a spec-compliant EFR decoder on the receiving end of the RTP stream (a network transcoder or the MS on the other GSM call leg) would receive and decode garbage EFR frames of 244 zero bits instead of invoking the spec-defined bad frame handler, causing bad audio artifacts for the user. The same situation would also happen for FR1 codec, but the application of ECU masked this bug: with the ECU invoked in the UL output path, the BFI emitting code for FR1 never executed. In the case of AMR and HR1 codecs, the model-specific BFI packet format of osmo-bts-trx is currently harmless, but: * The extra code adds unnecessary complexity; * BFI packet formats are inconsistent between osmo-bts-trx and other OsmoBTS models; * BFI format is even inconsistent within osmo-bts-trx itself, as under certain conditions the common code in l1sap will override the UL payload from the BTS model and emit its own form of BFI instead. Fix all of the above by removing trx model-specific BFI formats for all codecs, and let l1sap handle all BFIs. Related: OS#6033 Change-Id: I8f9fb5b8c5b2cad4b92ac693c0040779f811981a
2023-05-19copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbHVadim Yanitskiy25-25/+25
Change-Id: Ib0bed7a4196305e2b413ca657f4fa8fb6f0d39f6
2023-05-16paging: cosmetic: rename all IMM.ASS references to MAC blockPhilipp Maier3-58/+60
The paging interface towards the PCU has a confusing API. In fact what the PCU does when it wants to page or do an immediate assignment is sending a ready formatted MAC block to the BTS. The BTS then puts this MAC block in the paging queue and then eventually it justs sends it without looking at the contents. For the code in paging.c it is not imortant if the MAC block is an immediate assignment, it only cares if the paging record contains a MAC block or paging parameters. Related: OS#5927 Change-Id: Ifab37fdedaba98b160718113767e4ef6ee7d16ad
2023-05-10PCU interface: Log version when starting listenerarehbein1-1/+1
Change-Id: Ieba46cc7eee7758033815014ee38bf4751a0f26f
2023-05-10all models, FR/EFR UL: change SID check to _is_any_sid()Mychaela N. Falconia4-8/+8
In all OsmoBTS models in FR and EFR speech modes, as the UL traffic frame stream is passed from the PHY to l1sap and ultimately to RTP output, all passed frames are checked for SID. The Boolean result of this SID check is used in two ways: * RFC 3551 instructs that the Marker bit in the RTP header SHOULD be set in the first packet of a talkspurt after a period of silence suppression. OsmoBTS implements this recommendation by setting the Marker bit in the first RTP-transmitted non-SID UL packet that was preceded by SID. * In osmo-bts-trx only, this same SID check serves a second purpose: handling of BFI conditions depends on whether or not the last received good traffic frame was a SID. If a BFI condition is received after a non-SID traffic frame, the ECU is invoked, and if this ECU fails or when libosmocodec does not provide an ECU for the codec in use, a special FR (EFR) BFI frame of 260 (244) zero bits is emitted. Both the ECU call and the peculiar form of BFI are skipped when the last received good traffic frame was a SID. For both of the above purposes, in all BTS models, change the SID check from osmo_{fr,efr}_check_sid() to osmo_{fr,efr}_is_any_sid(). The effect of this change is that "what counts as a SID" for the just-listed purposes changes from recognizing only perfectly uncorrupted SID frames without any bit errors to recognizing all frames which the rules of GSM 06.31 (FR) or 06.81 (EFR) classify as either valid or invalid SID. Change-Id: I5c24b379deda8ae551f9924d10770da50e6acbbd
2023-05-09lc15,oc2g: fix handling of SID in EFRMychaela N. Falconia2-14/+12
Commit 32682c63f672 fixed EFR SID handling in osmo-bts-sysmo, but that fix was never propagated into osmo-bts-{lc15,oc2g} versions, which are essentially copies of osmo-bts-sysmo. Fix that oversight. Change-Id: I509c1ea374e640d819952d58592b12fa884ad9d8
2023-05-08RTP input, FR & EFR: preen incoming payloads for SID errorsMychaela N. Falconia2-9/+41
Those network elements which receive a stream of codec frames that may come from the uplink of GSM call A and which are responsible for preparing the frame stream for the downlink of GSM call B (such as OsmoBTS receiving RTP and feeding DL to its PHY) must be prepared for the possibility that their incoming frame stream may contain corrupted SID frames, presumably from bit errors on radio link A. Per the rules of section 6.1.1 of GSM 06.31 for FR and GSM 06.81 for EFR, SID frames with just one errored bit are still to be accepted as valid, whereas frames with more corrupted bits which are still recognizable as SID are classified as invalid SID. In the case of a TrFO call, the entity switching from leg A UL to leg B DL is responsible for *not* transmitting invalid SID frames on the destination leg (they should be treated like BFIs), and any deemed-valid SID frames that are forwarded should be preened, correcting that one bit error they may exhibit. Implement this functionality in OsmoBTS. Change-Id: I89df2f12c49dd5378667cf149d19bde654f80134
2023-05-05bbtransc/rcarrier: Fix statechg done twice upon NM_EV_RX_OPSTARTPau Espin Pedrol2-4/+4
When the NM_EV_RX_OPSTART event is received, it will call bts model specific function bts_model_opstart(), which is responisble for answering back with NM_EV_OPSTART_ACK or NM_EV_OPSTART_NACK. Since that answer could be done sequentially in same callback code path, we could end up twice at the end of the st_op_disabled_offline() function checking for statechg (due to reentring that function). As a result, one can see the following message appear during OML bring up: nm_bb_transc_fsm.c:185 NM_BBTRANSC_OP(bts0-trx0){ENABLED}: transition to state ENABLED not permitted! Fix the issue by avoiding ending up at the end of the function in code paths which should not be triggering any change. The case of bbtransc is a bit different than that of rcarrier for NM_EV_RX_SETATTR, since the former really doesn't receive any such message from the BSC yet, so if we checked for that one before continuing, it would never go on. Change-Id: I5184a33dd8da9244e8aacf3ab8bb8930f732a136
2023-05-05pcu_sock: don not continue when running out of TRX spacePhilipp Maier1-1/+1
The info indication on pcu_sock cann only support a limited but sufficient number of TRXs, when we detect that we overflow the maxiumum number of TRXs, then break and do not continue. (this is more or less a cosmetic problem) Change-Id: If4d7eecaded22f86750283f7aa13072064724537
2023-05-04l1sap: fix wording in commentPhilipp Maier1-1/+1
The function rtppayload_is_valid() is called from the receiving RTP code path. Lets use the word "forwarding" instead of "sending" to avoid the impression something is sent (like sending RTP packets to the outside world) Change-Id: Ie7fcc53dea462b0d575b0c9ca73ba7507289eefe
2023-05-04octphy: Fix clearly wrong noop assignmentPau Espin Pedrol1-4/+2
This code has been there since first octphy support was added. New gcc 13.1.1 is catching this and reporting compilation errors: """ /osmo-bts/src/osmo-bts-octphy/l1_oml.c: In function ‘ts_connect_as’: /osmo-bts/src/osmo-bts-octphy/l1_oml.c:1518:60: error: ‘oc’ is used uninitialized [-Werror=uninitialized] 1518 | tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc = | ^~ /osmo-bts/src/osmo-bts-octphy/l1_oml.c:1518:60: note: ‘oc’ was declared here 1518 | tOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_CMD *oc = | ^~ /osmo-bts/src/osmo-bts-octphy/l1_oml.c: In function ‘bts_model_ts_disconnect’: /osmo-bts/src/osmo-bts-octphy/l1_oml.c:1803:62: error: ‘oc’ is used uninitialized [-Werror=uninitialized] 1803 | tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc = | ^~ /osmo-bts/src/osmo-bts-octphy/l1_oml.c:1803:62: note: ‘oc’ was declared here 1803 | tOCTVC1_GSM_MSG_TRX_DEACTIVATE_PHYSICAL_CHANNEL_CMD *oc = | ^~ """ Change-Id: I0da7d3a94e9eba15b8d3d3d995bba532170d9df7
2023-05-04sched_lchan_tchx: use GSM_HR_BYTES_RTP_RFC5993 constantPhilipp Maier2-2/+2
osmo-bts-trx uses the RFC5993 RTP payload format, so when handling the RTP payload use GSM_HR_BYTES_RTP_RFC5993, instead of GSM_HR_BYTES + 1 Depends: libosmocore.git I125ef9cdab98c073971841c175b1a7dcd927f9c2 Related: OS#5688 Change-Id: I54dd3adab88e2262913f7b1e89340a0246c88a8a
2023-05-02oml: reset BCCH carrier power reduction mode (if enabled)Vadim Yanitskiy1-0/+2
We should not maintain BCCH carrier power reduction mode if we loose connection to the BSC. When entering NM_BTS_ST_OP_DISABLED_OFFLINE, reset the related state fields if it was enabled. Change-Id: I34468e3fccc490f48e30b159b63308a395b65fa9 Related: SYS#6435
2023-05-01oml: gsm_objclass2{mo,obj}(): set cause for unknown obj_classVadim Yanitskiy1-4/+10
This patch makes BTS_Tests_OML.TC_wrong_obj_class pass. Change-Id: I30e109a7c86e651fb7055a80ef0656d8563475c8 Fixes: OS#5966
2023-05-01oml: gsm_objclass2{mo,obj}(): cosmetic: return immediatelyVadim Yanitskiy1-36/+18
Change-Id: Ie2fb927ac7f71103a1e0e693718771dd36139223 Related: OS#5966
2023-04-29gsm_objclass2obj(): Change signature/set NACK causearehbein3-19/+30
- Add out-parameter to enable returning a NACK cause (ignored if NULL) - Return appropriate NACK cause if TRX number is unknown (fixes OS#5967 together with change I37e6b23ed95260a8188910cf9754faffcba519c5) Change-Id: If734ea2c8cae4c1f99b02520dffa4e3862a67745 Related: OS#5961, OS#5967
2023-04-29gsm_objclass2mo(): Change signature/set NACK causearehbein2-27/+40
- Add out-parameter to enable returning a NACK cause (ignored if NULL) - Return appropriate NACK cause if TRX number is unknown (part of fix for OS#5967) Change-Id: I37e6b23ed95260a8188910cf9754faffcba519c5 Related: OS#5961, OS#5967
2023-04-29fixup: common: Remove unused function gsm_objclass2nmstate()Vadim Yanitskiy1-2/+0
Change-Id: I31b948f2aeb18ac8069fc019285be7991cffe064
2023-04-28common: Remove unused function gsm_objclass2nmstate()arehbein1-14/+0
Change-Id: Ia538e3f3d416408f69f9d8e6c8c746eddd9f005a
2023-04-25debian: set compat level to 10Oliver Smith2-2/+2
Related: OS#5958 Change-Id: Id0f168a7d3c2ae6869121397e65ca1d0cfea30d3
2023-04-23license: fix typosMax2-10/+10
Change-Id: I450919973bbd31bce44c0b6606f457581e2f71df
2023-04-21flags: ensure completeness of bts_impl_flag_desc[]Vadim Yanitskiy1-0/+3
Change-Id: I049df344c8c0b0d6cd122e2f2d705e0f7ee5990c
2023-04-21flags: group BTS_INTERNAL_FLAG_* into an enumVadim Yanitskiy2-17/+21
Change-Id: I4c7d9f6dce61f7690b86c3973b13ddb63cdace04
2023-04-21flags: add missing entries to bts_impl_flag_desc[]Vadim Yanitskiy1-0/+2
The following output can be seen when doing 'show bts' in the VTY: BTS model specific (internal) flags: 001 Measurement and Payload data combined 003 unknown 0x8 Fix this by adding the missing values to the value-string array. Change-Id: I83e5065f9f80b4f81e9767f184c8dc027883025a Fixes: 0277cddab "sysmo,oc2g,lc15: Make RadioChannel MO depend on RadioCarrier MO" Fixes: ee5eb6169 "l1sap: check if BTS model supports interference reporting"
2023-04-20common: Remove redundant checksarehbein1-18/+6
Remove checks that are performed in gsm_bts_trx_num() already. Related: OS#5961 Related: OS#5967 Change-Id: I9f21f1a0a9dab897d4fd89ab6b7341ca4aec8b22
2023-04-18vty.c: Use already available tpp pointerPau Espin Pedrol1-1/+1
Change-Id: I54b4b995c3296d8a38ee72604dedbde77c5d0722
2023-04-13osmo-bts-virtual: properly activate [CBCH/]BCCH/CCCHVadim Yanitskiy2-8/+22
In change 8e04613e I overlooked that osmo-bts-virtual is re-using the scheduler of osmo-bts-trx and forgot to update its OML logic. As a result, osmo-bts-virtual is broken and does not transmit anything on the broadcast channels. Change-Id: I2276f7e5e4042e56ddf1fd1642c917dba0005ac4 Fixes: 8e04613e "osmo-bts-trx: properly activate [CBCH/]BCCH/CCCH" Related: OS#6001, OS#1572
2023-04-11bts-sysmo: Delay marking phy_link as connected until L1 reset + got infoPau Espin Pedrol1-2/+2
Better wait until the DSP is reset and all the information is retrieved before telling upper layers that the phy is ready. Keep it in CONNECTING state meanwhile. Change-Id: Ifdc791336fb8efd42f4428893f687093085af129
2023-04-11bts-sysmo: Fix pinst->version filled too earlyPau Espin Pedrol1-8/+6
The fields used to fill in pinst->version are set when info_compl_cb() is called, which happens asynchronously and hence later than when in bts_model_phy_link_open(). Hence, copying the values when in bts_model_phy_link_open() (l1if_open()) makes no sense at all. Fill in pinst->version in info_compl_cb(), just when the layer receives the required information. Related: OS#5978 Change-Id: Ica53a5d852214b24de7f75b08ad7e595ce5236ee
2023-04-11oml: Fix potential null ptr access on trx objectPau Espin Pedrol1-15/+24
If the TRX_NR had no matching TRX it would access a NULL pointer trx after failing to resolve it. This commit refactors the code path to only require the trx pointer at the very end, and NACKs the message if TRX fails to be resolved. Change-Id: If27639ae1727fc5232e1a964a1b29f50c8805d80
2023-04-11pcu_sock: Drop bts_sm pointerPau Espin Pedrol1-3/+1
It is not really needed since the object is global. Change-Id: I17f7c42dc9f38485dbcc8595a3a3dbf5a80a7961
2023-04-11pcu_sock: Allocate pcu_sock_state using g_bts_sm talloc contextPau Espin Pedrol1-1/+1
Change-Id: I29eae7bcc66dc5e646b8a4703871682202259bed
2023-04-11Move pcu_sock_state to gprs section of bts_smPau Espin Pedrol2-7/+7
Change-Id: I7d739287fd11f81ce657bac362e55fa822fb0ef5
2023-04-11Update g_bts_sm->num_bts when bts is added/removed from bts listPau Espin Pedrol1-1/+2
Change-Id: Ifa162d01d908eba8cadd8f01dd4d698491176fe8
2023-04-11Properly report all states through NM FSM upon OML link upPau Espin Pedrol12-45/+66
Change-Id: Ic3358629d17baab46f467a1ab82eea1837ad7390
2023-04-11nm: Document current state of SW_ACT in TRX related objectsPau Espin Pedrol2-2/+14
Change-Id: Ie24503b25b9c8042edae696d5b002933c73d00fb
2023-04-11Drop NM_EV_BBTRANSC_INSTALLED in favour of generic NM_EV_SW_ACTPau Espin Pedrol4-10/+3
All the other objects already use that one; there's no need to have a specific one for the NM Channel FSM. Change-Id: Ic5fd37367b500c75a0a53b1d868ba2aed3edef1b
2023-04-11Move GPRS NSE under BTS SiteMgrPau Espin Pedrol11-65/+77
As per ipaccess expectancies and following TS 12.21. Change-Id: If44d8f256cab7b2660900cedfb0ed9fe67eb3420
2023-04-11Merge gsm_network into gsm_bts_sm and place gsm_bts under itPau Espin Pedrol25-161/+258
This way the data model in TS 12.21 (Figure 1) is followed, where there's a BTS Site Manager containing one or more BTS. In our case we only support 1 BTS (cell) so far. Change-Id: Ideb0d458ec631008223f861cf8b46d09524a1a21 Related: OS#5994
2023-04-11nm: Dispatch NM_EV_SW_ACT in cascade to BTS SiteMgr childrenPau Espin Pedrol2-2/+1
Change-Id: I97445812bb1b6de450411aceaeece2427027ae67 Related: OS#5994
2023-04-11Introduce NM FSM for GPRS NSVC objectPau Espin Pedrol13-54/+303
Change-Id: I684482064136a461d01cace3cd37afc8b68458cc Related: OS#5994
2023-04-09cosmetic: Change LOGPLCFN argument orderHarald Welte12-80/+71
As it has come up during code review of Change-ID I214af0448652a9f321ccbab77977b67663ba28f9 introducing LOGPLCNF, my approach to the strict preserval of argument order (lchan first from LOGPLCHAN and fn *after* loglevel from LOGPFN) was considered sub-optimal. I used the following spatch rule to clean this up: @@ expression lc, ss, logl, fn; expression list trailer; @@ -LOGPLCFN(lc, ss, logl, fn, trailer); +LOGPLCFN(lc, fn, ss, logl, trailer); Change-Id: Iba4a8416545673d03cb057e4855f8b1ecae3e1ec
2023-04-06bts: Simplify lifecycle of BTS inside bts_listPau Espin Pedrol1-12/+8
Add the BTS object to the BTS list as the first thing after it is created, this way it's always attached and hence simply always detach it during object free. Change-Id: Ica4fe2a4be0c85b10702011e978be03bf970b0c8
2023-04-06Move NSVC structs to be part of NSEPau Espin Pedrol5-31/+35
The NSVCs exist inside an NSE. Rearrange data model to have proper relations. Change-Id: I1cfe9366594836c622673d461ab8b2edd1a2b58a
2023-04-06Rearrange declaration of struct gsm_bts_gprs_nsvcPau Espin Pedrol1-12/+12
Move it together with the other similar objects like gprs_nse and gprs_cell. Move the "mo" field to the start of the struct, similar to the other types. Change-Id: I5dc020a6bab8c94ab831b6ca506bc5cb681d07a3
2023-04-06Introduce NM FSM for GPRS Cell objectPau Espin Pedrol14-32/+320
Change-Id: I5fd1d17da09a5f0eee3d69fcb4788c106a240e21 Related: OS#5994
2023-04-06Fix octet 2 of NM GPRS CellPau Espin Pedrol1-1/+1
Octet 2 should contain the address of the GPRS cell in the GPRS NSE object. Since there's 1 GPRS Cell per BTS and we have only 1 BTS in osmo-bts, then this address should be 0. Otherwise, osmo-bts answers sometimes using (0x00, 0xff,0xff) instead of requested (0x00, 0x00, 0xff), for instance when ACKing an Admin Unlock. This is kinda still fine since value 0xff has the meaning of "all" addresses, and that means the only one available. Still, it's not the proper way to identify the object, so this patch fixes it. Change-Id: I2ea05778f5b5ac335c75f3958324664553da7f0d