aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-08-24 12:58:42 +0200
committerdexter <pmaier@sysmocom.de>2023-08-31 08:29:58 +0000
commit33a2a2fed55347a551f0a7a7e82bf2d6547d41ab (patch)
tree44b22c4e228c38b058bec2bfb63cc20609573b6e
parentc1d7bb69082b25fc2b33c2ff37cb027aacc71cbc (diff)
pcuif_proto: check confirm flag in struct gsm_pcu_if_pch
Since osmo-bsc uses RSL (with a propritary Ericsson RBS specific extension) to send a confirmed IMMEDIATE ASSIGNMENT messages via PCH, we can not just forward the MAC blocks into the paging queue without determining whether the MAC block is a PAGING message or an IMMEDIATE ASSIGNMENT message. the reason for this is that RSL uses two different message types (IMMEDIATE ASSIGNMENT COMMAND and PAGING COMMAND) to process IMMEDIATE ASSIGNMENT and PAGING messages. This means we have to look into the MAC block to make sure whether the message is a PAGING message or an IMMEDIATE ASSIGNMENT message. We also need to make sure that the confirm flag is properly executed. In the case of the IMMEDIATE ASSIGNMENT this means we have to include (confirm=true) or not include (confirm=false) the RSL_IE_ERIC_MOBILE_ID into the IMMEDIATE ASSIGNMENT COMMAND message. In the case of PAGING we directly echo a confirmation after sending the PAGING COMMAND via RSL when a confirmation is requested. Related: OS#5927 Depends: osmo-pcu.git Ia202862aafc1f0cb6601574ef61eb9155de11f04 Change-Id: I3d2842626b7e8325860ea3160c7d900d39e953a0
-rw-r--r--include/osmocom/bsc/abis_rsl.h2
-rw-r--r--include/osmocom/bsc/pcuif_proto.h3
-rw-r--r--src/osmo-bsc/abis_rsl.c8
-rw-r--r--src/osmo-bsc/pcu_sock.c16
4 files changed, 20 insertions, 9 deletions
diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index a6b2cefd1..023793ae5 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -68,7 +68,7 @@ int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
/* Ericcson vendor specific RSL extensions */
int rsl_ericsson_imm_assign_cmd(const struct gsm_bts *bts, uint32_t msg_id, uint8_t len,
- const uint8_t *val, uint8_t pag_grp);
+ const uint8_t *val, uint8_t pag_grp, bool confirm);
/* Siemens vendor-specific RSL extensions */
int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
diff --git a/include/osmocom/bsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h
index bf49b0683..aa22447e8 100644
--- a/include/osmocom/bsc/pcuif_proto.h
+++ b/include/osmocom/bsc/pcuif_proto.h
@@ -271,6 +271,9 @@ struct gsm_pcu_if_pch {
char imsi[OSMO_IMSI_BUF_SIZE];
/* GSM mac-block (with immediate assignment message) */
uint8_t data[GSM_MACBLOCK_LEN];
+ /* Set to true in case the receiving end must send a confirmation
+ * when the MAC block (data) has been sent. */
+ bool confirm;
} __attribute__((packed));
struct gsm_pcu_if {
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 5440a236d..76948c9bd 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -996,7 +996,7 @@ int rsl_imm_assign_cmd(const struct gsm_bts *bts, uint8_t len, const uint8_t *va
/* Chapter 8.5.6 Immediate Assignment Command (with Ericcson vendor specific RSL extension) */
int rsl_ericsson_imm_assign_cmd(const struct gsm_bts *bts, uint32_t msg_id, uint8_t len,
- const uint8_t *val, uint8_t pag_grp)
+ const uint8_t *val, uint8_t pag_grp, bool confirm)
{
struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val);
if (!msg)
@@ -1008,8 +1008,10 @@ int rsl_ericsson_imm_assign_cmd(const struct gsm_bts *bts, uint32_t msg_id, uint
/* ericsson can handle a reference at the end of the message which is used in
* the confirm message. The confirm message is only sent if the trailer is present */
- msgb_put_u8(msg, RSL_IE_ERIC_MOBILE_ID);
- msgb_put_u32(msg, msg_id);
+ if (confirm) {
+ msgb_put_u8(msg, RSL_IE_ERIC_MOBILE_ID);
+ msgb_put_u32(msg, msg_id);
+ }
return abis_rsl_sendmsg(msg);
}
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 6f48f0f9d..696d5f3a3 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -506,7 +506,7 @@ static int pcu_rx_rr_paging_pch(struct gsm_bts *bts, uint8_t paging_group,
}
static int pcu_rx_rr_imm_ass_pch(struct gsm_bts *bts, uint8_t paging_group,
- const struct gsm_pcu_if_pch *pch)
+ const struct gsm_pcu_if_pch *pch, bool confirm)
{
LOG_BTS(bts, DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (msg_id=0x%08x, IMSI=%s, Paging group=0x%02x)\n",
pch->msg_id, pch->imsi, paging_group);
@@ -516,7 +516,8 @@ static int pcu_rx_rr_imm_ass_pch(struct gsm_bts *bts, uint8_t paging_group,
* of the RSL specs. This means that each BTS vendor has to come up with a proprietary method. At
* the moment we only support Ericsson RBS here. */
if (is_ericsson_bts(bts))
- return rsl_ericsson_imm_assign_cmd(bts, pch->msg_id, sizeof(pch->data), pch->data, paging_group);
+ return rsl_ericsson_imm_assign_cmd(bts, pch->msg_id, sizeof(pch->data), pch->data, paging_group,
+ confirm);
LOG_BTS(bts, DPCU, LOGL_ERROR, "BTS model does not support sending immediate assignment via PCH!\n");
return -ENOTSUP;
@@ -549,11 +550,16 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
pch = (struct gsm_pcu_if_pch *)data_req->data;
pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(pch->imsi));
-
gsm48_imm_ass = (struct gsm48_imm_ass *)pch->data;
+
if (gsm48_imm_ass->msg_type == GSM48_MT_RR_IMM_ASS)
- return pcu_rx_rr_imm_ass_pch(bts, pag_grp, pch);
- return pcu_rx_rr_paging_pch(bts, pag_grp, pch);
+ return pcu_rx_rr_imm_ass_pch(bts, pag_grp, pch, pch->confirm);
+
+ if (pcu_rx_rr_paging_pch(bts, pag_grp, pch))
+ return -EIO;
+ if (pch->confirm)
+ return pcu_tx_pch_confirm(bts, pch->msg_id);
+ break;
default:
LOG_BTS(bts, DPCU, LOGL_ERROR, "Received PCU data request with "
"unsupported sapi %d\n", data_req->sapi);