2010-01-10 17:01:52 +00:00
|
|
|
/* ip.access nanoBTS specific code */
|
|
|
|
|
2018-05-27 09:53:43 +00:00
|
|
|
/* (C) 2009-2018 by Harald Welte <laforge@gnumonks.org>
|
2020-12-16 22:38:30 +00:00
|
|
|
* (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
|
2010-01-10 17:01:52 +00:00
|
|
|
*
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2011-01-01 14:25:50 +00:00
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2010-01-10 17:01:52 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-01 14:25:50 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2010-01-10 17:01:52 +00:00
|
|
|
*
|
2011-01-01 14:25:50 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-01-10 17:01:52 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2011-01-14 14:55:42 +00:00
|
|
|
#include <arpa/inet.h>
|
2017-09-21 14:15:32 +00:00
|
|
|
#include <time.h>
|
2010-01-10 17:01:52 +00:00
|
|
|
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/gsm/tlv.h>
|
2011-01-14 14:55:42 +00:00
|
|
|
|
2017-09-04 13:15:32 +00:00
|
|
|
#include <osmocom/bsc/gsm_data.h>
|
|
|
|
#include <osmocom/bsc/signal.h>
|
|
|
|
#include <osmocom/bsc/abis_nm.h>
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
#include <osmocom/abis/e1_input.h>
|
|
|
|
#include <osmocom/gsm/tlv.h>
|
|
|
|
#include <osmocom/core/msgb.h>
|
2018-10-23 13:35:43 +00:00
|
|
|
#include <osmocom/core/socket.h>
|
2021-07-21 12:26:26 +00:00
|
|
|
#include <osmocom/core/stat_item.h>
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
#include <osmocom/core/talloc.h>
|
2018-10-31 09:29:51 +00:00
|
|
|
#include <osmocom/core/utils.h>
|
2017-09-04 13:15:32 +00:00
|
|
|
#include <osmocom/bsc/gsm_data.h>
|
|
|
|
#include <osmocom/bsc/abis_nm.h>
|
|
|
|
#include <osmocom/bsc/abis_rsl.h>
|
2021-06-23 12:15:20 +00:00
|
|
|
#include <osmocom/bsc/abis_osmo.h>
|
2017-09-04 13:15:32 +00:00
|
|
|
#include <osmocom/bsc/debug.h>
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
#include <osmocom/abis/subchan_demux.h>
|
2014-08-20 21:46:40 +00:00
|
|
|
#include <osmocom/gsm/ipa.h>
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
#include <osmocom/abis/ipaccess.h>
|
|
|
|
#include <osmocom/core/logging.h>
|
2017-09-04 13:15:32 +00:00
|
|
|
#include <osmocom/bsc/ipaccess.h>
|
|
|
|
#include <osmocom/bsc/bts_ipaccess_nanobts_omlattr.h>
|
2018-04-19 12:31:11 +00:00
|
|
|
#include <osmocom/bsc/paging.h>
|
large refactoring: use FSMs for lchans; add inter-BSC HO
Add FSMs:
- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.
Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.
- Add logging macros for each FSM type:
- LOG_TS()
- LOG_LCHAN()
- LOG_MGWEP(), LOG_CI()
- LOG_ASSIGNMENT()
- LOG_HO()
These log with the osmo_fsm_inst where present.
New style decision: logging without a final newline char is awkward,
especially for gsmtap logging and when other logs interleave LOGPC() calls;
we have various cases where the final \n goes missing, and also this invokes
the log category checking N times instead of once.
So I decided to make these macros *always* append a newline, but only if
there is no final newline yet. I hope that the compiler optimizes the
strlen() of the constant format strings away. Thus I can log with or without
typing "\n" and always get an \n termination anyway.
General:
- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
with dedicated FSM timeouts, states and events.
- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
These can be used (with some macro magic) to define a state's timeout once,
and not make mistakes for each osmo_fsm_inst_state_chg().
Details:
bsc_subscr_conn_fsm.c:
- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
mgw_endpoint_fsm.
- There is exactly one state for an ongoing Assignment, with all details
handled in conn->assignment.fi. The state relies on the assignment_fsm's
timeout.
- There is one state for an ongoing Handover; except for an incoming Handover
from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
are both established.
- move bssmap_add_lcls_status() to osmo_bsc_lcls.c
abis_rsl.c:
- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in
abis_rsl.c
- reduce some rsl functions to merely send a message, rename to "_tx_".
- rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function.
- move all timers and error/release handling away into various FSMs.
- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
lchan passed, but just mode,type that they require. Rename to
ipacc_speech_mode*() and ipacc_payload_type().
- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
message received during BSSMAP Handover Command.
- move various logging to LOG_LCHAN() in order to log with the lchan FSM instance.
One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging
from DRR to DRSL. It might actually make sense to combine those categories.
- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance.
- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's
correct).
- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during
inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS.
assignment_fsm.c:
- the Chan Mode Modify in case of re-using the same lchan is not implemented
yet, because this was also missing in the previous implementation (OS#3357).
osmo_bsc_api.c:
- simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to
lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv
twice, once by member assignment and then again with a memcpy.)
- During handover, we used to copy the MR config from the old lchan. Since we
may handover between FR and HR, rather set the MR Config anew every time, so
that FR rates are always available on FR lchans, and never on HR lchans.
Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore),
I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore)
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-05-14 16:14:15 +00:00
|
|
|
#include <osmocom/bsc/timeslot_fsm.h>
|
2020-07-15 18:53:16 +00:00
|
|
|
#include <osmocom/bsc/bts.h>
|
2020-12-01 18:59:15 +00:00
|
|
|
#include <osmocom/bsc/bts_sm.h>
|
2020-09-30 10:52:04 +00:00
|
|
|
#include <osmocom/bsc/nm_common_fsm.h>
|
2021-08-29 11:18:40 +00:00
|
|
|
#include <osmocom/bsc/bsc_stats.h>
|
bsc: on-demand setup of nanoBTS and HSL femto sockets
The daemons set up nanoBTS and HSL femto sockets by default, ie. the
three sockets to support these two drivers are open even if we have
no BTS of that kind.
This patch enables on-demand socket creation, ie. we only enable them
if we have one BTS at least that requires it.
I added two new attributes to the gsm_bts object, they are:
* the start() function includes the code that we need to run to start
the BTS. This new function contains the socket creation in the
particular case of nanoBTS and HSL femto.
* the started boolean, which is used to know if we have already
started the BTS, ie. we have already invoked start().
Note that, I have splitted the bts_model_*_init() function into two
functions, the _init() functions that register the BTS driver
and the _start() functions that start BTS driver on-demand.
While I was at it, I added several changes/cleanups to this patch:
* Group all bts_model_*_init() calls into one function bts_init(),
which is called in the initialization path of osmo-nitb and
osmo-bsc.
* Add openbsc/bss.h that contains the declaration of
bsc_bootstrap_network, bsc_shutdown_net and bts_init.
* Add missing e1inp_init() in osmo-bsc.
* Fix missing declaration of hsl_setup in openbsc/e1_input.h
2011-05-14 09:32:48 +00:00
|
|
|
|
|
|
|
static int bts_model_nanobts_start(struct gsm_network *net);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
static void bts_model_nanobts_e1line_bind_ops(struct e1inp_line *line);
|
2010-01-10 17:01:52 +00:00
|
|
|
|
2020-12-16 22:38:30 +00:00
|
|
|
static int power_ctrl_send_def_params(const struct gsm_bts_trx *trx);
|
|
|
|
static int power_ctrl_enc_rsl_params(struct msgb *msg, const struct gsm_power_ctrl_params *cp);
|
|
|
|
|
2017-10-12 15:46:49 +00:00
|
|
|
static char *get_oml_status(const struct gsm_bts *bts)
|
|
|
|
{
|
|
|
|
if (bts->oml_link)
|
2017-11-29 11:18:02 +00:00
|
|
|
return all_trx_rsl_connected_unlocked(bts) ? "connected" : "degraded";
|
2017-10-12 15:46:49 +00:00
|
|
|
|
|
|
|
return "disconnected";
|
|
|
|
}
|
|
|
|
|
2012-07-02 17:51:55 +00:00
|
|
|
struct gsm_bts_model bts_model_nanobts = {
|
2010-01-10 17:01:52 +00:00
|
|
|
.type = GSM_BTS_TYPE_NANOBTS,
|
2011-02-12 11:29:21 +00:00
|
|
|
.name = "nanobts",
|
bsc: on-demand setup of nanoBTS and HSL femto sockets
The daemons set up nanoBTS and HSL femto sockets by default, ie. the
three sockets to support these two drivers are open even if we have
no BTS of that kind.
This patch enables on-demand socket creation, ie. we only enable them
if we have one BTS at least that requires it.
I added two new attributes to the gsm_bts object, they are:
* the start() function includes the code that we need to run to start
the BTS. This new function contains the socket creation in the
particular case of nanoBTS and HSL femto.
* the started boolean, which is used to know if we have already
started the BTS, ie. we have already invoked start().
Note that, I have splitted the bts_model_*_init() function into two
functions, the _init() functions that register the BTS driver
and the _start() functions that start BTS driver on-demand.
While I was at it, I added several changes/cleanups to this patch:
* Group all bts_model_*_init() calls into one function bts_init(),
which is called in the initialization path of osmo-nitb and
osmo-bsc.
* Add openbsc/bss.h that contains the declaration of
bsc_bootstrap_network, bsc_shutdown_net and bts_init.
* Add missing e1inp_init() in osmo-bsc.
* Fix missing declaration of hsl_setup in openbsc/e1_input.h
2011-05-14 09:32:48 +00:00
|
|
|
.start = bts_model_nanobts_start,
|
2011-02-12 11:29:21 +00:00
|
|
|
.oml_rcvmsg = &abis_nm_rcvmsg,
|
2017-10-09 15:12:53 +00:00
|
|
|
.oml_status = &get_oml_status,
|
2018-11-19 16:48:17 +00:00
|
|
|
.e1line_bind_ops = bts_model_nanobts_e1line_bind_ops,
|
2020-12-16 22:38:30 +00:00
|
|
|
|
|
|
|
/* MS/BS Power control specific API */
|
|
|
|
.power_ctrl_send_def_params = &power_ctrl_send_def_params,
|
|
|
|
.power_ctrl_enc_rsl_params = &power_ctrl_enc_rsl_params,
|
|
|
|
|
2018-11-19 16:48:17 +00:00
|
|
|
/* Some nanoBTS firmwares (if not all) don't support SI2ter and cause
|
|
|
|
* problems on some MS if it is enabled, see OS#3063. Disable it by
|
|
|
|
* default, can still be enabled through VTY cmd with same name.
|
|
|
|
*/
|
|
|
|
.force_combined_si = true,
|
2010-01-10 17:01:52 +00:00
|
|
|
.nm_att_tlvdef = {
|
|
|
|
.def = {
|
|
|
|
/* ip.access specifics */
|
|
|
|
[NM_ATT_IPACC_DST_IP] = { TLV_TYPE_FIXED, 4 },
|
|
|
|
[NM_ATT_IPACC_DST_IP_PORT] = { TLV_TYPE_FIXED, 2 },
|
|
|
|
[NM_ATT_IPACC_STREAM_ID] = { TLV_TYPE_TV, },
|
|
|
|
[NM_ATT_IPACC_SEC_OML_CFG] = { TLV_TYPE_FIXED, 6 },
|
|
|
|
[NM_ATT_IPACC_IP_IF_CFG] = { TLV_TYPE_FIXED, 8 },
|
|
|
|
[NM_ATT_IPACC_IP_GW_CFG] = { TLV_TYPE_FIXED, 12 },
|
|
|
|
[NM_ATT_IPACC_IN_SERV_TIME] = { TLV_TYPE_FIXED, 4 },
|
|
|
|
[NM_ATT_IPACC_LOCATION] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_PAGING_CFG] = { TLV_TYPE_FIXED, 2 },
|
|
|
|
[NM_ATT_IPACC_UNIT_ID] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_UNIT_NAME] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_SNMP_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_PRIM_OML_CFG_LIST] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_NV_FLAGS] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_FREQ_CTRL] = { TLV_TYPE_FIXED, 2 },
|
|
|
|
[NM_ATT_IPACC_PRIM_OML_FB_TOUT] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_CUR_SW_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_TIMING_BUS] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_CGI] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_RAC] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_OBJ_VERSION] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_GPRS_PAGING_CFG]= { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_NSEI] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_BVCI] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_NSVCI] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_NS_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_BSSGP_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_NS_LINK_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_RLC_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_ALM_THRESH_LIST]= { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_MONIT_VAL_LIST] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_TIB_CONTROL] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_SUPP_FEATURES] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_CODING_SCHEMES] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_RLC_CFG_2] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_HEARTB_TOUT] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_UPTIME] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_RLC_CFG_3] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_SSL_CFG] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_SEC_POSSIBLE] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_IML_SSL_STATE] = { TLV_TYPE_TL16V },
|
|
|
|
[NM_ATT_IPACC_REVOC_DATE] = { TLV_TYPE_TL16V },
|
|
|
|
},
|
|
|
|
},
|
2022-04-26 14:53:14 +00:00
|
|
|
.features_get_reported = true,
|
2010-01-10 17:01:52 +00:00
|
|
|
};
|
|
|
|
|
2011-01-14 14:55:42 +00:00
|
|
|
|
|
|
|
/* Callback function to be called whenever we get a GSM 12.21 state change event */
|
|
|
|
static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd)
|
|
|
|
{
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t obj_class = nsd->obj_class;
|
2011-01-14 14:55:42 +00:00
|
|
|
void *obj = nsd->obj;
|
|
|
|
|
2020-09-30 10:52:04 +00:00
|
|
|
struct gsm_bts_sm *bts_sm;
|
2011-01-14 14:55:42 +00:00
|
|
|
struct gsm_bts *bts;
|
|
|
|
struct gsm_bts_trx *trx;
|
2020-09-30 11:42:04 +00:00
|
|
|
struct gsm_bts_bb_trx *bb_transc;
|
2011-01-14 14:55:42 +00:00
|
|
|
struct gsm_bts_trx_ts *ts;
|
2020-12-01 16:25:28 +00:00
|
|
|
struct gsm_gprs_nsvc *nsvc;
|
2020-12-01 18:59:15 +00:00
|
|
|
struct gsm_gprs_nse *nse;
|
2020-12-02 17:19:49 +00:00
|
|
|
struct gsm_gprs_cell *cell;
|
2011-01-14 14:55:42 +00:00
|
|
|
|
2013-04-24 09:33:13 +00:00
|
|
|
if (!is_ipaccess_bts(nsd->bts))
|
2011-03-06 21:11:32 +00:00
|
|
|
return 0;
|
|
|
|
|
2011-01-14 14:55:42 +00:00
|
|
|
switch (obj_class) {
|
|
|
|
case NM_OC_SITE_MANAGER:
|
2020-09-30 10:52:04 +00:00
|
|
|
bts_sm = obj;
|
|
|
|
osmo_fsm_inst_dispatch(bts_sm->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
|
|
|
case NM_OC_BTS:
|
|
|
|
bts = obj;
|
2020-09-30 10:52:53 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
2020-09-30 11:42:04 +00:00
|
|
|
case NM_OC_BASEB_TRANSC:
|
|
|
|
bb_transc = obj;
|
|
|
|
osmo_fsm_inst_dispatch(bb_transc->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
|
|
|
break;
|
2011-01-14 14:55:42 +00:00
|
|
|
case NM_OC_CHANNEL:
|
|
|
|
ts = obj;
|
|
|
|
trx = ts->trx;
|
2020-09-30 14:36:30 +00:00
|
|
|
osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
|
|
|
case NM_OC_RADIO_CARRIER:
|
2020-09-30 12:43:09 +00:00
|
|
|
trx = obj;
|
|
|
|
osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
|
|
|
case NM_OC_GPRS_NSE:
|
2020-12-01 18:59:15 +00:00
|
|
|
nse = obj;
|
|
|
|
osmo_fsm_inst_dispatch(nse->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
|
|
|
case NM_OC_GPRS_CELL:
|
2020-12-02 17:19:49 +00:00
|
|
|
cell = obj;
|
|
|
|
osmo_fsm_inst_dispatch(cell->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
|
|
|
case NM_OC_GPRS_NSVC:
|
|
|
|
nsvc = obj;
|
|
|
|
/* We skip NSVC1 since we only use NSVC0 */
|
|
|
|
if (nsvc->id == 1)
|
|
|
|
break;
|
2020-12-02 02:57:23 +00:00
|
|
|
osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_STATE_CHG_REP, nsd);
|
|
|
|
break;
|
2011-01-14 14:55:42 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Callback function to be called every time we receive a 12.21 SW activated report */
|
|
|
|
static int sw_activ_rep(struct msgb *mb)
|
|
|
|
{
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(mb);
|
2011-08-17 20:43:54 +00:00
|
|
|
struct e1inp_sign_link *sign_link = mb->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
2020-09-30 10:52:04 +00:00
|
|
|
struct gsm_bts_trx *trx;
|
2020-12-02 02:57:23 +00:00
|
|
|
struct gsm_gprs_nsvc *nsvc;
|
2020-09-30 14:36:30 +00:00
|
|
|
struct gsm_bts_trx_ts *ts;
|
2011-01-14 14:55:42 +00:00
|
|
|
|
2020-09-30 10:52:04 +00:00
|
|
|
if (!is_ipaccess_bts(bts))
|
2011-01-14 14:55:42 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
switch (foh->obj_class) {
|
2020-09-30 10:52:04 +00:00
|
|
|
case NM_OC_SITE_MANAGER:
|
2020-12-01 16:25:28 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_SW_ACT_REP, NULL);
|
2020-09-30 10:52:04 +00:00
|
|
|
break;
|
2020-09-30 10:52:53 +00:00
|
|
|
case NM_OC_BTS:
|
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_SW_ACT_REP, NULL);
|
|
|
|
break;
|
2011-01-14 14:55:42 +00:00
|
|
|
case NM_OC_BASEB_TRANSC:
|
2020-09-30 10:52:04 +00:00
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return -EINVAL;
|
2020-09-30 11:42:04 +00:00
|
|
|
osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_SW_ACT_REP, NULL);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
2020-09-30 12:43:09 +00:00
|
|
|
case NM_OC_RADIO_CARRIER:
|
2020-09-30 10:52:04 +00:00
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return -EINVAL;
|
2020-09-30 12:43:09 +00:00
|
|
|
osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SW_ACT_REP, NULL);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
2020-09-30 14:36:30 +00:00
|
|
|
case NM_OC_CHANNEL:
|
|
|
|
if (!(ts = abis_nm_get_ts(mb)))
|
|
|
|
return -EINVAL;
|
|
|
|
osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_SW_ACT_REP, NULL);
|
|
|
|
break;
|
2020-12-01 18:59:15 +00:00
|
|
|
case NM_OC_GPRS_NSE:
|
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_SW_ACT_REP, NULL);
|
|
|
|
break;
|
2020-12-02 17:19:49 +00:00
|
|
|
case NM_OC_GPRS_CELL:
|
|
|
|
osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_SW_ACT_REP, NULL);
|
|
|
|
break;
|
2020-12-02 02:57:23 +00:00
|
|
|
case NM_OC_GPRS_NSVC:
|
|
|
|
if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr)))
|
|
|
|
return -EINVAL;
|
|
|
|
osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_SW_ACT_REP, NULL);
|
|
|
|
break;
|
2011-01-14 14:55:42 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-06-15 18:39:58 +00:00
|
|
|
static void nm_rx_opstart_ack_chan(struct msgb *oml_msg)
|
2018-05-03 14:11:28 +00:00
|
|
|
{
|
|
|
|
struct gsm_bts_trx_ts *ts;
|
2018-06-15 18:39:58 +00:00
|
|
|
ts = abis_nm_get_ts(oml_msg);
|
|
|
|
if (!ts)
|
|
|
|
/* error already logged in abis_nm_get_ts() */
|
2018-05-03 14:11:28 +00:00
|
|
|
return;
|
large refactoring: use FSMs for lchans; add inter-BSC HO
Add FSMs:
- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.
Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.
- Add logging macros for each FSM type:
- LOG_TS()
- LOG_LCHAN()
- LOG_MGWEP(), LOG_CI()
- LOG_ASSIGNMENT()
- LOG_HO()
These log with the osmo_fsm_inst where present.
New style decision: logging without a final newline char is awkward,
especially for gsmtap logging and when other logs interleave LOGPC() calls;
we have various cases where the final \n goes missing, and also this invokes
the log category checking N times instead of once.
So I decided to make these macros *always* append a newline, but only if
there is no final newline yet. I hope that the compiler optimizes the
strlen() of the constant format strings away. Thus I can log with or without
typing "\n" and always get an \n termination anyway.
General:
- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
with dedicated FSM timeouts, states and events.
- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
These can be used (with some macro magic) to define a state's timeout once,
and not make mistakes for each osmo_fsm_inst_state_chg().
Details:
bsc_subscr_conn_fsm.c:
- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
mgw_endpoint_fsm.
- There is exactly one state for an ongoing Assignment, with all details
handled in conn->assignment.fi. The state relies on the assignment_fsm's
timeout.
- There is one state for an ongoing Handover; except for an incoming Handover
from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
are both established.
- move bssmap_add_lcls_status() to osmo_bsc_lcls.c
abis_rsl.c:
- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in
abis_rsl.c
- reduce some rsl functions to merely send a message, rename to "_tx_".
- rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function.
- move all timers and error/release handling away into various FSMs.
- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
lchan passed, but just mode,type that they require. Rename to
ipacc_speech_mode*() and ipacc_payload_type().
- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
message received during BSSMAP Handover Command.
- move various logging to LOG_LCHAN() in order to log with the lchan FSM instance.
One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging
from DRR to DRSL. It might actually make sense to combine those categories.
- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance.
- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's
correct).
- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during
inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS.
assignment_fsm.c:
- the Chan Mode Modify in case of re-using the same lchan is not implemented
yet, because this was also missing in the previous implementation (OS#3357).
osmo_bsc_api.c:
- simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to
lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv
twice, once by member assignment and then again with a memcpy.)
- During handover, we used to copy the MR config from the old lchan. Since we
may handover between FR and HR, rather set the MR Config anew every time, so
that FR rates are always available on FR lchans, and never on HR lchans.
Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore),
I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore)
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-05-14 16:14:15 +00:00
|
|
|
if (!ts->fi) {
|
|
|
|
LOG_TS(ts, LOGL_ERROR, "Channel OPSTART ACK for uninitialized TS\n");
|
|
|
|
return;
|
|
|
|
}
|
2020-09-30 14:36:30 +00:00
|
|
|
osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_OPSTART_ACK, NULL);
|
large refactoring: use FSMs for lchans; add inter-BSC HO
Add FSMs:
- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.
Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.
- Add logging macros for each FSM type:
- LOG_TS()
- LOG_LCHAN()
- LOG_MGWEP(), LOG_CI()
- LOG_ASSIGNMENT()
- LOG_HO()
These log with the osmo_fsm_inst where present.
New style decision: logging without a final newline char is awkward,
especially for gsmtap logging and when other logs interleave LOGPC() calls;
we have various cases where the final \n goes missing, and also this invokes
the log category checking N times instead of once.
So I decided to make these macros *always* append a newline, but only if
there is no final newline yet. I hope that the compiler optimizes the
strlen() of the constant format strings away. Thus I can log with or without
typing "\n" and always get an \n termination anyway.
General:
- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
with dedicated FSM timeouts, states and events.
- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
These can be used (with some macro magic) to define a state's timeout once,
and not make mistakes for each osmo_fsm_inst_state_chg().
Details:
bsc_subscr_conn_fsm.c:
- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
mgw_endpoint_fsm.
- There is exactly one state for an ongoing Assignment, with all details
handled in conn->assignment.fi. The state relies on the assignment_fsm's
timeout.
- There is one state for an ongoing Handover; except for an incoming Handover
from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
are both established.
- move bssmap_add_lcls_status() to osmo_bsc_lcls.c
abis_rsl.c:
- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in
abis_rsl.c
- reduce some rsl functions to merely send a message, rename to "_tx_".
- rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function.
- move all timers and error/release handling away into various FSMs.
- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
lchan passed, but just mode,type that they require. Rename to
ipacc_speech_mode*() and ipacc_payload_type().
- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
message received during BSSMAP Handover Command.
- move various logging to LOG_LCHAN() in order to log with the lchan FSM instance.
One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging
from DRR to DRSL. It might actually make sense to combine those categories.
- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance.
- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's
correct).
- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during
inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS.
assignment_fsm.c:
- the Chan Mode Modify in case of re-using the same lchan is not implemented
yet, because this was also missing in the previous implementation (OS#3357).
osmo_bsc_api.c:
- simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to
lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv
twice, once by member assignment and then again with a memcpy.)
- During handover, we used to copy the MR config from the old lchan. Since we
may handover between FR and HR, rather set the MR Config anew every time, so
that FR rates are always available on FR lchans, and never on HR lchans.
Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore),
I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore)
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-05-14 16:14:15 +00:00
|
|
|
osmo_fsm_inst_dispatch(ts->fi, TS_EV_OML_READY, NULL);
|
2018-05-03 14:11:28 +00:00
|
|
|
}
|
|
|
|
|
2018-06-15 18:39:58 +00:00
|
|
|
static void nm_rx_opstart_ack(struct msgb *oml_msg)
|
2018-05-03 14:11:28 +00:00
|
|
|
{
|
2018-06-15 18:39:58 +00:00
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
|
2020-09-30 10:52:04 +00:00
|
|
|
struct e1inp_sign_link *sign_link = oml_msg->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
2020-09-30 11:42:04 +00:00
|
|
|
struct gsm_bts_trx *trx;
|
2020-12-02 02:57:23 +00:00
|
|
|
struct gsm_gprs_nsvc *nsvc;
|
2020-09-30 11:42:04 +00:00
|
|
|
|
2018-05-03 14:11:28 +00:00
|
|
|
switch (foh->obj_class) {
|
2020-09-30 10:52:04 +00:00
|
|
|
case NM_OC_SITE_MANAGER:
|
2020-12-01 16:25:28 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_OPSTART_ACK, NULL);
|
2020-09-30 10:52:04 +00:00
|
|
|
break;
|
2020-09-30 10:52:53 +00:00
|
|
|
case NM_OC_BTS:
|
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2020-09-30 12:43:09 +00:00
|
|
|
case NM_OC_RADIO_CARRIER:
|
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2020-09-30 11:42:04 +00:00
|
|
|
case NM_OC_BASEB_TRANSC:
|
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2018-05-03 14:11:28 +00:00
|
|
|
case NM_OC_CHANNEL:
|
2018-06-15 18:39:58 +00:00
|
|
|
nm_rx_opstart_ack_chan(oml_msg);
|
2018-05-03 14:11:28 +00:00
|
|
|
break;
|
2020-12-01 18:59:15 +00:00
|
|
|
case NM_OC_GPRS_NSE:
|
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2020-12-02 17:19:49 +00:00
|
|
|
case NM_OC_GPRS_CELL:
|
|
|
|
osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2020-12-02 02:57:23 +00:00
|
|
|
case NM_OC_GPRS_NSVC:
|
|
|
|
if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2018-05-03 14:11:28 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-30 10:52:04 +00:00
|
|
|
static void nm_rx_opstart_nack(struct msgb *oml_msg)
|
|
|
|
{
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
|
|
|
|
struct e1inp_sign_link *sign_link = oml_msg->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
2020-09-30 11:42:04 +00:00
|
|
|
struct gsm_bts_trx *trx;
|
2020-09-30 14:36:30 +00:00
|
|
|
struct gsm_bts_trx_ts *ts;
|
2020-12-02 02:57:23 +00:00
|
|
|
struct gsm_gprs_nsvc *nsvc;
|
2020-09-30 11:42:04 +00:00
|
|
|
|
2020-09-30 10:52:04 +00:00
|
|
|
switch (foh->obj_class) {
|
|
|
|
case NM_OC_SITE_MANAGER:
|
2020-12-01 16:25:28 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_OPSTART_NACK, NULL);
|
2020-09-30 10:52:04 +00:00
|
|
|
break;
|
2020-09-30 10:52:53 +00:00
|
|
|
case NM_OC_BTS:
|
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OPSTART_ACK, NULL);
|
|
|
|
break;
|
2020-09-30 12:43:09 +00:00
|
|
|
case NM_OC_RADIO_CARRIER:
|
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OPSTART_NACK, NULL);
|
|
|
|
break;
|
2020-09-30 11:42:04 +00:00
|
|
|
case NM_OC_BASEB_TRANSC:
|
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_OPSTART_NACK, NULL);
|
|
|
|
break;
|
2020-09-30 14:36:30 +00:00
|
|
|
case NM_OC_CHANNEL:
|
|
|
|
if (!(ts = abis_nm_get_ts(oml_msg)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_OPSTART_NACK, NULL);
|
|
|
|
break;
|
2020-12-01 18:59:15 +00:00
|
|
|
case NM_OC_GPRS_NSE:
|
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_OPSTART_NACK, NULL);
|
|
|
|
break;
|
2020-12-02 17:19:49 +00:00
|
|
|
case NM_OC_GPRS_CELL:
|
|
|
|
osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OPSTART_NACK, NULL);
|
|
|
|
break;
|
2020-12-02 02:57:23 +00:00
|
|
|
case NM_OC_GPRS_NSVC:
|
|
|
|
if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_OPSTART_NACK, NULL);
|
|
|
|
break;
|
2020-09-30 10:52:04 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-03 18:52:22 +00:00
|
|
|
static void nm_rx_get_attr_rep(struct msgb *oml_msg)
|
|
|
|
{
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
|
|
|
|
struct e1inp_sign_link *sign_link = oml_msg->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
|
|
|
struct gsm_bts_trx *trx;
|
|
|
|
|
|
|
|
switch (foh->obj_class) {
|
|
|
|
case NM_OC_BTS:
|
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_GET_ATTR_REP, NULL);
|
|
|
|
break;
|
|
|
|
case NM_OC_BASEB_TRANSC:
|
|
|
|
if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_GET_ATTR_REP, NULL);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
LOGPFOH(DNM, LOGL_ERROR, foh, "Get Attributes Response received on incorrect object class %d!\n", foh->obj_class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-30 10:52:53 +00:00
|
|
|
static void nm_rx_set_bts_attr_ack(struct msgb *oml_msg)
|
|
|
|
{
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
|
|
|
|
struct e1inp_sign_link *sign_link = oml_msg->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
|
|
|
|
|
|
|
if (foh->obj_class != NM_OC_BTS) {
|
|
|
|
LOG_BTS(bts, DNM, LOGL_ERROR, "Set BTS Attr Ack received on non BTS object!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_SET_ATTR_ACK, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-09-17 16:43:50 +00:00
|
|
|
static void nm_rx_set_radio_attr_ack(struct msgb *oml_msg)
|
|
|
|
{
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
|
|
|
|
struct e1inp_sign_link *sign_link = oml_msg->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
|
|
|
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
|
|
|
|
|
2020-09-30 12:43:09 +00:00
|
|
|
if (!trx || foh->obj_class != NM_OC_RADIO_CARRIER) {
|
2020-10-16 10:08:49 +00:00
|
|
|
LOGPFOH(DNM, LOGL_ERROR, foh, "Set Radio Carrier Attr Ack received on non Radio Carrier object!\n");
|
2020-09-17 16:43:50 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-09-30 12:43:09 +00:00
|
|
|
osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_SET_ATTR_ACK, NULL);
|
2020-09-17 16:43:50 +00:00
|
|
|
}
|
|
|
|
|
2020-09-30 14:36:30 +00:00
|
|
|
static void nm_rx_set_chan_attr_ack(struct msgb *oml_msg)
|
|
|
|
{
|
|
|
|
struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
|
|
|
|
struct gsm_bts_trx_ts *ts = abis_nm_get_ts(oml_msg);
|
|
|
|
|
|
|
|
if (!ts || foh->obj_class != NM_OC_CHANNEL) {
|
2020-10-16 10:08:49 +00:00
|
|
|
LOGPFOH(DNM, LOGL_ERROR, foh, "Set Channel Attr Ack received on non Radio Channel object!\n");
|
2020-09-30 14:36:30 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_SET_ATTR_ACK, NULL);
|
|
|
|
}
|
|
|
|
|
2020-12-01 18:59:15 +00:00
|
|
|
static void nm_rx_ipacc_set_attr_ack(struct msgb *oml_msg)
|
|
|
|
{
|
|
|
|
struct e1inp_sign_link *sign_link = oml_msg->dst;
|
|
|
|
struct gsm_bts *bts = sign_link->trx->bts;
|
|
|
|
struct abis_om_hdr *oh = msgb_l2(oml_msg);
|
|
|
|
uint8_t idstrlen = oh->data[0];
|
|
|
|
struct abis_om_fom_hdr *foh;
|
|
|
|
void *obj;
|
|
|
|
struct gsm_gprs_nse *nse;
|
2020-12-02 17:19:49 +00:00
|
|
|
struct gsm_gprs_cell *cell;
|
2020-12-02 02:57:23 +00:00
|
|
|
struct gsm_gprs_nsvc *nsvc;
|
2020-12-01 18:59:15 +00:00
|
|
|
|
|
|
|
foh = (struct abis_om_fom_hdr *) (oh->data + 1 + idstrlen);
|
|
|
|
obj = gsm_objclass2obj(bts, foh->obj_class, &foh->obj_inst);
|
|
|
|
|
|
|
|
switch (foh->obj_class) {
|
|
|
|
case NM_OC_GPRS_NSE:
|
|
|
|
nse = obj;
|
|
|
|
osmo_fsm_inst_dispatch(nse->mo.fi, NM_EV_SET_ATTR_ACK, NULL);
|
|
|
|
break;
|
2020-12-02 17:19:49 +00:00
|
|
|
case NM_OC_GPRS_CELL:
|
|
|
|
cell = obj;
|
|
|
|
osmo_fsm_inst_dispatch(cell->mo.fi, NM_EV_SET_ATTR_ACK, NULL);
|
|
|
|
break;
|
2020-12-02 02:57:23 +00:00
|
|
|
case NM_OC_GPRS_NSVC:
|
|
|
|
if (!(nsvc = gsm_bts_sm_nsvc_num(bts->site_mgr, foh->obj_inst.trx_nr)))
|
|
|
|
return;
|
|
|
|
osmo_fsm_inst_dispatch(nsvc->mo.fi, NM_EV_SET_ATTR_ACK, NULL);
|
|
|
|
break;
|
2020-12-01 18:59:15 +00:00
|
|
|
default:
|
|
|
|
LOGPFOH(DNM, LOGL_ERROR, foh, "IPACC Set Attr Ack received on incorrect object class %d!\n", foh->obj_class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-14 14:55:42 +00:00
|
|
|
/* Callback function to be called every time we receive a signal from NM */
|
2013-04-24 09:26:44 +00:00
|
|
|
static int bts_ipa_nm_sig_cb(unsigned int subsys, unsigned int signal,
|
2011-01-14 14:55:42 +00:00
|
|
|
void *handler_data, void *signal_data)
|
|
|
|
{
|
|
|
|
if (subsys != SS_NM)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
switch (signal) {
|
|
|
|
case S_NM_SW_ACTIV_REP:
|
|
|
|
return sw_activ_rep(signal_data);
|
2022-05-04 13:37:02 +00:00
|
|
|
case S_NM_STATECHG:
|
2011-01-14 14:55:42 +00:00
|
|
|
return nm_statechg_event(signal, signal_data);
|
2018-05-03 14:11:28 +00:00
|
|
|
case S_NM_OPSTART_ACK:
|
|
|
|
nm_rx_opstart_ack(signal_data);
|
|
|
|
return 0;
|
2020-09-30 10:52:04 +00:00
|
|
|
case S_NM_OPSTART_NACK:
|
|
|
|
nm_rx_opstart_nack(signal_data);
|
|
|
|
return 0;
|
2020-12-03 18:52:22 +00:00
|
|
|
case S_NM_GET_ATTR_REP:
|
|
|
|
nm_rx_get_attr_rep(signal_data);
|
|
|
|
return 0;
|
2020-09-30 10:52:53 +00:00
|
|
|
case S_NM_SET_BTS_ATTR_ACK:
|
|
|
|
nm_rx_set_bts_attr_ack(signal_data);
|
|
|
|
return 0;
|
2020-09-17 16:43:50 +00:00
|
|
|
case S_NM_SET_RADIO_ATTR_ACK:
|
|
|
|
nm_rx_set_radio_attr_ack(signal_data);
|
|
|
|
return 0;
|
2020-09-30 14:36:30 +00:00
|
|
|
case S_NM_SET_CHAN_ATTR_ACK:
|
|
|
|
nm_rx_set_chan_attr_ack(signal_data);
|
|
|
|
return 0;
|
2020-12-01 18:59:15 +00:00
|
|
|
case S_NM_IPACC_SET_ATTR_ACK:
|
|
|
|
nm_rx_ipacc_set_attr_ack(signal_data);
|
|
|
|
return 0;
|
2011-01-14 14:55:42 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
bsc: on-demand setup of nanoBTS and HSL femto sockets
The daemons set up nanoBTS and HSL femto sockets by default, ie. the
three sockets to support these two drivers are open even if we have
no BTS of that kind.
This patch enables on-demand socket creation, ie. we only enable them
if we have one BTS at least that requires it.
I added two new attributes to the gsm_bts object, they are:
* the start() function includes the code that we need to run to start
the BTS. This new function contains the socket creation in the
particular case of nanoBTS and HSL femto.
* the started boolean, which is used to know if we have already
started the BTS, ie. we have already invoked start().
Note that, I have splitted the bts_model_*_init() function into two
functions, the _init() functions that register the BTS driver
and the _start() functions that start BTS driver on-demand.
While I was at it, I added several changes/cleanups to this patch:
* Group all bts_model_*_init() calls into one function bts_init(),
which is called in the initialization path of osmo-nitb and
osmo-bsc.
* Add openbsc/bss.h that contains the declaration of
bsc_bootstrap_network, bsc_shutdown_net and bts_init.
* Add missing e1inp_init() in osmo-bsc.
* Fix missing declaration of hsl_setup in openbsc/e1_input.h
2011-05-14 09:32:48 +00:00
|
|
|
static int bts_model_nanobts_start(struct gsm_network *net)
|
2010-01-10 17:01:52 +00:00
|
|
|
{
|
2013-04-24 09:26:44 +00:00
|
|
|
osmo_signal_unregister_handler(SS_NM, bts_ipa_nm_sig_cb, NULL);
|
2012-07-02 17:51:55 +00:00
|
|
|
osmo_signal_register_handler(SS_NM, bts_ipa_nm_sig_cb, NULL);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
return 0;
|
bsc: on-demand setup of nanoBTS and HSL femto sockets
The daemons set up nanoBTS and HSL femto sockets by default, ie. the
three sockets to support these two drivers are open even if we have
no BTS of that kind.
This patch enables on-demand socket creation, ie. we only enable them
if we have one BTS at least that requires it.
I added two new attributes to the gsm_bts object, they are:
* the start() function includes the code that we need to run to start
the BTS. This new function contains the socket creation in the
particular case of nanoBTS and HSL femto.
* the started boolean, which is used to know if we have already
started the BTS, ie. we have already invoked start().
Note that, I have splitted the bts_model_*_init() function into two
functions, the _init() functions that register the BTS driver
and the _start() functions that start BTS driver on-demand.
While I was at it, I added several changes/cleanups to this patch:
* Group all bts_model_*_init() calls into one function bts_init(),
which is called in the initialization path of osmo-nitb and
osmo-bsc.
* Add openbsc/bss.h that contains the declaration of
bsc_bootstrap_network, bsc_shutdown_net and bts_init.
* Add missing e1inp_init() in osmo-bsc.
* Fix missing declaration of hsl_setup in openbsc/e1_input.h
2011-05-14 09:32:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int bts_model_nanobts_init(void)
|
|
|
|
{
|
2013-04-24 08:54:02 +00:00
|
|
|
bts_model_nanobts.features.data = &bts_model_nanobts._features_data[0];
|
|
|
|
bts_model_nanobts.features.data_len =
|
|
|
|
sizeof(bts_model_nanobts._features_data);
|
|
|
|
|
2018-02-21 12:24:36 +00:00
|
|
|
osmo_bts_set_feature(&bts_model_nanobts.features, BTS_FEAT_GPRS);
|
|
|
|
osmo_bts_set_feature(&bts_model_nanobts.features, BTS_FEAT_EGPRS);
|
|
|
|
osmo_bts_set_feature(&bts_model_nanobts.features, BTS_FEAT_MULTI_TSC);
|
2013-04-24 08:54:02 +00:00
|
|
|
|
2012-07-02 17:51:55 +00:00
|
|
|
return gsm_bts_model_register(&bts_model_nanobts);
|
2010-01-10 17:01:52 +00:00
|
|
|
}
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
|
|
|
#define OML_UP 0x0001
|
|
|
|
#define RSL_UP 0x0002
|
|
|
|
|
|
|
|
static struct gsm_bts *
|
|
|
|
find_bts_by_unitid(struct gsm_network *net, uint16_t site_id, uint16_t bts_id)
|
|
|
|
{
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
|
|
|
|
llist_for_each_entry(bts, &net->bts_list, list) {
|
|
|
|
if (!is_ipaccess_bts(bts))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (bts->ip_access.site_id == site_id &&
|
|
|
|
bts->ip_access.bts_id == bts_id)
|
|
|
|
return bts;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* These are exported because they are used by the VTY interface. */
|
2019-01-02 14:28:17 +00:00
|
|
|
void ipaccess_drop_rsl(struct gsm_bts_trx *trx, const char *reason)
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
{
|
2021-04-12 12:43:10 +00:00
|
|
|
if (!trx->rsl_link_primary)
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
return;
|
|
|
|
|
2019-06-13 14:37:24 +00:00
|
|
|
LOG_TRX(trx, DLINP, LOGL_NOTICE, "Dropping RSL link: %s\n", reason);
|
2021-04-12 12:43:10 +00:00
|
|
|
e1inp_sign_link_destroy(trx->rsl_link_primary);
|
|
|
|
trx->rsl_link_primary = NULL;
|
2021-06-04 15:30:21 +00:00
|
|
|
osmo_stat_item_dec(osmo_stat_item_group_get_item(trx->bts->bts_statg, BTS_STAT_RSL_CONNECTED), 1);
|
2018-04-19 12:31:11 +00:00
|
|
|
|
|
|
|
if (trx->bts->c0 == trx)
|
|
|
|
paging_flush_bts(trx->bts, NULL);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
}
|
|
|
|
|
2019-01-02 14:28:17 +00:00
|
|
|
void ipaccess_drop_oml(struct gsm_bts *bts, const char *reason)
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
{
|
2014-12-17 14:44:32 +00:00
|
|
|
struct gsm_bts *rdep_bts;
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
struct gsm_bts_trx *trx;
|
2020-09-30 14:36:30 +00:00
|
|
|
struct gsm_bts_trx_ts *ts ;
|
|
|
|
uint8_t tn;
|
2020-12-02 02:57:23 +00:00
|
|
|
uint8_t i;
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
2018-08-22 19:54:12 +00:00
|
|
|
/* First of all, remove deferred drop if enabled */
|
|
|
|
osmo_timer_del(&bts->oml_drop_link_timer);
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
if (!bts->oml_link)
|
|
|
|
return;
|
|
|
|
|
2019-06-13 14:37:24 +00:00
|
|
|
LOG_BTS(bts, DLINP, LOGL_NOTICE, "Dropping OML link: %s\n", reason);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
e1inp_sign_link_destroy(bts->oml_link);
|
|
|
|
bts->oml_link = NULL;
|
2017-09-21 14:15:32 +00:00
|
|
|
bts->uptime = 0;
|
2021-06-04 15:30:21 +00:00
|
|
|
osmo_stat_item_dec(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_OML_CONNECTED), 1);
|
2021-07-21 12:26:26 +00:00
|
|
|
gsm_bts_stats_reset(bts);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
2021-06-23 12:15:20 +00:00
|
|
|
/* Also drop the associated OSMO link */
|
|
|
|
e1inp_sign_link_destroy(bts->osmo_link);
|
|
|
|
bts->osmo_link = NULL;
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
/* we have issues reconnecting RSL, drop everything. */
|
2020-09-30 11:42:04 +00:00
|
|
|
llist_for_each_entry(trx, &bts->trx_list, list) {
|
2019-01-02 14:28:17 +00:00
|
|
|
ipaccess_drop_rsl(trx, "OML link drop");
|
2020-09-30 11:42:04 +00:00
|
|
|
osmo_fsm_inst_dispatch(trx->bb_transc.mo.fi, NM_EV_OML_DOWN, NULL);
|
2020-09-30 12:43:09 +00:00
|
|
|
osmo_fsm_inst_dispatch(trx->mo.fi, NM_EV_OML_DOWN, NULL);
|
2020-09-30 14:36:30 +00:00
|
|
|
for (tn = 0; tn < TRX_NR_TS; tn++) {
|
|
|
|
ts = &trx->ts[tn];
|
|
|
|
osmo_fsm_inst_dispatch(ts->mo.fi, NM_EV_OML_DOWN, NULL);
|
|
|
|
}
|
2020-09-30 11:42:04 +00:00
|
|
|
}
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
2022-05-04 15:35:22 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OML_DOWN, NULL);
|
|
|
|
osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, NM_EV_OML_DOWN, NULL);
|
|
|
|
|
2020-12-01 16:25:28 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->mo.fi, NM_EV_OML_DOWN, NULL);
|
2020-12-01 18:59:15 +00:00
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nse.mo.fi, NM_EV_OML_DOWN, NULL);
|
2020-12-02 02:57:23 +00:00
|
|
|
for (i = 0; i < ARRAY_SIZE(bts->site_mgr->gprs.nsvc); i++)
|
|
|
|
osmo_fsm_inst_dispatch(bts->site_mgr->gprs.nsvc[i].mo.fi, NM_EV_OML_DOWN, NULL);
|
|
|
|
|
large refactoring: use FSMs for lchans; add inter-BSC HO
Add FSMs:
- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.
Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.
- Add logging macros for each FSM type:
- LOG_TS()
- LOG_LCHAN()
- LOG_MGWEP(), LOG_CI()
- LOG_ASSIGNMENT()
- LOG_HO()
These log with the osmo_fsm_inst where present.
New style decision: logging without a final newline char is awkward,
especially for gsmtap logging and when other logs interleave LOGPC() calls;
we have various cases where the final \n goes missing, and also this invokes
the log category checking N times instead of once.
So I decided to make these macros *always* append a newline, but only if
there is no final newline yet. I hope that the compiler optimizes the
strlen() of the constant format strings away. Thus I can log with or without
typing "\n" and always get an \n termination anyway.
General:
- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
with dedicated FSM timeouts, states and events.
- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
These can be used (with some macro magic) to define a state's timeout once,
and not make mistakes for each osmo_fsm_inst_state_chg().
Details:
bsc_subscr_conn_fsm.c:
- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
mgw_endpoint_fsm.
- There is exactly one state for an ongoing Assignment, with all details
handled in conn->assignment.fi. The state relies on the assignment_fsm's
timeout.
- There is one state for an ongoing Handover; except for an incoming Handover
from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
are both established.
- move bssmap_add_lcls_status() to osmo_bsc_lcls.c
abis_rsl.c:
- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in
abis_rsl.c
- reduce some rsl functions to merely send a message, rename to "_tx_".
- rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function.
- move all timers and error/release handling away into various FSMs.
- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
lchan passed, but just mode,type that they require. Rename to
ipacc_speech_mode*() and ipacc_payload_type().
- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
message received during BSSMAP Handover Command.
- move various logging to LOG_LCHAN() in order to log with the lchan FSM instance.
One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging
from DRR to DRSL. It might actually make sense to combine those categories.
- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance.
- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's
correct).
- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during
inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS.
assignment_fsm.c:
- the Chan Mode Modify in case of re-using the same lchan is not implemented
yet, because this was also missing in the previous implementation (OS#3357).
osmo_bsc_api.c:
- simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to
lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv
twice, once by member assignment and then again with a memcpy.)
- During handover, we used to copy the MR config from the old lchan. Since we
may handover between FR and HR, rather set the MR Config anew every time, so
that FR rates are always available on FR lchans, and never on HR lchans.
Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore),
I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore)
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
2018-05-14 16:14:15 +00:00
|
|
|
gsm_bts_all_ts_dispatch(bts, TS_EV_OML_DOWN, NULL);
|
dyn TS: init only when both RSL and the Channel OM are established
Recent Icf6e25ff068e8a2600562d52726ead65e864ec02 changed the dyn_ts_init() hook
from bootstrap_rsl() to the Channel OPSTART ACK, but this is not sufficient.
Now RBS2k never calls dyn_ts_init(), and we may need to wait for RSL:
Dyn TS should actually be initialized only when *both* OML opstart and RSL link
are established. To that end, introduce a generalized API to query OML and RSL
status and to trigger a timeslot init at the appropriate time.
Add gsm_ts_check_init() to be called both when RSL and OML opstart are
established: trigger gsm_ts_init() only when both are given.
Add gsm_bts_trx_ts->initialized flag to mark whether initialization has already
taken place. Add gsm_bts_mark_all_ts_uninitialized() to conveniently clear this
flag for all TS in a BTS.
Add gsm_bts_model.oml_is_ts_ready() callback so that each BTS implementation
can return the OML status of a timeslot in its own OML implementation.
Actually, currently all BTS models that need this init mechanism store the TS'
OML status in ts->mo.nm_state. While we would in practice correctly init dyn TS
by just looking at ts->mo.nm_state, semantically, the decision whether the TS
is ready is up to the BTS models' specific OML implementations.
From bootstrap_rsl(), call gsm_ts_check_init(), in case the TS OML Opstart has
happened before RSL is established -- applies to all BTS models.
For all BTS models:
- call gsm_{bts,trx}_mark_all_ts_uninitialized() when OM is torn down, to make
sure the TS init mechanism will work a second time.
For all BTS models supporting dyn TS, i.e. osmo-bts, nanobts and RBS2k:
- implement oml_is_ts_ready().
- call gsm_ts_check_init() when a Channel OM is taken into operation.
Any BTS models that don't set oml_is_ts_ready() will see a ts init as soon as
RSL is bootstrapped (incidentally, the old dyn TS behavior before recent
Icf6e25ff068e8a2600562d52726ead65e864ec02).
This firstly fixes dyn TS for RBS2k by re-adding the initial switch to PDCH,
and furthermore does so only after both OML TS opstart and RSL are through.
This fixes the ttcn3-bsc-tests around dyn TS, since for the osmo-bts-virtual,
the RSL is established only after OML opstart on the TS, which was broken by
Icf6e25ff068e8a2600562d52726ead65e864ec02.
Nokia Site and Siemens BS11 practically do not require this init mechanism,
since all that happens there so far is dyn TS init, and these BTS models do not
support dyn TS of any kind. A future patch may add oml_is_ts_ready().
Related: OS#3205
Change-Id: I99f29d2ba079f6f4b77f0af12d9784588d2f56b3
2018-05-09 15:46:22 +00:00
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
bts->ip_access.flags = 0;
|
2014-12-17 14:44:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Go through the list and see if we are the depndency of a BTS
|
|
|
|
* and then drop the BTS. This can lead to some recursion but it
|
|
|
|
* should be fine in userspace.
|
|
|
|
* The oml_link is serving as recursion anchor for us and
|
|
|
|
* it is set to NULL some lines above.
|
|
|
|
*/
|
|
|
|
llist_for_each_entry(rdep_bts, &bts->network->bts_list, list) {
|
|
|
|
if (!bts_depend_is_depedency(rdep_bts, bts))
|
|
|
|
continue;
|
|
|
|
LOGP(DLINP, LOGL_NOTICE, "Dropping BTS(%u) due BTS(%u).\n",
|
|
|
|
rdep_bts->nr, bts->nr);
|
2019-01-02 14:28:17 +00:00
|
|
|
ipaccess_drop_oml(rdep_bts, "Dependency link drop");
|
2014-12-17 14:44:32 +00:00
|
|
|
}
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
}
|
|
|
|
|
2018-08-22 19:54:12 +00:00
|
|
|
/*! Callback for \ref ipaccess_drop_oml_deferred_cb.
|
|
|
|
*/
|
|
|
|
static void ipaccess_drop_oml_deferred_cb(void *data)
|
|
|
|
{
|
|
|
|
struct gsm_bts *bts = (struct gsm_bts *) data;
|
2019-01-02 14:28:17 +00:00
|
|
|
ipaccess_drop_oml(bts, "Deferred link drop");
|
2018-08-22 19:54:12 +00:00
|
|
|
}
|
|
|
|
/*! Deferr \ref ipacces_drop_oml through a timer to avoid dropping structures in
|
|
|
|
* current code context. This may be needed if we want to destroy the OML link
|
|
|
|
* while being called from a lower layer "struct osmo_fd" cb, were it is
|
|
|
|
* mandatory to return -EBADF if the osmo_fd has been destroyed. In case code
|
|
|
|
* destroying an OML link is called through an osmo_signal, it becomes
|
|
|
|
* impossible to return any value, thus deferring the destruction is required.
|
|
|
|
*/
|
|
|
|
void ipaccess_drop_oml_deferred(struct gsm_bts *bts)
|
|
|
|
{
|
|
|
|
if (!osmo_timer_pending(&bts->oml_drop_link_timer) && bts->oml_link) {
|
2019-06-13 14:37:24 +00:00
|
|
|
LOG_BTS(bts, DLINP, LOGL_NOTICE, "Deferring Drop of OML link.\n");
|
2018-08-22 19:54:12 +00:00
|
|
|
osmo_timer_setup(&bts->oml_drop_link_timer, ipaccess_drop_oml_deferred_cb, bts);
|
|
|
|
osmo_timer_schedule(&bts->oml_drop_link_timer, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-23 13:35:43 +00:00
|
|
|
/* Reject BTS because of an unknown unit ID */
|
|
|
|
static void ipaccess_sign_link_reject(const struct ipaccess_unit *dev, const struct e1inp_ts* ts)
|
|
|
|
{
|
|
|
|
uint16_t site_id = dev->site_id;
|
|
|
|
uint16_t bts_id = dev->bts_id;
|
|
|
|
uint16_t trx_id = dev->trx_id;
|
|
|
|
char ip[INET6_ADDRSTRLEN];
|
|
|
|
struct gsm_bts_rejected *entry = NULL;
|
|
|
|
struct gsm_bts_rejected *pos;
|
|
|
|
|
|
|
|
/* Write to log and increase counter */
|
|
|
|
LOGP(DLINP, LOGL_ERROR, "Unable to find BTS configuration for %u/%u/%u, disconnecting\n", site_id, bts_id,
|
|
|
|
trx_id);
|
2021-06-04 15:30:21 +00:00
|
|
|
rate_ctr_inc(rate_ctr_group_get_ctr(bsc_gsmnet->bsc_ctrs, BSC_CTR_UNKNOWN_UNIT_ID));
|
2018-10-23 13:35:43 +00:00
|
|
|
|
|
|
|
/* Get remote IP */
|
|
|
|
if (osmo_sock_get_remote_ip(ts->driver.ipaccess.fd.fd, ip, sizeof(ip)))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Rejected list: unlink existing entry */
|
|
|
|
llist_for_each_entry(pos, &bsc_gsmnet->bts_rejected, list) {
|
|
|
|
if (pos->site_id == site_id && pos->bts_id == bts_id && !strcmp(pos->ip, ip)) {
|
|
|
|
entry = pos;
|
|
|
|
llist_del(&entry->list);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate new entry */
|
|
|
|
if (!entry) {
|
|
|
|
entry = talloc_zero(tall_bsc_ctx, struct gsm_bts_rejected);
|
|
|
|
if (!entry)
|
|
|
|
return;
|
|
|
|
entry->site_id = site_id;
|
|
|
|
entry->bts_id = bts_id;
|
2018-10-31 09:29:51 +00:00
|
|
|
osmo_strlcpy(entry->ip, ip, sizeof(entry->ip));
|
2018-10-23 13:35:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Add to beginning with current timestamp */
|
|
|
|
llist_add(&entry->list, &bsc_gsmnet->bts_rejected);
|
|
|
|
entry->time = time(NULL);
|
|
|
|
|
|
|
|
/* Cut off last (oldest) element if we have too many */
|
|
|
|
if (llist_count(&bsc_gsmnet->bts_rejected) > 25) {
|
|
|
|
pos = llist_last_entry(&bsc_gsmnet->bts_rejected, struct gsm_bts_rejected, list);
|
|
|
|
llist_del(&pos->list);
|
|
|
|
talloc_free(pos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
/* This function is called once the OML/RSL link becomes up. */
|
|
|
|
static struct e1inp_sign_link *
|
|
|
|
ipaccess_sign_link_up(void *unit_data, struct e1inp_line *line,
|
|
|
|
enum e1inp_sign_type type)
|
|
|
|
{
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
struct ipaccess_unit *dev = unit_data;
|
|
|
|
struct e1inp_sign_link *sign_link = NULL;
|
2017-09-21 14:15:32 +00:00
|
|
|
struct timespec tp;
|
|
|
|
int rc;
|
2021-05-19 14:30:50 +00:00
|
|
|
struct e1inp_ts *sign_ts = e1inp_line_ipa_oml_ts(line);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
2013-04-24 09:36:15 +00:00
|
|
|
bts = find_bts_by_unitid(bsc_gsmnet, dev->site_id, dev->bts_id);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
if (!bts) {
|
2021-05-19 14:30:50 +00:00
|
|
|
ipaccess_sign_link_reject(dev, sign_ts);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2020-07-14 12:05:57 +00:00
|
|
|
DEBUGP(DLINP, "%s: Identified BTS %u/%u/%u\n", e1inp_signtype_name(type),
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
dev->site_id, dev->bts_id, dev->trx_id);
|
|
|
|
|
2021-11-09 15:21:34 +00:00
|
|
|
/* Check if this BTS has a valid configuration. If not we will drop it
|
|
|
|
* immediately. */
|
|
|
|
if (gsm_bts_check_cfg(bts) != 0) {
|
|
|
|
LOGP(DLINP, LOGL_NOTICE, "(bts=%u) BTS config invalid, dropping BTS!\n", bts->nr);
|
|
|
|
ipaccess_drop_oml_deferred(bts);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
switch(type) {
|
|
|
|
case E1INP_SIGN_OML:
|
|
|
|
/* remove old OML signal link for this BTS. */
|
2019-01-02 14:28:17 +00:00
|
|
|
ipaccess_drop_oml(bts, "new OML link");
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
2014-12-17 13:46:17 +00:00
|
|
|
if (!bts_depend_check(bts)) {
|
|
|
|
LOGP(DLINP, LOGL_NOTICE,
|
|
|
|
"Dependency not full-filled for %u/%u/%u\n",
|
|
|
|
dev->site_id, dev->bts_id, dev->trx_id);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
/* create new OML link. */
|
|
|
|
sign_link = bts->oml_link =
|
2021-05-19 14:30:50 +00:00
|
|
|
e1inp_sign_link_create(sign_ts,
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
E1INP_SIGN_OML, bts->c0,
|
|
|
|
bts->oml_tei, 0);
|
2021-05-19 14:33:06 +00:00
|
|
|
rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp);
|
2017-09-21 14:15:32 +00:00
|
|
|
bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need sub-second precision for uptime */
|
2018-03-26 11:02:33 +00:00
|
|
|
if (!(sign_link->trx->bts->ip_access.flags & OML_UP)) {
|
|
|
|
e1inp_event(sign_link->ts, S_L_INP_TEI_UP,
|
|
|
|
sign_link->tei, sign_link->sapi);
|
|
|
|
sign_link->trx->bts->ip_access.flags |= OML_UP;
|
|
|
|
}
|
2021-06-04 15:30:21 +00:00
|
|
|
osmo_stat_item_inc(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_OML_CONNECTED), 1);
|
2021-06-23 12:15:20 +00:00
|
|
|
|
|
|
|
/* Create link for E1INP_SIGN_OSMO */
|
|
|
|
//SAPI must be 0, no IPAC_PROTO_EXT_PCU, see ipaccess_bts_read_cb
|
|
|
|
bts->osmo_link = e1inp_sign_link_create(sign_ts, E1INP_SIGN_OSMO, bts->c0, IPAC_PROTO_OSMO, 0);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
break;
|
|
|
|
case E1INP_SIGN_RSL: {
|
|
|
|
struct e1inp_ts *ts;
|
|
|
|
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, dev->trx_id);
|
|
|
|
|
|
|
|
/* no OML link set yet? give up. */
|
2013-06-30 17:02:57 +00:00
|
|
|
if (!bts->oml_link || !trx)
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* remove old RSL link for this TRX. */
|
2019-01-02 14:28:17 +00:00
|
|
|
ipaccess_drop_rsl(trx, "new RSL link");
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
|
|
|
/* set new RSL link for this TRX. */
|
|
|
|
line = bts->oml_link->ts->line;
|
2021-05-19 14:30:50 +00:00
|
|
|
ts = e1inp_line_ipa_rsl_ts(line, dev->trx_id);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
e1inp_ts_config_sign(ts, line);
|
2021-04-12 12:43:10 +00:00
|
|
|
sign_link = trx->rsl_link_primary =
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
e1inp_sign_link_create(ts, E1INP_SIGN_RSL,
|
2021-04-12 12:43:10 +00:00
|
|
|
trx, trx->rsl_tei_primary, 0);
|
|
|
|
trx->rsl_link_primary->ts->sign.delay = 0;
|
2018-03-26 11:02:33 +00:00
|
|
|
if (!(sign_link->trx->bts->ip_access.flags &
|
|
|
|
(RSL_UP << sign_link->trx->nr))) {
|
|
|
|
e1inp_event(sign_link->ts, S_L_INP_TEI_UP,
|
|
|
|
sign_link->tei, sign_link->sapi);
|
|
|
|
sign_link->trx->bts->ip_access.flags |=
|
|
|
|
(RSL_UP << sign_link->trx->nr);
|
|
|
|
}
|
2021-06-04 15:30:21 +00:00
|
|
|
osmo_stat_item_inc(osmo_stat_item_group_get_item(bts->bts_statg, BTS_STAT_RSL_CONNECTED), 1);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return sign_link;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ipaccess_sign_link_down(struct e1inp_line *line)
|
|
|
|
{
|
|
|
|
/* No matter what link went down, we close both signal links. */
|
2021-05-19 14:30:50 +00:00
|
|
|
struct e1inp_ts *ts = e1inp_line_ipa_oml_ts(line);
|
2018-02-12 13:28:52 +00:00
|
|
|
struct gsm_bts *bts = NULL;
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
struct e1inp_sign_link *link;
|
|
|
|
|
2020-07-14 12:26:20 +00:00
|
|
|
LOGPIL(line, DLINP, LOGL_NOTICE, "Signalling link down\n");
|
|
|
|
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
llist_for_each_entry(link, &ts->sign.sign_links, list) {
|
2018-02-12 13:28:52 +00:00
|
|
|
/* Get bts pointer from the first element of the list. */
|
|
|
|
if (bts == NULL)
|
|
|
|
bts = link->trx->bts;
|
|
|
|
/* Cancel RSL connection timeout in case are still waiting for an RSL connection. */
|
|
|
|
if (link->trx->mo.nm_state.administrative == NM_STATE_UNLOCKED)
|
|
|
|
osmo_timer_del(&link->trx->rsl_connect_timeout);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
}
|
2018-02-12 13:28:52 +00:00
|
|
|
if (bts != NULL)
|
2019-01-02 14:28:17 +00:00
|
|
|
ipaccess_drop_oml(bts, "link down");
|
2020-07-14 12:26:20 +00:00
|
|
|
else
|
|
|
|
LOGPIL(line, DLINP, LOGL_NOTICE, "Signalling link down for unknown BTS\n");
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called if we receive one OML/RSL message. */
|
|
|
|
static int ipaccess_sign_link(struct msgb *msg)
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
struct e1inp_sign_link *link = msg->dst;
|
|
|
|
|
|
|
|
switch (link->type) {
|
|
|
|
case E1INP_SIGN_RSL:
|
|
|
|
ret = abis_rsl_rcvmsg(msg);
|
|
|
|
break;
|
|
|
|
case E1INP_SIGN_OML:
|
|
|
|
ret = abis_nm_rcvmsg(msg);
|
|
|
|
break;
|
2021-06-23 12:15:20 +00:00
|
|
|
case E1INP_SIGN_OSMO:
|
|
|
|
ret = abis_osmo_rcvmsg(msg);
|
|
|
|
break;
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
default:
|
|
|
|
LOGP(DLINP, LOGL_ERROR, "Unknown signal link type %d\n",
|
|
|
|
link->type);
|
|
|
|
msgb_free(msg);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* not static, ipaccess-config needs it. */
|
|
|
|
struct e1inp_line_ops ipaccess_e1inp_line_ops = {
|
|
|
|
.cfg = {
|
|
|
|
.ipa = {
|
|
|
|
.addr = "0.0.0.0",
|
|
|
|
.role = E1INP_LINE_R_BSC,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
.sign_link_up = ipaccess_sign_link_up,
|
|
|
|
.sign_link_down = ipaccess_sign_link_down,
|
|
|
|
.sign_link = ipaccess_sign_link,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void bts_model_nanobts_e1line_bind_ops(struct e1inp_line *line)
|
|
|
|
{
|
|
|
|
e1inp_line_bind_ops(line, &ipaccess_e1inp_line_ops);
|
|
|
|
}
|
2020-12-16 22:38:30 +00:00
|
|
|
|
|
|
|
static void enc_meas_proc_params(struct msgb *msg, uint8_t ptype,
|
|
|
|
const struct gsm_power_ctrl_meas_params *mp)
|
|
|
|
{
|
|
|
|
struct ipac_preproc_ave_cfg *ave_cfg;
|
|
|
|
uint8_t *ie_len;
|
|
|
|
|
|
|
|
/* No averaging => no Measurement Averaging parameters */
|
|
|
|
if (mp->algo == GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* (TLV) Measurement Averaging parameters for RxLev/RxQual */
|
|
|
|
ie_len = msgb_tl_put(msg, RSL_IPAC_EIE_MEAS_AVG_CFG);
|
|
|
|
|
|
|
|
ave_cfg = (struct ipac_preproc_ave_cfg *) msgb_put(msg, sizeof(*ave_cfg));
|
|
|
|
ave_cfg->param_id = ptype & 0x03;
|
|
|
|
|
|
|
|
/* H_REQAVE and H_REQT */
|
2020-12-25 16:14:47 +00:00
|
|
|
ave_cfg->h_reqave = mp->h_reqave & 0x1f;
|
|
|
|
ave_cfg->h_reqt = mp->h_reqt & 0x1f;
|
2020-12-16 22:38:30 +00:00
|
|
|
|
|
|
|
/* Averaging method and parameters */
|
|
|
|
ave_cfg->ave_method = (mp->algo - 1) & 0x07;
|
|
|
|
switch (mp->algo) {
|
|
|
|
case GSM_PWR_CTRL_MEAS_AVG_ALGO_OSMO_EWMA:
|
|
|
|
msgb_v_put(msg, mp->ewma.alpha);
|
|
|
|
break;
|
|
|
|
case GSM_PWR_CTRL_MEAS_AVG_ALGO_WEIGHTED:
|
|
|
|
case GSM_PWR_CTRL_MEAS_AVG_ALGO_MOD_MEDIAN:
|
|
|
|
/* FIXME: unknown format */
|
|
|
|
break;
|
|
|
|
case GSM_PWR_CTRL_MEAS_AVG_ALGO_UNWEIGHTED:
|
|
|
|
case GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE:
|
|
|
|
/* No parameters here */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Update length part of the containing IE */
|
|
|
|
*ie_len = msg->tail - (ie_len + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void enc_power_params(struct msgb *msg, const struct gsm_power_ctrl_params *cp)
|
|
|
|
{
|
|
|
|
struct ipac_preproc_pc_comp *thresh_comp;
|
|
|
|
struct ipac_preproc_pc_thresh *thresh;
|
|
|
|
|
|
|
|
/* These parameters are valid for dynamic mode only */
|
|
|
|
OSMO_ASSERT(cp->mode == GSM_PWR_CTRL_MODE_DYN_BTS);
|
|
|
|
|
|
|
|
/* (TLV) Measurement Averaging Configure */
|
|
|
|
enc_meas_proc_params(msg, IPAC_RXQUAL_AVE, &cp->rxqual_meas);
|
|
|
|
enc_meas_proc_params(msg, IPAC_RXLEV_AVE, &cp->rxlev_meas);
|
|
|
|
|
|
|
|
/* (TV) Thresholds: {L,U}_RXLEV_XX_P and {L,U}_RXQUAL_XX_P */
|
|
|
|
if (cp->dir == GSM_PWR_CTRL_DIR_UL)
|
|
|
|
msgb_v_put(msg, RSL_IPAC_EIE_MS_PWR_CTL);
|
|
|
|
else
|
|
|
|
msgb_v_put(msg, RSL_IPAC_EIE_BS_PWR_CTL);
|
|
|
|
|
|
|
|
thresh = (struct ipac_preproc_pc_thresh *) msgb_put(msg, sizeof(*thresh));
|
|
|
|
|
|
|
|
/* {L,U}_RXLEV_XX_P (see 3GPP TS 45.008, A.3.2.1, a & b) */
|
|
|
|
thresh->l_rxlev = cp->rxlev_meas.lower_thresh & 0x3f;
|
|
|
|
thresh->u_rxlev = cp->rxlev_meas.upper_thresh & 0x3f;
|
|
|
|
|
|
|
|
/* {L,U}_RXQUAL_XX_P (see 3GPP TS 45.008, A.3.2.1, c & d) */
|
|
|
|
thresh->l_rxqual = cp->rxqual_meas.lower_thresh & 0x07;
|
|
|
|
thresh->u_rxqual = cp->rxqual_meas.upper_thresh & 0x07;
|
|
|
|
|
|
|
|
/* (TV) PC Threshold Comparators */
|
|
|
|
msgb_v_put(msg, RSL_IPAC_EIE_PC_THRESH_COMP);
|
|
|
|
|
|
|
|
thresh_comp = (struct ipac_preproc_pc_comp *) msgb_put(msg, sizeof(*thresh_comp));
|
|
|
|
|
|
|
|
/* RxLev: P1, N1, P2, N2 (see 3GPP TS 45.008, A.3.2.1, a & b) */
|
|
|
|
thresh_comp->p1 = cp->rxlev_meas.lower_cmp_p & 0x1f;
|
|
|
|
thresh_comp->n1 = cp->rxlev_meas.lower_cmp_n & 0x1f;
|
|
|
|
thresh_comp->p2 = cp->rxlev_meas.upper_cmp_p & 0x1f;
|
|
|
|
thresh_comp->n2 = cp->rxlev_meas.upper_cmp_n & 0x1f;
|
|
|
|
|
|
|
|
/* RxQual: P3, N3, P4, N4 (see 3GPP TS 45.008, A.3.2.1, c & d) */
|
|
|
|
thresh_comp->p3 = cp->rxqual_meas.lower_cmp_p & 0x1f;
|
|
|
|
thresh_comp->n3 = cp->rxqual_meas.lower_cmp_n & 0x1f;
|
|
|
|
thresh_comp->p4 = cp->rxqual_meas.upper_cmp_p & 0x1f;
|
|
|
|
thresh_comp->n4 = cp->rxqual_meas.upper_cmp_n & 0x1f;
|
|
|
|
|
2021-02-07 05:00:46 +00:00
|
|
|
/* Minimum interval between power level changes (P_CON_INTERVAL) */
|
|
|
|
thresh_comp->pc_interval = cp->ctrl_interval;
|
2020-12-16 22:38:30 +00:00
|
|
|
|
|
|
|
/* Change step limitations: POWER_{INC,RED}_STEP_SIZE */
|
|
|
|
thresh_comp->inc_step_size = cp->inc_step_size_db & 0x0f;
|
|
|
|
thresh_comp->red_step_size = cp->red_step_size_db & 0x0f;
|
|
|
|
}
|
|
|
|
|
2021-08-26 13:41:17 +00:00
|
|
|
void osmobts_enc_power_params_osmo_ext(struct msgb *msg, const struct gsm_power_ctrl_params *cp);
|
2020-12-16 22:38:30 +00:00
|
|
|
static void add_power_params_ie(struct msgb *msg, enum abis_rsl_ie iei,
|
2021-08-26 13:41:17 +00:00
|
|
|
const struct gsm_bts_trx *trx,
|
2020-12-16 22:38:30 +00:00
|
|
|
const struct gsm_power_ctrl_params *cp)
|
|
|
|
{
|
|
|
|
uint8_t *ie_len = msgb_tl_put(msg, iei);
|
|
|
|
uint8_t msg_len = msgb_length(msg);
|
|
|
|
|
|
|
|
enc_power_params(msg, cp);
|
2021-08-26 13:41:17 +00:00
|
|
|
if (iei == RSL_IE_MS_POWER_PARAM && is_osmobts(trx->bts))
|
|
|
|
osmobts_enc_power_params_osmo_ext(msg, cp);
|
2020-12-16 22:38:30 +00:00
|
|
|
|
|
|
|
*ie_len = msgb_length(msg) - msg_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int power_ctrl_send_def_params(const struct gsm_bts_trx *trx)
|
|
|
|
{
|
|
|
|
const struct gsm_power_ctrl_params *ms_power_ctrl = &trx->bts->ms_power_ctrl;
|
|
|
|
const struct gsm_power_ctrl_params *bs_power_ctrl = &trx->bts->bs_power_ctrl;
|
|
|
|
struct abis_rsl_common_hdr *ch;
|
|
|
|
struct msgb *msg;
|
|
|
|
|
|
|
|
/* Sending this message does not make sense if neither MS Power control
|
|
|
|
* nor BS Power control is to be performed by the BTS itself ('dyn-bts'). */
|
|
|
|
if (ms_power_ctrl->mode != GSM_PWR_CTRL_MODE_DYN_BTS &&
|
|
|
|
bs_power_ctrl->mode != GSM_PWR_CTRL_MODE_DYN_BTS)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
msg = rsl_msgb_alloc();
|
|
|
|
if (msg == NULL)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
ch = (struct abis_rsl_common_hdr *) msgb_put(msg, sizeof(*ch));
|
|
|
|
ch->msg_discr = ABIS_RSL_MDISC_TRX;
|
|
|
|
ch->msg_type = RSL_MT_IPAC_MEAS_PREPROC_DFT;
|
|
|
|
|
|
|
|
/* BS/MS Power IEs (to be re-defined in channel specific messages) */
|
|
|
|
msgb_tv_put(msg, RSL_IE_MS_POWER, 0); /* dummy value */
|
|
|
|
msgb_tv_put(msg, RSL_IE_BS_POWER, 0); /* dummy value */
|
|
|
|
|
|
|
|
/* MS/BS Power Parameters IEs */
|
|
|
|
if (ms_power_ctrl->mode == GSM_PWR_CTRL_MODE_DYN_BTS)
|
2021-08-26 13:41:17 +00:00
|
|
|
add_power_params_ie(msg, RSL_IE_MS_POWER_PARAM, trx, ms_power_ctrl);
|
2020-12-16 22:38:30 +00:00
|
|
|
if (bs_power_ctrl->mode == GSM_PWR_CTRL_MODE_DYN_BTS)
|
2021-08-26 13:41:17 +00:00
|
|
|
add_power_params_ie(msg, RSL_IE_BS_POWER_PARAM, trx, bs_power_ctrl);
|
2020-12-16 22:38:30 +00:00
|
|
|
|
2021-04-12 12:43:10 +00:00
|
|
|
msg->dst = trx->rsl_link_primary;
|
2020-12-16 22:38:30 +00:00
|
|
|
|
|
|
|
return abis_rsl_sendmsg(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int power_ctrl_enc_rsl_params(struct msgb *msg, const struct gsm_power_ctrl_params *cp)
|
|
|
|
{
|
|
|
|
/* We send everything in "Measurement Pre-processing Defaults" */
|
|
|
|
return 0;
|
|
|
|
}
|