aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/pcu_if.h1
-rw-r--r--src/common/l1sap.c5
-rw-r--r--src/common/pcu_sock.c39
-rw-r--r--src/common/rsl.c4
4 files changed, 32 insertions, 17 deletions
diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h
index a020c050..ba3873e1 100644
--- a/include/osmo-bts/pcu_if.h
+++ b/include/osmo-bts/pcu_if.h
@@ -6,6 +6,7 @@
extern int pcu_direct;
int pcu_tx_info_ind(void);
+int pcu_tx_si13(const struct gsm_bts *bts);
int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
uint16_t arfcn, uint8_t block_nr);
int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 21d9dc69..1b3a3ad8 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -52,6 +52,7 @@
#include <osmo-bts/handover.h>
#include <osmo-bts/power_control.h>
#include <osmo-bts/msg_utils.h>
+#include <osmo-bts/pcuif_proto.h>
struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx,
unsigned int chan_nr)
@@ -1013,7 +1014,7 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
if (len == 0)
return -EINVAL;
if (L1SAP_IS_PTCCH(fn)) {
- pcu_tx_data_ind(&trx->ts[tn], 1, fn,
+ pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PTCCH, fn,
0 /* ARFCN */, L1SAP_FN2PTCCHBLOCK(fn),
data, len, rssi, data_ind->ber10k,
data_ind->ta_offs_qbits,
@@ -1023,7 +1024,7 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
if (pr_info != PRES_INFO_BOTH)
return 0;
/* PDTCH / PACCH frame handling */
- pcu_tx_data_ind(&trx->ts[tn], 0, fn, 0 /* ARFCN */,
+ pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, 0 /* ARFCN */,
L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k,
data_ind->ta_offs_qbits, data_ind->lqual_cb);
}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index a4ddc052..0a9ba2db 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -322,7 +322,7 @@ int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
return pcu_sock_send(&bts_gsmnet, msg);
}
-int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
+int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn,
uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len,
int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual)
{
@@ -332,9 +332,8 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
struct gsm_bts *bts = ts->trx->bts;
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
- LOGP(DPCU, LOGL_DEBUG, "Sending data indication: is_ptcch=%d arfcn=%d "
- "block=%d data=%s\n", is_ptcch, arfcn, block_nr,
- osmo_hexdump(data, len));
+ LOGP(DPCU, LOGL_DEBUG, "Sending data indication: sapi=%s arfcn=%d block=%d data=%s\n",
+ sapi_string[sapi], arfcn, block_nr, osmo_hexdump(data, len));
if (lqual / 10 < btsb->min_qual_norm) {
LOGP(DPCU, LOGL_DEBUG, "Link quality %"PRId16" is below threshold %f, dropping packet\n",
@@ -348,7 +347,7 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn,
pcu_prim = (struct gsm_pcu_if *) msg->data;
data_ind = &pcu_prim->u.data_ind;
- data_ind->sapi = (is_ptcch) ? PCU_IF_SAPI_PTCCH : PCU_IF_SAPI_PDTCH;
+ data_ind->sapi = sapi;
data_ind->rssi = rssi;
data_ind->fn = fn;
data_ind->arfcn = arfcn;
@@ -488,16 +487,6 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
osmo_hexdump(data_req->data, data_req->len));
switch (data_req->sapi) {
- case PCU_IF_SAPI_BCCH:
- if (data_req->len == 23) {
- bts->si_valid |= (1 << SYSINFO_TYPE_13);
- memcpy(bts->si_buf[SYSINFO_TYPE_13], data_req->data,
- data_req->len);
- } else {
- bts->si_valid &= ~(1 << SYSINFO_TYPE_13);
- }
- osmo_signal_dispatch(SS_GLOBAL, S_NEW_SYSINFO, bts);
- break;
case PCU_IF_SAPI_PCH:
if (msg_type == PCU_IF_MSG_PAG_REQ) {
/* FIXME: Add function to schedule paging request.
@@ -546,6 +535,21 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
return rc;
}
+int pcu_tx_si13(const struct gsm_bts *bts)
+{
+ /* the SI is per-BTS so it doesn't matter which TRX we use */
+ struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, 0);
+
+ /* The low-level data like FN, ARFCN etc will be ignored but we have to set lqual high enough to bypass
+ the check at lower levels */
+ int rc = pcu_tx_data_ind(&trx->ts[0], PCU_IF_SAPI_BCCH, 0, 0, 0, GSM_BTS_SI(bts, SYSINFO_TYPE_13),
+ GSM_MACBLOCK_LEN, 0, 0, 0, INT16_MAX);
+ if (rc < 0)
+ LOGP(DPCU, LOGL_NOTICE, "Failed to send SI13 to PCU: %d\n", rc);
+
+ return rc;
+}
+
static int pcu_rx_txt_ind(struct gsm_bts *bts,
struct gsm_pcu_if_txt_ind *txt)
{
@@ -555,6 +559,11 @@ static int pcu_rx_txt_ind(struct gsm_bts *bts,
txt->text);
osmo_signal_dispatch(SS_FAIL, OSMO_EVT_PCU_VERS, txt->text);
osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH);
+
+ if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13))
+ return pcu_tx_si13(bts);
+ else
+ LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n");
break;
case PCU_OML_ALERT:
osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text);
diff --git a/src/common/rsl.c b/src/common/rsl.c
index dc176ea7..69ecf2e7 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -50,6 +50,7 @@
#include <osmo-bts/cbch.h>
#include <osmo-bts/l1sap.h>
#include <osmo-bts/bts_model.h>
+#include <osmo-bts/pcuif_proto.h>
//#define FAKE_CIPH_MODE_COMPL
@@ -306,6 +307,9 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg)
LCHAN_REL_ACT_REACT;
}
+ if (SYSINFO_TYPE_13 == osmo_si)
+ pcu_tx_si13(trx->bts);
+
if (SYSINFO_TYPE_2quater == osmo_si) {
si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO);
bv.data = si2q->rest_octets;