aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
AgeCommit message (Collapse)AuthorFilesLines
2023-12-11Handle empty (idle) PDCH blocks gracefullyAndreas Eversberg1-1/+1
An empty PDCH block contains no payload, sysmo-bts and similar BTS models crash, because they expect the msg->l2h to be set. The function l1sap_pdch_req() will not set msg->l2h for empty PDCH blocks, so these models crash. The current osmo-pcu does not send empty PDCH blocks to these BTS models. But there shouldn't be a crash, if we receive empty PDCH blocks over the PCU socket interface. Change-Id: Icb52c896766425fcf453c65530c4c0b8d06b8821
2023-09-21oml: implement handling of NM_ATT_IPACC_SUPP_FEATURESVadim Yanitskiy1-0/+24
Change-Id: I88c6c6af18be054bd152832e60c8afbbd16098a3 Depends: libosmocore.git Ia4208e10d61843dd6ae77398f6624c918dc81ea4 Depends: libosmocore.git I85316af9b57e8113077305798cb2d82a24e48e00
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-04-11Introduce NM FSM for GPRS NSVC objectPau Espin Pedrol1-4/+1
Change-Id: I684482064136a461d01cace3cd37afc8b68458cc Related: OS#5994
2023-04-09cosmetic: Change LOGPLCFN argument orderHarald Welte2-7/+7
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-06Introduce NM FSM for GPRS Cell objectPau Espin Pedrol1-1/+1
Change-Id: I5fd1d17da09a5f0eee3d69fcb4788c106a240e21 Related: OS#5994
2023-04-06Introduce NM FSM for GPRS NSE objectPau Espin Pedrol1-1/+1
Related: OS#5994 Change-Id: I01eadc63214a2eb5e1bce455c7e5b62bd41905ea
2023-04-06Simplify implementation of bts_model_opstart() in all bts typesPau Espin Pedrol1-8/+2
Use mo->fi directly to avoid repeating code paths for each obj_class. Change-Id: I54632201afe87eb3e02bc75cbade163917239ab6
2023-04-06bts_model_apply_oml(): Improve definition of parameterPau Espin Pedrol1-1/+2
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 Pedrol1-2/+1
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 Pedrol1-12/+2
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-05nm: Apply BTS/TRX/TS OML Attributes through NM FSMsPau Espin Pedrol1-2/+1
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-04bts_model_apply_oml(): Drop unneded codePau Espin Pedrol1-8/+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-03-31Replace explicit gsm_lchan_name() calls with LOGPLCHANHarald Welte1-6/+3
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-29cosmetic: use __func__ instead of __FUNCTION__Harald Welte1-1/+1
Our linter would complain about this these days: __func__ should be used instead of gcc specific __FUNCTION__ Change-Id: I80bf6d0a89ce6454ae063759d6088a28b04670c0
2023-03-28Introduce LOGPLCFN() for logging lchan-name + frame numberHarald Welte2-9/+9
So far, we've had LOGPLCHAN() and LOGPFN(). This resulted in a number of log lines containing frame numbers *not* containing the lchan context, which makes it difficult to deterine which of potentially many concurrently active lchans is logging. Let's introduce LOGPLCFN() for a FN-extended version of LOGPLCHAN(), and convert all callers that have the related context. Change-Id: I214af0448652a9f321ccbab77977b67663ba28f9
2023-03-28cosmetic: Replace %i with %dHarald Welte2-2/+2
Our linter will fail on %i, so let's replace any legacy occurrences with %d Change-Id: Ic302915bd5576d3e1f77668918f005d651daf21a
2023-03-24osmo-bts-{sysmo,lc15,oc2g}: fix segfault in ph_tch_req()Vadim Yanitskiy1-2/+1
ph_tch_req() is a recursive function and conditionally calls itself at the very bottom. The recursive call happens iff all of the following conditions are met: * DTXd is enabled, * AMR codec is in use, * DTX DL AMR FSM state is recursive. The problem is that ph_tch_req() may pull sizeof(*lsap) from the given msgb twice: during the initial and the recursive calls. The second attempt to pull sizeof(*lsap) causes the process to abort, because the remaining room is less than it's attempting to pull. AFAICT, doing msgb_pull() is not really necessary, given that l1sap_tch_rts_ind() thankfully does set msg->l2h before pushing the lsap header in front of the actual frame. Update osmo-bts-sysmo and its copy-pasted siblings, which are likely affected too, except osmo-bts-octphy which does not do the recursion. Change-Id: Ib349b74a9e4bd48c902286f872d3b0e9a068256c Related: OS#5925
2022-09-06Depend on libosmo-netifPau Espin Pedrol1-0/+2
This library will be used soon when adding Osmux support to osmo-bts. Furthermore, it nice to have it available to make use of other general interfaces to create connections, primitives, RTP and AMR related functionalities, etc. Related: SYS#5987 Change-Id: I49db4de715065c083e1249cbeae6298d6868e229
2022-08-11Clean up osmo-bts-*/Makefile.amPau Espin Pedrol1-3/+31
Make them more easy to read and edit by splitting to one element per line when several elements are present. Change-Id: I24ecfa1167b806dcb3a5a0c00343299df842a78b
2022-04-25model_init: order features alphabetically, part 2Oliver Smith1-2/+3
Order the ones I've overlooked as well. Related: SYS#5922, OS#5538 Change-Id: I0aa344de9ea4849de0fcd7b44bfaa70274af594b
2021-11-25[lc15,oc2g,octphy] Fix memory leak on write queue overflowHarald Welte1-1/+5
Callers of osmo_wqueue_enqueue must always check the return value and free the message themselves in the error case. Change-Id: Ic67fbef23e419c0c8a7bcfb16d134e1bf649de72 Related: OS#5329
2021-10-14Move lchan_init_lapdm inside lchan_set_state(LCHAN_S_ACTIVE)Pau Espin Pedrol1-3/+0
osmo-bts-trx/l1_if.c lchan_init_lapdm() for CCCH is already done when trx_set_ts_as_pchan() calls: "lchan_set_state(&ts->lchan[CCCH_LCHAN], LCHAN_S_ACTIVE);" Change-Id: I7a9c3660b9aab57ff8765e2f1526349599630cd9
2021-09-22nm_*fsm: Make FSMs aware of object being properly configured or notPau Espin Pedrol1-4/+27
This will allow in the future advertising children objects that the parent object has been configured. It is useful for instance to let TRX know that the BTS is configured. Change-Id: Ie319465fd0e991bab8451ea34ec72ff3702533d2
2021-09-20Allow setting administrative state through oml_mo_state_chg()Pau Espin Pedrol1-1/+1
This way it can be changed together with operative/availability state, and changes announced to the BSC if present. This commit presents no real change in osmo-bts behavior, since the only place where adm_state is passed different than -1 is in st_op_disabled_notinstalled_on_enter(), which is actually never called (yet) since it's the initial state and no other states transition later to it. However, this will change in the future once we support re-connecting to a (possibly different) BSC, which means objects will need to be moved to that state to restart the whole OML install procedure on the new BSC. Change-Id: Ifdc6a1dfb673c0ab915ddf2a9d372928f4f86b4c
2021-09-13lchan: Move TA CTRL param to its own substructPau Espin Pedrol1-1/+1
Field is renamed to look similar to similar fields in power control loop. This is a preparation commit, next one will add functionality to skip SACCH blocksi (P_CON_INTERVAL). Related: SYS#5371 Change-Id: I169ce58ab827e38b64f4b15f935097a9118fa118
2021-07-05Rename osmo dyn ts enums to contain SDCCH8Pau Espin Pedrol2-3/+3
They will gain support to be activated as SDCCH/8 soon too. Related: SYS#5309 Depends: libosmocore.git I56dcfe4d17899630b17f80145c3ced72f1e91e68 Change-Id: Ia617d20fc52f09dbab8f4516c06fa1efac08e898
2021-06-10osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()Vadim Yanitskiy1-12/+10
Change-Id: Ied39cc594fedc712d751ab1c7b636bbbff527bd6
2021-05-23[VAMOS] gsm_data.h: introduce and use BTS_TSC macroVadim Yanitskiy1-1/+1
Change-Id: I0cf915d2d3a640aa1442cf6abe9a314261b4a64e Related: SYS#5315, OS#4940
2021-04-20lchan2lch_par(): fix missing default branch in switchVadim Yanitskiy1-7/+12
New channel mode values have recently been added with change [1] to 'enum gsm48_chan_mode'. The lack of default branch in lchan2lch_par() caused build failures on Jenkins: oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V2_VAMOS’ not handled in switch [-Werror=switch] oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V3_VAMOS’ not handled in switch [-Werror=switch] oml.c:956:2: error: enumeration value ‘GSM48_CMODE_SPEECH_V5_VAMOS’ not handled in switch [-Werror=switch] This function is duplicated in osmo-bts-{lc15,oc2g,octphy,sysmo}, so we unfortunately need to apply the same fix to all copy-pasted files. Change-Id: I557ff8cac6564d22485c101fba9212f5f0e95bb7 Related: [1] Ie0ea592da5610ae70290106d004e549cf3212a89
2020-11-03fixup: vty: call bts_model_vty_init() from bts_vty_init()Vadim Yanitskiy1-2/+0
Now bts_model_vty_init() must be called only once, otherwise the process would crash when bts_model_init() is called from main(). Change-Id: I262c39896b5db86c54ad9aa7042c7ca6657815d9 Related: SYS#4937, OS#3036
2020-11-02vty: call bts_model_vty_init() from bts_vty_init()Vadim Yanitskiy1-5/+1
Similar to bts_vty_init(), BTS specific bts_model_vty_init() requires a pointer to 'struct gsm_bts'. Not only it's used as a parent talloc context, but also stored locally, so then it can be used by some VTY commands. Let's expose the global 'struct gsm_bts' from main, and pass the application's talloc context like was done in [1]. This finally makes the BTS model specific options appear in the automatically generated VTY reference (--vty-ref-xml). [1] Ic356a950da85de02c82e9882a5fbadaaa6929680 Change-Id: Iee7fee6747dd1e7c0af36f9b27326f651ae37aaf Related: SYS#4937, OS#3036
2020-10-24main: separate model-specific arguments in helpVadim Yanitskiy1-0/+1
Change-Id: I9646a45d61153499ad3d580a03d930ed20e23cda
2020-10-24main: increase spacing between commands and descriptionVadim Yanitskiy1-1/+1
Otherwise it's hard to fit new options with long names. Change-Id: If9a418545abff6d22602ba07cfd4447f5ace7742 Related: SYS#4910
2020-10-20Introduce NM Channel FSMPau Espin Pedrol2-24/+19
Change-Id: I288cbfb4730b25a334ef1c3d6b9679d6f1d4cfc5
2020-10-20Introduce NM Radio Carrier and Baseband Transceiver FSMsPau Espin Pedrol2-24/+23
All the Operative State logic to manage a RadioCarrier//BBTransc NM objects is centralized in these FSM, where other parts of the code simply send events to it. This allows keeping state consistent and offloading logic from each bts backend, since they are only required to submit events now. The idea in the long run is to also replace other NM objects with similar FSMs. This improved logic fixes bug where PHY + RSL link became available before OPSTART and hence op state changed to Enabled before receiving any OPSTART message. Change-Id: Ifb249a821c4270918699b6375a72b3a618e8cfbe
2020-10-20Introduce NM BTS FSMPau Espin Pedrol1-1/+3
Change-Id: Iae631bcc7acdf955296b124707e42d5e565af186
2020-10-20Introduce NM BTS Site Manager FSMPau Espin Pedrol1-1/+4
This fixes old behavior mimicing broken behavior in nanoBTS (according to TS 12.21) where BTS Site Mgr NM object was announced as Enabled despite no OPSTART was sent by the BSC. With this new FSM, BTS SiteManager will be announced as Disabled Offline during OML startup conversation, instead of Enabled. The new osmo-bsc OML management FSMs use this change in behavior to find out whether it should use the old broken management states (without Offline state, as per nanoBTS) or use the new state transitions (which allow fixing several race conditions). Change-Id: Iab2d17c45c9642860cd2d5d523c1baae24502243
2020-10-20Change NM Channel availability Dependency->Offline when RadioCarrier becomes ↵Pau Espin Pedrol1-0/+12
enabled This fix allows osmo-bts to play fine with newer osmo-bsc NM OML FSMs, which expectes for non-nanoBTS types to follow TS 12.21 guidelines. Until now, BSC simply waited to received State Event Change Dependency for each TS and then sent all required commands (Set Chan Attr, Adm Unlock and Opstart). In newer osmo-bsc FSMs, Opstart is only sent when in Offline state, so we need to transit to that state. For the above mentioned reason, since we pass through the Dependency state anyway after this patch, older osmo-bscs will work correctly too. Change-Id: Id9e61f8d773e6e6170c68b5b836d276c747d8d69
2020-10-19use osmo_fd_setup() everywhereHarald Welte1-4/+1
Change-Id: I9be55f791a15fae2362dc431dc778b9b9d8db349
2020-09-28vty: make most struct pointers const in show/write commandsVadim Yanitskiy1-4/+4
Change-Id: Iacc32f7982c150d84ea4df7affa1f9e07806928f
2020-08-03Constify the 'trx' argument of trx_get_hlayer1() everywhereVadim Yanitskiy2-2/+2
Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
2020-07-05Move gsm_bts code gsm-data.* => bts.*Pau Espin Pedrol1-0/+1
bts.h refers to struct gsm_bts object, but we still had a bunch of stuff in bulky gsm_data.* from old days. Let's move stuff where it belongs to start clean up of gsm_data. Change-Id: I0a4219e3f64f625ee8b364bf408b8d2bcc8085c5
2020-06-23bts_model: Convert bts_model_trx_close() to return asynchronouslyPau Espin Pedrol1-3/+4
Some backends like osmo-bts-trx require exchanging messages like POWEROFF to close the TRX, and hence need some time. Switch the function to expect result asynchronously by calling a callback. This will be used later to wait until all TRX are really powered off before exiting the process. Change-Id: I7d76b600fc06e1114b35bf0c2d08eff5bbd1b69a
2020-06-18power_ramp: Add support to get callback when ramping process completesPau Espin Pedrol1-1/+1
It will be used in forthcoming commits to feed FSM events once the ramping process completes. Change-Id: I778dc215cf6055b93658670cc12e78ad2e51f85e
2020-06-18Introduce LOGPTRX macro and use it in tx_power.cPau Espin Pedrol1-8/+8
Rename OCTPHY specific LOPGTRX macro to avoid redefine conflicts. Change-Id: I02878611501aca51039e2ac7e35784ccb93b1db6
2020-06-11Do not mix public and private BTS features, use libosmocore's APIVadim Yanitskiy1-5/+5
It was a very bad idea to mix "public" BTS features, that are reported to the BSC via OML, and those features, that are used locally (and exclusively) in osmo-bts. Why? At least because we already have the BTS feature manipulation API in libosmocore, that is used by osmo-bsc, but for some reason not by osmo-bts. New features added to libosmocore would clash with the existing "internal" ones like BTS_FEAT_MS_PWR_CTRL_DSP. So what this change does can be described as follows: - remove duplicate definition of the "public" features, - use libosmocore's API for the "public" features, - separate both "internal" and "public" features: - the "public" features continue to live in bitvec, - the "internal" features become flags, - s/BTS_FEAT/BTS_INTERNAL_FLAG/g. Change-Id: Icf792d02323bb73e3b8d46384c7890cb1eb4731e
2020-05-19l1_utils.h: Avoid redefinition of global vars defined in l1_utils.cPau Espin Pedrol1-5/+5
Change-Id: Idd40433fee22aeb1e86708c132929bb69e626334
2020-05-09Use OSMO_FD_* instead of deprecated BSC_FD_*Pau Espin Pedrol1-1/+1
New define is available since libosmocore 1.1.0, and we already require 1.3.0, so no need to update dependenices. Let's change it to avoid people re-using old BSC_FD_READ symbol when copy-pasting somewhere else. Change-Id: Id51ccb2c273c5f0fa4986f28bbd69a72d2dbaa0e
2020-02-17osmo-bts-sysmo: merge measurement data and payloadPhilipp Maier1-2/+2
For osmo-bts-sysmo the MPH INFO MEAS IND indication is still sent separately. Lets merge the measurement information into the PH DATA Change-Id: Iffe7865727fbf9bca8eb32a96e8ea05cf718a948 Related: OS#2977