aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-09-18 02:49:32 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2020-10-07 11:40:12 +0000
commit86ce105038275f8e32a4bcdd55ed4f1aa225615a (patch)
treebb648da374a3ca173fc116cadd0e10dc63aa8853
parent766f59096ec05a899dd51c9f59eff0248098ecf3 (diff)
refactor paging: introduce bsc_paging_start()
Allow starting a paging from elsewhere than a BSSMAP Paging Request. For upcoming Location Services (LCS), a BSSLAP TA Request from the SMLC may require triggering a Paging. Change-Id: Iaff91584699d163bd1963927280ff3a8ddd43073
-rw-r--r--include/osmocom/bsc/paging.h1
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c9
-rw-r--r--tests/handover/handover_test.c3
3 files changed, 10 insertions, 3 deletions
diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h
index 3dd5dc6b4..cebdce393 100644
--- a/include/osmocom/bsc/paging.h
+++ b/include/osmocom/bsc/paging.h
@@ -88,4 +88,5 @@ unsigned int paging_pending_requests_nr(struct gsm_bts *bts);
void paging_flush_bts(struct gsm_bts *bts, struct bsc_msc_data *msc);
void paging_flush_network(struct gsm_network *net, struct bsc_msc_data *msc);
+int bsc_paging_start(struct bsc_paging_params *params);
#endif
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 3c00d68a0..ad501222f 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -293,7 +293,6 @@ static int bssmap_handle_paging(struct bsc_msc_data *msc,
.msc = msc,
.tmsi = GSM_RESERVED_TMSI,
};
- struct bsc_paging_params *params; // (tmp cosmetic shim, dropped in subsequent patch)
tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0);
remain = payload_length - 1;
@@ -357,9 +356,13 @@ static int bssmap_handle_paging(struct bsc_msc_data *msc,
LOG_PAGING(&paging, DMSC, LOGL_ERROR, "eMLPP IE present, but eMLPP is not handled\n");
}
- rate_ctr_inc(&msc->network->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]);
+ return bsc_paging_start(&paging);
+}
+
+int bsc_paging_start(struct bsc_paging_params *params)
+{
+ rate_ctr_inc(&bsc_gsmnet->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED]);
- params = &paging;
switch (params->cil.id_discr) {
case CELL_IDENT_NO_CELL:
page_all_bts(params);
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index ba0ec21b9..bdf926d8a 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -48,6 +48,7 @@
#include <osmocom/bsc/handover_fsm.h>
#include <osmocom/bsc/bsc_msc_data.h>
#include <osmocom/bsc/bts.h>
+#include <osmocom/bsc/paging.h>
void *ctx;
@@ -1798,6 +1799,8 @@ void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, uint8_t dlci, enu
void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr) {}
int bsc_compl_l3(struct gsm_lchan *lchan, struct msgb *msg, uint16_t chosen_channel)
{ return 0; }
+int bsc_paging_start(struct bsc_paging_params *params)
+{ return 0; }
void bsc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg) {}
void bsc_assign_compl(struct gsm_subscriber_connection *conn, uint8_t rr_cause) {}
void bsc_cm_update(struct gsm_subscriber_connection *conn,