mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 21:13:44 +00:00
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:
@@ -283,7 +283,6 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
|
|||||||
struct gsm_bts *bts = msg->lchan->ts->trx->bts;
|
struct gsm_bts *bts = msg->lchan->ts->trx->bts;
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
u_int8_t *classmark2_lv = gh->data + 1;
|
u_int8_t *classmark2_lv = gh->data + 1;
|
||||||
struct paging_signal_data sig_data;
|
|
||||||
|
|
||||||
if (is_siemens_bts(bts))
|
if (is_siemens_bts(bts))
|
||||||
send_siemens_mrpci(msg->lchan, classmark2_lv);
|
send_siemens_mrpci(msg->lchan, classmark2_lv);
|
||||||
@@ -300,14 +299,8 @@ int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
|
|||||||
subscr = conn->subscr;
|
subscr = conn->subscr;
|
||||||
}
|
}
|
||||||
|
|
||||||
sig_data.subscr = subscr;
|
|
||||||
sig_data.bts = conn->bts;
|
|
||||||
sig_data.conn = conn;
|
|
||||||
|
|
||||||
counter_inc(bts->network->stats.paging.completed);
|
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 */
|
/* Stop paging on the bts we received the paging response */
|
||||||
paging_request_stop(conn->bts, subscr, conn, msg);
|
paging_request_stop(conn->bts, subscr, conn, msg);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -72,12 +72,25 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
|
|||||||
struct msgb *msg, void *data, void *param)
|
struct msgb *msg, void *data, void *param)
|
||||||
{
|
{
|
||||||
struct subscr_request *request;
|
struct subscr_request *request;
|
||||||
|
struct gsm_subscriber_connection *conn = data;
|
||||||
struct gsm_subscriber *subscr = param;
|
struct gsm_subscriber *subscr = param;
|
||||||
|
struct paging_signal_data sig_data;
|
||||||
|
|
||||||
/* There is no request anymore... */
|
/* There is no request anymore... */
|
||||||
if (llist_empty(&subscr->requests))
|
if (llist_empty(&subscr->requests))
|
||||||
return -1;
|
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
|
* FIXME: What to do with paging requests coming during
|
||||||
* this callback? We must be sure to not start paging when
|
* this callback? We must be sure to not start paging when
|
||||||
|
|||||||
@@ -251,16 +251,11 @@ static int paging_pending_request(struct gsm_bts_paging_state *bts,
|
|||||||
static void paging_T3113_expired(void *data)
|
static void paging_T3113_expired(void *data)
|
||||||
{
|
{
|
||||||
struct gsm_paging_request *req = (struct gsm_paging_request *)data;
|
struct gsm_paging_request *req = (struct gsm_paging_request *)data;
|
||||||
struct paging_signal_data sig_data;
|
|
||||||
void *cbfn_param;
|
void *cbfn_param;
|
||||||
gsm_cbfn *cbfn;
|
gsm_cbfn *cbfn;
|
||||||
|
|
||||||
LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
|
LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
|
||||||
req, req->subscr->imsi);
|
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 */
|
/* must be destroyed before calling cbfn, to prevent double free */
|
||||||
counter_inc(req->bts->network->stats.paging.expired);
|
counter_inc(req->bts->network->stats.paging.expired);
|
||||||
@@ -268,8 +263,6 @@ static void paging_T3113_expired(void *data)
|
|||||||
cbfn = req->cbfn;
|
cbfn = req->cbfn;
|
||||||
paging_remove_request(&req->bts->paging, req);
|
paging_remove_request(&req->bts->paging, req);
|
||||||
|
|
||||||
|
|
||||||
dispatch_signal(SS_PAGING, S_PAGING_EXPIRED, &sig_data);
|
|
||||||
if (cbfn)
|
if (cbfn)
|
||||||
cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, NULL, NULL,
|
cbfn(GSM_HOOK_RR_PAGING, GSM_PAGING_EXPIRED, NULL, NULL,
|
||||||
cbfn_param);
|
cbfn_param);
|
||||||
|
|||||||
Reference in New Issue
Block a user