diff options
Diffstat (limited to 'openbsc/include/openbsc/gsm_data.h')
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 75 |
1 files changed, 52 insertions, 23 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 74e193832..4e1977e38 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -93,36 +93,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; @@ -201,9 +214,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 */ @@ -214,6 +224,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; @@ -509,6 +525,14 @@ enum gsm_auth_policy { #define GSM_T3101_DEFAULT 10 #define GSM_T3113_DEFAULT 60 +/* + * 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; @@ -539,6 +563,11 @@ struct gsm_network { struct gsmnet_stats stats; + 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; |