2009-02-14 22:51:00 +00:00
|
|
|
/* Generic signalling/notification infrastructure */
|
2010-07-13 18:08:35 +00:00
|
|
|
/* (C) 2009-2010 by Holger Hans Peter Freyther <zecke@selfish.org>
|
2009-02-16 22:05:44 +00:00
|
|
|
* (C) 2009 by Harald Welte <laforge@gnumonks.org>
|
2010-09-15 18:30:36 +00:00
|
|
|
* (C) 2010 by On-Waves
|
2009-02-14 22:51:00 +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
|
2009-02-14 22:51:00 +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.
|
2009-02-14 22:51:00 +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/>.
|
2009-02-14 22:51:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPENBSC_SIGNAL_H
|
|
|
|
#define OPENBSC_SIGNAL_H
|
|
|
|
|
2009-02-16 22:05:44 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2009-02-14 22:51:00 +00:00
|
|
|
#include <openbsc/gsm_data.h>
|
|
|
|
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/core/signal.h>
|
2009-02-14 22:51:00 +00:00
|
|
|
|
|
|
|
/*
|
2009-02-16 22:05:44 +00:00
|
|
|
* Signalling subsystems
|
2009-02-14 22:51:00 +00:00
|
|
|
*/
|
2009-02-17 14:35:45 +00:00
|
|
|
enum signal_subsystems {
|
|
|
|
SS_PAGING,
|
|
|
|
SS_SMS,
|
|
|
|
SS_ABISIP,
|
2009-05-01 15:39:49 +00:00
|
|
|
SS_NM,
|
2009-06-06 13:54:35 +00:00
|
|
|
SS_LCHAN,
|
2009-07-29 21:14:15 +00:00
|
|
|
SS_SUBSCR,
|
2009-11-14 09:08:40 +00:00
|
|
|
SS_SCALL,
|
2010-03-28 07:58:03 +00:00
|
|
|
SS_CHALLOC,
|
2010-03-05 18:36:20 +00:00
|
|
|
SS_IPAC_NWL,
|
2010-07-28 18:27:27 +00:00
|
|
|
SS_RF,
|
2010-09-15 18:30:36 +00:00
|
|
|
SS_MSC,
|
2011-01-06 12:31:41 +00:00
|
|
|
SS_HO,
|
2012-02-03 19:26:25 +00:00
|
|
|
SS_CCCH,
|
2009-02-17 14:35:45 +00:00
|
|
|
};
|
2009-02-14 22:51:00 +00:00
|
|
|
|
2009-02-16 22:05:44 +00:00
|
|
|
/* SS_PAGING signals */
|
|
|
|
enum signal_paging {
|
2009-12-19 11:38:10 +00:00
|
|
|
S_PAGING_SUCCEEDED,
|
|
|
|
S_PAGING_EXPIRED,
|
2009-02-14 22:51:00 +00:00
|
|
|
};
|
|
|
|
|
2009-08-08 14:03:15 +00:00
|
|
|
/* SS_SMS signals */
|
|
|
|
enum signal_sms {
|
|
|
|
S_SMS_SUBMITTED, /* A SMS has been successfully submitted to us */
|
|
|
|
S_SMS_DELIVERED, /* A SMS has been successfully delivered to a MS */
|
|
|
|
S_SMS_SMMA, /* A MS tells us it has more space available */
|
2009-08-09 12:59:02 +00:00
|
|
|
S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */
|
2010-12-24 08:47:04 +00:00
|
|
|
S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */
|
2009-08-08 14:03:15 +00:00
|
|
|
};
|
|
|
|
|
2009-02-17 14:35:45 +00:00
|
|
|
/* SS_ABISIP signals */
|
|
|
|
enum signal_abisip {
|
2009-11-18 20:06:12 +00:00
|
|
|
S_ABISIP_CRCX_ACK,
|
2009-12-19 15:42:06 +00:00
|
|
|
S_ABISIP_MDCX_ACK,
|
2009-11-18 20:06:12 +00:00
|
|
|
S_ABISIP_DLCX_IND,
|
2009-02-17 14:35:45 +00:00
|
|
|
};
|
|
|
|
|
2009-05-01 15:39:49 +00:00
|
|
|
/* SS_NM signals */
|
|
|
|
enum signal_nm {
|
|
|
|
S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */
|
|
|
|
S_NM_FAIL_REP, /* GSM 12.21 failure event report */
|
2009-06-10 08:48:14 +00:00
|
|
|
S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */
|
2009-07-07 10:40:07 +00:00
|
|
|
S_NM_IPACC_NACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_NACK happened */
|
2009-12-29 10:26:38 +00:00
|
|
|
S_NM_IPACC_ACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_ACK happened */
|
2009-12-30 08:00:01 +00:00
|
|
|
S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */
|
|
|
|
S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */
|
implement nanoBTS frequency error test
This helps us to detect the frequency error of BS-11 if it is located
next to the nanoBTS 900.
If 'ipaccess-config -l' is called, it will produce a report like
<0020> ipaccess-config.c:85 TEST REPORT: test_no=0x42 test_res=0
<0020> ipaccess-config.c:108 ==> ARFCN 220, Frequency Error 22
<0020> ipaccess-config.c:108 ==> ARFCN 1, Frequency Error -37
<0020> ipaccess-config.c:108 ==> ARFCN 10, Frequency Error 0
<0020> ipaccess-config.c:108 ==> ARFCN 20, Frequency Error 11
<0020> ipaccess-config.c:108 ==> ARFCN 53, Frequency Error 5
<0020> ipaccess-config.c:108 ==> ARFCN 63, Frequency Error -4
<0020> ipaccess-config.c:108 ==> ARFCN 84, Frequency Error 11
<0020> ipaccess-config.c:108 ==> ARFCN 101, Frequency Error 0
<0020> ipaccess-config.c:108 ==> ARFCN 123, Frequency Error -52
where in this case the ARFCN 123 is the BS-11 with a frequency error
larger than all the other (regular) BTS in the vicinity.
2009-08-07 22:02:36 +00:00
|
|
|
S_NM_TEST_REP, /* GSM 12.21 Test Report */
|
2011-01-14 14:55:42 +00:00
|
|
|
S_NM_STATECHG_OPER, /* Operational State changed*/
|
|
|
|
S_NM_STATECHG_ADM, /* Administrative State changed */
|
2011-03-06 22:20:28 +00:00
|
|
|
S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */
|
2009-05-01 15:39:49 +00:00
|
|
|
};
|
|
|
|
|
2009-06-06 13:54:35 +00:00
|
|
|
/* SS_LCHAN signals */
|
|
|
|
enum signal_lchan {
|
|
|
|
/*
|
|
|
|
* The lchan got freed with an use_count != 0 and error
|
|
|
|
* recovery needs to be carried out from within the
|
|
|
|
* signal handler.
|
|
|
|
*/
|
|
|
|
S_LCHAN_UNEXPECTED_RELEASE,
|
2009-11-29 21:45:52 +00:00
|
|
|
S_LCHAN_ACTIVATE_ACK, /* 08.58 Channel Activate ACK */
|
|
|
|
S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */
|
|
|
|
S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */
|
|
|
|
S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */
|
|
|
|
S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */
|
2009-11-30 18:16:47 +00:00
|
|
|
S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */
|
2009-06-06 13:54:35 +00:00
|
|
|
};
|
|
|
|
|
2010-03-28 07:58:03 +00:00
|
|
|
/* SS_CHALLOC signals */
|
|
|
|
enum signal_challoc {
|
|
|
|
S_CHALLOC_ALLOC_FAIL, /* allocation of lchan has failed */
|
|
|
|
S_CHALLOC_FREED, /* lchan has been successfully freed */
|
|
|
|
};
|
|
|
|
|
2009-07-29 21:14:15 +00:00
|
|
|
/* SS_SUBSCR signals */
|
|
|
|
enum signal_subscr {
|
|
|
|
S_SUBSCR_ATTACHED,
|
|
|
|
S_SUBSCR_DETACHED,
|
2009-12-13 11:39:18 +00:00
|
|
|
S_SUBSCR_IDENTITY, /* we've received some identity information */
|
2009-07-29 21:14:15 +00:00
|
|
|
};
|
|
|
|
|
2009-11-14 09:08:40 +00:00
|
|
|
/* SS_SCALL signals */
|
|
|
|
enum signal_scall {
|
|
|
|
S_SCALL_SUCCESS,
|
|
|
|
S_SCALL_EXPIRED,
|
|
|
|
S_SCALL_DETACHED,
|
|
|
|
};
|
|
|
|
|
2010-03-05 18:36:20 +00:00
|
|
|
/* SS_IPAC_NWL signals */
|
|
|
|
enum signal_ipaccess {
|
|
|
|
S_IPAC_NWL_COMPLETE,
|
|
|
|
};
|
|
|
|
|
2009-11-30 18:37:18 +00:00
|
|
|
enum signal_global {
|
2011-01-14 14:55:42 +00:00
|
|
|
S_GLOBAL_BTS_CLOSE_OM,
|
2009-11-30 18:37:18 +00:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:27:27 +00:00
|
|
|
/* SS_RF signals */
|
|
|
|
enum signal_rf {
|
|
|
|
S_RF_OFF,
|
|
|
|
S_RF_ON,
|
|
|
|
S_RF_GRACE,
|
|
|
|
};
|
|
|
|
|
2010-04-26 19:55:29 +00:00
|
|
|
struct gsm_subscriber;
|
|
|
|
|
2009-02-14 22:51:00 +00:00
|
|
|
struct paging_signal_data {
|
|
|
|
struct gsm_subscriber *subscr;
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
|
2010-12-23 17:19:17 +00:00
|
|
|
int paging_result;
|
|
|
|
|
2009-02-14 22:51:00 +00:00
|
|
|
/* NULL in case the paging didn't work */
|
2010-06-17 07:05:57 +00:00
|
|
|
struct gsm_subscriber_connection *conn;
|
2009-02-14 22:51:00 +00:00
|
|
|
};
|
|
|
|
|
2009-11-14 09:08:40 +00:00
|
|
|
struct scall_signal_data {
|
|
|
|
struct gsm_subscriber *subscr;
|
2010-06-17 07:05:57 +00:00
|
|
|
struct gsm_subscriber_connection *conn;
|
2009-11-14 09:08:40 +00:00
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2009-12-30 07:38:43 +00:00
|
|
|
struct ipacc_ack_signal_data {
|
2010-05-12 15:34:51 +00:00
|
|
|
struct gsm_bts_trx *trx;
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t msg_type;
|
2009-12-30 07:38:43 +00:00
|
|
|
};
|
|
|
|
|
2011-03-06 20:20:38 +00:00
|
|
|
struct abis_om2k_mo;
|
|
|
|
|
2011-01-14 14:55:42 +00:00
|
|
|
struct nm_statechg_signal_data {
|
2011-03-06 21:11:32 +00:00
|
|
|
struct gsm_bts *bts;
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t obj_class;
|
2011-01-14 14:55:42 +00:00
|
|
|
void *obj;
|
|
|
|
struct gsm_nm_state *old_state;
|
|
|
|
struct gsm_nm_state *new_state;
|
2011-03-06 20:20:38 +00:00
|
|
|
|
|
|
|
/* This pointer is vaold for TS 12.21 MO */
|
2011-01-14 14:55:42 +00:00
|
|
|
struct abis_om_obj_inst *obj_inst;
|
2011-03-06 20:20:38 +00:00
|
|
|
/* This pointer is vaold for RBS2000 MO */
|
|
|
|
struct abis_om2k_mo *om2k_mo;
|
2011-01-14 14:55:42 +00:00
|
|
|
};
|
|
|
|
|
2011-03-06 22:20:28 +00:00
|
|
|
struct nm_om2k_signal_data {
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
void *obj;
|
|
|
|
struct abis_om2k_mo *om2k_mo;
|
|
|
|
|
|
|
|
uint8_t accordance_ind;
|
|
|
|
};
|
|
|
|
|
2010-07-13 18:08:35 +00:00
|
|
|
struct nm_nack_signal_data {
|
|
|
|
struct msgb *msg;
|
2012-11-11 17:26:23 +00:00
|
|
|
struct gsm_bts *bts;
|
2010-07-13 18:08:35 +00:00
|
|
|
uint8_t mt;
|
|
|
|
};
|
|
|
|
|
2010-03-28 07:58:03 +00:00
|
|
|
struct challoc_signal_data {
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
struct gsm_lchan *lchan;
|
|
|
|
enum gsm_chan_t type;
|
|
|
|
};
|
|
|
|
|
2010-07-28 18:27:27 +00:00
|
|
|
struct rf_signal_data {
|
|
|
|
struct gsm_network *net;
|
|
|
|
};
|
|
|
|
|
2010-12-24 09:15:55 +00:00
|
|
|
struct sms_signal_data {
|
|
|
|
/* The transaction where this occured */
|
|
|
|
struct gsm_trans *trans;
|
|
|
|
/* Can be NULL for SMMA */
|
|
|
|
struct gsm_sms *sms;
|
|
|
|
/* int paging result. Only the ones with > 0 */
|
|
|
|
int paging_result;
|
|
|
|
};
|
|
|
|
|
2010-12-27 12:28:20 +00:00
|
|
|
struct lchan_signal_data {
|
|
|
|
/* The lchan the signal happened on */
|
|
|
|
struct gsm_lchan *lchan;
|
|
|
|
/* Measurement reports on this lchan */
|
|
|
|
struct gsm_meas_rep *mr;
|
|
|
|
};
|
|
|
|
|
2010-09-15 18:30:36 +00:00
|
|
|
/* MSC signals */
|
|
|
|
enum signal_msc {
|
|
|
|
S_MSC_LOST,
|
|
|
|
S_MSC_CONNECTED,
|
2011-08-17 15:37:16 +00:00
|
|
|
S_MSC_AUTHENTICATED,
|
2010-09-15 18:30:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct osmo_msc_data;
|
|
|
|
struct msc_signal_data {
|
|
|
|
struct osmo_msc_data *data;
|
|
|
|
};
|
|
|
|
|
2012-02-03 19:26:25 +00:00
|
|
|
/* SS_CCCH signals */
|
|
|
|
enum signal_ccch {
|
|
|
|
S_CCCH_PAGING_LOAD,
|
|
|
|
S_CCCH_RACH_LOAD,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ccch_signal_data {
|
|
|
|
struct gsm_bts *bts;
|
|
|
|
uint16_t pg_buf_space;
|
|
|
|
uint16_t rach_slot_count;
|
|
|
|
uint16_t rach_busy_count;
|
|
|
|
uint16_t rach_access_count;
|
|
|
|
};
|
|
|
|
|
2009-02-14 22:51:00 +00:00
|
|
|
#endif
|