This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
lynxis lazus gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/2066 abis-rsl: Send imm.ass messages via PCH It is possible to send immidiate assign messages through the paging channel. This commit adds the required functionality to the pcu socket interface and to the abis_rsl api Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 --- M openbsc/include/openbsc/abis_rsl.h M openbsc/include/openbsc/pcuif_proto.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/pcu_sock.c 4 files changed, 61 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/2066/1 diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index e61d4ea..093935b 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -58,7 +58,11 @@ int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id); /* Ericcson vendor specific RSL extensions */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val); +int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val, + uint32_t tlli); +int rsl_ericsson_imm_assign_via_pch_cmd(struct gsm_bts *bts, uint8_t len, + uint8_t *val, uint32_t tlli, + uint8_t pag_grp); /* Siemens vendor-specific RSL extensions */ int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); diff --git a/openbsc/include/openbsc/pcuif_proto.h b/openbsc/include/openbsc/pcuif_proto.h index eb28d66..0dbb6c2 100644 --- a/openbsc/include/openbsc/pcuif_proto.h +++ b/openbsc/include/openbsc/pcuif_proto.h @@ -23,7 +23,7 @@ #define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ #define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ #define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ -#define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on AGCH but with additional TLLI */ +#define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on PCH or AGCH but with additional TLLI */ /* flags */ #define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ @@ -61,6 +61,7 @@ struct gsm_pcu_if_data_cnf_dt { uint8_t sapi; uint32_t tlli; + uint8_t imsi[3]; uint32_t fn; uint16_t arfcn; uint8_t trx_nr; diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 72547e9..ba52c09 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1084,17 +1084,42 @@ return abis_rsl_sendmsg(msg); } -/* Chapter 8.5.6 */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val) +/* Append mobile idenitiy (tlli) to message buffer */ +static void rsl_ericsson_put_mi(struct msgb *msg, uint32_t tlli) +{ + /* NOTE: 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, 0xf1); + msgb_put_u32(msg, tlli); +} + +/* Chapter 8.5.6 (Ericcson vendor specific RSL extension) */ +int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val, + uint32_t tlli) { struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val); if (!msg) return 1; - /* 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, 0xf1); - msgb_put_u32(msg, tlli); + /* Append ericsson propritary mobile identity field */ + rsl_ericsson_put_mi(msg, tlli); + + return abis_rsl_sendmsg(msg); +} + +/* Chapter 8.5.6 (Ericcson vendor specific RSL extension) */ +int rsl_ericsson_imm_assign_via_pch_cmd(struct gsm_bts *bts, uint8_t len, + uint8_t *val, uint32_t tlli, + uint8_t pag_grp) +{ + struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val); + + /* Append ericsson propritary paging group field */ + msgb_put_u8(msg, 0x0e); + msgb_put_u8(msg, pag_grp); + + /* Append ericsson propritary mobile identity field */ + rsl_ericsson_put_mi(msg, tlli); return abis_rsl_sendmsg(msg); } diff --git a/openbsc/src/libbsc/pcu_sock.c b/openbsc/src/libbsc/pcu_sock.c index 98e12fa..7f9119f 100644 --- a/openbsc/src/libbsc/pcu_sock.c +++ b/openbsc/src/libbsc/pcu_sock.c @@ -325,9 +325,9 @@ mi_len = p1->data[0]; mi = p1->data+1; LOGP(DPCU, LOGL_ERROR, "PCU Sends paging " - "request type %02x (chan_needed=%02x, mi_len=%u, mi=%s)\n", + "request type %02x (chan_needed=0x%02x, mi_len=%u, mi=%s, paging_group=0x%02x)\n", p1->msg_type, chan_needed, mi_len, - osmo_hexdump_nospc(mi,mi_len)); + osmo_hexdump_nospc(mi,mi_len), paging_group); /* NOTE: We will have to add 2 to mi_len and subtract 2 from * the mi pointer because rsl_paging_cmd() will perform the * reverse operations. This is because rsl_paging_cmd() is @@ -392,6 +392,7 @@ msg->l3h = msgb_put(msg, data_req->len); memcpy(msg->l3h, data_req->data, data_req->len); + LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via AGCH\n"); if (rsl_imm_assign_cmd(bts, msg->len, msg->data)) { msgb_free(msg); rc = -EIO; @@ -407,18 +408,29 @@ } tlli = *((uint32_t *)data_req->data); - msg = msgb_alloc(data_req->len - 4, "pcu_agch"); + /* the first three bytes are the last three digits of + * the IMSI, which we need to compute the paging group */ + imsi_digit_buf[0] = data_req->data[4]; + imsi_digit_buf[1] = data_req->data[5]; + imsi_digit_buf[2] = data_req->data[6]; + imsi_digit_buf[3] = '\0'; + pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, + str_to_imsi(imsi_digit_buf)); + + msg = msgb_alloc(data_req->len - 7, "pcu_pch"); if (!msg) { rc = -ENOMEM; break; } - msg->l3h = msgb_put(msg, data_req->len - 4); - memcpy(msg->l3h, data_req->data + 4, data_req->len - 4); + msg->l3h = msgb_put(msg, data_req->len - 7); + memcpy(msg->l3h, data_req->data + 7, data_req->len - 7); - if (bts->type == GSM_BTS_TYPE_RBS2000) - rc = rsl_ericsson_imm_assign_cmd(bts, tlli, msg->len, msg->data); - else - rc = rsl_imm_assign_cmd(bts, msg->len, msg->data); + LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (tlli=0x%08x, pag_grp=0x%02x)\n", + tlli, pag_grp); + if (bts->type == GSM_BTS_TYPE_RBS2000) { + rc = rsl_ericsson_imm_assign_via_pch_cmd(bts, msg->len, msg->data, tlli, pag_grp); + } else + LOGP(DPCU, LOGL_ERROR, "This BTS does not support immediate via PCH, dropping message!\n"); if (rc) { msgb_free(msg); @@ -426,8 +438,8 @@ } break; default: - LOGP(DPCU, LOGL_ERROR, "Received PCU data request with " - "unsupported sapi %d\n", data_req->sapi); + LOGP(DPCU, LOGL_ERROR, "Received PCU data request for " + "unsupported channel (sapi=%d)\n", data_req->sapi); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/2066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus <lynxis at fe80.eu> Gerrit-Reviewer: dexter <pmaier at sysmocom.de>