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/.
dexter gerrit-no-reply at lists.osmocom.orgdexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/22368 ) Change subject: gprs_bssgp_rim: add serving BSS NACC application ...................................................................... gprs_bssgp_rim: add serving BSS NACC application Answer an incoming RAN INFORMATION REQUEST RIM PDU with RAN INFORMATION PDU that contains system information type 1, 3 and 13 Depends: osmo-pcu TODO!!!!!!!!!!!!!!! Change-Id: Id72118120c14984d2fb1b918b41fac4868150d41 Related: SYS#5103 --- M include/osmocom/pcu/pcuif_proto.h M src/bts.h M src/gprs_bssgp_rim.c M src/pcu_l1_if.cpp 4 files changed, 100 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/68/22368/1 diff --git a/include/osmocom/pcu/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h index cdd73d9..6ac9a02 100644 --- a/include/osmocom/pcu/pcuif_proto.h +++ b/include/osmocom/pcu/pcuif_proto.h @@ -1,12 +1,13 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H +#include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/gsm/l1sap.h> #include <arpa/inet.h> #define PCU_SOCK_DEFAULT "/tmp/pcu_bts" -#define PCU_IF_VERSION 0x0a +#define PCU_IF_VERSION 0x0b #define TXT_MAX_LEN 128 /* msg_type */ @@ -177,6 +178,13 @@ struct in_addr v4; struct in6_addr v6; } remote_ip[PCU_IF_NUM_NSVC]; + /* RIM */ + uint8_t si1[GSM_MACBLOCK_LEN]; + uint8_t si1_is_set; + uint8_t si3[GSM_MACBLOCK_LEN]; + uint8_t si3_is_set; + uint8_t si13[GSM_MACBLOCK_LEN]; + uint8_t si13_is_set; } __attribute__ ((packed)); struct gsm_pcu_if_act_req { diff --git a/src/bts.h b/src/bts.h index 7f437e3..195c44f 100644 --- a/src/bts.h +++ b/src/bts.h @@ -215,6 +215,10 @@ uint8_t n3105; struct gprs_rlcmac_trx trx[8]; + uint8_t si1[GSM_MACBLOCK_LEN]; + bool si1_is_set; + uint8_t si3[GSM_MACBLOCK_LEN]; + bool si3_is_set; uint8_t si13[GSM_MACBLOCK_LEN]; bool si13_is_set; diff --git a/src/gprs_bssgp_rim.c b/src/gprs_bssgp_rim.c index 8cb330f..3d4b7a9 100644 --- a/src/gprs_bssgp_rim.c +++ b/src/gprs_bssgp_rim.c @@ -23,6 +23,9 @@ #include <osmocom/gsm/tlv.h> #include <osmocom/gprs/gprs_ns.h> #include <osmocom/core/prim.h> +#include <pcu_l1_if.h> +#include <gprs_rlcmac.h> +#include <bts.h> #include "gprs_debug.h" #include "gprs_pcu.h" @@ -48,6 +51,60 @@ memcpy(&resp_pdu->routing_info_src, &req_pdu->routing_info_dest, sizeof(resp_pdu->routing_info_src)); } +/* Fill NACC application container with data (cell identifier, sysinfo) */ +static void fill_app_cont_nacc(struct bssgp_ran_inf_app_cont_nacc *app_cont, const struct gprs_rlcmac_bts *bts) +{ + struct bssgp_bvc_ctx *bctx = gprs_bssgp_pcu_current_bctx(); + + app_cont->reprt_cell.rai.lac.plmn.mcc = bctx->ra_id.mcc; + app_cont->reprt_cell.rai.lac.plmn.mnc = bctx->ra_id.mnc; + app_cont->reprt_cell.rai.lac.plmn.mnc_3_digits = bctx->ra_id.mnc_3_digits; + app_cont->reprt_cell.rai.lac.lac = bctx->ra_id.lac; + app_cont->reprt_cell.rai.rac = bctx->ra_id.rac; + app_cont->reprt_cell.cell_identity = bctx->cell_id; + app_cont->num_si = 0; + + if (bts->si1_is_set) { + app_cont->si[app_cont->num_si] = bts->si1 + 2; + app_cont->num_si++; + } + + if (bts->si3_is_set) { + app_cont->si[app_cont->num_si] = bts->si3 + 2; + app_cont->num_si++; + } + + if (bts->si13_is_set) { + app_cont->si[app_cont->num_si] = bts->si13 + 2; + app_cont->num_si++; + } + + /* Note: It is possible that the resulting PDU will not contain any system information, even if this is + * an unlikely case since the BTS immediately updates the system information after startup. The + * specification permits to send zero system information, see also: 3GPP TS 48.018 section 11.3.63.2.1 */ +} + +/* Format a RAN INFORMATION PDU that contains the requested system information */ +static void format_response_pdu(struct bssgp_ran_information_pdu *resp_pdu, struct bssgp_ran_information_pdu *req_pdu, + const struct gprs_rlcmac_bts *bts) +{ + memset(resp_pdu, 0, sizeof(*resp_pdu)); + mirror_rim_routing_info(resp_pdu, req_pdu); + + resp_pdu->decoded.rim_cont = (struct bssgp_ran_inf_rim_cont) { + .app_id = BSSGP_RAN_INF_APP_ID_NACC, + .seq_num = 1, /* single report has only one message in response */ + .pdu_ind = { + .pdu_type_ext = RIM_PDU_TYPE_SING_REP, + }, + .prot_ver = 1, + }; + + fill_app_cont_nacc(&resp_pdu->decoded.rim_cont.u.app_cont_nacc, bts); + resp_pdu->decoded_present = true; + resp_pdu->rim_cont_iei = BSSGP_IE_RI_RIM_CONTAINER; +} + /* Format a RAN INFORMATION ERROR PDU */ static void format_response_pdu_err(struct bssgp_ran_information_pdu *resp_pdu, struct bssgp_ran_information_pdu *req_pdu) @@ -148,7 +205,9 @@ /* Handle incoming RIM container */ switch (pdu->rim_cont_iei) { case BSSGP_IE_RI_REQ_RIM_CONTAINER: - LOGP(DRIM, LOGL_NOTICE, "BSSGP RIM (NSEI=%u) responding to RAN INFORMATION REQUEST not yet implemented!\n", nsei); + LOGP(DRIM, LOGL_NOTICE, "BSSGP RIM (NSEI=%u) responding to RAN INFORMATION REQUEST ...\n", nsei); + format_response_pdu(&resp_pdu, pdu, bts); + bssgp_tx_rim(&resp_pdu, nsei); break; case BSSGP_IE_RI_RIM_CONTAINER: LOGP(DRIM, LOGL_NOTICE, "BSSGP RIM (NSEI=%u) responding to RAN INFORMATION not yet implemented!\n", nsei); diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 8ae74d5..7054d1b 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -656,6 +656,33 @@ goto bssgp_failed; } + if (info_ind->si1_is_set) { + LOGP(DL1IF, LOGL_DEBUG, " si1=%s\n", osmo_hexdump_nospc(info_ind->si1, GSM_MACBLOCK_LEN)); + memcpy(bts->si1, info_ind->si1, GSM_MACBLOCK_LEN); + bts->si1_is_set = true; + } else { + LOGP(DL1IF, LOGL_DEBUG, " si1=(not set)\n"); + bts->si1_is_set = false; + } + + if (info_ind->si3_is_set) { + LOGP(DL1IF, LOGL_DEBUG, " si3=%s\n", osmo_hexdump_nospc(info_ind->si3, GSM_MACBLOCK_LEN)); + memcpy(bts->si3, info_ind->si3, GSM_MACBLOCK_LEN); + bts->si3_is_set = true; + } else { + LOGP(DL1IF, LOGL_DEBUG, " si3=(not set)\n"); + bts->si3_is_set = false; + } + + if (info_ind->si13_is_set) { + LOGP(DL1IF, LOGL_DEBUG, " si13=%s\n", osmo_hexdump_nospc(info_ind->si13, GSM_MACBLOCK_LEN)); + memcpy(bts->si13, info_ind->si13, GSM_MACBLOCK_LEN); + bts->si13_is_set = true; + } else { + LOGP(DL1IF, LOGL_DEBUG, " si13=(not set)\n"); + bts->si13_is_set = false; + } + if (info_ind->t3142) { /* if timer values are set */ osmo_tdef_set(bts->T_defs_bts, 3142, info_ind->t3142, OSMO_TDEF_S); osmo_tdef_set(bts->T_defs_bts, 3169, info_ind->t3169, OSMO_TDEF_S); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/22368 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Id72118120c14984d2fb1b918b41fac4868150d41 Gerrit-Change-Number: 22368 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210121/e79b6d27/attachment.htm>