aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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
2023-04-06Introduce NM FSM for GPRS NSE objectPau Espin Pedrol14-56/+368
Related: OS#5994 Change-Id: I01eadc63214a2eb5e1bce455c7e5b62bd41905ea
2023-04-06NM: NACK received OML OPSTART if no attributes were set beforehandPau Espin Pedrol5-0/+30
Related: OS#5992 Change-Id: I771ecc2f60873a3549e8a07a2e57c7948dfc993e
2023-04-06nm: Apply OPSTART through NM FSMsPau Espin Pedrol8-6/+42
This way we have further control on how to handle the OPSTART messages received. For instance, NACK them if the NM object FSMs are not at the expected correct state. Related: OS#5992 Change-Id: I5df0bfb4cc812c11c7a00a8ffa882ae1915d562f
2023-04-06Simplify implementation of bts_model_opstart() in all bts typesPau Espin Pedrol7-74/+14
Use mo->fi directly to avoid repeating code paths for each obj_class. Change-Id: I54632201afe87eb3e02bc75cbade163917239ab6
2023-04-06lc15,oc2g,sysmo: Update GPRS NM object state at the right timePau Espin Pedrol3-17/+3
Change-Id: I2f331954835496504f1fafa572bd46ee83b03a63
2023-04-06bts_model_apply_oml(): Improve definition of parameterPau Espin Pedrol13-14/+24
The param is usually called obj_class, but here it is called kind. In any case, change the param to pass the related struct gsm_abis_mo (which still contains mo->obj_class), similar to what's done in other bts_model functions such as bts_model_opstart(). Change-Id: Ife2e98a791455d5f7e7052356d559af2f1d4d185
2023-04-06oml: Get rid of unused tlv_parsed param in bts_model_apply_oml()Pau Espin Pedrol15-28/+14
This way we simplify the common lower level interface. It can be added in the future again if it is really required at any point to pass/use specific TLV values in the device-specific code. Change-Id: I64c6c6834e277b1d75a97d6f408e7e1b7ca85832
2023-04-06nm: Drop NM_EV_SETATTR_{ACK/NACK}Pau Espin Pedrol16-138/+55
Simply return error codes from lower layer implementations, and do the OML handling in the common NM TS 12.21 FSMs. As a result, we simplify the logic in the lower layers. Change-Id: I281c07bb5ad88ee03542f092141cebe036d10aee
2023-04-05logging: Introduce LOGPLCGT()Harald Welte2-17/+18
We have LOGPLCHAN and LOGPGT, but not a combined version for logging both the lchan and the gsm_time. Let's resolve this. Log messages without indicating the lchan name are pretty useless if you have multiple concurrently active lchans... Change-Id: I4bf3363f92acdf67d8e7333e30ac2209e31cb287
2023-04-05nm: Apply BTS/TRX/TS OML Attributes through NM FSMsPau Espin Pedrol16-28/+93
This way we have further control on how to handle the SetAttr meessages received. For instance, NACK them if the NM object FSMs are not at the expected correct state. The originating msgs are now kept owned and freed by the OML layer (oml.c), and the NM FSMs only uses them and create new OML msgb when answering with ACK/NACK. Related: OS#5992 Change-Id: Id68868e25bbf96227ab6459fcd3c9181852ed28e
2023-04-05oml.c: Remove dot character at the end of log linesPau Espin Pedrol1-9/+9
Change-Id: Iaf061bb752f9808a6ab31049b9e87920a6b07f3d
2023-04-04bts_model_apply_oml(): Drop unneded codePau Espin Pedrol7-56/+0
Calls to bts_model_apply_oml() are done only for BTS, RCARRIER and RCHANNEL NM Objects in their respective Rx code paths (and they will be moved to respective FSMs in follow up patches). This function is never called with any of the GPRS NM objects. These NM Objectes have the NM_MT_IPACC_SET_ATTR msg ACKED/NACKED in its own path: oml_ipa_set_attr() rc = oml_ipa_mo_set_attr() return oml_fom_ack_nack(msg, rc); Change-Id: I1a0d38a122f50ffe749ebc4f1cc11235ca516586
2023-04-04Clarify configuration of TSC on each timeslotPau Espin Pedrol8-12/+92
Related: OS#5856 Change-Id: Ief21daf63ba76725de9117cbe14ada8b75f147df
2023-04-04bts-trx: Drop unused param to internal functionPau Espin Pedrol1-2/+2
Change-Id: Id7ad7629ec13bcec618055c41083cdac0a3102be
2023-04-03bts-{lc15,oc2g,sysmo}: support EFR in repeat_last_sid()Mychaela N. Falconia1-6/+6
The function repeat_last_sid() is implemented in the common part, but is only used by osmo-bts-{lc15,oc2g,sysmo} models. These BTS models call this function when they are looking to see if a previously cached SID frame needs to retransmitted on the DL because it is that time according to the SACCH multiframe. Out of non-AMR codecs, this function previously supported only FR1 and HR1, but failed to support EFR. Fix that omission. Change-Id: Iebcd28e65af889254740757eed9c579392eb1c33
2023-04-03tests: $(BUILT_SOURCES) is not defined, depend on osmo-bts-virtualVadim Yanitskiy1-3/+3
Change-Id: I4ace06e115a2689bde9afd9f99ecee99d796360b
2023-04-01contrib/ber: Avoid regenerating codec_bit_class.h every buildPau Espin Pedrol3-7/+62
Automatic generation of a header file using a C program built during build of osmo-bts creates several problems when cross-compiling. The generated header file is only 59 lines long, so let's have it generated in order to avoid having to call the helper program every time. A Makefile target is added to easily regenerate the file manually in case it's needed: make -C contrib/ber/ update_codec_bit_class_h Fixes: acf0f0f0bb715b795c5bc5de6ddf2aa62458af10 Change-Id: I97efdb4ee00537fcae191b4267d0211d582ef372
2023-03-31Replace explicit gsm_lchan_name() calls with LOGPLCHANHarald Welte8-273/+148
There was a surprising number of explicit gsm_lchan_name() calls from within log message code. Let's avoid that whenever possible and use a LOGPLCHAN() or related macro. Change-Id: If4f4f555f5ca61dfa624b298805f5375efc0b137
2023-03-30sysmo: emit empty RTP ticks during FACCH stealing on TCH/FMychaela N. Falconia3-0/+44
When FACCH stealing occurs and sysmoBTS L1 delivers GsmL1_Sapi_FacchF instead of GsmL1_Sapi_TchF, that 20 ms unit still needs to be accounted for in the RTP timestamp cadence, and if we run with rtp continuous-streaming enabled, then an actual BFI packet needs to be emitted. The original code failed to do either; the present change implements correct behavior for TCH/F. The present patch only covers the case of TCH/F; handling of TCH/H is left as a FIXME for other/later developers. Related: OS#5974 Change-Id: I39d15faade28fb7d670493a99a0e0bdb654e2a4a
2023-03-30rtp continuous-streaming: fix BFI in the quality-suppressed caseMychaela N. Falconia1-2/+2
The check for (tch_ind->lqual_cb >= bts->min_qual_norm) in l1sap_tch_ind() has the intent of suppressing valid-seeming speech frame output from lower layers when the link quality is too low; this check is particularly important for FR1 codec where the intrinsic validity check is only a 3-bit CRC which has 1/8 probability of indicating "correct" when decoding radio noise during DTXu silence. However, this check is effectively defeated in the current implementation of rtp continuous-streaming: the RTP packet being output is the presumed-bogus speech frame from lower layers, rather than the intended zero-length payload. Fix this bug. Related: OS#5975 Change-Id: Icee0f57be289a0592a0197469432a012d15f224c
2023-03-30contrib: Add BER testing toolSylvain Munaut7-1/+690
This implements RTP based GSM BER testing for osmo-bts, implementing ideas described in https://osmocom.org/projects/osmobts/wiki/BER_Testing In short: The command transmits a PRBS sequence encapsulated in RTP frames, which are sent to the BTS, which transmits that data in the (unimpaired) downlink. The mobile station receives the data and is instructed to loop it back in the (possibly impaired) uplink. The BTS receives that uplink, puts in in RTP frames which end up being received back by this very tool. By correlating the received RTP with the PRBS sequence, this tool can compute the BER (Bit Error Rate) of the (possibly impaired) uplink. Doing this with different RF channel model simulators in the uplink allows to establish BER at different levels and channel conditions. Original code by Sylvain Munaut extended with some comments and Automake integration by Harald Welte. Change-Id: I1cffa0ae959e29ec61775b13185fd1057ed7485a
2023-03-29lc15: fix compiler warning about unused variable cell_sizeHarald Welte1-3/+4
oml.c: In function ‘bts_model_apply_oml’: oml.c:1814:17: error: variable ‘cell_size’ set but not used [-Werror=unused-but-set-variable] 1814 | uint8_t cell_size; | ^~~~~~~~~ Change-Id: I0bf1542f613f613d03609d50836137ff440401af
2023-03-29cosmetic: Remove "FIXME?" from Odd AMR CMI phaseHarald Welte3-3/+9
This default phase of the Codec Mode Indication in downlink direction is called "odd", which is defined by starting with CMC in every 26 multiframe. At call set-up, after every successful handover and after a channel mode modify, the default phase (odd) shall be used in downlink direction. During a call, the phase of Codec Mode Indication may be changed in downlink by using a RATSCCH message. As we don't implement RATSCCH, odd is always correct. Change-Id: Ia64767fbfdc3fb067d72dbf5eabb1d84e3868ce5
2023-03-29oc2g: Fix 'unused variable' compiler warningHarald Welte1-1/+1
oml.c: In function ‘bts_model_opstart’: oml.c:1883:32: warning: variable ‘ts’ set but not used [-Wunused-but-set-variable] 1883 | struct gsm_bts_trx_ts *ts; | ^~ Change-Id: Ifd5552f2dd56f4f9bf4c17d25b741f694f4f2168
2023-03-29lc15/oc2g: remove unused variablesHarald Welte2-6/+0
oml.c: In function ‘l1if_rsl_chan_mod’: oml.c:1980:22: error: unused variable ‘i’ [-Werror=unused-variable] 1980 | unsigned int i; | ^ oml.c:1979:35: error: unused variable ‘s4l’ [-Werror=unused-variable] 1979 | const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type]; | ^~~ oml.c: In function ‘l1if_rsl_chan_mod’: oml.c:1985:22: warning: unused variable ‘i’ [-Wunused-variable] 1985 | unsigned int i; | ^ oml.c:1984:35: warning: unused variable ‘s4l’ [-Wunused-variable] 1984 | const struct lchan_sapis *s4l = &sapis_for_lchan[lchan->type]; | ^~~ Change-Id: Ieb8882bbade7f6d6628c9c00150bcf54e3a9dc75
2023-03-29lc15: Remove unused warningHarald Welte1-1/+0
l1_if.c: In function ‘activate_rf_compl_cb’: l1_if.c:1251:22: error: unused variable ‘i’ [-Werror=unused-variable] 1251 | unsigned int i; | ^ Change-Id: I23270dfe6779321e514c71184b3c71f52a9b4c4a