Merge branch 'master' into sms

Conflicts:
	openbsc/include/openbsc/transaction.h
	openbsc/src/gsm_04_11.c
	openbsc/src/transaction.c
This commit is contained in:
Harald Welte 2009-07-28 00:44:49 +02:00
commit 3366a94d6c
11 changed files with 64 additions and 53 deletions

View File

@ -2056,10 +2056,6 @@ static int bs11_read_swl_file(struct abis_nm_bs11_sw *bs11_sw)
FILE *swl;
int rc = 0;
if (!tall_fle_ctx)
tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 1,
"bs11_file_list_entry");
swl = fopen(bs11_sw->swl_fname, "r");
if (!swl)
return -ENODEV;
@ -2373,3 +2369,10 @@ int abis_nm_ipaccess_restart(struct gsm_bts *bts)
{
return __simple_cmd(bts, NM_MT_IPACC_RESTART);
}
static __attribute__((constructor)) void on_dso_load_abis_nm(void)
{
tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 1,
"bs11_file_list_entry");
}

View File

@ -370,10 +370,6 @@ e1inp_sign_link_create(struct e1inp_ts *ts, enum e1inp_sign_type type,
if (ts->type != E1INP_TS_TYPE_SIGN)
return NULL;
if (!tall_sigl_ctx)
tall_sigl_ctx = talloc_named_const(tall_bsc_ctx, 1,
"e1inp_sign_link");
link = talloc_zero(tall_sigl_ctx, struct e1inp_sign_link);
if (!link)
return NULL;
@ -505,3 +501,9 @@ int e1inp_line_register(struct e1inp_line *line)
return 0;
}
static __attribute__((constructor)) void on_dso_load_e1_inp(void)
{
tall_sigl_ctx = talloc_named_const(tall_bsc_ctx, 1,
"e1inp_sign_link");
}

View File

@ -350,9 +350,6 @@ static void allocate_loc_updating_req(struct gsm_lchan *lchan)
use_lchan(lchan);
release_loc_updating_req(lchan);
if (!tall_locop_ctx)
tall_locop_ctx = talloc_named_const(tall_bsc_ctx, 1,
"loc_updating_oper");
lchan->loc_operation = talloc_zero(tall_locop_ctx,
struct gsm_loc_updating_operation);
}
@ -408,6 +405,8 @@ static int gsm0408_handle_lchan_signal(unsigned int subsys, unsigned int signal,
*/
static __attribute__((constructor)) void on_dso_load_0408(void)
{
tall_locop_ctx = talloc_named_const(tall_bsc_ctx, 1,
"loc_updating_oper");
register_signal_handler(SS_LCHAN, gsm0408_handle_lchan_signal, NULL);
}

View File

@ -286,19 +286,11 @@ static int gsm340_rx_tpdu(struct msgb *msg)
u_int8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
int rc = 0;
if (!tall_sms_ctx)
tall_sms_ctx = talloc_named_const(tall_bsc_ctx, 1,
"sms_submit");
sms = talloc(tall_sms_ctx, struct sms_submit);
if (!sms)
return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
memset(sms, 0, sizeof(*sms));
if (!tall_gsms_ctx)
tall_gsms_ctx = talloc_named_const(tall_bsc_ctx, 1,
"sms");
gsms = talloc(tall_gsms_ctx, struct gsm_sms);
if (!gsms) {
talloc_free(sms);
@ -772,3 +764,9 @@ int gsm0411_send_sms(struct gsm_lchan *lchan, struct sms_deliver *sms)
smsd->ud = FIXME;
}
#endif
static __attribute__((constructor)) void on_dso_load_sms(void)
{
tall_sms_ctx = talloc_named_const(tall_bsc_ctx, 1, "sms_submit");
tall_gsms_ctx = talloc_named_const(tall_bsc_ctx, 1, "sms");
}

View File

@ -103,10 +103,6 @@ struct gsm_subscriber *subscr_alloc(void)
{
struct gsm_subscriber *s;
if (!tall_subscr_ctx)
tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 1,
"subscriber");
s = talloc(tall_subscr_ctx, struct gsm_subscriber);
if (!s)
return NULL;
@ -212,10 +208,6 @@ void subscr_get_channel(struct gsm_subscriber *subscr,
{
struct subscr_request *request;
if (!tall_sub_req_ctx)
tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 1,
"subscr_request");
request = talloc(tall_sub_req_ctx, struct subscr_request);
if (!request) {
if (cbfn)
@ -272,3 +264,11 @@ void subscr_put_channel(struct gsm_lchan *lchan)
subscr_send_paging_request(lchan->subscr);
}
static __attribute__((constructor)) void on_dso_load_subscr(void)
{
tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 1, "subscriber");
tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 1,
"subscr_request");
}

View File

@ -140,9 +140,6 @@ static int mncc_setup_ind(struct gsm_call *call, int msg_type,
if (call->remote_ref)
return 0;
if (!tall_call_ctx)
tall_call_ctx = talloc_named_const(tall_bsc_ctx, 1,
"gsm_call");
/* create remote call */
if (!(remote = talloc(tall_call_ctx, struct gsm_call))) {
memset(&mncc, 0, sizeof(struct gsm_mncc));
@ -306,9 +303,6 @@ int mncc_recv(struct gsm_network *net, int msg_type, void *arg)
if (!call) {
if (msg_type != MNCC_SETUP_IND)
return 0; /* drop */
if (!tall_call_ctx)
tall_call_ctx = talloc_named_const(tall_bsc_ctx, 1,
"gsm_call");
/* create call */
if (!(call = talloc_zero(tall_call_ctx, struct gsm_call))) {
struct gsm_mncc rel;
@ -395,3 +389,8 @@ int mncc_recv(struct gsm_network *net, int msg_type, void *arg)
return rc;
}
static __attribute__((constructor)) void on_dso_load_trau_mncc(void)
{
tall_call_ctx = talloc_named_const(tall_bsc_ctx, 1, "gsm_call");
}

View File

@ -33,9 +33,6 @@ struct msgb *msgb_alloc(u_int16_t size, const char *name)
{
struct msgb *msg;
if (!tall_msgb_ctx)
tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 1, "msgb");
msg = _talloc_zero(tall_msgb_ctx, sizeof(*msg) + size, name);
if (!msg)
@ -76,3 +73,8 @@ struct msgb *msgb_dequeue(struct llist_head *queue)
return llist_entry(lh, struct msgb, list);
}
static __attribute__((constructor)) void on_dso_load_trau_msgb(void)
{
tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 1, "msgb");
}

View File

@ -219,9 +219,6 @@ static void _paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr,
struct gsm_bts_paging_state *bts_entry = &bts->paging;
struct gsm_paging_request *req;
if (!tall_paging_ctx)
tall_paging_ctx = talloc_named_const(NULL, 1, "paging_request");
if (paging_pending_request(bts_entry, subscr)) {
DEBUGP(DPAG, "Paging request already pending\n");
return;
@ -310,3 +307,8 @@ void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t free_slots)
{
bts->paging.available_slots = free_slots;
}
static __attribute__((constructor)) void on_dso_load_paging(void)
{
tall_paging_ctx = talloc_named_const(NULL, 1, "paging_request");
}

View File

@ -39,9 +39,6 @@ int register_signal_handler(unsigned int subsys, signal_cbfn *cbfn, void *data)
{
struct signal_handler *sig_data;
if (!tall_sigh_ctx)
tall_sigh_ctx = talloc_named_const(NULL, 1, "signal_handler");
sig_data = talloc(tall_sigh_ctx, struct signal_handler);
if (!sig_data)
return -ENOMEM;
@ -84,3 +81,8 @@ void dispatch_signal(unsigned int subsys, unsigned int signal, void *signal_data
(*handler->cbfn)(subsys, signal, handler->data, signal_data);
}
}
static __attribute__((constructor)) void on_dso_load_signal(void)
{
tall_sigh_ctx = talloc_named_const(NULL, 1, "signal_handler");
}

View File

@ -312,9 +312,6 @@ int subchan_mux_init(struct subch_mux *mx)
{
int i;
if (!tall_tqe_ctx)
tall_tqe_ctx = talloc_named_const(tall_bsc_ctx, 1,
"subch_txq_entry");
memset(mx, 0, sizeof(*mx));
for (i = 0; i < NR_SUBCH; i++) {
struct mux_subch *sch = &mx->subch[i];
@ -323,3 +320,9 @@ int subchan_mux_init(struct subch_mux *mx)
return 0;
}
static __attribute__((constructor)) void on_dso_load_ss_demux(void)
{
tall_tqe_ctx = talloc_named_const(tall_bsc_ctx, 1,
"subch_txq_entry");
}

View File

@ -55,10 +55,6 @@ int trau_mux_map(const struct gsm_e1_subslot *src,
{
struct map_entry *me;
if (!tall_map_ctx)
tall_map_ctx = talloc_named_const(tall_bsc_ctx, 1,
"trau_map_entry");
me = talloc(tall_map_ctx, struct map_entry);
if (!me)
return -ENOMEM;
@ -201,10 +197,6 @@ int trau_recv_lchan(struct gsm_lchan *lchan, u_int32_t callref)
struct gsm_e1_subslot *src_ss;
struct upqueue_entry *ue;
if (!tall_upq_ctx)
tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 1,
"trau_upq_entry");
ue = talloc(tall_upq_ctx, struct upqueue_entry);
if (!ue)
return -ENOMEM;
@ -243,3 +235,12 @@ int trau_send_lchan(struct gsm_lchan *lchan, struct decoded_trau_frame *tf)
return subchan_mux_enqueue(mx, dst_e1_ss->e1_ts_ss, trau_bits_out,
TRAU_FRAME_BITS);
}
static __attribute__((constructor)) void on_dso_load_trau_mux(void)
{
tall_map_ctx = talloc_named_const(tall_bsc_ctx, 1,
"trau_map_entry");
tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 1,
"trau_upq_entry");
}