paging: Dispatch the SS_PAGING signals at the MSC code level

This way the channel is fully ready for use.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut
2010-12-01 23:04:03 +01:00
parent 5a86e06eb3
commit 8a31a3fcee
3 changed files with 13 additions and 14 deletions

View File

@@ -283,7 +283,6 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
struct gsm_bts *bts = msg->lchan->ts->trx->bts;
struct gsm48_hdr *gh = msgb_l3(msg);
u_int8_t *classmark2_lv = gh->data + 1;
struct paging_signal_data sig_data;
if (is_siemens_bts(bts))
send_siemens_mrpci(msg->lchan, classmark2_lv);
@@ -300,14 +299,8 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
subscr = conn->subscr;
}
sig_data.subscr = subscr;
sig_data.bts = conn->bts;
sig_data.conn = conn;
counter_inc(bts->network->stats.paging.completed);
dispatch_signal(SS_PAGING, S_PAGING_SUCCEEDED, &sig_data);
/* Stop paging on the bts we received the paging response */
paging_request_stop(conn->bts, subscr, conn, msg);
return 0;

View File

@@ -72,12 +72,25 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
struct msgb *msg, void *data, void *param)
{
struct subscr_request *request;
struct gsm_subscriber_connection *conn = data;
struct gsm_subscriber *subscr = param;
struct paging_signal_data sig_data;
/* There is no request anymore... */
if (llist_empty(&subscr->requests))
return -1;
/* Dispatch signal */
sig_data.subscr = subscr;
sig_data.bts = conn ? conn->bts : NULL;
sig_data.conn = conn;
dispatch_signal(
SS_PAGING,
event == GSM_PAGING_SUCCEEDED ?
S_PAGING_SUCCEEDED : S_PAGING_EXPIRED,
&sig_data
);
/*
* FIXME: What to do with paging requests coming during
* this callback? We must be sure to not start paging when

View File

@@ -251,16 +251,11 @@ static int paging_pending_request(struct gsm_bts_paging_state *bts,
static void paging_T3113_expired(void *data)
{
struct gsm_paging_request *req = (struct gsm_paging_request *)data;
struct paging_signal_data sig_data;
void *cbfn_param;
gsm_cbfn *cbfn;
LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
req, req->subscr->imsi);
sig_data.subscr = req->subscr;
sig_data.bts = req->bts;
sig_data.conn = NULL;
/* must be destroyed before calling cbfn, to prevent double free */
counter_inc(req->bts->network->stats.paging.expired);
@@ -268,8 +263,6 @@ static void paging_T3113_expired(void *data)
cbfn = req->cbfn;
paging_remove_request(&req->bts->paging, req);
dispatch_signal(SS_PAGING, S_PAGING_EXPIRED, &sig_data);
if (cbfn)
cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, NULL, NULL,
cbfn_param);