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
This commit is contained in:
Philipp Maier 2023-08-24 12:58:42 +02:00 committed by dexter
parent c1d7bb6908
commit 33a2a2fed5
4 changed files with 20 additions and 9 deletions

View File

@ -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);

View File

@ -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 {

View File

@ -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);
}

View File

@ -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);