aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/pcu_if.h1
-rw-r--r--src/common/pcu_sock.c33
-rw-r--r--src/common/rsl.c2
-rw-r--r--tests/paging/paging_test.c1
4 files changed, 37 insertions, 0 deletions
diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index 88a96cd9..c5578131 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -8,6 +8,7 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len);
int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn);
int pcu_tx_time_ind(uint32_t fn);
+int pcu_tx_pag_req(uint8_t *identity_lv, uint8_t chan_needed);
int pcu_sock_init(void);
void pcu_sock_exit(void);
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 1bf8cd60..d9ea73ee 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -389,6 +389,39 @@ int pcu_tx_time_ind(uint32_t fn)
return pcu_sock_send(&bts_gsmnet, msg);
}
+int pcu_tx_pag_req(uint8_t *identity_lv, uint8_t chan_needed)
+{
+ struct pcu_sock_state *state = bts_gsmnet.pcu_state;
+ struct msgb *msg;
+ struct gsm_pcu_if *pcu_prim;
+ struct gsm_pcu_if_pag_req *pag_req;
+
+ /* check if identity does not fit: length > sizeof(lv) - 1 */
+ if (identity_lv[0] >= sizeof(pag_req->identity_lv)) {
+ LOGP(DPCU, LOGL_ERROR, "Paging identity too large (%d)\n",
+ identity_lv[0]);
+ return -EINVAL;
+ }
+
+ /* socket not created */
+ if (!state) {
+ LOGP(DPCU, LOGL_DEBUG, "PCU socket not created, ignoring "
+ "paging message\n");
+ return 0;
+ }
+
+ msg = pcu_msgb_alloc(PCU_IF_MSG_PAG_REQ, 0);
+ if (!msg)
+ return -ENOMEM;
+ pcu_prim = (struct gsm_pcu_if *) msg->data;
+ pag_req = &pcu_prim->u.pag_req;
+
+ pag_req->chan_needed = chan_needed;
+ memcpy(pag_req->identity_lv, identity_lv, identity_lv[0] + 1);
+
+ return pcu_sock_send(&bts_gsmnet, msg);
+}
+
static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
struct gsm_pcu_if_data *data_req)
{
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 6d409885..7c17b63d 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -398,6 +398,8 @@ static int rsl_rx_paging_cmd(struct gsm_bts_trx *trx, struct msgb *msg)
/* FIXME: notfiy the BSC somehow ?*/
}
+ pcu_tx_pag_req(identity_lv, chan_needed);
+
return 0;
}
diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c
index 684c70d8..e477669c 100644
--- a/tests/paging/paging_test.c
+++ b/tests/paging/paging_test.c
@@ -30,6 +30,7 @@
static struct gsm_bts *bts;
static struct gsm_bts_role_bts *btsb;
int gprs_enabled = 0;
+int pcu_direct = 0;
static const uint8_t static_ilv[] = {
0x08, 0x59, 0x51, 0x30, 0x99, 0x00, 0x00, 0x00, 0x19