dexter has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/34192 )
Change subject: pcuif_proto: check confirm flag in struct gsm_pcu_if_pch
......................................................................
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
---
M include/osmocom/bsc/abis_rsl.h
M include/osmocom/bsc/pcuif_proto.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/pcu_sock.c
4 files changed, 50 insertions(+), 9 deletions(-)
Approvals:
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index a6b2cef..023793a 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -68,7 +68,7 @@
/* 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 bf49b06..aa22447 100644
--- a/include/osmocom/bsc/pcuif_proto.h
+++ b/include/osmocom/bsc/pcuif_proto.h
@@ -271,6 +271,9 @@
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 5440a23..76948c9 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -996,7 +996,7 @@
/* 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 @@
/* 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 6f48f0f..696d5f3 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -506,7 +506,7 @@
}
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 @@
* 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 @@
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);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/34192
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3d2842626b7e8325860ea3160c7d900d39e953a0
Gerrit-Change-Number: 34192
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged