aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc/gsm_data.h')
-rw-r--r--openbsc/include/openbsc/gsm_data.h80
1 files changed, 57 insertions, 23 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 0ac8674fd..7fb6a8448 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -85,36 +85,49 @@ typedef int gsm_cbfn(unsigned int hooknum,
struct msgb *msg,
void *data, void *param);
-/*
- * Use the channel. As side effect the lchannel recycle timer
- * will be started.
- */
-#define LCHAN_RELEASE_TIMEOUT 20, 0
-#define use_lchan(lchan) \
- do { lchan->use_count++; \
- DEBUGP(DCC, "lchan (bts=%d,trx=%d,ts=%d,ch=%d) increases usage to: %d\n", \
- lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, \
- lchan->nr, lchan->use_count); \
- bsc_schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0);
-
-#define put_lchan(lchan) \
- do { lchan->use_count--; \
- DEBUGP(DCC, "lchan (bts=%d,trx=%d,ts=%d,ch=%d) decreases usage to: %d\n", \
- lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, \
- lchan->nr, lchan->use_count); \
- } while(0);
-
-
/* communications link with a BTS */
struct gsm_bts_link {
struct gsm_bts *bts;
};
+struct sccp_connection;
struct gsm_lchan;
struct gsm_subscriber;
struct gsm_mncc;
struct rtp_socket;
+/* BSC/MSC data holding them together */
+struct bss_sccp_connection_data {
+ struct gsm_lchan *lchan;
+ struct sccp_connection *sccp;
+ int ciphering_handled : 1;
+
+ /* Timers... */
+
+ /* for assginment command */
+ struct timer_list T10;
+
+ /* for SCCP ... */
+ struct timer_list sccp_it;
+
+ /* audio handling */
+ int rtp_port;
+
+ /* Queue SCCP and GSM0408 messages */
+ struct llist_head gsm_queue;
+ unsigned int gsm_queue_size;
+
+ struct llist_head sccp_queue;
+ unsigned int sccp_queue_size;
+};
+
+#define GSM0808_T10_VALUE 6, 0
+#define sccp_get_lchan(data_ctx) ((struct bss_sccp_connection_data *)data_ctx)->lchan
+#define lchan_get_sccp(lchan) lchan->msc_data->sccp
+struct bss_sccp_connection_data *bss_sccp_create_data();
+void bss_sccp_free_data(struct bss_sccp_connection_data *);
+
+
/* Network Management State */
struct gsm_nm_state {
u_int8_t operational;
@@ -170,9 +183,6 @@ struct gsm_lchan {
/* To whom we are allocated at the moment */
struct gsm_subscriber *subscr;
- /* Timer started to release the channel */
- struct timer_list release_timer;
-
struct timer_list T3101;
/* Established data link layer services */
@@ -183,6 +193,12 @@ struct gsm_lchan {
*/
struct gsm_loc_updating_operation *loc_operation;
+ /*
+ * MSC handling...
+ */
+ struct bss_sccp_connection_data *msc_data;
+
+
/* use count. how many users use this channel */
unsigned int use_count;
};
@@ -257,6 +273,9 @@ struct gsm_bts_trx {
} bs11;
};
struct gsm_bts_trx_ts ts[TRX_NR_TS];
+
+ /* NM state */
+ int rf_locked;
};
enum gsm_bts_type {
@@ -405,6 +424,14 @@ enum gsm_auth_policy {
GSM_AUTH_POLICY_TOKEN, /* accept first, send token per sms, then revoke authorization */
};
+/*
+ * internal data for audio management
+ */
+struct gsm_audio_support {
+ u_int8_t hr : 1,
+ ver : 7;
+};
+
struct gsm_network {
/* global parameters */
u_int16_t country_code;
@@ -415,6 +442,11 @@ struct gsm_network {
int a5_encryption;
int neci;
+ struct gsm_audio_support **audio_support;
+ int audio_length;
+ int rtp_payload;
+ int rtp_base_port;
+
/* layer 4 */
int (*mncc_recv) (struct gsm_network *net, int msg_type, void *arg);
struct llist_head upqueue;
@@ -506,4 +538,6 @@ static inline int is_siemens_bts(struct gsm_bts *bts)
enum gsm_auth_policy gsm_auth_policy_parse(const char *arg);
const char *gsm_auth_policy_name(enum gsm_auth_policy policy);
+void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked);
+
#endif