aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/smscb.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-09-06 23:18:27 +0200
committerlaforge <laforge@gnumonks.org>2019-09-08 08:39:17 +0000
commit7d88844909ce52dcf936d7cd233df555f58a998f (patch)
treeeb322e194111aa76d605030e184a0313166b9e5a /src/osmo-bsc/smscb.c
parentc32fc078f2fa872d2f8ede82aefaf4bd61999051 (diff)
SMSCB: Send ETWS Primary Notifiation via RSL to BTS
In addition to transmission of the ETWS Primary Notification via all dedicated channels, we also need to send it to the BTS for transmission via PCH (P1 Rest Octets) and for forwarding to PCU for PACCH transmission. Change-Id: I7e45b0373458a4348b12b92dd92861062532548b
Diffstat (limited to 'src/osmo-bsc/smscb.c')
-rw-r--r--src/osmo-bsc/smscb.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/osmo-bsc/smscb.c b/src/osmo-bsc/smscb.c
index 319ef21a7..8d48af9fe 100644
--- a/src/osmo-bsc/smscb.c
+++ b/src/osmo-bsc/smscb.c
@@ -40,6 +40,7 @@
#include <osmocom/bsc/vty.h>
#include <osmocom/bsc/gsm_04_08_rr.h>
#include <osmocom/bsc/lchan_fsm.h>
+#include <osmocom/bsc/abis_rsl.h>
/*********************************************************************************
* Helper Functions
@@ -461,8 +462,15 @@ static int tx_cbsp_keepalive_compl(struct bsc_cbc_link *cbc)
* Per-BTS Processing of CBSP from CBC, called via cbsp_per_bts()
*********************************************************************************/
-static void etws_primary_to_dedicated(struct gsm_bts *bts,
- const struct osmo_cbsp_write_replace *wrepl)
+/* timer call-back once ETWS warning period has expired */
+static void etws_pn_cb(void *data)
+{
+ struct gsm_bts *bts = (struct gsm_bts *)data;
+ LOG_BTS(bts, DCBS, LOGL_NOTICE, "ETWS PN Timeout; disabling broadcast via PCH\n");
+ rsl_etws_pn_command(bts, RSL_CHAN_PCH_AGCH, NULL, 0);
+}
+
+static void etws_primary_to_bts(struct gsm_bts *bts, const struct osmo_cbsp_write_replace *wrepl)
{
uint8_t etws_primary[ETWS_PRIM_NOTIF_SIZE];
struct gsm_bts_trx *trx;
@@ -491,7 +499,18 @@ static void etws_primary_to_dedicated(struct gsm_bts *bts,
LOG_BTS(bts, DCBS, LOGL_NOTICE, "Sent ETWS Primary Notification via %u dedicated channels\n",
count);
- /* FIXME: Notify BTS of primary ETWS notification via vendor-specific Abis message */
+ /* Notify BTS of primary ETWS notification via vendor-specific Abis message */
+ if (osmo_bts_has_feature(&bts->features, BTS_FEAT_ETWS_PN)) {
+ rsl_etws_pn_command(bts, RSL_CHAN_PCH_AGCH, etws_primary, sizeof(etws_primary));
+ LOG_BTS(bts, DCBS, LOGL_NOTICE, "Sent ETWS Primary Notification via common channel\n");
+ if (wrepl->u.emergency.warning_period != 0xffffffff) {
+ osmo_timer_setup(&bts->etws_timer, etws_pn_cb, bts);
+ osmo_timer_schedule(&bts->etws_timer, wrepl->u.emergency.warning_period, 0);
+ } else
+ LOG_BTS(bts, DCBS, LOGL_NOTICE, "Unlimited ETWS PN broadcast, this breaks "
+ "normal network operation due to PCH blockage\n");
+ } else
+ LOG_BTS(bts, DCBS, LOGL_ERROR, "BTS doesn't support RSL command for ETWS PN\n");
}
/*! Try to execute a write-replace operation; roll-back if it fails.
@@ -563,9 +582,7 @@ static int bts_rx_write_replace(struct gsm_bts *bts, const struct osmo_cbsp_deco
int rc;
if (!wrepl->is_cbs) {
- /* send through any active dedicated channels of this BTS */
- etws_primary_to_dedicated(bts, wrepl);
- /* TODO: send via RSL to BTS for transmission on PCH */
+ etws_primary_to_bts(bts, wrepl);
return 0;
}