2010-01-10 17:01:52 +00:00
|
|
|
/* ip.access nanoBTS specific code */
|
|
|
|
|
|
|
|
/* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org>
|
|
|
|
*
|
|
|
|
* 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>
|
|
|
|
#include <osmocom/core/talloc.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>
|
|
|
|
#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>
|
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
|
|
|
|
2013-04-24 09:36:15 +00:00
|
|
|
extern struct gsm_network *bsc_gsmnet;
|
|
|
|
|
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
|
|
|
|
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,
|
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
|
|
|
.e1line_bind_ops = bts_model_nanobts_e1line_bind_ops,
|
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 },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
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;
|
|
|
|
struct gsm_nm_state *new_state = nsd->new_state;
|
|
|
|
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
struct gsm_bts_trx *trx;
|
|
|
|
struct gsm_bts_trx_ts *ts;
|
|
|
|
struct gsm_bts_gprs_nsvc *nsvc;
|
|
|
|
|
2016-09-29 15:01:57 +00:00
|
|
|
struct msgb *msgb;
|
2013-08-29 16:29:46 +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
|
|
|
/* This event-driven BTS setup is currently only required on nanoBTS */
|
|
|
|
|
|
|
|
/* S_NM_STATECHG_ADM is called after we call chg_adm_state() and would create
|
|
|
|
* endless loop */
|
|
|
|
if (evt != S_NM_STATECHG_OPER)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
switch (obj_class) {
|
|
|
|
case NM_OC_SITE_MANAGER:
|
|
|
|
bts = container_of(obj, struct gsm_bts, site_mgr);
|
|
|
|
if ((new_state->operational == NM_OPSTATE_ENABLED &&
|
|
|
|
new_state->availability == NM_AVSTATE_OK) ||
|
|
|
|
(new_state->operational == NM_OPSTATE_DISABLED &&
|
|
|
|
new_state->availability == NM_AVSTATE_OFF_LINE))
|
|
|
|
abis_nm_opstart(bts, obj_class, 0xff, 0xff, 0xff);
|
|
|
|
break;
|
|
|
|
case NM_OC_BTS:
|
|
|
|
bts = obj;
|
|
|
|
if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
|
2016-09-29 15:01:57 +00:00
|
|
|
msgb = nanobts_attr_bts_get(bts);
|
|
|
|
abis_nm_set_bts_attr(bts, msgb->data, msgb->len);
|
|
|
|
msgb_free(msgb);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_chg_adm_state(bts, obj_class,
|
|
|
|
bts->bts_nr, 0xff, 0xff,
|
|
|
|
NM_STATE_UNLOCKED);
|
|
|
|
abis_nm_opstart(bts, obj_class,
|
|
|
|
bts->bts_nr, 0xff, 0xff);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NM_OC_CHANNEL:
|
|
|
|
ts = obj;
|
|
|
|
trx = ts->trx;
|
|
|
|
if (new_state->operational == NM_OPSTATE_DISABLED &&
|
|
|
|
new_state->availability == NM_AVSTATE_DEPENDENCY) {
|
|
|
|
enum abis_nm_chan_comb ccomb =
|
|
|
|
abis_nm_chcomb4pchan(ts->pchan);
|
2014-11-07 08:54:57 +00:00
|
|
|
if (abis_nm_set_channel_attr(ts, ccomb) == -EINVAL) {
|
|
|
|
ipaccess_drop_oml(trx->bts);
|
|
|
|
return -1;
|
|
|
|
}
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_chg_adm_state(trx->bts, obj_class,
|
|
|
|
trx->bts->bts_nr, trx->nr, ts->nr,
|
|
|
|
NM_STATE_UNLOCKED);
|
|
|
|
abis_nm_opstart(trx->bts, obj_class,
|
|
|
|
trx->bts->bts_nr, trx->nr, ts->nr);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NM_OC_RADIO_CARRIER:
|
|
|
|
trx = obj;
|
|
|
|
if (new_state->operational == NM_OPSTATE_DISABLED &&
|
|
|
|
new_state->availability == NM_AVSTATE_OK)
|
|
|
|
abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr,
|
|
|
|
trx->nr, 0xff);
|
|
|
|
break;
|
|
|
|
case NM_OC_GPRS_NSE:
|
|
|
|
bts = container_of(obj, struct gsm_bts, gprs.nse);
|
|
|
|
if (bts->gprs.mode == BTS_GPRS_NONE)
|
|
|
|
break;
|
|
|
|
if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
|
2016-09-29 15:01:57 +00:00
|
|
|
msgb = nanobts_attr_nse_get(bts);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr,
|
2016-09-29 15:01:57 +00:00
|
|
|
0xff, 0xff, msgb->data,
|
|
|
|
msgb->len);
|
|
|
|
msgb_free(msgb);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_opstart(bts, obj_class, bts->bts_nr,
|
|
|
|
0xff, 0xff);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NM_OC_GPRS_CELL:
|
|
|
|
bts = container_of(obj, struct gsm_bts, gprs.cell);
|
|
|
|
if (bts->gprs.mode == BTS_GPRS_NONE)
|
|
|
|
break;
|
|
|
|
if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
|
2016-09-29 15:01:57 +00:00
|
|
|
msgb = nanobts_attr_cell_get(bts);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr,
|
2016-09-29 15:01:57 +00:00
|
|
|
0, 0xff, msgb->data,
|
|
|
|
msgb->len);
|
|
|
|
msgb_free(msgb);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_opstart(bts, obj_class, bts->bts_nr,
|
|
|
|
0, 0xff);
|
|
|
|
abis_nm_chg_adm_state(bts, obj_class, bts->bts_nr,
|
|
|
|
0, 0xff, NM_STATE_UNLOCKED);
|
|
|
|
abis_nm_chg_adm_state(bts, NM_OC_GPRS_NSE, bts->bts_nr,
|
|
|
|
0xff, 0xff, NM_STATE_UNLOCKED);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NM_OC_GPRS_NSVC:
|
|
|
|
nsvc = obj;
|
|
|
|
bts = nsvc->bts;
|
|
|
|
if (bts->gprs.mode == BTS_GPRS_NONE)
|
|
|
|
break;
|
|
|
|
/* We skip NSVC1 since we only use NSVC0 */
|
|
|
|
if (nsvc->id == 1)
|
|
|
|
break;
|
2011-10-17 11:57:58 +00:00
|
|
|
if ((new_state->availability == NM_AVSTATE_OFF_LINE) ||
|
|
|
|
(new_state->availability == NM_AVSTATE_DEPENDENCY)) {
|
2016-09-29 15:01:57 +00:00
|
|
|
msgb = nanobts_attr_nscv_get(bts);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr,
|
|
|
|
nsvc->id, 0xff,
|
2016-09-29 15:01:57 +00:00
|
|
|
msgb->data, msgb->len);
|
|
|
|
msgb_free(msgb);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_opstart(bts, obj_class, bts->bts_nr,
|
|
|
|
nsvc->id, 0xff);
|
|
|
|
abis_nm_chg_adm_state(bts, obj_class, bts->bts_nr,
|
|
|
|
nsvc->id, 0xff,
|
|
|
|
NM_STATE_UNLOCKED);
|
|
|
|
}
|
|
|
|
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;
|
2011-01-14 14:55:42 +00:00
|
|
|
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
|
|
|
|
|
|
|
|
if (!trx)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2013-04-24 09:33:13 +00:00
|
|
|
if (!is_ipaccess_bts(trx->bts))
|
2011-01-14 14:55:42 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
switch (foh->obj_class) {
|
|
|
|
case NM_OC_BASEB_TRANSC:
|
|
|
|
abis_nm_chg_adm_state(trx->bts, foh->obj_class,
|
|
|
|
trx->bts->bts_nr, trx->nr, 0xff,
|
|
|
|
NM_STATE_UNLOCKED);
|
|
|
|
abis_nm_opstart(trx->bts, foh->obj_class,
|
|
|
|
trx->bts->bts_nr, trx->nr, 0xff);
|
|
|
|
/* TRX software is active, tell it to initiate RSL Link */
|
2013-03-12 12:57:05 +00:00
|
|
|
abis_nm_ipaccess_rsl_connect(trx, trx->bts->ip_access.rsl_ip,
|
|
|
|
3003, trx->rsl_tei);
|
2011-01-14 14:55:42 +00:00
|
|
|
break;
|
|
|
|
case NM_OC_RADIO_CARRIER: {
|
|
|
|
/*
|
|
|
|
* Locking the radio carrier will make it go
|
|
|
|
* offline again and we would come here. The
|
|
|
|
* framework should determine that there was
|
|
|
|
* no change and avoid recursion.
|
|
|
|
*
|
|
|
|
* This code is here to make sure that on start
|
|
|
|
* a TRX remains locked.
|
|
|
|
*/
|
2011-05-30 10:07:53 +00:00
|
|
|
int rc_state = trx->mo.nm_state.administrative;
|
2011-01-14 14:55:42 +00:00
|
|
|
/* Patch ARFCN into radio attribute */
|
2016-09-29 15:01:57 +00:00
|
|
|
struct msgb *msgb = nanobts_attr_radio_get(trx->bts, trx);
|
|
|
|
abis_nm_set_radio_attr(trx, msgb->data, msgb->len);
|
|
|
|
msgb_free(msgb);
|
2011-01-14 14:55:42 +00:00
|
|
|
abis_nm_chg_adm_state(trx->bts, foh->obj_class,
|
|
|
|
trx->bts->bts_nr, trx->nr, 0xff,
|
|
|
|
rc_state);
|
|
|
|
abis_nm_opstart(trx->bts, foh->obj_class, trx->bts->bts_nr,
|
|
|
|
trx->nr, 0xff);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
case S_NM_STATECHG_OPER:
|
|
|
|
case S_NM_STATECHG_ADM:
|
|
|
|
return nm_statechg_event(signal, signal_data);
|
|
|
|
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. */
|
|
|
|
void ipaccess_drop_rsl(struct gsm_bts_trx *trx)
|
|
|
|
{
|
|
|
|
if (!trx->rsl_link)
|
|
|
|
return;
|
|
|
|
|
|
|
|
e1inp_sign_link_destroy(trx->rsl_link);
|
|
|
|
trx->rsl_link = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ipaccess_drop_oml(struct gsm_bts *bts)
|
|
|
|
{
|
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;
|
|
|
|
|
|
|
|
if (!bts->oml_link)
|
|
|
|
return;
|
|
|
|
|
|
|
|
e1inp_sign_link_destroy(bts->oml_link);
|
|
|
|
bts->oml_link = NULL;
|
2017-09-21 14:15:32 +00:00
|
|
|
bts->uptime = 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
|
|
|
|
|
|
|
/* we have issues reconnecting RSL, drop everything. */
|
|
|
|
llist_for_each_entry(trx, &bts->trx_list, list)
|
|
|
|
ipaccess_drop_rsl(trx);
|
|
|
|
|
|
|
|
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);
|
|
|
|
ipaccess_drop_oml(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
|
|
|
}
|
|
|
|
|
|
|
|
/* 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;
|
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) {
|
|
|
|
LOGP(DLINP, LOGL_ERROR, "Unable to find BTS configuration for "
|
|
|
|
" %u/%u/%u, disconnecting\n", dev->site_id,
|
|
|
|
dev->bts_id, dev->trx_id);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
DEBUGP(DLINP, "Identified BTS %u/%u/%u\n",
|
|
|
|
dev->site_id, dev->bts_id, dev->trx_id);
|
|
|
|
|
|
|
|
switch(type) {
|
|
|
|
case E1INP_SIGN_OML:
|
|
|
|
/* remove old OML signal link for this BTS. */
|
|
|
|
ipaccess_drop_oml(bts);
|
|
|
|
|
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 =
|
|
|
|
e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML - 1],
|
|
|
|
E1INP_SIGN_OML, bts->c0,
|
|
|
|
bts->oml_tei, 0);
|
2017-09-21 14:15:32 +00:00
|
|
|
rc = clock_gettime(CLOCK_MONOTONIC, &tp);
|
|
|
|
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;
|
|
|
|
}
|
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. */
|
|
|
|
ipaccess_drop_rsl(trx);
|
|
|
|
|
|
|
|
/* set new RSL link for this TRX. */
|
|
|
|
line = bts->oml_link->ts->line;
|
|
|
|
ts = &line->ts[E1INP_SIGN_RSL + dev->trx_id - 1];
|
|
|
|
e1inp_ts_config_sign(ts, line);
|
|
|
|
sign_link = trx->rsl_link =
|
|
|
|
e1inp_sign_link_create(ts, E1INP_SIGN_RSL,
|
|
|
|
trx, trx->rsl_tei, 0);
|
|
|
|
trx->rsl_link->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);
|
|
|
|
}
|
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. */
|
|
|
|
struct e1inp_ts *ts = &line->ts[E1INP_SIGN_OML-1];
|
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;
|
|
|
|
|
|
|
|
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)
|
|
|
|
ipaccess_drop_oml(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
|
|
|
}
|
|
|
|
|
|
|
|
/* 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;
|
|
|
|
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);
|
|
|
|
}
|