From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:34:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:34:27 +0000 Subject: [PATCH] openbsc[master]: add DRANAP debug constant Message-ID: Review at https://gerrit.osmocom.org/190 add DRANAP debug constant Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2 --- M openbsc/include/openbsc/debug.h M openbsc/src/gprs/sgsn_main.c M openbsc/src/libcommon/debug.c 3 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/90/190/1 diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h index 189ca47..b6087e2 100644 --- a/openbsc/include/openbsc/debug.h +++ b/openbsc/include/openbsc/debug.h @@ -34,6 +34,7 @@ DSMPP, DFILTER, DGTPHUB, + DRANAP, Debug_LastEntry, }; diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index cb762b7..aef36ca 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -281,6 +281,11 @@ .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DRANAP] = { + .name = "DRANAP", + .description = "RAN Application Part (RANAP)", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static const struct log_info gprs_log_info = { diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c index 7fb3ecb..232f6f7 100644 --- a/openbsc/src/libcommon/debug.c +++ b/openbsc/src/libcommon/debug.c @@ -165,6 +165,11 @@ .description = "BSC/NAT IMSI based filtering", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DRANAP] = { + .name = "DRANAP", + .description = "Radio Access Network Application Part Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; enum log_filter { -- To view, visit https://gerrit.osmocom.org/190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:34:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:34:27 +0000 Subject: [PATCH] openbsc[master]: add DSUA debug constant Message-ID: Review at https://gerrit.osmocom.org/191 add DSUA debug constant Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 --- M openbsc/include/openbsc/debug.h M openbsc/src/gprs/sgsn_main.c M openbsc/src/libcommon/debug.c 3 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/91/191/1 diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h index b6087e2..43ebb19 100644 --- a/openbsc/include/openbsc/debug.h +++ b/openbsc/include/openbsc/debug.h @@ -35,6 +35,7 @@ DFILTER, DGTPHUB, DRANAP, + DSUA, Debug_LastEntry, }; diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index aef36ca..c852840 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -286,6 +286,11 @@ .description = "RAN Application Part (RANAP)", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DSUA] = { + .name = "DSUA", + .description = "SCCP User Adaptation (SUA)", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static const struct log_info gprs_log_info = { diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c index 232f6f7..cf5beeb 100644 --- a/openbsc/src/libcommon/debug.c +++ b/openbsc/src/libcommon/debug.c @@ -170,6 +170,11 @@ .description = "Radio Access Network Application Part Protocol", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DSUA] = { + .name = "DSUA", + .description = "SCCP User Adaptation Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; enum log_filter { -- To view, visit https://gerrit.osmocom.org/191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:34:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:34:28 +0000 Subject: [PATCH] openbsc[master]: add libiu Message-ID: Review at https://gerrit.osmocom.org/192 add libiu Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 --- M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/iu.h M openbsc/src/Makefile.am A openbsc/src/libiu/Makefile.am A openbsc/src/libiu/iu.c 6 files changed, 812 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/92/192/1 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index a933d66..97596ae 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -194,6 +194,7 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile + src/libiu/Makefile src/osmo-nitb/Makefile src/osmo-bsc/Makefile src/osmo-bsc_nat/Makefile diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index c272b14..2bca6b7 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -18,7 +18,8 @@ gprs_gb_parse.h smpp.h meas_feed.h \ gprs_gsup_client.h bsc_msg_filter.h \ oap.h oap_messages.h \ - gtphub.h + gtphub.h \ + iu.h openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h openbscdir = $(includedir)/openbsc diff --git a/openbsc/include/openbsc/iu.h b/openbsc/include/openbsc/iu.h new file mode 100644 index 0000000..1c4d7af --- /dev/null +++ b/openbsc/include/openbsc/iu.h @@ -0,0 +1,60 @@ +#pragma once + +#include + +struct sgsn_pdp_ctx; +struct msgb; +struct gprs_ra_id; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_GlobalRNC_ID; + +struct ue_conn_ctx { + struct llist_head list; + struct osmo_sua_link *link; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; +}; + +enum iu_event_type { + IU_EVENT_RAB_ASSIGN, + IU_EVENT_SECURITY_MODE_COMPLETE, + IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ + /* FIXME: maybe IU_EVENT_IU_RELEASE and IU_EVENT_LINK_INVALIDATED + * should be combined to one generic event that simply means the + * ue_conn_ctx should no longer be used, for whatever reason. */ +}; + +extern const struct value_string iu_event_type_names[]; +static inline const char *iu_event_type_str(enum iu_event_type e) +{ + return get_value_string(iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ +typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + /* TODO "gprs_" in generic CS+PS domain ^ */ + uint16_t *sai); + +typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, + enum iu_event_type type, void *data); + +typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port, + iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); + +void iu_link_del(struct osmo_sua_link *link); + +int iu_tx(struct msgb *msg, uint8_t sapi); + +int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); +int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); +int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, + int send_ck, int new_key); diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index 6f6174e..3a129b5 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -2,7 +2,7 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS) -SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libfilter osmo-nitb osmo-bsc_mgcp utils ipaccess gprs +SUBDIRS = libcommon libmgcp libbsc libiu libmsc libtrau libfilter osmo-nitb osmo-bsc_mgcp utils ipaccess gprs # Conditional modules if BUILD_NAT diff --git a/openbsc/src/libiu/Makefile.am b/openbsc/src/libiu/Makefile.am new file mode 100644 index 0000000..7b1ba4d --- /dev/null +++ b/openbsc/src/libiu/Makefile.am @@ -0,0 +1,10 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) \ + $(LIBASN1C_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) $(LIBOSMORANAP_CFLAGS) + +noinst_LIBRARIES = libiu.a + +libiu_a_SOURCES = iu.c + diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c new file mode 100644 index 0000000..2211767 --- /dev/null +++ b/openbsc/src/libiu/iu.c @@ -0,0 +1,738 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sua_link. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sua_link *link; +}; + +void *talloc_iu_ctx; + +int asn1_xer_print = 1; +void *talloc_asn1_ctx; + +iu_recv_cb_t global_iu_recv_cb = NULL; +iu_event_cb_t global_iu_event_cb = NULL; + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +const struct value_string iu_event_type_names[] = { +#define IU_EVT_STR(X) { X, #X } + IU_EVT_STR(IU_EVENT_RAB_ASSIGN), + IU_EVT_STR(IU_EVENT_SECURITY_MODE_COMPLETE), + IU_EVT_STR(IU_EVENT_IU_RELEASE), + IU_EVT_STR(IU_EVENT_LINK_INVALIDATED), +#undef IU_EVT_STR +}; + +struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sua_link *link, uint32_t conn_id) +{ + struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); + + ctx->link = link; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +struct ue_conn_ctx *ue_conn_ctx_find(struct osmo_sua_link *link, + uint32_t conn_id) +{ + struct ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->link == link && ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sua_link *link) +{ + struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->link = link; + llist_add(&rnc->entry, &rnc_list); + + LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sua_link *link) +{ + struct iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (link && rnc->link != link) + LOGP(DRANAP, LOGL_NOTICE, "RNC %d on new link" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + rnc->link = link; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, link); +} + +/* Discard/invalidate all ue_conn_ctx and iu_rnc entries that reference the + * given link, since this link is invalid and about to be deallocated. For + * each ue_conn_ctx, invoke the iu_event_cb_t with IU_EVENT_LINK_INVALIDATED. + */ +void iu_link_del(struct osmo_sua_link *link) +{ + struct iu_rnc *rnc, *rnc_next; + llist_for_each_entry_safe(rnc, rnc_next, &rnc_list, entry) { + if (!rnc->link) + continue; + if (rnc->link != link) + continue; + rnc->link = NULL; + llist_del(&rnc->entry); + talloc_free(rnc); + } + + struct ue_conn_ctx *uec, *uec_next; + llist_for_each_entry_safe(uec, uec_next, &ue_conn_ctx_list, list) { + if (uec->link != link) + continue; + uec->link = NULL; + global_iu_event_cb(uec, IU_EVENT_LINK_INVALIDATED, NULL); + } +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sua_user_link_down(ue_ctx->link, &prim->oph); +} + +int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + uint8_t ik[16]; + uint8_t ck[16]; + unsigned int i; + + /* C5 function to derive IK from Kc */ + for (i = 0; i < 4; i++) + ik[i] = tp->vec.kc[i] ^ tp->vec.kc[i+4]; + memcpy(ik+4, tp->vec.kc, 8); + for (i = 12; i < 16; i++) + ik[i] = ik[i-12]; + + if (send_ck) { + /* C4 function to derive CK from Kc */ + memcpy(ck, tp->vec.kc, 8); + memcpy(ck+8, tp->vec.kc, 8); + } + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(ik, send_ck? ck : NULL, new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, + struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, + struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct ue_conn_ctx *ue_conn = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGP(DRANAP, LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, ue_conn->link); + ue_conn->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SUA link %p conn_id %u)\n", + uectx->link, uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + return 0; +} + +static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + msg = ranap_new_msg_iu_rel_cmd(&ies->cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(ctx->link, &prim->oph); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGP(DRANAP, LOGL_INFO, "RAB Asignment Response:"); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + + LOGPC(DRANAP, LOGL_INFO, "\n"); + + return rc; +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +/* Send a paging command down a given SUA link. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sua_link *link, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + return osmo_sccp_tx_unitdata_ranap(link, 1, 2, msg->data, + msgb_length(msg)); +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (!rnc->link) { + /* Not actually connected, don't count it. */ + continue; + } + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(rnc->link, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGP(DRANAP, LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SUA link %p\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, rnc->link); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGP(DRANAP, LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sua_link *link); +int tx_conn_req(struct osmo_sua_link *link, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link) +{ + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ue_conn_ctx *ue; + + printf("sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + printf("N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGP(DGPRS, LOGL_NOTICE, "Received invalid N-CONNECT.ind\n"); + return 0; + } + ue = ue_conn_ctx_alloc(link, prim->u.connect.conn_id); + /* first ensure the local SUA/SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sua_user_link_down(link, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + printf("N-DISCONNECT.ind(%u)\n", prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(link, prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + printf("N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(link, prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + printf("N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, link, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port, + iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) +{ + struct osmo_sua_user *user; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + osmo_sua_set_log_area(DSUA); + user = osmo_sua_user_create(talloc_iu_ctx, sccp_sap_up, talloc_iu_ctx); + return osmo_sua_server_listen(user, listen_addr, listen_port); +} + -- To view, visit https://gerrit.osmocom.org/192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:47:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:47:55 +0000 Subject: [PATCH] openbsc[master]: gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL Message-ID: Review at https://gerrit.osmocom.org/193 gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL Add missing mmctx NULL check in gsm0408_rcv_gmm(). gsm48_tx_gmm_status() would dereference mmctx without checking, so we can't call it if mmctx == NULL. Follows up on recent e98ba82d2b07c835: "gprs_gmm.c: Don't try to de-reference NULL mmctx". Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/93/193/1 diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 68ba326..5848a63 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1464,7 +1464,10 @@ default: LOGMMCTXP(LOGL_NOTICE, mmctx, "Unknown GSM 04.08 GMM msg type 0x%02x\n", gh->msg_type); - rc = gsm48_tx_gmm_status(mmctx, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL); + if (mmctx) + rc = gsm48_tx_gmm_status(mmctx, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL); + else + rc = -EINVAL; break; } -- To view, visit https://gerrit.osmocom.org/193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:56:26 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:56:26 +0000 Subject: openbsc[master]: build: add libasn1c, libosmo-ranap and libosmo-sigtran In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 libasn1c is not part of the jenkins build yet. We should actually also add a ./configure switch to disable Iu to be able to build 2G without 3G dependencies. -- To view, visit https://gerrit.osmocom.org/189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:59:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:59:59 +0000 Subject: openbsc[master]: build: add libasn1c, libosmo-ranap and libosmo-sigtran In-Reply-To: References: Message-ID: Patch Set 1: > libasn1c is not part of the jenkins build yet. So I mean to say: makes sense to not even add libasn1c to jenkins until we have a proper configure switch in place and this still builds for 2G. -- To view, visit https://gerrit.osmocom.org/189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 2 23:35:10 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 2 Jun 2016 23:35:10 +0000 Subject: openbsc[master]: comment tweak for bsc_handover_start() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 can you use doxygen comment style? -- To view, visit https://gerrit.osmocom.org/176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 2 23:39:01 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 2 Jun 2016 23:39:01 +0000 Subject: openbsc[master]: cosmetic: declare local var at top In-Reply-To: References: Message-ID: Patch Set 1: isn't it C99? i like to move local vars in that context where it is. is there any coding style reference? -- To view, visit https://gerrit.osmocom.org/178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6f3394a18b6157f14469f676fff6849a503b694 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 2 23:42:34 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 2 Jun 2016 23:42:34 +0000 Subject: openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/179/1//COMMIT_MSG Commit Message: PS1, Line 7: Fix free slot search for chan_alloc_reverse == true I don't like fix xy. (even I'm also using it ;) what do you think about "implement reverse channels search for bts->chan_alloc_reverse" -- To view, visit https://gerrit.osmocom.org/179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie919bfcaabab5286cbbbb1dbda0c140c62289503 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 2 23:44:55 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 2 Jun 2016 23:44:55 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/180/1//COMMIT_MSG Commit Message: PS1, Line 9: See comment added in the code. this is not helpful. can you please write a (short) summary or remove this sentence? -- To view, visit https://gerrit.osmocom.org/180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 2 23:48:00 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 2 Jun 2016 23:48:00 +0000 Subject: osmo-pcu[master]: RFC: remove this == NULL checks In-Reply-To: References: Message-ID: Patch Set 1: I'll move the checks outside the function. -- To view, visit https://gerrit.osmocom.org/136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 2 23:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 2 Jun 2016 23:59:12 +0000 Subject: [ABANDON] osmo-pcu[master]: bts/counter: remove trailing white spaces from descriptions In-Reply-To: References: Message-ID: lynxis lazus has abandoned this change. Change subject: bts/counter: remove trailing white spaces from descriptions ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/67 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id852f3671d76a32df903f7a936b348b0d856d9c2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 00:57:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 00:57:07 +0000 Subject: [PATCH] openbsc[master]: add libiu In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/192 to look at the new patch set (#2). add libiu Co-Authored by dwillmann, laforge, nhofmeyr Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 --- M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/iu.h M openbsc/src/Makefile.am A openbsc/src/libiu/Makefile.am A openbsc/src/libiu/iu.c 6 files changed, 822 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/92/192/2 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 5cd5d2d..fccdb45 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -203,6 +203,7 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile + src/libiu/Makefile src/osmo-nitb/Makefile src/osmo-bsc/Makefile src/osmo-bsc_nat/Makefile diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index c272b14..2bca6b7 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -18,7 +18,8 @@ gprs_gb_parse.h smpp.h meas_feed.h \ gprs_gsup_client.h bsc_msg_filter.h \ oap.h oap_messages.h \ - gtphub.h + gtphub.h \ + iu.h openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h openbscdir = $(includedir)/openbsc diff --git a/openbsc/include/openbsc/iu.h b/openbsc/include/openbsc/iu.h new file mode 100644 index 0000000..1c4d7af --- /dev/null +++ b/openbsc/include/openbsc/iu.h @@ -0,0 +1,60 @@ +#pragma once + +#include + +struct sgsn_pdp_ctx; +struct msgb; +struct gprs_ra_id; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_GlobalRNC_ID; + +struct ue_conn_ctx { + struct llist_head list; + struct osmo_sua_link *link; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; +}; + +enum iu_event_type { + IU_EVENT_RAB_ASSIGN, + IU_EVENT_SECURITY_MODE_COMPLETE, + IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ + /* FIXME: maybe IU_EVENT_IU_RELEASE and IU_EVENT_LINK_INVALIDATED + * should be combined to one generic event that simply means the + * ue_conn_ctx should no longer be used, for whatever reason. */ +}; + +extern const struct value_string iu_event_type_names[]; +static inline const char *iu_event_type_str(enum iu_event_type e) +{ + return get_value_string(iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ +typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + /* TODO "gprs_" in generic CS+PS domain ^ */ + uint16_t *sai); + +typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, + enum iu_event_type type, void *data); + +typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port, + iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); + +void iu_link_del(struct osmo_sua_link *link); + +int iu_tx(struct msgb *msg, uint8_t sapi); + +int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); +int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); +int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, + int send_ck, int new_key); diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index 6f6174e..4aa880f 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -2,9 +2,18 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS) -SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libfilter osmo-nitb osmo-bsc_mgcp utils ipaccess gprs +# Libraries +SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libfilter -# Conditional modules +# Conditional Libraries +if BUILD_IU +SUBDIRS += libiu +endif + +# Programs +SUBDIRS += osmo-nitb osmo-bsc_mgcp utils ipaccess gprs + +# Conditional Programs if BUILD_NAT SUBDIRS += osmo-bsc_nat endif diff --git a/openbsc/src/libiu/Makefile.am b/openbsc/src/libiu/Makefile.am new file mode 100644 index 0000000..7b1ba4d --- /dev/null +++ b/openbsc/src/libiu/Makefile.am @@ -0,0 +1,10 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) \ + $(LIBASN1C_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) $(LIBOSMORANAP_CFLAGS) + +noinst_LIBRARIES = libiu.a + +libiu_a_SOURCES = iu.c + diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c new file mode 100644 index 0000000..2211767 --- /dev/null +++ b/openbsc/src/libiu/iu.c @@ -0,0 +1,738 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sua_link. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sua_link *link; +}; + +void *talloc_iu_ctx; + +int asn1_xer_print = 1; +void *talloc_asn1_ctx; + +iu_recv_cb_t global_iu_recv_cb = NULL; +iu_event_cb_t global_iu_event_cb = NULL; + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +const struct value_string iu_event_type_names[] = { +#define IU_EVT_STR(X) { X, #X } + IU_EVT_STR(IU_EVENT_RAB_ASSIGN), + IU_EVT_STR(IU_EVENT_SECURITY_MODE_COMPLETE), + IU_EVT_STR(IU_EVENT_IU_RELEASE), + IU_EVT_STR(IU_EVENT_LINK_INVALIDATED), +#undef IU_EVT_STR +}; + +struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sua_link *link, uint32_t conn_id) +{ + struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); + + ctx->link = link; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +struct ue_conn_ctx *ue_conn_ctx_find(struct osmo_sua_link *link, + uint32_t conn_id) +{ + struct ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->link == link && ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sua_link *link) +{ + struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->link = link; + llist_add(&rnc->entry, &rnc_list); + + LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sua_link *link) +{ + struct iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (link && rnc->link != link) + LOGP(DRANAP, LOGL_NOTICE, "RNC %d on new link" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + rnc->link = link; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, link); +} + +/* Discard/invalidate all ue_conn_ctx and iu_rnc entries that reference the + * given link, since this link is invalid and about to be deallocated. For + * each ue_conn_ctx, invoke the iu_event_cb_t with IU_EVENT_LINK_INVALIDATED. + */ +void iu_link_del(struct osmo_sua_link *link) +{ + struct iu_rnc *rnc, *rnc_next; + llist_for_each_entry_safe(rnc, rnc_next, &rnc_list, entry) { + if (!rnc->link) + continue; + if (rnc->link != link) + continue; + rnc->link = NULL; + llist_del(&rnc->entry); + talloc_free(rnc); + } + + struct ue_conn_ctx *uec, *uec_next; + llist_for_each_entry_safe(uec, uec_next, &ue_conn_ctx_list, list) { + if (uec->link != link) + continue; + uec->link = NULL; + global_iu_event_cb(uec, IU_EVENT_LINK_INVALIDATED, NULL); + } +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sua_user_link_down(ue_ctx->link, &prim->oph); +} + +int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + uint8_t ik[16]; + uint8_t ck[16]; + unsigned int i; + + /* C5 function to derive IK from Kc */ + for (i = 0; i < 4; i++) + ik[i] = tp->vec.kc[i] ^ tp->vec.kc[i+4]; + memcpy(ik+4, tp->vec.kc, 8); + for (i = 12; i < 16; i++) + ik[i] = ik[i-12]; + + if (send_ck) { + /* C4 function to derive CK from Kc */ + memcpy(ck, tp->vec.kc, 8); + memcpy(ck+8, tp->vec.kc, 8); + } + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(ik, send_ck? ck : NULL, new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, + struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, + struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct ue_conn_ctx *ue_conn = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGP(DRANAP, LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, ue_conn->link); + ue_conn->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SUA link %p conn_id %u)\n", + uectx->link, uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + return 0; +} + +static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + msg = ranap_new_msg_iu_rel_cmd(&ies->cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(ctx->link, &prim->oph); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGP(DRANAP, LOGL_INFO, "RAB Asignment Response:"); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + + LOGPC(DRANAP, LOGL_INFO, "\n"); + + return rc; +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +/* Send a paging command down a given SUA link. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sua_link *link, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + return osmo_sccp_tx_unitdata_ranap(link, 1, 2, msg->data, + msgb_length(msg)); +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (!rnc->link) { + /* Not actually connected, don't count it. */ + continue; + } + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(rnc->link, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGP(DRANAP, LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SUA link %p\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, rnc->link); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGP(DRANAP, LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sua_link *link); +int tx_conn_req(struct osmo_sua_link *link, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link) +{ + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ue_conn_ctx *ue; + + printf("sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + printf("N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGP(DGPRS, LOGL_NOTICE, "Received invalid N-CONNECT.ind\n"); + return 0; + } + ue = ue_conn_ctx_alloc(link, prim->u.connect.conn_id); + /* first ensure the local SUA/SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sua_user_link_down(link, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + printf("N-DISCONNECT.ind(%u)\n", prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(link, prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + printf("N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(link, prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + printf("N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, link, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port, + iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) +{ + struct osmo_sua_user *user; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + osmo_sua_set_log_area(DSUA); + user = osmo_sua_user_create(talloc_iu_ctx, sccp_sap_up, talloc_iu_ctx); + return osmo_sua_server_listen(user, listen_addr, listen_port); +} + -- To view, visit https://gerrit.osmocom.org/192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 00:57:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 00:57:07 +0000 Subject: [PATCH] openbsc[master]: configure.ac: add --enable-iu with deps asn1c, ranap, sigtran In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/189 to look at the new patch set (#2). configure.ac: add --enable-iu with deps asn1c, ranap, sigtran For upcoming 3G support. Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 --- M openbsc/configure.ac 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/89/189/2 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 60601fe..5cd5d2d 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -73,6 +73,18 @@ AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") AC_SUBST(osmo_ac_mgcp_transcoding) +# Enable/disable 3G aka IuPS + IuCS support? +AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], + [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) +if test "x$osmo_ac_iu" = "xyes" ; then + PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? + AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) +fi +AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") +AC_SUBST(osmo_ac_iu) + found_libgtp=yes PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) -- To view, visit https://gerrit.osmocom.org/189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jun 3 01:40:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 01:40:14 +0000 Subject: [PATCH] openbsc[master]: comment tweak for bsc_handover_start() In-Reply-To: References: Message-ID: Hello lynxis lazus, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/176 to look at the new patch set (#2). comment tweak for bsc_handover_start() Have a comment only in the .c file to remove dup, tweak wording, use doxygen style. Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 --- M openbsc/include/openbsc/handover.h M openbsc/src/libbsc/handover_logic.c 2 files changed, 3 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/76/176/2 diff --git a/openbsc/include/openbsc/handover.h b/openbsc/include/openbsc/handover.h index bd0d8ad..3fe71a2 100644 --- a/openbsc/include/openbsc/handover.h +++ b/openbsc/include/openbsc/handover.h @@ -3,9 +3,6 @@ struct gsm_subscriber_connection; -/* Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, - * after it has decided it wants to initiate HO to a specific BTS */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); /* clear any operation for this connection */ diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 2b8c386..56b623a 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -85,9 +85,9 @@ return NULL; } -/* Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, - * after it has decided it wants to initiate HO to a specific BTS */ +/*! \brief Hand over the specified logical channel to the specified new BTS. + * This is the main entry point for the actual handover algorithm, after the + * decision whether to initiate HO to a specific BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { struct gsm_lchan *new_lchan; -- To view, visit https://gerrit.osmocom.org/176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jun 3 02:09:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 02:09:46 +0000 Subject: openbsc[master]: comment tweak for bsc_handover_start() In-Reply-To: References: Message-ID: Patch Set 2: > can you use doxygen comment style? we don't even have doxygen in the openbsc build, but here you go -- To view, visit https://gerrit.osmocom.org/176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 3 11:24:09 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 3 Jun 2016 11:24:09 +0000 Subject: [PATCH] openbsc[master]: Store last used FN for TCH Message-ID: Review at https://gerrit.osmocom.org/194 Store last used FN for TCH It's necessary to properly compute timestamp compensation for RTP packets in case of DTX (or heavy packet loss). Related: OS#22 Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/94/194/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c3d5978..c7516c6 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -291,6 +291,7 @@ uint8_t len; } last_sid; uint8_t last_cmr; + uint32_t last_fn; } tch; /* BTS-side ciphering state (rx only, bi-directional, ...) */ uint8_t ciph_state; -- To view, visit https://gerrit.osmocom.org/194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 3 11:31:01 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 3 Jun 2016 11:31:01 +0000 Subject: [PATCH] osmo-bts[master]: Fix debug output Message-ID: Review at https://gerrit.osmocom.org/195 Fix debug output Previously frame number was not saved in case of PRIM_TCH rendering many debug statements with g_time useless. Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5 --- M src/osmo-bts-sysmo/tch.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/195/1 diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index fa21eb5..e08d8a6 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -567,6 +567,7 @@ l1sap = msgb_l1sap_prim(rmsg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); l1sap->u.tch.chan_nr = chan_nr; + l1sap->u.tch.fn = data_ind->u32Fn; return l1sap_up(trx, l1sap); } -- To view, visit https://gerrit.osmocom.org/195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 3 11:31:01 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 3 Jun 2016 11:31:01 +0000 Subject: [PATCH] osmo-bts[master]: Fix RTP timestamps in case of DTX Message-ID: Review at https://gerrit.osmocom.org/196 Fix RTP timestamps in case of DTX Compute RTP user_ts adjustment based on the difference between current and previous FN instead of hard-coded value. Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Related: OS#1562 --- M src/common/l1sap.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/196/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ac398d3..e060473 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -69,6 +69,13 @@ static int l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); +static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn, uint32_t base) +{ + if (last_fn) /* 8 samples, 120 ms, 26 bursts */ + return (fn - last_fn) * 8 * 120 / 26; + return base; +} + static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = { 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, @@ -853,7 +860,7 @@ /* hand msg to RTP code for transmission */ if (lchan->abis_ip.rtp_socket) osmo_rtp_send_frame(lchan->abis_ip.rtp_socket, - msg->data, msg->len, 160); + msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn, GSM_RTP_DURATION)); /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { @@ -871,7 +878,7 @@ msgb_enqueue(&lchan->dl_tch_queue, msg); } - + lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 3 12:49:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 12:49:48 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches Message-ID: Review at https://gerrit.osmocom.org/197 TEST on private branches Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 --- M openbsc/README 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/197/1 diff --git a/openbsc/README b/openbsc/README index 88ea328..4016fd1 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,5 @@ +TEST CHANGE + About OpenBSC ============= -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 3 12:49:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 12:49:48 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches, second commit Message-ID: Review at https://gerrit.osmocom.org/198 TEST on private branches, second commit Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed --- M openbsc/README 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/98/198/1 diff --git a/openbsc/README b/openbsc/README index 4016fd1..f35b60a 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,4 @@ +another TEST CHANGE TEST CHANGE About OpenBSC -- To view, visit https://gerrit.osmocom.org/198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:01:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:01:09 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches In-Reply-To: References: Message-ID: TEST on private branches Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 --- M openbsc/README 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/197/2 diff --git a/openbsc/README b/openbsc/README index 88ea328..e187f8c 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,5 @@ +TEST CHANGE + About OpenBSC ============= @@ -37,3 +39,5 @@ http://openbsc.osmocom.org/ Harald Welte + +test123 -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:01:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:01:09 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches, second commit In-Reply-To: References: Message-ID: TEST on private branches, second commit Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed --- M openbsc/README 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/98/198/2 diff --git a/openbsc/README b/openbsc/README index e187f8c..3c2fbcd 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,4 @@ +another tweaked CHANGE TEST CHANGE About OpenBSC -- To view, visit https://gerrit.osmocom.org/198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:03:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:03:29 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches In-Reply-To: References: Message-ID: TEST on private branches Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 --- M openbsc/README 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/197/3 diff --git a/openbsc/README b/openbsc/README index 88ea328..68e5ad6 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,5 @@ +TEST CHANGE + About OpenBSC ============= @@ -37,3 +39,5 @@ http://openbsc.osmocom.org/ Harald Welte + +test423 -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 2 22:34:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 2 Jun 2016 22:34:27 +0000 Subject: [PATCH] openbsc[master]: build: add libasn1c, libosmo-ranap and libosmo-sigtran Message-ID: Review at https://gerrit.osmocom.org/189 build: add libasn1c, libosmo-ranap and libosmo-sigtran For upcoming Iu. Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 --- M openbsc/configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/89/189/1 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 60601fe..a933d66 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -28,6 +28,9 @@ PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) +PKG_CHECK_MODULES(LIBASN1C, libasn1c) +PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # Enabke/disable the NAT? AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], -- To view, visit https://gerrit.osmocom.org/189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:17:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:17:55 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches, second commit In-Reply-To: References: Message-ID: TEST on private branches, second commit Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed --- M openbsc/README 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/98/198/4 diff --git a/openbsc/README b/openbsc/README index 68e5ad6..dacbefc 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,4 @@ +another tweaked CHANGE TEST CHANGE About OpenBSC @@ -40,4 +41,4 @@ Harald Welte -test423 +test42399 -- To view, visit https://gerrit.osmocom.org/198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:19:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:19:10 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches, second commit In-Reply-To: References: Message-ID: TEST on private branches, second commit Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed --- M openbsc/README 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/98/198/5 diff --git a/openbsc/README b/openbsc/README index 68e5ad6..bbce558 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,4 @@ +another tweaked CHANGE TEST CHANGE About OpenBSC @@ -40,4 +41,4 @@ Harald Welte -test423 +test4239999 -- To view, visit https://gerrit.osmocom.org/198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:31:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:31:20 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/197 to look at the new patch set (#4). TEST on private branches Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 --- M openbsc/README 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/197/4 diff --git a/openbsc/README b/openbsc/README index 88ea328..d7cba7c 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,5 @@ +TEST CHANGE + About OpenBSC ============= @@ -16,6 +18,9 @@ * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) * ipaccess-utils - some tools to discover + configure ip.access nanoBTS * bs11_config - a tool to configure the Siemens BS-11 microBTS + + +testing Various interfaces towards the BTS are supported, among which are: @@ -37,3 +42,5 @@ http://openbsc.osmocom.org/ Harald Welte + +test423 -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:31:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:31:20 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches, second commit In-Reply-To: References: Message-ID: TEST on private branches, second commit Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed --- M openbsc/README 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/98/198/6 diff --git a/openbsc/README b/openbsc/README index d7cba7c..32cf0a9 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,4 @@ +another tweaked CHANGE TEST CHANGE About OpenBSC @@ -43,4 +44,4 @@ Harald Welte -test423 +test42399990000 -- To view, visit https://gerrit.osmocom.org/198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:32:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:32:53 +0000 Subject: [PATCH] openbsc[master]: TEST on private branches In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/197 to look at the new patch set (#5). TEST on private branches Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 --- M openbsc/README 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/197/5 diff --git a/openbsc/README b/openbsc/README index 88ea328..fea6ce2 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,5 @@ +TEST CHANGE + About OpenBSC ============= @@ -16,6 +18,9 @@ * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) * ipaccess-utils - some tools to discover + configure ip.access nanoBTS * bs11_config - a tool to configure the Siemens BS-11 microBTS + + +testing123 Various interfaces towards the BTS are supported, among which are: @@ -37,3 +42,5 @@ http://openbsc.osmocom.org/ Harald Welte + +test423 -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 13:33:40 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 3 Jun 2016 13:33:40 +0000 Subject: [PATCH] openbsc[master]: TEST on prtivate branches In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/197 to look at the new patch set (#6). TEST on prtivate branches Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 --- M openbsc/AUTHORS M openbsc/README 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/197/6 diff --git a/openbsc/AUTHORS b/openbsc/AUTHORS index 91af515..5fcd216 100644 --- a/openbsc/AUTHORS +++ b/openbsc/AUTHORS @@ -7,3 +7,4 @@ Sylvain Munaut <246tnt at gmail.com> Jacob Erlbeck Neels Hofmeyr +test commit diff --git a/openbsc/README b/openbsc/README index 88ea328..fea6ce2 100644 --- a/openbsc/README +++ b/openbsc/README @@ -1,3 +1,5 @@ +TEST CHANGE + About OpenBSC ============= @@ -16,6 +18,9 @@ * OsmoGTPHUB - a hub aggregating many GTP links (between SGSN and GGSN) * ipaccess-utils - some tools to discover + configure ip.access nanoBTS * bs11_config - a tool to configure the Siemens BS-11 microBTS + + +testing123 Various interfaces towards the BTS are supported, among which are: @@ -37,3 +42,5 @@ http://openbsc.osmocom.org/ Harald Welte + +test423 -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 3 15:50:02 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 3 Jun 2016 15:50:02 +0000 Subject: [PATCH] osmo-bts[master]: Fix RTP timestamps in case of DTX In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/196 to look at the new patch set (#2). Fix RTP timestamps in case of DTX Compute RTP user_ts adjustment based on the difference between current and previous FN instead of hard-coded value. Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Related: OS#1562 --- M src/common/l1sap.c 1 file changed, 15 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/196/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ac398d3..bd9956a 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -69,6 +69,19 @@ static int l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); +static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn) +{ + if (last_fn) { + /* 8 samples, 120 ms, 26 bursts */ + uint32_t a = (fn - last_fn) * 8 * 120 / 26; + /* round to multiple of GSM_RTP_DURATION */ + uint32_t r = a + GSM_RTP_DURATION / 2; + r -= r % GSM_RTP_DURATION; + return r; + } + return GSM_RTP_DURATION; +} + static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = { 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, @@ -853,7 +866,7 @@ /* hand msg to RTP code for transmission */ if (lchan->abis_ip.rtp_socket) osmo_rtp_send_frame(lchan->abis_ip.rtp_socket, - msg->data, msg->len, 160); + msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn)); /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { @@ -871,7 +884,7 @@ msgb_enqueue(&lchan->dl_tch_queue, msg); } - + lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:34:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:34:10 +0000 Subject: osmo-bts[master]: Fix RTP timestamps in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/196/2/src/common/l1sap.c File src/common/l1sap.c: PS2, Line 75: 8 samples I think this could deserve some more verbose description. Particulraly where the '8 samples' comes from. It's 8 samples per milli-second (8000 Hz) as per spec. Also, it is 26 TDMA frames, not bursts What about a set of #defines (if we don't already have them or some of them) which should probably be part of libosmo-abis/trau: #define GSM_VOICE_SAMPLE_RATE_HZ 8000 #define GSM_VOICE_SAMPLES_PER_MS (GSM_VOICE_SAMPLE_RATE_HZ/1000) #define GSM_VOICE_MULTIFRAME 26 #define GSM_RTP_FRAME_DURATION_MS 20 #define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS*GSM_VOICE_SAMPLES_PER_MS) #define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) uint32_t ms_passed = (fn - last_fn) * GSM_TDMA_FRAME_MS; uin32_t samples_passed = ms_passed * GSM_VOICE_SAMPLES_PER_MS; and then calculate the rounded value? I think this is much easier to understand, as otherwise nobody will remember the details of the computation... -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:34:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:34:19 +0000 Subject: osmo-bts[master]: Fix RTP timestamps in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:34:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:34:46 +0000 Subject: openbsc[master]: Store last used FN for TCH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:35:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:35:20 +0000 Subject: osmo-bts[master]: Fix debug output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:35:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:35:23 +0000 Subject: [MERGED] osmo-bts[master]: Fix debug output In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix debug output ...................................................................... Fix debug output Previously frame number was not saved in case of PRIM_TCH rendering many debug statements with g_time useless. Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5 Reviewed-on: https://gerrit.osmocom.org/195 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/osmo-bts-sysmo/tch.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index fa21eb5..e08d8a6 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -567,6 +567,7 @@ l1sap = msgb_l1sap_prim(rmsg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); l1sap->u.tch.chan_nr = chan_nr; + l1sap->u.tch.fn = data_ind->u32Fn; return l1sap_up(trx, l1sap); } -- To view, visit https://gerrit.osmocom.org/195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:35:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:35:34 +0000 Subject: [MERGED] openbsc[master]: Store last used FN for TCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Store last used FN for TCH ...................................................................... Store last used FN for TCH It's necessary to properly compute timestamp compensation for RTP packets in case of DTX (or heavy packet loss). Related: OS#22 Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c3d5978..c7516c6 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -291,6 +291,7 @@ uint8_t len; } last_sid; uint8_t last_cmr; + uint32_t last_fn; } tch; /* BTS-side ciphering state (rx only, bi-directional, ...) */ uint8_t ciph_state; -- To view, visit https://gerrit.osmocom.org/194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:36:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:36:38 +0000 Subject: [MERGED] openbsc[master]: Add regexp authorization policy for IMSI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add regexp authorization policy for IMSI ...................................................................... Add regexp authorization policy for IMSI * extend "auth policy" vty command with new option "regexp" * add vty command "authorized-regexp" for setting arbitrary POSIX regular expression * add basic vty test * add optional "regexp" argument to subscriber-create-on-demand vty command With those in place we can now set the regexp against which MS's IMSI will be matched. If IMSI match the regexp than MS is allowed to access the network. If subscriber is already marked as authorized in HLR than it'll be allowed regardless of IMSI matching. The same way we can decide whether to create subscribers on-demand basesd on IMSI regexp match. Similar to authorization this restriction can be overridden by manually creating subscriber via vty, ctrl interface or directly in HLR. Change-Id: I525f4b80676de47d1d422686da2ca012301b0129 Fixes: OS#1647 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libcommon/gsm_data.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/vty_test_runner.py 6 files changed, 88 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index a08938c..31a4ed5 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -2,6 +2,8 @@ #define _GSM_DATA_H #include +#include +#include #include #include @@ -22,6 +24,7 @@ enum gsm_subscr_creation_mode { GSM_SUBSCR_DONT_CREATE = 0, GSM_SUBSCR_CREAT_W_RAND_EXT = 1, + GSM_SUBSCR_CREAT_W_REGEXP = 2, }; enum gsm_security_event { @@ -205,6 +208,7 @@ GSM_AUTH_POLICY_CLOSED, /* only subscribers authorized in DB */ GSM_AUTH_POLICY_ACCEPT_ALL, /* accept everyone, even if not authorized in DB */ GSM_AUTH_POLICY_TOKEN, /* accept first, send token per sms, then revoke authorization */ + GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */ }; #define GSM_T3101_DEFAULT 10 @@ -219,6 +223,8 @@ char *name_long; char *name_short; enum gsm_auth_policy auth_policy; + regex_t authorized_regexp; + char *authorized_reg_str; enum gsm48_reject_value reject_cause; int a5_encryption; int neci; diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 46ad457..f4d47b4 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -190,8 +190,11 @@ net->name_long, VTY_NEWLINE); vty_out(vty, " Short network name: '%s'%s", net->name_short, VTY_NEWLINE); - vty_out(vty, " Authentication policy: %s%s", - gsm_auth_policy_name(net->auth_policy), VTY_NEWLINE); + vty_out(vty, " Authentication policy: %s", + gsm_auth_policy_name(net->auth_policy)); + if (net->authorized_reg_str) + vty_out(vty, ", authorized regexp: %s", net->authorized_reg_str); + vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " Location updating reject cause: %u%s", net->reject_cause, VTY_NEWLINE); vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, @@ -791,6 +794,8 @@ vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE); vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE); vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE); + if (gsmnet->authorized_reg_str) + vty_out(vty, " authorized-regexp %s%s", gsmnet->authorized_reg_str, VTY_NEWLINE); vty_out(vty, " location updating reject cause %u%s", gsmnet->reject_cause, VTY_NEWLINE); vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); @@ -1398,17 +1403,34 @@ DEFUN(cfg_net_auth_policy, cfg_net_auth_policy_cmd, - "auth policy (closed|accept-all|token)", + "auth policy (closed|accept-all|regexp|token)", "Authentication (not cryptographic)\n" "Set the GSM network authentication policy\n" "Require the MS to be activated in HLR\n" "Accept all MS, whether in HLR or not\n" + "Use regular expression for IMSI authorization decision\n" "Use SMS-token based authentication\n") { enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]); struct gsm_network *gsmnet = gsmnet_from_vty(vty); gsmnet->auth_policy = policy; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_authorize_regexp, cfg_net_authorize_regexp_cmd, + "authorized-regexp REGEXP", + "Set regexp for IMSI which will be used for authorization decision\n" + "Regular expression, IMSIs matching it are allowed to use the network\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + if (gsm_parse_reg(gsmnet, &gsmnet->authorized_regexp, + &gsmnet->authorized_reg_str, argc, argv) != 0) { + vty_out(vty, "%%Failed to parse the authorized-regexp: '%s'%s", + argv[0], VTY_NEWLINE); + return CMD_WARNING; + } return CMD_SUCCESS; } @@ -3973,6 +3995,7 @@ install_element(GSMNET_NODE, &cfg_net_name_short_cmd); install_element(GSMNET_NODE, &cfg_net_name_long_cmd); install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd); + install_element(GSMNET_NODE, &cfg_net_authorize_regexp_cmd); install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd); install_element(GSMNET_NODE, &cfg_net_encryption_cmd); install_element(GSMNET_NODE, &cfg_net_neci_cmd); diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 4e235fd..9d794ee 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -162,6 +162,7 @@ { GSM_AUTH_POLICY_CLOSED, "closed" }, { GSM_AUTH_POLICY_ACCEPT_ALL, "accept-all" }, { GSM_AUTH_POLICY_TOKEN, "token" }, + { GSM_AUTH_POLICY_REGEXP, "regexp" }, { 0, NULL } }; diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 74da34b..92c4cfe 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -25,9 +25,12 @@ #include #include #include +#include #include #include #include +#include +#include #include "bscconfig.h" @@ -244,6 +247,17 @@ return -EINVAL; /* not reached */ } +static bool subscr_regexp_check(const struct gsm_network *net, const char *imsi) +{ + if (!net->authorized_reg_str) + return false; + + if (regexec(&net->authorized_regexp, imsi, 0, NULL, 0) != REG_NOMATCH) + return true; + + return false; +} + static int authorize_subscriber(struct gsm_loc_updating_operation *loc, struct gsm_subscriber *subscriber) { @@ -260,6 +274,13 @@ switch (subscriber->group->net->auth_policy) { case GSM_AUTH_POLICY_CLOSED: + return subscriber->authorized; + case GSM_AUTH_POLICY_REGEXP: + if (subscriber->authorized) + return 1; + if (subscr_regexp_check(subscriber->group->net, + subscriber->imsi)) + subscriber->authorized = 1; return subscriber->authorized; case GSM_AUTH_POLICY_TOKEN: if (subscriber->authorized) @@ -509,10 +530,14 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { - if (net->subscr_creation_mode != GSM_SUBSCR_DONT_CREATE) - return subscr_create_subscriber(net->subscr_group, imsi); + if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) + return NULL; - return NULL; + if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP) + if (!subscr_regexp_check(net, imsi)) + return NULL; + + return subscr_create_subscriber(net->subscr_group, imsi); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 5d74e04..3f67b9a 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -1032,11 +1032,15 @@ } DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, - "subscriber-create-on-demand", - "Make a new record when a subscriber is first seen.\n") + "subscriber-create-on-demand [regexp]", + "Make a new record when a subscriber is first seen.\n" + "Create subscribers only if IMSI matches the regexp specified in " + "authorized-regexp command\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + if (argc) + gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; return CMD_SUCCESS; } @@ -1070,9 +1074,12 @@ static int config_write_nitb(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); + enum gsm_subscr_creation_mode scm = gsmnet->subscr_creation_mode; + const char *reg = (scm & GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", + *pref = scm ? "" : "no "; vty_out(vty, "nitb%s", VTY_NEWLINE); - vty_out(vty, " %ssubscriber-create-on-demand%s", - gsmnet->subscr_creation_mode ? "" : "no ", VTY_NEWLINE); + vty_out(vty, " %ssubscriber-create-on-demand%s%s", + pref, reg, VTY_NEWLINE); vty_out(vty, " %sassign-tmsi%s", gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE); return CMD_SUCCESS; diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index c088855..c264328 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -231,6 +231,22 @@ self.assertEquals(self.vty.node(), 'config-mncc-int') + def testVtyAuthorization(self): + self.vty.enable() + self.vty.command("configure terminal") + self.vty.command("network") + self.assertTrue(self.vty.verify("auth policy closed", [''])) + self.assertTrue(self.vty.verify("auth policy regexp", [''])) + self.assertTrue(self.vty.verify("authorized-regexp ^001", [''])) + self.assertTrue(self.vty.verify("authorized-regexp 02$", [''])) + self.assertTrue(self.vty.verify("authorized-regexp *123.*", [''])) + self.vty.command("end") + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand regexp", [''])) + self.vty.command("end") + def testSi2Q(self): self.vty.enable() self.vty.command("configure terminal") -- To view, visit https://gerrit.osmocom.org/104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I525f4b80676de47d1d422686da2ca012301b0129 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:37:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:37:03 +0000 Subject: openbsc[master]: gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:39:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:39:05 +0000 Subject: openbsc[master]: dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:40:06 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:40:06 +0000 Subject: openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b7cff07ad9ac281a212daff8106a7d65c3c3145 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:42:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:42:01 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/180/2/openbsc/src/libbsc/chan_alloc.c File openbsc/src/libbsc/chan_alloc.c: Line 100: * pchan must match; but when looking for TCH/F, allow a match not sure if I understand the code fully, but we sould always try to finda "pure" (static) TCH/F first, and only if none are available use the dynamic TCH/F / PDCH. Otherwise we could end up finding a dynamic channel first, allocate that to TCH and meanwhile have an idle wasted static TCH/F -- To view, visit https://gerrit.osmocom.org/180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:42:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:42:34 +0000 Subject: openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie919bfcaabab5286cbbbb1dbda0c140c62289503 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:43:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:43:43 +0000 Subject: openbsc[master]: cosmetic: declare local var at top In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 As the variable is local to the for loop, it is declared at the "top of the block", so I think your change actually makes it worse by exposing a varaible that has no significance outside of the block to outside code. -- To view, visit https://gerrit.osmocom.org/178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6f3394a18b6157f14469f676fff6849a503b694 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:44:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:44:07 +0000 Subject: openbsc[master]: debug log: cosmetic fixes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fb7a1c1beabb1f4388517383fd0bdc082d557ca Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:44:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:44:27 +0000 Subject: openbsc[master]: comment tweak for bsc_handover_start() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:47:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:47:12 +0000 Subject: openbsc[master]: add DSUA debug constant In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/191/2/openbsc/src/gprs/sgsn_main.c File openbsc/src/gprs/sgsn_main.c: Line 292: .enabled = 1, .loglevel = LOGL_DEBUG, not sure if DEBUG is such a suitable default, we should fix that in other / older logging subsystems, and try to avoid introducing more. However, this can be one extra patch changing all DEBUG to INFO or NOTICE by default. We should expect the normal user not interested in debugging... https://gerrit.osmocom.org/#/c/191/2/openbsc/src/libcommon/debug.c File openbsc/src/libcommon/debug.c: Line 173: [DSUA] = { Why do we have to declare it both in libcommon and in sgsn? Because libcommon is not linked into sgsn? -- To view, visit https://gerrit.osmocom.org/191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:47:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:47:40 +0000 Subject: openbsc[master]: configure.ac: add --enable-iu with deps asn1c, ranap, sigtran In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 09:49:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 5 Jun 2016 09:49:57 +0000 Subject: openbsc[master]: add libiu In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/192/2/openbsc/src/libiu/iu.c File openbsc/src/libiu/iu.c: Line 1: #include copyright statement and AGPLv3+ header missing Line 57: struct osmo_sua_link *link; as it is a SCCP User SAP, we should hide the sua specific bits inside the implementation and have users (like libiu) use a 'struct osmo_sccp_link' instead. -- To view, visit https://gerrit.osmocom.org/192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 5 13:36:46 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 5 Jun 2016 13:36:46 +0000 Subject: [PATCH] libosmocore[master]: gsm48.c: move to hex tmsi representation Message-ID: Review at https://gerrit.osmocom.org/199 gsm48.c: move to hex tmsi representation Because we should save the backward compatibility with other projects that use this library, there is one new gsm48_mid_to_string() method which is similar to the gsm48_mi_to_string() but uses the '0x%08x' format string to convert TMSI. Also there is one more gsm48_tmsi_from_string() method that was moved here from OpenBSC/gsm_subscriber.h. Change-Id: I9d05209e546d8692360860839fa0720fb7349385 --- M include/osmocom/gsm/gsm48.h M src/gsm/gsm48.c 2 files changed, 58 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/199/1 diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index d6e58c2..3b6a80b 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -29,10 +29,12 @@ int gsm48_generate_mid_from_tmsi(uint8_t *buf, uint32_t tmsi); int gsm48_generate_mid_from_imsi(uint8_t *buf, const char *imsi); -/* Convert Mobile Identity (10.5.1.4) to string */ +/* Mobile Identity (10.5.1.4) related methods */ +const char *gsm48_mi_type_name(uint8_t mi); int gsm48_mi_to_string(char *string, const int str_len, const uint8_t *mi, const int mi_len); -const char *gsm48_mi_type_name(uint8_t mi); +int gsm48_mid_to_string(char *string, const int str_len, + const uint8_t *mi, const int mi_len); /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 8a46f76..0399aac 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -443,7 +443,10 @@ return 2 + buf[1]; } -/* Convert Mobile Identity (10.5.1.4) to string */ +/* Convert Mobile Identity (10.5.1.4) to string. + * Now it is outdated method because we are moving to + * hexadecimal TMSI representation, so we should use + * the gsm48_mid_to_string() instead of this one. */ int gsm48_mi_to_string(char *string, const int str_len, const uint8_t *mi, const int mi_len) { @@ -470,7 +473,7 @@ case GSM_MI_TYPE_IMEISV: *str_cur++ = osmo_bcd2char(mi[0] >> 4); - for (i = 1; i < mi_len; i++) { + for (i = 1; i < mi_len; i++) { if (str_cur + 2 >= string + str_len) return str_cur - string; *str_cur++ = osmo_bcd2char(mi[i] & 0xf); @@ -487,6 +490,55 @@ return str_cur - string; } +int gsm48_mid_to_string(char *string, const int str_len, const uint8_t *mi, + const int mi_len) +{ + int i; + uint8_t mi_type; + char *str_cur = string; + uint32_t tmsi; + + mi_type = mi[0] & GSM_MI_TYPE_MASK; + + switch (mi_type) { + case GSM_MI_TYPE_NONE: + break; + case GSM_MI_TYPE_TMSI: + if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) { + memcpy(&tmsi, &mi[1], 4); + tmsi = ntohl(tmsi); + return snprintf(string, str_len, "0x%08x", tmsi); + } + break; + case GSM_MI_TYPE_IMSI: + case GSM_MI_TYPE_IMEI: + case GSM_MI_TYPE_IMEISV: + *str_cur++ = osmo_bcd2char(mi[0] >> 4); + + for (i = 1; i < mi_len; i++) { + if (str_cur + 2 >= string + str_len) + return str_cur - string; + *str_cur++ = osmo_bcd2char(mi[i] & 0xf); + /* skip last nibble in last input byte when GSM_EVEN */ + if( (i != mi_len-1) || (mi[0] & GSM_MI_ODD)) + *str_cur++ = osmo_bcd2char(mi[i] >> 4); + } + break; + default: + break; + } + *str_cur++ = '\0'; + + return str_cur - string; +} + +uint32_t gsm48_tmsi_from_string(char *mi_string) +{ + /* It is not required to cut the '0x' because + * the strtoul() can handle it automatically */ + return strtoul(mi_string, NULL, 16); +} + void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf) { raid->mcc = (buf[0] & 0xf) * 100; -- To view, visit https://gerrit.osmocom.org/199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d05209e546d8692360860839fa0720fb7349385 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:00:57 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:00:57 +0000 Subject: [ABANDON] openbsc[master]: TEST on private branches, second commit In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST on private branches, second commit ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2a3f8d5bd56816fd9883996f9a189e3f5afb5eed Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:01:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:01:03 +0000 Subject: [ABANDON] openbsc[master]: TEST on prtivate branches In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST on prtivate branches ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6e3ae86a82ccba426254d2db3387b03b2a596315 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:01:26 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:01:26 +0000 Subject: [MERGED] openbsc[master]: comment tweak for bsc_handover_start() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: comment tweak for bsc_handover_start() ...................................................................... comment tweak for bsc_handover_start() Have a comment only in the .c file to remove dup, tweak wording, use doxygen style. Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 --- M openbsc/include/openbsc/handover.h M openbsc/src/libbsc/handover_logic.c 2 files changed, 3 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/handover.h b/openbsc/include/openbsc/handover.h index bd0d8ad..3fe71a2 100644 --- a/openbsc/include/openbsc/handover.h +++ b/openbsc/include/openbsc/handover.h @@ -3,9 +3,6 @@ struct gsm_subscriber_connection; -/* Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, - * after it has decided it wants to initiate HO to a specific BTS */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); /* clear any operation for this connection */ diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c index 2b8c386..56b623a 100644 --- a/openbsc/src/libbsc/handover_logic.c +++ b/openbsc/src/libbsc/handover_logic.c @@ -85,9 +85,9 @@ return NULL; } -/* Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, - * after it has decided it wants to initiate HO to a specific BTS */ +/*! \brief Hand over the specified logical channel to the specified new BTS. + * This is the main entry point for the actual handover algorithm, after the + * decision whether to initiate HO to a specific BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { struct gsm_lchan *new_lchan; -- To view, visit https://gerrit.osmocom.org/176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:02:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:02:10 +0000 Subject: [MERGED] openbsc[master]: debug log: cosmetic fixes In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: debug log: cosmetic fixes ...................................................................... debug log: cosmetic fixes Drop erroneous C from a DEBUGPC, should be on a new line. Drop underscores from IPAC_PDCH_[DE]ACT: all other log messages for IPAC PDCH are without underscores -- git grep "P(.*IPAC.PDCH.*ACT" Change-Id: I8fb7a1c1beabb1f4388517383fd0bdc082d557ca --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index c3a0c5c..abe2f9b 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1224,7 +1224,7 @@ LOGP(DRSL, LOGL_ERROR, "%s CHANNEL MODE MODIFY NACK\n", ts_name); break; case RSL_MT_IPAC_PDCH_ACT_ACK: - DEBUGPC(DRSL, "%s IPAC PDCH ACT ACK\n", ts_name); + DEBUGP(DRSL, "%s IPAC PDCH ACT ACK\n", ts_name); msg->lchan->ts->flags |= TS_F_PDCH_MODE; break; case RSL_MT_IPAC_PDCH_ACT_NACK: @@ -1951,7 +1951,7 @@ dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; dh->chan_nr = gsm_ts2chan_nr(ts, 0); - DEBUGP(DRSL, "%s IPAC_PDCH_%sACT\n", gsm_ts_name(ts), + DEBUGP(DRSL, "%s IPAC PDCH %sACT\n", gsm_ts_name(ts), act ? "" : "DE"); msg->dst = ts->trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fb7a1c1beabb1f4388517383fd0bdc082d557ca Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:10:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:10:49 +0000 Subject: openbsc[master]: cosmetic: declare local var at top In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 > As the variable is local to the for loop, it is declared at the > "top of the block", so I think your change actually makes it worse > by exposing a varaible that has no significance outside of the > block to outside code. I am totally with you. In gtphub, I first had variable declarations right above where I use them. But then Holger asked me to stay in osmocom style, which wants to have vars declared on top. I would be the first to cheer when this style were dropped, my single reason to move this var declaration was http://i.stack.imgur.com/MyQki.jpg (Actually, this was Holger's reference to justify that style.) And probably that I'm not sufficiently aware of the C99 standard: > isn't it C99? i like to move local vars in that context where it > is. is there any coding style reference? Let's drop this patch then. (Let's see how gerrit handles a branch resubmission with one commit from it gone; just abandoning this will cause merge conflicts...) -- To view, visit https://gerrit.osmocom.org/178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6f3394a18b6157f14469f676fff6849a503b694 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:13:01 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:13:01 +0000 Subject: [MERGED] openbsc[master]: configure.ac: add --enable-iu with deps asn1c, ranap, sigtran In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: configure.ac: add --enable-iu with deps asn1c, ranap, sigtran ...................................................................... configure.ac: add --enable-iu with deps asn1c, ranap, sigtran For upcoming 3G support. Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 --- M openbsc/configure.ac 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 60601fe..5cd5d2d 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -73,6 +73,18 @@ AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") AC_SUBST(osmo_ac_mgcp_transcoding) +# Enable/disable 3G aka IuPS + IuCS support? +AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], + [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"]) +if test "x$osmo_ac_iu" = "xyes" ; then + PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version? + PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version? + PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version? + AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support]) +fi +AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes") +AC_SUBST(osmo_ac_iu) + found_libgtp=yes PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no) -- To view, visit https://gerrit.osmocom.org/189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:36:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:36:06 +0000 Subject: openbsc[master]: add DSUA debug constant In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/191/2/openbsc/src/gprs/sgsn_main.c File openbsc/src/gprs/sgsn_main.c: Line 292: .enabled = 1, .loglevel = LOGL_DEBUG, > not sure if DEBUG is such a suitable default, we should fix that in other / while the 3G stuff is still unstable, I'd personally prefer having DEBUG by default, because "normal users" will be practically us developing on it. But I fully agree in principle. Let's move away from DEBUG soon-ish. https://gerrit.osmocom.org/#/c/191/2/openbsc/src/libcommon/debug.c File openbsc/src/libcommon/debug.c: Line 173: [DSUA] = { > Why do we have to declare it both in libcommon and in sgsn? Because libcomm hmm, interesting point... actually libcommon *is* linked to osmo-sgsn. But sgsn_main.c defines an own gprs_loginfo with own gprs_categories. Actually this applies to pretty much all of the D* in gprs_categories in sgsn_main.c. I'm not sure whether osmo-sgsn wants to explicitly have less categories than libcommon provides in its default_categories. (BTW we also define DSUA in osmo-iuh in hnbgw.h and hnbgw.c and libosmo-sccp in sua.c) In conclusion, If this needs to change I think that that should happen outside of the IuPS topic and along with all the other D* in sgsn_main.c -- To view, visit https://gerrit.osmocom.org/191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:36:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:36:28 +0000 Subject: [MERGED] openbsc[master]: gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL ...................................................................... gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL Add missing mmctx NULL check in gsm0408_rcv_gmm(). gsm48_tx_gmm_status() would dereference mmctx without checking, so we can't call it if mmctx == NULL. Follows up on recent e98ba82d2b07c835: "gprs_gmm.c: Don't try to de-reference NULL mmctx". Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 68ba326..5848a63 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1464,7 +1464,10 @@ default: LOGMMCTXP(LOGL_NOTICE, mmctx, "Unknown GSM 04.08 GMM msg type 0x%02x\n", gh->msg_type); - rc = gsm48_tx_gmm_status(mmctx, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL); + if (mmctx) + rc = gsm48_tx_gmm_status(mmctx, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL); + else + rc = -EINVAL; break; } -- To view, visit https://gerrit.osmocom.org/193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:37:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:37:10 +0000 Subject: [ABANDON] openbsc[master]: cosmetic: declare local var at top In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: cosmetic: declare local var at top ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie6f3394a18b6157f14469f676fff6849a503b694 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:45:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:45:04 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/181 to look at the new patch set (#3). dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I5b7cff07ad9ac281a212daff8106a7d65c3c3145 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 45 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/81/181/3 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..7cd83b1 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -256,6 +256,12 @@ struct gsm48_req_ref *rqd_ref; struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + } dyn_pdch; #else /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. * Currently we don't share these headers so this is a magic number. */ diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index abe2f9b..59176df 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -470,6 +470,15 @@ if (rc < 0) return rc; + /* if channel is in PDCH mode, deactivate PDCH first */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH + && (lchan->ts->flags & TS_F_PDCH_MODE)) { + /* store activation type and handover reference */ + lchan->dyn_pdch.act_type = act_type; + lchan->dyn_pdch.ho_ref = ho_ref; + return rsl_ipacc_pdch_activate(lchan->ts, 0); + } + ta = lchan->rqd_ta; /* BS11 requires TA shifted by 2 bits */ @@ -746,6 +755,11 @@ LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + + /* Put PDCH channel back into PDCH mode first */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + return rsl_ipacc_pdch_activate(lchan->ts, 1); + do_lchan_free(lchan); return 0; @@ -1187,6 +1201,26 @@ return 0; } +static int rsl_rx_pdch_act_ack(struct msgb *msg) +{ + msg->lchan->ts->flags |= TS_F_PDCH_MODE; + + /* We have activated PDCH, so now the channel is available again. */ + do_lchan_free(msg->lchan); + + return 0; +} + +static int rsl_rx_pdch_deact_ack(struct msgb *msg) +{ + msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + + rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, + msg->lchan->dyn_pdch.ho_ref); + + return 0; +} + static int abis_rsl_rx_dchan(struct msgb *msg) { struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg); @@ -1225,14 +1259,14 @@ break; case RSL_MT_IPAC_PDCH_ACT_ACK: DEBUGP(DRSL, "%s IPAC PDCH ACT ACK\n", ts_name); - msg->lchan->ts->flags |= TS_F_PDCH_MODE; + rc = rsl_rx_pdch_act_ack(msg); break; case RSL_MT_IPAC_PDCH_ACT_NACK: LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH ACT NACK\n", ts_name); break; case RSL_MT_IPAC_PDCH_DEACT_ACK: DEBUGP(DRSL, "%s IPAC PDCH DEACT ACK\n", ts_name); - msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + rc = rsl_rx_pdch_deact_ack(msg); break; case RSL_MT_IPAC_PDCH_DEACT_NACK: LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH DEACT NACK\n", ts_name); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 5c27862..04452f7 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -329,8 +329,10 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { generate_ma_for_ts(&cur_trx->ts[i]); + cur_trx->ts[i].flags |= TS_F_PDCH_MODE; + } } } if (isd->link_type == E1INP_SIGN_RSL) -- To view, visit https://gerrit.osmocom.org/181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5b7cff07ad9ac281a212daff8106a7d65c3c3145 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:45:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:45:04 +0000 Subject: [PATCH] openbsc[master]: dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/182 to look at the new patch set (#3). dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP Add dyn_pdch_init() and call from inp_sig_cb() upon RSL UP. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT, i.e. when the PDCH ACT ACK messages are received. Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 34 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/82/182/3 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 04452f7..0c0eb84 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -302,6 +302,36 @@ generate_ma_for_ts(&trx->ts[i]); } +static void dyn_pdch_init(struct gsm_bts_trx *trx) +{ + unsigned int i; + struct gsm_bts_trx_ts *ts; + int rc; + unsigned int pdch_act_count = 0; + + for (i = 0; i < TRX_NR_TS; i++) { + ts = &trx->ts[i]; + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + rc = rsl_ipacc_pdch_activate(ts, 1); + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "Failed to activate PDCH on" + " BTS %u TRX %u TS %u: %d\n", + trx->bts->nr, trx->nr, i, rc); + continue; + } + pdch_act_count ++; + } + } + + if (pdch_act_count) { + LOGP(DRSL, LOGL_NOTICE, + "Activated PDCH on %u dynamic TCH/F_PDCH time slots" + " for BTS %u TRX %u\n", + pdch_act_count, trx->bts->nr, trx->nr); + } +} + /* Callback function to be called every time we receive a signal from INPUT */ static int inp_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -329,14 +359,14 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); - cur_trx->ts[i].flags |= TS_F_PDCH_MODE; - } } } - if (isd->link_type == E1INP_SIGN_RSL) + if (isd->link_type == E1INP_SIGN_RSL) { bootstrap_rsl(trx); + dyn_pdch_init(trx); + } break; case S_L_INP_TEI_DN: LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx); -- To view, visit https://gerrit.osmocom.org/182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:48:31 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:48:31 +0000 Subject: openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 restore +2 from hwelte after cosmetic change due to rebase after abandoning https://gerrit.osmocom.org/178 -- To view, visit https://gerrit.osmocom.org/181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5b7cff07ad9ac281a212daff8106a7d65c3c3145 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:49:40 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:49:40 +0000 Subject: openbsc[master]: dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 restore +2 from hwelte after cosmetic change due to rebase after abandoning https://gerrit.osmocom.org/178 -- To view, visit https://gerrit.osmocom.org/182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 5 23:56:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 5 Jun 2016 23:56:02 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/180/1//COMMIT_MSG Commit Message: PS1, Line 9: See comment added in the code. > this is not helpful. can you please write a (short) summary or remove this Ok, "see comment" disrupts the commit log reading experience, but in fact there's not much to add to the summary line. Instead I would drop this line from the commit log, or just say "Add comment". https://gerrit.osmocom.org/#/c/180/2/openbsc/src/libbsc/chan_alloc.c File openbsc/src/libbsc/chan_alloc.c: Line 100: * pchan must match; but when looking for TCH/F, allow a match > not sure if I understand the code fully, but we sould always try to finda " Good point, I didn't catch this causality in jolly's patch. Will fix. -- To view, visit https://gerrit.osmocom.org/180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 6 00:07:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 00:07:13 +0000 Subject: openbsc[master]: add libiu In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/192/2/openbsc/src/libiu/iu.c File openbsc/src/libiu/iu.c: Line 1: #include > copyright statement and AGPLv3+ header missing whoa, how did that happen. thanks! Line 57: struct osmo_sua_link *link; > as it is a SCCP User SAP, we should hide the sua specific bits inside the i i.e. add struct osmo_sccp_link to libosmo-sccp? let's look at this in person one of these days. -- To view, visit https://gerrit.osmocom.org/192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 6 00:16:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 00:16:18 +0000 Subject: [PATCH] openbsc[master]: add libiu In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/192 to look at the new patch set (#3). add libiu Co-Authored by dwillmann, laforge, nhofmeyr Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 --- M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/iu.h M openbsc/src/Makefile.am A openbsc/src/libiu/Makefile.am A openbsc/src/libiu/iu.c 6 files changed, 842 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/92/192/3 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 5cd5d2d..fccdb45 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -203,6 +203,7 @@ src/libmgcp/Makefile src/libcommon/Makefile src/libfilter/Makefile + src/libiu/Makefile src/osmo-nitb/Makefile src/osmo-bsc/Makefile src/osmo-bsc_nat/Makefile diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index c272b14..2bca6b7 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -18,7 +18,8 @@ gprs_gb_parse.h smpp.h meas_feed.h \ gprs_gsup_client.h bsc_msg_filter.h \ oap.h oap_messages.h \ - gtphub.h + gtphub.h \ + iu.h openbsc_HEADERS = gsm_04_08.h meas_rep.h bsc_api.h openbscdir = $(includedir)/openbsc diff --git a/openbsc/include/openbsc/iu.h b/openbsc/include/openbsc/iu.h new file mode 100644 index 0000000..1c4d7af --- /dev/null +++ b/openbsc/include/openbsc/iu.h @@ -0,0 +1,60 @@ +#pragma once + +#include + +struct sgsn_pdp_ctx; +struct msgb; +struct gprs_ra_id; + +struct RANAP_RAB_SetupOrModifiedItemIEs_s; +struct RANAP_GlobalRNC_ID; + +struct ue_conn_ctx { + struct llist_head list; + struct osmo_sua_link *link; + uint32_t conn_id; + int integrity_active; + struct gprs_ra_id ra_id; +}; + +enum iu_event_type { + IU_EVENT_RAB_ASSIGN, + IU_EVENT_SECURITY_MODE_COMPLETE, + IU_EVENT_IU_RELEASE, /* An actual Iu Release message was received */ + IU_EVENT_LINK_INVALIDATED, /* A SUA link was lost or closed down */ + /* FIXME: maybe IU_EVENT_IU_RELEASE and IU_EVENT_LINK_INVALIDATED + * should be combined to one generic event that simply means the + * ue_conn_ctx should no longer be used, for whatever reason. */ +}; + +extern const struct value_string iu_event_type_names[]; +static inline const char *iu_event_type_str(enum iu_event_type e) +{ + return get_value_string(iu_event_type_names, e); +} + +/* Implementations of iu_recv_cb_t shall find the ue_conn_ctx in msg->dst. */ +typedef int (* iu_recv_cb_t )(struct msgb *msg, struct gprs_ra_id *ra_id, + /* TODO "gprs_" in generic CS+PS domain ^ */ + uint16_t *sai); + +typedef int (* iu_event_cb_t )(struct ue_conn_ctx *ue_ctx, + enum iu_event_type type, void *data); + +typedef int (* iu_rab_ass_resp_cb_t )(struct ue_conn_ctx *ue_ctx, uint8_t rab_id, + struct RANAP_RAB_SetupOrModifiedItemIEs_s *setup_ies); + +int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port, + iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb); + +void iu_link_del(struct osmo_sua_link *link); + +int iu_tx(struct msgb *msg, uint8_t sapi); + +int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac); +int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac); + +int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg); +int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id); +int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, + int send_ck, int new_key); diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index 6f6174e..4aa880f 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -2,9 +2,18 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(COVERAGE_LDFLAGS) -SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libfilter osmo-nitb osmo-bsc_mgcp utils ipaccess gprs +# Libraries +SUBDIRS = libcommon libmgcp libbsc libmsc libtrau libfilter -# Conditional modules +# Conditional Libraries +if BUILD_IU +SUBDIRS += libiu +endif + +# Programs +SUBDIRS += osmo-nitb osmo-bsc_mgcp utils ipaccess gprs + +# Conditional Programs if BUILD_NAT SUBDIRS += osmo-bsc_nat endif diff --git a/openbsc/src/libiu/Makefile.am b/openbsc/src/libiu/Makefile.am new file mode 100644 index 0000000..7b1ba4d --- /dev/null +++ b/openbsc/src/libiu/Makefile.am @@ -0,0 +1,10 @@ +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBCRYPTO_CFLAGS) \ + $(LIBASN1C_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) $(LIBOSMORANAP_CFLAGS) + +noinst_LIBRARIES = libiu.a + +libiu_a_SOURCES = iu.c + diff --git a/openbsc/src/libiu/iu.c b/openbsc/src/libiu/iu.c new file mode 100644 index 0000000..056937a --- /dev/null +++ b/openbsc/src/libiu/iu.c @@ -0,0 +1,758 @@ +/* Common parts of IuCS and IuPS interfaces implementation */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* Parsed global RNC id. See also struct RANAP_GlobalRNC_ID, and note that the + * PLMN identity is a BCD representation of the MCC and MNC. + * See iu_grnc_id_parse(). */ +struct iu_grnc_id { + uint16_t mcc; + uint16_t mnc; + uint16_t rnc_id; +}; + +/* A remote RNC (Radio Network Controller, like BSC but for UMTS) that has + * called us and is currently reachable at the given osmo_sua_link. So, when we + * know a LAC for a subscriber, we can page it at the RNC matching that LAC or + * RAC. An HNB-GW typically presents itself as if it were a single RNC, even + * though it may have several RNCs in hNodeBs connected to it. Those will then + * share the same RNC id, which they actually receive and adopt from the HNB-GW + * in the HNBAP HNB REGISTER ACCEPT message. */ +struct iu_rnc { + struct llist_head entry; + + uint16_t rnc_id; + uint16_t lac; /* Location Area Code (used for CS and PS) */ + uint8_t rac; /* Routing Area Code (used for PS only) */ + struct osmo_sua_link *link; +}; + +void *talloc_iu_ctx; + +int asn1_xer_print = 1; +void *talloc_asn1_ctx; + +iu_recv_cb_t global_iu_recv_cb = NULL; +iu_event_cb_t global_iu_event_cb = NULL; + +static LLIST_HEAD(ue_conn_ctx_list); +static LLIST_HEAD(rnc_list); + +const struct value_string iu_event_type_names[] = { +#define IU_EVT_STR(X) { X, #X } + IU_EVT_STR(IU_EVENT_RAB_ASSIGN), + IU_EVT_STR(IU_EVENT_SECURITY_MODE_COMPLETE), + IU_EVT_STR(IU_EVENT_IU_RELEASE), + IU_EVT_STR(IU_EVENT_LINK_INVALIDATED), +#undef IU_EVT_STR +}; + +struct ue_conn_ctx *ue_conn_ctx_alloc(struct osmo_sua_link *link, uint32_t conn_id) +{ + struct ue_conn_ctx *ctx = talloc_zero(talloc_iu_ctx, struct ue_conn_ctx); + + ctx->link = link; + ctx->conn_id = conn_id; + llist_add(&ctx->list, &ue_conn_ctx_list); + + return ctx; +} + +struct ue_conn_ctx *ue_conn_ctx_find(struct osmo_sua_link *link, + uint32_t conn_id) +{ + struct ue_conn_ctx *ctx; + + llist_for_each_entry(ctx, &ue_conn_ctx_list, list) { + if (ctx->link == link && ctx->conn_id == conn_id) + return ctx; + } + return NULL; +} + +static struct iu_rnc *iu_rnc_alloc(uint16_t rnc_id, uint16_t lac, uint8_t rac, + struct osmo_sua_link *link) +{ + struct iu_rnc *rnc = talloc_zero(talloc_iu_ctx, struct iu_rnc); + + rnc->rnc_id = rnc_id; + rnc->lac = lac; + rnc->rac = rac; + rnc->link = link; + llist_add(&rnc->entry, &rnc_list); + + LOGP(DRANAP, LOGL_NOTICE, "New RNC %d (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + + return rnc; +} + +static struct iu_rnc *iu_rnc_register(uint16_t rnc_id, uint16_t lac, + uint8_t rac, struct osmo_sua_link *link) +{ + struct iu_rnc *rnc; + llist_for_each_entry(rnc, &rnc_list, entry) { + if (rnc->rnc_id != rnc_id) + continue; + + /* We have this RNC Id registered already. Make sure that the + * details match. */ + + /* TODO should a mismatch be an error? */ + if (rnc->lac != lac || rnc->rac != rac) + LOGP(DRANAP, LOGL_NOTICE, "RNC %d changes its details:" + " LAC=%d RAC=%d --> LAC=%d RAC=%d\n", + rnc->rnc_id, rnc->lac, rnc->rac, + lac, rac); + rnc->lac = lac; + rnc->rac = rac; + + if (link && rnc->link != link) + LOGP(DRANAP, LOGL_NOTICE, "RNC %d on new link" + " (LAC=%d RAC=%d)\n", + rnc->rnc_id, rnc->lac, rnc->rac); + rnc->link = link; + return rnc; + } + + /* Not found, make a new one. */ + return iu_rnc_alloc(rnc_id, lac, rac, link); +} + +/* Discard/invalidate all ue_conn_ctx and iu_rnc entries that reference the + * given link, since this link is invalid and about to be deallocated. For + * each ue_conn_ctx, invoke the iu_event_cb_t with IU_EVENT_LINK_INVALIDATED. + */ +void iu_link_del(struct osmo_sua_link *link) +{ + struct iu_rnc *rnc, *rnc_next; + llist_for_each_entry_safe(rnc, rnc_next, &rnc_list, entry) { + if (!rnc->link) + continue; + if (rnc->link != link) + continue; + rnc->link = NULL; + llist_del(&rnc->entry); + talloc_free(rnc); + } + + struct ue_conn_ctx *uec, *uec_next; + llist_for_each_entry_safe(uec, uec_next, &ue_conn_ctx_list, list) { + if (uec->link != link) + continue; + uec->link = NULL; + global_iu_event_cb(uec, IU_EVENT_LINK_INVALIDATED, NULL); + } +} + +/*********************************************************************** + * RANAP handling + ***********************************************************************/ + +int iu_rab_act(struct ue_conn_ctx *ue_ctx, struct msgb *msg) +{ + struct osmo_scu_prim *prim; + + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ue_ctx->conn_id; + osmo_prim_init(&prim->oph, + SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, + msg); + return osmo_sua_user_link_down(ue_ctx->link, &prim->oph); +} + +int iu_rab_deact(struct ue_conn_ctx *ue_ctx, uint8_t rab_id) +{ + /* FIXME */ + return -1; +} + +int iu_tx_sec_mode_cmd(struct ue_conn_ctx *uectx, struct gsm_auth_tuple *tp, + int send_ck, int new_key) +{ + struct osmo_scu_prim *prim; + struct msgb *msg; + uint8_t ik[16]; + uint8_t ck[16]; + unsigned int i; + + /* C5 function to derive IK from Kc */ + for (i = 0; i < 4; i++) + ik[i] = tp->vec.kc[i] ^ tp->vec.kc[i+4]; + memcpy(ik+4, tp->vec.kc, 8); + for (i = 12; i < 16; i++) + ik[i] = ik[i-12]; + + if (send_ck) { + /* C4 function to derive CK from Kc */ + memcpy(ck, tp->vec.kc, 8); + memcpy(ck+8, tp->vec.kc, 8); + } + + /* create RANAP message */ + msg = ranap_new_msg_sec_mod_cmd(ik, send_ck? ck : NULL, new_key ? RANAP_KeyStatus_new : RANAP_KeyStatus_old); + msg->l2h = msg->data; + /* wrap RANAP message in SCCP N-DATA.req */ + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + + return 0; +} + +static int iu_grnc_id_parse(struct iu_grnc_id *dst, + struct RANAP_GlobalRNC_ID *src) +{ + /* The size is coming from arbitrary sender, check it gracefully */ + if (src->pLMNidentity.size != 3) { + LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:" + " should be 3, is %d\n", src->pLMNidentity.size); + return -1; + } + gsm48_mcc_mnc_from_bcd(&src->pLMNidentity.buf[0], + &dst->mcc, &dst->mnc); + dst->rnc_id = (uint16_t)src->rNC_ID; + return 0; +} + +#if 0 + -- not used at present -- +static int iu_grnc_id_compose(struct iu_grnc_id *src, + struct RANAP_GlobalRNC_ID *dst) +{ + /* The caller must ensure proper size */ + OSMO_ASSERT(dst->pLMNidentity.size == 3); + gsm48_mcc_mnc_to_bcd(&dst->pLMNidentity.buf[0], + src->mcc, src->mnc); + dst->rNC_ID = src->rnc_id; + return 0; +} +#endif + +static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies) +{ + struct ue_conn_ctx *ue_conn = ctx; + struct gprs_ra_id ra_id; + struct iu_grnc_id grnc_id; + uint16_t sai; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ranap_parse_lai(&ra_id, &ies->lai) != 0) { + LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + + if (ies->presenceMask & INITIALUE_MESSAGEIES_RANAP_RAC_PRESENT) { + ra_id.rac = asn1str_to_u8(&ies->rac); + } + + if (iu_grnc_id_parse(&grnc_id, &ies->globalRNC_ID) != 0) { + LOGP(DRANAP, LOGL_ERROR, + "Failed to parse RANAP Global-RNC-ID IE\n"); + return -1; + } + + sai = asn1str_to_u16(&ies->sai.sAC); + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Make sure we know the RNC Id and LAC+RAC coming in on this connection. */ + iu_rnc_register(grnc_id.rnc_id, ra_id.lac, ra_id.rac, ue_conn->link); + ue_conn->ra_id = ra_id; + + /* Feed into the MM layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, &ra_id, &sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_dt(void *ctx, RANAP_DirectTransferIEs_t *ies) +{ + struct gprs_ra_id _ra_id, *ra_id = NULL; + uint16_t _sai, *sai = NULL; + struct msgb *msg = msgb_alloc(256, "RANAP->NAS"); + + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_LAI_PRESENT) { + if (ranap_parse_lai(&_ra_id, &ies->lai) != 0) { + LOGP(DRANAP, LOGL_ERROR, "Failed to parse RANAP LAI IE\n"); + return -1; + } + ra_id = &_ra_id; + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_RAC_PRESENT) { + _ra_id.rac = asn1str_to_u8(&ies->rac); + } + if (ies->presenceMask & DIRECTTRANSFERIES_RANAP_SAI_PRESENT) { + _sai = asn1str_to_u16(&ies->sai.sAC); + sai = &_sai; + } + } + + msgb_gmmh(msg) = msgb_put(msg, ies->nas_pdu.size); + memcpy(msgb_gmmh(msg), ies->nas_pdu.buf, ies->nas_pdu.size); + + /* Feed into the MM/CC/SMS-CP layer */ + msg->dst = ctx; + global_iu_recv_cb(msg, ra_id, sai); + + msgb_free(msg); + + return 0; +} + +static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +int iu_tx(struct msgb *msg_nas, uint8_t sapi) +{ + struct ue_conn_ctx *uectx = msg_nas->dst; + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Transmitting L3 Message as RANAP DT (SUA link %p conn_id %u)\n", + uectx->link, uectx->conn_id); + + msg = ranap_new_msg_dt(sapi, msg_nas->data, msgb_length(msg_nas)); + msgb_free(msg_nas); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = uectx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(uectx->link, &prim->oph); + return 0; +} + +static int ranap_handle_co_iu_rel_req(struct ue_conn_ctx *ctx, RANAP_Iu_ReleaseRequestIEs_t *ies) +{ + struct msgb *msg; + struct osmo_scu_prim *prim; + + LOGP(DRANAP, LOGL_INFO, "Received Iu Release Request, Sending Release Command\n"); + msg = ranap_new_msg_iu_rel_cmd(&ies->cause); + msg->l2h = msg->data; + prim = (struct osmo_scu_prim *) msgb_push(msg, sizeof(*prim)); + prim->u.data.conn_id = ctx->conn_id; + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_DATA, + PRIM_OP_REQUEST, msg); + osmo_sua_user_link_down(ctx->link, &prim->oph); + return 0; +} + +static int ranap_handle_co_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_AssignmentResponseIEs_t *ies) +{ + int rc = -1; + + LOGP(DRANAP, LOGL_INFO, "RAB Asignment Response:"); + if (ies->presenceMask & RAB_ASSIGNMENTRESPONSEIES_RANAP_RAB_SETUPORMODIFIEDLIST_PRESENT) { + /* TODO: Iterate over list of SetupOrModifiedList IEs and handle each one */ + RANAP_IE_t *ranap_ie = ies->raB_SetupOrModifiedList.raB_SetupOrModifiedList_ies.list.array[0]; + RANAP_RAB_SetupOrModifiedItemIEs_t setup_ies; + + rc = ranap_decode_rab_setupormodifieditemies_fromlist(&setup_ies, &ranap_ie->value); + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in ranap_decode_rab_setupormodifieditemies()\n"); + return rc; + } + + rc = global_iu_event_cb(ctx, IU_EVENT_RAB_ASSIGN, &setup_ies); + + ranap_free_rab_setupormodifieditemies(&setup_ies); + } + + LOGPC(DRANAP, LOGL_INFO, "\n"); + + return rc; +} + +/* Entry point for connection-oriented RANAP message */ +static void cn_ranap_handle_co(void *ctx, ranap_message *message) +{ + int rc; + + LOGP(DRANAP, LOGL_NOTICE, "handle_co(dir=%u, proc=%u)\n", message->direction, message->procedureCode); + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_InitialUE_Message: + rc = ranap_handle_co_initial_ue(ctx, &message->msg.initialUE_MessageIEs); + break; + case RANAP_ProcedureCode_id_DirectTransfer: + rc = ranap_handle_co_dt(ctx, &message->msg.directTransferIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_co_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + case RANAP_ProcedureCode_id_Iu_ReleaseRequest: + /* Iu Release Request */ + rc = ranap_handle_co_iu_rel_req(ctx, &message->msg.iu_ReleaseRequestIEs); + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Initiating Message: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_SecurityModeControl: + /* Security Mode Complete */ + rc = global_iu_event_cb(ctx, IU_EVENT_SECURITY_MODE_COMPLETE, NULL); + break; + case RANAP_ProcedureCode_id_Iu_Release: + /* Iu Release Complete */ + rc = global_iu_event_cb(ctx, IU_EVENT_IU_RELEASE, NULL); + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Iu Release event: Iu Event callback returned %d\n", + rc); + } + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Successful Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_outcome: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_RAB_Assignment: + /* RAB Assignment Response */ + rc = ranap_handle_co_rab_ass_resp(ctx, &message->msg.raB_AssignmentResponseIEs); + break; + default: + LOGP(DRANAP, LOGL_ERROR, "Received Outcome: unknown Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + default: + LOGP(DRANAP, LOGL_ERROR, "Received Unsuccessful Outcome: Procedure Code %d\n", + message->procedureCode); + rc = -1; + break; + } + + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_co (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +static int ranap_handle_cl_reset_req(void *ctx, RANAP_ResetIEs_t *ies) +{ + /* FIXME: send reset response */ + return -1; +} + +static int ranap_handle_cl_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies) +{ + if (ies->presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication (%s)\n", + ranap_cause_str(&ies->cause)); + else + LOGP(DRANAP, LOGL_ERROR, "Rx Error Indication\n"); + + return 0; +} + +/* Entry point for connection-less RANAP message */ +static void cn_ranap_handle_cl(void *ctx, ranap_message *message) +{ + int rc; + + switch (message->direction) { + case RANAP_RANAP_PDU_PR_initiatingMessage: + switch (message->procedureCode) { + case RANAP_ProcedureCode_id_Reset: + /* received reset.req, send reset.resp */ + rc = ranap_handle_cl_reset_req(ctx, &message->msg.resetIEs); + break; + case RANAP_ProcedureCode_id_ErrorIndication: + rc = ranap_handle_cl_err_ind(ctx, &message->msg.errorIndicationIEs); + break; + default: + rc = -1; + break; + } + break; + case RANAP_RANAP_PDU_PR_successfulOutcome: + case RANAP_RANAP_PDU_PR_unsuccessfulOutcome: + case RANAP_RANAP_PDU_PR_outcome: + default: + rc = -1; + break; + } + + if (rc) { + LOGP(DRANAP, LOGL_ERROR, "Error in cn_ranap_handle_cl (%d)\n", + rc); + /* TODO handling of the error? */ + } +} + +/*********************************************************************** + * Paging + ***********************************************************************/ + +/* Send a paging command down a given SUA link. tmsi and paging_cause are + * optional and may be passed NULL and 0, respectively, to disable their use. + * See enum RANAP_PagingCause. + * + * If TMSI is given, the IMSI is not sent over the air interface. Nevertheless, + * the IMSI is still required for resolution in the HNB-GW and/or(?) RNC. */ +static int iu_tx_paging_cmd(struct osmo_sua_link *link, + const char *imsi, const uint32_t *tmsi, + bool is_ps, uint32_t paging_cause) +{ + struct msgb *msg; + msg = ranap_new_msg_paging_cmd(imsi, tmsi, is_ps? 1 : 0, paging_cause); + msg->l2h = msg->data; + return osmo_sccp_tx_unitdata_ranap(link, 1, 2, msg->data, + msgb_length(msg)); +} + +static int iu_page(const char *imsi, const uint32_t *tmsi_or_ptimsi, + uint16_t lac, uint8_t rac, bool is_ps) +{ + struct iu_rnc *rnc; + int pagings_sent = 0; + + if (tmsi_or_ptimsi) { + LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use %s %x)\n", + is_ps? "IuPS" : "IuCS", + imsi, + is_ps? "PTMSI" : "TMSI", + *tmsi_or_ptimsi); + } else { + LOGP(DRANAP, LOGL_DEBUG, "%s: Looking for RNCs to page for IMSI %s" + " (paging will use IMSI)\n", + is_ps? "IuPS" : "IuCS", + imsi + ); + } + + llist_for_each_entry(rnc, &rnc_list, entry) { + if (!rnc->link) { + /* Not actually connected, don't count it. */ + continue; + } + if (rnc->lac != lac) + continue; + if (is_ps && rnc->rac != rac) + continue; + + /* Found a match! */ + if (iu_tx_paging_cmd(rnc->link, imsi, tmsi_or_ptimsi, is_ps, 0) + == 0) { + LOGP(DRANAP, LOGL_DEBUG, + "%s: Paged for IMSI %s on RNC %d, on SUA link %p\n", + is_ps? "IuPS" : "IuCS", + imsi, rnc->rnc_id, rnc->link); + pagings_sent ++; + } + } + + /* Some logging... */ + if (pagings_sent > 0) { + LOGP(DRANAP, LOGL_DEBUG, + "%s: %d RNCs were paged for IMSI %s.\n", + is_ps? "IuPS" : "IuCS", + pagings_sent, imsi); + } + else { + if (is_ps) { + LOGP(DRANAP, LOGL_ERROR, "IuPS: Found no RNC to page for" + " LAC %d RAC %d (would have paged IMSI %s)\n", + lac, rac, imsi); + } + else { + LOGP(DRANAP, LOGL_ERROR, "IuCS: Found no RNC to page for" + " LAC %d (would have paged IMSI %s)\n", + lac, imsi); + } + } + + return pagings_sent; +} + +int iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac) +{ + return iu_page(imsi, tmsi, lac, 0, false); +} + +int iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac) +{ + return iu_page(imsi, ptmsi, lac, rac, true); +} + + +/*********************************************************************** + * + ***********************************************************************/ + +int tx_unitdata(struct osmo_sua_link *link); +int tx_conn_req(struct osmo_sua_link *link, uint32_t conn_id); + +struct osmo_prim_hdr *make_conn_req(uint32_t conn_id); +struct osmo_prim_hdr *make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len); + +struct osmo_prim_hdr *make_conn_resp(struct osmo_scu_connect_param *param) +{ + struct msgb *msg = msgb_alloc(1024, "conn_resp"); + struct osmo_scu_prim *prim; + + prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim)); + osmo_prim_init(&prim->oph, SCCP_SAP_USER, + OSMO_SCU_PRIM_N_CONNECT, + PRIM_OP_RESPONSE, msg); + memcpy(&prim->u.connect, param, sizeof(prim->u.connect)); + return &prim->oph; +} + +static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link) +{ + struct osmo_scu_prim *prim = (struct osmo_scu_prim *) oph; + struct osmo_prim_hdr *resp = NULL; + int rc; + struct ue_conn_ctx *ue; + + printf("sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); + + switch (OSMO_PRIM_HDR(oph)) { + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM): + /* confirmation of outbound connection */ + rc = -1; + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION): + /* indication of new inbound connection request*/ + printf("N-CONNECT.ind(X->%u)\n", prim->u.connect.conn_id); + if (/* prim->u.connect.called_addr.ssn != OSMO_SCCP_SSN_RANAP || */ + !msgb_l2(oph->msg) || msgb_l2len(oph->msg) == 0) { + LOGP(DGPRS, LOGL_NOTICE, "Received invalid N-CONNECT.ind\n"); + return 0; + } + ue = ue_conn_ctx_alloc(link, prim->u.connect.conn_id); + /* first ensure the local SUA/SCCP socket is ACTIVE */ + resp = make_conn_resp(&prim->u.connect); + osmo_sua_user_link_down(link, resp); + /* then handle the RANAP payload */ + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DISCONNECT, PRIM_OP_INDICATION): + /* indication of disconnect */ + printf("N-DISCONNECT.ind(%u)\n", prim->u.disconnect.conn_id); + ue = ue_conn_ctx_find(link, prim->u.disconnect.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_DATA, PRIM_OP_INDICATION): + /* connection-oriented data received */ + printf("N-DATA.ind(%u, %s)\n", prim->u.data.conn_id, + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + /* resolve UE context */ + ue = ue_conn_ctx_find(link, prim->u.data.conn_id); + rc = ranap_cn_rx_co(cn_ranap_handle_co, ue, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION): + /* connection-less data received */ + printf("N-UNITDATA.ind(%s)\n", + osmo_hexdump(msgb_l2(oph->msg), msgb_l2len(oph->msg))); + rc = ranap_cn_rx_cl(cn_ranap_handle_cl, link, msgb_l2(oph->msg), msgb_l2len(oph->msg)); + break; + default: + rc = -1; + break; + } + + msgb_free(oph->msg); + return rc; +} + +int iu_init(void *ctx, const char *listen_addr, uint16_t listen_port, + iu_recv_cb_t iu_recv_cb, iu_event_cb_t iu_event_cb) +{ + struct osmo_sua_user *user; + talloc_iu_ctx = talloc_named_const(ctx, 1, "iu"); + talloc_asn1_ctx = talloc_named_const(talloc_iu_ctx, 1, "asn1"); + + global_iu_recv_cb = iu_recv_cb; + global_iu_event_cb = iu_event_cb; + osmo_sua_set_log_area(DSUA); + user = osmo_sua_user_create(talloc_iu_ctx, sccp_sap_up, talloc_iu_ctx); + return osmo_sua_server_listen(user, listen_addr, listen_port); +} + -- To view, visit https://gerrit.osmocom.org/192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 6 00:21:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 00:21:49 +0000 Subject: openbsc[master]: add libiu In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-2 (2 comments) added (c) notice, two things yet to be resolved. https://gerrit.osmocom.org/#/c/192/3/openbsc/src/libiu/iu.c File openbsc/src/libiu/iu.c: Line 77: struct osmo_sua_link *link; (comment from Patch Set 2 still valid) Line 694: printf("sccp_sap_up(%s)\n", osmo_scu_prim_name(oph)); we should not have printf()s here. (x4 below) -- To view, visit https://gerrit.osmocom.org/192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 6 00:25:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 00:25:58 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 logic needs fix ( https://gerrit.osmocom.org/#/c/180/2/openbsc/src/libbsc/chan_alloc.c at 100 ) -- To view, visit https://gerrit.osmocom.org/180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 6 08:13:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 08:13:53 +0000 Subject: [PATCH] libosmo-abis[master]: Add defines for FN to SAMPLE conversion Message-ID: Review at https://gerrit.osmocom.org/200 Add defines for FN to SAMPLE conversion Add defines necessary to correctly convert number of TDMA frames into number of voice samples. Defines are proposed by Harald in comments on gerrit. Change-Id: I1d8345352fb2ac76f71e88cb40f089fe3f9aae7e Related: OS#1562 --- M include/osmocom/trau/osmo_ortp.h 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/00/200/1 diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index 9512759..0d2696e 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -21,6 +21,15 @@ /*! \brief Osmocom pseudo-static paylaod type for Adaptive Multi Rate (AMR) */ #define RTP_PT_AMR 98 +#define GSM_VOICE_SAMPLE_RATE_HZ 8000 +#define GSM_VOICE_SAMPLES_PER_MS (GSM_VOICE_SAMPLE_RATE_HZ / 1000) +#define GSM_VOICE_MULTIFRAME 26 +#define GSM_RTP_FRAME_DURATION_MS 20 +#define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) +#define GSM_MS_TO_SAMPLES(ms) (ms * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_FN_TO_MS(fn) (fn * GSM_TDMA_FRAME_MS) + /*! \brief Parameter to osmo_rtp_socket_param_set() */ enum osmo_rtp_param { OSMO_RTP_P_JITBUF = 1, -- To view, visit https://gerrit.osmocom.org/200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d8345352fb2ac76f71e88cb40f089fe3f9aae7e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 09:20:56 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 09:20:56 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional Message-ID: Review at https://gerrit.osmocom.org/201 Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it optional (defaulting to previous behavior) by adding following: * optional "no-extension" argument to subscriber-create-on-demand * db unit tests * vty test The range for random extension can now be specified with "subscriber-create-on-demand random" command. Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Fixes: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/net_init.c M openbsc/src/libcommon/gsm_subscriber_base.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 12 files changed, 166 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/1 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6699a86..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -35,13 +37,15 @@ int db_fini(void); /* subscriber management */ -struct gsm_subscriber *db_create_subscriber(const char *imsi); +struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); int db_subscriber_expire(void *priv, void (*callback)(void *priv, long long unsigned int id)); int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber); -int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber); +int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, + uint64_t smax); int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token); int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei); int db_subscriber_delete(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 31a4ed5..d70db1b 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -25,6 +25,7 @@ GSM_SUBSCR_DONT_CREATE = 0, GSM_SUBSCR_CREAT_W_RAND_EXT = 1, GSM_SUBSCR_CREAT_W_REGEXP = 2, + GSM_SUBSCR_CREAT_W_NO_EXT = 4, }; enum gsm_security_event { @@ -290,6 +291,8 @@ /* subscriber related features */ int subscr_creation_mode; + uint64_t ext_min; + uint64_t ext_max; struct gsm_subscriber_group *subscr_group; struct gsm_sms_queue *sms_queue; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 9df989a..81e51be 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -1,6 +1,8 @@ #ifndef _GSM_SUBSCR_H #define _GSM_SUBSCR_H +#include + #include "gsm_data.h" #include #include @@ -90,7 +92,8 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi); + const char *imsi, uint64_t smin, + uint64_t smax, bool ext); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index afcaaf3..4636d57 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -104,7 +104,8 @@ net->stats.bts.rsl_fail = osmo_counter_alloc("net.bts.rsl_fail"); net->mncc_recv = mncc_recv; - + net->ext_min = GSM_MIN_EXTEN; + net->ext_max = GSM_MAX_EXTEN; gsm_net_update_ctype(net); return net; diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/openbsc/src/libcommon/gsm_subscriber_base.c index 1f98cc6..ef163de 100644 --- a/openbsc/src/libcommon/gsm_subscriber_base.c +++ b/openbsc/src/libcommon/gsm_subscriber_base.c @@ -63,6 +63,7 @@ llist_add_tail(&s->entry, &active_subscribers); s->use_count = 1; s->tmsi = GSM_RESERVED_TMSI; + s->extension[0] = '\0'; INIT_LLIST_HEAD(&s->requests); diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index 0d6a37c..0d29286 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -18,6 +18,9 @@ * along with this program. If not, see . * */ + +#include + #include #include #include @@ -83,6 +86,8 @@ char *tmp, *imsi, *msisdn, *alg, *ki, *saveptr = NULL; struct gsm_subscriber* subscr; int rc; + bool ext = (GSM_SUBSCR_CREAT_W_RAND_EXT & net->subscr_creation_mode) ? + true : false; tmp = talloc_strdup(cmd, cmd->value); if (!tmp) @@ -95,7 +100,9 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi); + subscr = subscr_create_subscriber(net->subscr_group, imsi, + net->ext_min, + net->ext_max, ext); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 9e3fb36..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -518,7 +519,8 @@ return 0; } -struct gsm_subscriber *db_create_subscriber(const char *imsi) +struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -550,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -955,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1061,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", @@ -1249,13 +1257,14 @@ return 0; } -int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber) +int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, + uint64_t smax) { dbi_result result = NULL; uint32_t try; for (;;) { - try = (rand()%(GSM_MAX_EXTEN-GSM_MIN_EXTEN+1)+GSM_MIN_EXTEN); + try = (rand() % (smax - smin + 1) + smin); result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " "WHERE extension = %i", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 92c4cfe..f761903 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -537,7 +537,11 @@ if (!subscr_regexp_check(net, imsi)) return NULL; - return subscr_create_subscriber(net->subscr_group, imsi); + bool ext = (GSM_SUBSCR_CREAT_W_RAND_EXT & net->subscr_creation_mode) ? + true : false; + + return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, + net->ext_max, ext); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 57c10cf..7d62888 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -203,9 +203,11 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi) + const char *imsi, uint64_t smin, + uint64_t smax, bool ext) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi); + struct gsm_subscriber *subscr = + db_create_subscriber(imsi, smin, smax, ext); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 3f67b9a..cf9a211 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -235,12 +237,16 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); struct gsm_subscriber *subscr; + bool ext = (GSM_SUBSCR_CREAT_W_RAND_EXT == gsmnet->subscr_creation_mode) + ? true : false; subscr = subscr_get_by_imsi(gsmnet->subscr_group, argv[0]); if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], + gsmnet->ext_min, + gsmnet->ext_max, ext); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1031,6 +1037,34 @@ return CMD_SUCCESS; } +/* Note: limit on the parameter length is set by internal vty code limitations */ +DEFUN(cfg_nitb_subscr_random, cfg_nitb_subscr_random_cmd, + "subscriber-create-on-demand random <1-9999999999> <2-9999999999>", + "Set random parameters for a new record when a subscriber is first seen.\n" + "Set random parameters for a new record when a subscriber is first seen.\n" + "Minimum for subscriber extension\n""Maximum for subscriber extension\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + if (mi >= ma) { + vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + gsmnet->ext_min = mi; + gsmnet->ext_max = ma; + return CMD_SUCCESS; +} + +DEFUN(cfg_nitb_subscr_noext, cfg_nitb_subscr_noext_cmd, + "subscriber-create-no-extension", + "Do not assign extension when creating subscriber on demand.\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_NO_EXT; + return CMD_SUCCESS; +} + DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, "subscriber-create-on-demand [regexp]", "Make a new record when a subscriber is first seen.\n" @@ -1038,7 +1072,8 @@ "authorized-regexp command\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + if (!gsmnet->subscr_creation_mode) + gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; if (argc) gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; return CMD_SUCCESS; @@ -1080,6 +1115,12 @@ vty_out(vty, "nitb%s", VTY_NEWLINE); vty_out(vty, " %ssubscriber-create-on-demand%s%s", pref, reg, VTY_NEWLINE); + if(scm & GSM_SUBSCR_CREAT_W_NO_EXT) + vty_out(vty, " subscriber-create-no-extension%s", VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) + vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" + PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, + VTY_NEWLINE); vty_out(vty, " %sassign-tmsi%s", gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE); return CMD_SUCCESS; @@ -1134,6 +1175,8 @@ install_element(CONFIG_NODE, &cfg_nitb_cmd); install_node(&nitb_node, config_write_nitb); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_noext_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd); install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd); diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index ee0cbca..a689789 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *alice_imsi, char *imei1, char *imei2, bool ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -187,8 +189,10 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } SUBSCR_PUT(alice); } @@ -217,18 +221,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index c264328..34c0719 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -424,11 +424,15 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913769" + imsi3 = "100500854113769" + imsi4 = "100583744053769" wrong_imsi = "204300999999999" # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) self.vty.verify('subscriber imsi '+wrong_imsi+' name wrong', ['% No subscriber found for imsi '+wrong_imsi]) res = self.vty.command('subscriber imsi '+imsi+' name '+('X' * 160)) @@ -442,9 +446,54 @@ self.vty.verify('subscriber imsi '+imsi+' extension '+('1' * 14), ['']) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-no-extension", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi3) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi4) + self.assert_(res != "") def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 09:37:01 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 09:37:01 +0000 Subject: [PATCH] openbsc[master]: Add warning for unsupported DTX configurations Message-ID: Review at https://gerrit.osmocom.org/202 Add warning for unsupported DTX configurations libosmo-abis do not consider DTX bits while processing TRAU frames. As I do not have equipment to test it, I'm not sure if/how non-IP BTS will work in case of DTX - warn users about it. Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Related: OS#22 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/02/202/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index f4d47b4..b0f2f62 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1748,7 +1748,9 @@ struct gsm_bts *bts = vty->index; bts->dtxu = (argc > 0) ? GSM48_DTX_SHALL_BE_USED : GSM48_DTX_MAY_BE_USED; - + if (!is_ipaccess_bts(bts)) + vty_out(vty, "%% DTX enabled on non-IP BTS: this configuration " + "neither supported nor tested!%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -1771,7 +1773,9 @@ struct gsm_bts *bts = vty->index; bts->dtxd = true; - + if (!is_ipaccess_bts(bts)) + vty_out(vty, "%% DTX enabled on non-IP BTS: this configuration " + "neither supported nor tested!%s", VTY_NEWLINE); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 09:50:25 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 09:50:25 +0000 Subject: [PATCH] libosmo-abis[master]: Extend RTP frame sending API In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/82 to look at the new patch set (#2). Extend RTP frame sending API Add osmo_rtp_send_frame_ext() which accept boolean parameter in addition to arguments of osmo_rtp_send_frame() to explicitly set marker bit in RTP header. Previously it was always unset which resulted in degradation of speech quality for codecs with explicit talkspurt events (was tested with AMR's ONSET). Related: OS#1562 Change-Id: I23e6dccfad5643e662391a0a2abebbb45597ffd9 --- M include/osmocom/trau/osmo_ortp.h M src/trau/osmo_ortp.c 2 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/82/82/2 diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index 9512759..cec0d2e 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -2,6 +2,7 @@ #define _OSMO_ORTP_H #include +#include #include #include @@ -67,6 +68,9 @@ int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration); +int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, + unsigned int payload_len, unsigned int duration, + bool marker); int osmo_rtp_socket_poll(struct osmo_rtp_socket *rs); int osmo_rtp_get_bound_ip_port(struct osmo_rtp_socket *rs, diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 3313798..eb78212 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -23,6 +23,7 @@ */ #include +#include #include #include @@ -417,6 +418,22 @@ int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration) { + return osmo_rtp_send_frame_ext(rs, payload, payload_len, duration, + false); +} + +/*! \brief Send one RTP frame via a RTP socket + * \param[in] rs OsmoRTP socket + * \param[in] payload pointer to buffer with RTP payload data + * \param[in] payload_len length of \a payload in bytes + * \param[in] duration duration in number of RTP clock ticks + * \param[in] marker the status of Marker bit in RTP header + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, + unsigned int payload_len, unsigned int duration, + bool marker) +{ mblk_t *mblk; int rc; @@ -428,6 +445,7 @@ if (!mblk) return -ENOMEM; + rtp_set_markbit(mblk, marker); rc = rtp_session_sendm_with_ts(rs->sess, mblk, rs->tx_timestamp); rs->tx_timestamp += duration; -- To view, visit https://gerrit.osmocom.org/82 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I23e6dccfad5643e662391a0a2abebbb45597ffd9 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:03:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 6 Jun 2016 10:03:05 +0000 Subject: libosmo-abis[master]: Extend RTP frame sending API In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/82 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I23e6dccfad5643e662391a0a2abebbb45597ffd9 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:03:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 6 Jun 2016 10:03:08 +0000 Subject: [MERGED] libosmo-abis[master]: Extend RTP frame sending API In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Extend RTP frame sending API ...................................................................... Extend RTP frame sending API Add osmo_rtp_send_frame_ext() which accept boolean parameter in addition to arguments of osmo_rtp_send_frame() to explicitly set marker bit in RTP header. Previously it was always unset which resulted in degradation of speech quality for codecs with explicit talkspurt events (was tested with AMR's ONSET). Related: OS#1562 Change-Id: I23e6dccfad5643e662391a0a2abebbb45597ffd9 Reviewed-on: https://gerrit.osmocom.org/82 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M include/osmocom/trau/osmo_ortp.h M src/trau/osmo_ortp.c 2 files changed, 22 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index 9512759..cec0d2e 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -2,6 +2,7 @@ #define _OSMO_ORTP_H #include +#include #include #include @@ -67,6 +68,9 @@ int osmo_rtp_socket_free(struct osmo_rtp_socket *rs); int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration); +int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, + unsigned int payload_len, unsigned int duration, + bool marker); int osmo_rtp_socket_poll(struct osmo_rtp_socket *rs); int osmo_rtp_get_bound_ip_port(struct osmo_rtp_socket *rs, diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index 3313798..eb78212 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -23,6 +23,7 @@ */ #include +#include #include #include @@ -417,6 +418,22 @@ int osmo_rtp_send_frame(struct osmo_rtp_socket *rs, const uint8_t *payload, unsigned int payload_len, unsigned int duration) { + return osmo_rtp_send_frame_ext(rs, payload, payload_len, duration, + false); +} + +/*! \brief Send one RTP frame via a RTP socket + * \param[in] rs OsmoRTP socket + * \param[in] payload pointer to buffer with RTP payload data + * \param[in] payload_len length of \a payload in bytes + * \param[in] duration duration in number of RTP clock ticks + * \param[in] marker the status of Marker bit in RTP header + * \returns 0 on success, <0 in case of error. + */ +int osmo_rtp_send_frame_ext(struct osmo_rtp_socket *rs, const uint8_t *payload, + unsigned int payload_len, unsigned int duration, + bool marker) +{ mblk_t *mblk; int rc; @@ -428,6 +445,7 @@ if (!mblk) return -ENOMEM; + rtp_set_markbit(mblk, marker); rc = rtp_session_sendm_with_ts(rs->sess, mblk, rs->tx_timestamp); rs->tx_timestamp += duration; -- To view, visit https://gerrit.osmocom.org/82 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I23e6dccfad5643e662391a0a2abebbb45597ffd9 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:03:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 6 Jun 2016 10:03:52 +0000 Subject: openbsc[master]: Add warning for unsupported DTX configurations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:05:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 6 Jun 2016 10:05:12 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:05:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 6 Jun 2016 10:05:51 +0000 Subject: libosmo-abis[master]: Add defines for FN to SAMPLE conversion In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d8345352fb2ac76f71e88cb40f089fe3f9aae7e Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:05:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 6 Jun 2016 10:05:53 +0000 Subject: [MERGED] libosmo-abis[master]: Add defines for FN to SAMPLE conversion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add defines for FN to SAMPLE conversion ...................................................................... Add defines for FN to SAMPLE conversion Add defines necessary to correctly convert number of TDMA frames into number of voice samples. Defines are proposed by Harald in comments on gerrit. Change-Id: I1d8345352fb2ac76f71e88cb40f089fe3f9aae7e Related: OS#1562 Reviewed-on: https://gerrit.osmocom.org/200 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M include/osmocom/trau/osmo_ortp.h 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index cec0d2e..eb53a41 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -22,6 +22,15 @@ /*! \brief Osmocom pseudo-static paylaod type for Adaptive Multi Rate (AMR) */ #define RTP_PT_AMR 98 +#define GSM_VOICE_SAMPLE_RATE_HZ 8000 +#define GSM_VOICE_SAMPLES_PER_MS (GSM_VOICE_SAMPLE_RATE_HZ / 1000) +#define GSM_VOICE_MULTIFRAME 26 +#define GSM_RTP_FRAME_DURATION_MS 20 +#define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) +#define GSM_MS_TO_SAMPLES(ms) (ms * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_FN_TO_MS(fn) (fn * GSM_TDMA_FRAME_MS) + /*! \brief Parameter to osmo_rtp_socket_param_set() */ enum osmo_rtp_param { OSMO_RTP_P_JITBUF = 1, -- To view, visit https://gerrit.osmocom.org/200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d8345352fb2ac76f71e88cb40f089fe3f9aae7e Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:10:54 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 10:10:54 +0000 Subject: [PATCH] openbsc[master]: Add talkspurt indicator for gsm_lchan Message-ID: Review at https://gerrit.osmocom.org/203 Add talkspurt indicator for gsm_lchan Add bit which can be set on BTS side to indicate that next RTP frame should be marked as a beginning of speech. Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Related: OS#1562 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/03/203/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..fc32f0a 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -309,7 +309,8 @@ int s; /* Kind of the release/activation. E.g. RSL or PCU */ int rel_act_kind; - + /* RTP helper*/ + bool marker; /* power handling */ struct { uint8_t current; -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:22:47 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 10:22:47 +0000 Subject: [PATCH] osmo-bts[master]: Fix RTP timestamps in case of DTX In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/196 to look at the new patch set (#3). Fix RTP timestamps in case of DTX Compute RTP user_ts adjustment based on the difference between current and previous FN instead of hard-coded value. Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Related: OS#1562 --- M src/common/l1sap.c 1 file changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/196/3 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ac398d3..77fd1a0 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -69,6 +69,20 @@ static int l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); +static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn) +{ + if (last_fn) { + uint32_t ms_passed = GSM_FN_TO_MS(fn - last_fn), + samples_passed = GSM_MS_TO_SAMPLES(ms_passed); + /* round number of samples to the nearest multiple of + GSM_RTP_DURATION */ + uint32_t r = samples_passed + GSM_RTP_DURATION / 2; + r -= r % GSM_RTP_DURATION; + return r; + } + return GSM_RTP_DURATION; +} + static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = { 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, @@ -853,7 +867,7 @@ /* hand msg to RTP code for transmission */ if (lchan->abis_ip.rtp_socket) osmo_rtp_send_frame(lchan->abis_ip.rtp_socket, - msg->data, msg->len, 160); + msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn)); /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { @@ -871,7 +885,7 @@ msgb_enqueue(&lchan->dl_tch_queue, msg); } - + lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 6 10:52:04 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 10:52:04 +0000 Subject: [PATCH] osmo-bts[master]: Use libosmocodec for AMR RTP Message-ID: Review at https://gerrit.osmocom.org/204 Use libosmocodec for AMR RTP Add dependency on libosmocodec and use it to parse RTP with AMR payload. Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 --- M configure.ac M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M tests/sysmobts/Makefile.am 4 files changed, 16 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/204/1 diff --git a/configure.ac b/configure.ac index 0951e18..60a9114 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,7 @@ dnl checks for libraries PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9) +PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty) PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.3.2) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 9ed89dc..34f4bb0 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..63d90af 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -298,10 +299,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -323,12 +320,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); #ifdef USE_L1_RTP_MODE memcpy(l1_payload+2, rtp_payload, payload_len); @@ -353,11 +353,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -391,12 +387,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -405,7 +401,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index a00e7c2..2f267f3 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 11:09:22 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 11:09:22 +0000 Subject: [PATCH] openbsc[master]: lchan_alloc(): on alloc failure, report original type Message-ID: Review at https://gerrit.osmocom.org/205 lchan_alloc(): on alloc failure, report original type In lchan_alloc(), there are several decisions to fall back to another type of channel, followed by setting the channel type to the fall back type. So far, this was set regardless of allocation success or failure. If such fall back type is not available, do not modify the local type variable and thus report an S_CHALLOC_ALLOC_FAIL on the type originally requested (report is at the end of lchan_alloc()). Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/05/205/1 diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index de9da81..c9c5fa8 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -161,12 +161,14 @@ if (allow_bigger) { if (lchan == NULL) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); - type = GSM_LCHAN_TCH_H; + if (lchan) + type = GSM_LCHAN_TCH_H; } if (lchan == NULL) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); - type = GSM_LCHAN_TCH_F; + if (lchan) + type = GSM_LCHAN_TCH_F; } } break; @@ -175,7 +177,8 @@ /* If we don't have TCH/F available, fall-back to TCH/H */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); - type = GSM_LCHAN_TCH_H; + if (lchan) + type = GSM_LCHAN_TCH_H; } break; case GSM_LCHAN_TCH_H: @@ -183,7 +186,8 @@ /* If we don't have TCH/H available, fall-back to TCH/F */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); - type = GSM_LCHAN_TCH_F; + if (lchan) + type = GSM_LCHAN_TCH_F; } break; default: -- To view, visit https://gerrit.osmocom.org/205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 6 16:06:41 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 16:06:41 +0000 Subject: [PATCH] osmo-bts[master]: Move TCH code to common subdir Message-ID: Review at https://gerrit.osmocom.org/206 Move TCH code to common subdir * move code from gen_empty_tch_msg() which is common to sysmobts and litecell into separate file under common/ directory * introduce bts-specific function for getting payload address, setting payload type and size This makes introducing and testing DTXd support on both platforms much easier. Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Related: OS#1563 --- M src/common/Makefile.am A src/common/tch.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 4 files changed, 159 insertions(+), 97 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/06/206/1 diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 8df6513..5c84ade 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -4,7 +4,7 @@ noinst_LIBRARIES = libbts.a libl1sched.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ - rsl.c vty.c paging.c measurement.c amr.c lchan.c \ + rsl.c vty.c paging.c measurement.c amr.c tch.c lchan.c \ load_indication.c pcu_sock.c handover.c msg_utils.c \ load_indication.c pcu_sock.c handover.c msg_utils.c \ tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c \ diff --git a/src/common/tch.c b/src/common/tch.c new file mode 100644 index 0000000..794f941 --- /dev/null +++ b/src/common/tch.c @@ -0,0 +1,67 @@ +/* OsmoBTS common TCH code */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +extern struct msgb *l1p_msgb_alloc(void); +extern uint8_t *get_payload_addr(struct msgb *msg); +extern void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan); +extern void set_payload_size(struct msgb *msg, uint8_t size); + +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) +{ + struct msgb *msg; + uint8_t *l1_payload; + + msg = l1p_msgb_alloc(); + if (!msg) + return NULL; + + l1_payload = get_payload_addr(msg); + + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_AMR: + set_payload_type(msg, lchan); + if (lchan->tch.last_sid.len) { + memcpy(l1_payload, lchan->tch.last_sid.buf, + lchan->tch.last_sid.len); + set_payload_size(msg, lchan->tch.last_sid.len + 1); + } else { + /* FIXME: decide if we should send SPEECH_BAD or + * SID_BAD */ +#if 0 + *payload_type = GsmL1_TchPlType_Amr_SidBad; + memset(l1_payload, 0xFF, 5); + msu_param->u8Size = 5 + 3; +#else + /* send an all-zero SID */ + set_payload_size(msg, 8); +#endif + } + break; + default: + msgb_free(msg); + msg = NULL; + break; + } + + return msg; +} diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a11911c..d09264a 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -100,6 +100,52 @@ #define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ #define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ +void set_payload_size(struct msgb *msg, uint8_t size) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + msu_param->u8Size = size; +} + +void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *payload_type; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + payload_type = &msu_param->u8Buffer[0]; + + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_AMR: + *payload_type = GsmL1_TchPlType_Amr; + break; + default: + return; + } +} + +uint8_t *get_payload_addr(struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + + return &msu_param->u8Buffer[1]; +} + static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) { struct msgb *msg; @@ -483,52 +529,4 @@ gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; -} - -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) -{ - struct msgb *msg; - GsmL1_Prim_t *l1p; - GsmL1_PhDataReq_t *data_req; - GsmL1_MsgUnitParam_t *msu_param; - uint8_t *payload_type; - uint8_t *l1_payload; - - msg = l1p_msgb_alloc(); - if (!msg) - return NULL; - - l1p = msgb_l1prim(msg); - data_req = &l1p->u.phDataReq; - msu_param = &data_req->msgUnitParam; - payload_type = &msu_param->u8Buffer[0]; - l1_payload = &msu_param->u8Buffer[1]; - - switch (lchan->tch_mode) { - case GSM48_CMODE_SPEECH_AMR: - *payload_type = GsmL1_TchPlType_Amr; - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; - } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - msu_param->u8Size = 8; -#endif - } - break; - default: - msgb_free(msg); - msg = NULL; - break; - } - - return msg; } diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..13f9ec6 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -89,6 +89,51 @@ out[i] = (in[i] & 0xF) << 4; } +void set_payload_size(struct msgb *msg, uint8_t size) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + msu_param->u8Size = size; +} + +void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *payload_type; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + payload_type = &msu_param->u8Buffer[0]; + + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_AMR: + *payload_type = GsmL1_TchPlType_Amr; + break; + default: + return; + } +} + +uint8_t *get_payload_addr(struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + + return &msu_param->u8Buffer[1]; +} static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) { @@ -579,52 +624,4 @@ gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; -} - -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) -{ - struct msgb *msg; - GsmL1_Prim_t *l1p; - GsmL1_PhDataReq_t *data_req; - GsmL1_MsgUnitParam_t *msu_param; - uint8_t *payload_type; - uint8_t *l1_payload; - - msg = l1p_msgb_alloc(); - if (!msg) - return NULL; - - l1p = msgb_l1prim(msg); - data_req = &l1p->u.phDataReq; - msu_param = &data_req->msgUnitParam; - payload_type = &msu_param->u8Buffer[0]; - l1_payload = &msu_param->u8Buffer[1]; - - switch (lchan->tch_mode) { - case GSM48_CMODE_SPEECH_AMR: - *payload_type = GsmL1_TchPlType_Amr; - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; - } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - msu_param->u8Size = 8; -#endif - } - break; - default: - msgb_free(msg); - msg = NULL; - break; - } - - return msg; } -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 6 16:20:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 16:20:13 +0000 Subject: [PATCH] libosmocore[master]: gitignore: add gsup_test, tlv_test Message-ID: Review at https://gerrit.osmocom.org/207 gitignore: add gsup_test, tlv_test Change-Id: Ied1cbc7a48bdbc3696e9d8657285071c377d6de5 --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/207/1 diff --git a/.gitignore b/.gitignore index 70e2016..3a64e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,8 @@ tests/gprs/gprs_test tests/msgb/msgb_test tests/sim/sim_test +tests/gsup/gsup_test +tests/tlv/tlv_test utils/osmo-arfcn utils/osmo-auc-gen -- To view, visit https://gerrit.osmocom.org/207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied1cbc7a48bdbc3696e9d8657285071c377d6de5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 6 16:29:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 16:29:00 +0000 Subject: osmo-bts[master]: Move TCH code to common subdir In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/206/1//COMMIT_MSG Commit Message: Line 7: Move TCH code to common subdir the summary omits one of the two changes. I'd actually prefer to have this in two separate commits... https://gerrit.osmocom.org/#/c/206/1/src/osmo-bts-litecell15/tch.c File src/osmo-bts-litecell15/tch.c: Line 103: void set_payload_size(struct msgb *msg, uint8_t size) no-one is using these functions? they are not published in any .h file? At least explain in the commit log who will use them ... and how :) https://gerrit.osmocom.org/#/c/206/1/src/osmo-bts-sysmo/tch.c File src/osmo-bts-sysmo/tch.c: Line 92: void set_payload_size(struct msgb *msg, uint8_t size) same thing: no users? -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 6 16:31:35 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 16:31:35 +0000 Subject: osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/204/1/configure.ac File configure.ac: Line 31: PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec) libosmocodec is already in here -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 6 16:38:05 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 16:38:05 +0000 Subject: [PATCH] osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/204 to look at the new patch set (#2). Use libosmocodec for AMR RTP Add dependency on libosmocodec and use it to parse RTP with AMR payload. Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 --- M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M tests/sysmobts/Makefile.am 3 files changed, 15 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/204/2 diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 9ed89dc..34f4bb0 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..63d90af 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -298,10 +299,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -323,12 +320,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); #ifdef USE_L1_RTP_MODE memcpy(l1_payload+2, rtp_payload, payload_len); @@ -353,11 +353,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -391,12 +387,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -405,7 +401,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index a00e7c2..2f267f3 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 6 16:38:40 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 6 Jun 2016 16:38:40 +0000 Subject: osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Patch Set 1: Oops, thanks for spotting it! -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 6 21:39:47 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 6 Jun 2016 21:39:47 +0000 Subject: osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/204/2//COMMIT_MSG Commit Message: Line 9: Add dependency on libosmocodec and use it to parse RTP with AMR payload. now "add dependency" isn't accurate :) could you explain in more detail, you're adding libosmocodec linking flags for which program(s) exactly? Also I would appreciate some words on the aim. The current log message makes me (with no idea what AMR is) think this adds the capability to talk a kind of encoding language osmo-bts couldn't handle before. When looking at the code it looks more like it's about some AMR parameters extracted in a better way? https://gerrit.osmocom.org/#/c/204/2/src/osmo-bts-sysmo/tch.c File src/osmo-bts-sysmo/tch.c: Line 326: int8_t sti, cmi; (not really important, but would be nice to avoid cosmetic reordering like this) -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 09:17:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 09:17:10 +0000 Subject: openbsc[master]: add DSUA debug constant In-Reply-To: References: Message-ID: Patch Set 3: bump: is submission of this patch blocked? IMHO the issues raised are prior to this change and should be solved independently. -- To view, visit https://gerrit.osmocom.org/191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:32:39 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 10:32:39 +0000 Subject: [PATCH] osmo-pcu[master]: encoding/rlc_copy_from_aligned_buffer: export written payloa... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/142 to look at the new patch set (#3). encoding/rlc_copy_from_aligned_buffer: export written payload bytes via an argument Require to count statistics for rlc_dl_payload_bytes. Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc --- M src/encoding.cpp M src/encoding.h M src/tbf_dl.cpp M tests/edge/EdgeTest.cpp 4 files changed, 109 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/142/3 diff --git a/src/encoding.cpp b/src/encoding.cpp index 9dba4f6..2102a1e 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -899,13 +899,13 @@ * \param num_chunks count the chunks (llc pdu data) within rlc/mac * \param data_block buffer holds rlc/mac data * \param is_final if this is the last rlc/mac within a TBF + * \param count_payload if not NULL save the written size of payload in bytes into it * \return the state of the rlc/mac like if there is more space for another chunk */ static Encoding::AppendResult rlc_data_to_dl_append_gprs( struct gprs_rlc_data_block_info *rdbi, gprs_llc *llc, int *offset, int *num_chunks, - uint8_t *data_block, - bool is_final) + uint8_t *data_block, bool is_final, int *count_payload) { int chunk; int space; @@ -930,6 +930,8 @@ *e_pointer |= 0x01; /* fill only space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; /* return data block as message */ *offset = rdbi->data_len; (*num_chunks)++; @@ -947,6 +949,8 @@ *e_pointer |= 0x01; /* fill space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; *offset = rdbi->data_len; (*num_chunks)++; rdbi->cv = 0; @@ -974,6 +978,8 @@ // no need to set e_pointer nor increase delimiter /* fill only space, which is 1 octet less than chunk */ llc->consume(data, space); + if (count_payload) + *count_payload = space; /* return data block as message */ *offset = rdbi->data_len; (*num_chunks)++; @@ -999,6 +1005,8 @@ (*num_chunks)++; /* copy (rest of) LLC frame to space and reset later */ llc->consume(data, chunk); + if (count_payload) + *count_payload = chunk; data += chunk; space -= chunk; (*offset) += chunk; @@ -1030,13 +1038,14 @@ * \param num_chunks count the chunks (llc pdu data) within rlc/mac * \param data_block buffer holds rlc/mac data * \param is_final if this is the last rlc/mac within a TBF + * \param count_payload if not NULL save the written size of payload in bytes into it * \return the state of the rlc/mac like if there is more space for another chunk */ static Encoding::AppendResult rlc_data_to_dl_append_egprs( struct gprs_rlc_data_block_info *rdbi, gprs_llc *llc, int *offset, int *num_chunks, uint8_t *data_block, - bool is_final) + bool is_final, int *count_payload) { int chunk; int space; @@ -1060,6 +1069,8 @@ chunk, space); /* fill only space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; /* return data block as message */ *offset = rdbi->data_len; (*num_chunks)++; @@ -1074,6 +1085,8 @@ "header, and we are done\n", chunk, space); /* fill space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; *offset = rdbi->data_len; (*num_chunks)++; rdbi->cv = 0; @@ -1088,6 +1101,8 @@ chunk, space); /* fill space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; *offset = rdbi->data_len; (*num_chunks)++; return Encoding::AR_NEED_MORE_BLOCKS; @@ -1118,6 +1133,8 @@ (*num_chunks)++; /* copy (rest of) LLC frame to space and reset later */ llc->consume(data, chunk); + if (count_payload) + *count_payload = chunk; data += chunk; space -= chunk; (*offset) += chunk; @@ -1183,21 +1200,23 @@ * \param num_chunks count the chunks (llc pdu data) within rlc/mac * \param data_block buffer holds rlc/mac data * \param is_final if this is the last rlc/mac within a TBF + * \param count_payload if not NULL save the written size of payload in bytes into it * \return the state of the rlc/mac like if there is more space for another chunk */ Encoding::AppendResult Encoding::rlc_data_to_dl_append( struct gprs_rlc_data_block_info *rdbi, GprsCodingScheme cs, gprs_llc *llc, int *offset, int *num_chunks, - uint8_t *data_block, - bool is_final) + uint8_t *data_block, bool is_final, int *count_payload) { if (cs.isGprs()) return rlc_data_to_dl_append_gprs(rdbi, - llc, offset, num_chunks, data_block, is_final); + llc, offset, num_chunks, data_block, is_final, + count_payload); if (cs.isEgprs()) return rlc_data_to_dl_append_egprs(rdbi, - llc, offset, num_chunks, data_block, is_final); + llc, offset, num_chunks, data_block, is_final, + count_payload); LOGP(DRLCMACDL, LOGL_ERROR, "%s data block encoding not implemented\n", cs.name()); diff --git a/src/encoding.h b/src/encoding.h index 94e9a02..710de78 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -91,6 +91,5 @@ static AppendResult rlc_data_to_dl_append( struct gprs_rlc_data_block_info *rdbi, GprsCodingScheme cs, gprs_llc *llc, int *offset, int *num_chunks, - uint8_t *data, - bool is_final); + uint8_t *data, bool is_final, int *count_payload); }; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index da6628a..00adbc9 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -538,7 +538,7 @@ is_final = llc_queue()->size() == 0 && !keep_open(fn); ar = Encoding::rlc_data_to_dl_append(rdbi, cs, - &m_llc, &write_offset, &num_chunks, data, is_final); + &m_llc, &write_offset, &num_chunks, data, is_final, NULL); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 96ea0c1..68a0d0b 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -506,6 +506,7 @@ uint8_t llc_data[1500] = {0,}; int num_chunks = 0; int write_offset; + int count_payload; struct gprs_llc llc; Encoding::AppendResult ar; @@ -522,36 +523,42 @@ llc.reset(); llc.put_frame(llc_data, 11); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 11); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 26); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 2 + 11 + 26); + OSMO_ASSERT(count_payload == 26); OSMO_ASSERT(num_chunks == 2); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((11 << 2) | (1 << 1) | (0 << 0))); @@ -569,13 +576,15 @@ llc.reset(); llc.put_frame(llc_data, 20); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 19); + OSMO_ASSERT(count_payload == 19); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == ((0 << 2) | (0 << 1) | (1 << 0))); @@ -589,23 +598,28 @@ OSMO_ASSERT(llc.chunk_size() == 1); + count_payload = -1; + ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 1); + OSMO_ASSERT(count_payload == 1); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 1 + 18); + OSMO_ASSERT(count_payload == 18); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((1 << 2) | (1 << 1) | (1 << 0))); @@ -622,24 +636,28 @@ llc.reset(); llc.put_frame(llc_data, 7); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 7); + OSMO_ASSERT(count_payload == 7); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 11); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 2 + 7 + 11); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((7 << 2) | (1 << 1) | (0 << 0))); @@ -657,13 +675,15 @@ llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(write_offset == 20); + OSMO_ASSERT(count_payload == 20); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(rdbi.cv != 0); @@ -680,13 +700,15 @@ llc.reset(); llc.put_frame(llc_data, 20); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(write_offset == 20); + OSMO_ASSERT(count_payload == 20); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(rdbi.cv == 0); @@ -703,13 +725,15 @@ llc.reset(); llc.put_frame(llc_data, 30); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(write_offset == 20); + OSMO_ASSERT(count_payload == 20); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == 0); @@ -721,24 +745,28 @@ memset(data, 0, sizeof(data)); OSMO_ASSERT(llc.chunk_size() == 10); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 10); + OSMO_ASSERT(count_payload == 10); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 10 + 9); + OSMO_ASSERT(count_payload == 9); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((10 << 2) | (1 << 1) | (1 << 0))); @@ -755,36 +783,42 @@ llc.reset(); llc.put_frame(llc_data, 11); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 11); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 26); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 2 + 11 + 26); + OSMO_ASSERT(count_payload == 26); OSMO_ASSERT(num_chunks == 2); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 5); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((11 << 1) | (0 << 0))); @@ -807,25 +841,30 @@ llc.reset(); llc.put_frame(llc_data, 15); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 15); + OSMO_ASSERT(count_payload == 15); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 12); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); + /* no LI here, becaues there are exact 12 bytes left. Put LI into next frame */ OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 12); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((15 << 1) | (1 << 0))); @@ -838,37 +877,43 @@ memset(data, 0, sizeof(data)); OSMO_ASSERT(llc.chunk_size() == 0); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 0); + OSMO_ASSERT(count_payload == 0); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 7); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == 2 + 0 + 7); + OSMO_ASSERT(count_payload == 7); OSMO_ASSERT(num_chunks == 2); llc.reset(); llc.put_frame(llc_data, 18); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 18); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((0 << 1) | (0 << 0))); @@ -884,25 +929,29 @@ llc.reset(); llc.put_frame(llc_data, 6); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 6); + OSMO_ASSERT(count_payload == 6); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 12); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 12); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((6 << 1) | (0 << 0))); @@ -924,14 +973,16 @@ llc.reset(); llc.put_frame(llc_data, rdbi.data_len); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == rdbi.data_len); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == 0); @@ -948,14 +999,16 @@ llc.reset(); llc.put_frame(llc_data, rdbi.data_len - 1); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == rdbi.data_len - 1); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == (((rdbi.data_len-1) << 1) | (1 << 0))); @@ -973,14 +1026,16 @@ llc.reset(); llc.put_frame(llc_data, rdbi.data_len - 2); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == rdbi.data_len - 2); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == (((rdbi.data_len-2) << 1) | (0 << 0))); -- To view, visit https://gerrit.osmocom.org/142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:41:48 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:41:48 +0000 Subject: libosmo-sccp[master]: Add selector for ANSI or ITU variant In-Reply-To: References: Message-ID: Patch Set 6: (7 comments) https://gerrit.osmocom.org/#/c/73/6/src/sccp.c File src/sccp.c: Line 157: if (ai & sccp_variant[sccp_system.variant].ai_pc_ind) { \ In the long run we need to aim for dual ansi/itu support but it is good enough for this iteration. Line 195: addr->gti_len = length - read; Was the length wrong before? Do we have a test case for this? Line 538: if (sock->gti_data) ai[0] = (sock->gti_ind & 0x0f) << 2; Line wrap please Line 539: if (sock->route_ind || !sock->gti_data) ai[0] |= sccp_variant[sccp_system.variant].ai_route_ind; line wrap after the if please Line 542: if (sock->national) ai[0] |= sccp_variant[sccp_system.variant].ai_national; dito Line 545: if (sock->use_poi) ai[0] |= sccp_variant[sccp_system.variant].ai_pc_ind; dito Line 554: if (!poi) return -1; \ line wrap -- To view, visit https://gerrit.osmocom.org/73 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia17eef8c9b7d8e1092c587f469b4a68aa9702651 Gerrit-PatchSet: 6 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:42:19 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:42:19 +0000 Subject: [MERGED] osmo-pcu[master]: tbf_dl: comment why we sent a dummy LLC packets to delay the... In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: tbf_dl: comment why we sent a dummy LLC packets to delay the release of the TBF ...................................................................... tbf_dl: comment why we sent a dummy LLC packets to delay the release of the TBF Change-Id: I1862674437dffef4de3ffa7b183ecf690020b0ec Reviewed-on: https://gerrit.osmocom.org/143 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M src/tbf_dl.cpp 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index da6628a..0cd6b76 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -515,6 +515,8 @@ bool is_final; if (m_llc.frame_length() == 0) { + /* nothing to sent - delay the release of the TBF */ + int space = block_data_len - write_offset; /* A header will need to by added, so we just need * space-1 octets */ -- To view, visit https://gerrit.osmocom.org/143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1862674437dffef4de3ffa7b183ecf690020b0ec Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:44:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:44:12 +0000 Subject: openbsc[master]: lchan_alloc(): on alloc failure, report original type In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 Verified to work with ip.access nanobts -- To view, visit https://gerrit.osmocom.org/205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:48:31 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:48:31 +0000 Subject: osmo-pcu[master]: encoding/rlc_copy_from_aligned_buffer: export written payloa... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:48:35 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:48:35 +0000 Subject: [MERGED] osmo-pcu[master]: encoding/rlc_copy_from_aligned_buffer: export written payloa... In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: encoding/rlc_copy_from_aligned_buffer: export written payload bytes via an argument ...................................................................... encoding/rlc_copy_from_aligned_buffer: export written payload bytes via an argument Require to count statistics for rlc_dl_payload_bytes. Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc Reviewed-on: https://gerrit.osmocom.org/142 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther --- M src/encoding.cpp M src/encoding.h M src/tbf_dl.cpp M tests/edge/EdgeTest.cpp 4 files changed, 109 insertions(+), 36 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/encoding.cpp b/src/encoding.cpp index 9dba4f6..2102a1e 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -899,13 +899,13 @@ * \param num_chunks count the chunks (llc pdu data) within rlc/mac * \param data_block buffer holds rlc/mac data * \param is_final if this is the last rlc/mac within a TBF + * \param count_payload if not NULL save the written size of payload in bytes into it * \return the state of the rlc/mac like if there is more space for another chunk */ static Encoding::AppendResult rlc_data_to_dl_append_gprs( struct gprs_rlc_data_block_info *rdbi, gprs_llc *llc, int *offset, int *num_chunks, - uint8_t *data_block, - bool is_final) + uint8_t *data_block, bool is_final, int *count_payload) { int chunk; int space; @@ -930,6 +930,8 @@ *e_pointer |= 0x01; /* fill only space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; /* return data block as message */ *offset = rdbi->data_len; (*num_chunks)++; @@ -947,6 +949,8 @@ *e_pointer |= 0x01; /* fill space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; *offset = rdbi->data_len; (*num_chunks)++; rdbi->cv = 0; @@ -974,6 +978,8 @@ // no need to set e_pointer nor increase delimiter /* fill only space, which is 1 octet less than chunk */ llc->consume(data, space); + if (count_payload) + *count_payload = space; /* return data block as message */ *offset = rdbi->data_len; (*num_chunks)++; @@ -999,6 +1005,8 @@ (*num_chunks)++; /* copy (rest of) LLC frame to space and reset later */ llc->consume(data, chunk); + if (count_payload) + *count_payload = chunk; data += chunk; space -= chunk; (*offset) += chunk; @@ -1030,13 +1038,14 @@ * \param num_chunks count the chunks (llc pdu data) within rlc/mac * \param data_block buffer holds rlc/mac data * \param is_final if this is the last rlc/mac within a TBF + * \param count_payload if not NULL save the written size of payload in bytes into it * \return the state of the rlc/mac like if there is more space for another chunk */ static Encoding::AppendResult rlc_data_to_dl_append_egprs( struct gprs_rlc_data_block_info *rdbi, gprs_llc *llc, int *offset, int *num_chunks, uint8_t *data_block, - bool is_final) + bool is_final, int *count_payload) { int chunk; int space; @@ -1060,6 +1069,8 @@ chunk, space); /* fill only space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; /* return data block as message */ *offset = rdbi->data_len; (*num_chunks)++; @@ -1074,6 +1085,8 @@ "header, and we are done\n", chunk, space); /* fill space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; *offset = rdbi->data_len; (*num_chunks)++; rdbi->cv = 0; @@ -1088,6 +1101,8 @@ chunk, space); /* fill space */ llc->consume(data, space); + if (count_payload) + *count_payload = space; *offset = rdbi->data_len; (*num_chunks)++; return Encoding::AR_NEED_MORE_BLOCKS; @@ -1118,6 +1133,8 @@ (*num_chunks)++; /* copy (rest of) LLC frame to space and reset later */ llc->consume(data, chunk); + if (count_payload) + *count_payload = chunk; data += chunk; space -= chunk; (*offset) += chunk; @@ -1183,21 +1200,23 @@ * \param num_chunks count the chunks (llc pdu data) within rlc/mac * \param data_block buffer holds rlc/mac data * \param is_final if this is the last rlc/mac within a TBF + * \param count_payload if not NULL save the written size of payload in bytes into it * \return the state of the rlc/mac like if there is more space for another chunk */ Encoding::AppendResult Encoding::rlc_data_to_dl_append( struct gprs_rlc_data_block_info *rdbi, GprsCodingScheme cs, gprs_llc *llc, int *offset, int *num_chunks, - uint8_t *data_block, - bool is_final) + uint8_t *data_block, bool is_final, int *count_payload) { if (cs.isGprs()) return rlc_data_to_dl_append_gprs(rdbi, - llc, offset, num_chunks, data_block, is_final); + llc, offset, num_chunks, data_block, is_final, + count_payload); if (cs.isEgprs()) return rlc_data_to_dl_append_egprs(rdbi, - llc, offset, num_chunks, data_block, is_final); + llc, offset, num_chunks, data_block, is_final, + count_payload); LOGP(DRLCMACDL, LOGL_ERROR, "%s data block encoding not implemented\n", cs.name()); diff --git a/src/encoding.h b/src/encoding.h index 94e9a02..710de78 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -91,6 +91,5 @@ static AppendResult rlc_data_to_dl_append( struct gprs_rlc_data_block_info *rdbi, GprsCodingScheme cs, gprs_llc *llc, int *offset, int *num_chunks, - uint8_t *data, - bool is_final); + uint8_t *data, bool is_final, int *count_payload); }; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 0cd6b76..66f747b 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -540,7 +540,7 @@ is_final = llc_queue()->size() == 0 && !keep_open(fn); ar = Encoding::rlc_data_to_dl_append(rdbi, cs, - &m_llc, &write_offset, &num_chunks, data, is_final); + &m_llc, &write_offset, &num_chunks, data, is_final, NULL); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 96ea0c1..68a0d0b 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -506,6 +506,7 @@ uint8_t llc_data[1500] = {0,}; int num_chunks = 0; int write_offset; + int count_payload; struct gprs_llc llc; Encoding::AppendResult ar; @@ -522,36 +523,42 @@ llc.reset(); llc.put_frame(llc_data, 11); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 11); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 26); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 2 + 11 + 26); + OSMO_ASSERT(count_payload == 26); OSMO_ASSERT(num_chunks == 2); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((11 << 2) | (1 << 1) | (0 << 0))); @@ -569,13 +576,15 @@ llc.reset(); llc.put_frame(llc_data, 20); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 19); + OSMO_ASSERT(count_payload == 19); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == ((0 << 2) | (0 << 1) | (1 << 0))); @@ -589,23 +598,28 @@ OSMO_ASSERT(llc.chunk_size() == 1); + count_payload = -1; + ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 1); + OSMO_ASSERT(count_payload == 1); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 1 + 18); + OSMO_ASSERT(count_payload == 18); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((1 << 2) | (1 << 1) | (1 << 0))); @@ -622,24 +636,28 @@ llc.reset(); llc.put_frame(llc_data, 7); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 7); + OSMO_ASSERT(count_payload == 7); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 11); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 2 + 7 + 11); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((7 << 2) | (1 << 1) | (0 << 0))); @@ -657,13 +675,15 @@ llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(write_offset == 20); + OSMO_ASSERT(count_payload == 20); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(rdbi.cv != 0); @@ -680,13 +700,15 @@ llc.reset(); llc.put_frame(llc_data, 20); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(write_offset == 20); + OSMO_ASSERT(count_payload == 20); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(rdbi.cv == 0); @@ -703,13 +725,15 @@ llc.reset(); llc.put_frame(llc_data, 30); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(write_offset == 20); + OSMO_ASSERT(count_payload == 20); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == 0); @@ -721,24 +745,28 @@ memset(data, 0, sizeof(data)); OSMO_ASSERT(llc.chunk_size() == 10); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 10); + OSMO_ASSERT(count_payload == 10); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 10 + 9); + OSMO_ASSERT(count_payload == 9); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((10 << 2) | (1 << 1) | (1 << 0))); @@ -755,36 +783,42 @@ llc.reset(); llc.put_frame(llc_data, 11); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 11); + OSMO_ASSERT(count_payload == 11); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 26); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 2 + 11 + 26); + OSMO_ASSERT(count_payload == 26); OSMO_ASSERT(num_chunks == 2); llc.reset(); llc.put_frame(llc_data, 99); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 5); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((11 << 1) | (0 << 0))); @@ -807,25 +841,30 @@ llc.reset(); llc.put_frame(llc_data, 15); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 15); + OSMO_ASSERT(count_payload == 15); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 12); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); + /* no LI here, becaues there are exact 12 bytes left. Put LI into next frame */ OSMO_ASSERT(ar == Encoding::AR_NEED_MORE_BLOCKS); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 12); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == ((15 << 1) | (1 << 0))); @@ -838,37 +877,43 @@ memset(data, 0, sizeof(data)); OSMO_ASSERT(llc.chunk_size() == 0); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 0); + OSMO_ASSERT(count_payload == 0); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 7); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == 2 + 0 + 7); + OSMO_ASSERT(count_payload == 7); OSMO_ASSERT(num_chunks == 2); llc.reset(); llc.put_frame(llc_data, 18); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv != 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 18); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((0 << 1) | (0 << 0))); @@ -884,25 +929,29 @@ llc.reset(); llc.put_frame(llc_data, 6); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, false); + &llc, &write_offset, &num_chunks, data, false, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_SPACE_LEFT); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(write_offset == 1 + 6); + OSMO_ASSERT(count_payload == 6); OSMO_ASSERT(num_chunks == 1); llc.reset(); llc.put_frame(llc_data, 12); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == 12); OSMO_ASSERT(num_chunks == 3); OSMO_ASSERT(data[0] == ((6 << 1) | (0 << 0))); @@ -924,14 +973,16 @@ llc.reset(); llc.put_frame(llc_data, rdbi.data_len); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 1); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == rdbi.data_len); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == 0); @@ -948,14 +999,16 @@ llc.reset(); llc.put_frame(llc_data, rdbi.data_len - 1); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == rdbi.data_len - 1); OSMO_ASSERT(num_chunks == 1); OSMO_ASSERT(data[0] == (((rdbi.data_len-1) << 1) | (1 << 0))); @@ -973,14 +1026,16 @@ llc.reset(); llc.put_frame(llc_data, rdbi.data_len - 2); + count_payload = -1; ar = Encoding::rlc_data_to_dl_append(&rdbi, cs, - &llc, &write_offset, &num_chunks, data, true); + &llc, &write_offset, &num_chunks, data, true, &count_payload); OSMO_ASSERT(ar == Encoding::AR_COMPLETED_BLOCK_FILLED); OSMO_ASSERT(rdbi.e == 0); OSMO_ASSERT(rdbi.cv == 0); OSMO_ASSERT(write_offset == (int)rdbi.data_len); + OSMO_ASSERT(count_payload == rdbi.data_len - 2); OSMO_ASSERT(num_chunks == 2); OSMO_ASSERT(data[0] == (((rdbi.data_len-2) << 1) | (0 << 0))); -- To view, visit https://gerrit.osmocom.org/142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e622acb1f13f7489946baf049de4ba1cde6a1fc Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:48:52 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:48:52 +0000 Subject: osmo-pcu[master]: add KPI counter to count bytes for RLC and LLC frames In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9a98a5a375d39b3f4990360056c4d6145e755f4d Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:50:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:50:42 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true Message-ID: Review at https://gerrit.osmocom.org/208 dyn PDCH: Fix free slot search for chan_alloc_reverse == true For chan_alloc_reverse, _lc_find_trx() should return the last free slot instead of the first. Original patch by jolly, but split in two by nhofmeyr. Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/208/1 diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index de9da81..8600846 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -75,12 +75,24 @@ _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) { struct gsm_bts_trx_ts *ts; - int j, ss; + int j, start, stop, dir, ss; if (!trx_is_usable(trx)) return NULL; - for (j = 0; j < 8; j++) { + if (trx->bts->chan_alloc_reverse) { + /* check TS 7..0 */ + start = 7; + stop = -1; + dir = -1; + } else { + /* check TS 0..7 */ + start = 0; + stop = 8; + dir = 1; + } + + for (j = start; j != stop; j += dir) { ts = &trx->ts[j]; if (!ts_is_usable(ts)) continue; -- To view, visit https://gerrit.osmocom.org/208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:50:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:50:42 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots Message-ID: Review at https://gerrit.osmocom.org/209 dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots Remove check for dyn PDCH in _lc_find_trx(), instead call _lc_find_trx() via _lc_find_bts() several times, so that pure TCH/F is preferred to TCH/F_PDCH. Add this logic next to the other channel match decisions in chan_alloc(). BTW, the removed check in _lc_find_trx() whether PDCH is active is not necessary, as described in the added comment for lchan_alloc(). Original patch idea by jolly, but split in two and implemented differently by nhofmeyr. Change-Id: I0c728b922656be03588b775638b610a93f8187d5 --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 29 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/09/209/1 diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 8600846..f84f030 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -96,14 +96,7 @@ ts = &trx->ts[j]; if (!ts_is_usable(ts)) continue; - /* ip.access dynamic TCH/F + PDCH combination */ - if (ts->pchan == GSM_PCHAN_TCH_F_PDCH && - pchan == GSM_PCHAN_TCH_F) { - /* we can only consider such a dynamic channel - * if the PDCH is currently inactive */ - if (ts->flags & TS_F_PDCH_MODE) - continue; - } else if (ts->pchan != pchan) + if (ts->pchan != pchan) continue; /* check if all sub-slots are allocated yet */ for (ss = 0; ss < subslots_per_pchan[pchan]; ss++) { @@ -140,7 +133,12 @@ return NULL; } -/* Allocate a logical channel */ +/* Allocate a logical channel. + * + * For TCH/F, we may return a dynamic TCH/F_PDCH channel (but prefer a pure + * TCH/F). If we pick a TCH/F_PDCH time slot, PDCH will be disabled later on; + * there is no need to check whether PDCH mode is currently active, here. + */ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger) { @@ -180,6 +178,14 @@ lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); type = GSM_LCHAN_TCH_F; } + + /* try dynamic TCH/F_PDCH */ + if (lchan == NULL) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); + /* TCH/F_PDCH will be used as TCH/F */ + if (lchan) + type = GSM_LCHAN_TCH_F; + } } break; case GSM_LCHAN_TCH_F: @@ -189,6 +195,14 @@ lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); type = GSM_LCHAN_TCH_H; } + /* If we don't have TCH/H either, try dynamic TCH/F_PDCH */ + if (!lchan) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); + /* TCH/F_PDCH used as TCH/F -- here, type is already + * set to GSM_LCHAN_TCH_F, but for clarity's sake... */ + if (lchan) + type = GSM_LCHAN_TCH_F; + } break; case GSM_LCHAN_TCH_H: lchan =_lc_find_bts(bts, GSM_PCHAN_TCH_H); @@ -197,6 +211,12 @@ lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); type = GSM_LCHAN_TCH_F; } + /* If we don't have TCH/F either, try dynamic TCH/F_PDCH */ + if (!lchan) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); + if (lchan) + type = GSM_LCHAN_TCH_F; + } break; default: LOGP(DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type); -- To view, visit https://gerrit.osmocom.org/209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c728b922656be03588b775638b610a93f8187d5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:50:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:50:42 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... Message-ID: Review at https://gerrit.osmocom.org/210 dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 45 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/10/210/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..7cd83b1 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -256,6 +256,12 @@ struct gsm48_req_ref *rqd_ref; struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + } dyn_pdch; #else /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. * Currently we don't share these headers so this is a magic number. */ diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index abe2f9b..59176df 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -470,6 +470,15 @@ if (rc < 0) return rc; + /* if channel is in PDCH mode, deactivate PDCH first */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH + && (lchan->ts->flags & TS_F_PDCH_MODE)) { + /* store activation type and handover reference */ + lchan->dyn_pdch.act_type = act_type; + lchan->dyn_pdch.ho_ref = ho_ref; + return rsl_ipacc_pdch_activate(lchan->ts, 0); + } + ta = lchan->rqd_ta; /* BS11 requires TA shifted by 2 bits */ @@ -746,6 +755,11 @@ LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + + /* Put PDCH channel back into PDCH mode first */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + return rsl_ipacc_pdch_activate(lchan->ts, 1); + do_lchan_free(lchan); return 0; @@ -1187,6 +1201,26 @@ return 0; } +static int rsl_rx_pdch_act_ack(struct msgb *msg) +{ + msg->lchan->ts->flags |= TS_F_PDCH_MODE; + + /* We have activated PDCH, so now the channel is available again. */ + do_lchan_free(msg->lchan); + + return 0; +} + +static int rsl_rx_pdch_deact_ack(struct msgb *msg) +{ + msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + + rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, + msg->lchan->dyn_pdch.ho_ref); + + return 0; +} + static int abis_rsl_rx_dchan(struct msgb *msg) { struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg); @@ -1225,14 +1259,14 @@ break; case RSL_MT_IPAC_PDCH_ACT_ACK: DEBUGP(DRSL, "%s IPAC PDCH ACT ACK\n", ts_name); - msg->lchan->ts->flags |= TS_F_PDCH_MODE; + rc = rsl_rx_pdch_act_ack(msg); break; case RSL_MT_IPAC_PDCH_ACT_NACK: LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH ACT NACK\n", ts_name); break; case RSL_MT_IPAC_PDCH_DEACT_ACK: DEBUGP(DRSL, "%s IPAC PDCH DEACT ACK\n", ts_name); - msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + rc = rsl_rx_pdch_deact_ack(msg); break; case RSL_MT_IPAC_PDCH_DEACT_NACK: LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH DEACT NACK\n", ts_name); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 5c27862..04452f7 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -329,8 +329,10 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { generate_ma_for_ts(&cur_trx->ts[i]); + cur_trx->ts[i].flags |= TS_F_PDCH_MODE; + } } } if (isd->link_type == E1INP_SIGN_RSL) -- To view, visit https://gerrit.osmocom.org/210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:50:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:50:42 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP Message-ID: Review at https://gerrit.osmocom.org/211 dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP Add dyn_pdch_init() and call from inp_sig_cb() upon RSL UP. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT, i.e. when the PDCH ACT ACK messages are received. Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 --- M openbsc/src/libbsc/bsc_init.c 1 file changed, 34 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/11/211/1 diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 04452f7..0c0eb84 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -302,6 +302,36 @@ generate_ma_for_ts(&trx->ts[i]); } +static void dyn_pdch_init(struct gsm_bts_trx *trx) +{ + unsigned int i; + struct gsm_bts_trx_ts *ts; + int rc; + unsigned int pdch_act_count = 0; + + for (i = 0; i < TRX_NR_TS; i++) { + ts = &trx->ts[i]; + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + rc = rsl_ipacc_pdch_activate(ts, 1); + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "Failed to activate PDCH on" + " BTS %u TRX %u TS %u: %d\n", + trx->bts->nr, trx->nr, i, rc); + continue; + } + pdch_act_count ++; + } + } + + if (pdch_act_count) { + LOGP(DRSL, LOGL_NOTICE, + "Activated PDCH on %u dynamic TCH/F_PDCH time slots" + " for BTS %u TRX %u\n", + pdch_act_count, trx->bts->nr, trx->nr); + } +} + /* Callback function to be called every time we receive a signal from INPUT */ static int inp_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) @@ -329,14 +359,14 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); - cur_trx->ts[i].flags |= TS_F_PDCH_MODE; - } } } - if (isd->link_type == E1INP_SIGN_RSL) + if (isd->link_type == E1INP_SIGN_RSL) { bootstrap_rsl(trx); + dyn_pdch_init(trx); + } break; case S_L_INP_TEI_DN: LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx); -- To view, visit https://gerrit.osmocom.org/211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:51:47 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:51:47 +0000 Subject: openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 restore +2 by hwelte on previous patch set (was abandoned and re-submitted due to gerrit internal reasons) -- To view, visit https://gerrit.osmocom.org/208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:52:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:52:14 +0000 Subject: openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 restore +2 by hwelte on previous patch set (was abandoned and re-submitted due to gerrit internal reasons) -- To view, visit https://gerrit.osmocom.org/210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:52:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:52:38 +0000 Subject: openbsc[master]: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 restore +2 by hwelte on previous patch set (was abandoned and re-submitted due to gerrit internal reasons) -- To view, visit https://gerrit.osmocom.org/211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:53:22 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:53:22 +0000 Subject: [ABANDON] openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: dyn PDCH: Fix free slot search for chan_alloc_reverse == true ...................................................................... Abandoned abandoned and re-submitted due to gerrit internal reasons -- To view, visit https://gerrit.osmocom.org/179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie919bfcaabab5286cbbbb1dbda0c140c62289503 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:53:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:53:27 +0000 Subject: [ABANDON] openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots ...................................................................... Abandoned abandoned and re-submitted due to gerrit internal reasons -- To view, visit https://gerrit.osmocom.org/180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iddd575873a2fe819fc182a6b3d4186caea1997e5 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:53:31 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:53:31 +0000 Subject: [ABANDON] openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel ...................................................................... Abandoned abandoned and re-submitted due to gerrit internal reasons -- To view, visit https://gerrit.osmocom.org/181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5b7cff07ad9ac281a212daff8106a7d65c3c3145 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:53:34 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:53:34 +0000 Subject: [ABANDON] openbsc[master]: dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP ...................................................................... Abandoned abandoned and re-submitted due to gerrit internal reasons -- To view, visit https://gerrit.osmocom.org/182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:55:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 7 Jun 2016 10:55:09 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/209/1//COMMIT_MSG Commit Message: Line 11: Add this logic next to the other channel match decisions in chan_alloc(). I meant lchan_alloc() -- To view, visit https://gerrit.osmocom.org/209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c728b922656be03588b775638b610a93f8187d5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:55:14 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:55:14 +0000 Subject: libosmocore[master]: Add Finite State Machine abstraction code In-Reply-To: References: Message-ID: Patch Set 5: (4 comments) https://gerrit.osmocom.org/#/c/163/5/include/osmocom/core/fsm.h File include/osmocom/core/fsm.h: PS5, Line 40: const? Line 44: void (*allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void *data); Maybe also a _before_ and _after_ state has been transitioned? https://gerrit.osmocom.org/#/c/163/5/src/fsm.c File src/fsm.c: Line 67: * logging can be used for the LU procedure of one subscriber, while Mention time out handling as well and where would you attach state of a state? To the _inst or somewhere else? E.g. a pending msgb? https://gerrit.osmocom.org/#/c/163/5/tests/testsuite.at File tests/testsuite.at: Line 208: cat $abs_srcdir/fsm/fsm_test.err > experr Jacob had this list ordered to execute the long running tests last (bssgp-fc and timer). We have broken that quite some time agao but I think it would be nice to restore it. -- To view, visit https://gerrit.osmocom.org/163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:55:40 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:55:40 +0000 Subject: openbsc[master]: add DRANAP debug constant In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 10:56:25 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 10:56:25 +0000 Subject: [MERGED] osmo-pcu[master]: add KPI counter to count bytes for RLC and LLC frames In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: add KPI counter to count bytes for RLC and LLC frames ...................................................................... add KPI counter to count bytes for RLC and LLC frames rlc.dl_bytes bytes before sending rlc rlc.dl_payload_bytes count data w/o LI rlc.ul_bytes bytes when received rlc (only valid) rlc.ul_payload_bytes count data fragments w/o LI llc.dl_bytes complete encapsulated LLC PDUs llc.ul_bytes complete received LLC PDUs Change-Id: I9a98a5a375d39b3f4990360056c4d6145e755f4d Reviewed-on: https://gerrit.osmocom.org/145 Reviewed-by: Harald Welte Reviewed-by: Holger Freyther Tested-by: Jenkins Builder --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_sched.cpp M src/tbf_dl.cpp M src/tbf_ul.cpp 5 files changed, 41 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/bts.cpp b/src/bts.cpp index 953ac4d..9e91b87 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -73,6 +73,10 @@ { "rlc.late-block", "RLC Late Block "}, { "rlc.sent-dummy", "RLC Sent Dummy "}, { "rlc.sent-control", "RLC Sent Control "}, + { "rlc.dl_bytes", "RLC DL Bytes "}, + { "rlc.dl_payload_bytes", "RLC DL Payload Bytes "}, + { "rlc.ul_bytes", "RLC UL Bytes "}, + { "rlc.ul_payload_bytes", "RLC UL Payload Bytes "}, { "decode.errors", "Decode Errors "}, { "sba.allocated", "SBA Allocated "}, { "sba.freed", "SBA Freed "}, @@ -80,6 +84,8 @@ { "llc.timeout", "Timedout Frames "}, { "llc.dropped", "Dropped Frames "}, { "llc.scheduled", "Scheduled Frames "}, + { "llc.dl_bytes", "RLC encapsulated PDUs"}, + { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, }; @@ -1302,6 +1308,8 @@ return -EINVAL; } + bts()->rlc_ul_bytes(len); + LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); diff --git a/src/bts.h b/src/bts.h index 35f24d1..a713c46 100644 --- a/src/bts.h +++ b/src/bts.h @@ -235,6 +235,10 @@ CTR_RLC_LATE_BLOCK, CTR_RLC_SENT_DUMMY, CTR_RLC_SENT_CONTROL, + CTR_RLC_DL_BYTES, + CTR_RLC_DL_PAYLOAD_BYTES, + CTR_RLC_UL_BYTES, + CTR_RLC_UL_PAYLOAD_BYTES, CTR_DECODE_ERRORS, CTR_SBA_ALLOCATED, CTR_SBA_FREED, @@ -242,6 +246,8 @@ CTR_LLC_FRAME_TIMEDOUT, CTR_LLC_FRAME_DROPPED, CTR_LLC_FRAME_SCHED, + CTR_LLC_DL_BYTES, + CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, }; @@ -313,6 +319,10 @@ void rlc_late_block(); void rlc_sent_dummy(); void rlc_sent_control(); + void rlc_dl_bytes(int bytes); + void rlc_dl_payload_bytes(int bytes); + void rlc_ul_bytes(int bytes); + void rlc_ul_payload_bytes(int bytes); void decode_error(); void sba_allocated(); void sba_freed(); @@ -320,6 +330,8 @@ void llc_timedout_frame(); void llc_dropped_frame(); void llc_frame_sched(); + void llc_dl_bytes(int bytes); + void llc_ul_bytes(int bytes); void rach_frame(); void ms_present(int32_t n); @@ -427,6 +439,11 @@ return m_statg; } +#define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \ + inline void BTS::func_name(int inc) {\ + rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \ + } + #define CREATE_COUNT_INLINE(func_name, ctr_name) \ inline void BTS::func_name() {\ rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \ @@ -455,6 +472,10 @@ CREATE_COUNT_INLINE(rlc_late_block, CTR_RLC_LATE_BLOCK); CREATE_COUNT_INLINE(rlc_sent_dummy, CTR_RLC_SENT_DUMMY); CREATE_COUNT_INLINE(rlc_sent_control, CTR_RLC_SENT_CONTROL); +CREATE_COUNT_ADD_INLINE(rlc_dl_bytes, CTR_RLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_dl_payload_bytes, CTR_RLC_DL_PAYLOAD_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_bytes, CTR_RLC_UL_BYTES); +CREATE_COUNT_ADD_INLINE(rlc_ul_payload_bytes, CTR_RLC_UL_PAYLOAD_BYTES); CREATE_COUNT_INLINE(decode_error, CTR_DECODE_ERRORS) CREATE_COUNT_INLINE(sba_allocated, CTR_SBA_ALLOCATED) CREATE_COUNT_INLINE(sba_freed, CTR_SBA_FREED) @@ -462,6 +483,8 @@ CREATE_COUNT_INLINE(llc_timedout_frame, CTR_LLC_FRAME_TIMEDOUT); CREATE_COUNT_INLINE(llc_dropped_frame, CTR_LLC_FRAME_DROPPED); CREATE_COUNT_INLINE(llc_frame_sched, CTR_LLC_FRAME_SCHED); +CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); +CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); #undef CREATE_COUNT_INLINE diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index fce3aaf..0367ad0 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -360,6 +360,7 @@ if (!msg) return -ENOMEM; /* msg is now available */ + bts->bts->rlc_dl_bytes(msg->data_len); /* set USF */ OSMO_ASSERT(msgb_length(msg) > 0); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 66f747b..5931676 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -513,6 +513,7 @@ do { bool is_final; + int payload_written = 0; if (m_llc.frame_length() == 0) { /* nothing to sent - delay the release of the TBF */ @@ -540,7 +541,10 @@ is_final = llc_queue()->size() == 0 && !keep_open(fn); ar = Encoding::rlc_data_to_dl_append(rdbi, cs, - &m_llc, &write_offset, &num_chunks, data, is_final, NULL); + &m_llc, &write_offset, &num_chunks, data, is_final, &payload_written); + + if (payload_written > 0) + bts->rlc_dl_payload_bytes(payload_written); if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; @@ -548,6 +552,7 @@ LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s" "len=%d\n", tbf_name(this), m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); + bts->llc_dl_bytes(m_llc.frame_length()); m_llc.reset(); if (is_final) { diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index e7c64ad..98962d1 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -67,6 +67,8 @@ for (i = 0; i < num_frames; i++) { frame = frames + i; + bts->rlc_ul_payload_bytes(frame->length); + LOGP(DRLCMACUL, LOGL_DEBUG, "-- Frame %d starts at offset %d, " "length=%d, is_complete=%d\n", i + 1, frame->offset, frame->length, frame->is_complete); @@ -79,6 +81,7 @@ LOGP(DRLCMACUL, LOGL_INFO, "%s complete UL frame len=%d\n", tbf_name(this) , m_llc.frame_length()); snd_ul_ud(); + bts->llc_ul_bytes(m_llc.frame_length()); m_llc.reset(); } } -- To view, visit https://gerrit.osmocom.org/145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a98a5a375d39b3f4990360056c4d6145e755f4d Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:03:06 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:03:06 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) I would have preferred not to mix the min/max handling make MSISDN optional as they have little to do with each other. I was willing to look away but there is something else I don't find right so please split up, bool ext = (GSM_SUBSCR_CREAT_W_RAND_EXT == gsmnet->subscr_creation_mode) ? true : false; we have this snippet at three or more places. This show an issue. Can you centralize the creation? https://gerrit.osmocom.org/#/c/201/1/openbsc/src/libcommon/gsm_subscriber_base.c File openbsc/src/libcommon/gsm_subscriber_base.c: Line 66: s->extension[0] = '\0'; Okay but we can rely on talloc_zero :) -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:03:35 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:03:35 +0000 Subject: [MERGED] openbsc[master]: Add warning for unsupported DTX configurations In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: Add warning for unsupported DTX configurations ...................................................................... Add warning for unsupported DTX configurations libosmo-abis do not consider DTX bits while processing TRAU frames. As I do not have equipment to test it, I'm not sure if/how non-IP BTS will work in case of DTX - warn users about it. Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Related: OS#22 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index f4d47b4..b0f2f62 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1748,7 +1748,9 @@ struct gsm_bts *bts = vty->index; bts->dtxu = (argc > 0) ? GSM48_DTX_SHALL_BE_USED : GSM48_DTX_MAY_BE_USED; - + if (!is_ipaccess_bts(bts)) + vty_out(vty, "%% DTX enabled on non-IP BTS: this configuration " + "neither supported nor tested!%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -1771,7 +1773,9 @@ struct gsm_bts *bts = vty->index; bts->dtxd = true; - + if (!is_ipaccess_bts(bts)) + vty_out(vty, "%% DTX enabled on non-IP BTS: this configuration " + "neither supported nor tested!%s", VTY_NEWLINE); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:04:37 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:04:37 +0000 Subject: libosmocore[master]: gitignore: add gsup_test, tlv_test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied1cbc7a48bdbc3696e9d8657285071c377d6de5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:04:38 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:04:38 +0000 Subject: [MERGED] libosmocore[master]: gitignore: add gsup_test, tlv_test In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: gitignore: add gsup_test, tlv_test ...................................................................... gitignore: add gsup_test, tlv_test Change-Id: Ied1cbc7a48bdbc3696e9d8657285071c377d6de5 Reviewed-on: https://gerrit.osmocom.org/207 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/.gitignore b/.gitignore index 70e2016..3a64e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,8 @@ tests/gprs/gprs_test tests/msgb/msgb_test tests/sim/sim_test +tests/gsup/gsup_test +tests/tlv/tlv_test utils/osmo-arfcn utils/osmo-auc-gen -- To view, visit https://gerrit.osmocom.org/207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied1cbc7a48bdbc3696e9d8657285071c377d6de5 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:06:50 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:06:50 +0000 Subject: osmo-bts[master]: Move TCH code to common subdir In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) See neels comments and mine about copyright. You want to kill one code clone and seem to introduce two more. Doesn't seem like a net win. :) https://gerrit.osmocom.org/#/c/206/1/src/common/tch.c File src/common/tch.c: Line 3: /* (C) 2016 by sysmocom s.f.m.c. GmbH You say copy and then have a copyright year of 2016? You would have to list the original author. -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:07:12 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:07:12 +0000 Subject: openbsc[master]: add DSUA debug constant In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:08:26 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:08:26 +0000 Subject: openbsc[master]: Add talkspurt indicator for gsm_lchan In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/203/1/openbsc/include/openbsc/gsm_data_shared.h File openbsc/include/openbsc/gsm_data_shared.h: Line 312: /* RTP helper*/ space between r and * Line 313: bool marker; Can you think of a short but more explaining name? How is this marker set? Is it set to remember to send the marker bit? Is it used when RTP with the marker bit has been received? -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:08:38 +0000 Subject: libosmo-sccp[master]: Add selector for ANSI or ITU variant In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/73 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia17eef8c9b7d8e1092c587f469b4a68aa9702651 Gerrit-PatchSet: 6 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:09:39 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:09:39 +0000 Subject: openbsc[master]: lchan_alloc(): on alloc failure, report original type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:10:40 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:10:40 +0000 Subject: [MERGED] openbsc[master]: lchan_alloc(): on alloc failure, report original type In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: lchan_alloc(): on alloc failure, report original type ...................................................................... lchan_alloc(): on alloc failure, report original type In lchan_alloc(), there are several decisions to fall back to another type of channel, followed by setting the channel type to the fall back type. So far, this was set regardless of allocation success or failure. If such fall back type is not available, do not modify the local type variable and thus report an S_CHALLOC_ALLOC_FAIL on the type originally requested (report is at the end of lchan_alloc()). Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Neels Hofmeyr: Verified Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index de9da81..c9c5fa8 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -161,12 +161,14 @@ if (allow_bigger) { if (lchan == NULL) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); - type = GSM_LCHAN_TCH_H; + if (lchan) + type = GSM_LCHAN_TCH_H; } if (lchan == NULL) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); - type = GSM_LCHAN_TCH_F; + if (lchan) + type = GSM_LCHAN_TCH_F; } } break; @@ -175,7 +177,8 @@ /* If we don't have TCH/F available, fall-back to TCH/H */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); - type = GSM_LCHAN_TCH_H; + if (lchan) + type = GSM_LCHAN_TCH_H; } break; case GSM_LCHAN_TCH_H: @@ -183,7 +186,8 @@ /* If we don't have TCH/H available, fall-back to TCH/F */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); - type = GSM_LCHAN_TCH_F; + if (lchan) + type = GSM_LCHAN_TCH_F; } break; default: -- To view, visit https://gerrit.osmocom.org/205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 11:11:55 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 11:11:55 +0000 Subject: openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 12:32:01 +0000 Subject: [PATCH] osmo-pcu[master]: tbf: replace this == NULL check in tbf->name In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/136 to look at the new patch set (#2). tbf: replace this == NULL check in tbf->name All checks of (this == null) will be eliminated by GCC >= 6.1 (https://gcc.gnu.org/gcc-6/changes.html, Value range propagation now assumes that the this pointer of C++ member functions is non-null. Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b --- M src/tbf.cpp 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/36/136/2 diff --git a/src/tbf.cpp b/src/tbf.cpp index 69b9e3a..1fc1aef 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1176,14 +1176,11 @@ const char *tbf_name(gprs_rlcmac_tbf *tbf) { - return tbf->name(); + return tbf ? tbf->name() : "(no TBF)"; } const char *gprs_rlcmac_tbf::name() const { - if (this == NULL) - return "(no TBF)"; - snprintf(m_name_buf, sizeof(m_name_buf) - 1, "TBF(TFI=%d TLLI=0x%08x DIR=%s STATE=%s%s)", m_tfi, tlli(), -- To view, visit https://gerrit.osmocom.org/136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 12:32:01 +0000 Subject: [PATCH] osmo-pcu[master]: tbf_dl: correct tbf name in log message for moveing a DL TBF Message-ID: Review at https://gerrit.osmocom.org/212 tbf_dl: correct tbf name in log message for moveing a DL TBF It makes no sense to call functions of null pointer object. Use the name of the old tbf. Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef --- M src/tbf_dl.cpp M tests/tbf/TbfTest.err 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/212/1 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 5931676..9dd4bfc 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -214,7 +214,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "%s IMSI %s: " "moving DL TBF to new MS object\n", - dl_tbf->name(), imsi); + ms_old->dl_tbf()->name(), imsi); dl_tbf = ms_old->dl_tbf(); /* Move the DL TBF to the new MS */ dl_tbf->set_ms(ms); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9bea2fd..4e83ce2 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1868,7 +1868,7 @@ - No gaps in received block, last block: BSN=0 CV=15 Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 0 There is a new MS object for the same MS: (0xf1223344, '0011223344') -> (0xf5667788, '') -(no TBF) IMSI 0011223344: moving DL TBF to new MS object +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) IMSI 0011223344: moving DL TBF to new MS object Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Attaching TBF to MS object, TLLI = 0xf5667788, TBF = TBF(TFI=0 TLLI=0xf5667788 DIR=DL STATE=FINISHED) Modifying MS object, TLLI = 0xf5667788, IMSI '' -> '0011223344' -- To view, visit https://gerrit.osmocom.org/212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 12:32:01 +0000 Subject: [PATCH] osmo-pcu[master]: NOT-FOR-MERGE/llc: fix NULL-pointer check gprs_llc_queue::si... Message-ID: Review at https://gerrit.osmocom.org/213 NOT-FOR-MERGE/llc: fix NULL-pointer check gprs_llc_queue::size() gprs_llc_queue::octets() Change-Id: I918a094e0dc59098a9eb00d152c9ae42d36b3a99 --- M src/llc.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/213/1 diff --git a/src/llc.h b/src/llc.h index 94de16e..4883624 100644 --- a/src/llc.h +++ b/src/llc.h @@ -127,10 +127,10 @@ inline size_t gprs_llc_queue::size() const { - return this ? m_queue_size : 0; + return m_queue_size; } inline size_t gprs_llc_queue::octets() const { - return this ? m_queue_octets : 0; + return m_queue_octets; } -- To view, visit https://gerrit.osmocom.org/213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I918a094e0dc59098a9eb00d152c9ae42d36b3a99 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:33:38 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 12:33:38 +0000 Subject: osmo-pcu[master]: tbf: replace this == NULL check in tbf->name In-Reply-To: References: Message-ID: Patch Set 2: I splitted this commit into two. one for tbf->name #this one for gprs_llc_queue::size() / gprs_llc_queue::octects() #213 -- To view, visit https://gerrit.osmocom.org/136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:40:31 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 12:40:31 +0000 Subject: [PATCH] osmo-bts[master]: Move common TCH code into src/common/tch.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/206 to look at the new patch set (#2). Move common TCH code into src/common/tch.c Move gen_empty_tch_msg() into src/common/ to make adding DTXd support easier. Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Related: OS#1563 --- M src/common/Makefile.am A src/common/tch.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 4 files changed, 68 insertions(+), 81 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/06/206/2 diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 8df6513..5c84ade 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -4,7 +4,7 @@ noinst_LIBRARIES = libbts.a libl1sched.a libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ - rsl.c vty.c paging.c measurement.c amr.c lchan.c \ + rsl.c vty.c paging.c measurement.c amr.c tch.c lchan.c \ load_indication.c pcu_sock.c handover.c msg_utils.c \ load_indication.c pcu_sock.c handover.c msg_utils.c \ tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c \ diff --git a/src/common/tch.c b/src/common/tch.c new file mode 100644 index 0000000..d31b04e --- /dev/null +++ b/src/common/tch.c @@ -0,0 +1,67 @@ +/* OsmoBTS common TCH code */ + +/* (C) 2011-2012 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +extern struct msgb *l1p_msgb_alloc(void); +extern uint8_t *get_payload_addr(struct msgb *msg); +extern void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan); +extern void set_payload_size(struct msgb *msg, uint8_t size); + +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) +{ + struct msgb *msg; + uint8_t *l1_payload; + + msg = l1p_msgb_alloc(); + if (!msg) + return NULL; + + l1_payload = get_payload_addr(msg); + + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_AMR: + set_payload_type(msg, lchan); + if (lchan->tch.last_sid.len) { + memcpy(l1_payload, lchan->tch.last_sid.buf, + lchan->tch.last_sid.len); + set_payload_size(msg, lchan->tch.last_sid.len + 1); + } else { + /* FIXME: decide if we should send SPEECH_BAD or + * SID_BAD */ +#if 0 + *payload_type = GsmL1_TchPlType_Amr_SidBad; + memset(l1_payload, 0xFF, 5); + msu_param->u8Size = 5 + 3; +#else + /* send an all-zero SID */ + set_payload_size(msg, 8); +#endif + } + break; + default: + msgb_free(msg); + msg = NULL; + break; + } + + return msg; +} diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 2c42ef5..d09264a 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -530,43 +530,3 @@ get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; } - -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) -{ - struct msgb *msg; - uint8_t *l1_payload; - - msg = l1p_msgb_alloc(); - if (!msg) - return NULL; - - l1_payload = get_payload_addr(msg); - - switch (lchan->tch_mode) { - case GSM48_CMODE_SPEECH_AMR: - set_payload_type(msg, lchan); - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - set_payload_size(msg, lchan->tch.last_sid.len + 1); - } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - set_payload_size(msg, 8); -#endif - } - break; - default: - msgb_free(msg); - msg = NULL; - break; - } - - return msg; -} diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 3b9fe36..13f9ec6 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -625,43 +625,3 @@ get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; } - -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) -{ - struct msgb *msg; - uint8_t *l1_payload; - - msg = l1p_msgb_alloc(); - if (!msg) - return NULL; - - l1_payload = get_payload_addr(msg); - - switch (lchan->tch_mode) { - case GSM48_CMODE_SPEECH_AMR: - set_payload_type(msg, lchan); - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - set_payload_size(msg, lchan->tch.last_sid.len + 1); - } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - set_payload_size(msg, 8); -#endif - } - break; - default: - msgb_free(msg); - msg = NULL; - break; - } - - return msg; -} -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:40:32 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 12:40:32 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: Add bts-specific payload functions Message-ID: Review at https://gerrit.osmocom.org/214 sysmobts: Add bts-specific payload functions Add functions for getting payload buffer address, setting payload type and size. Convert gen_empty_tch_msg() to use them. This is in preparation for splitting out TCH hadling logic into common/ to make DTXd implementation easier. Change-Id: If213ec89762e50b4a5e79becebb589d6260e6b62 --- M src/osmo-bts-sysmo/tch.c 1 file changed, 49 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/214/1 diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..3b9fe36 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -89,6 +89,51 @@ out[i] = (in[i] & 0xF) << 4; } +void set_payload_size(struct msgb *msg, uint8_t size) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + msu_param->u8Size = size; +} + +void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *payload_type; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + payload_type = &msu_param->u8Buffer[0]; + + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_AMR: + *payload_type = GsmL1_TchPlType_Amr; + break; + default: + return; + } +} + +uint8_t *get_payload_addr(struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + + return &msu_param->u8Buffer[1]; +} static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) { @@ -584,29 +629,21 @@ struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) { struct msgb *msg; - GsmL1_Prim_t *l1p; - GsmL1_PhDataReq_t *data_req; - GsmL1_MsgUnitParam_t *msu_param; - uint8_t *payload_type; uint8_t *l1_payload; msg = l1p_msgb_alloc(); if (!msg) return NULL; - l1p = msgb_l1prim(msg); - data_req = &l1p->u.phDataReq; - msu_param = &data_req->msgUnitParam; - payload_type = &msu_param->u8Buffer[0]; - l1_payload = &msu_param->u8Buffer[1]; + l1_payload = get_payload_addr(msg); switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: - *payload_type = GsmL1_TchPlType_Amr; + set_payload_type(msg, lchan); if (lchan->tch.last_sid.len) { memcpy(l1_payload, lchan->tch.last_sid.buf, lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; + set_payload_size(msg, lchan->tch.last_sid.len + 1); } else { /* FIXME: decide if we should send SPEECH_BAD or * SID_BAD */ @@ -616,7 +653,7 @@ msu_param->u8Size = 5 + 3; #else /* send an all-zero SID */ - msu_param->u8Size = 8; + set_payload_size(msg, 8); #endif } break; -- To view, visit https://gerrit.osmocom.org/214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If213ec89762e50b4a5e79becebb589d6260e6b62 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:40:32 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 12:40:32 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Add bts-specific payload functions Message-ID: Review at https://gerrit.osmocom.org/215 LC15: Add bts-specific payload functions Add functions for getting payload buffer address, setting payload type and size. Convert gen_empty_tch_msg() to use them. This is in preparation for splitting out TCH hadling logic into common/ to make DTXd implementation easier. Change-Id: Ie36b6d7a32cd3eaeb09f5a60c1a6471516a61fbd --- M src/osmo-bts-litecell15/tch.c 1 file changed, 50 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/15/215/1 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a11911c..2c42ef5 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -100,6 +100,52 @@ #define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ #define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ +void set_payload_size(struct msgb *msg, uint8_t size) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + msu_param->u8Size = size; +} + +void set_payload_type(struct msgb *msg, struct gsm_lchan *lchan) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *payload_type; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + payload_type = &msu_param->u8Buffer[0]; + + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_AMR: + *payload_type = GsmL1_TchPlType_Amr; + break; + default: + return; + } +} + +uint8_t *get_payload_addr(struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + + return &msu_param->u8Buffer[1]; +} + static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) { struct msgb *msg; @@ -488,29 +534,21 @@ struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) { struct msgb *msg; - GsmL1_Prim_t *l1p; - GsmL1_PhDataReq_t *data_req; - GsmL1_MsgUnitParam_t *msu_param; - uint8_t *payload_type; uint8_t *l1_payload; msg = l1p_msgb_alloc(); if (!msg) return NULL; - l1p = msgb_l1prim(msg); - data_req = &l1p->u.phDataReq; - msu_param = &data_req->msgUnitParam; - payload_type = &msu_param->u8Buffer[0]; - l1_payload = &msu_param->u8Buffer[1]; + l1_payload = get_payload_addr(msg); switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: - *payload_type = GsmL1_TchPlType_Amr; + set_payload_type(msg, lchan); if (lchan->tch.last_sid.len) { memcpy(l1_payload, lchan->tch.last_sid.buf, lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; + set_payload_size(msg, lchan->tch.last_sid.len + 1); } else { /* FIXME: decide if we should send SPEECH_BAD or * SID_BAD */ @@ -520,7 +558,7 @@ msu_param->u8Size = 5 + 3; #else /* send an all-zero SID */ - msu_param->u8Size = 8; + set_payload_size(msg, 8); #endif } break; -- To view, visit https://gerrit.osmocom.org/215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie36b6d7a32cd3eaeb09f5a60c1a6471516a61fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:43:54 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 12:43:54 +0000 Subject: osmo-bts[master]: Move common TCH code into src/common/tch.c In-Reply-To: References: Message-ID: Patch Set 1: The new functions look like copy-paste because both litecell and sysmobts use the same names like GsmL1_PhDataReq_t but they are defined in different files. I have not found better way to compile common/tch.c with different headers for LC15 and sysmo. -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:46:49 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 12:46:49 +0000 Subject: [PATCH] openbsc[master]: Add talkspurt indicator for gsm_lchan In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/203 to look at the new patch set (#2). Add talkspurt indicator for gsm_lchan Add bit which can be set on BTS side to indicate that next RTP frame should be marked as a beginning of speech. Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Related: OS#1562 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/03/203/2 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..4b876e8 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -309,7 +309,8 @@ int s; /* Kind of the release/activation. E.g. RSL or PCU */ int rel_act_kind; - + /* RTP helper */ + bool rtp_tx_marker; /* power handling */ struct { uint8_t current; -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 12:49:13 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 12:49:13 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 1: https://codesearch.debian.net/results/asciidoc_escape/page_0 I'll only escape the '|' -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 13:26:56 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 13:26:56 +0000 Subject: osmo-pcu[master]: NOT-FOR-MERGE/llc: fix NULL-pointer check gprs_llc_queue::si... In-Reply-To: References: Message-ID: Patch Set 1: there are missing cases, because llc_queue() returns NULL if no ms assoziated. -- To view, visit https://gerrit.osmocom.org/213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I918a094e0dc59098a9eb00d152c9ae42d36b3a99 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 13:37:40 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 13:37:40 +0000 Subject: [PATCH] libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/70 to look at the new patch set (#2). add vty call show asciidoc: generate a documentation for counters For each counter group a ascii doc table is generated containing all single counter with a reference to a section to add additional information to the counter Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb --- M include/osmocom/vty/command.h M src/vty/command.c M src/vty/stats_vty.c 3 files changed, 204 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/70/70/2 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 9a02575..1de748c 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -379,6 +379,8 @@ char *host_config_file(); void host_config_set(const char *); +char *asciidoc_escape(const char *inp); + /* This is called from main when a daemon is invoked with -v or --version. */ void print_version(int print_copyright); diff --git a/src/vty/command.c b/src/vty/command.c index 1f1dddb..a4f5594 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -402,6 +402,59 @@ return cnode->prompt; } +/*! + * \brief escape all special asciidoc symbols + * \param unsafe string + * \return a new talloc char * + */ +char *asciidoc_escape(const char *inp) +{ + int _strlen; + char *out, *out_ptr; + int len = 0, i, j; + + if (!inp) + return NULL; + _strlen = strlen(inp); + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '|': + len += 2; + break; + default: + len += 1; + break; + } + } + + out = talloc_size(NULL, len + 1); + if (!out) + return NULL; + + out_ptr = out; + +#define ADD(out, str) \ + for (j = 0; j < strlen(str); ++j) \ + *(out++) = str[j]; + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '"': + ADD(out_ptr, "\\|"); + break; + default: + *(out_ptr++) = inp[i]; + break; + } + } + +#undef ADD + + out_ptr[0] = '\0'; + return out; +} + static char *xml_escape(const char *inp) { int _strlen; diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index e0239bf..1f80b1b 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -33,6 +33,8 @@ #include #include +#include +#include #define CFG_STATS_STR "Configure stats sub-system\n" #define CFG_REPORTER_STR "Configure a stats reporter\n" @@ -355,6 +357,151 @@ return CMD_SUCCESS; } +static int asciidoc_handle_counter(struct osmo_counter *counter, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = asciidoc_escape(counter->name); + char *description = asciidoc_escape(counter->description); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <> | %s%s", + name, + name, + description ? description : "", + VTY_NEWLINE); + + talloc_free(name); + if (description) + talloc_free(description); + + return 0; +} + +static void asciidoc_counter_generate(struct vty *vty) +{ + vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE); + vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + osmo_counters_for_each(asciidoc_handle_counter, vty); + vty_out(vty, "|===%s", VTY_NEWLINE); +} + +static int asciidoc_rate_ctr_handler( + struct rate_ctr_group *ctrg, struct rate_ctr *ctr, + const struct rate_ctr_desc *desc, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = asciidoc_escape(desc->name); + char *description = asciidoc_escape(desc->description); + char *group_name_prefix = asciidoc_escape(ctrg->desc->group_name_prefix); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <<%s_%s>> | %s%s", + name, + group_name_prefix, + name, + description ? description : NULL, + VTY_NEWLINE); + + /* description seems to be optional */ + talloc_free(name); + talloc_free(group_name_prefix); + if (description) + talloc_free(description); + + return 0; +} + +static int asciidoc_rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_) +{ + struct vty *vty = sctx_; + + char *group_description = asciidoc_escape(ctrg->desc->group_description); + char *group_name_prefix = asciidoc_escape(ctrg->desc->group_name_prefix); + + vty_out(vty, "// rate_ctr_group table %s%s", group_description, VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description, VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + rate_ctr_for_each_counter(ctrg, asciidoc_rate_ctr_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + /* group description seems to be optional */ + if (group_description) + talloc_free(group_description); + + return 0; +} + +static int asciidoc_osmo_stat_item_handler( + struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_) +{ + struct vty *vty = sctx_; + + char *name = asciidoc_escape(item->desc->name); + char *description = asciidoc_escape(item->desc->description); + char *group_name_prefix = asciidoc_escape(statg->desc->group_name_prefix); + char *unit = asciidoc_escape(item->desc->unit); + + /* | name | This document & | description | unit | */ + vty_out(vty, "| %s | <<%s_%s>> | %s | %s%s", + name, + group_name_prefix, + name, + description ? description : "", + unit ? unit : "", + VTY_NEWLINE); + + talloc_free(name); + talloc_free(group_name_prefix); + if (description) + talloc_free(description); + if (unit) + talloc_free(unit); + + return 0; +} + +static int asciidoc_osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_) +{ + char *group_name_prefix = asciidoc_escape(statg->desc->group_name_prefix); + char *group_description = asciidoc_escape(statg->desc->group_description); + + struct vty *vty = sctx_; + vty_out(vty, "%s%s", group_description ? group_description : "" , VTY_NEWLINE); + + vty_out(vty, "// osmo_stat_item_group table %s%s", group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description | unit%s", VTY_NEWLINE); + osmo_stat_item_for_each_item(statg, asciidoc_osmo_stat_item_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + if (group_description) + talloc_free(group_description); + + return 0; +} + +DEFUN(show_stats_asciidoc_table, + show_stats_asciidoc_table_cmd, + "show asciidoc", + "Generate an ascii doc table of all registered counters.\n") +{ + vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); + rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE); + osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE); + asciidoc_counter_generate(vty); + return CMD_SUCCESS; +} + static int config_write_stats_reporter(struct vty *vty, struct osmo_stats_reporter *srep) { if (srep == NULL) @@ -443,4 +590,6 @@ install_element(CFG_STATS_NODE, &cfg_stats_reporter_level_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_enable_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_disable_cmd); + + install_element_ve(&show_stats_asciidoc_table_cmd); } -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 13:37:55 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 13:37:55 +0000 Subject: [PATCH] openbsc[master]: Make random extension range configurable Message-ID: Review at https://gerrit.osmocom.org/216 Make random extension range configurable Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 11 files changed, 78 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/216/1 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6699a86..6ffe1ad 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -35,13 +35,15 @@ int db_fini(void); /* subscriber management */ -struct gsm_subscriber *db_create_subscriber(const char *imsi); +struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, + uint64_t smax); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); int db_subscriber_expire(void *priv, void (*callback)(void *priv, long long unsigned int id)); int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber); -int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber); +int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, + uint64_t smax); int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token); int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei); int db_subscriber_delete(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 31a4ed5..e7cd520 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -290,6 +290,8 @@ /* subscriber related features */ int subscr_creation_mode; + uint64_t ext_min; + uint64_t ext_max; struct gsm_subscriber_group *subscr_group; struct gsm_sms_queue *sms_queue; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 9df989a..3cba5d1 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -90,7 +90,8 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi); + const char *imsi, uint64_t smin, + uint64_t smax); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index afcaaf3..4636d57 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -104,7 +104,8 @@ net->stats.bts.rsl_fail = osmo_counter_alloc("net.bts.rsl_fail"); net->mncc_recv = mncc_recv; - + net->ext_min = GSM_MIN_EXTEN; + net->ext_max = GSM_MAX_EXTEN; gsm_net_update_ctype(net); return net; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index 0d6a37c..a02db36 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -18,6 +18,7 @@ * along with this program. If not, see . * */ + #include #include #include @@ -95,7 +96,9 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi); + subscr = subscr_create_subscriber(net->subscr_group, imsi, + net->ext_min, + net->ext_max); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 9e3fb36..b367139 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -518,7 +518,8 @@ return 0; } -struct gsm_subscriber *db_create_subscriber(const char *imsi) +struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, + uint64_t smax) { dbi_result result; struct gsm_subscriber *subscr; @@ -550,7 +551,7 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr); + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -1249,13 +1250,14 @@ return 0; } -int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber) +int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, + uint64_t smax) { dbi_result result = NULL; uint32_t try; for (;;) { - try = (rand()%(GSM_MAX_EXTEN-GSM_MIN_EXTEN+1)+GSM_MIN_EXTEN); + try = (rand() % (smax - smin + 1) + smin); result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " "WHERE extension = %i", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 92c4cfe..6704497 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -537,7 +537,8 @@ if (!subscr_regexp_check(net, imsi)) return NULL; - return subscr_create_subscriber(net->subscr_group, imsi); + return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, + net->ext_max); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 57c10cf..1dc2cc2 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -203,9 +203,10 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi) + const char *imsi, uint64_t smin, + uint64_t smax) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 3f67b9a..a035bf9 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -240,7 +242,9 @@ if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], + gsmnet->ext_min, + gsmnet->ext_max); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1031,6 +1035,25 @@ return CMD_SUCCESS; } +/* Note: limit on the parameter length is set by internal vty code limitations */ +DEFUN(cfg_nitb_subscr_random, cfg_nitb_subscr_random_cmd, + "subscriber-create-on-demand random <1-9999999999> <2-9999999999>", + "Set random parameters for a new record when a subscriber is first seen.\n" + "Set random parameters for a new record when a subscriber is first seen.\n" + "Minimum for subscriber extension\n""Maximum for subscriber extension\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + if (mi >= ma) { + vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + gsmnet->ext_min = mi; + gsmnet->ext_max = ma; + return CMD_SUCCESS; +} + DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, "subscriber-create-on-demand [regexp]", "Make a new record when a subscriber is first seen.\n" @@ -1080,6 +1103,10 @@ vty_out(vty, "nitb%s", VTY_NEWLINE); vty_out(vty, " %ssubscriber-create-on-demand%s%s", pref, reg, VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) + vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" + PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, + VTY_NEWLINE); vty_out(vty, " %sassign-tmsi%s", gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE); return CMD_SUCCESS; @@ -1134,6 +1161,7 @@ install_element(CONFIG_NODE, &cfg_nitb_cmd); install_node(&nitb_node, config_write_nitb); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd); install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd); diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index ee0cbca..dc81481 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -164,7 +164,7 @@ struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -217,7 +217,7 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); @@ -228,7 +228,7 @@ test_subs("9993245423445", "1234567890", "6543560920"); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index c264328..9ea988d 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -424,11 +424,13 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913769" wrong_imsi = "204300999999999" # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) self.vty.verify('subscriber imsi '+wrong_imsi+' name wrong', ['% No subscriber found for imsi '+wrong_imsi]) res = self.vty.command('subscriber imsi '+imsi+' name '+('X' * 160)) @@ -442,9 +444,28 @@ self.vty.verify('subscriber imsi '+imsi+' extension '+('1' * 14), ['']) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 7 14:00:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 14:00:20 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/70/2/src/vty/command.c File src/vty/command.c: Line 410: char *asciidoc_escape(const char *inp) this introduces a new global symbol into a shared library, i.e. into the global namespace of every program that links the library. We either have to keep an explciit .map file to hide those symbols (like we do with other osmocom libraries), or prefix it with osmo_*, or define it as static in the file where it is used... -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 14:05:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 14:05:04 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/70/2/src/vty/stats_vty.c File src/vty/stats_vty.c: Line 491: "show asciidoc", call it "show asciidoc counters" as it only documents counters so far. This way we can extend it later with "show asciidoc (foo|bar|counters)" as needed. -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 14:14:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 14:14:17 +0000 Subject: openbsc[master]: Add talkspurt indicator for gsm_lchan In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/203/2/openbsc/include/openbsc/gsm_data_shared.h File openbsc/include/openbsc/gsm_data_shared.h: Line 313: bool rtp_tx_marker; the member now has a more descriptive name, but the comment still tells me not what it is actually used for. Yes, somehow related to the RTP marker bit. But how exactly? See the other members, the line of comment gives me an immediate idea about what it is about... -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 14:25:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 14:25:41 +0000 Subject: openbsc[master]: Make random extension range configurable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 14:27:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 14:27:43 +0000 Subject: osmo-bts[master]: LC15: Add bts-specific payload functions In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/215/1/src/osmo-bts-litecell15/tch.c File src/osmo-bts-litecell15/tch.c: PS1, Line 103: set_payload_size as the functions are non-static and added to tch.c, I would expect their name to be more descriptive. "set_payload_type()" doesn't give any indication that it is about tch type. So maybe tch_{set,get}_payload_{type,addr} would be more descriptive -- To view, visit https://gerrit.osmocom.org/215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie36b6d7a32cd3eaeb09f5a60c1a6471516a61fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 14:53:54 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 7 Jun 2016 14:53:54 +0000 Subject: [PATCH] libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/70 to look at the new patch set (#3). add vty call show asciidoc: generate a documentation for counters For each counter group a ascii doc table is generated containing all single counter with a reference to a section to add additional information to the counter Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb --- M include/osmocom/vty/command.h M src/vty/command.c M src/vty/stats_vty.c 3 files changed, 204 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/70/70/3 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 9a02575..135ef2f 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -379,6 +379,8 @@ char *host_config_file(); void host_config_set(const char *); +char *osmo_asciidoc_escape(const char *inp); + /* This is called from main when a daemon is invoked with -v or --version. */ void print_version(int print_copyright); diff --git a/src/vty/command.c b/src/vty/command.c index 1f1dddb..0626143 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -402,6 +402,59 @@ return cnode->prompt; } +/*! + * \brief escape all special asciidoc symbols + * \param unsafe string + * \return a new talloc char * + */ +char *osmo_asciidoc_escape(const char *inp) +{ + int _strlen; + char *out, *out_ptr; + int len = 0, i, j; + + if (!inp) + return NULL; + _strlen = strlen(inp); + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '|': + len += 2; + break; + default: + len += 1; + break; + } + } + + out = talloc_size(NULL, len + 1); + if (!out) + return NULL; + + out_ptr = out; + +#define ADD(out, str) \ + for (j = 0; j < strlen(str); ++j) \ + *(out++) = str[j]; + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '"': + ADD(out_ptr, "\\|"); + break; + default: + *(out_ptr++) = inp[i]; + break; + } + } + +#undef ADD + + out_ptr[0] = '\0'; + return out; +} + static char *xml_escape(const char *inp) { int _strlen; diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index e0239bf..04671d2 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -33,6 +33,8 @@ #include #include +#include +#include #define CFG_STATS_STR "Configure stats sub-system\n" #define CFG_REPORTER_STR "Configure a stats reporter\n" @@ -355,6 +357,151 @@ return CMD_SUCCESS; } +static int asciidoc_handle_counter(struct osmo_counter *counter, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = osmo_asciidoc_escape(counter->name); + char *description = osmo_asciidoc_escape(counter->description); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <> | %s%s", + name, + name, + description ? description : "", + VTY_NEWLINE); + + talloc_free(name); + if (description) + talloc_free(description); + + return 0; +} + +static void asciidoc_counter_generate(struct vty *vty) +{ + vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE); + vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + osmo_counters_for_each(asciidoc_handle_counter, vty); + vty_out(vty, "|===%s", VTY_NEWLINE); +} + +static int asciidoc_rate_ctr_handler( + struct rate_ctr_group *ctrg, struct rate_ctr *ctr, + const struct rate_ctr_desc *desc, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = osmo_asciidoc_escape(desc->name); + char *description = osmo_asciidoc_escape(desc->description); + char *group_name_prefix = osmo_asciidoc_escape(ctrg->desc->group_name_prefix); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <<%s_%s>> | %s%s", + name, + group_name_prefix, + name, + description ? description : NULL, + VTY_NEWLINE); + + /* description seems to be optional */ + talloc_free(name); + talloc_free(group_name_prefix); + if (description) + talloc_free(description); + + return 0; +} + +static int asciidoc_rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_) +{ + struct vty *vty = sctx_; + + char *group_description = osmo_asciidoc_escape(ctrg->desc->group_description); + char *group_name_prefix = osmo_asciidoc_escape(ctrg->desc->group_name_prefix); + + vty_out(vty, "// rate_ctr_group table %s%s", group_description, VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description, VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + rate_ctr_for_each_counter(ctrg, asciidoc_rate_ctr_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + /* group description seems to be optional */ + if (group_description) + talloc_free(group_description); + + return 0; +} + +static int asciidoc_osmo_stat_item_handler( + struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_) +{ + struct vty *vty = sctx_; + + char *name = osmo_asciidoc_escape(item->desc->name); + char *description = osmo_asciidoc_escape(item->desc->description); + char *group_name_prefix = osmo_asciidoc_escape(statg->desc->group_name_prefix); + char *unit = osmo_asciidoc_escape(item->desc->unit); + + /* | name | This document & | description | unit | */ + vty_out(vty, "| %s | <<%s_%s>> | %s | %s%s", + name, + group_name_prefix, + name, + description ? description : "", + unit ? unit : "", + VTY_NEWLINE); + + talloc_free(name); + talloc_free(group_name_prefix); + if (description) + talloc_free(description); + if (unit) + talloc_free(unit); + + return 0; +} + +static int asciidoc_osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_) +{ + char *group_name_prefix = osmo_asciidoc_escape(statg->desc->group_name_prefix); + char *group_description = osmo_asciidoc_escape(statg->desc->group_description); + + struct vty *vty = sctx_; + vty_out(vty, "%s%s", group_description ? group_description : "" , VTY_NEWLINE); + + vty_out(vty, "// osmo_stat_item_group table %s%s", group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description | unit%s", VTY_NEWLINE); + osmo_stat_item_for_each_item(statg, asciidoc_osmo_stat_item_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + if (group_description) + talloc_free(group_description); + + return 0; +} + +DEFUN(show_stats_asciidoc_table, + show_stats_asciidoc_table_cmd, + "show asciidoc counters", + "Generate an ascii doc table of all registered counters.\n") +{ + vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); + rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE); + osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE); + asciidoc_counter_generate(vty); + return CMD_SUCCESS; +} + static int config_write_stats_reporter(struct vty *vty, struct osmo_stats_reporter *srep) { if (srep == NULL) @@ -443,4 +590,6 @@ install_element(CFG_STATS_NODE, &cfg_stats_reporter_level_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_enable_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_disable_cmd); + + install_element_ve(&show_stats_asciidoc_table_cmd); } -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:28:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:28:32 +0000 Subject: osmo-bts[master]: Move common TCH code into src/common/tch.c In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 The problem I see with this to some extent is that there is some commonality between osmo-bts-sysmo and osmo-bts-lc15, but not with other BTS models. So at the very leas the code should have very clearly documented about which type of hardware it applies to. In general, I'm not quite happy with this. As stated before, there is no guarantee that lc15 and sysmobts will not diverge more over time, and then we'd have to split up the 'common' code again. I think for now it's best to get over it and do changes in both BTS back-ends. -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:29:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:29:24 +0000 Subject: osmo-pcu[master]: tbf_dl: correct tbf name in log message for moveing a DL TBF In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:29:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:29:47 +0000 Subject: osmo-pcu[master]: tbf: replace this == NULL check in tbf->name In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:30:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:30:44 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c728b922656be03588b775638b610a93f8187d5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:32:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:32:32 +0000 Subject: osmo-bts[master]: Fix RTP timestamps in case of DTX In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:32:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:32:39 +0000 Subject: [MERGED] osmo-bts[master]: Fix RTP timestamps in case of DTX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix RTP timestamps in case of DTX ...................................................................... Fix RTP timestamps in case of DTX Compute RTP user_ts adjustment based on the difference between current and previous FN instead of hard-coded value. Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Related: OS#1562 Reviewed-on: https://gerrit.osmocom.org/196 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/common/l1sap.c 1 file changed, 16 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ac398d3..77fd1a0 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -69,6 +69,20 @@ static int l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); +static uint32_t fn_ms_adj(uint32_t fn, uint32_t last_fn) +{ + if (last_fn) { + uint32_t ms_passed = GSM_FN_TO_MS(fn - last_fn), + samples_passed = GSM_MS_TO_SAMPLES(ms_passed); + /* round number of samples to the nearest multiple of + GSM_RTP_DURATION */ + uint32_t r = samples_passed + GSM_RTP_DURATION / 2; + r -= r % GSM_RTP_DURATION; + return r; + } + return GSM_RTP_DURATION; +} + static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = { 0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, @@ -853,7 +867,7 @@ /* hand msg to RTP code for transmission */ if (lchan->abis_ip.rtp_socket) osmo_rtp_send_frame(lchan->abis_ip.rtp_socket, - msg->data, msg->len, 160); + msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn)); /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { @@ -871,7 +885,7 @@ msgb_enqueue(&lchan->dl_tch_queue, msg); } - + lchan->tch.last_fn = fn; return 0; } -- To view, visit https://gerrit.osmocom.org/196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 7 15:34:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 7 Jun 2016 15:34:23 +0000 Subject: osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/204/2/src/osmo-bts-sysmo/tch.c File src/osmo-bts-sysmo/tch.c: PS2, Line 326: int8_t why change from uint8_t to int8_t ? -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 16:33:27 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 7 Jun 2016 16:33:27 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/70/2/src/vty/stats_vty.c File src/vty/stats_vty.c: Line 374: if (description) no if needed here. talloc_free(NULL) and free(NULL) is well defined. -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 7 16:45:51 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 16:45:51 +0000 Subject: [PATCH] libosmo-abis[master]: Fix macro definitions Message-ID: Review at https://gerrit.osmocom.org/217 Fix macro definitions Wrap macro parameter in brackets to make sure macros always work properly. Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 --- M include/osmocom/trau/osmo_ortp.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/17/217/1 diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index eb53a41..7c2a5cb 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -28,8 +28,8 @@ #define GSM_RTP_FRAME_DURATION_MS 20 #define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS) #define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) -#define GSM_MS_TO_SAMPLES(ms) (ms * GSM_VOICE_SAMPLES_PER_MS) -#define GSM_FN_TO_MS(fn) (fn * GSM_TDMA_FRAME_MS) +#define GSM_MS_TO_SAMPLES(ms) ((ms) * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_FN_TO_MS(fn) ((fn) * GSM_TDMA_FRAME_MS) /*! \brief Parameter to osmo_rtp_socket_param_set() */ enum osmo_rtp_param { -- To view, visit https://gerrit.osmocom.org/217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 7 17:05:17 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 7 Jun 2016 17:05:17 +0000 Subject: osmo-bts[master]: Move common TCH code into src/common/tch.c In-Reply-To: References: Message-ID: Patch Set 2: The gen_empty_tch_msg() in this patch uses only gsm_lchan and msgb structs. It does not know anything about L1 details - it calls BTS-specific functions for this. So as long as BTS model provides such functions there should be no need to change anything. Of course I can copy-paste old gen_empty_tch_msg() but I think it would be easier to have non-trivial common function and copy-paste only trivial code like the one in set_payload_*. -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 8 11:26:35 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 8 Jun 2016 11:26:35 +0000 Subject: [PATCH] openbsc[master]: Add talkspurt indicator for gsm_lchan In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/203 to look at the new patch set (#3). Add talkspurt indicator for gsm_lchan Add bit which can be set on BTS side to indicate that next RTP frame should be marked as a beginning of speech. Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Related: OS#1562 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/03/203/3 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..51cfcc2 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -309,7 +309,8 @@ int s; /* Kind of the release/activation. E.g. RSL or PCU */ int rel_act_kind; - + /* RTP header Marker bit to indicate beginning of speech after pause */ + bool rtp_tx_marker; /* power handling */ struct { uint8_t current; -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 8 11:38:25 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 8 Jun 2016 11:38:25 +0000 Subject: osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Patch Set 2: osmo_amr_rtp_dec() uses int8_t for sti and cmi - it's generic function so it might be called to parse AMR frame where sti and/or cmi might not make sense: in this case -1 is returned. I do not want to introduce extra warnings so I use int8_t as well. -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 8 11:38:56 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 8 Jun 2016 11:38:56 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/204 to look at the new patch set (#3). sysmobts: use libosmocodec for AMR RTP Use libosmocodec function to parse RTP with AMR payload. This replaces "manual" parsing of AMR frame with function covered by test suite and makes adding DTXd support easier. Related: OS#1563 Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 --- M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M tests/sysmobts/Makefile.am 3 files changed, 15 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/204/3 diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 9ed89dc..34f4bb0 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..63d90af 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -298,10 +299,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -323,12 +320,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); #ifdef USE_L1_RTP_MODE memcpy(l1_payload+2, rtp_payload, payload_len); @@ -353,11 +353,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -391,12 +387,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -405,7 +401,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index a00e7c2..2f267f3 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 8 13:41:41 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 8 Jun 2016 13:41:41 +0000 Subject: [PATCH] osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" Message-ID: Review at https://gerrit.osmocom.org/218 Revert "tbf: Add state WAIT_ASSIGN" This reverts commit f1a7b8fc6651f92a8b7f3f27b7ca05d07f4e44e0. Conflicts: tests/tbf/TbfTest.err The commit broke GPRS service at least for osmo-bts-sysmo on a SysmoBTS 1002 with current master of osmo-bts (ef30f50d5d6d5f863fc147d05ccdceb89284934e). The error observed is the following log output (was viewing both osmo-bts-sysmo and osmo-pcu logs interleaved): <0002> tbf.cpp:874 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN) T3169 timeout during transsmission <0002> tbf.cpp:893 - Assignment was on CCCH <0002> tbf.cpp:899 - No uplink data received yet <0007> l1sap.c:904 RACH for packet access <0001> pcu_l1_if.cpp:311 RACH request received: sapi=1 qta=0, ra=121, fn=13653 [repeat] When removing this single commit from current osmo-pcu master, GPRS service works well on SysmoBTS, with current osmo-bts master. The TbfTest.err expected output needed adjustment after the revert. Disclaimer: I am not aware of adverse effects this commit may have. I have no idea what the WAIT_ASSIGN state is used for -- further review is required. Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 5 files changed, 119 insertions(+), 173 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/18/218/1 diff --git a/src/bts.cpp b/src/bts.cpp index 9e91b87..c366faa 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -552,11 +552,8 @@ m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) { + if (plen >= 0) pcu_l1if_tx_agch(immediate_assignment, plen); - if (tbf) - tbf->set_state(GPRS_RLCMAC_WAIT_ASSIGN); - } bitvec_free(immediate_assignment); @@ -614,10 +611,8 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) { + if (plen >= 0) pcu_l1if_tx_pch(immediate_assignment, plen, imsi); - tbf->set_state(GPRS_RLCMAC_WAIT_ASSIGN); - } bitvec_free(immediate_assignment); } diff --git a/src/tbf.cpp b/src/tbf.cpp index 69b9e3a..c07f379 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -394,7 +394,6 @@ const char *gprs_rlcmac_tbf::tbf_state_name[] = { "NULL", "ASSIGN", - "WAIT ASSIGN", "FLOW", "FINISHED", "WAIT RELEASE", @@ -825,12 +824,6 @@ if ((state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) { if (state_is(GPRS_RLCMAC_ASSIGN)) { LOGP(DRLCMAC, LOGL_NOTICE, "%s releasing due to " - "PACCH assignment timeout (not yet sent).\n", - tbf_name(this)); - tbf_free(this); - return; - } else if (state_is(GPRS_RLCMAC_WAIT_ASSIGN)) { - LOGP(DRLCMAC, LOGL_NOTICE, "%s releasing due to " "PACCH assignment timeout.\n", tbf_name(this)); tbf_free(this); return; @@ -841,7 +834,7 @@ if ((state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(this); dl_tbf->m_wait_confirm = 0; - if (dl_tbf->state_is(GPRS_RLCMAC_WAIT_ASSIGN)) { + if (dl_tbf->state_is(GPRS_RLCMAC_ASSIGN)) { tbf_assign_control_ts(dl_tbf); if (!dl_tbf->upgrade_to_multislot) { @@ -1002,8 +995,6 @@ if (poll_ass_dl) { set_polling(new_poll_fn, ts); - if (new_dl_tbf->state_is(GPRS_RLCMAC_ASSIGN)) - new_dl_tbf->set_state(GPRS_RLCMAC_WAIT_ASSIGN); dl_ass_state = GPRS_RLCMAC_DL_ASS_WAIT_ACK; LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled DL Assignment polling on FN=%d, TS=%d\n", @@ -1076,8 +1067,6 @@ set_polling(new_poll_fn, ts); ul_ass_state = GPRS_RLCMAC_UL_ASS_WAIT_ACK; - if (new_tbf->state_is(GPRS_RLCMAC_ASSIGN)) - new_tbf->set_state(GPRS_RLCMAC_WAIT_ASSIGN); LOGP(DRLCMACDL, LOGL_INFO, "%s Scheduled UL Assignment polling on FN=%d, TS=%d\n", name(), poll_fn, poll_ts); diff --git a/src/tbf.h b/src/tbf.h index ad8ad4c..030663c 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -43,8 +43,7 @@ enum gprs_rlcmac_tbf_state { GPRS_RLCMAC_NULL = 0, /* new created TBF */ - GPRS_RLCMAC_ASSIGN, /* wait for DL transmission */ - GPRS_RLCMAC_WAIT_ASSIGN,/* wait for confirmation */ + GPRS_RLCMAC_ASSIGN, /* wait for downlink assignment */ GPRS_RLCMAC_FLOW, /* RLC/MAC flow, resource needed */ GPRS_RLCMAC_FINISHED, /* flow finished, wait for release */ GPRS_RLCMAC_WAIT_RELEASE,/* wait for release or restart of DL TBF */ @@ -231,7 +230,7 @@ int set_tlli_from_ul(uint32_t new_tlli); void merge_and_clear_ms(GprsMs *old_ms); - static const char *tbf_state_name[7]; + static const char *tbf_state_name[6]; class GprsMs *m_ms; @@ -316,7 +315,10 @@ { /* The TBF is established or has been assigned by a IMM.ASS for * download */ - return state > GPRS_RLCMAC_ASSIGN; + return state > GPRS_RLCMAC_ASSIGN || + (direction == GPRS_RLCMAC_DL_TBF && + state == GPRS_RLCMAC_ASSIGN && + (state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))); } inline uint8_t gprs_rlcmac_tbf::tfi() const diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index e1be844..04697f7 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1072,7 +1072,7 @@ ms2 = the_bts.ms_by_tlli(tlli1); OSMO_ASSERT(ms2 == ms1); OSMO_ASSERT(ms2->dl_tbf()); - OSMO_ASSERT(ms2->dl_tbf()->state_is(GPRS_RLCMAC_WAIT_ASSIGN)); + OSMO_ASSERT(ms2->dl_tbf()->state_is(GPRS_RLCMAC_ASSIGN)); dl_tbf2 = ms2->dl_tbf(); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9bea2fd..9b91241 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -570,8 +570,7 @@ TX: START TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 08 00 23 2b 2b 2b 2b -TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -597,8 +596,7 @@ TX: START TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 18 40 23 2b 2b 2b 2b -TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -624,8 +622,7 @@ TX: START TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 28 80 23 2b 2b 2b 2b -TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -651,8 +648,7 @@ TX: START TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 38 c0 23 2b 2b 2b 2b -TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -678,8 +674,7 @@ TX: START TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 49 00 23 2b 2b 2b 2b -TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -705,8 +700,7 @@ TX: START TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 59 40 23 2b 2b 2b 2b -TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -732,8 +726,7 @@ TX: START TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 69 80 23 2b 2b 2b 2b -TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -759,8 +752,7 @@ TX: START TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 79 c0 23 2b 2b 2b 2b -TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -786,8 +778,7 @@ TX: START TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 8a 00 23 2b 2b 2b 2b -TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -813,8 +804,7 @@ TX: START TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 9a 40 23 2b 2b 2b 2b -TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -840,8 +830,7 @@ TX: START TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 aa 80 23 2b 2b 2b 2b -TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -867,8 +856,7 @@ TX: START TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 ba c0 23 2b 2b 2b 2b -TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -894,8 +882,7 @@ TX: START TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 cb 00 23 2b 2b 2b 2b -TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -921,8 +908,7 @@ TX: START TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 db 40 23 2b 2b 2b 2b -TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -948,8 +934,7 @@ TX: START TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 eb 80 23 2b 2b 2b 2b -TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -975,8 +960,7 @@ TX: START TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 00 fb c0 23 2b 2b 2b 2b -TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1002,8 +986,7 @@ TX: START TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 0c 00 23 2b 2b 2b 2b -TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1029,8 +1012,7 @@ TX: START TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 1c 40 23 2b 2b 2b 2b -TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1056,8 +1038,7 @@ TX: START TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 2c 80 23 2b 2b 2b 2b -TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1083,8 +1064,7 @@ TX: START TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 3c c0 23 2b 2b 2b 2b -TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1110,8 +1090,7 @@ TX: START TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 4d 00 23 2b 2b 2b 2b -TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1137,8 +1116,7 @@ TX: START TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 5d 40 23 2b 2b 2b 2b -TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1164,8 +1142,7 @@ TX: START TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 6d 80 23 2b 2b 2b 2b -TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1191,8 +1168,7 @@ TX: START TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 7d c0 23 2b 2b 2b 2b -TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1218,8 +1194,7 @@ TX: START TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 8e 00 23 2b 2b 2b 2b -TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1245,8 +1220,7 @@ TX: START TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 9e 40 23 2b 2b 2b 2b -TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1272,8 +1246,7 @@ TX: START TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 ae 80 23 2b 2b 2b 2b -TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1299,8 +1272,7 @@ TX: START TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 be c0 23 2b 2b 2b 2b -TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1326,8 +1298,7 @@ TX: START TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 cf 00 23 2b 2b 2b 2b -TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1353,8 +1324,7 @@ TX: START TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 df 40 23 2b 2b 2b 2b -TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1380,8 +1350,7 @@ TX: START TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 ef 80 23 2b 2b 2b 2b -TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1407,8 +1376,7 @@ TX: START TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 00 00 01 ff c0 23 2b 2b 2b 2b -TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) append ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 @@ -1442,10 +1410,9 @@ TX: START TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 23 2b 2b 2b 2b -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) append -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) append -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to RELEASING +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) append +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) append +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to RELEASING TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING) free PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xc0123456, TBF = TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING) @@ -1471,35 +1438,34 @@ TX: START TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 23 2b 2b 2b 2b -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) append -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) downlink (V(A)==0 .. V(S)==0) +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) append +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==0) - Sending new block at BSN 0, CS=CS-1 -- Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) (len=19) +- Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) -- Chunk with length 19 is less than remaining space (20): add length header to to delimit LLC frame -- No space left, so we are done. -Complete DL frame for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN)len=19 -- Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) (len=19) +Complete DL frame for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN)len=19 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) data block (BSN 0, CS-1): 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-1): 07 00 00 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 MSG = 07 00 00 4d 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) downlink (V(A)==0 .. V(S)==1) +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==1) - Sending new block at BSN 1, CS=CS-1 -- Chunk with length 19 is less than remaining space (20): add length header to to delimit LLC frame -- No space left, so we are done. -Complete DL frame for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN)len=19 -- Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) (len=19) +Complete DL frame for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN)len=19 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) (len=19) data block (BSN 1, CS-1): 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 - Copying data unit 0 (BSN 1) msg block (BSN 1, CS-1): 07 00 02 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 MSG = 07 00 02 4d 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) downlink (V(A)==0 .. V(S)==2) +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==2) - Sending new block at BSN 2, CS=CS-1 -- Chunk with length 19 is less than remaining space (20): add length header to to delimit LLC frame -- Final block, so we done. -Complete DL frame for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN)len=19 -TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FINISHED +Complete DL frame for TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN)len=19 +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FINISHED data block (BSN 2, CS-1): 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 - Copying data unit 0 (BSN 2) - Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). @@ -1533,26 +1499,29 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) changes state from FLOW to WAIT ASSIGN Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN) restarting timer 3169 while old timer 3169 pending -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN): Got CS-1 RLC data block: CV=0, BSN=0, SPB=0, PI=0, E=1, TI=1, bitoffs=24 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW): Got CS-1 RLC data block: CV=0, BSN=0, SPB=0, PI=0, E=1, TI=1, bitoffs=24 - BSN 0 storing in window (0..63) -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN): data_length=20, data=f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW): data_length=20, data=f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Decoded premier TLLI=0x00000000 of UL DATA TFI=0. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed - Raising V(R) to 1 - Taking block 0 out, raising V(Q) to 1 - Assembling frames: (len=20) -- Frame 1 starts at offset 4, length=16, is_complete=1 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) complete UL frame len=16 -LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) len=16 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) complete UL frame len=16 +LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) len=16 No bctx +- No gaps in received block, last block: BSN=0 CV=0 +- Finished with UL TBF +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes state from FLOW to FINISHED - Scheduling Ack/Nack, because TLLI is included. -Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN)', TA=7 +- Scheduling Ack/Nack, because last block has CV==0. +Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 @@ -1577,8 +1546,7 @@ TX: START TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=7 TA=7 pollFN=-1 Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT ASSIGN) append +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: MS requests single block allocation @@ -1618,16 +1586,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1704,16 +1671,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 8f 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1756,7 +1722,6 @@ +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -1765,7 +1730,7 @@ ------------------------- RX : Uplink Control Block ------------------------- RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Packet Control Ack TBF: [UPLINK] DOWNLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) stopping timer 0. Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 @@ -1843,16 +1808,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654348 TS 7 -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 -Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654348, TS=7 +Scheduling control message at RTS for TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=48 28 5e ac ce f1 0f 1d 00 00 88 40 09 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=1, CPS=0, RSB=0, rc=184 @@ -1915,16 +1879,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2012,16 +1975,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654340 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654340, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 Slot Allocation (Algorithm A) for class 1 @@ -2094,16 +2056,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2176,15 +2137,14 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) changes state from FLOW to WAIT ASSIGN Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN) restarting timer 3169 while old timer 3169 pending -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN): Got CS-1 RLC data block: CV=0, BSN=0, SPB=0, PI=0, E=1, TI=1, bitoffs=24 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW): Got CS-1 RLC data block: CV=0, BSN=0, SPB=0, PI=0, E=1, TI=1, bitoffs=24 - BSN 0 storing in window (0..63) -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN): data_length=20, data=f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW): data_length=20, data=f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Decoded premier TLLI=0x00000000 of UL DATA TFI=0. Got RACH from TLLI=0x00000000 while TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) still exists. Killing pending DL TBF TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to RELEASING @@ -2202,10 +2162,14 @@ - Taking block 0 out, raising V(Q) to 1 - Assembling frames: (len=20) -- Frame 1 starts at offset 4, length=16, is_complete=1 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) complete UL frame len=16 -LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) len=16 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) complete UL frame len=16 +LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) len=16 No bctx +- No gaps in received block, last block: BSN=0 CV=0 +- Finished with UL TBF +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes state from FLOW to FINISHED - Scheduling Ack/Nack, because TLLI is included. +- Scheduling Ack/Nack, because last block has CV==0. New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: @@ -2246,16 +2210,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 83 1d 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2337,7 +2300,6 @@ +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW): Scheduling polling at FN 2654288 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Scheduled DL Assignment polling on FN=2654288, TS=7 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=48 08 00 00 0c 72 00 02 08 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -2346,7 +2308,7 @@ ------------------------- RX : Uplink Control Block ------------------------- RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Packet Control Ack TBF: [UPLINK] DOWNLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) stopping timer 0. Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 @@ -2997,7 +2959,6 @@ +++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Downlink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE): Scheduling polling at FN 2654413 TS 7 -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to WAIT ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on FN=2654413, TS=7 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654400 block=2 data=48 08 20 08 0c 72 00 02 18 00 80 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -3012,7 +2973,7 @@ PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING), 1 TBFs, USFs = 01, TFIs = 00000002. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) ********** TBF ends here ********** -TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=WAIT ASSIGN) changes state from WAIT ASSIGN to FLOW +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) stopping timer 0. Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 @@ -3348,16 +3309,15 @@ +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to WAIT ASSIGN -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 -Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) (TRX=0, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f0 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) Packet Control Ack -TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) changes state from WAIT ASSIGN to FLOW +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 9 10:31:58 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 9 Jun 2016 10:31:58 +0000 Subject: [PATCH] openbsc[master]: Add DTXd indicator to gsm_lchan Message-ID: Review at https://gerrit.osmocom.org/219 Add DTXd indicator to gsm_lchan It is necessary for proper reporting of DTXd status during the measurement period. Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Related: OS#1701 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/219/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..60a689c 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -292,6 +292,8 @@ } last_sid; uint8_t last_cmr; uint32_t last_fn; + /* indicates if DTXd was active during DL measurement period */ + bool dtxd_active; } tch; /* BTS-side ciphering state (rx only, bi-directional, ...) */ uint8_t ciph_state; -- To view, visit https://gerrit.osmocom.org/219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 9 10:44:12 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 9 Jun 2016 10:44:12 +0000 Subject: [PATCH] osmo-bts[master]: Add DTXd support for sysmoBTS and LC15 Message-ID: Review at https://gerrit.osmocom.org/220 Add DTXd support for sysmoBTS and LC15 * set/clear DTXd activity indicator for measurement reporting * set DTXd status based on information from RSL Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Related: OS#1563 --- M src/common/rsl.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/220/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index e13d48c..dddde69 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -103,6 +103,8 @@ struct rsl_ie_chan_mode *cm) { lchan->rsl_cmode = cm->spd_ind; + lchan->ts->trx->bts->dtxd = (cm->dtx_dtu & RSL_CMOD_DTXd) ? true : false; + switch (cm->chan_rate) { case RSL_CMOD_SP_GSM1: lchan->tch_mode = GSM48_CMODE_SPEECH_V1; @@ -1694,8 +1696,7 @@ } /* 8.4.8 MEASUREMENT RESult */ -static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, - bool dtxd_used) +static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len) { struct msgb *msg; uint8_t meas_res[16]; @@ -1713,8 +1714,10 @@ return -ENOMEM; msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++); - size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, dtxd_used, + size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, + lchan->tch.dtxd_active, meas_res); + lchan->tch.dtxd_active = false; if (ie_len >= 3) { msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res); lchan->meas.flags &= ~LC_UL_M_F_RES_VALID; @@ -1755,9 +1758,7 @@ LOGP(DRSL, LOGL_INFO, "%s Handing RLL msg %s from LAPDm to MEAS REP\n", gsm_lchan_name(lchan), rsl_msg_name(rh->msg_type)); - /* FIXME: add dtx downlink support */ - rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg), - false); + rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg)); msgb_free(msg); return rc; } else { diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 6a60b3f..1054aba 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -439,6 +439,8 @@ l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ + if (trx->bts->dtxd && trx != trx->bts->c0) + lchan->tch.dtxd_active = true; empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index debc80a..d6d0cdd 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -433,6 +433,8 @@ l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ + if (trx->bts->dtxd && trx != trx->bts->c0) + lchan->tch.dtxd_active = true; empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ -- To view, visit https://gerrit.osmocom.org/220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 9 12:18:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 9 Jun 2016 12:18:39 +0000 Subject: [PATCH] osmo-bts[master]: Add DTXd support for sysmoBTS and LC15 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/220 to look at the new patch set (#2). Add DTXd support for sysmoBTS and LC15 * set/clear DTXd activity indicator for measurement reporting * set DTXd status based on information from RSL Related: OS#1563 Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Depends-On: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c --- M src/common/rsl.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/220/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index e13d48c..dddde69 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -103,6 +103,8 @@ struct rsl_ie_chan_mode *cm) { lchan->rsl_cmode = cm->spd_ind; + lchan->ts->trx->bts->dtxd = (cm->dtx_dtu & RSL_CMOD_DTXd) ? true : false; + switch (cm->chan_rate) { case RSL_CMOD_SP_GSM1: lchan->tch_mode = GSM48_CMODE_SPEECH_V1; @@ -1694,8 +1696,7 @@ } /* 8.4.8 MEASUREMENT RESult */ -static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, - bool dtxd_used) +static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len) { struct msgb *msg; uint8_t meas_res[16]; @@ -1713,8 +1714,10 @@ return -ENOMEM; msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++); - size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, dtxd_used, + size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, + lchan->tch.dtxd_active, meas_res); + lchan->tch.dtxd_active = false; if (ie_len >= 3) { msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res); lchan->meas.flags &= ~LC_UL_M_F_RES_VALID; @@ -1755,9 +1758,7 @@ LOGP(DRSL, LOGL_INFO, "%s Handing RLL msg %s from LAPDm to MEAS REP\n", gsm_lchan_name(lchan), rsl_msg_name(rh->msg_type)); - /* FIXME: add dtx downlink support */ - rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg), - false); + rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg)); msgb_free(msg); return rc; } else { diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 6a60b3f..1054aba 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -439,6 +439,8 @@ l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ + if (trx->bts->dtxd && trx != trx->bts->c0) + lchan->tch.dtxd_active = true; empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index debc80a..d6d0cdd 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -433,6 +433,8 @@ l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ + if (trx->bts->dtxd && trx != trx->bts->c0) + lchan->tch.dtxd_active = true; empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ -- To view, visit https://gerrit.osmocom.org/220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 9 15:54:38 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 9 Jun 2016 15:54:38 +0000 Subject: [PATCH] osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/204 to look at the new patch set (#4). Use libosmocodec for AMR RTP Use libosmocodec function to parse RTP with AMR payload in sysmoBTS and LC15. This replaces "manual" parsing of AMR frame with function covered by test suite and makes adding DTXd support easier. Related: OS#1563 Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 --- M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M tests/sysmobts/Makefile.am 5 files changed, 27 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/204/4 diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 5b63001..768e29d 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,8 +1,8 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -lortp +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a11911c..15ad456 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -222,10 +223,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -247,13 +244,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); memcpy(l1_payload+2, rtp_payload, payload_len); /* CMI in downlink tells the L1 encoder which encoding function @@ -264,11 +263,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -302,12 +297,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -316,7 +311,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 9ed89dc..34f4bb0 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..63d90af 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -298,10 +299,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -323,12 +320,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); #ifdef USE_L1_RTP_MODE memcpy(l1_payload+2, rtp_payload, payload_len); @@ -353,11 +353,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -391,12 +387,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -405,7 +401,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index a00e7c2..2f267f3 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 10 10:46:48 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 10:46:48 +0000 Subject: [MERGED] openbsc[master]: add DRANAP debug constant In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: add DRANAP debug constant ...................................................................... add DRANAP debug constant Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2 --- M openbsc/include/openbsc/debug.h M openbsc/src/gprs/sgsn_main.c M openbsc/src/libcommon/debug.c 3 files changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h index 189ca47..b6087e2 100644 --- a/openbsc/include/openbsc/debug.h +++ b/openbsc/include/openbsc/debug.h @@ -34,6 +34,7 @@ DSMPP, DFILTER, DGTPHUB, + DRANAP, Debug_LastEntry, }; diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index cb762b7..aef36ca 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -281,6 +281,11 @@ .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DRANAP] = { + .name = "DRANAP", + .description = "RAN Application Part (RANAP)", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static const struct log_info gprs_log_info = { diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c index 7fb3ecb..232f6f7 100644 --- a/openbsc/src/libcommon/debug.c +++ b/openbsc/src/libcommon/debug.c @@ -165,6 +165,11 @@ .description = "BSC/NAT IMSI based filtering", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DRANAP] = { + .name = "DRANAP", + .description = "Radio Access Network Application Part Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; enum log_filter { -- To view, visit https://gerrit.osmocom.org/190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:06:43 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:06:43 +0000 Subject: openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (2 comments) The only thing I find is that we are not running an activation timer in case of a handover. I think it is something we should fix mid-term. Can you either add it to your backlog or open a ticket in the osmocom.org tracker? https://gerrit.osmocom.org/#/c/210/1/openbsc/src/libbsc/abis_rsl.c File openbsc/src/libbsc/abis_rsl.c: Line 479: return rsl_ipacc_pdch_activate(lchan->ts, 0); * This routine might be called by rsl_rx_chan_rqd and bsc_handover_start In the later we don't run any activation timer (to detect broken channels). Can you add that to your backlog? I think we should have a timer running here. Line 1209: do_lchan_free(msg->lchan); Good. maybe add an OSMO_ASSERT to check that msg->lchan->state != NONE? -- To view, visit https://gerrit.osmocom.org/210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:10:52 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:10:52 +0000 Subject: osmo-pcu[master]: tbf_dl: correct tbf name in log message for moveing a DL TBF In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/212/1/src/tbf_dl.cpp File src/tbf_dl.cpp: Line 217: ms_old->dl_tbf()->name(), imsi); coverity probably warned about this one? -- To view, visit https://gerrit.osmocom.org/212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:12:58 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:12:58 +0000 Subject: [PATCH] osmo-pcu[master]: tbf_dl: correct tbf name in log message for moving a DL TBF In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/212 to look at the new patch set (#2). tbf_dl: correct tbf name in log message for moving a DL TBF It makes no sense to call functions on null pointer object. Use the name of the old tbf. Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef --- M src/tbf_dl.cpp M tests/tbf/TbfTest.err 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/212/2 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 5931676..9dd4bfc 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -214,7 +214,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "%s IMSI %s: " "moving DL TBF to new MS object\n", - dl_tbf->name(), imsi); + ms_old->dl_tbf()->name(), imsi); dl_tbf = ms_old->dl_tbf(); /* Move the DL TBF to the new MS */ dl_tbf->set_ms(ms); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9bea2fd..4e83ce2 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1868,7 +1868,7 @@ - No gaps in received block, last block: BSN=0 CV=15 Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 0 There is a new MS object for the same MS: (0xf1223344, '0011223344') -> (0xf5667788, '') -(no TBF) IMSI 0011223344: moving DL TBF to new MS object +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) IMSI 0011223344: moving DL TBF to new MS object Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Attaching TBF to MS object, TLLI = 0xf5667788, TBF = TBF(TFI=0 TLLI=0xf5667788 DIR=DL STATE=FINISHED) Modifying MS object, TLLI = 0xf5667788, IMSI '' -> '0011223344' -- To view, visit https://gerrit.osmocom.org/212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:13:17 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:13:17 +0000 Subject: osmo-pcu[master]: tbf_dl: correct tbf name in log message for moving a DL TBF In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) Fixed typos int he commit message. https://gerrit.osmocom.org/#/c/212/1//COMMIT_MSG Commit Message: PS1, Line 7: moving a moveing => moving. -- To view, visit https://gerrit.osmocom.org/212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:13:23 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:13:23 +0000 Subject: [MERGED] osmo-pcu[master]: tbf_dl: correct tbf name in log message for moving a DL TBF In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: tbf_dl: correct tbf name in log message for moving a DL TBF ...................................................................... tbf_dl: correct tbf name in log message for moving a DL TBF It makes no sense to call functions on null pointer object. Use the name of the old tbf. Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Reviewed-on: https://gerrit.osmocom.org/212 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther --- M src/tbf_dl.cpp M tests/tbf/TbfTest.err 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 5931676..9dd4bfc 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -214,7 +214,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "%s IMSI %s: " "moving DL TBF to new MS object\n", - dl_tbf->name(), imsi); + ms_old->dl_tbf()->name(), imsi); dl_tbf = ms_old->dl_tbf(); /* Move the DL TBF to the new MS */ dl_tbf->set_ms(ms); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 9bea2fd..4e83ce2 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1868,7 +1868,7 @@ - No gaps in received block, last block: BSN=0 CV=15 Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 0 There is a new MS object for the same MS: (0xf1223344, '0011223344') -> (0xf5667788, '') -(no TBF) IMSI 0011223344: moving DL TBF to new MS object +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) IMSI 0011223344: moving DL TBF to new MS object Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Attaching TBF to MS object, TLLI = 0xf5667788, TBF = TBF(TFI=0 TLLI=0xf5667788 DIR=DL STATE=FINISHED) Modifying MS object, TLLI = 0xf5667788, IMSI '' -> '0011223344' -- To view, visit https://gerrit.osmocom.org/212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93b8c07a0b2de40a11e94fd6c212897cbe3b50ef Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:14:08 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:14:08 +0000 Subject: osmo-pcu[master]: tbf: replace this == NULL check in tbf->name In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/136/2//COMMIT_MSG Commit Message: Line 7: tbf: replace this == NULL check in tbf->name Replace is the wrong word. You do remove it as it is invalid C++. -- To view, visit https://gerrit.osmocom.org/136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:14:10 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:14:10 +0000 Subject: [MERGED] osmo-pcu[master]: tbf: replace this == NULL check in tbf->name In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: tbf: replace this == NULL check in tbf->name ...................................................................... tbf: replace this == NULL check in tbf->name All checks of (this == null) will be eliminated by GCC >= 6.1 (https://gcc.gnu.org/gcc-6/changes.html, Value range propagation now assumes that the this pointer of C++ member functions is non-null. Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Reviewed-on: https://gerrit.osmocom.org/136 Tested-by: Jenkins Builder Reviewed-by: Harald Welte Reviewed-by: Holger Freyther --- M src/tbf.cpp 1 file changed, 1 insertion(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/tbf.cpp b/src/tbf.cpp index 69b9e3a..1fc1aef 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1176,14 +1176,11 @@ const char *tbf_name(gprs_rlcmac_tbf *tbf) { - return tbf->name(); + return tbf ? tbf->name() : "(no TBF)"; } const char *gprs_rlcmac_tbf::name() const { - if (this == NULL) - return "(no TBF)"; - snprintf(m_name_buf, sizeof(m_name_buf) - 1, "TBF(TFI=%d TLLI=0x%08x DIR=%s STATE=%s%s)", m_tfi, tlli(), -- To view, visit https://gerrit.osmocom.org/136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifddaef70bb0a4402050c817b1000d515c3a7118b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:21:21 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:21:21 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (7 comments) https://gerrit.osmocom.org/#/c/70/3/src/vty/command.c File src/vty/command.c: Line 418: _strlen = strlen(inp); Haha, I wanted to say that _strlen is not a good name. It clashes with reserved namespace of POSIX (_ prefix) and if (_strlen or if (strlen are easy to confuse and address of strlen will certainly be always > 0. Line 443: case '"': Why isn't it '|' here? https://gerrit.osmocom.org/#/c/70/3/src/vty/stats_vty.c File src/vty/stats_vty.c: Line 374: if (description) unconditionally talloc_free(description) please Line 410: if (description) talloc_free() directly Line 432: if (group_description) directly free this. free(NULL) and talloc_free(NULL) are well defined Line 459: if (description) directly release it. Line 483: if (group_description) and here too -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:23:19 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:23:19 +0000 Subject: libosmo-abis[master]: Fix macro definitions In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/217/1//COMMIT_MSG Commit Message: Line 10: properly. Link to the failure? Or explain how BLA(bla()) failed? -- To view, visit https://gerrit.osmocom.org/217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:32:01 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: argh. This is _just_ a new state and the state itself makes sense. I am afraid "we" need to look at the state transitions of it. -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:34:39 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:34:39 +0000 Subject: openbsc[master]: Add DTXd indicator to gsm_lchan In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 10 11:34:41 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 11:34:41 +0000 Subject: [MERGED] openbsc[master]: Add DTXd indicator to gsm_lchan In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: Add DTXd indicator to gsm_lchan ...................................................................... Add DTXd indicator to gsm_lchan It is necessary for proper reporting of DTXd status during the measurement period. Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Related: OS#1701 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index c7516c6..60a689c 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -292,6 +292,8 @@ } last_sid; uint8_t last_cmr; uint32_t last_fn; + /* indicates if DTXd was active during DL measurement period */ + bool dtxd_active; } tch; /* BTS-side ciphering state (rx only, bi-directional, ...) */ uint8_t ciph_state; -- To view, visit https://gerrit.osmocom.org/219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 10 12:03:32 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 10 Jun 2016 12:03:32 +0000 Subject: [PATCH] libosmo-abis[master]: Fix macro definitions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/217 to look at the new patch set (#2). Fix macro definitions Wrap macro parameter in brackets to make sure macros always work properly: without it GSM_FN_TO_MS(a - b) will result in a - b * GSM_TDMA_FRAME_MS contrary to the user's expectation of (a - b) * GSM_TDMA_FRAME_MS. Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 --- M include/osmocom/trau/osmo_ortp.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/17/217/2 diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index eb53a41..7c2a5cb 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -28,8 +28,8 @@ #define GSM_RTP_FRAME_DURATION_MS 20 #define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS) #define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) -#define GSM_MS_TO_SAMPLES(ms) (ms * GSM_VOICE_SAMPLES_PER_MS) -#define GSM_FN_TO_MS(fn) (fn * GSM_TDMA_FRAME_MS) +#define GSM_MS_TO_SAMPLES(ms) ((ms) * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_FN_TO_MS(fn) ((fn) * GSM_TDMA_FRAME_MS) /*! \brief Parameter to osmo_rtp_socket_param_set() */ enum osmo_rtp_param { -- To view, visit https://gerrit.osmocom.org/217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 10 12:16:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 10 Jun 2016 12:16:23 +0000 Subject: [PATCH] openbsc[master]: DTX: add data necessary for scheduling Message-ID: Review at https://gerrit.osmocom.org/221 DTX: add data necessary for scheduling DTXd: to schedule SID repetition we have to know when previous SID was sent (fn) and if it was UPDATE or FIRST SID (is_update). DTXu: to properly set Marker bit in outgoing RTP we have to know the beginning of talkspurt. For codecs without explicit ONSET event we can do it by setting the flag (ul_sid) upon receiving SID and unsetting it on speech frames. Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Related: OS#22, OS#1701 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/221/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 60a689c..a8bcd5d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -289,7 +289,12 @@ struct { uint8_t buf[16]; uint8_t len; + uint32_t fn; + bool is_update; } last_sid; + /* set for each SID frame to detect talkspurt for codecs without + explicit ONSET event */ + bool ul_sid; uint8_t last_cmr; uint32_t last_fn; /* indicates if DTXd was active during DL measurement period */ -- To view, visit https://gerrit.osmocom.org/221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 10 14:15:43 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 10 Jun 2016 14:15:43 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/211 to look at the new patch set (#2). dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable Add dyn_pdch_init() in new file bsc_dyn_pdch.c (new file to avoid linking issues; bsc_init.c would create undefined references, and putting in a new file is the easiest solution). Call dyn_pdch_init() from nm_statechg_event() whenever a TS is enabled. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT and when subsequently the PDCH ACT ACK messages are received in rsl_rx_pdch_act_ack(). Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/Makefile.am A openbsc/src/libbsc/bsc_dyn_pdch.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c 5 files changed, 50 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/11/211/2 diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index 100a6d1..6ff8382 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -106,5 +106,7 @@ int rsl_direct_rf_release(struct gsm_lchan *lchan); +void dyn_pdch_init(struct gsm_bts_trx_ts *ts); + #endif /* RSL_MT_H */ diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am index 8fa5c7c..48880d9 100644 --- a/openbsc/src/libbsc/Makefile.am +++ b/openbsc/src/libbsc/Makefile.am @@ -23,5 +23,6 @@ bsc_init.c bts_init.c bsc_rf_ctrl.c \ arfcn_range_encode.c bsc_ctrl_commands.c \ bsc_ctrl_lookup.c \ - net_init.c + net_init.c \ + bsc_dyn_pdch.c diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c new file mode 100644 index 0000000..717880b --- /dev/null +++ b/openbsc/src/libbsc/bsc_dyn_pdch.c @@ -0,0 +1,42 @@ +/* Dynamic PDCH initialisation implementation shared across NM and RSL */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +void dyn_pdch_init(struct gsm_bts_trx_ts *ts) +{ + int rc; + + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on" + " BTS %u TRX %u TS %u\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr); + rc = rsl_ipacc_pdch_activate(ts, 1); + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "Failed to activate PDCH on" + " BTS %u TRX %u TS %u: %d\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, rc); + } + } +} diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 04452f7..5c27862 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -329,10 +329,8 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); - cur_trx->ts[i].flags |= TS_F_PDCH_MODE; - } } } if (isd->link_type == E1INP_SIGN_RSL) diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index dfb5a45..89d5256 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -369,6 +369,9 @@ abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr, trx->nr, ts->nr); } + if (new_state->operational == NM_OPSTATE_ENABLED + && new_state->availability == NM_AVSTATE_OK) + dyn_pdch_init(ts); break; case NM_OC_RADIO_CARRIER: trx = obj; -- To view, visit https://gerrit.osmocom.org/211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 10 14:58:44 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 10 Jun 2016 14:58:44 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/218/1/src/tbf.cpp File src/tbf.cpp: Line 844 this looks suspicious... no transition away from WAIT_ASSIGN? -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jun 10 15:30:22 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 10 Jun 2016 15:30:22 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/218/1/src/tbf.cpp File src/tbf.cpp: Line 864 but the dl_ass will be confirmed at some point? At this point I also wonder about your PCU cfg and if it is a "sane" default? -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 11 16:16:38 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 11 Jun 2016 16:16:38 +0000 Subject: [PATCH] libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/70 to look at the new patch set (#4). add vty call show asciidoc: generate a documentation for counters For each counter group a ascii doc table is generated containing all single counter with a reference to a section to add additional information to the counter Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb --- M include/osmocom/vty/command.h M src/vty/command.c M src/vty/stats_vty.c 3 files changed, 197 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/70/70/4 diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 9a02575..135ef2f 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -379,6 +379,8 @@ char *host_config_file(); void host_config_set(const char *); +char *osmo_asciidoc_escape(const char *inp); + /* This is called from main when a daemon is invoked with -v or --version. */ void print_version(int print_copyright); diff --git a/src/vty/command.c b/src/vty/command.c index 1f1dddb..483ca80 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -402,6 +402,59 @@ return cnode->prompt; } +/*! + * \brief escape all special asciidoc symbols + * \param unsafe string + * \return a new talloc char * + */ +char *osmo_asciidoc_escape(const char *inp) +{ + int _strlen; + char *out, *out_ptr; + int len = 0, i, j; + + if (!inp) + return NULL; + _strlen = strlen(inp); + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '|': + len += 2; + break; + default: + len += 1; + break; + } + } + + out = talloc_size(NULL, len + 1); + if (!out) + return NULL; + + out_ptr = out; + +#define ADD(out, str) \ + for (j = 0; j < strlen(str); ++j) \ + *(out++) = str[j]; + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '|': + ADD(out_ptr, "\\|"); + break; + default: + *(out_ptr++) = inp[i]; + break; + } + } + +#undef ADD + + out_ptr[0] = '\0'; + return out; +} + static char *xml_escape(const char *inp) { int _strlen; diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index e0239bf..be5a6aa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -33,6 +33,8 @@ #include #include +#include +#include #define CFG_STATS_STR "Configure stats sub-system\n" #define CFG_REPORTER_STR "Configure a stats reporter\n" @@ -355,6 +357,144 @@ return CMD_SUCCESS; } +static int asciidoc_handle_counter(struct osmo_counter *counter, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = osmo_asciidoc_escape(counter->name); + char *description = osmo_asciidoc_escape(counter->description); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <> | %s%s", + name, + name, + description ? description : "", + VTY_NEWLINE); + + talloc_free(name); + talloc_free(description); + + return 0; +} + +static void asciidoc_counter_generate(struct vty *vty) +{ + vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE); + vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + osmo_counters_for_each(asciidoc_handle_counter, vty); + vty_out(vty, "|===%s", VTY_NEWLINE); +} + +static int asciidoc_rate_ctr_handler( + struct rate_ctr_group *ctrg, struct rate_ctr *ctr, + const struct rate_ctr_desc *desc, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = osmo_asciidoc_escape(desc->name); + char *description = osmo_asciidoc_escape(desc->description); + char *group_name_prefix = osmo_asciidoc_escape(ctrg->desc->group_name_prefix); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <<%s_%s>> | %s%s", + name, + group_name_prefix, + name, + description ? description : NULL, + VTY_NEWLINE); + + /* description seems to be optional */ + talloc_free(name); + talloc_free(group_name_prefix); + talloc_free(description); + + return 0; +} + +static int asciidoc_rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_) +{ + struct vty *vty = sctx_; + + char *group_description = osmo_asciidoc_escape(ctrg->desc->group_description); + char *group_name_prefix = osmo_asciidoc_escape(ctrg->desc->group_name_prefix); + + vty_out(vty, "// rate_ctr_group table %s%s", group_description, VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description, VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + rate_ctr_for_each_counter(ctrg, asciidoc_rate_ctr_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + talloc_free(group_description); + + return 0; +} + +static int asciidoc_osmo_stat_item_handler( + struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_) +{ + struct vty *vty = sctx_; + + char *name = osmo_asciidoc_escape(item->desc->name); + char *description = osmo_asciidoc_escape(item->desc->description); + char *group_name_prefix = osmo_asciidoc_escape(statg->desc->group_name_prefix); + char *unit = osmo_asciidoc_escape(item->desc->unit); + + /* | name | This document & | description | unit | */ + vty_out(vty, "| %s | <<%s_%s>> | %s | %s%s", + name, + group_name_prefix, + name, + description ? description : "", + unit ? unit : "", + VTY_NEWLINE); + + talloc_free(name); + talloc_free(group_name_prefix); + talloc_free(description); + talloc_free(unit); + + return 0; +} + +static int asciidoc_osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_) +{ + char *group_name_prefix = osmo_asciidoc_escape(statg->desc->group_name_prefix); + char *group_description = osmo_asciidoc_escape(statg->desc->group_description); + + struct vty *vty = sctx_; + vty_out(vty, "%s%s", group_description ? group_description : "" , VTY_NEWLINE); + + vty_out(vty, "// osmo_stat_item_group table %s%s", group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description | unit%s", VTY_NEWLINE); + osmo_stat_item_for_each_item(statg, asciidoc_osmo_stat_item_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + talloc_free(group_description); + + return 0; +} + +DEFUN(show_stats_asciidoc_table, + show_stats_asciidoc_table_cmd, + "show asciidoc counters", + "Generate an ascii doc table of all registered counters.\n") +{ + vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); + rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE); + osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE); + asciidoc_counter_generate(vty); + return CMD_SUCCESS; +} + static int config_write_stats_reporter(struct vty *vty, struct osmo_stats_reporter *srep) { if (srep == NULL) @@ -443,4 +583,6 @@ install_element(CFG_STATS_NODE, &cfg_stats_reporter_level_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_enable_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_disable_cmd); + + install_element_ve(&show_stats_asciidoc_table_cmd); } -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sat Jun 11 16:17:36 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 11 Jun 2016 16:17:36 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) done https://gerrit.osmocom.org/#/c/70/3/src/vty/command.c File src/vty/command.c: Line 418: _strlen = strlen(inp); > Haha, I wanted to say that _strlen is not a good name. It clashes with res i copied the code from xml escape. Line 443: case '"': > Why isn't it '|' here? fixed -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jun 11 16:35:43 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Sat, 11 Jun 2016 16:35:43 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 4: BSD: fails because of time 30: timer FAILED (testsuite.at:190) -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:39:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:39:42 +0000 Subject: openbsc[master]: DTX: add data necessary for scheduling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:39:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:39:47 +0000 Subject: [MERGED] openbsc[master]: DTX: add data necessary for scheduling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTX: add data necessary for scheduling ...................................................................... DTX: add data necessary for scheduling DTXd: to schedule SID repetition we have to know when previous SID was sent (fn) and if it was UPDATE or FIRST SID (is_update). DTXu: to properly set Marker bit in outgoing RTP we have to know the beginning of talkspurt. For codecs without explicit ONSET event we can do it by setting the flag (ul_sid) upon receiving SID and unsetting it on speech frames. Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Related: OS#22, OS#1701 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 60a689c..a8bcd5d 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -289,7 +289,12 @@ struct { uint8_t buf[16]; uint8_t len; + uint32_t fn; + bool is_update; } last_sid; + /* set for each SID frame to detect talkspurt for codecs without + explicit ONSET event */ + bool ul_sid; uint8_t last_cmr; uint32_t last_fn; /* indicates if DTXd was active during DL measurement period */ -- To view, visit https://gerrit.osmocom.org/221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:40:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:40:08 +0000 Subject: libosmo-abis[master]: Fix macro definitions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:42:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:42:31 +0000 Subject: osmo-bts[master]: Add DTXd support for sysmoBTS and LC15 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:42:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:42:34 +0000 Subject: [MERGED] osmo-bts[master]: Add DTXd support for sysmoBTS and LC15 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add DTXd support for sysmoBTS and LC15 ...................................................................... Add DTXd support for sysmoBTS and LC15 * set/clear DTXd activity indicator for measurement reporting * set DTXd status based on information from RSL Related: OS#1563 Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Depends-On: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Reviewed-on: https://gerrit.osmocom.org/220 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/common/rsl.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 11 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/rsl.c b/src/common/rsl.c index e13d48c..dddde69 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -103,6 +103,8 @@ struct rsl_ie_chan_mode *cm) { lchan->rsl_cmode = cm->spd_ind; + lchan->ts->trx->bts->dtxd = (cm->dtx_dtu & RSL_CMOD_DTXd) ? true : false; + switch (cm->chan_rate) { case RSL_CMOD_SP_GSM1: lchan->tch_mode = GSM48_CMODE_SPEECH_V1; @@ -1694,8 +1696,7 @@ } /* 8.4.8 MEASUREMENT RESult */ -static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, - bool dtxd_used) +static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len) { struct msgb *msg; uint8_t meas_res[16]; @@ -1713,8 +1714,10 @@ return -ENOMEM; msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++); - size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, dtxd_used, + size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, + lchan->tch.dtxd_active, meas_res); + lchan->tch.dtxd_active = false; if (ie_len >= 3) { msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res); lchan->meas.flags &= ~LC_UL_M_F_RES_VALID; @@ -1755,9 +1758,7 @@ LOGP(DRSL, LOGL_INFO, "%s Handing RLL msg %s from LAPDm to MEAS REP\n", gsm_lchan_name(lchan), rsl_msg_name(rh->msg_type)); - /* FIXME: add dtx downlink support */ - rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg), - false); + rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg)); msgb_free(msg); return rc; } else { diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 6a60b3f..1054aba 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -439,6 +439,8 @@ l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ + if (trx->bts->dtxd && trx != trx->bts->c0) + lchan->tch.dtxd_active = true; empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index debc80a..d6d0cdd 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -433,6 +433,8 @@ l1p->u.phDataReq.msgUnitParam.u8Size); } else { /* empty frame */ + if (trx->bts->dtxd && trx != trx->bts->c0) + lchan->tch.dtxd_active = true; empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); } /* send message to DSP's queue */ -- To view, visit https://gerrit.osmocom.org/220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:43:16 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:43:16 +0000 Subject: osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:43:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:43:19 +0000 Subject: [MERGED] osmo-bts[master]: Use libosmocodec for AMR RTP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use libosmocodec for AMR RTP ...................................................................... Use libosmocodec for AMR RTP Use libosmocodec function to parse RTP with AMR payload in sysmoBTS and LC15. This replaces "manual" parsing of AMR frame with function covered by test suite and makes adding DTXd support easier. Related: OS#1563 Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Reviewed-on: https://gerrit.osmocom.org/204 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M tests/sysmobts/Makefile.am 5 files changed, 27 insertions(+), 36 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 5b63001..768e29d 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,8 +1,8 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -lortp +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index a11911c..15ad456 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -222,10 +223,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -247,13 +244,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); memcpy(l1_payload+2, rtp_payload, payload_len); /* CMI in downlink tells the L1 encoder which encoding function @@ -264,11 +263,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -302,12 +297,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -316,7 +311,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 9ed89dc..34f4bb0 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e08d8a6..63d90af 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -298,10 +299,6 @@ return msg; } -enum amr_frame_type { - AMR_FT_SID_AMR = 8, -}; - int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) { unsigned int i; @@ -323,12 +320,15 @@ struct gsm_lchan *lchan) { struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr; - uint8_t ft = (rtp_payload[1] >> 3) & 0xf; - uint8_t cmr = rtp_payload[0] >> 4; - uint8_t cmi, sti; + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; uint8_t *l1_cmi_idx = l1_payload; uint8_t *l1_cmr_idx = l1_payload+1; int rc; + + osmo_amr_rtp_dec(rtp_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); #ifdef USE_L1_RTP_MODE memcpy(l1_payload+2, rtp_payload, payload_len); @@ -353,11 +353,7 @@ cmi = ft; LOGP(DRTP, LOGL_DEBUG, "SPEECH frame with CMI %u\n", cmi); break; - case AMR_FT_SID_AMR: - /* extract the mode indiciation from last bits of - * 39 bit SID frame (Table 6 / 26.101) */ - cmi = (rtp_payload[2+4] >> 1) & 0x7; - sti = rtp_payload[2+4] & 0x10; + case AMR_SID: LOGP(DRTP, LOGL_DEBUG, "SID %s frame with CMI %u\n", sti ? "UPDATE" : "FIRST", cmi); break; @@ -391,12 +387,12 @@ } #if 0 /* check for bad quality indication */ - if (rtp_payload[1] & AMR_TOC_QBIT) { + if (bfi == AMR_GOOD) { /* obtain frame type from AMR FT */ l1_payload[2] = ft; } else { /* bad quality, we should indicate that... */ - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* FIXME: Should we do GsmL1_TchPlType_Amr_SidBad? */ l1_payload[2] = ft; } else { @@ -405,7 +401,7 @@ } #endif - if (ft == AMR_FT_SID_AMR) { + if (ft == AMR_SID) { /* store the last SID frame in lchan context */ unsigned int copy_len; copy_len = OSMO_MIN(payload_len+1, diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index a00e7c2..2f267f3 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(top_srcdir)/src/osmo-bts-sysmo -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:43:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:43:48 +0000 Subject: openbsc[master]: Add talkspurt indicator for gsm_lchan In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:43:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:43:51 +0000 Subject: [MERGED] openbsc[master]: Add talkspurt indicator for gsm_lchan In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add talkspurt indicator for gsm_lchan ...................................................................... Add talkspurt indicator for gsm_lchan Add bit which can be set on BTS side to indicate that next RTP frame should be marked as a beginning of speech. Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Related: OS#1562 --- M openbsc/include/openbsc/gsm_data_shared.h 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index a8bcd5d..8ed11b6 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -316,7 +316,8 @@ int s; /* Kind of the release/activation. E.g. RSL or PCU */ int rel_act_kind; - + /* RTP header Marker bit to indicate beginning of speech after pause */ + bool rtp_tx_marker; /* power handling */ struct { uint8_t current; -- To view, visit https://gerrit.osmocom.org/203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:45:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:45:25 +0000 Subject: [MERGED] libosmo-abis[master]: Fix macro definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix macro definitions ...................................................................... Fix macro definitions Wrap macro parameter in brackets to make sure macros always work properly: without it GSM_FN_TO_MS(a - b) will result in a - b * GSM_TDMA_FRAME_MS contrary to the user's expectation of (a - b) * GSM_TDMA_FRAME_MS. Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Reviewed-on: https://gerrit.osmocom.org/217 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M include/osmocom/trau/osmo_ortp.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/trau/osmo_ortp.h b/include/osmocom/trau/osmo_ortp.h index eb53a41..7c2a5cb 100644 --- a/include/osmocom/trau/osmo_ortp.h +++ b/include/osmocom/trau/osmo_ortp.h @@ -28,8 +28,8 @@ #define GSM_RTP_FRAME_DURATION_MS 20 #define GSM_SAMPLES_PER_RTP_FRAME (GSM_RTP_FRAME_DURATION_MS * GSM_VOICE_SAMPLES_PER_MS) #define GSM_TDMA_FRAME_MS (120 / GSM_VOICE_MULTIFRAME) -#define GSM_MS_TO_SAMPLES(ms) (ms * GSM_VOICE_SAMPLES_PER_MS) -#define GSM_FN_TO_MS(fn) (fn * GSM_TDMA_FRAME_MS) +#define GSM_MS_TO_SAMPLES(ms) ((ms) * GSM_VOICE_SAMPLES_PER_MS) +#define GSM_FN_TO_MS(fn) ((fn) * GSM_TDMA_FRAME_MS) /*! \brief Parameter to osmo_rtp_socket_param_set() */ enum osmo_rtp_param { -- To view, visit https://gerrit.osmocom.org/217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:47:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:47:20 +0000 Subject: openbsc[master]: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:47:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:47:56 +0000 Subject: openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:48:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:48:29 +0000 Subject: openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c728b922656be03588b775638b610a93f8187d5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:48:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:48:38 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots ...................................................................... dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots Remove check for dyn PDCH in _lc_find_trx(), instead call _lc_find_trx() via _lc_find_bts() several times, so that pure TCH/F is preferred to TCH/F_PDCH. Add this logic next to the other channel match decisions in chan_alloc(). BTW, the removed check in _lc_find_trx() whether PDCH is active is not necessary, as described in the added comment for lchan_alloc(). Original patch idea by jolly, but split in two and implemented differently by nhofmeyr. Change-Id: I0c728b922656be03588b775638b610a93f8187d5 --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 29 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 37cdb27..4715780 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -96,14 +96,7 @@ ts = &trx->ts[j]; if (!ts_is_usable(ts)) continue; - /* ip.access dynamic TCH/F + PDCH combination */ - if (ts->pchan == GSM_PCHAN_TCH_F_PDCH && - pchan == GSM_PCHAN_TCH_F) { - /* we can only consider such a dynamic channel - * if the PDCH is currently inactive */ - if (ts->flags & TS_F_PDCH_MODE) - continue; - } else if (ts->pchan != pchan) + if (ts->pchan != pchan) continue; /* check if all sub-slots are allocated yet */ for (ss = 0; ss < subslots_per_pchan[pchan]; ss++) { @@ -140,7 +133,12 @@ return NULL; } -/* Allocate a logical channel */ +/* Allocate a logical channel. + * + * For TCH/F, we may return a dynamic TCH/F_PDCH channel (but prefer a pure + * TCH/F). If we pick a TCH/F_PDCH time slot, PDCH will be disabled later on; + * there is no need to check whether PDCH mode is currently active, here. + */ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger) { @@ -182,6 +180,14 @@ if (lchan) type = GSM_LCHAN_TCH_F; } + + /* try dynamic TCH/F_PDCH */ + if (lchan == NULL) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); + /* TCH/F_PDCH will be used as TCH/F */ + if (lchan) + type = GSM_LCHAN_TCH_F; + } } break; case GSM_LCHAN_TCH_F: @@ -192,6 +198,14 @@ if (lchan) type = GSM_LCHAN_TCH_H; } + /* If we don't have TCH/H either, try dynamic TCH/F_PDCH */ + if (!lchan) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); + /* TCH/F_PDCH used as TCH/F -- here, type is already + * set to GSM_LCHAN_TCH_F, but for clarity's sake... */ + if (lchan) + type = GSM_LCHAN_TCH_F; + } break; case GSM_LCHAN_TCH_H: lchan =_lc_find_bts(bts, GSM_PCHAN_TCH_H); @@ -201,6 +215,12 @@ if (lchan) type = GSM_LCHAN_TCH_F; } + /* If we don't have TCH/F either, try dynamic TCH/F_PDCH */ + if (!lchan) { + lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); + if (lchan) + type = GSM_LCHAN_TCH_F; + } break; default: LOGP(DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type); -- To view, visit https://gerrit.osmocom.org/209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c728b922656be03588b775638b610a93f8187d5 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jun 12 15:48:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 12 Jun 2016 15:48:38 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: Fix free slot search for chan_alloc_reverse == true In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: Fix free slot search for chan_alloc_reverse == true ...................................................................... dyn PDCH: Fix free slot search for chan_alloc_reverse == true For chan_alloc_reverse, _lc_find_trx() should return the last free slot instead of the first. Original patch by jolly, but split in two by nhofmeyr. Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 14 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index c9c5fa8..37cdb27 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -75,12 +75,24 @@ _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) { struct gsm_bts_trx_ts *ts; - int j, ss; + int j, start, stop, dir, ss; if (!trx_is_usable(trx)) return NULL; - for (j = 0; j < 8; j++) { + if (trx->bts->chan_alloc_reverse) { + /* check TS 7..0 */ + start = 7; + stop = -1; + dir = -1; + } else { + /* check TS 0..7 */ + start = 0; + stop = 8; + dir = 1; + } + + for (j = start; j != stop; j += dir) { ts = &trx->ts[j]; if (!ts_is_usable(ts)) continue; -- To view, visit https://gerrit.osmocom.org/208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:04:26 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 09:04:26 +0000 Subject: [PATCH] openbsc[master]: Fix SIGABRT on wrong AMR payload Message-ID: Review at https://gerrit.osmocom.org/222 Fix SIGABRT on wrong AMR payload Previously length check have not considered AMR format which requires extra byte for in-band length leading to SIGABRT on incorrect payload from BTS. Change-Id: I800f756fc803accace8c7e0b4a42b3744fe78bb6 Fixes: OS#1731 --- M openbsc/src/libtrau/rtp_proxy.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/222/1 diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c index 6c04610..ed19175 100644 --- a/openbsc/src/libtrau/rtp_proxy.c +++ b/openbsc/src/libtrau/rtp_proxy.c @@ -163,7 +163,9 @@ return -EINVAL; } - if (payload_len > MAX_RTP_PAYLOAD_LEN) { + if (payload_len > MAX_RTP_PAYLOAD_LEN || + (rtph->payload_type == RTP_PT_AMR && + payload_len > MAX_RTP_PAYLOAD_LEN - 1)) { DEBUGPC(DLMUX, "RTP payload too large (%d octets)\n", payload_len); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I800f756fc803accace8c7e0b4a42b3744fe78bb6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:18:51 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 09:18:51 +0000 Subject: [MERGED] openbsc[master]: add DSUA debug constant In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add DSUA debug constant ...................................................................... add DSUA debug constant Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 --- M openbsc/include/openbsc/debug.h M openbsc/src/gprs/sgsn_main.c M openbsc/src/libcommon/debug.c 3 files changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h index b6087e2..43ebb19 100644 --- a/openbsc/include/openbsc/debug.h +++ b/openbsc/include/openbsc/debug.h @@ -35,6 +35,7 @@ DFILTER, DGTPHUB, DRANAP, + DSUA, Debug_LastEntry, }; diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c index aef36ca..c852840 100644 --- a/openbsc/src/gprs/sgsn_main.c +++ b/openbsc/src/gprs/sgsn_main.c @@ -286,6 +286,11 @@ .description = "RAN Application Part (RANAP)", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DSUA] = { + .name = "DSUA", + .description = "SCCP User Adaptation (SUA)", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static const struct log_info gprs_log_info = { diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c index 232f6f7..cf5beeb 100644 --- a/openbsc/src/libcommon/debug.c +++ b/openbsc/src/libcommon/debug.c @@ -170,6 +170,11 @@ .description = "Radio Access Network Application Part Protocol", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DSUA] = { + .name = "DSUA", + .description = "SCCP User Adaptation Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; enum log_filter { -- To view, visit https://gerrit.osmocom.org/191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:24:09 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 09:24:09 +0000 Subject: [ABANDON] osmo-bts[master]: sysmobts: Add bts-specific payload functions In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: sysmobts: Add bts-specific payload functions ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: If213ec89762e50b4a5e79becebb589d6260e6b62 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:24:18 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 09:24:18 +0000 Subject: [ABANDON] osmo-bts[master]: LC15: Add bts-specific payload functions In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: LC15: Add bts-specific payload functions ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie36b6d7a32cd3eaeb09f5a60c1a6471516a61fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:24:25 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 09:24:25 +0000 Subject: [ABANDON] osmo-bts[master]: Move common TCH code into src/common/tch.c In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Move common TCH code into src/common/tch.c ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ia0d4d0f9848fc2ab54f975a3b6d1815fbcdf78a7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:34:19 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 09:34:19 +0000 Subject: [PATCH] osmo-bts[master]: DTXu: mark beginning of speech burst in RTP Message-ID: Review at https://gerrit.osmocom.org/223 DTXu: mark beginning of speech burst in RTP Set Marker bit in RTP header to mark the beginning of talkspurt. Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e Related: OS#1562 --- M src/common/l1sap.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 3 files changed, 92 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/23/223/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 77fd1a0..163e129 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -866,8 +866,8 @@ /* hand msg to RTP code for transmission */ if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn)); + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn), lchan->rtp_tx_marker); /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { @@ -885,6 +885,8 @@ msgb_enqueue(&lchan->dl_tch_queue, msg); } + + lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 15ad456..36656e0 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -101,7 +101,8 @@ #define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ #define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ -static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -113,6 +114,13 @@ /* new L1 can deliver bits like we need them */ cur = msgb_put(msg, GSM_FR_BYTES); memcpy(cur, l1_payload, GSM_FR_BYTES); + + if (osmo_fr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -131,7 +139,9 @@ return GSM_FR_BYTES; } -static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, + uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -143,6 +153,17 @@ /* new L1 can deliver bits like we need them */ cur = msgb_put(msg, GSM_EFR_BYTES); memcpy(cur, l1_payload, GSM_EFR_BYTES); + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; + osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); + if (ft == AMR_GSM_EFR_SID) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -154,7 +175,8 @@ return payload_len; } -static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -171,6 +193,13 @@ cur = msgb_put(msg, GSM_HR_BYTES); memcpy(cur, l1_payload, GSM_HR_BYTES); + + if (osmo_hr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -431,6 +460,15 @@ lchan->type != GSM_LCHAN_TCH_F) goto err_payload_match; break; + case GsmL1_TchPlType_Amr_Onset: + if (lchan->type != GSM_LCHAN_TCH_H && + lchan->type != GSM_LCHAN_TCH_F) + goto err_payload_match; + /* according to 3GPP TS 26.093 ONSET frames precede the first + speech frame of a speech burst - set the marker for next RTP + frame and drop last SID */ + lchan->rtp_tx_marker = true; + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -441,13 +479,13 @@ switch (payload_type) { case GsmL1_TchPlType_Fr: - rmsg = l1_to_rtppayload_fr(payload, payload_len); + rmsg = l1_to_rtppayload_fr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Hr: - rmsg = l1_to_rtppayload_hr(payload, payload_len); + rmsg = l1_to_rtppayload_hr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Efr: - rmsg = l1_to_rtppayload_efr(payload, payload_len); + rmsg = l1_to_rtppayload_efr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Amr: rmsg = l1_to_rtppayload_amr(payload, payload_len, lchan); diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 63d90af..6f61096 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -91,7 +91,8 @@ } -static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -115,6 +116,13 @@ cur[0] |= 0xD0; #endif /* USE_L1_RTP_MODE */ + + if (osmo_fr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -142,7 +150,9 @@ } #if defined(L1_HAS_EFR) && defined(USE_L1_RTP_MODE) -static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, + uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -166,6 +176,17 @@ cur[0] |= 0xC0; #endif /* USE_L1_RTP_MODE */ + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; + osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); + if (ft == AMR_GSM_EFR_SID) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -184,7 +205,8 @@ #warning No EFR support in L1 #endif /* L1_HAS_EFR */ -static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -206,6 +228,13 @@ /* reverse the bit-order of each payload byte */ osmo_revbytebits_buf(cur, GSM_HR_BYTES); #endif /* USE_L1_RTP_MODE */ + + if (osmo_hr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -525,6 +554,15 @@ lchan->type != GSM_LCHAN_TCH_F) goto err_payload_match; break; + case GsmL1_TchPlType_Amr_Onset: + if (lchan->type != GSM_LCHAN_TCH_H && + lchan->type != GSM_LCHAN_TCH_F) + goto err_payload_match; + /* according to 3GPP TS 26.093 ONSET frames precede the first + speech frame of a speech burst - set the marker for next RTP + frame and drop last SID */ + lchan->rtp_tx_marker = true; + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -535,14 +573,14 @@ switch (payload_type) { case GsmL1_TchPlType_Fr: - rmsg = l1_to_rtppayload_fr(payload, payload_len); + rmsg = l1_to_rtppayload_fr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Hr: - rmsg = l1_to_rtppayload_hr(payload, payload_len); + rmsg = l1_to_rtppayload_hr(payload, payload_len, lchan); break; #if defined(L1_HAS_EFR) && defined(USE_L1_RTP_MODE) case GsmL1_TchPlType_Efr: - rmsg = l1_to_rtppayload_efr(payload, payload_len); + rmsg = l1_to_rtppayload_efr(payload, payload_len, lchan); break; #endif case GsmL1_TchPlType_Amr: -- To view, visit https://gerrit.osmocom.org/223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 09:42:37 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 09:42:37 +0000 Subject: openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/210/1/openbsc/src/libbsc/abis_rsl.c File openbsc/src/libbsc/abis_rsl.c: Line 479: return rsl_ipacc_pdch_activate(lchan->ts, 0); > * This routine might be called by rsl_rx_chan_rqd and bsc_handover_start http://osmocom.org/issues/1749 -- To view, visit https://gerrit.osmocom.org/210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:13:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 10:13:23 +0000 Subject: [PATCH] osmo-bts[master]: Fix debug output Message-ID: Review at https://gerrit.osmocom.org/224 Fix debug output Previously frame number was not saved in case of PRIM_TCH rendering many debug statements with g_time useless. Copy-paste from ef30f50d5d6d5f863fc147d05ccdceb89284934e. Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951 --- M src/osmo-bts-litecell15/tch.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/224/1 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 15ad456..245c19a 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -467,6 +467,7 @@ l1sap = msgb_l1sap_prim(rmsg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); l1sap->u.tch.chan_nr = chan_nr; + l1sap->u.tch.fn = data_ind->u32Fn; return l1sap_up(trx, l1sap); } -- To view, visit https://gerrit.osmocom.org/224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:13:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 10:13:24 +0000 Subject: [PATCH] osmo-bts[master]: DTXd: store/repeat last SID Message-ID: Review at https://gerrit.osmocom.org/225 DTXd: store/repeat last SID Store last SID received over RTP and repeat is if necessary (no new SID or SPEECH frames) according to codec-specific scheduling rules. Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 Related: OS#1563 --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/l1_if.h M src/osmo-bts-sysmo/tch.c 3 files changed, 119 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/25/225/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index d6d0cdd..84fad99 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -414,7 +414,7 @@ /* no message/data, we generate an empty traffic msg */ if (!nmsg) - nmsg = gen_empty_tch_msg(lchan); + nmsg = gen_empty_tch_msg(lchan, u32Fn); /* no traffic message, we generate an empty msg */ if (!nmsg) { diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index bb1d5a5..2fc8a29 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -111,7 +111,7 @@ const uint8_t *rtp_pl, unsigned int rtp_pl_len); int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan); +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); /* ciphering */ int l1if_set_ciphering(struct femtol1_hdl *fl1h, diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 63d90af..07a0efb 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -23,7 +23,7 @@ #include #include #include - +#include #include #include @@ -577,7 +577,66 @@ return -EINVAL; } -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) +static inline bool fn_chk(uint8_t *t, uint32_t fn) +{ + uint8_t i; + for (i = 0; i < ARRAY_SIZE(t); i++) + if (fn % 104 == t[i]) + return false; + return true; +} + +static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) +{ + /* 3GPP TS 45.008 ? 8.3 */ + uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, + h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, + h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; + if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if (lchan->type == GSM_LCHAN_TCH_F) + return fn_chk(f, fn); + else + return fn_chk(lchan->nr ? h1 : h0, fn); + } + return false; +} + +static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *l1_payload; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + l1_payload = &msu_param->u8Buffer[1]; + + if (lchan->tch.last_sid.len) { + memcpy(l1_payload, lchan->tch.last_sid.buf, + lchan->tch.last_sid.len); + msu_param->u8Size = lchan->tch.last_sid.len + 1; + return true; + } + return false; +} + +/* store the last SID frame in lchan context */ +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update) +{ + size_t copy_len = OSMO_MIN(length + 1, + ARRAY_SIZE(lchan->tch.last_sid.buf)); + + lchan->tch.last_sid.len = copy_len; + lchan->tch.last_sid.fn = fn; + lchan->tch.last_sid.is_update = update; + + memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); +} + +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) { struct msgb *msg; GsmL1_Prim_t *l1p; @@ -599,21 +658,63 @@ switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: *payload_type = GsmL1_TchPlType_Amr; - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; + /* according to 3GPP TS 26.093 A.5.1.1: */ + if (lchan->tch.last_sid.is_update) { + /* SID UPDATE should be repeated every 8th frame */ + if (fn - lchan->tch.last_sid.fn < 7) { + msgb_free(msg); + return NULL; + } } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - msu_param->u8Size = 8; -#endif + /* 3rd frame after SID FIRST should be SID UPDATE */ + if (fn - lchan->tch.last_sid.fn < 3) { + msgb_free(msg); + return NULL; + } + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send AMR frame on TCH " + "(FN=%u) but SID buffer is empty - sent NO_DATA\n", + fn); + osmo_amr_rtp_enc(l1_payload, 0, AMR_NO_DATA, + AMR_GOOD); + return msg; + } + break; + case GSM48_CMODE_SPEECH_V1: + if (lchan->type == GSM_LCHAN_TCH_F) + *payload_type = GsmL1_TchPlType_Fr; + else + *payload_type = GsmL1_TchPlType_Hr; + /* unlike AMR, FR & HR schedued based on absolute FN value */ + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send V1 frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; + } + break; + case GSM48_CMODE_SPEECH_EFR: + *payload_type = GsmL1_TchPlType_Efr; + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send EFR frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; } break; default: -- To view, visit https://gerrit.osmocom.org/225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:13:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 10:13:24 +0000 Subject: [PATCH] osmo-bts[master]: DTXd: store/repeat last SID Message-ID: Review at https://gerrit.osmocom.org/226 DTXd: store/repeat last SID Store last SID received over RTP and repeat is if necessary (no new SID or SPEECH frames) according to codec-specific scheduling rules. Related: OS#1563 Copy-paster from I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 for LC15. Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/l1_if.h M src/osmo-bts-litecell15/tch.c 3 files changed, 118 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/26/226/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 1054aba..54fd2d3 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -420,7 +420,7 @@ /* no message/data, we generate an empty traffic msg */ if (!nmsg) - nmsg = gen_empty_tch_msg(lchan); + nmsg = gen_empty_tch_msg(lchan, u32Fn); /* no traffic message, we generate an empty msg */ if (!nmsg) { diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h index 0c8843b..2d136af 100644 --- a/src/osmo-bts-litecell15/l1_if.h +++ b/src/osmo-bts-litecell15/l1_if.h @@ -91,7 +91,7 @@ const uint8_t *rtp_pl, unsigned int rtp_pl_len); int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan); +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); /* ciphering */ int l1if_set_ciphering(struct lc15l1_hdl *fl1h, diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 245c19a..db16209 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -481,7 +481,66 @@ return -EINVAL; } -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) +static inline bool fn_chk(uint8_t *t, uint32_t fn) +{ + uint8_t i; + for (i = 0; i < ARRAY_SIZE(t); i++) + if (fn % 104 == t[i]) + return false; + return true; +} + +static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) +{ + /* 3GPP TS 45.008 ? 8.3 */ + uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, + h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, + h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; + if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if (lchan->type == GSM_LCHAN_TCH_F) + return fn_chk(f, fn); + else + return fn_chk(lchan->nr ? h1 : h0, fn); + } + return false; +} + +static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *l1_payload; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + l1_payload = &msu_param->u8Buffer[1]; + + if (lchan->tch.last_sid.len) { + memcpy(l1_payload, lchan->tch.last_sid.buf, + lchan->tch.last_sid.len); + msu_param->u8Size = lchan->tch.last_sid.len + 1; + return true; + } + return false; +} + +/* store the last SID frame in lchan context */ +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update) +{ + size_t copy_len = OSMO_MIN(length + 1, + ARRAY_SIZE(lchan->tch.last_sid.buf)); + + lchan->tch.last_sid.len = copy_len; + lchan->tch.last_sid.fn = fn; + lchan->tch.last_sid.is_update = update; + + memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); +} + +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) { struct msgb *msg; GsmL1_Prim_t *l1p; @@ -503,21 +562,63 @@ switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: *payload_type = GsmL1_TchPlType_Amr; - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; + /* according to 3GPP TS 26.093 A.5.1.1: */ + if (lchan->tch.last_sid.is_update) { + /* SID UPDATE should be repeated every 8th frame */ + if (fn - lchan->tch.last_sid.fn < 7) { + msgb_free(msg); + return NULL; + } } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - msu_param->u8Size = 8; -#endif + /* 3rd frame after SID FIRST should be SID UPDATE */ + if (fn - lchan->tch.last_sid.fn < 3) { + msgb_free(msg); + return NULL; + } + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send AMR frame on TCH " + "(FN=%u) but SID buffer is empty - sent NO_DATA\n", + fn); + osmo_amr_rtp_enc(l1_payload, 0, AMR_NO_DATA, + AMR_GOOD); + return msg; + } + break; + case GSM48_CMODE_SPEECH_V1: + if (lchan->type == GSM_LCHAN_TCH_F) + *payload_type = GsmL1_TchPlType_Fr; + else + *payload_type = GsmL1_TchPlType_Hr; + /* unlike AMR, FR & HR schedued based on absolute FN value */ + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send V1 frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; + } + break; + case GSM48_CMODE_SPEECH_EFR: + *payload_type = GsmL1_TchPlType_Efr; + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send EFR frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; } break; default: -- To view, visit https://gerrit.osmocom.org/226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:15:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 10:15:34 +0000 Subject: osmo-bts[master]: DTXd: store/repeat last SID In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:16:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 10:16:01 +0000 Subject: osmo-bts[master]: DTXd: store/repeat last SID In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:16:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 10:16:15 +0000 Subject: osmo-bts[master]: Fix debug output In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:17:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 10:17:07 +0000 Subject: osmo-bts[master]: DTXu: mark beginning of speech burst in RTP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:17:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 10:17:29 +0000 Subject: openbsc[master]: Fix SIGABRT on wrong AMR payload In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I800f756fc803accace8c7e0b4a42b3744fe78bb6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:18:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 10:18:14 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:20:47 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 10:20:47 +0000 Subject: [PATCH] libosmo-sccp[master]: remove two compiler warnings for unused variables Message-ID: Review at https://gerrit.osmocom.org/227 remove two compiler warnings for unused variables Change-Id: Ib358fbc29cd4d3aa18e3c106afcca627e6b668a1 --- M src/sua.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/27/227/1 diff --git a/src/sua.c b/src/sua.c index 6e187d8..0920d2b 100644 --- a/src/sua.c +++ b/src/sua.c @@ -793,7 +793,6 @@ struct xua_msg_part *data_ie = xua_msg_find_tag(xua, SUA_IEI_DATA); struct msgb *upmsg; struct sua_connection *conn; - uint8_t *cur; /* fill conn */ conn = conn_create(link); @@ -901,7 +900,6 @@ struct xua_msg_part *data_ie = xua_msg_find_tag(xua, SUA_IEI_DATA); struct msgb *upmsg; uint32_t conn_id = xua_msg_get_u32(xua, SUA_IEI_DEST_REF); - uint32_t cause; /* resolve conn */ conn = conn_find_by_id(link, conn_id); @@ -926,7 +924,8 @@ memcpy(¶m->calling_addr, &conn->calling_addr, sizeof(param->calling_addr)); //param->in_sequence_control; - cause = xua_msg_get_u32(xua, SUA_IEI_CAUSE); + /* TODO evaluate cause: + * uint32_t cause = xua_msg_get_u32(xua, SUA_IEI_CAUSE); */ /* optional: src addr */ /* optional: dest addr */ param->importance = xua_msg_get_u32(xua, SUA_IEI_IMPORTANCE); -- To view, visit https://gerrit.osmocom.org/227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib358fbc29cd4d3aa18e3c106afcca627e6b668a1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 10:20:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 10:20:48 +0000 Subject: [PATCH] libosmo-sccp[master]: remove obsolete fixme comment Message-ID: Review at https://gerrit.osmocom.org/228 remove obsolete fixme comment Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a --- M src/sua.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/28/228/1 diff --git a/src/sua.c b/src/sua.c index 0920d2b..1bb9b89 100644 --- a/src/sua.c +++ b/src/sua.c @@ -906,7 +906,6 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "COREF for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ return -1; } conn_restart_rx_inact_timer(conn); -- To view, visit https://gerrit.osmocom.org/228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 12:00:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 12:00:24 +0000 Subject: [PATCH] libosmocore[master]: api doc: get_value_string(): mention composition in static b... Message-ID: Review at https://gerrit.osmocom.org/229 api doc: get_value_string(): mention composition in static buffer Change-Id: I93dad98711ef69f8a1e196efa029a842a1ff5bd6 --- M src/utils.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/229/1 diff --git a/src/utils.c b/src/utils.c index 1c2fc32..e76297f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -43,6 +43,10 @@ * \param[in] vs Array of value_string tuples * \param[in] val Value to be converted * \returns pointer to human-readable string + * + * If val is found in vs, the array's string entry is returned. Otherwise, an + * "unknown" string containing the actual value is composed in a static buffer + * that is reused across invocations. */ const char *get_value_string(const struct value_string *vs, uint32_t val) { -- To view, visit https://gerrit.osmocom.org/229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93dad98711ef69f8a1e196efa029a842a1ff5bd6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 12:00:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 12:00:25 +0000 Subject: [PATCH] libosmocore[master]: add get_value_string_or_null() to handle unknown items Message-ID: Review at https://gerrit.osmocom.org/230 add get_value_string_or_null() to handle unknown items Add get_value_string_or_null() to return NULL in case the given value is not found in the list of strings, to be able to cleanly fall back to another list of strings. Absorb the lookup loop from get_value_string(). Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN. In a subsequent commit, get_value_string_or_null() will be used by new rsl_or_ipac_msg_name(). Change-Id: I1fa3907e28d528d2758bc3eae9d19e6c1168f5e5 --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/30/230/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index bc39519..476e492 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -25,6 +25,8 @@ }; const char *get_value_string(const struct value_string *vs, uint32_t val); +const char *get_value_string_or_null(const struct value_string *vs, + uint32_t val); int get_string_value(const struct value_string *vs, const char *str); diff --git a/src/utils.c b/src/utils.c index e76297f..4a54802 100644 --- a/src/utils.c +++ b/src/utils.c @@ -50,6 +50,23 @@ */ const char *get_value_string(const struct value_string *vs, uint32_t val) { + const char *str = get_value_string_or_null(vs, val); + if (str) + return str; + + snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); + namebuf[sizeof(namebuf) - 1] = '\0'; + return namebuf; +} + +/*! \brief get human-readable string or NULL for given value + * \param[in] vs Array of value_string tuples + * \param[in] val Value to be converted + * \returns pointer to human-readable string or NULL if val is not found + */ +const char *get_value_string_or_null(const struct value_string *vs, + uint32_t val) +{ int i; for (i = 0;; i++) { @@ -59,9 +76,7 @@ return vs[i].str; } - snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); - namebuf[sizeof(namebuf) - 1] = '\0'; - return namebuf; + return NULL; } /*! \brief get numeric value for given human-readable string -- To view, visit https://gerrit.osmocom.org/230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fa3907e28d528d2758bc3eae9d19e6c1168f5e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 12:00:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 12:00:25 +0000 Subject: [PATCH] libosmocore[master]: add rsl_or_ipac_msg_name() for both standard and ip.access m... Message-ID: Review at https://gerrit.osmocom.org/231 add rsl_or_ipac_msg_name() for both standard and ip.access msg types Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN. Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f --- M include/osmocom/gsm/rsl.h M src/gsm/libosmogsm.map M src/gsm/rsl.c 3 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/231/1 diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 418e3f0..b140d48 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -39,6 +39,7 @@ const char *rsl_rlm_cause_name(uint8_t err); const char *rsl_msg_name(uint8_t err); const char *rsl_ipac_msg_name(uint8_t msg_type); +const char *rsl_or_ipac_msg_name(uint8_t msg_type); /* Section 3.3.2.3 TS 05.02. I think this looks like a table */ int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 301f5aa..ea2101c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -266,6 +266,7 @@ rsl_init_rll_hdr; rsl_ipac_msg_name; rsl_msg_name; +rsl_or_ipac_msg_name; rsl_rll_push_hdr; rsl_rll_push_l3; rsl_rll_simple; diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index de2e9d7..c3c32a9 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -382,6 +382,17 @@ return get_value_string(rsl_ipac_msgt_names, msg_type); } +/*! \brief Get human-readable name of standard or ip.access RSL msg type. + * If msg_type is a standard RSL message type, return its human-readable name. + * Otherwise return rsl_ipac_msg_name(msg_type). */ +const char *rsl_or_ipac_msg_name(uint8_t msg_type) +{ + const char *str = get_value_string_or_null(rsl_msgt_names, msg_type); + if (str) + return str; + return rsl_ipac_msg_name(msg_type); +} + static const struct value_string rsl_rlm_cause_strs[] = { { RLL_CAUSE_T200_EXPIRED, "Timer T200 expired (N200+1) times" }, { RLL_CAUSE_REEST_REQ, "Re-establishment request" }, -- To view, visit https://gerrit.osmocom.org/231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 12:27:36 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 12:27:36 +0000 Subject: [PATCH] osmo-bts[master]: Close TRX session before opening new one Message-ID: Review at https://gerrit.osmocom.org/232 Close TRX session before opening new one This fixes the unstable behavior (BTS loosing subscribers after some time) in case previous run of osmo-bts was interrupted (with ctrl+c for example). Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d --- M src/osmo-bts-octphy/l1_oml.c 1 file changed, 43 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/232/1 diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 14181dc..3794199 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1097,6 +1097,23 @@ return 0; } +static int disable_events_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data) +{ + tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_RSP *mser = + (tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_RSP *) resp->l2h; + + /* in a completion call-back, we take msgb ownership and must + * release it before returning */ + + mOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_RSP_SWAP(mser); + + LOGP(DL1C, LOGL_INFO, "Rx DISABLE-EVT-REC.resp\n"); + + msgb_free(resp); + + return 0; +} + int l1if_enable_events(struct gsm_bts_trx *trx) { struct phy_instance *pinst = trx_phy_instance(trx); @@ -1116,7 +1133,29 @@ LOGP(DL1C, LOGL_INFO, "Tx ENABLE-EVT-REC.req\n"); - return l1if_req_compl(fl1h, msg, enable_events_compl_cb, 0); + return l1if_req_compl(fl1h, msg, disable_events_compl_cb, 0); +} + +int l1if_disable_events(struct gsm_bts_trx *trx) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; + struct msgb *msg = l1p_msgb_alloc(); + tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD *mse; + + mse = (tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD *) + msgb_put(msg, sizeof(*mse)); + mOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD_DEF(mse); + + l1if_fill_msg_hdr(&mse->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, + cOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CID); + mse->ulEvtActiveFlag = cOCT_FALSE; + + mOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD_SWAP(mse); + + LOGP(DL1C, LOGL_INFO, "Tx DISABLE-EVT-REC.req\n"); + + return l1if_req_compl(fl1h, msg, disable_events_compl_cb, 0); } #define talloc_replace(dst, ctx, src) \ @@ -1481,6 +1520,9 @@ int bts_model_trx_close(struct gsm_bts_trx *trx) { + /* disable events */ + l1if_disable_events(trx); + /* FIXME: close only one TRX */ return trx_close(trx); } -- To view, visit https://gerrit.osmocom.org/232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 12:58:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 13 Jun 2016 12:58:53 +0000 Subject: [PATCH] osmo-bts[master]: octphy: Use the app. info. defaults as base Message-ID: Review at https://gerrit.osmocom.org/233 octphy: Use the app. info. defaults as base Similar to 91565b2d51646657002f91fdc22dce3c7320e13a use default initializers. Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0 Fixes: Os#1642 --- M src/osmo-bts-octphy/l1_oml.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/233/1 diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 14181dc..18bd8c0 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1156,6 +1156,7 @@ ais = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CMD *) msgb_put(msg, sizeof(*ais)); + mOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CMD_DEF(ais); l1if_fill_msg_hdr(&ais->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, cOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CID); @@ -1197,6 +1198,7 @@ tOCTVC1_MAIN_MSG_APPLICATION_INFO_CMD *ai; ai = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_CMD *) msgb_put(msg, sizeof(*ai)); + mOCTVC1_MAIN_MSG_APPLICATION_INFO_CMD_DEF(ai); l1if_fill_msg_hdr(&ai->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID); -- To view, visit https://gerrit.osmocom.org/233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:16 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:16 +0000 Subject: [PATCH] osmo-bts[master]: LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation Message-ID: Review at https://gerrit.osmocom.org/234 LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 --- M include/osmo-bts/l1sap.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/34/234/1 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index e76aca6..1f8b2a5 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -25,7 +25,7 @@ /* PTCH layout from frame number */ #define L1SAP_FN2MACBLOCK(fn) ((fn % 52) / 4) -#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 52) & 7) +#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 104) & 3) #define L1SAP_IS_PTCCH(fn) ((fn % 52) == 12) /* subslot from any chan_nr */ -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:16 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:16 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/abis.c: fix 100% CPU usage after disconnecting ... Message-ID: Review at https://gerrit.osmocom.org/235 LC15: common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d --- M src/common/abis.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/235/1 diff --git a/src/common/abis.c b/src/common/abis.c index defdb44..6753149 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -144,7 +144,6 @@ if (trx->rsl_link) { e1inp_sign_link_destroy(trx->rsl_link); trx->rsl_link = NULL; - trx_link_estab(trx); } } -- To view, visit https://gerrit.osmocom.org/235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:16 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:16 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Bring back DSP trace argument Message-ID: Review at https://gerrit.osmocom.org/236 LC15: Bring back DSP trace argument Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/main.c 2 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/236/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 1054aba..f7ecc7a 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -67,6 +67,8 @@ #include "misc/lc15bts_bid.h" #include "utils.h" +extern unsigned int dsp_trace; + struct wait_l1_conf { struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ @@ -1397,6 +1399,10 @@ return -EIO; } + + struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; + fl1h->dsp_trace_f = dsp_trace; + l1if_reset(pinst->u.lc15.hdl); phy_link_state_set(plink, PHY_LINK_CONNECTED); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ef132f8..2aaacd3 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -60,6 +60,8 @@ #include "oml_router.h" #include "misc/lc15bts_bid.h" +unsigned int dsp_trace = 0x00000000; + int bts_model_init(struct gsm_bts *bts) { struct gsm_bts_trx *trx; @@ -133,8 +135,8 @@ void bts_model_print_help() { printf( " -w --hw-version Print the targeted HW Version\n" - " -M --pcu-direct Force PCU to access message queue for " - "PDCH dchannel directly\n" + " -M --pcu-direct Force PCU to access message queue for PDCH dchannel directly\n" + " -p --dsp-trace Set DSP trace flags\n" ); } @@ -180,6 +182,9 @@ break; switch (c) { + case 'p': + dsp_trace = strtoul(optarg, NULL, 16); + break; case 'M': pcu_direct = 1; break; -- To view, visit https://gerrit.osmocom.org/236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:16 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:16 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Hardware changes: - Change system devices path - Remov... Message-ID: Review at https://gerrit.osmocom.org/237 LC15: Hardware changes: - Change system devices path - Remove obsoleted sensors and add new sensors - Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD) Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 --- M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/hw_misc.c M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c M src/osmo-bts-litecell15/misc/lc15bts_clock.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 17 files changed, 322 insertions(+), 336 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/237/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index da79df6..c6be4f0 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -53,31 +53,31 @@ static const struct calib_file_desc calib_files[] = { { - .fname = "calib_rx1a.conf", + .fname = "calib_rx0a.conf", .rx = 1, .trx = 0, + .rxpath = 0, + }, { + .fname = "calib_rx0b.conf", + .rx = 1, + .trx = 0, + .rxpath = 1, + }, { + .fname = "calib_rx1a.conf", + .rx = 1, + .trx = 1, .rxpath = 0, }, { .fname = "calib_rx1b.conf", .rx = 1, - .trx = 0, - .rxpath = 1, - }, { - .fname = "calib_rx2a.conf", - .rx = 1, - .trx = 1, - .rxpath = 0, - }, { - .fname = "calib_rx2b.conf", - .rx = 1, .trx = 1, .rxpath = 1, }, { - .fname = "calib_tx1.conf", + .fname = "calib_tx0.conf", .rx = 0, .trx = 0, }, { - .fname = "calib_tx2.conf", + .fname = "calib_tx1.conf", .rx = 0, .trx = 1, }, diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index cd53e26..49232b2 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -63,7 +63,7 @@ return -EINVAL; } - fd = open("/sys/class/leds/usr0/brightness", O_WRONLY); + fd = open("/var/lc15/leds/led0/brightness", O_WRONLY); if (fd < 0) return -ENODEV; @@ -73,7 +73,7 @@ } close(fd); - fd = open("/sys/class/leds/usr1/brightness", O_WRONLY); + fd = open("/var/lc15/leds/led1/brightness", O_WRONLY); if (fd < 0) return -ENODEV; diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 7e6cd68..6381864 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -249,7 +249,7 @@ struct osmo_wqueue *wq = &hdl->write_q[q]; struct osmo_fd *write_ofd = &hdl->write_q[q].bfd; - snprintf(buf, sizeof(buf)-1, "%s%d", rd_devnames[q], plink->num+1); + snprintf(buf, sizeof(buf)-1, "%s%d", rd_devnames[q], plink->num); buf[sizeof(buf)-1] = '\0'; rc = open(buf, O_RDONLY); @@ -270,7 +270,7 @@ return rc; } - snprintf(buf, sizeof(buf)-1, "%s%d", wr_devnames[q], plink->num+1); + snprintf(buf, sizeof(buf)-1, "%s%d", wr_devnames[q], plink->num); buf[sizeof(buf)-1] = '\0'; rc = open(buf, O_WRONLY); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 1fb5851..06a126a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -27,8 +27,8 @@ #include "lc15bts_bid.h" -#define BOARD_REV_SYSFS "/sys/devices/0.lc15/revision" -#define BOARD_OPT_SYSFS "/sys/devices/0.lc15/option" +#define BOARD_REV_SYSFS "/var/lc15/platform/revision" +#define BOARD_OPT_SYSFS "/var/lc15/platform/option" static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index 90ecb7a..f4df5d3 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -27,15 +27,15 @@ #include "lc15bts_clock.h" -#define CLKERR_ERR_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average" -#define CLKERR_ACC_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average_accuracy" -#define CLKERR_INT_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average_interval" -#define CLKERR_FLT_SYSFS "/sys/devices/5002000.clkerr/clkerr1_fault" -#define CLKERR_RFS_SYSFS "/sys/devices/5002000.clkerr/refresh" -#define CLKERR_RST_SYSFS "/sys/devices/5002000.clkerr/reset" +#define CLKERR_ERR_SYSFS "/var/lc15/clkerr/clkerr1_average" +#define CLKERR_ACC_SYSFS "/var/lc15/clkerr/clkerr1_average_accuracy" +#define CLKERR_INT_SYSFS "/var/lc15/clkerr/clkerr1_average_interval" +#define CLKERR_FLT_SYSFS "/var/lc15/clkerr/clkerr1_fault" +#define CLKERR_RFS_SYSFS "/var/lc15/clkerr/refresh" +#define CLKERR_RST_SYSFS "/var/lc15/clkerr/reset" -#define OCXODAC_VAL_SYSFS "/sys/bus/iio/devices/iio:device0/out_voltage0_raw" -#define OCXODAC_ROM_SYSFS "/sys/bus/iio/devices/iio:device0/store_eeprom" +#define OCXODAC_VAL_SYSFS "/var/lc15/ocxo/voltage" +#define OCXODAC_ROM_SYSFS "/var/lc15/ocxo/eeprom" /* clock error */ static int clkerr_fd_err = -1; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index a4c5650..506e525 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -74,7 +74,15 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .memory_limit = { + .logrf_limit = { + .thresh_warn = 60, + .thresh_crit = 78, + }, + .ocxo_limit = { + .thresh_warn = 60, + .thresh_crit = 78, + }, + .tx0_limit = { .thresh_warn = 60, .thresh_crit = 78, }, @@ -82,7 +90,7 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .tx2_limit = { + .pa0_limit = { .thresh_warn = 60, .thresh_crit = 78, }, @@ -90,12 +98,8 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .pa2_limit = { - .thresh_warn = 60, - .thresh_crit = 78, - }, .action_warn = 0, - .action_crit = TEMP_ACT_PA1_OFF | TEMP_ACT_PA2_OFF, + .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, .state = STATE_NORMAL, } }; @@ -260,12 +264,12 @@ hours_timer_cb(NULL); /* Enable the PAs */ - rc = lc15bts_power_set(LC15BTS_POWER_PA1, 1); + rc = lc15bts_power_set(LC15BTS_POWER_PA0, 1); if (rc < 0) { exit(3); } - rc = lc15bts_power_set(LC15BTS_POWER_PA2, 1); + rc = lc15bts_power_set(LC15BTS_POWER_PA1, 1); if (rc < 0) { exit(3); } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 466d0b2..98bd701 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -21,8 +21,8 @@ #if 0 TEMP_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA1_OFF = 0x2, - TEMP_ACT_PA2_OFF = 0x4, + TEMP_ACT_PA0_OFF = 0x2, + TEMP_ACT_PA1_OFF = 0x4, TEMP_ACT_BTS_SRV_OFF = 0x10, }; @@ -31,8 +31,8 @@ #if 0 TEMP_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA1_ON = 0x2, - TEMP_ACT_NORM_PA2_ON = 0x4, + TEMP_ACT_NORM_PA0_ON = 0x2, + TEMP_ACT_NORM_PA1_ON = 0x4, TEMP_ACT_NORM_BTS_SRV_ON= 0x10, }; @@ -62,11 +62,12 @@ LIMIT_SUPPLY_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_MEMORY_NODE, + LIMIT_LOGRF_NODE, + LIMIT_OCXO_NODE, + LIMIT_TX0_NODE, LIMIT_TX1_NODE, - LIMIT_TX2_NODE, + LIMIT_PA0_NODE, LIMIT_PA1_NODE, - LIMIT_PA2_NODE, }; struct lc15bts_mgr_instance { @@ -82,11 +83,12 @@ struct lc15bts_temp_limit supply_limit; struct lc15bts_temp_limit soc_limit; struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit memory_limit; + struct lc15bts_temp_limit logrf_limit; + struct lc15bts_temp_limit ocxo_limit; + struct lc15bts_temp_limit tx0_limit; struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit tx2_limit; + struct lc15bts_temp_limit pa0_limit; struct lc15bts_temp_limit pa1_limit; - struct lc15bts_temp_limit pa2_limit; } temp; struct { diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index d2100eb..903c5fe 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -47,7 +47,7 @@ #include #include -#define ETH0_ADDR_SYSFS "/sys/class/net/eth0/address" +#define ETH0_ADDR_SYSFS "/var/lc15/net/eth0/address" static struct osmo_fd nl_fd; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 00b8657..042fc87 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -85,6 +85,16 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ + if (actions & TEMP_ACT_NORM_PA0_ON) { + if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch on the PA #0\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched on the PA #0 as normal action.\n"); + } + } + if (actions & TEMP_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, @@ -92,16 +102,6 @@ } else { LOGP(DTEMP, LOGL_NOTICE, "Switched on the PA #1 as normal action.\n"); - } - } - - if (actions & TEMP_ACT_NORM_PA2_ON) { - if (lc15bts_power_set(LC15BTS_POWER_PA2, 1) != 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to switch on the PA #2\n"); - } else { - LOGP(DTEMP, LOGL_NOTICE, - "Switched on the PA #2 as normal action.\n"); } } @@ -120,16 +120,6 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA2_OFF) { - if (lc15bts_power_set(LC15BTS_POWER_PA2, 0) != 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to switch off the PA #2. Stop BTS?\n"); - } else { - LOGP(DTEMP, LOGL_NOTICE, - "Switched off the PA #2 due temperature.\n"); - } - } - if (actions & TEMP_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, @@ -137,6 +127,16 @@ } else { LOGP(DTEMP, LOGL_NOTICE, "Switched off the PA #1 due temperature.\n"); + } + } + + if (actions & TEMP_ACT_PA0_OFF) { + if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch off the PA #0. Stop BTS?\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched off the PA #0 due temperature.\n"); } } @@ -215,7 +215,7 @@ LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); @@ -230,7 +230,7 @@ } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); @@ -245,7 +245,7 @@ } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); @@ -259,23 +259,53 @@ LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current memory temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_MEMORY, LC15BTS_TEMP_INPUT); + /* Read the current RF log detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the memory temperature. rc=%d\n", rc); + "Failed to read the RF log detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { int temp = rc / 1000; - if (temp > s_mgr->temp.memory_limit.thresh_warn) + if (temp > s_mgr->temp.logrf_limit.thresh_warn) warn_thresh_passed = 1; - if (temp > s_mgr->temp.memory_limit.thresh_crit) + if (temp > s_mgr->temp.logrf_limit.thresh_crit) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "Memory temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + } + + /* Read the current OCXO temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to read the OCXO temperature. rc=%d\n", rc); + warn_thresh_passed = crit_thresh_passed = 1; + } else { + int temp = rc / 1000; + if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + warn_thresh_passed = 1; + if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + crit_thresh_passed = 1; + LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to read the TX #0 temperature. rc=%d\n", rc); + warn_thresh_passed = crit_thresh_passed = 1; + } else { + int temp = rc / 1000; + if (temp > s_mgr->temp.tx0_limit.thresh_warn) + warn_thresh_passed = 1; + if (temp > s_mgr->temp.tx0_limit.thresh_crit) + crit_thresh_passed = 1; + LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); + } + + /* Read the current TX #2 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); @@ -289,23 +319,23 @@ LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX2, LC15BTS_TEMP_INPUT); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the TX #2 temperature. rc=%d\n", rc); + "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { int temp = rc / 1000; - if (temp > s_mgr->temp.tx2_limit.thresh_warn) + if (temp > s_mgr->temp.pa0_limit.thresh_warn) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx2_limit.thresh_crit) + if (temp > s_mgr->temp.pa0_limit.thresh_crit) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "TX #2 temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, LC15BTS_TEMP_INPUT); + /* Read the current PA #2 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); @@ -317,21 +347,6 @@ if (temp > s_mgr->temp.pa1_limit.thresh_crit) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); - } - - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA2, LC15BTS_TEMP_INPUT); - if (rc < 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to read the PA #2 temperature. rc=%d\n", rc); - warn_thresh_passed = crit_thresh_passed = 1; - } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa2_limit.thresh_warn) - warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa2_limit.thresh_crit) - crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "PA #2 temperature is: %d\n", temp); } lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index e5ef55f..280c9c7 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -67,11 +67,12 @@ case LIMIT_SUPPLY_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_MEMORY_NODE: + case LIMIT_LOGRF_NODE: + case LIMIT_OCXO_NODE: + case LIMIT_TX0_NODE: case LIMIT_TX1_NODE: - case LIMIT_TX2_NODE: + case LIMIT_PA0_NODE: case LIMIT_PA1_NODE: - case LIMIT_PA2_NODE: vty->node = MGR_NODE; break; default: @@ -90,11 +91,12 @@ case LIMIT_SUPPLY_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_MEMORY_NODE: + case LIMIT_LOGRF_NODE: + case LIMIT_OCXO_NODE: + case LIMIT_TX0_NODE: case LIMIT_TX1_NODE: - case LIMIT_TX2_NODE: + case LIMIT_PA0_NODE: case LIMIT_PA1_NODE: - case LIMIT_PA2_NODE: return 1; default: return 0; @@ -154,30 +156,36 @@ 1, }; -static struct cmd_node limit_memory_node = { - LIMIT_MEMORY_NODE, - "%s(limit-memory)# ", +static struct cmd_node limit_logrf_node = { + LIMIT_LOGRF_NODE, + "%s(limit-logrf)# ", 1, }; +static struct cmd_node limit_ocxo_node = { + LIMIT_OCXO_NODE, + "%s(limit-ocxo)# ", + 1, +}; + +static struct cmd_node limit_tx0_node = { + LIMIT_TX0_NODE, + "%s(limit-tx0)# ", + 1, +}; static struct cmd_node limit_tx1_node = { LIMIT_TX1_NODE, "%s(limit-tx1)# ", 1, }; -static struct cmd_node limit_tx2_node = { - LIMIT_TX2_NODE, - "%s(limit-tx2)# ", +static struct cmd_node limit_pa0_node = { + LIMIT_PA0_NODE, + "%s(limit-pa0)# ", 1, }; static struct cmd_node limit_pa1_node = { LIMIT_PA1_NODE, "%s(limit-pa1)# ", - 1, -}; -static struct cmd_node limit_pa2_node = { - LIMIT_PA2_NODE, - "%s(limit-pa2)# ", 1, }; @@ -202,10 +210,10 @@ static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " %spa0-on%s", + (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " %spa2-on%s", - (actions & TEMP_ACT_NORM_PA2_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } @@ -213,10 +221,10 @@ static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " %spa0-off%s", + (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " %spa2-off%s", - (actions & TEMP_ACT_PA2_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } @@ -228,11 +236,12 @@ write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits memory", &s_mgr->temp.memory_limit); + write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); + write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); + write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits tx2", &s_mgr->temp.tx2_limit); + write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); - write_temp_limit(vty, "limits pa2", &s_mgr->temp.pa2_limit); write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); write_action(vty, "actions warn", s_mgr->temp.action_warn); @@ -259,11 +268,12 @@ CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(memory, "MEMORY\n", LIMIT_MEMORY_NODE, memory_limit) +CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) +CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) +CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(tx2, "TX2\n", LIMIT_TX2_NODE, tx2_limit) +CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -CFG_LIMIT(pa2, "PA2\n", LIMIT_PA2_NODE, pa2_limit) #undef CFG_LIMIT DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, @@ -298,6 +308,24 @@ CFG_ACTION(critical, "Critical Actions\n", ACT_CRIT_NODE, action_crit) #undef CFG_ACTION +DEFUN(cfg_action_pa0_on, cfg_action_pa0_on_cmd, + "pa0-on", + "Switch the Power Amplifier #0 on\n") +{ + int *action = vty->index; + *action |= TEMP_ACT_NORM_PA0_ON; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_action_pa0_on, cfg_no_action_pa0_on_cmd, + "no pa0-on", + NO_STR "Switch the Power Amplifieri #0 on\n") +{ + int *action = vty->index; + *action &= ~TEMP_ACT_NORM_PA0_ON; + return CMD_SUCCESS; +} + DEFUN(cfg_action_pa1_on, cfg_action_pa1_on_cmd, "pa1-on", "Switch the Power Amplifier #1 on\n") @@ -313,24 +341,6 @@ { int *action = vty->index; *action &= ~TEMP_ACT_NORM_PA1_ON; - return CMD_SUCCESS; -} - -DEFUN(cfg_action_pa2_on, cfg_action_pa2_on_cmd, - "pa2-on", - "Switch the Power Amplifier #2 on\n") -{ - int *action = vty->index; - *action |= TEMP_ACT_NORM_PA2_ON; - return CMD_SUCCESS; -} - -DEFUN(cfg_no_action_pa2_on, cfg_no_action_pa2_on_cmd, - "no pa2-on", - NO_STR "Switch the Power Amplifieri #2 on\n") -{ - int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA2_ON; return CMD_SUCCESS; } @@ -352,39 +362,39 @@ return CMD_SUCCESS; } +DEFUN(cfg_action_pa0_off, cfg_action_pa0_off_cmd, + "pa0-off", + "Switch the Power Amplifier #0 off\n") +{ + int *action = vty->index; + *action |= TEMP_ACT_PA0_OFF; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_action_pa0_off, cfg_no_action_pa0_off_cmd, + "no pa0-off", + NO_STR "Do not switch off the Power Amplifier #0\n") +{ + int *action = vty->index; + *action &= ~TEMP_ACT_PA0_OFF; + return CMD_SUCCESS; +} + DEFUN(cfg_action_pa1_off, cfg_action_pa1_off_cmd, - "pa1-off", - "Switch the Power Amplifier #1 off\n") -{ - int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; - return CMD_SUCCESS; -} - -DEFUN(cfg_no_action_pa1_off, cfg_no_action_pa1_off_cmd, - "no pa1-off", - NO_STR "Do not switch off the Power Amplifier #1\n") -{ - int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; - return CMD_SUCCESS; -} - -DEFUN(cfg_action_pa2_off, cfg_action_pa2_off_cmd, - "pa2-off", - "Switch the Power Amplifier #2 off\n") + "pa1-off", + "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA2_OFF; + *action |= TEMP_ACT_PA1_OFF; return CMD_SUCCESS; } -DEFUN(cfg_no_action_pa2_off, cfg_no_action_pa2_off_cmd, - "no pa2-off", - NO_STR "Do not switch off the Power Amplifier #2\n") +DEFUN(cfg_no_action_pa1_off, cfg_no_action_pa1_off_cmd, + "no pa1-off", + NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA2_OFF; + *action &= ~TEMP_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -413,45 +423,49 @@ lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, VTY_NEWLINE); vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, VTY_NEWLINE); vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Memory (DDR): %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_MEMORY, - LC15BTS_TEMP_INPUT) / 1000.0f, + vty_out(vty, " LogRF : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + VTY_NEWLINE); + vty_out(vty, " OCXO : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + VTY_NEWLINE); + vty_out(vty, " TX 0 : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, VTY_NEWLINE); vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 2 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX2, - LC15BTS_TEMP_INPUT) / 1000.0f, + vty_out(vty, " Power Amp #0: %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, VTY_NEWLINE); vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1, - LC15BTS_TEMP_INPUT) / 1000.0f, - VTY_NEWLINE); - vty_out(vty, " Power Amp #2: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA2, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : (ON) [%6.2f Vdc, %4.2f A, %6.2f W]%s", + vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, LC15BTS_POWER_VOLTAGE)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, LC15BTS_POWER_CURRENT)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER)/1000000.0f, + VTY_NEWLINE); + vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", + lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE)/1000.0f, + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT)/1000.0f, + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, LC15BTS_POWER_POWER)/1000000.0f, VTY_NEWLINE); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", @@ -461,15 +475,6 @@ lc15bts_power_sensor_get(LC15BTS_POWER_PA1, LC15BTS_POWER_CURRENT)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, - VTY_NEWLINE); - vty_out(vty, " Power Amp #2: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_get(LC15BTS_POWER_PA2) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, LC15BTS_POWER_POWER)/1000000.0f, VTY_NEWLINE); @@ -496,20 +501,20 @@ static void register_normal_action(int act) { + install_element(act, &cfg_action_pa0_on_cmd); + install_element(act, &cfg_no_action_pa0_on_cmd); install_element(act, &cfg_action_pa1_on_cmd); install_element(act, &cfg_no_action_pa1_on_cmd); - install_element(act, &cfg_action_pa2_on_cmd); - install_element(act, &cfg_no_action_pa2_on_cmd); install_element(act, &cfg_action_bts_srv_on_cmd); install_element(act, &cfg_no_action_bts_srv_on_cmd); } static void register_action(int act) { + install_element(act, &cfg_action_pa0_off_cmd); + install_element(act, &cfg_no_action_pa0_off_cmd); install_element(act, &cfg_action_pa1_off_cmd); install_element(act, &cfg_no_action_pa1_off_cmd); - install_element(act, &cfg_action_pa2_off_cmd); - install_element(act, &cfg_no_action_pa2_off_cmd); install_element(act, &cfg_action_bts_srv_off_cmd); install_element(act, &cfg_no_action_bts_srv_off_cmd); } @@ -542,30 +547,35 @@ register_limit(LIMIT_FPGA_NODE); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_memory_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_memory_cmd); - register_limit(LIMIT_MEMORY_NODE); - vty_install_default(LIMIT_MEMORY_NODE); + install_node(&limit_logrf_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_logrf_cmd); + register_limit(LIMIT_LOGRF_NODE); + vty_install_default(LIMIT_LOGRF_NODE); + + install_node(&limit_ocxo_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_ocxo_cmd); + register_limit(LIMIT_OCXO_NODE); + vty_install_default(LIMIT_OCXO_NODE); + + install_node(&limit_tx0_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_cmd); + register_limit(LIMIT_TX0_NODE); + vty_install_default(LIMIT_TX0_NODE); install_node(&limit_tx1_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_tx1_cmd); register_limit(LIMIT_TX1_NODE); vty_install_default(LIMIT_TX1_NODE); - install_node(&limit_tx2_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx2_cmd); - register_limit(LIMIT_TX2_NODE); - vty_install_default(LIMIT_TX2_NODE); + install_node(&limit_pa0_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_cmd); + register_limit(LIMIT_PA0_NODE); + vty_install_default(LIMIT_PA0_NODE); install_node(&limit_pa1_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa1_cmd); register_limit(LIMIT_PA1_NODE); vty_install_default(LIMIT_PA1_NODE); - - install_node(&limit_pa2_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa2_cmd); - register_limit(LIMIT_PA2_NODE); - vty_install_default(LIMIT_PA2_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index e0602c8..5ff8e31 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -74,37 +74,41 @@ .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "memory", + .name = "logrf", .has_max = 1, - .sensor = LC15BTS_TEMP_MEMORY, - .ee_par = LC15BTS_PAR_TEMP_MEMORY_MAX, + .sensor = LC15BTS_TEMP_LOGRF, + .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + }, { + .name = "ocxo", + .has_max = 1, + .sensor = LC15BTS_TEMP_OCXO, + .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, + }, { + .name = "tx0", + .has_max = 0, + .sensor = LC15BTS_TEMP_TX0, + .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { .name = "tx1", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "tx2", - .has_max = 0, - .sensor = LC15BTS_TEMP_TX2, - .ee_par = LC15BTS_PAR_TEMP_TX2_MAX, + .name = "pa0", + .has_max = 1, + .sensor = LC15BTS_TEMP_PA0, + .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { .name = "pa1", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, - }, { - .name = "pa2", - .has_max = 1, - .sensor = LC15BTS_TEMP_PA2, - .ee_par = LC15BTS_PAR_TEMP_PA2_MAX, } }; void lc15bts_check_temp(int no_rom_write) { int temp_old[ARRAY_SIZE(temp_data)]; - int temp_hi[ARRAY_SIZE(temp_data)]; int temp_cur[ARRAY_SIZE(temp_data)]; int i, rc; @@ -112,40 +116,24 @@ int ret; rc = lc15bts_par_get_int(temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - if (temp_data[i].has_max) { - temp_hi[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_HIGHEST); - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_INPUT); - if ((temp_cur[i] < 0 && temp_cur[i] > -1000) || - (temp_hi[i] < 0 && temp_hi[i] > -1000)) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n"); - continue; - } + temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + if (temp_cur[i] < 0 && temp_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d)\n", temp_data[i].sensor); + continue; } - else { - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_INPUT); - - if (temp_cur[i] < 0 && temp_cur[i] > -1000) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n"); - continue; - } - temp_hi[i] = temp_cur[i]; - } - + LOGP(DTEMP, LOGL_DEBUG, "Current %s temperature: %d.%d C\n", temp_data[i].name, temp_cur[i]/1000, temp_cur[i]%1000); - if (temp_hi[i] > temp_old[i]) { + if (temp_cur[i] > temp_old[i]) { LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " "temperature: %d.%d C\n", temp_data[i].name, - temp_hi[i]/1000, temp_hi[i]%1000); + temp_cur[i]/1000, temp_old[i]%1000); if (!no_rom_write) { rc = lc15bts_par_set_int(temp_data[i].ee_par, - temp_hi[i]/1000); + temp_cur[i]/1000); if (rc < 0) LOGP(DTEMP, LOGL_ERROR, "error writing new %s " "max temp %d (%s)\n", temp_data[i].name, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 7154426..3d80e67 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -46,11 +46,12 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_MEMORY_MAX, "temp-memory-max" }, + { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, + { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, - { LC15BTS_PAR_TEMP_TX2_MAX, "temp-tx2-max" }, + { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, - { LC15BTS_PAR_TEMP_PA2_MAX, "temp-pa2-max" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -64,11 +65,12 @@ case LC15BTS_PAR_TEMP_SUPPLY_MAX: case LC15BTS_PAR_TEMP_SOC_MAX: case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_MEMORY_MAX: + case LC15BTS_PAR_TEMP_LOGRF_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_TX2_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: case LC15BTS_PAR_TEMP_PA1_MAX: - case LC15BTS_PAR_TEMP_PA2_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index 7c18271..c50a69f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -7,11 +7,12 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_MEMORY_MAX, + LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_OCXO_MAX, + LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, - LC15BTS_PAR_TEMP_TX2_MAX, + LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, - LC15BTS_PAR_TEMP_PA2_MAX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index a2997ee..5b01d36 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -30,24 +30,24 @@ #define LC15BTS_PA_VOLTAGE 24000000 -#define PA_SUPPLY_MIN_SYSFS "/sys/devices/0.pa-supply/min_microvolts" -#define PA_SUPPLY_MAX_SYSFS "/sys/devices/0.pa-supply/max_microvolts" +#define PA_SUPPLY_MIN_SYSFS "/var/lc15/pa-supply/min_microvolts" +#define PA_SUPPLY_MAX_SYSFS "/var/lc15/pa-supply/max_microvolts" static const char *power_enable_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_PA1] = "/sys/devices/0.pa1/state", - [LC15BTS_POWER_PA2] = "/sys/devices/0.pa2/state", + [LC15BTS_POWER_PA0] = "/var/lc15/pa-state/pa0/state", + [LC15BTS_POWER_PA1] = "/var/lc15/pa-state/pa1/state", }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/sys/bus/i2c/devices/2-0040/hwmon/hwmon6/", - [LC15BTS_POWER_PA1] = "/sys/bus/i2c/devices/2-0044/hwmon/hwmon7/", - [LC15BTS_POWER_PA2] = "/sys/bus/i2c/devices/2-0045/hwmon/hwmon8/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", + [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; static const char *power_sensor_type_str[_NUM_POWER_TYPES] = { - [LC15BTS_POWER_POWER] = "power1_input", - [LC15BTS_POWER_VOLTAGE] = "in1_input", - [LC15BTS_POWER_CURRENT] = "curr1_input", + [LC15BTS_POWER_POWER] = "power", + [LC15BTS_POWER_VOLTAGE] = "voltage", + [LC15BTS_POWER_CURRENT] = "current", }; int lc15bts_power_sensor_get( @@ -94,8 +94,8 @@ int fd; int rc; - if ((source != LC15BTS_POWER_PA1) - && (source != LC15BTS_POWER_PA2) ) { + if ((source != LC15BTS_POWER_PA0) + && (source != LC15BTS_POWER_PA1) ) { return -EINVAL; } @@ -144,6 +144,7 @@ { int fd; int rc; + int retVal = 0; char enstr[10]; fd = open(power_enable_devs[source], O_RDONLY); @@ -152,7 +153,7 @@ } rc = read(fd, enstr, sizeof(enstr)); - enstr[sizeof(enstr)-1] = '\0'; + enstr[rc-1] = '\0'; close(fd); @@ -163,5 +164,10 @@ return -EIO; } - return atoi(enstr); + rc = strcmp(enstr, "enabled"); + if(rc == 0) { + retVal = 1; + } + + return retVal; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 4bb2748..8963b76 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -3,8 +3,8 @@ enum lc15bts_power_source { LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_PA0, LC15BTS_POWER_PA1, - LC15BTS_POWER_PA2, _NUM_POWER_SOURCES }; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index fa6300e..aa35854 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -31,43 +31,27 @@ static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/sys/bus/i2c/devices/2-004d/hwmon/hwmon5/temp1_", - [LC15BTS_TEMP_SOC] = "/sys/class/hwmon/hwmon1/temp1_", - [LC15BTS_TEMP_FPGA] = "/sys/devices/0.iio_hwmon/temp1_", - [LC15BTS_TEMP_MEMORY] = "/sys/bus/i2c/devices/2-004c/hwmon/hwmon4/temp1_", - [LC15BTS_TEMP_TX1] = "/sys/devices/0.ncp15xh103_tx1/temp1_", - [LC15BTS_TEMP_TX2] = "/sys/devices/0.ncp15xh103_tx2/temp1_", - [LC15BTS_TEMP_PA1] = "/sys/bus/i2c/devices/2-004d/hwmon/hwmon5/temp2_", - [LC15BTS_TEMP_PA2] = "/sys/bus/i2c/devices/2-004c/hwmon/hwmon4/temp2_", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -static const int temp_has_fault[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_PA1] = 1, - [LC15BTS_TEMP_PA2] = 1, -}; - -static const char *temp_type_str[_NUM_TEMP_TYPES] = { - [LC15BTS_TEMP_INPUT] = "input", - [LC15BTS_TEMP_LOWEST] = "lowest", - [LC15BTS_TEMP_HIGHEST] = "highest", - [LC15BTS_TEMP_FAULT] = "fault", -}; - -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, - enum lc15bts_temp_type type) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) { char buf[PATH_MAX]; char tempstr[8]; - char faultstr[8]; int fd, rc; if (sensor < 0 || sensor >= _NUM_TEMP_SENSORS) return -EINVAL; - if (type >= ARRAY_SIZE(temp_type_str)) - return -EINVAL; - - snprintf(buf, sizeof(buf)-1, "%s%s", temp_devs[sensor], temp_type_str[type]); + snprintf(buf, sizeof(buf)-1, "%s", temp_devs[sensor]); buf[sizeof(buf)-1] = '\0'; fd = open(buf, O_RDONLY); @@ -85,32 +69,6 @@ return -EIO; } close(fd); - - // Check fault - if (type == LC15BTS_TEMP_FAULT || !temp_has_fault[sensor]) - return atoi(tempstr); - - snprintf(buf, sizeof(buf)-1, "%s%s", temp_devs[sensor], temp_type_str[LC15BTS_TEMP_FAULT]); - buf[sizeof(buf)-1] = '\0'; - - fd = open(buf, O_RDONLY); - if (fd < 0) - return fd; - - rc = read(fd, faultstr, sizeof(faultstr)); - tempstr[sizeof(faultstr)-1] = '\0'; - if (rc < 0) { - close(fd); - return rc; - } - if (rc == 0) { - close(fd); - return -EIO; - } - close(fd); - - if (atoi(faultstr)) - return -EIO; return atoi(tempstr); } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index 4b70cb8..aca8fe2 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,11 +5,12 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_MEMORY, + LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_OCXO, + LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, - LC15BTS_TEMP_TX2, + LC15BTS_TEMP_PA0, LC15BTS_TEMP_PA1, - LC15BTS_TEMP_PA2, _NUM_TEMP_SENSORS }; @@ -21,7 +22,6 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, - enum lc15bts_temp_type type); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); #endif -- To view, visit https://gerrit.osmocom.org/237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:16 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:16 +0000 Subject: [PATCH] osmo-bts[master]: LC15: TRX nominal TX power can be used from EEPROM or from B... Message-ID: Review at https://gerrit.osmocom.org/238 LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e --- M include/osmo-bts/phy_link.h M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 4 files changed, 226 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/238/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index edc6cc0..b3db4ce 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -103,7 +103,8 @@ /* configuration */ uint32_t dsp_trace_f; char *calib_path; - + int minTxPower; + int maxTxPower; struct lc15l1_hdl *hdl; } lc15; } u; diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index c6be4f0..3bc788c 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -42,7 +42,11 @@ #include "lc15bts.h" #include "utils.h" - +/** + * * Maximum calibration data chunk size + * */ +#define MAX_CALIB_TBL_SIZE 65536 +#define CALIB_HDR_V1 0x01 struct calib_file_desc { const char *fname; @@ -83,9 +87,37 @@ }, }; +static struct calTbl_t +{ + union + { + struct + { + uint8_t u8Version; // Header version (1) + uint8_t u8Parity; // Parity byte (xor) + uint8_t u8Type; // Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) + uint8_t u8Band; // GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) + uint32_t u32Len; // Table length in bytes including the header + struct + { + uint32_t u32DescOfst; // Description section offset + uint32_t u32DateOfst; // Date section offset + uint32_t u32StationOfst; // Calibration test station section offset + uint32_t u32FpgaFwVerOfst; // Calibration FPGA firmware version section offset + uint32_t u32DspFwVerOfst; // Calibration DSP firmware section offset + uint32_t u32DataOfst; // Calibration data section offset + } toc; + } v1; + } hdr; + + uint8_t u8RawData[MAX_CALIB_TBL_SIZE - 32]; +}; + static int calib_file_send(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc); +static int calib_verify(struct lc15l1_hdl *fl1h, + const struct calib_file_desc *desc); /* determine next calibration file index based on supported bands */ static int get_next_calib_file_idx(struct lc15l1_hdl *fl1h, int last_idx) @@ -203,6 +235,20 @@ return 0; } + rc = calib_verify(fl1h, desc); + if ( rc < 0 ) { + LOGP(DL1C, LOGL_ERROR, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + st->last_file_idx = get_next_calib_file_idx(fl1h, st->last_file_idx); + + if (st->last_file_idx >= 0) + return calib_file_send(fl1h, + &calib_files[st->last_file_idx]); + return 0; + + } + + LOGP(DL1C, LOGL_INFO, "Verify L1 calibration table %s -> done\n", desc->fname); + return calib_file_send_next_chunk(fl1h); } @@ -258,3 +304,155 @@ return calib_file_send(fl1h, &calib_files[st->last_file_idx]); } + +static int calib_verify(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc) +{ + int i, rc, sz; + struct calib_send_state *st = &fl1h->st; + struct phy_link *plink = fl1h->phy_inst->phy_link; + char *rbuf; + struct calTbl_t *calTbl; + char calChkSum ; + + + //calculate file size in bytes + fseek(st->fp, 0L, SEEK_END); + sz = ftell(st->fp); + + //rewind read poiner + fseek(st->fp, 0L, SEEK_SET); + + //read file + rbuf = (char *) malloc( sizeof(char) * sz ); + + rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); + if ( rc != sz) { + + LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); + free(rbuf); + + //close file + rc = calib_file_close(fl1h); + if (rc < 0 ) { + LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); + return rc; + } + + return -2; + } + + + calTbl = (struct calTbl_t*) rbuf; + //calcualte file checksum + calChkSum = 0; + while ( sz-- ) { + calChkSum ^= rbuf[sz]; + } + + //validate Tx calibration parity + if ( calChkSum ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); + return -4; + } + + //validate Tx calibration header + if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); + return -5; + } + + //validate calibration description + if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); + return -6; + } + + //validate calibration date + if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); + return -7; + } + + LOGP(DL1C, LOGL_INFO, "L1 calibration table %s created on %s\n", + desc->fname, + calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); + + //validate calibration station + if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); + return -8; + } + + //validate FPGA FW version + if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); + return -9; + } + //validate DSP FW version + if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); + return -10; + } + + //validate Tx calibration data offset + if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); + return -11; + } + + if ( !desc->rx ) { + + //parse min/max Tx power + fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; + fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; + + //override nominal Tx power of given TRX if needed + if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", + plink->num, + fl1h->phy_inst->u.lc15.maxTxPower, + fl1h->phy_inst->trx->nominal_power); + + fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.maxTxPower; + } + + if ( fl1h->phy_inst->trx->nominal_power < fl1h->phy_inst->u.lc15.minTxPower) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", + plink->num, + fl1h->phy_inst->u.lc15.minTxPower, + fl1h->phy_inst->trx->nominal_power); + + fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.minTxPower; + } + + if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm > to_mdB(fl1h->phy_inst->u.lc15.maxTxPower) ) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", + plink->num, + to_mdB(fl1h->phy_inst->u.lc15.maxTxPower), + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm); + + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.maxTxPower); + } + + if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm < to_mdB(fl1h->phy_inst->u.lc15.minTxPower) ) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", + plink->num, + to_mdB(fl1h->phy_inst->u.lc15.minTxPower), + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm); + + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.minTxPower); + } + + LOGP(DL1C, LOGL_DEBUG, "%s: minTxPower=%d, maxTxPower=%d\n", + desc->fname, + fl1h->phy_inst->u.lc15.minTxPower, + fl1h->phy_inst->u.lc15.maxTxPower ); + } + + //rewind read poiner for subsequence tasks + fseek(st->fp, 0L, SEEK_SET); + free(rbuf); + + return 0; +} + diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index d0288ab..8c4364c 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -218,6 +218,8 @@ vty_out(vty, "%s ", gsm_band_name(1 << i)); } vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "Min Tx Power: %d dBm%s", fl1h->phy_inst->u.lc15.minTxPower, VTY_NEWLINE); + vty_out(vty, "Max Tx Power: %d dBm%s", fl1h->phy_inst->u.lc15.maxTxPower, VTY_NEWLINE); return CMD_SUCCESS; } @@ -246,8 +248,9 @@ } DEFUN(set_tx_power, set_tx_power_cmd, - "trx <0-0> tx-power <-110-100>", + "trx nr <0-1> tx-power <-110-100>", TRX_STR + "TRX number \n" "Set transmit power (override BSC)\n" "Transmit power in dBm\n") { @@ -298,6 +301,25 @@ return CMD_SUCCESS; } +DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd, + "nominal-tx-power <0-40>", + "Set the nominal transmit output power in dBm\n" + "Nominal transmit output power level in dBm\n") +{ + int nominal_power = atoi(argv[0]); + struct gsm_bts_trx *trx = vty->index; + + if (( nominal_power > 40 ) || ( nominal_power < 0 )) { + vty_out(vty, "Nominal Tx power level must be between 0 and 40 dBm (%d) %s", + nominal_power, VTY_NEWLINE); + return CMD_WARNING; + } + + trx->nominal_power = nominal_power; + trx->power_params.trx_p_max_out_mdBm = to_mdB(nominal_power); + + return CMD_SUCCESS; +} void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { @@ -305,6 +327,7 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) { + vty_out(vty, " nominal-tx-power %d%s", trx->nominal_power,VTY_NEWLINE); } static void write_phy_inst(struct vty *vty, struct phy_instance *pinst) diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index 2aaacd3..352949b 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -81,7 +81,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - trx->nominal_power = 37; + trx->nominal_power = 40; trx->power_params.trx_p_max_out_mdBm = to_mdB(bts->c0->nominal_power); } -- To view, visit https://gerrit.osmocom.org/238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:17 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:17 +0000 Subject: [PATCH] osmo-bts[master]: LC15: BTS parameters are configurable via configuration file... Message-ID: Review at https://gerrit.osmocom.org/239 LC15: BTS parameters are configurable via configuration file : - Maximum cell size - Diversity - Unused TS pedestal - Adjustment of Tx output power - Reduction Tx power level in 8-PSK modulation scheme Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 --- M include/osmo-bts/gsm_data.h M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 6 files changed, 196 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/39/239/1 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 7a48667..6bbbd5f 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -111,6 +111,14 @@ struct { char *sock_path; } pcu; +#ifdef ENABLE_LC15BTS + /* specific to LC15 BTS */ + uint8_t max_cell_size; /* 166 qbits */ + uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ + uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ + uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ +#endif }; enum lchan_ciph_state { diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 768e29d..6d6ca25 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -4,6 +4,10 @@ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +if ENABLE_LC15BTS +AM_CFLAGS += -DENABLE_LC15BTS +endif + EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ misc/lc15bts_bid.h misc/lc15bts_nl.h \ diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index f7ecc7a..e94db84 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1077,6 +1077,7 @@ oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); } else { bts_update_status(BTS_STATUS_RF_ACTIVE, 0); + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); } @@ -1091,17 +1092,27 @@ { struct msgb *msg = sysp_msgb_alloc(); Litecell15_Prim_t *sysp = msgb_sysprim(msg); + struct gsm_bts_role_bts *btsb = bts_role_bts(hdl->phy_inst->trx->bts); if (on) { sysp->id = Litecell15_PrimId_ActivateRfReq; sysp->u.activateRfReq.msgq.u8UseTchMsgq = 0; sysp->u.activateRfReq.msgq.u8UsePdtchMsgq = pcu_direct; - sysp->u.activateRfReq.u8UnusedTsMode = 0; + sysp->u.activateRfReq.u8UnusedTsMode = btsb->pedestal_mode; sysp->u.activateRfReq.u8McCorrMode = 0; + /* diversity mode: 0: SISO-A, 1: SISO-B, 2: MRC */ + sysp->u.activateRfReq.u8DiversityMode = btsb->diversity_mode; + /* maximum cell size in quarter-bits, 90 == 12.456 km */ - sysp->u.activateRfReq.u8MaxCellSize = 90; + sysp->u.activateRfReq.u8MaxCellSize = btsb->max_cell_size; + + /* auto tx power adjustment mode 0:none, 1: automatic*/ + sysp->u.activateRfReq.autoPowerAdjust.u8EnAutoPowerAdjust = btsb->tx_pwr_adj_mode; + + /* PSK modulation scheme maximum power level */ + sysp->u.activateRfReq.autoPowerAdjust.u8PowerReduction8Psk = btsb->tx_pwr_red_8psk; } else { sysp->id = Litecell15_PrimId_DeactivateRfReq; } diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index 4c40db0..f6a7e3f 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -22,6 +22,22 @@ L1P_T_IND, }; +enum lc15_diversity_mode{ + LC15_DIVERSITY_SISO_A = 0, + LC15_DIVERSITY_SISO_B, + LC15_DIVERSITY_MRC, +}; + +enum lc15_pedestal_mode{ + LC15_PEDESTAL_OFF = 0, + LC15_PEDESTAL_ON, +}; + +enum lc15_auto_pwr_adjust_mode{ + LC15_TX_PWR_ADJ_NONE = 0, + LC15_TX_PWR_ADJ_AUTO, +}; + enum l1prim_type lc15bts_get_l1prim_type(GsmL1_PrimId_t id); const struct value_string lc15bts_l1prim_names[GsmL1_PrimId_NUM+1]; GsmL1_PrimId_t lc15bts_get_l1prim_conf(GsmL1_PrimId_t id); @@ -61,4 +77,11 @@ const uint8_t pdch_msu_size[_NUM_PDCH_CS]; +/* LC15 default parameters */ +#define GSM_BTS_MAX_CELL_SIZE_DEFAULT 166 /* 166 qbits is default value */ +#define GSM_BTS_DIVERSITY_MODE_DEFAULT 2 /* MRC is default mode */ +#define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ +#define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ +#define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ + #endif /* LC15BTS_H */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 8c4364c..fcace3f 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -65,6 +65,35 @@ static struct gsm_bts *vty_bts; +static const struct value_string lc15_diversity_mode_strs[] = { + { LC15_DIVERSITY_SISO_A, "siso-a" }, + { LC15_DIVERSITY_SISO_B, "siso-b" }, + { LC15_DIVERSITY_MRC, "mrc" }, + { 0, NULL } +}; + +static const struct value_string lc15_pedestal_mode_strs[] = { + { LC15_PEDESTAL_OFF, "off" }, + { LC15_PEDESTAL_ON, "on" }, + { 0, NULL } +}; + +static const struct value_string lc15_auto_adj_pwr_strs[] = { + { LC15_TX_PWR_ADJ_NONE, "none" }, + { LC15_TX_PWR_ADJ_AUTO, "auto" }, + { 0, NULL } +}; + +static int parse_mdbm(const char *valstr, const char *unit) +{ + int val = atoi(valstr); + + if (!strcmp(unit, "dB") || !strcmp(unit, "dBm")) + return val * 1000; + else + return val; +} + /* configuration */ DEFUN(cfg_phy_cal_path, cfg_phy_cal_path_cmd, @@ -321,8 +350,114 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_max_cell_size, cfg_bts_max_cell_size_cmd, + "max-cell-size <0-166>", + "Set the maximum cell size in qbits\n") +{ + struct gsm_bts *bts = vty->index;; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int cell_size = (uint8_t)atoi(argv[0]); + + if (( cell_size > 166 ) || ( cell_size < 0 )) { + vty_out(vty, "Max cell size must be between 0 and 166 qbits (%d) %s", + cell_size, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->max_cell_size = (uint8_t)cell_size; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_diversity_mode, cfg_bts_diversity_mode_cmd, + "diversity-mode (siso-a|siso-b|mrc)", + "Set reception diversity mode \n" + "Reception diversity mode can be (siso-a, siso-b, mrc)\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_diversity_mode_strs, argv[0]); + + if((val < LC15_DIVERSITY_SISO_A) || (val > LC15_DIVERSITY_MRC)) { + vty_out(vty, "Invalid reception diversity mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->diversity_mode = (uint8_t)val; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_pedestal_mode, cfg_bts_pedestal_mode_cmd, + "pedestal-mode (on|off)", + "Set unused time-slot transmission in pedestal mode\n" + "Transmission pedestal mode can be (off, on)\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_pedestal_mode_strs, argv[0]); + + if((val < LC15_PEDESTAL_OFF) || (val > LC15_PEDESTAL_ON)) { + vty_out(vty, "Invalid unused time-slot transmission mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->pedestal_mode = (uint8_t)val; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, + "pwr-adj-mode (none|auto)", + "Set output power adjustment mode\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_auto_adj_pwr_strs, argv[0]); + + if((val < LC15_TX_PWR_ADJ_NONE) || (val > LC15_TX_PWR_ADJ_AUTO)) { + vty_out(vty, "Invalid output power adjustment mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->tx_pwr_adj_mode = (uint8_t)val; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_tx_red_pwr_8psk, cfg_bts_tx_red_pwr_8psk_cmd, + "tx-red-pwr-8psk <0-40>", + "Set reduction output power for 8-PSK scheme in dB unit\n") +{ + struct gsm_bts *bts = vty->index;; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = atoi(argv[0]); + + if (( val > 40 ) || ( val < 0 )) { + vty_out(vty, "Reduction Tx power level must be between 0 and 40 dB (%d) %s", + val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->tx_pwr_red_8psk = (uint8_t)val; + return CMD_SUCCESS; +} + void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + vty_out(vty, " max-cell-size %d%s", + btsb->max_cell_size, VTY_NEWLINE); + + vty_out(vty, " diversity-mode %s%s", + get_value_string(lc15_diversity_mode_strs, btsb->diversity_mode), VTY_NEWLINE); + + vty_out(vty, " pedestal-mode %s%s", + get_value_string(lc15_pedestal_mode_strs, btsb->pedestal_mode) , VTY_NEWLINE); + + vty_out(vty, " pwr-adj-mode %s%s", + get_value_string(lc15_auto_adj_pwr_strs, btsb->tx_pwr_adj_mode), VTY_NEWLINE); + + vty_out(vty, " tx-red-pwr-8psk %d%s", + btsb->tx_pwr_red_8psk, VTY_NEWLINE); + } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -405,6 +540,13 @@ install_element(BTS_NODE, &cfg_bts_auto_band_cmd); install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd); + install_element(BTS_NODE, &cfg_bts_diversity_mode_cmd); + install_element(BTS_NODE, &cfg_bts_pedestal_mode_cmd); + install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); + install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); + install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); + + install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); install_element(PHY_INST_NODE, &cfg_phy_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_no_dsp_trace_f_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index 352949b..b2f0f77 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -72,6 +72,12 @@ btsb = bts_role_bts(bts); btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + /* specific default values for LC15 platform */ + btsb->max_cell_size = GSM_BTS_MAX_CELL_SIZE_DEFAULT; + btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; + btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; + btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; + btsb->tx_pwr_red_8psk = GSM_BTS_TX_RED_PWR_8PSK_DEFAULT; rc = oml_router_init(bts, OML_ROUTER_PATH, &accept_fd, &read_fd); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:17 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:17 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Enable to bypass LED control by the BTS via configurat... Message-ID: Review at https://gerrit.osmocom.org/240 LC15: Enable to bypass LED control by the BTS via configuration file Change-Id: I17639bfffa2429d70eb254427812260ec8802ef6 --- M include/osmo-bts/gsm_data.h M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 5 files changed, 48 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/240/1 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 6bbbd5f..101cbfc 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -116,6 +116,7 @@ uint8_t max_cell_size; /* 166 qbits */ uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ #endif diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index e94db84..0f10fcb 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1046,6 +1046,8 @@ GsmL1_Status_t status; int on = 0; unsigned int i; + struct gsm_bts *bts = trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); if (sysp->id == Litecell15_PrimId_ActivateRfCnf) on = 1; @@ -1064,8 +1066,10 @@ LOGP(DL1C, LOGL_FATAL, "RF-ACT.conf with status %s\n", get_value_string(lc15bts_l1status_names, status)); bts_shutdown(trx->bts, "RF-ACT failure"); - } else - bts_update_status(BTS_STATUS_RF_ACTIVE, 1); + } else { + if(btsb->led_ctrl_mode == LC15_LED_CONTROL_BTS) + bts_update_status(BTS_STATUS_RF_ACTIVE, 1); + } /* signal availability */ oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); @@ -1076,8 +1080,8 @@ for (i = 0; i < ARRAY_SIZE(trx->ts); i++) oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); } else { - bts_update_status(BTS_STATUS_RF_ACTIVE, 0); - + if(btsb->led_ctrl_mode == LC15_LED_CONTROL_BTS) + bts_update_status(BTS_STATUS_RF_ACTIVE, 0); oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); } @@ -1162,10 +1166,13 @@ oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 0); } else { int i; + struct gsm_bts *bts = trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); LOGP(DL1C, LOGL_INFO, "Rx RF-MUTE.conf with status=%s\n", get_value_string(lc15bts_l1status_names, status)); - bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]); + if(btsb->led_ctrl_mode == LC15_LED_CONTROL_BTS) + bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]); oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 1); osmo_static_assert( diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index f6a7e3f..4822893 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -33,6 +33,11 @@ LC15_PEDESTAL_ON, }; +enum lc15_led_control_mode{ + LC15_LED_CONTROL_BTS = 0, + LC15_LED_CONTROL_EXT, +}; + enum lc15_auto_pwr_adjust_mode{ LC15_TX_PWR_ADJ_NONE = 0, LC15_TX_PWR_ADJ_AUTO, @@ -81,6 +86,7 @@ #define GSM_BTS_MAX_CELL_SIZE_DEFAULT 166 /* 166 qbits is default value */ #define GSM_BTS_DIVERSITY_MODE_DEFAULT 2 /* MRC is default mode */ #define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ +#define GSM_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */ #define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ #define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index fcace3f..7762a57 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -78,6 +78,12 @@ { 0, NULL } }; +static const struct value_string lc15_led_mode_strs[] = { + { LC15_LED_CONTROL_BTS, "bts" }, + { LC15_LED_CONTROL_EXT, "external" }, + { 0, NULL } +}; + static const struct value_string lc15_auto_adj_pwr_strs[] = { { LC15_TX_PWR_ADJ_NONE, "none" }, { LC15_TX_PWR_ADJ_AUTO, "auto" }, @@ -404,6 +410,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_led_mode, cfg_bts_led_mode_cmd, + "led-control-mode (bts|external)", + "Set LED controlled by BTS or external software\n" + "LED can be controlled by (bts, external)\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_led_mode_strs, argv[0]); + + if((val < LC15_LED_CONTROL_BTS) || (val > LC15_LED_CONTROL_EXT)) { + vty_out(vty, "Invalid LED control mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->led_ctrl_mode = (uint8_t)val; + return CMD_SUCCESS; +} + DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, "pwr-adj-mode (none|auto)", "Set output power adjustment mode\n") @@ -451,6 +475,9 @@ vty_out(vty, " pedestal-mode %s%s", get_value_string(lc15_pedestal_mode_strs, btsb->pedestal_mode) , VTY_NEWLINE); + + vty_out(vty, " led-control-mode %s%s", + get_value_string(lc15_led_mode_strs, btsb->led_ctrl_mode), VTY_NEWLINE); vty_out(vty, " pwr-adj-mode %s%s", get_value_string(lc15_auto_adj_pwr_strs, btsb->tx_pwr_adj_mode), VTY_NEWLINE); @@ -542,6 +569,7 @@ install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd); install_element(BTS_NODE, &cfg_bts_diversity_mode_cmd); install_element(BTS_NODE, &cfg_bts_pedestal_mode_cmd); + install_element(BTS_NODE, &cfg_bts_led_mode_cmd); install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index b2f0f77..b172c5c 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -74,6 +74,7 @@ btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); /* specific default values for LC15 platform */ btsb->max_cell_size = GSM_BTS_MAX_CELL_SIZE_DEFAULT; + btsb->led_ctrl_mode = GSM_BTS_LED_CTRL_MODE_DEFAULT; btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; -- To view, visit https://gerrit.osmocom.org/240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17639bfffa2429d70eb254427812260ec8802ef6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:17 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:17 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB... Message-ID: Review at https://gerrit.osmocom.org/241 LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB step Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 --- M include/osmo-bts/gsm_data.h M src/common/oml.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 5 files changed, 41 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/241/1 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 101cbfc..001dacb 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -117,6 +117,7 @@ uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ + uint8_t pwr_red_step; /* Tx power reduction steps in 1 dB or 2 dB */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ #endif diff --git a/src/common/oml.c b/src/common/oml.c index 86ec1bf..e7953c9 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -637,9 +637,20 @@ /* 9.4.47 RF Max Power Reduction */ if (TLVP_PRESENT(&tp, NM_ATT_RF_MAXPOWR_R)) { +#ifdef ENABLE_LC15BTS + struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); + if( btsb->pwr_red_step == 2) + trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R) * 2; + else + trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R); + + LOGP(DOML, LOGL_INFO, "Set RF Max Power Reduction=%d dB, step=%d dB\n", + trx->max_power_red, btsb->pwr_red_step); +#else trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R) * 2; - LOGP(DOML, LOGL_INFO, "Set RF Max Power Reduction = %d dBm\n", - trx->max_power_red); + LOGP(DOML, LOGL_INFO, "Set RF Max Power Reduction = %d dB\n", + trx->max_power_red); +#endif } /* 9.4.5 ARFCN List */ #if 0 diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index 4822893..cada00d 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -87,6 +87,7 @@ #define GSM_BTS_DIVERSITY_MODE_DEFAULT 2 /* MRC is default mode */ #define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ #define GSM_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */ +#define GSM_BTS_PWR_RED_STEP_DEFAULT 2 /* Default Tx power reduction step is 2 dB */ #define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ #define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 7762a57..1b2ff61 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -428,6 +428,26 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_pwr_red_step, cfg_bts_pwr_red_step_cmd, + "pwr-red-step <1-2>", + "Set the transmit output power reduction step in dB\n" + "Power reduction step in dB\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + uint8_t pwr_red_step = (uint8_t)atoi(argv[0]); + + if (( pwr_red_step > 2 ) || ( pwr_red_step < 1 )) { + vty_out(vty, "Tx power reduction step must be either 1 or 2 dB (%d) %s", + pwr_red_step, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->pwr_red_step = pwr_red_step; + + return CMD_SUCCESS; +} + DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, "pwr-adj-mode (none|auto)", "Set output power adjustment mode\n") @@ -484,6 +504,10 @@ vty_out(vty, " tx-red-pwr-8psk %d%s", btsb->tx_pwr_red_8psk, VTY_NEWLINE); + + vty_out(vty, " pwr-red-step %d%s", + btsb->pwr_red_step, VTY_NEWLINE); + } @@ -571,6 +595,7 @@ install_element(BTS_NODE, &cfg_bts_pedestal_mode_cmd); install_element(BTS_NODE, &cfg_bts_led_mode_cmd); install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); + install_element(BTS_NODE, &cfg_bts_pwr_red_step_cmd); install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index b172c5c..ce30021 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -77,6 +77,7 @@ btsb->led_ctrl_mode = GSM_BTS_LED_CTRL_MODE_DEFAULT; btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; + btsb->pwr_red_step = GSM_BTS_PWR_RED_STEP_DEFAULT; btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; btsb->tx_pwr_red_8psk = GSM_BTS_TX_RED_PWR_8PSK_DEFAULT; -- To view, visit https://gerrit.osmocom.org/241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:17 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:17 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Introduce TS 12.21 8.8.2 Abis/OML failure event report Message-ID: Review at https://gerrit.osmocom.org/242 LC15: Introduce TS 12.21 8.8.2 Abis/OML failure event report Change-Id: Id710f452c4e0eecbba855e87ab86a3087988e326 --- M include/osmo-bts/oml.h M include/osmo-bts/pcuif_proto.h M src/common/main.c M src/common/oml.c M src/common/pcu_sock.c 5 files changed, 135 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/242/1 diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index 9f49444..1182437 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -1,11 +1,38 @@ #ifndef _OML_H #define _OML_H +#include struct gsm_bts; struct gsm_abis_mo; struct msgb; struct gsm_lchan; +struct gsm_failure_evt_rep { + uint8_t event_type; + uint8_t event_serverity; + uint8_t cause_type; + uint16_t event_cause; + char *add_text; +}; + +/* FIXME: can move to libosmocore */ +enum abis_mm_event_causes { + /* Critical causes */ + NM_MM_EVT_CRIT_SW_FATAL = 0x0000, + NM_MM_EVT_CRIT_PROC_STOP = 0x0002, + NM_MM_EVT_CRIT_RTP_TOUT = 0x032c, + NM_MM_EVT_CRIT_BOOT_FAIL = 0x0401, + /* Major causes */ + NM_MM_EVT_MAJ_UKWN_MSG = 0x0002, + NM_MM_EVT_MAJ_RSL_FAIL = 0x0309, + NM_MM_EVT_MAJ_UNSUP_ATTR = 0x0318, + NM_MM_EVT_MAJ_NET_CONGEST = 0x032b, + /* Minor causes */ + NM_MM_EVT_MIN_PAG_TAB_FULL = 0x0401, + /* Warning causes */ + NM_MM_EVT_WARN_SW_WARN = 0x0001, + +}; int oml_init(void); int down_oml(struct gsm_bts *bts, struct msgb *msg); @@ -42,4 +69,7 @@ int oml_set_lchan_t200(struct gsm_lchan *lchan); extern const unsigned int oml_default_t200_ms[7]; +/* Transmit failure event report */ +int oml_tx_failure_event_rep(struct gsm_abis_mo *mo, struct gsm_failure_evt_rep failure_evt_rep); + #endif // _OML_H */ diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index 9d740ac..75e911b 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -14,6 +14,9 @@ #define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ #define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ +/*alarms & performance counters */ +#define PCU_IF_MSG_FAILURE_EVT_IND 0x67 /* PCU failure event report indication*/ + /* sapi */ #define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ #define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ @@ -131,6 +134,14 @@ uint8_t identity_lv[9]; } __attribute__ ((packed)); +struct gsm_pcu_if_fail_evt_ind { + uint8_t event_type; + uint8_t event_serverity; + uint8_t cause_type; + uint16_t event_cause; + char add_text[100]; +}__attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -147,6 +158,7 @@ struct gsm_pcu_if_act_req act_req; struct gsm_pcu_if_time_ind time_ind; struct gsm_pcu_if_pag_req pag_req; + struct gsm_pcu_if_fail_evt_ind failure_evt_ind; } u; } __attribute__ ((packed)); diff --git a/src/common/main.c b/src/common/main.c index d19c284..a0edbff 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -50,6 +50,7 @@ #include #include #include +#include int quit = 0; static const char *config_file = "osmo-bts.cfg"; @@ -176,18 +177,38 @@ static void signal_handler(int signal) { + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + fprintf(stderr, "signal %u received\n", signal); switch (signal) { case SIGINT: //osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); - if (!quit) + if (!quit) { + snprintf(log_msg, 100, "BTS: signal SIGINT received -> shutdown\n"); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_PROC_STOP; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&bts->mo, failure_rep); + bts_shutdown(bts, "SIGINT"); + } quit++; break; case SIGABRT: case SIGUSR1: case SIGUSR2: + snprintf(log_msg, 100, "BTS: signal %d received\n", signal); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_PROC_STOP; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&bts->mo, failure_rep); + talloc_report_full(tall_bts_ctx, stderr); break; default: diff --git a/src/common/oml.c b/src/common/oml.c index e7953c9..2277c37 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -41,6 +41,8 @@ #include #include #include +#include +#include /* FIXME: move this to libosmocore */ static struct tlv_definition abis_nm_att_tlvdef_ipa = { @@ -369,6 +371,38 @@ return oml_mo_send_msg(mo, nmsg, NM_MT_SW_ACTIVATED_REP); } +/* TS 12.21 8.8.2 */ +int oml_tx_failure_event_rep(struct gsm_abis_mo *mo, struct gsm_failure_evt_rep failure_evt_rep) +{ + struct msgb *nmsg; + uint8_t cause[3]; + int i, len; + + LOGP(DOML, LOGL_INFO, "%s Tx FAILure EVT REP\n", gsm_abis_mo_name(mo)); + + nmsg = oml_msgb_alloc(); + if (!nmsg) + return -ENOMEM; + + msgb_tv_put(nmsg, NM_ATT_EVENT_TYPE, failure_evt_rep.event_type); + msgb_tv_put(nmsg, NM_ATT_SEVERITY, failure_evt_rep.event_serverity); + + cause[0] = failure_evt_rep.cause_type; + for (i = 0; i < 2 ; i++) + cause[i + 1] = ((uint8_t*)&failure_evt_rep.event_cause)[1 - i]; + + msgb_tv_fixed_put(nmsg, NM_ATT_PROB_CAUSE, 3, cause); + + len = strlen(failure_evt_rep.add_text); + if(len){ + LOGP(DOML, LOGL_DEBUG, "%s Tx FAILure EVT REP Additional Text = %s (%d)\n", gsm_abis_mo_name(mo), failure_evt_rep.add_text, len); + msgb_tl16v_put(nmsg, NM_ATT_ADD_TEXT, len, failure_evt_rep.add_text); + } + + return oml_mo_send_msg(mo, nmsg, NM_MT_FAILURE_EVENT_REP); + +} + /* TS 12.21 9.4.53 */ enum abis_nm_t200_idx { T200_SDCCH = 0, diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 7c835fb..77186c0 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -40,6 +40,7 @@ #include #include #include +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -550,11 +551,35 @@ return 0; } +static int pcu_rx_failure_event_rep(struct gsm_bts *bts, struct gsm_pcu_if_fail_evt_ind *fail_ind) +{ + struct gsm_failure_evt_rep failure_rep; + int rc; + + LOGP(DPCU, LOGL_DEBUG, "[PCU] Failure EVT REP detailed: evt_type=%02x, evt_serv=%02x, cause_type=%02x, cause_id=%04x, text=%s\n", + fail_ind->event_type, + fail_ind->event_serverity, + fail_ind->cause_type, + fail_ind->event_cause, + fail_ind->add_text); + + failure_rep.event_type = fail_ind->event_type; + failure_rep.event_serverity = fail_ind->event_serverity; + failure_rep.cause_type = fail_ind->cause_type; + failure_rep.event_cause = fail_ind->event_cause; + failure_rep.add_text = &fail_ind->add_text[0]; + + rc = oml_tx_failure_event_rep(&bts->gprs.cell.mo, failure_rep); + return rc; +} + static int pcu_rx(struct gsm_network *net, uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { int rc = 0; struct gsm_bts *bts; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; /* FIXME: allow multiple BTS */ bts = llist_entry(net->bts_list.next, struct gsm_bts, list); @@ -567,9 +592,19 @@ case PCU_IF_MSG_ACT_REQ: rc = pcu_rx_act_req(bts, &pcu_prim->u.act_req); break; + case PCU_IF_MSG_FAILURE_EVT_IND: + rc = pcu_rx_failure_event_rep(bts, &pcu_prim->u.failure_evt_ind); + break; default: - LOGP(DPCU, LOGL_ERROR, "Received unknwon PCU msg type %d\n", - msg_type); + snprintf(log_msg, 100, "Received unknown PCU msg type %d\n", msg_type); + LOGP(DPCU, LOGL_ERROR,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&bts->mo, failure_rep); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id710f452c4e0eecbba855e87ab86a3087988e326 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:17 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:17 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Introduce DSP alive timer per TRX Message-ID: Review at https://gerrit.osmocom.org/243 LC15: Introduce DSP alive timer per TRX Change-Id: Ic075063a5b3294b72cc502a01e9616c296797238 --- M include/osmo-bts/gsm_data.h M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/l1_if.h M src/osmo-bts-litecell15/lc15bts.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 7 files changed, 125 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/243/1 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 001dacb..ef569f8 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -118,6 +118,7 @@ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ uint8_t pwr_red_step; /* Tx power reduction steps in 1 dB or 2 dB */ + uint8_t dsp_alive_period; /* DSP alive timer period */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ #endif diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0f10fcb..1faa00b 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -66,6 +66,7 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "utils.h" +#include "osmo-bts/oml.h" extern unsigned int dsp_trace; @@ -1398,6 +1399,73 @@ return 0; } +static void dsp_alive_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) +{ + Litecell15_Prim_t *sysp = msgb_sysprim(resp); + Litecell15_IsAliveCnf_t *sac = &sysp->u.IsAliveCnf; + struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(trx); + + fl1h->hw_alive.dsp_alive_cnt++; + fl1h->failure_rep_sent = 0; + LOGP(DL1C, LOGL_NOTICE, "Rx SYS prim %s, status=%d (%d)\n", + get_value_string(lc15bts_sysprim_names, sysp->id), sac->status, trx->nr); + + msgb_free(resp); +} + +static int dsp_alive_timer_cb(void *data) +{ + struct lc15l1_hdl *fl1h = data; + struct gsm_bts_trx *trx = fl1h->phy_inst->trx; + struct msgb *msg = sysp_msgb_alloc(); + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + + Litecell15_Prim_t *sys_prim = msgb_sysprim(msg); + sys_prim->id = Litecell15_PrimId_IsAliveReq; + + if (fl1h->hw_alive.dsp_alive_cnt == 0) { + + if(fl1h->failure_rep_sent) + exit(23); + + snprintf(log_msg, 100, "Timeout waiting for SYS prim %s primitive (%d)\n", + get_value_string(lc15bts_sysprim_names, sys_prim->id + 1), trx->nr); + + LOGP(DL1C, LOGL_ERROR,"%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + if(!rc) + fl1h->failure_rep_sent = 1; + } + } + + LOGP(DL1C, LOGL_NOTICE, "Tx SYS prim %s (%d)\n", + get_value_string(lc15bts_sysprim_names, sys_prim->id), trx->nr); + + rc = l1if_req_compl(fl1h, msg, dsp_alive_compl_cb, NULL); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id)); + return -EIO; + } + + /* restart timer */ + fl1h->hw_alive.dsp_alive_cnt = 0; + osmo_timer_schedule(&fl1h->hw_alive.dsp_alive_timer, fl1h->hw_alive.dsp_alive_period, 0); + + return 0; +} + int bts_model_phy_link_open(struct phy_link *plink) { struct phy_instance *pinst = phy_instance_by_num(plink, 0); @@ -1425,6 +1493,26 @@ phy_link_state_set(plink, PHY_LINK_CONNECTED); + /* Send first IS_ALIVE primitive */ + struct msgb *msg = sysp_msgb_alloc(); + int rc; + + Litecell15_Prim_t *sys_prim = msgb_sysprim(msg); + sys_prim->id = Litecell15_PrimId_IsAliveReq; + + rc = l1if_req_compl(fl1h, msg, dsp_alive_compl_cb, NULL); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id)); + return -EIO; + } + + /* initialize DSP heart beat alive timer */ + struct gsm_bts_role_bts *btsb = bts_role_bts(pinst->trx->bts); + fl1h->hw_alive.dsp_alive_timer.cb = dsp_alive_timer_cb; + fl1h->hw_alive.dsp_alive_timer.data = fl1h; + fl1h->hw_alive.dsp_alive_cnt = 0; + fl1h->hw_alive.dsp_alive_period = btsb->dsp_alive_period; + osmo_timer_schedule(&fl1h->hw_alive.dsp_alive_timer, fl1h->hw_alive.dsp_alive_period, 0); return 0; } diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h index 0c8843b..ad75ea6 100644 --- a/src/osmo-bts-litecell15/l1_if.h +++ b/src/osmo-bts-litecell15/l1_if.h @@ -59,6 +59,13 @@ struct calib_send_state st; uint8_t last_rf_mute[8]; + + struct { + struct osmo_timer_list dsp_alive_timer; + unsigned int dsp_alive_cnt; + uint8_t dsp_alive_period; + } hw_alive; + uint8_t failure_rep_sent; /* Flag to indicate the failure report has already sent to network before stop BTS itself*/ }; #define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h) diff --git a/src/osmo-bts-litecell15/lc15bts.c b/src/osmo-bts-litecell15/lc15bts.c index 172a7e4..6ce82e3 100644 --- a/src/osmo-bts-litecell15/lc15bts.c +++ b/src/osmo-bts-litecell15/lc15bts.c @@ -121,6 +121,8 @@ case Litecell15_PrimId_MuteRfCnf: return L1P_T_CONF; case Litecell15_PrimId_SetRxAttenReq: return L1P_T_REQ; case Litecell15_PrimId_SetRxAttenCnf: return L1P_T_CONF; + case Litecell15_PrimId_IsAliveReq: return L1P_T_REQ; + case Litecell15_PrimId_IsAliveCnf: return L1P_T_CONF; default: return L1P_T_INVALID; } } @@ -142,6 +144,8 @@ { Litecell15_PrimId_MuteRfCnf, "MUTE-RF.cnf" }, { Litecell15_PrimId_SetRxAttenReq, "SET-RX-ATTEN.req" }, { Litecell15_PrimId_SetRxAttenCnf, "SET-RX-ATTEN-CNF.cnf" }, + { Litecell15_PrimId_IsAliveReq, "IS-ALIVE.req" }, + { Litecell15_PrimId_IsAliveCnf, "IS-ALIVE-CNF.cnf" }, { 0, NULL } }; @@ -155,6 +159,7 @@ case Litecell15_PrimId_SetCalibTblReq: return Litecell15_PrimId_SetCalibTblCnf; case Litecell15_PrimId_MuteRfReq: return Litecell15_PrimId_MuteRfCnf; case Litecell15_PrimId_SetRxAttenReq: return Litecell15_PrimId_SetRxAttenCnf; + case Litecell15_PrimId_IsAliveReq: return Litecell15_PrimId_IsAliveCnf; default: return -1; // Weak } } diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index cada00d..a00c48f 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -88,6 +88,7 @@ #define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ #define GSM_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */ #define GSM_BTS_PWR_RED_STEP_DEFAULT 2 /* Default Tx power reduction step is 2 dB */ +#define GSM_BTS_DSP_ALIVE_TMR_DEFAULT 5 /* Default DSP alive timer is 5 seconds */ #define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ #define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 1b2ff61..4150504 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -448,6 +448,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_dsp_alive_timer, cfg_bts_dsp_alive_timer_cmd, + "dsp-alive-period <0-60>", + "Set DSP alive timer period in second\n") +{ + struct gsm_bts *bts = vty->index;; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + uint8_t period = (uint8_t)atoi(argv[0]); + + if (( period > 60 ) || ( period < 0 )) { + vty_out(vty, "DSP heart beat alive timer period must be between 0 and 60 seconds (%d) %s", + period, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->dsp_alive_period = period; + return CMD_SUCCESS; +} + DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, "pwr-adj-mode (none|auto)", "Set output power adjustment mode\n") @@ -498,6 +516,9 @@ vty_out(vty, " led-control-mode %s%s", get_value_string(lc15_led_mode_strs, btsb->led_ctrl_mode), VTY_NEWLINE); + + vty_out(vty, " dsp-alive-period %d%s", + btsb->dsp_alive_period, VTY_NEWLINE); vty_out(vty, " pwr-adj-mode %s%s", get_value_string(lc15_auto_adj_pwr_strs, btsb->tx_pwr_adj_mode), VTY_NEWLINE); @@ -596,6 +617,7 @@ install_element(BTS_NODE, &cfg_bts_led_mode_cmd); install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); install_element(BTS_NODE, &cfg_bts_pwr_red_step_cmd); + install_element(BTS_NODE, &cfg_bts_dsp_alive_timer_cmd); install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ce30021..6a2509b 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -78,6 +78,7 @@ btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; btsb->pwr_red_step = GSM_BTS_PWR_RED_STEP_DEFAULT; + btsb->dsp_alive_period = GSM_BTS_DSP_ALIVE_TMR_DEFAULT; btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; btsb->tx_pwr_red_8psk = GSM_BTS_TX_RED_PWR_8PSK_DEFAULT; -- To view, visit https://gerrit.osmocom.org/243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic075063a5b3294b72cc502a01e9616c296797238 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:17 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:17 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - DSP L1 is no long... Message-ID: Review at https://gerrit.osmocom.org/244 LC15: osmo-bts-litecell15/l1_if.c: Alarm - DSP L1 is no longer sending primitives Change-Id: Ic19e21c31a8f95c5e15c91cd886788ec4e83ec13 --- M src/osmo-bts-litecell15/oml.c 1 file changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/244/1 diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 7aedee1..d4a8c75 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -782,10 +782,32 @@ static void alive_timer_cb(void *data) { struct lc15l1_hdl *fl1h = data; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + int rc; if (fl1h->alive_prim_cnt == 0) { - LOGP(DL1C, LOGL_FATAL, "DSP L1 is no longer sending primitives!\n"); - exit(23); + + if(fl1h->failure_rep_sent) + exit(23); + + snprintf(log_msg, 100, "DSP L1 is no longer sending primitives!\n"); + LOGP(DL1C, LOGL_FATAL,"%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + if(!rc) + fl1h->failure_rep_sent = 1; + } + } fl1h->alive_prim_cnt = 0; osmo_timer_schedule(&fl1h->alive_timer, 5, 0); -- To view, visit https://gerrit.osmocom.org/244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic19e21c31a8f95c5e15c91cd886788ec4e83ec13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:18 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:18 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/oml.c: Alarm - Timeout waiting for... Message-ID: Review at https://gerrit.osmocom.org/245 LC15: osmo-bts-litecell15/oml.c: Alarm - Timeout waiting for primitives Change-Id: If35dc4c0d3c04d328d0d8f85d5cfa4038afe723b --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 38 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/245/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 1faa00b..8193030 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -75,6 +75,7 @@ struct osmo_timer_list timer; /* timer for L1 timeout */ unsigned int conf_prim_id; /* primitive we expect in response */ unsigned int is_sys_prim; /* is this a system (1) or L1 (0) primitive */ + struct lc15l1_hdl *fl1h; l1if_compl_cb *cb; void *cb_data; }; @@ -88,14 +89,43 @@ static void l1if_req_timeout(void *data) { struct wait_l1_conf *wlc = data; + struct lc15l1_hdl *fl1h = wlc->fl1h; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + int rc; - if (wlc->is_sys_prim) - LOGP(DL1C, LOGL_FATAL, "Timeout waiting for SYS primitive %s\n", - get_value_string(lc15bts_sysprim_names, wlc->conf_prim_id)); - else - LOGP(DL1C, LOGL_FATAL, "Timeout waiting for L1 primitive %s\n", - get_value_string(lc15bts_l1prim_names, wlc->conf_prim_id)); - exit(23); + if(fl1h->failure_rep_sent) + exit(23); + + if (wlc->is_sys_prim) { + snprintf(log_msg, 100, "Timeout waiting for SYS primitive %s\n", + get_value_string(lc15bts_sysprim_names, wlc->conf_prim_id)); + + } else { + snprintf(log_msg, 100, "Timeout waiting for L1 primitive %s\n", + get_value_string(lc15bts_l1prim_names, wlc->conf_prim_id)); + } + + LOGP(DL1C, LOGL_FATAL, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + + if(!rc) + fl1h->failure_rep_sent = 1; + + } + + osmo_timer_schedule(&wlc->timer, 1, 0); + } static int _l1if_req_compl(struct lc15l1_hdl *fl1h, struct msgb *msg, @@ -155,6 +185,7 @@ llist_add(&wlc->list, &fl1h->wlc_list); /* schedule a timer for timeout_secs seconds. If DSP fails to respond, we terminate */ + wlc->fl1h = fl1h; wlc->timer.data = wlc; wlc->timer.cb = l1if_req_timeout; osmo_timer_schedule(&wlc->timer, timeout_secs, 0); -- To view, visit https://gerrit.osmocom.org/245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If35dc4c0d3c04d328d0d8f85d5cfa4038afe723b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:18 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:18 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - Unknown MPH-INFO.req Message-ID: Review at https://gerrit.osmocom.org/246 LC15: osmo-bts-litecell15/l1_if.c: Alarm - Unknown MPH-INFO.req Change-Id: Iff984987ac0db06825afccfcb982d33f53c70a04 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/246/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 8193030..d60ea57 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -492,6 +492,8 @@ uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: @@ -532,8 +534,15 @@ msgb_free(msg); break; default: - LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", - l1sap->u.info.type); + snprintf(log_msg, 100, "unknown MPH-INFO.req %d\n", l1sap->u.info.type); + LOGP(DL1C, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&trx->mo, failure_rep); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff984987ac0db06825afccfcb982d33f53c70a04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:18 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:18 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c : Alarm - Unknown l1sap do... Message-ID: Review at https://gerrit.osmocom.org/247 LC15: osmo-bts-litecell15/l1_if.c : Alarm - Unknown l1sap downlink operation Change-Id: Ia31720a495fb460a6449d89e02a29ef18503b885 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/247/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d60ea57..6f06ede 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -554,6 +554,8 @@ { struct msgb *msg = l1sap->oph.msg; int rc = 0; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; switch (OSMO_PRIM_HDR(&l1sap->oph)) { case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): @@ -566,8 +568,16 @@ rc = mph_info_req(trx, msg, l1sap); break; default: - LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", - l1sap->oph.primitive, l1sap->oph.operation); + snprintf(log_msg, 100, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + LOGP(DL1C, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&trx->mo, failure_rep); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia31720a495fb460a6449d89e02a29ef18503b885 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:18 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:18 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to op... Message-ID: Review at https://gerrit.osmocom.org/248 LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to open calibration data file Change-Id: If2829d68531494f0ede8f9dd2fe19ea99c63ea99 --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/248/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 3bc788c..1b60d3e 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -41,6 +41,7 @@ #include "l1_if.h" #include "lc15bts.h" #include "utils.h" +#include "osmo-bts/oml.h" /** * * Maximum calibration data chunk size @@ -137,7 +138,9 @@ { struct calib_send_state *st = &fl1h->st; char *calib_path = fl1h->phy_inst->u.lc15.calib_path; - char fname[PATH_MAX]; + char fname[PATH_MAX]; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; if (st->fp) { LOGP(DL1C, LOGL_NOTICE, "L1 calibration file was left opened !!\n"); @@ -151,9 +154,21 @@ st->fp = fopen(fname, "rb"); if (!st->fp) { - LOGP(DL1C, LOGL_ERROR, - "Failed to open '%s' for calibration data.\n", fname); - return -1; + snprintf(log_msg, 100, "Failed to open '%s' for calibration data.\n", fname); + LOGP(DL1C, LOGL_ERROR, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_BOOT_FAIL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + } + return -1; } return 0; } -- To view, visit https://gerrit.osmocom.org/248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2829d68531494f0ede8f9dd2fe19ea99c63ea99 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:18 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:18 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to ve... Message-ID: Review at https://gerrit.osmocom.org/249 LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to verify calibration data file Change-Id: I0472ca8024124a9123eef1a2a93742cf15e1371f --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/49/249/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 1b60d3e..87b9764 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -252,7 +252,24 @@ rc = calib_verify(fl1h, desc); if ( rc < 0 ) { - LOGP(DL1C, LOGL_ERROR, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + + snprintf(log_msg, 100, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + LOGP(DL1C, LOGL_ERROR, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_BOOT_FAIL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + } + st->last_file_idx = get_next_calib_file_idx(fl1h, st->last_file_idx); if (st->last_file_idx >= 0) -- To view, visit https://gerrit.osmocom.org/249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0472ca8024124a9123eef1a2a93742cf15e1371f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:18 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:18 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Calibration ... Message-ID: Review at https://gerrit.osmocom.org/250 LC15: osmo-bts-litecell15/calib_file.c: Alarm - Calibration file path not specified Change-Id: Iff46e7ed6093cf77b95758a866a58991cd807bfa --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/250/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 87b9764..857e6d0 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -321,11 +321,26 @@ int rc; struct calib_send_state *st = &fl1h->st; char *calib_path = fl1h->phy_inst->u.lc15.calib_path; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; - if (!calib_path) { - LOGP(DL1C, LOGL_ERROR, "Calibration file path not specified\n"); - return -1; - } + if (!calib_path) { + snprintf(log_msg, 100, "Calibration file path not specified\n"); + LOGP(DL1C, LOGL_ERROR, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = 0x0401; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + } + return -1; + } rc = get_next_calib_file_idx(fl1h, -1); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff46e7ed6093cf77b95758a866a58991cd807bfa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/bts.c : Alarm - Failed to establish RSL link an... Message-ID: Review at https://gerrit.osmocom.org/251 LC15: common/bts.c : Alarm - Failed to establish RSL link and deactivate RF Change-Id: I8adac2c9dd1570feec14b3e66f8b05c4274cf127 --- M src/common/bts.c 1 file changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/251/1 diff --git a/src/common/bts.c b/src/common/bts.c index 6f621c4..69692b9 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -44,6 +44,7 @@ #include #include #include +#include "osmo-bts/oml.h" #define MIN_QUAL_RACH 5.0f /* at least 5 dB C/I */ #define MIN_QUAL_NORM -0.5f /* at least -1 dB C/I */ @@ -250,6 +251,9 @@ int trx_link_estab(struct gsm_bts_trx *trx) { struct e1inp_sign_link *link = trx->rsl_link; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; uint8_t radio_state = link ? NM_OPSTATE_ENABLED : NM_OPSTATE_DISABLED; LOGP(DSUM, LOGL_INFO, "RSL link (TRX %02x) state changed to %s, sending Status'.\n", @@ -258,11 +262,26 @@ oml_mo_state_chg(&trx->mo, radio_state, NM_AVSTATE_OK); if (link) - rsl_tx_rf_res(trx); + rc = rsl_tx_rf_res(trx); else - bts_model_trx_deact_rf(trx); + rc = bts_model_trx_deact_rf(trx); - return 0; + if(rc < 0) { + if(link) + snprintf(log_msg, 100, "Failed to establish RSL link (%d)\n", rc); + else + snprintf(log_msg, 100, "Failed to deactivate RF (%d)\n", rc); + + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_RSL_FAIL; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + + return rc; } /* set the availability of the TRX (used by PHY driver) */ -- To view, visit https://gerrit.osmocom.org/251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8adac2c9dd1570feec14b3e66f8b05c4274cf127 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c: Alarm - Unsupported BTS attributes Message-ID: Review at https://gerrit.osmocom.org/252 LC15: common/oml.c: Alarm - Unsupported BTS attributes Change-Id: I1a515a8fca128b924c82d8a88eb5d420e14b3604 --- M src/common/oml.c 1 file changed, 34 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/252/1 diff --git a/src/common/oml.c b/src/common/oml.c index 2277c37..ccafc66 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -495,24 +495,56 @@ struct gsm_bts_role_bts *btsb = bts_role_bts(bts); int rc, i; const uint8_t *payload; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx SET BTS ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&bts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* Test for globally unsupported stuff here */ if (TLVP_PRESENT(&tp, NM_ATT_BCCH_ARFCN)) { uint16_t arfcn = ntohs(tlvp_val16_unal(&tp, NM_ATT_BCCH_ARFCN)); if (arfcn > 1024) { - LOGP(DOML, LOGL_NOTICE, "Given ARFCN %d is not supported.\n", arfcn); + snprintf(log_msg, 100, "Given ARFCN %d is not supported.\n", + arfcn); + + LOGP(DOML, LOGL_NOTICE, "%s", log_msg); + + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_WARNING; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_WARN_SW_WARN; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&bts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); } } /* 9.4.52 Starting Time */ if (TLVP_PRESENT(&tp, NM_ATT_START_TIME)) { + snprintf(log_msg, 100, "NM_ATT_START_TIME Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&bts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP); } -- To view, visit https://gerrit.osmocom.org/252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a515a8fca128b924c82d8a88eb5d420e14b3604 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c: Alarm - Unsupported radio attributes Message-ID: Review at https://gerrit.osmocom.org/253 LC15: common/oml.c: Alarm - Unsupported radio attributes Change-Id: I209ea1ca0b54fb36189ca1154134344f57c1898c --- M src/common/oml.c 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/253/1 diff --git a/src/common/oml.c b/src/common/oml.c index ccafc66..cc87ec4 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -676,13 +676,25 @@ struct abis_om_fom_hdr *foh = msgb_l3(msg); struct tlv_parsed tp, *tp_merged; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx SET RADIO CARRIER ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for Set Radio Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&trx->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* merge existing BTS attributes with new attributes */ tp_merged = tlvp_copy(trx->mo.nm_attr, trx->bts); -- To view, visit https://gerrit.osmocom.org/253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I209ea1ca0b54fb36189ca1154134344f57c1898c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported channel attributes Message-ID: Review at https://gerrit.osmocom.org/254 LC15: common/oml.c : Alarm - Unsupported channel attributes Change-Id: I52fd6f3edb0e7eb88c6ea97454696fa84e322cf9 --- M src/common/oml.c 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/254/1 diff --git a/src/common/oml.c b/src/common/oml.c index cc87ec4..b32231b 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -838,13 +838,24 @@ struct gsm_bts *bts = ts->trx->bts; struct tlv_parsed tp, *tp_merged; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx SET CHAN ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for Set Channel Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&ts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* 9.4.21 HSN... */ /* 9.4.27 MAIO */ -- To view, visit https://gerrit.osmocom.org/254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52fd6f3edb0e7eb88c6ea97454696fa84e322cf9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Formatted O&M message too short Message-ID: Review at https://gerrit.osmocom.org/255 LC15: common/oml.c : Alarm - Formatted O&M message too short Change-Id: I697c7e14efb2ebdbf789b2e0db13c43521791d85 --- M src/common/oml.c 1 file changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/255/1 diff --git a/src/common/oml.c b/src/common/oml.c index b32231b..b5394dc 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -981,9 +981,27 @@ struct abis_om_fom_hdr *foh = msgb_l3(msg); struct gsm_bts_trx *trx; int ret; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; if (msgb_l2len(msg) < sizeof(*foh)) { - LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too short\n"); + snprintf(log_msg, 100, "Formatted O&M message too short\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + return -EIO; } -- To view, visit https://gerrit.osmocom.org/255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I697c7e14efb2ebdbf789b2e0db13c43521791d85 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Formatted O&M with BTS number i... Message-ID: Review at https://gerrit.osmocom.org/256 LC15: common/oml.c : Alarm - Formatted O&M with BTS number is out of range Change-Id: I15a227a60c75b8a91005b18afb6256f34d6b71b4 --- M src/common/oml.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/256/1 diff --git a/src/common/oml.c b/src/common/oml.c index b5394dc..c840f11 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1006,7 +1006,23 @@ } if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + snprintf(log_msg, 100, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + LOGP(DOML, LOGL_INFO,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx){ + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); } -- To view, visit https://gerrit.osmocom.org/256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I15a227a60c75b8a91005b18afb6256f34d6b71b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Unknown formatted O&M message type Message-ID: Review at https://gerrit.osmocom.org/257 LC15: common/oml.c : Alarm - Unknown formatted O&M message type Change-Id: I6b700c58b3780d401968610965f07b63872b578c --- M src/common/oml.c 1 file changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/257/1 diff --git a/src/common/oml.c b/src/common/oml.c index c840f11..a93f5b9 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1054,8 +1054,25 @@ ret = oml_ipa_set_attr(bts, msg); break; default: - LOGP(DOML, LOGL_INFO, "unknown Formatted O&M msg_type 0x%02x\n", - foh->msg_type); + snprintf(log_msg, 100, "unknown Formatted O&M msg_type 0x%02x\n", foh->msg_type); + LOGP(DOML, LOGL_INFO,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } else { + oml_tx_failure_event_rep(&bts->mo, failure_rep); + } + ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL); } -- To view, visit https://gerrit.osmocom.org/257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b700c58b3780d401968610965f07b63872b578c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:19 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:19 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported IPA set attributes Message-ID: Review at https://gerrit.osmocom.org/258 LC15: common/oml.c : Alarm - Unsupported IPA set attributes Change-Id: I78f2f846132f9996bb4008643f1a666e366d2f85 --- M src/common/oml.c 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/258/1 diff --git a/src/common/oml.c b/src/common/oml.c index a93f5b9..6b42b16 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1236,13 +1236,26 @@ struct tlv_parsed tp; void *obj; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx IPA SET ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for IPAC Set Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + oml_tx_failure_event_rep(mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* Resolve MO by obj_class/obj_inst */ mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); -- To view, visit https://gerrit.osmocom.org/258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78f2f846132f9996bb4008643f1a666e366d2f85 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:20 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:20 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/l1sap.c : Alarm - Unknown uplink L1SAP primitive Message-ID: Review at https://gerrit.osmocom.org/259 LC15: common/l1sap.c : Alarm - Unknown uplink L1SAP primitive Change-Id: I4943eabecb971f7cfece24c35b0e9e0e660f31a0 --- M src/common/l1sap.c 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/59/259/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 77fd1a0..78e15e7 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -46,6 +46,7 @@ #include #include #include +#include "osmo-bts/oml.h" static struct gsm_lchan * get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -933,6 +934,8 @@ { struct msgb *msg = l1sap->oph.msg; int rc = 0; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; switch (OSMO_PRIM_HDR(&l1sap->oph)) { case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_INDICATION): @@ -959,8 +962,16 @@ rc = l1sap_ph_rach_ind(trx, l1sap, &l1sap->u.rach_ind); break; default: - LOGP(DL1P, LOGL_NOTICE, "unknown prim %d op %d\n", - l1sap->oph.primitive, l1sap->oph.operation); + snprintf(log_msg, 100, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + LOGP(DL1P, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&trx->mo, failure_rep); break; } -- To view, visit https://gerrit.osmocom.org/259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4943eabecb971f7cfece24c35b0e9e0e660f31a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:20 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:20 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Introduce measurement management messages, TS 12.21 se... Message-ID: Review at https://gerrit.osmocom.org/260 LC15: Introduce measurement management messages, TS 12.21 section 8.10 Change-Id: Ic930baa69fc09ad5059627ed3d85cce5474085b0 --- M include/osmo-bts/oml.h M include/osmo-bts/pcu_if.h M include/osmo-bts/pcuif_proto.h M src/common/oml.c M src/common/pcu_sock.c 5 files changed, 455 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/260/1 diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index 1182437..77ba751 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -16,6 +16,14 @@ }; /* FIXME: can move to libosmocore */ +enum abis_nm_msgtype_ipacc_appended { + NM_MT_IPACC_START_MEAS_ACK = 0xde, + NM_MT_IPACC_MEAS_RES_REQ_NACK = 0xfc, + NM_MT_IPACC_START_MEAS_NACK = 0xfd, + NM_MT_IPACC_STOP_MEAS_ACK = 0xdf, + NM_MT_IPACC_STOP_MEAS_NACK = 0xfe, +}; + enum abis_mm_event_causes { /* Critical causes */ NM_MM_EVT_CRIT_SW_FATAL = 0x0000, @@ -72,4 +80,11 @@ /* Transmit failure event report */ int oml_tx_failure_event_rep(struct gsm_abis_mo *mo, struct gsm_failure_evt_rep failure_evt_rep); +/* Transmit start/stop/request measurement messages*/ +int oml_tx_mm_start_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause); +int oml_tx_mm_meas_res_req_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause); +int oml_tx_mm_meas_res_resp(struct gsm_abis_mo *mo, struct gsm_pcu_if_meas_resp meas_resp); +int oml_tx_mm_stop_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause); + + #endif // _OML_H */ diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 0c4fb69..ea00493 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -19,4 +19,8 @@ int pcu_sock_init(const char *path); void pcu_sock_exit(void); +int pcu_tx_mm_start_meas(struct gsm_bts *bts, uint8_t meas_id); +int pcu_tx_mm_meas_res_req(struct gsm_bts *bts, uint8_t meas_id); +int pcu_tx_mm_stop_meas(struct gsm_bts *bts, uint8_t meas_id); + #endif /* _PCU_IF_H */ diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index 75e911b..14cb770 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -1,5 +1,6 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H +#include #define PCU_IF_VERSION 0x05 @@ -15,7 +16,17 @@ #define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ /*alarms & performance counters */ +#define PCU_IF_MSG_START_MEAS_REQ 0x61 /* PCU start measurement request */ +#define PCU_IF_MSG_START_MEAS_ACK 0x62 /* PCU start measurement ACK */ +#define PCU_IF_MSG_START_MEAS_NACK 0x63 /* PCU start measurement NACK */ +#define PCU_IF_MSG_MEAS_RES_REQ 0x64 /* PCU measurement result request*/ +#define PCU_IF_MSG_MEAS_RES_RESP 0x65 /* PCU measurement result response*/ +#define PCU_IF_MSG_MEAS_RES_NACK 0x66 /* PCU measurement result NACK*/ #define PCU_IF_MSG_FAILURE_EVT_IND 0x67 /* PCU failure event report indication*/ +#define PCU_IF_MSG_STOP_MEAS_REQ 0x68 /* PCU stop measurement request */ +#define PCU_IF_MSG_STOP_MEAS_ACK 0x69 /* PCU stop measurement ACK */ +#define PCU_IF_MSG_STOP_MEAS_NACK 0x6a /* PCU stop measurement NACK */ + /* sapi */ #define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ @@ -142,6 +153,24 @@ char add_text[100]; }__attribute__ ((packed)); +struct gsm_pcu_if_start_meas_req { + uint8_t meas_id; /*measurement ID */ + uint8_t nack_cause; + uint8_t spare[2]; +}__attribute__ ((packed)); + +struct gsm_pcu_if_meas_req { + uint8_t meas_id; /*measurement ID */ + uint8_t spare[2]; +}__attribute__ ((packed)); + +struct gsm_pcu_if_meas_resp { + uint8_t meas_id; /*measurement ID */ + uint8_t nack_cause; /*NACK cause */ + uint16_t len; /*total result length */ + uint8_t data[100]; /*PM counter result must be started from here */ +}__attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -159,6 +188,10 @@ struct gsm_pcu_if_time_ind time_ind; struct gsm_pcu_if_pag_req pag_req; struct gsm_pcu_if_fail_evt_ind failure_evt_ind; + struct gsm_pcu_if_start_meas_req start_meas_req; + struct gsm_pcu_if_start_meas_req stop_meas_req; + struct gsm_pcu_if_meas_req meas_req; + struct gsm_pcu_if_meas_resp meas_resp; } u; } __attribute__ ((packed)); diff --git a/src/common/oml.c b/src/common/oml.c index 6b42b16..f7f2444 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -90,6 +90,9 @@ [NM_ATT_IPACC_SEC_POSSIBLE] = { TLV_TYPE_TL16V }, [NM_ATT_IPACC_IML_SSL_STATE] = { TLV_TYPE_TL16V }, [NM_ATT_IPACC_REVOC_DATE] = { TLV_TYPE_TL16V }, + /* GSM 12.21 attributes */ + [NM_ATT_MEAS_TYPE] = { TLV_TYPE_TV }, + [NM_ATT_MEAS_RES] = { TLV_TYPE_TV }, }, }; @@ -401,6 +404,81 @@ return oml_mo_send_msg(mo, nmsg, NM_MT_FAILURE_EVENT_REP); +} + +/* TS 12.21 8.10.2 */ +int oml_tx_mm_meas_res_resp(struct gsm_abis_mo *mo, struct gsm_pcu_if_meas_resp meas_resp) +{ + struct msgb *nmsg; + + LOGP(DOML, LOGL_INFO, "%s Tx MEASurement RESult RESPonse\n", gsm_abis_mo_name(mo)); + + nmsg = oml_msgb_alloc(); + if (!nmsg) + return -ENOMEM; + + msgb_tv_put(nmsg, NM_ATT_MEAS_TYPE, meas_resp.meas_id); + msgb_tl16v_put(nmsg, NM_ATT_MEAS_RES, meas_resp.len, meas_resp.data); + + return oml_mo_send_msg(mo, nmsg, NM_MT_MEAS_RES_RESP); +} + +int oml_tx_mm_start_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause) +{ + struct msgb *msg; + uint8_t msg_type; + + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + + if (nack_cause) { + msg_type = NM_MT_IPACC_START_MEAS_NACK; + msgb_tv_put(msg, NM_ATT_NACK_CAUSES, nack_cause); + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } else { + msg_type = NM_MT_IPACC_START_MEAS_ACK; + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } + + return oml_mo_send_msg(mo, msg, msg_type); +} + +int oml_tx_mm_stop_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause) +{ + struct msgb *msg; + uint8_t msg_type; + + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + + if (nack_cause) { + msg_type = NM_MT_IPACC_STOP_MEAS_NACK; + msgb_tv_put(msg, NM_ATT_NACK_CAUSES, nack_cause); + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } else { + msg_type = NM_MT_IPACC_STOP_MEAS_ACK; + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } + + return oml_mo_send_msg(mo, msg, msg_type); +} + +int oml_tx_mm_meas_res_req_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause) +{ + struct msgb *msg; + uint8_t msg_type; + + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + + msg_type = NM_MT_IPACC_MEAS_RES_REQ_NACK; + msgb_tv_put(msg, NM_ATT_NACK_CAUSES, nack_cause); + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + + return oml_mo_send_msg(mo, msg, msg_type); } /* TS 12.21 9.4.53 */ @@ -976,6 +1054,197 @@ return bts_model_chg_adm_state(bts, mo, obj, adm_state); } +/* GSM 12.21 section 8.10.1 */ +static int oml_rx_mm_meas_res_req(struct gsm_bts *bts, struct msgb *msg) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + struct gsm_abis_mo *mo = &bts->gprs.cell.mo; + struct tlv_parsed tp; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + uint8_t meas_id; + + LOGP(DOML, LOGL_DEBUG, "%s Rx MEAS RES REQ\n", gsm_abis_mo_name(mo)); + + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + if (!TLVP_PRESENT(&tp, NM_ATT_MEAS_TYPE)) { + snprintf(log_msg, 100, "%s NM_ATT_MEAS_TYPE not found\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + /* Get measurement ID */ + meas_id = *TLVP_VAL(&tp, NM_ATT_MEAS_TYPE); + + /* send request to PCU */ + rc = pcu_tx_mm_meas_res_req(bts, meas_id); + if (rc < 0) { + snprintf(log_msg, 100, "%s PCU socket may not be ready for measurement ID (%d)\n", gsm_abis_mo_name(mo), meas_id); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_NET_CONGEST; + failure_rep.add_text = (char *)&log_msg; + + /*send alarm to indicate PCU link is not ready */ + oml_tx_failure_event_rep(mo, failure_rep); + + /*send MEAS RES REQ NACK */ + return oml_tx_mm_meas_res_req_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); + } + + return 0; +} + +/* GSM 12.21 section 8.10.3 */ +static int oml_rx_mm_start_meas(struct gsm_bts *bts, struct msgb *msg) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + struct gsm_abis_mo *mo = &bts->gprs.cell.mo; + struct tlv_parsed tp; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + uint8_t meas_id; + + LOGP(DOML, LOGL_DEBUG, "%s Rx START MEAS\n", gsm_abis_mo_name(mo)); + + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + if (!TLVP_PRESENT(&tp, NM_ATT_MEAS_TYPE)) { + snprintf(log_msg, 100, "%s PCU socket may not be ready for measurement ID (%d)\n", gsm_abis_mo_name(mo), meas_id); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + /* Get measurement ID */ + meas_id = *TLVP_VAL(&tp, NM_ATT_MEAS_TYPE); + + /* send request to PCU */ + rc = pcu_tx_mm_start_meas(bts, meas_id); + if (rc < 0) { + snprintf(log_msg, 100, "%s PCU socket may not be ready\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_NET_CONGEST; + failure_rep.add_text = (char *)&log_msg; + + /*send alarm to indicate PCU link is not ready */ + oml_tx_failure_event_rep(mo, failure_rep); + + /*send START MEAS NACK */ + return oml_tx_mm_start_meas_ack_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); + } + + return 0; +} + +static int oml_rx_mm_stop_meas(struct gsm_bts *bts, struct msgb *msg) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + struct gsm_abis_mo *mo = &bts->gprs.cell.mo; + struct tlv_parsed tp; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + uint8_t meas_id; + + LOGP(DOML, LOGL_DEBUG, "%s Rx STOP MEAS\n", gsm_abis_mo_name(mo)); + + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + if (!TLVP_PRESENT(&tp, NM_ATT_MEAS_TYPE)) { + snprintf(log_msg, 100, "%s PCU socket may not be ready for measurement ID (%d)\n", gsm_abis_mo_name(mo), meas_id); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + /* Get measurement ID */ + meas_id = *TLVP_VAL(&tp, NM_ATT_MEAS_TYPE); + + /* send request to PCU */ + rc = pcu_tx_mm_stop_meas(bts, meas_id); + if (rc < 0) { + snprintf(log_msg, 100, "%s PCU socket may not be ready\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_NET_CONGEST; + failure_rep.add_text = (char *)&log_msg; + + /*send alarm to indicate PCU link is not ready */ + oml_tx_failure_event_rep(mo, failure_rep); + + /*send STOP MEAS NACK */ + return oml_tx_mm_stop_meas_ack_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); + } + + return 0; +} + static int down_fom(struct gsm_bts *bts, struct msgb *msg) { struct abis_om_fom_hdr *foh = msgb_l3(msg); @@ -1053,6 +1322,15 @@ case NM_MT_IPACC_SET_ATTR: ret = oml_ipa_set_attr(bts, msg); break; + case NM_MT_START_MEAS: + ret = oml_rx_mm_start_meas(bts, msg); + break; + case NM_MT_MEAS_RES_REQ: + ret = oml_rx_mm_meas_res_req(bts, msg); + break; + case NM_MT_STOP_MEAS: + ret = oml_rx_mm_stop_meas(bts, msg); + break; default: snprintf(log_msg, 100, "unknown Formatted O&M msg_type 0x%02x\n", foh->msg_type); LOGP(DOML, LOGL_INFO,"%s", log_msg); diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 77186c0..bff65c6 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -449,6 +449,64 @@ return pcu_sock_send(&bts_gsmnet, msg); } +int pcu_tx_mm_start_meas(struct gsm_bts *bts, uint8_t meas_id) +{ + struct gsm_pcu_if *pcu_prim; + struct gsm_pcu_if_start_meas_req *start_meas_req; + struct msgb *msg; + + msg = pcu_msgb_alloc(PCU_IF_MSG_START_MEAS_REQ, bts->nr); + if (!msg) + return -ENOMEM; + + pcu_prim = (struct gsm_pcu_if *) msg->data; + start_meas_req = &pcu_prim->u.start_meas_req; + start_meas_req->meas_id = meas_id; + + LOGP(DPCU, LOGL_INFO, "[BTS->PCU] Sent STAT MEASurement REQuest: 0x%02x\n", start_meas_req->meas_id); + + return pcu_sock_send(&bts_gsmnet, msg); +} + +int pcu_tx_mm_stop_meas(struct gsm_bts *bts, uint8_t meas_id) +{ + struct gsm_pcu_if *pcu_prim; + struct gsm_pcu_if_start_meas_req *stop_meas_req; + struct msgb *msg; + + msg = pcu_msgb_alloc(PCU_IF_MSG_STOP_MEAS_REQ, bts->nr); + if (!msg) + return -ENOMEM; + + pcu_prim = (struct gsm_pcu_if *) msg->data; + stop_meas_req = &pcu_prim->u.start_meas_req; + stop_meas_req->meas_id = meas_id; + + LOGP(DPCU, LOGL_INFO, "[BTS->PCU] Sent STOP MEASurement REQuest: 0x%02x\n", stop_meas_req->meas_id); + + return pcu_sock_send(&bts_gsmnet, msg); +} + +int pcu_tx_mm_meas_res_req(struct gsm_bts *bts, uint8_t meas_id) +{ + struct gsm_pcu_if *pcu_prim; + struct gsm_pcu_if_meas_req *meas_req; + struct msgb *msg; + + msg = pcu_msgb_alloc(PCU_IF_MSG_MEAS_RES_REQ, bts->nr); + if (!msg) + return -ENOMEM; + + pcu_prim = (struct gsm_pcu_if *) msg->data; + meas_req = &pcu_prim->u.meas_req; + meas_req->meas_id = meas_id; + + LOGP(DPCU, LOGL_INFO, "[BTS->PCU ]Sent MEASurement RESult REQuest: 0x%02x\n", meas_req->meas_id); + + return pcu_sock_send(&bts_gsmnet, msg); +} + + static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type, struct gsm_pcu_if_data *data_req) { @@ -573,6 +631,55 @@ return rc; } +static int pcu_rx_mm_start_meas_ack_nack(struct gsm_bts *bts, struct gsm_pcu_if_start_meas_req *start_meas, uint8_t nack_cause) +{ + int rc; + rc = oml_tx_mm_start_meas_ack_nack(&bts->gprs.cell.mo, start_meas->meas_id, nack_cause); + if (rc < 0 ) + return rc; + + return 0; +} + +static int pcu_rx_mm_stop_meas_ack_nack(struct gsm_bts *bts, struct gsm_pcu_if_start_meas_req *stop_meas, uint8_t nack_cause) +{ + int rc; + + rc = oml_tx_mm_stop_meas_ack_nack(&bts->gprs.cell.mo, stop_meas->meas_id, nack_cause); + if (rc < 0 ) + return rc; + + return 0; +} + +static int pcu_rx_mm_meas_res_req_nack(struct gsm_bts *bts, struct gsm_pcu_if_meas_resp *meas_resp, uint8_t nack_cause) +{ + int rc; + + rc = oml_tx_mm_meas_res_req_nack(&bts->gprs.cell.mo, meas_resp->meas_id, nack_cause); + if (rc < 0 ) + return rc; + + return 0; +} + +static int pcu_rx_mm_meas_res_resp(struct gsm_bts *bts, struct gsm_pcu_if_meas_resp *meas_resp) +{ + struct gsm_pcu_if_meas_resp res_resp; + int rc; + + res_resp.meas_id = meas_resp->meas_id; + res_resp.len = meas_resp->len; + memcpy(res_resp.data, meas_resp->data, meas_resp->len); + + rc = oml_tx_mm_meas_res_resp(&bts->gprs.cell.mo, res_resp); + if (rc < 0 ) + return rc; + + return 0; +} + + static int pcu_rx(struct gsm_network *net, uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { @@ -595,6 +702,24 @@ case PCU_IF_MSG_FAILURE_EVT_IND: rc = pcu_rx_failure_event_rep(bts, &pcu_prim->u.failure_evt_ind); break; + case PCU_IF_MSG_START_MEAS_ACK: + rc = pcu_rx_mm_start_meas_ack_nack(bts, &pcu_prim->u.start_meas_req, 0); + break; + case PCU_IF_MSG_START_MEAS_NACK: + rc = pcu_rx_mm_start_meas_ack_nack(bts, &pcu_prim->u.start_meas_req, pcu_prim->u.start_meas_req.nack_cause); + break; + case PCU_IF_MSG_MEAS_RES_NACK: + rc = pcu_rx_mm_meas_res_req_nack(bts, &pcu_prim->u.meas_resp, pcu_prim->u.meas_resp.nack_cause); + break; + case PCU_IF_MSG_MEAS_RES_RESP: + rc = pcu_rx_mm_meas_res_resp(bts, &pcu_prim->u.meas_resp); + break; + case PCU_IF_MSG_STOP_MEAS_ACK: + rc = pcu_rx_mm_stop_meas_ack_nack(bts, &pcu_prim->u.stop_meas_req, 0); + break; + case PCU_IF_MSG_STOP_MEAS_NACK: + rc = pcu_rx_mm_stop_meas_ack_nack(bts, &pcu_prim->u.stop_meas_req, pcu_prim->u.stop_meas_req.nack_cause); + break; default: snprintf(log_msg, 100, "Received unknown PCU msg type %d\n", msg_type); LOGP(DPCU, LOGL_ERROR,"%s", log_msg); -- To view, visit https://gerrit.osmocom.org/260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic930baa69fc09ad5059627ed3d85cce5474085b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:20 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:20 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/rsl.c : Alarm - BTS page table is full Message-ID: Review at https://gerrit.osmocom.org/261 LC15: common/rsl.c : Alarm - BTS page table is full Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 --- M src/common/rsl.c 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/261/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index dddde69..e661b18 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -50,6 +50,7 @@ #include #include #include +#include "osmo-bts/oml.h" //#define FAKE_CIPH_MODE_COMPL @@ -415,6 +416,8 @@ uint8_t chan_needed = 0, paging_group; const uint8_t *identity_lv; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)); @@ -432,6 +435,26 @@ identity_lv, chan_needed); if (rc < 0) { /* FIXME: notfiy the BSC somehow ?*/ + switch(rc) { + /* Send Failure event report of BTS page table is full to BSC */ + case -ENOSPC: + snprintf(log_msg, 100, "BTS page table is full\n"); + if(trx) { + + failure_rep.event_type = NM_EVT_ENV_FAIL; + failure_rep.event_serverity = NM_SEVER_MINOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MIN_PAG_TAB_FULL; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + break; + + default: + break; + } + } pcu_tx_pag_req(identity_lv, chan_needed); -- To view, visit https://gerrit.osmocom.org/261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:20 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:20 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to create IPAC RTP/RTCP ... Message-ID: Review at https://gerrit.osmocom.org/262 LC15: common/rsl.c : Alarm - Failed to create IPAC RTP/RTCP socket Change-Id: I6426f7fcb1e2e25f8143c0b5835c24fedc8089be --- M src/common/rsl.c 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/262/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index e661b18..4fee48b 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1461,6 +1461,8 @@ int rc, inc_ip_port = 0, port; char *name; struct in_addr ia; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; if (dch->c.msg_type == RSL_MT_IPAC_CRCX) name = "CRCX"; @@ -1517,9 +1519,18 @@ lchan->abis_ip.rtp_socket = osmo_rtp_socket_create(lchan->ts->trx, OSMO_RTP_F_POLL); if (!lchan->abis_ip.rtp_socket) { - LOGP(DRSL, LOGL_ERROR, - "%s IPAC Failed to create RTP/RTCP sockets\n", - gsm_lchan_name(lchan)); + + snprintf(log_msg, 100, "%s IPAC Failed to create RTP/RTCP sockets\n", gsm_lchan_name(lchan)); + LOGP(DRSL, LOGL_ERROR,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_RTP_TOUT; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&lchan->ts->trx->mo, failure_rep); + return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL, inc_ip_port, dch->c.msg_type); } -- To view, visit https://gerrit.osmocom.org/262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6426f7fcb1e2e25f8143c0b5835c24fedc8089be Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:29:20 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 13:29:20 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to bind RTP/RTCP socket Message-ID: Review at https://gerrit.osmocom.org/263 LC15: common/rsl.c : Alarm - Failed to bind RTP/RTCP socket Change-Id: Ief24e775dd186dbf2bb773afbc3e16d7037f179d --- M src/common/rsl.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/63/263/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 4fee48b..d9af705 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1557,9 +1557,17 @@ rc = osmo_rtp_socket_bind(lchan->abis_ip.rtp_socket, ipstr, -1); if (rc < 0) { - LOGP(DRSL, LOGL_ERROR, - "%s IPAC Failed to bind RTP/RTCP sockets\n", - gsm_lchan_name(lchan)); + snprintf(log_msg, 100, "%s IPAC Failed to bind RTP/RTCP sockets\n", gsm_lchan_name(lchan)); + LOGP(DRSL, LOGL_ERROR,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_RTP_TOUT; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&lchan->ts->trx->mo, failure_rep); + osmo_rtp_socket_free(lchan->abis_ip.rtp_socket); lchan->abis_ip.rtp_socket = NULL; msgb_queue_flush(&lchan->dl_tch_queue); -- To view, visit https://gerrit.osmocom.org/263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief24e775dd186dbf2bb773afbc3e16d7037f179d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:42:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 13:42:20 +0000 Subject: osmo-bts[master]: LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/234/1//COMMIT_MSG Commit Message: Line 7: LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation Can you please add a reference to the relevant specification / chapter where this was derived from? This should preferrably go into a comment next to the #define. Also, it would be useful to quickly explain in the commit message how this manifests itself as a problem/bug, if any. Finally, please drop the LC15 from the patch subject if the change is in the generic/common part of osmo-bts. Thanks! -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:43:39 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 13 Jun 2016 13:43:39 +0000 Subject: osmo-bts[master]: LC15: common/rsl.c : Alarm - BTS page table is full In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 I think the better approach is to use the signal framework to signal the event and then have a OML consumer to send out the OML message. In the long run we can have a CTRL TRAP implementation to export the same failures through the CTRL interface (and later by SNMP). This applies to all the other implementations as well. -- To view, visit https://gerrit.osmocom.org/261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:43:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 13:43:57 +0000 Subject: osmo-bts[master]: LC15: Bring back DSP trace argument In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/236/1//COMMIT_MSG Commit Message: Line 7: LC15: Bring back DSP trace argument Can you please elaborate on why? The DSP trace flags can be set quite comfortably via the VTY, so setting them via command line argument just adds a second way of configuring the same property, which I consider somewhat inconsistent. -- To view, visit https://gerrit.osmocom.org/236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:46:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 13:46:34 +0000 Subject: osmo-bts[master]: LC15: Hardware changes: - Change system devices path - Remov... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:51:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 13:51:33 +0000 Subject: osmo-bts[master]: LC15: TRX nominal TX power can be used from EEPROM or from B... In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/238/1/src/osmo-bts-litecell15/calib_file.c File src/osmo-bts-litecell15/calib_file.c: PS1, Line 346: calcualte file checksum coding style: We don't do double-slash comments. Let's try not to introduce new code, even though there are occasional violations of the style already in the tree. PS1, Line 348: sz-- coding style. We don't have spaces inside parenthesis -- To view, visit https://gerrit.osmocom.org/238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 13:59:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 13:59:37 +0000 Subject: osmo-bts[master]: LC15: BTS parameters are configurable via configuration file... In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/239/1/include/osmo-bts/gsm_data.h File include/osmo-bts/gsm_data.h: PS1, Line 114: #ifdef ENABLE_LC15BTS : /* specific to LC15 BTS */ : uint8_t max_cell_size; /* 166 qbits */ : uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ : uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ : uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ : uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ : #endif : }; we don't have any bts-model specific values in this structure so far, and I'm not convinced this is the right place to store this data. Wouldn't it make more sense in the phy_link? Also, if it must be introduced here, then it should be a sub-structure like struct { .... } lc15; https://gerrit.osmocom.org/#/c/239/1/src/osmo-bts-litecell15/lc15bts.h File src/osmo-bts-litecell15/lc15bts.h: PS1, Line 81: SM_BTS_M as far as i can see, all these constants are LC15 specific, so they should probably not have the generic GSM_BTS_ prefix, but something that indicates they are LC15. https://gerrit.osmocom.org/#/c/239/1/src/osmo-bts-litecell15/lc15bts_vty.c File src/osmo-bts-litecell15/lc15bts_vty.c: Line 354: "max-cell-size <0-166>", you introduce a lot of configuration locally to the BTS. This is quite contrary to the classic GSM architecture approach where all configuration is down-loaded via A-bis OML from the BSC, and related configuration is at the BSC. I'm not fundamentally against doing it this way, but your approach using the bts-local configuration file basically makes the configuration management of larger BTS populations much more complicated, as the operator will have to build a configuration and cofnig version management system for config files on all BTSs, as opposed to just one central at the BSC. If you look at the OML of Nokia/Ericsson/Siemens, these kind of settings are all part of their respective OML dialects. -- To view, visit https://gerrit.osmocom.org/239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:08:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:08:05 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - DSP L1 is no long... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/244/1/src/osmo-bts-litecell15/oml.c File src/osmo-bts-litecell15/oml.c: PS1, Line 798: failure_rep.event_type = NM_EVT_PROC_FAIL; : failure_rep.event_serverity = NM_SEVER_CRITICAL; : failure_rep.cause_type = NM_PCAUSE_T_MANUF; : failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; : failure_rep.add_text = (char *)&log_msg; you introduce several blocks like this in your patch series, I think it would be better to introduce a common function to which the MO and the individual arguments are passed, and which then wraps the call to oml_tx_failure_event_rep(). Or possibly even change the signature of that function to do away with struct gsm_failure_evt_rep? -- To view, visit https://gerrit.osmocom.org/244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic19e21c31a8f95c5e15c91cd886788ec4e83ec13 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:11:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:11:10 +0000 Subject: osmo-bts[master]: LC15: common/bts.c : Alarm - Failed to establish RSL link an... In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/251/1/src/common/bts.c File src/common/bts.c: PS1, Line 47: "osmo-bts/oml.h" please note all other include files are used with <> instead of "", so please follow that practise. PS1, Line 254: int rc; : char log_msg[100]; see my other comment in a different patch of your series about introducing a convenience wrapper around oml_tx_failure_event_rep(). It might even make sense to have that as a varargs function so you can pass in the format string and any additional arguments to the function, avoiding the need to have these log_msg[100] buffers all over the code. -- To view, visit https://gerrit.osmocom.org/251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8adac2c9dd1570feec14b3e66f8b05c4274cf127 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:18:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:18:26 +0000 Subject: osmo-bts[master]: LC15: Introduce measurement management messages, TS 12.21 se... In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/260/1//COMMIT_MSG Commit Message: Line 7: LC15: Introduce measurement management messages, TS 12.21 section 8.10 could you please elaborate on the architecture of the implementation? Why are they fed into the PCU? https://gerrit.osmocom.org/#/c/260/1/include/osmo-bts/pcu_if.h File include/osmo-bts/pcu_if.h: PS1, Line 22: _mm MM is generally used to refer to Mobility Management in GSM and the Osmcoom code base, so the naming should be less ambiguous. -- To view, visit https://gerrit.osmocom.org/260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic930baa69fc09ad5059627ed3d85cce5474085b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:19:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:19:38 +0000 Subject: libosmo-sccp[master]: remove obsolete fixme comment In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/228/1//COMMIT_MSG Commit Message: PS1, Line 7: t why is it obsolete? are we now generating an error message towards the remote side? -- To view, visit https://gerrit.osmocom.org/228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:20:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:20:38 +0000 Subject: libosmo-sccp[master]: remove two compiler warnings for unused variables In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/227/1/src/sua.c File src/sua.c: PS1, Line 927: TODO evaluate cause I'd rather actually add code that uses the cause value than to hide the warning. I left the compiler warning intentionally so that we know this needs to be adressed. -- To view, visit https://gerrit.osmocom.org/227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib358fbc29cd4d3aa18e3c106afcca627e6b668a1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:21:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:21:53 +0000 Subject: libosmocore[master]: add get_value_string_or_null() to handle unknown items In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fa3907e28d528d2758bc3eae9d19e6c1168f5e5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:22:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:22:17 +0000 Subject: libosmocore[master]: add rsl_or_ipac_msg_name() for both standard and ip.access m... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:22:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:22:40 +0000 Subject: libosmocore[master]: api doc: get_value_string(): mention composition in static b... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93dad98711ef69f8a1e196efa029a842a1ff5bd6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:23:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:23:15 +0000 Subject: osmo-bts[master]: Close TRX session before opening new one In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:23:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:23:41 +0000 Subject: osmo-bts[master]: octphy: Use the app. info. defaults as base In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:24:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:24:35 +0000 Subject: osmo-bts[master]: LC15: common/abis.c: fix 100% CPU usage after disconnecting ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:27:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:27:26 +0000 Subject: osmo-bts[master]: LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/241/1//COMMIT_MSG Commit Message: Line 7: LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB step This breaks compliance with the TS 12.21 specification, where it is clearly stated that MAX_POWER_RED is in units of 2dB. we cannot accept this patch in the current form. Also, it means that the BSC would have to have corresponding non-standard interpretation of the IE. I suggest you instead introduce a new, proprietary OML IE, and then the BSC can either use the standard (2dB step size) IE or the proprietary IE for finer granularity. You could even make it .1 dB for higher resolution at that point. -- To view, visit https://gerrit.osmocom.org/241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 14:28:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 13 Jun 2016 14:28:41 +0000 Subject: osmo-bts[master]: LC15: Introduce TS 12.21 8.8.2 Abis/OML failure event report In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/242/1/include/osmo-bts/oml.h File include/osmo-bts/oml.h: PS1, Line 18: /* FIXME: can move to libosmocore */ please introduce the related enum directly to libosmocore, rather than adding it with FIXME here. PS1, Line 21: MM_ please note my other comment regarding MM being the standard acronym for Mobility Management. -- To view, visit https://gerrit.osmocom.org/242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id710f452c4e0eecbba855e87ab86a3087988e326 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:25:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:25:52 +0000 Subject: [PATCH] osmo-bts[master]: sysmo: add L3 handle to l1prim messages Message-ID: Review at https://gerrit.osmocom.org/264 sysmo: add L3 handle to l1prim messages Place a layer 3 handle into GSM L1 messages to better match up confirmations to respective requests. This handle is a uint32_t transparently returned in the confirmation messages, so a match-up is easy to add. So far, a GSM L1 confirmation message received for a preceding L1 Request was matched only by the prim_id. That meant that only one instance of the same primitive could be waiting for a confirmation at any given time, or the responses would get mixed up: the struct wait_l1_conf instances entered into the fl1h->wlc_list queue would be returned to a possibly mismatching confirmation handler. (Seen during testing of dyn pdch switching.) Send the hLayer3 handle out via prim_init(), using new static functions to produce handles on different scopes: * l1p_handle_for_trx() * l1p_handle_for_ts() * l1p_handle_for_lchan() (These could possibly move to a more general .h/.c file later.) Remember the hLayer3 handle in * struct wait_l1_conf. Match the incoming confirmations' and stored hLayer3 handles up in, and remove a now obsolete comment from: * is_prim_compat() Since the hLayer3 members are at different byte offsets in GsmL1_Prim_t.u.*, use large switch statements to set/get the value: * In prim_init(), extend existing switch statement to set in GsmL1_Prim_t. * Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a more general .h/.c file later). Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/oml.c 2 files changed, 128 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/64/264/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index d6d0cdd..04e60c5 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -67,6 +67,7 @@ struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ unsigned int conf_prim_id; /* primitive we expect in response */ + HANDLE conf_hLayer3; /* layer 3 handle we expect in response */ unsigned int is_sys_prim; /* is this a system (1) or L1 (0) primitive */ l1if_compl_cb *cb; void *cb_data; @@ -90,6 +91,58 @@ get_value_string(femtobts_l1prim_names, wlc->conf_prim_id)); exit(23); } + +static HANDLE l1p_get_hLayer3(GsmL1_Prim_t *prim) +{ + switch (prim->id) { + case GsmL1_PrimId_MphInitReq: + return prim->u.mphInitReq.hLayer3; + case GsmL1_PrimId_MphCloseReq: + return prim->u.mphCloseReq.hLayer3; + case GsmL1_PrimId_MphConnectReq: + return prim->u.mphConnectReq.hLayer3; + case GsmL1_PrimId_MphDisconnectReq: + return prim->u.mphDisconnectReq.hLayer3; + case GsmL1_PrimId_MphActivateReq: + return prim->u.mphActivateReq.hLayer3; + case GsmL1_PrimId_MphDeactivateReq: + return prim->u.mphDeactivateReq.hLayer3; + case GsmL1_PrimId_MphConfigReq: + return prim->u.mphConfigReq.hLayer3; + case GsmL1_PrimId_MphMeasureReq: + return prim->u.mphMeasureReq.hLayer3; + case GsmL1_PrimId_MphInitCnf: + return prim->u.mphInitCnf.hLayer3; + case GsmL1_PrimId_MphCloseCnf: + return prim->u.mphCloseCnf.hLayer3; + case GsmL1_PrimId_MphConnectCnf: + return prim->u.mphConnectCnf.hLayer3; + case GsmL1_PrimId_MphDisconnectCnf: + return prim->u.mphDisconnectCnf.hLayer3; + case GsmL1_PrimId_MphActivateCnf: + return prim->u.mphActivateCnf.hLayer3; + case GsmL1_PrimId_MphDeactivateCnf: + return prim->u.mphDeactivateCnf.hLayer3; + case GsmL1_PrimId_MphConfigCnf: + return prim->u.mphConfigCnf.hLayer3; + case GsmL1_PrimId_MphMeasureCnf: + return prim->u.mphMeasureCnf.hLayer3; + case GsmL1_PrimId_MphTimeInd: + case GsmL1_PrimId_MphSyncInd: + case GsmL1_PrimId_PhEmptyFrameReq: + case GsmL1_PrimId_PhDataReq: + case GsmL1_PrimId_PhConnectInd: + case GsmL1_PrimId_PhReadyToSendInd: + case GsmL1_PrimId_PhDataInd: + case GsmL1_PrimId_PhRaInd: + break; + default: + LOGP(DL1C, LOGL_ERROR, "unknown L1 primitive %u\n", prim->id); + break; + } + return 0; +} + static int _l1if_req_compl(struct femtol1_hdl *fl1h, struct msgb *msg, int is_system_prim, l1if_compl_cb *cb, void *data) @@ -118,6 +171,7 @@ } wlc->is_sys_prim = 0; wlc->conf_prim_id = femtobts_l1prim_req2conf[l1p->id]; + wlc->conf_hLayer3 = l1p_get_hLayer3(l1p); wqueue = &fl1h->write_q[MQ_L1_WRITE]; timeout_secs = 30; } else { @@ -943,12 +997,12 @@ static inline int is_prim_compat(GsmL1_Prim_t *l1p, struct wait_l1_conf *wlc) { - /* the limitation here is that we cannot have multiple callers - * sending the same primitive */ if (wlc->is_sys_prim != 0) return 0; if (l1p->id != wlc->conf_prim_id) return 0; + if (l1p_get_hLayer3(l1p) != wlc->conf_hLayer3) + return 0; return 1; } diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index cd03b22..6951f84 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -92,45 +92,70 @@ static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); -static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct femtol1_hdl *gl1) +static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct femtol1_hdl *gl1, + HANDLE hLayer3) { prim->id = id; - /* for some reason the hLayer1 field is not always at the same position - * in the GsmL1_Prim_t, so we have to have this ugly case statement here... */ + /* for some reason the hLayer1 and hlayer3 fields are not always at the + * same position in the GsmL1_Prim_t, so we have to have this ugly case + * statement here... */ switch (id) { case GsmL1_PrimId_MphInitReq: //prim->u.mphInitReq.hLayer1 = gl1->hLayer1; + prim->u.mphInitReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphCloseReq: prim->u.mphCloseReq.hLayer1 = gl1->hLayer1; + prim->u.mphCloseReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConnectReq: prim->u.mphConnectReq.hLayer1 = gl1->hLayer1; + prim->u.mphConnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDisconnectReq: prim->u.mphDisconnectReq.hLayer1 = gl1->hLayer1; + prim->u.mphDisconnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphActivateReq: prim->u.mphActivateReq.hLayer1 = gl1->hLayer1; + prim->u.mphActivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDeactivateReq: prim->u.mphDeactivateReq.hLayer1 = gl1->hLayer1; + prim->u.mphDeactivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConfigReq: prim->u.mphConfigReq.hLayer1 = gl1->hLayer1; + prim->u.mphConfigReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphMeasureReq: prim->u.mphMeasureReq.hLayer1 = gl1->hLayer1; + prim->u.mphMeasureReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphInitCnf: + prim->u.mphInitCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphCloseCnf: + prim->u.mphCloseCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConnectCnf: + prim->u.mphConnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDisconnectCnf: + prim->u.mphDisconnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphActivateCnf: + prim->u.mphActivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDeactivateCnf: + prim->u.mphDeactivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConfigCnf: + prim->u.mphConfigCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphMeasureCnf: + prim->u.mphMeasureCnf.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphTimeInd: break; @@ -155,6 +180,35 @@ break; } return &prim->u; +} + +static HANDLE l1p_handle_for_trx(struct gsm_bts_trx *trx) +{ + struct gsm_bts *bts = trx->bts; + + osmo_static_assert(sizeof(HANDLE) >= 4, l1p_handle_is_at_least_32bit); + osmo_static_assert(sizeof(trx->nr) == 1, trx_nr_is_8bit); + osmo_static_assert(sizeof(bts->nr) == 1, bts_nr_is_8bit); + + return bts->nr << 24 + | trx->nr << 16; +} + +static HANDLE l1p_handle_for_ts(struct gsm_bts_trx_ts *ts) +{ + osmo_static_assert(sizeof(ts->nr) == 1, ts_nr_is_8bit); + + return l1p_handle_for_trx(ts->trx) + | ts->nr << 8; +} + + +static HANDLE l1p_handle_for_lchan(struct gsm_lchan *lchan) +{ + osmo_static_assert(sizeof(lchan->nr) == 1, lchan_nr_is_8bit); + + return l1p_handle_for_ts(lchan->ts) + | lchan->nr; } GsmL1_Status_t prim_status(GsmL1_Prim_t *prim) @@ -346,7 +400,8 @@ } msg = l1p_msgb_alloc(); - mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h); + mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h, + l1p_handle_for_trx(trx)); dev_par = &mi_req->deviceParam; dev_par->devType = GsmL1_DevType_TxdRxu; dev_par->freqBand = femto_band; @@ -385,7 +440,8 @@ struct msgb *msg; msg = l1p_msgb_alloc(); - prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h); + prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h, + l1p_handle_for_trx(trx)); LOGP(DL1C, LOGL_NOTICE, "Close TRX %u\n", trx->nr); return l1if_gsm_req_compl(fl1h, msg, trx_close_compl_cb, NULL); @@ -430,7 +486,8 @@ struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); GsmL1_MphConnectReq_t *cr; - cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, + l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; cr->logChComb = pchan_to_logChComb[ts->pchan]; @@ -917,7 +974,8 @@ GsmL1_MphActivateReq_t *act_req; GsmL1_LogChParam_t *lch_par; - act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, fl1h); + act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, + fl1h, l1p_handle_for_lchan(lchan)); lch_par = &act_req->logChPrm; act_req->u8Tn = lchan->ts->nr; act_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); @@ -1210,7 +1268,8 @@ /* channel mode, encryption and/or multirate have changed */ /* update multi-rate config */ - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); conf_req->cfgParamId = GsmL1_ConfigParamId_SetLogChParams; conf_req->cfgParams.setLogChParams.sapi = cmd->sapi; conf_req->cfgParams.setLogChParams.u8Tn = lchan->ts->nr; @@ -1263,7 +1322,7 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphConfigReq_t *conf_req; - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, 0); conf_req->cfgParamId = GsmL1_ConfigParamId_SetTxPowerLevel; conf_req->cfgParams.setTxPowerLevel.fTxPowerLevel = tx_power; @@ -1284,7 +1343,8 @@ struct msgb *msg = l1p_msgb_alloc(); struct GsmL1_MphConfigReq_t *cfgr; - cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); cfgr->cfgParamId = GsmL1_ConfigParamId_SetCipheringParams; cfgr->cfgParams.setCipheringParams.u8Tn = lchan->ts->nr; @@ -1431,7 +1491,8 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphDeactivateReq_t *deact_req; - deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, fl1h); + deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, + fl1h, l1p_handle_for_lchan(lchan)); deact_req->u8Tn = lchan->ts->nr; deact_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); deact_req->dir = cmd->dir; -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:29:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:29:30 +0000 Subject: [ABANDON] libosmo-sccp[master]: remove two compiler warnings for unused variables In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: remove two compiler warnings for unused variables ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ib358fbc29cd4d3aa18e3c106afcca627e6b668a1 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:43:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:43:03 +0000 Subject: [PATCH] libosmo-sccp[master]: clarify fixme comment, x7 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/228 to look at the new patch set (#2). clarify fixme comment, x7 The fixme is about an actual message sent back, not about the error log. Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a --- M src/sua.c 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/28/228/2 diff --git a/src/sua.c b/src/sua.c index 6e187d8..89182d2 100644 --- a/src/sua.c +++ b/src/sua.c @@ -846,7 +846,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "COAK for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } conn_restart_rx_inact_timer(conn); @@ -854,7 +854,7 @@ if (conn->state != S_CONN_PEND_OUT) { LOGP(DSUA, LOGL_ERROR, "COAK in wrong state %s\n", get_value_string(conn_state_names, conn->state)); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -EINVAL; } @@ -908,7 +908,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "COREF for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } conn_restart_rx_inact_timer(conn); @@ -961,7 +961,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "RELRE for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } @@ -1011,7 +1011,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "RELCO for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } conn_restart_rx_inact_timer(conn); @@ -1058,14 +1058,14 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "DT1 for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } if (conn->state != S_ACTIVE) { LOGP(DSUA, LOGL_ERROR, "DT1 in invalid state %s\n", get_value_string(conn_state_names, conn->state)); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } -- To view, visit https://gerrit.osmocom.org/228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:43:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:43:03 +0000 Subject: [PATCH] libosmo-sccp[master]: fix log msg typo, x5 Message-ID: Review at https://gerrit.osmocom.org/265 fix log msg typo, x5 Change-Id: I00ff99ef14d62d3b353fe69762ae49f374938f94 --- M src/sua.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/65/265/1 diff --git a/src/sua.c b/src/sua.c index 89182d2..5575d58 100644 --- a/src/sua.c +++ b/src/sua.c @@ -844,7 +844,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "COAK for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "COAK for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -906,7 +906,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "COREF for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "COREF for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -959,7 +959,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "RELRE for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "RELRE for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -1009,7 +1009,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "RELCO for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "RELCO for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -1056,7 +1056,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "DT1 for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "DT1 for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; -- To view, visit https://gerrit.osmocom.org/265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00ff99ef14d62d3b353fe69762ae49f374938f94 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:45:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:45:52 +0000 Subject: [MERGED] libosmocore[master]: api doc: get_value_string(): mention composition in static b... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: api doc: get_value_string(): mention composition in static buffer ...................................................................... api doc: get_value_string(): mention composition in static buffer Change-Id: I93dad98711ef69f8a1e196efa029a842a1ff5bd6 Reviewed-on: https://gerrit.osmocom.org/229 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M src/utils.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/utils.c b/src/utils.c index 1c2fc32..e76297f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -43,6 +43,10 @@ * \param[in] vs Array of value_string tuples * \param[in] val Value to be converted * \returns pointer to human-readable string + * + * If val is found in vs, the array's string entry is returned. Otherwise, an + * "unknown" string containing the actual value is composed in a static buffer + * that is reused across invocations. */ const char *get_value_string(const struct value_string *vs, uint32_t val) { -- To view, visit https://gerrit.osmocom.org/229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93dad98711ef69f8a1e196efa029a842a1ff5bd6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:46:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:46:20 +0000 Subject: [MERGED] libosmocore[master]: add get_value_string_or_null() to handle unknown items In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add get_value_string_or_null() to handle unknown items ...................................................................... add get_value_string_or_null() to handle unknown items Add get_value_string_or_null() to return NULL in case the given value is not found in the list of strings, to be able to cleanly fall back to another list of strings. Absorb the lookup loop from get_value_string(). Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN. In a subsequent commit, get_value_string_or_null() will be used by new rsl_or_ipac_msg_name(). Change-Id: I1fa3907e28d528d2758bc3eae9d19e6c1168f5e5 Reviewed-on: https://gerrit.osmocom.org/230 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 20 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index bc39519..476e492 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -25,6 +25,8 @@ }; const char *get_value_string(const struct value_string *vs, uint32_t val); +const char *get_value_string_or_null(const struct value_string *vs, + uint32_t val); int get_string_value(const struct value_string *vs, const char *str); diff --git a/src/utils.c b/src/utils.c index e76297f..4a54802 100644 --- a/src/utils.c +++ b/src/utils.c @@ -50,6 +50,23 @@ */ const char *get_value_string(const struct value_string *vs, uint32_t val) { + const char *str = get_value_string_or_null(vs, val); + if (str) + return str; + + snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); + namebuf[sizeof(namebuf) - 1] = '\0'; + return namebuf; +} + +/*! \brief get human-readable string or NULL for given value + * \param[in] vs Array of value_string tuples + * \param[in] val Value to be converted + * \returns pointer to human-readable string or NULL if val is not found + */ +const char *get_value_string_or_null(const struct value_string *vs, + uint32_t val) +{ int i; for (i = 0;; i++) { @@ -59,9 +76,7 @@ return vs[i].str; } - snprintf(namebuf, sizeof(namebuf), "unknown 0x%x", val); - namebuf[sizeof(namebuf) - 1] = '\0'; - return namebuf; + return NULL; } /*! \brief get numeric value for given human-readable string -- To view, visit https://gerrit.osmocom.org/230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1fa3907e28d528d2758bc3eae9d19e6c1168f5e5 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:46:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 13 Jun 2016 17:46:48 +0000 Subject: [MERGED] libosmocore[master]: add rsl_or_ipac_msg_name() for both standard and ip.access m... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add rsl_or_ipac_msg_name() for both standard and ip.access msg types ...................................................................... add rsl_or_ipac_msg_name() for both standard and ip.access msg types Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN. Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f Reviewed-on: https://gerrit.osmocom.org/231 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M include/osmocom/gsm/rsl.h M src/gsm/libosmogsm.map M src/gsm/rsl.c 3 files changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/rsl.h b/include/osmocom/gsm/rsl.h index 418e3f0..b140d48 100644 --- a/include/osmocom/gsm/rsl.h +++ b/include/osmocom/gsm/rsl.h @@ -39,6 +39,7 @@ const char *rsl_rlm_cause_name(uint8_t err); const char *rsl_msg_name(uint8_t err); const char *rsl_ipac_msg_name(uint8_t msg_type); +const char *rsl_or_ipac_msg_name(uint8_t msg_type); /* Section 3.3.2.3 TS 05.02. I think this looks like a table */ int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 301f5aa..ea2101c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -266,6 +266,7 @@ rsl_init_rll_hdr; rsl_ipac_msg_name; rsl_msg_name; +rsl_or_ipac_msg_name; rsl_rll_push_hdr; rsl_rll_push_l3; rsl_rll_simple; diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index de2e9d7..c3c32a9 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -382,6 +382,17 @@ return get_value_string(rsl_ipac_msgt_names, msg_type); } +/*! \brief Get human-readable name of standard or ip.access RSL msg type. + * If msg_type is a standard RSL message type, return its human-readable name. + * Otherwise return rsl_ipac_msg_name(msg_type). */ +const char *rsl_or_ipac_msg_name(uint8_t msg_type) +{ + const char *str = get_value_string_or_null(rsl_msgt_names, msg_type); + if (str) + return str; + return rsl_ipac_msg_name(msg_type); +} + static const struct value_string rsl_rlm_cause_strs[] = { { RLL_CAUSE_T200_EXPIRED, "Timer T200 expired (N200+1) times" }, { RLL_CAUSE_REEST_REQ, "Re-establishment request" }, -- To view, visit https://gerrit.osmocom.org/231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 13 17:52:52 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 17:52:52 +0000 Subject: [PATCH] libosmocore[master]: lapdm: Fix malformed Abis messages Message-ID: Review at https://gerrit.osmocom.org/266 lapdm: Fix malformed Abis messages Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89 --- M src/gsm/lapdm.c 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/266/1 diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c index fa7769b..0e877e1 100644 --- a/src/gsm/lapdm.c +++ b/src/gsm/lapdm.c @@ -421,6 +421,11 @@ rll_msg = RSL_MT_EST_IND; break; case OSMO_PRIM(PRIM_DL_EST, PRIM_OP_CONFIRM): + if (dp->oph.msg && dp->oph.msg->len == 0) { + /* omit L3 info by freeing message */ + msgb_free(dp->oph.msg); + dp->oph.msg = NULL; + } rll_msg = RSL_MT_EST_CONF; break; case OSMO_PRIM(PRIM_DL_DATA, PRIM_OP_INDICATION): @@ -429,9 +434,19 @@ case OSMO_PRIM(PRIM_DL_UNIT_DATA, PRIM_OP_INDICATION): return send_rslms_rll_l3_ui(mctx, dp->oph.msg); case OSMO_PRIM(PRIM_DL_REL, PRIM_OP_INDICATION): + if (dp->oph.msg && dp->oph.msg->len == 0) { + /* omit L3 info by freeing message */ + msgb_free(dp->oph.msg); + dp->oph.msg = NULL; + } rll_msg = RSL_MT_REL_IND; break; case OSMO_PRIM(PRIM_DL_REL, PRIM_OP_CONFIRM): + if (dp->oph.msg && dp->oph.msg->len == 0) { + /* omit L3 info by freeing message */ + msgb_free(dp->oph.msg); + dp->oph.msg = NULL; + } rll_msg = RSL_MT_REL_CONF; break; case OSMO_PRIM(PRIM_DL_SUSP, PRIM_OP_CONFIRM): -- To view, visit https://gerrit.osmocom.org/266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Mon Jun 13 20:14:32 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 20:14:32 +0000 Subject: osmo-bts[master]: LC15: common/rsl.c : Alarm - BTS page table is full In-Reply-To: References: Message-ID: Patch Set 1: Would you like to provide more detail about the mentioned signal framework so that I can adapt those alarms to meet the framework? -- To view, visit https://gerrit.osmocom.org/261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 20:22:30 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 20:22:30 +0000 Subject: osmo-bts[master]: LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation In-Reply-To: References: Message-ID: Patch Set 1: We have seen that the DSP time to time rejects PTCCH message from BTS due to invalid block number. As a result, we patched FN2PTCCHBLOCK calculation according TS 45.0002 Table 6. -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 20:22:37 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 13 Jun 2016 20:22:37 +0000 Subject: osmo-bts[master]: LC15: common/rsl.c : Alarm - BTS page table is full In-Reply-To: References: Message-ID: Patch Set 1: The most recent is probably the CDR support I added to the SGSN last year. Code to register for a signal of a subsystem and do something with it: http://git.osmocom.org/openbsc/commit/openbsc/src/gprs/sgsn_cdr.c?id=4f5b8237ec2182861fbe075f4cce56a9c7caf904 And adding events in the SGSN: http://git.osmocom.org/openbsc/commit/openbsc/src/gprs/?id=b100895557af0980d5910a3dc81903179dea615e So while you are in the oml.c it might be natural and more direct just to create an event send it but once you are in RSL or int he BTS code itself the abstraction makes sense. You might not know/want to touch the OML object from that far below in the code. Tell me if you need more pointers to usage of event consumption and creation. -- To view, visit https://gerrit.osmocom.org/261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 13 20:36:46 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Mon, 13 Jun 2016 20:36:46 +0000 Subject: osmo-bts[master]: LC15: Bring back DSP trace argument In-Reply-To: References: Message-ID: Patch Set 1: We want to activate the DSP flags argument directly from the command line because it is much faster, catches the DSP traces sooner and allowing to apply multiple flags at time rather than activating only one flag at a time in VTY. -- To view, visit https://gerrit.osmocom.org/236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 09:39:05 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 14 Jun 2016 09:39:05 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: I haven't touched the PCU config -- it is the default as found in the osmo-pcu examples as well as in the sysmoBTS stable package: pcu flow-control-interval 10 cs 2 alloc-algorithm dynamic alpha 0 gamma 0 -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 09:53:56 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 14 Jun 2016 09:53:56 +0000 Subject: osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to bind RTP/RTCP socket In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief24e775dd186dbf2bb773afbc3e16d7037f179d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:18:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:18:19 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PD... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel ...................................................................... dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_init.c 3 files changed, 45 insertions(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved Jenkins Builder: Verified Holger Freyther: Looks good to me, but someone else must approve diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 8ed11b6..0b6bf60 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -256,6 +256,12 @@ struct gsm48_req_ref *rqd_ref; struct gsm_subscriber_connection *conn; + + struct { + /* channel activation type and handover ref */ + uint8_t act_type; + uint8_t ho_ref; + } dyn_pdch; #else /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. * Currently we don't share these headers so this is a magic number. */ diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index abe2f9b..59176df 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -470,6 +470,15 @@ if (rc < 0) return rc; + /* if channel is in PDCH mode, deactivate PDCH first */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH + && (lchan->ts->flags & TS_F_PDCH_MODE)) { + /* store activation type and handover reference */ + lchan->dyn_pdch.act_type = act_type; + lchan->dyn_pdch.ho_ref = ho_ref; + return rsl_ipacc_pdch_activate(lchan->ts, 0); + } + ta = lchan->rqd_ta; /* BS11 requires TA shifted by 2 bits */ @@ -746,6 +755,11 @@ LOGP(DRSL, LOGL_NOTICE, "%s CHAN REL ACK but state %s\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + + /* Put PDCH channel back into PDCH mode first */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + return rsl_ipacc_pdch_activate(lchan->ts, 1); + do_lchan_free(lchan); return 0; @@ -1187,6 +1201,26 @@ return 0; } +static int rsl_rx_pdch_act_ack(struct msgb *msg) +{ + msg->lchan->ts->flags |= TS_F_PDCH_MODE; + + /* We have activated PDCH, so now the channel is available again. */ + do_lchan_free(msg->lchan); + + return 0; +} + +static int rsl_rx_pdch_deact_ack(struct msgb *msg) +{ + msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + + rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, + msg->lchan->dyn_pdch.ho_ref); + + return 0; +} + static int abis_rsl_rx_dchan(struct msgb *msg) { struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg); @@ -1225,14 +1259,14 @@ break; case RSL_MT_IPAC_PDCH_ACT_ACK: DEBUGP(DRSL, "%s IPAC PDCH ACT ACK\n", ts_name); - msg->lchan->ts->flags |= TS_F_PDCH_MODE; + rc = rsl_rx_pdch_act_ack(msg); break; case RSL_MT_IPAC_PDCH_ACT_NACK: LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH ACT NACK\n", ts_name); break; case RSL_MT_IPAC_PDCH_DEACT_ACK: DEBUGP(DRSL, "%s IPAC PDCH DEACT ACK\n", ts_name); - msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + rc = rsl_rx_pdch_deact_ack(msg); break; case RSL_MT_IPAC_PDCH_DEACT_NACK: LOGP(DRSL, LOGL_ERROR, "%s IPAC PDCH DEACT NACK\n", ts_name); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 5c27862..04452f7 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -329,8 +329,10 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { generate_ma_for_ts(&cur_trx->ts[i]); + cur_trx->ts[i].flags |= TS_F_PDCH_MODE; + } } } if (isd->link_type == E1INP_SIGN_RSL) -- To view, visit https://gerrit.osmocom.org/210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:18:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:18:19 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable ...................................................................... dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable Add dyn_pdch_init() in new file bsc_dyn_pdch.c (new file to avoid linking issues; bsc_init.c would create undefined references, and putting in a new file is the easiest solution). Call dyn_pdch_init() from nm_statechg_event() whenever a TS is enabled. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT and when subsequently the PDCH ACT ACK messages are received in rsl_rx_pdch_act_ack(). Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 --- M openbsc/include/openbsc/abis_rsl.h M openbsc/src/libbsc/Makefile.am A openbsc/src/libbsc/bsc_dyn_pdch.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/bts_ipaccess_nanobts.c 5 files changed, 50 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h index 100a6d1..6ff8382 100644 --- a/openbsc/include/openbsc/abis_rsl.h +++ b/openbsc/include/openbsc/abis_rsl.h @@ -106,5 +106,7 @@ int rsl_direct_rf_release(struct gsm_lchan *lchan); +void dyn_pdch_init(struct gsm_bts_trx_ts *ts); + #endif /* RSL_MT_H */ diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am index 8fa5c7c..48880d9 100644 --- a/openbsc/src/libbsc/Makefile.am +++ b/openbsc/src/libbsc/Makefile.am @@ -23,5 +23,6 @@ bsc_init.c bts_init.c bsc_rf_ctrl.c \ arfcn_range_encode.c bsc_ctrl_commands.c \ bsc_ctrl_lookup.c \ - net_init.c + net_init.c \ + bsc_dyn_pdch.c diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c new file mode 100644 index 0000000..717880b --- /dev/null +++ b/openbsc/src/libbsc/bsc_dyn_pdch.c @@ -0,0 +1,42 @@ +/* Dynamic PDCH initialisation implementation shared across NM and RSL */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +void dyn_pdch_init(struct gsm_bts_trx_ts *ts) +{ + int rc; + + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on" + " BTS %u TRX %u TS %u\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr); + rc = rsl_ipacc_pdch_activate(ts, 1); + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "Failed to activate PDCH on" + " BTS %u TRX %u TS %u: %d\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, rc); + } + } +} diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 04452f7..5c27862 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -329,10 +329,8 @@ llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) { int i; - for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) { + for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) generate_ma_for_ts(&cur_trx->ts[i]); - cur_trx->ts[i].flags |= TS_F_PDCH_MODE; - } } } if (isd->link_type == E1INP_SIGN_RSL) diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index dfb5a45..89d5256 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -369,6 +369,9 @@ abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr, trx->nr, ts->nr); } + if (new_state->operational == NM_OPSTATE_ENABLED + && new_state->availability == NM_AVSTATE_OK) + dyn_pdch_init(ts); break; case NM_OC_RADIO_CARRIER: trx = obj; -- To view, visit https://gerrit.osmocom.org/211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:18:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:18:33 +0000 Subject: [MERGED] osmo-bts[master]: octphy: Use the app. info. defaults as base In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: Use the app. info. defaults as base ...................................................................... octphy: Use the app. info. defaults as base Similar to 91565b2d51646657002f91fdc22dce3c7320e13a use default initializers. Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0 Fixes: Os#1642 --- M src/osmo-bts-octphy/l1_oml.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 14181dc..18bd8c0 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1156,6 +1156,7 @@ ais = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CMD *) msgb_put(msg, sizeof(*ais)); + mOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CMD_DEF(ais); l1if_fill_msg_hdr(&ais->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, cOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_CID); @@ -1197,6 +1198,7 @@ tOCTVC1_MAIN_MSG_APPLICATION_INFO_CMD *ai; ai = (tOCTVC1_MAIN_MSG_APPLICATION_INFO_CMD *) msgb_put(msg, sizeof(*ai)); + mOCTVC1_MAIN_MSG_APPLICATION_INFO_CMD_DEF(ai); l1if_fill_msg_hdr(&ai->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID); -- To view, visit https://gerrit.osmocom.org/233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:18:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:18:43 +0000 Subject: [MERGED] osmo-bts[master]: Close TRX session before opening new one In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Close TRX session before opening new one ...................................................................... Close TRX session before opening new one This fixes the unstable behavior (BTS loosing subscribers after some time) in case previous run of osmo-bts was interrupted (with ctrl+c for example). Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d --- M src/osmo-bts-octphy/l1_oml.c 1 file changed, 43 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 18bd8c0..401201a 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1097,6 +1097,23 @@ return 0; } +static int disable_events_compl_cb(struct octphy_hdl *fl1, struct msgb *resp, void *data) +{ + tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_RSP *mser = + (tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_RSP *) resp->l2h; + + /* in a completion call-back, we take msgb ownership and must + * release it before returning */ + + mOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_RSP_SWAP(mser); + + LOGP(DL1C, LOGL_INFO, "Rx DISABLE-EVT-REC.resp\n"); + + msgb_free(resp); + + return 0; +} + int l1if_enable_events(struct gsm_bts_trx *trx) { struct phy_instance *pinst = trx_phy_instance(trx); @@ -1116,7 +1133,29 @@ LOGP(DL1C, LOGL_INFO, "Tx ENABLE-EVT-REC.req\n"); - return l1if_req_compl(fl1h, msg, enable_events_compl_cb, 0); + return l1if_req_compl(fl1h, msg, disable_events_compl_cb, 0); +} + +int l1if_disable_events(struct gsm_bts_trx *trx) +{ + struct phy_instance *pinst = trx_phy_instance(trx); + struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; + struct msgb *msg = l1p_msgb_alloc(); + tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD *mse; + + mse = (tOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD *) + msgb_put(msg, sizeof(*mse)); + mOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD_DEF(mse); + + l1if_fill_msg_hdr(&mse->Header, msg, fl1h, cOCTVC1_MSG_TYPE_COMMAND, + cOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CID); + mse->ulEvtActiveFlag = cOCT_FALSE; + + mOCTVC1_MAIN_MSG_API_SYSTEM_MODIFY_SESSION_EVT_CMD_SWAP(mse); + + LOGP(DL1C, LOGL_INFO, "Tx DISABLE-EVT-REC.req\n"); + + return l1if_req_compl(fl1h, msg, disable_events_compl_cb, 0); } #define talloc_replace(dst, ctx, src) \ @@ -1483,6 +1522,9 @@ int bts_model_trx_close(struct gsm_bts_trx *trx) { + /* disable events */ + l1if_disable_events(trx); + /* FIXME: close only one TRX */ return trx_close(trx); } -- To view, visit https://gerrit.osmocom.org/232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:19:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:19:00 +0000 Subject: [MERGED] osmo-bts[master]: DTXd: store/repeat last SID In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTXd: store/repeat last SID ...................................................................... DTXd: store/repeat last SID Store last SID received over RTP and repeat is if necessary (no new SID or SPEECH frames) according to codec-specific scheduling rules. Related: OS#1563 Copy-paster from I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 for LC15. Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/l1_if.h M src/osmo-bts-litecell15/tch.c 3 files changed, 118 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 1054aba..54fd2d3 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -420,7 +420,7 @@ /* no message/data, we generate an empty traffic msg */ if (!nmsg) - nmsg = gen_empty_tch_msg(lchan); + nmsg = gen_empty_tch_msg(lchan, u32Fn); /* no traffic message, we generate an empty msg */ if (!nmsg) { diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h index 0c8843b..2d136af 100644 --- a/src/osmo-bts-litecell15/l1_if.h +++ b/src/osmo-bts-litecell15/l1_if.h @@ -91,7 +91,7 @@ const uint8_t *rtp_pl, unsigned int rtp_pl_len); int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan); +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); /* ciphering */ int l1if_set_ciphering(struct lc15l1_hdl *fl1h, diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 245c19a..db16209 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -481,7 +481,66 @@ return -EINVAL; } -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) +static inline bool fn_chk(uint8_t *t, uint32_t fn) +{ + uint8_t i; + for (i = 0; i < ARRAY_SIZE(t); i++) + if (fn % 104 == t[i]) + return false; + return true; +} + +static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) +{ + /* 3GPP TS 45.008 ? 8.3 */ + uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, + h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, + h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; + if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if (lchan->type == GSM_LCHAN_TCH_F) + return fn_chk(f, fn); + else + return fn_chk(lchan->nr ? h1 : h0, fn); + } + return false; +} + +static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *l1_payload; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + l1_payload = &msu_param->u8Buffer[1]; + + if (lchan->tch.last_sid.len) { + memcpy(l1_payload, lchan->tch.last_sid.buf, + lchan->tch.last_sid.len); + msu_param->u8Size = lchan->tch.last_sid.len + 1; + return true; + } + return false; +} + +/* store the last SID frame in lchan context */ +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update) +{ + size_t copy_len = OSMO_MIN(length + 1, + ARRAY_SIZE(lchan->tch.last_sid.buf)); + + lchan->tch.last_sid.len = copy_len; + lchan->tch.last_sid.fn = fn; + lchan->tch.last_sid.is_update = update; + + memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); +} + +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) { struct msgb *msg; GsmL1_Prim_t *l1p; @@ -503,21 +562,63 @@ switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: *payload_type = GsmL1_TchPlType_Amr; - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; + /* according to 3GPP TS 26.093 A.5.1.1: */ + if (lchan->tch.last_sid.is_update) { + /* SID UPDATE should be repeated every 8th frame */ + if (fn - lchan->tch.last_sid.fn < 7) { + msgb_free(msg); + return NULL; + } } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - msu_param->u8Size = 8; -#endif + /* 3rd frame after SID FIRST should be SID UPDATE */ + if (fn - lchan->tch.last_sid.fn < 3) { + msgb_free(msg); + return NULL; + } + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send AMR frame on TCH " + "(FN=%u) but SID buffer is empty - sent NO_DATA\n", + fn); + osmo_amr_rtp_enc(l1_payload, 0, AMR_NO_DATA, + AMR_GOOD); + return msg; + } + break; + case GSM48_CMODE_SPEECH_V1: + if (lchan->type == GSM_LCHAN_TCH_F) + *payload_type = GsmL1_TchPlType_Fr; + else + *payload_type = GsmL1_TchPlType_Hr; + /* unlike AMR, FR & HR schedued based on absolute FN value */ + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send V1 frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; + } + break; + case GSM48_CMODE_SPEECH_EFR: + *payload_type = GsmL1_TchPlType_Efr; + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send EFR frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; } break; default: -- To view, visit https://gerrit.osmocom.org/226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:19:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:19:00 +0000 Subject: [MERGED] osmo-bts[master]: DTXd: store/repeat last SID In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTXd: store/repeat last SID ...................................................................... DTXd: store/repeat last SID Store last SID received over RTP and repeat is if necessary (no new SID or SPEECH frames) according to codec-specific scheduling rules. Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 Related: OS#1563 --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/l1_if.h M src/osmo-bts-sysmo/tch.c 3 files changed, 119 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index d6d0cdd..84fad99 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -414,7 +414,7 @@ /* no message/data, we generate an empty traffic msg */ if (!nmsg) - nmsg = gen_empty_tch_msg(lchan); + nmsg = gen_empty_tch_msg(lchan, u32Fn); /* no traffic message, we generate an empty msg */ if (!nmsg) { diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h index bb1d5a5..2fc8a29 100644 --- a/src/osmo-bts-sysmo/l1_if.h +++ b/src/osmo-bts-sysmo/l1_if.h @@ -111,7 +111,7 @@ const uint8_t *rtp_pl, unsigned int rtp_pl_len); int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg); int l1if_tch_fill(struct gsm_lchan *lchan, uint8_t *l1_buffer); -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan); +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn); /* ciphering */ int l1if_set_ciphering(struct femtol1_hdl *fl1h, diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 63d90af..07a0efb 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -23,7 +23,7 @@ #include #include #include - +#include #include #include @@ -577,7 +577,66 @@ return -EINVAL; } -struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan) +static inline bool fn_chk(uint8_t *t, uint32_t fn) +{ + uint8_t i; + for (i = 0; i < ARRAY_SIZE(t); i++) + if (fn % 104 == t[i]) + return false; + return true; +} + +static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) +{ + /* 3GPP TS 45.008 ? 8.3 */ + uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, + h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, + h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; + if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if (lchan->type == GSM_LCHAN_TCH_F) + return fn_chk(f, fn); + else + return fn_chk(lchan->nr ? h1 : h0, fn); + } + return false; +} + +static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) +{ + GsmL1_Prim_t *l1p; + GsmL1_PhDataReq_t *data_req; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *l1_payload; + + l1p = msgb_l1prim(msg); + data_req = &l1p->u.phDataReq; + msu_param = &data_req->msgUnitParam; + l1_payload = &msu_param->u8Buffer[1]; + + if (lchan->tch.last_sid.len) { + memcpy(l1_payload, lchan->tch.last_sid.buf, + lchan->tch.last_sid.len); + msu_param->u8Size = lchan->tch.last_sid.len + 1; + return true; + } + return false; +} + +/* store the last SID frame in lchan context */ +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update) +{ + size_t copy_len = OSMO_MIN(length + 1, + ARRAY_SIZE(lchan->tch.last_sid.buf)); + + lchan->tch.last_sid.len = copy_len; + lchan->tch.last_sid.fn = fn; + lchan->tch.last_sid.is_update = update; + + memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); +} + +struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) { struct msgb *msg; GsmL1_Prim_t *l1p; @@ -599,21 +658,63 @@ switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: *payload_type = GsmL1_TchPlType_Amr; - if (lchan->tch.last_sid.len) { - memcpy(l1_payload, lchan->tch.last_sid.buf, - lchan->tch.last_sid.len); - msu_param->u8Size = lchan->tch.last_sid.len+1; + /* according to 3GPP TS 26.093 A.5.1.1: */ + if (lchan->tch.last_sid.is_update) { + /* SID UPDATE should be repeated every 8th frame */ + if (fn - lchan->tch.last_sid.fn < 7) { + msgb_free(msg); + return NULL; + } } else { - /* FIXME: decide if we should send SPEECH_BAD or - * SID_BAD */ -#if 0 - *payload_type = GsmL1_TchPlType_Amr_SidBad; - memset(l1_payload, 0xFF, 5); - msu_param->u8Size = 5 + 3; -#else - /* send an all-zero SID */ - msu_param->u8Size = 8; -#endif + /* 3rd frame after SID FIRST should be SID UPDATE */ + if (fn - lchan->tch.last_sid.fn < 3) { + msgb_free(msg); + return NULL; + } + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send AMR frame on TCH " + "(FN=%u) but SID buffer is empty - sent NO_DATA\n", + fn); + osmo_amr_rtp_enc(l1_payload, 0, AMR_NO_DATA, + AMR_GOOD); + return msg; + } + break; + case GSM48_CMODE_SPEECH_V1: + if (lchan->type == GSM_LCHAN_TCH_F) + *payload_type = GsmL1_TchPlType_Fr; + else + *payload_type = GsmL1_TchPlType_Hr; + /* unlike AMR, FR & HR schedued based on absolute FN value */ + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send V1 frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; + } + break; + case GSM48_CMODE_SPEECH_EFR: + *payload_type = GsmL1_TchPlType_Efr; + if (dtx_sched_optional(lchan, fn)) { + msgb_free(msg); + return NULL; + } + if (repeat_last_sid(lchan, msg)) + return msg; + else { + LOGP(DL1C, LOGL_NOTICE, "Have to send EFR frame on TCH " + "(FN=%u) but SID buffer is empty - sent nothing\n", + fn); + return NULL; } break; default: -- To view, visit https://gerrit.osmocom.org/225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:19:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:19:01 +0000 Subject: [MERGED] osmo-bts[master]: Fix debug output In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix debug output ...................................................................... Fix debug output Previously frame number was not saved in case of PRIM_TCH rendering many debug statements with g_time useless. Copy-paste from ef30f50d5d6d5f863fc147d05ccdceb89284934e. Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951 --- M src/osmo-bts-litecell15/tch.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 15ad456..245c19a 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -467,6 +467,7 @@ l1sap = msgb_l1sap_prim(rmsg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); l1sap->u.tch.chan_nr = chan_nr; + l1sap->u.tch.fn = data_ind->u32Fn; return l1sap_up(trx, l1sap); } -- To view, visit https://gerrit.osmocom.org/224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:19:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:19:13 +0000 Subject: [MERGED] osmo-bts[master]: DTXu: mark beginning of speech burst in RTP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTXu: mark beginning of speech burst in RTP ...................................................................... DTXu: mark beginning of speech burst in RTP Set Marker bit in RTP header to mark the beginning of talkspurt. Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e Related: OS#1562 --- M src/common/l1sap.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 3 files changed, 92 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 77fd1a0..163e129 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -866,8 +866,8 @@ /* hand msg to RTP code for transmission */ if (lchan->abis_ip.rtp_socket) - osmo_rtp_send_frame(lchan->abis_ip.rtp_socket, - msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn)); + osmo_rtp_send_frame_ext(lchan->abis_ip.rtp_socket, + msg->data, msg->len, fn_ms_adj(fn, lchan->tch.last_fn), lchan->rtp_tx_marker); /* if loopback is enabled, also queue received RTP data */ if (lchan->loopback) { @@ -885,6 +885,8 @@ msgb_enqueue(&lchan->dl_tch_queue, msg); } + + lchan->rtp_tx_marker = false; lchan->tch.last_fn = fn; return 0; } diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index db16209..e92c57b 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -101,7 +101,8 @@ #define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ #define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ -static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -113,6 +114,13 @@ /* new L1 can deliver bits like we need them */ cur = msgb_put(msg, GSM_FR_BYTES); memcpy(cur, l1_payload, GSM_FR_BYTES); + + if (osmo_fr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -131,7 +139,9 @@ return GSM_FR_BYTES; } -static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, + uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -143,6 +153,17 @@ /* new L1 can deliver bits like we need them */ cur = msgb_put(msg, GSM_EFR_BYTES); memcpy(cur, l1_payload, GSM_EFR_BYTES); + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; + osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); + if (ft == AMR_GSM_EFR_SID) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -154,7 +175,8 @@ return payload_len; } -static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -171,6 +193,13 @@ cur = msgb_put(msg, GSM_HR_BYTES); memcpy(cur, l1_payload, GSM_HR_BYTES); + + if (osmo_hr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -431,6 +460,15 @@ lchan->type != GSM_LCHAN_TCH_F) goto err_payload_match; break; + case GsmL1_TchPlType_Amr_Onset: + if (lchan->type != GSM_LCHAN_TCH_H && + lchan->type != GSM_LCHAN_TCH_F) + goto err_payload_match; + /* according to 3GPP TS 26.093 ONSET frames precede the first + speech frame of a speech burst - set the marker for next RTP + frame and drop last SID */ + lchan->rtp_tx_marker = true; + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -441,13 +479,13 @@ switch (payload_type) { case GsmL1_TchPlType_Fr: - rmsg = l1_to_rtppayload_fr(payload, payload_len); + rmsg = l1_to_rtppayload_fr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Hr: - rmsg = l1_to_rtppayload_hr(payload, payload_len); + rmsg = l1_to_rtppayload_hr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Efr: - rmsg = l1_to_rtppayload_efr(payload, payload_len); + rmsg = l1_to_rtppayload_efr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Amr: rmsg = l1_to_rtppayload_amr(payload, payload_len, lchan); diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 07a0efb..a391fcc 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -91,7 +91,8 @@ } -static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -115,6 +116,13 @@ cur[0] |= 0xD0; #endif /* USE_L1_RTP_MODE */ + + if (osmo_fr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -142,7 +150,9 @@ } #if defined(L1_HAS_EFR) && defined(USE_L1_RTP_MODE) -static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_efr(uint8_t *l1_payload, + uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -166,6 +176,17 @@ cur[0] |= 0xC0; #endif /* USE_L1_RTP_MODE */ + enum osmo_amr_type ft; + enum osmo_amr_quality bfi; + uint8_t cmr; + int8_t sti, cmi; + osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); + if (ft == AMR_GSM_EFR_SID) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -184,7 +205,8 @@ #warning No EFR support in L1 #endif /* L1_HAS_EFR */ -static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len) +static struct msgb *l1_to_rtppayload_hr(uint8_t *l1_payload, uint8_t payload_len, + struct gsm_lchan *lchan) { struct msgb *msg; uint8_t *cur; @@ -206,6 +228,13 @@ /* reverse the bit-order of each payload byte */ osmo_revbytebits_buf(cur, GSM_HR_BYTES); #endif /* USE_L1_RTP_MODE */ + + if (osmo_hr_check_sid(l1_payload, payload_len)) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } return msg; } @@ -525,6 +554,15 @@ lchan->type != GSM_LCHAN_TCH_F) goto err_payload_match; break; + case GsmL1_TchPlType_Amr_Onset: + if (lchan->type != GSM_LCHAN_TCH_H && + lchan->type != GSM_LCHAN_TCH_F) + goto err_payload_match; + /* according to 3GPP TS 26.093 ONSET frames precede the first + speech frame of a speech burst - set the marker for next RTP + frame and drop last SID */ + lchan->rtp_tx_marker = true; + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -535,14 +573,14 @@ switch (payload_type) { case GsmL1_TchPlType_Fr: - rmsg = l1_to_rtppayload_fr(payload, payload_len); + rmsg = l1_to_rtppayload_fr(payload, payload_len, lchan); break; case GsmL1_TchPlType_Hr: - rmsg = l1_to_rtppayload_hr(payload, payload_len); + rmsg = l1_to_rtppayload_hr(payload, payload_len, lchan); break; #if defined(L1_HAS_EFR) && defined(USE_L1_RTP_MODE) case GsmL1_TchPlType_Efr: - rmsg = l1_to_rtppayload_efr(payload, payload_len); + rmsg = l1_to_rtppayload_efr(payload, payload_len, lchan); break; #endif case GsmL1_TchPlType_Amr: -- To view, visit https://gerrit.osmocom.org/223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:20:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:20:05 +0000 Subject: [MERGED] openbsc[master]: Fix SIGABRT on wrong AMR payload In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix SIGABRT on wrong AMR payload ...................................................................... Fix SIGABRT on wrong AMR payload Previously length check have not considered AMR format which requires extra byte for in-band length leading to SIGABRT on incorrect payload from BTS. Change-Id: I800f756fc803accace8c7e0b4a42b3744fe78bb6 Fixes: OS#1731 --- M openbsc/src/libtrau/rtp_proxy.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c index 6c04610..ed19175 100644 --- a/openbsc/src/libtrau/rtp_proxy.c +++ b/openbsc/src/libtrau/rtp_proxy.c @@ -163,7 +163,9 @@ return -EINVAL; } - if (payload_len > MAX_RTP_PAYLOAD_LEN) { + if (payload_len > MAX_RTP_PAYLOAD_LEN || + (rtph->payload_type == RTP_PT_AMR && + payload_len > MAX_RTP_PAYLOAD_LEN - 1)) { DEBUGPC(DLMUX, "RTP payload too large (%d octets)\n", payload_len); return -EINVAL; -- To view, visit https://gerrit.osmocom.org/222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I800f756fc803accace8c7e0b4a42b3744fe78bb6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:36:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:36:22 +0000 Subject: libosmo-sccp[master]: clarify fixme comment, x7 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:36:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:36:23 +0000 Subject: [MERGED] libosmo-sccp[master]: clarify fixme comment, x7 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: clarify fixme comment, x7 ...................................................................... clarify fixme comment, x7 The fixme is about an actual message sent back, not about the error log. Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a Reviewed-on: https://gerrit.osmocom.org/228 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/sua.c 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sua.c b/src/sua.c index 6e187d8..89182d2 100644 --- a/src/sua.c +++ b/src/sua.c @@ -846,7 +846,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "COAK for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } conn_restart_rx_inact_timer(conn); @@ -854,7 +854,7 @@ if (conn->state != S_CONN_PEND_OUT) { LOGP(DSUA, LOGL_ERROR, "COAK in wrong state %s\n", get_value_string(conn_state_names, conn->state)); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -EINVAL; } @@ -908,7 +908,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "COREF for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } conn_restart_rx_inact_timer(conn); @@ -961,7 +961,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "RELRE for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } @@ -1011,7 +1011,7 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "RELCO for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } conn_restart_rx_inact_timer(conn); @@ -1058,14 +1058,14 @@ if (!conn) { LOGP(DSUA, LOGL_ERROR, "DT1 for unknwon reference %u\n", conn_id); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } if (conn->state != S_ACTIVE) { LOGP(DSUA, LOGL_ERROR, "DT1 in invalid state %s\n", get_value_string(conn_state_names, conn->state)); - /* FIXME: error message? */ + /* FIXME: send error reply down the sua link? */ return -1; } -- To view, visit https://gerrit.osmocom.org/228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6de8fb202c7beb025232e9b97605e9f46778506a Gerrit-PatchSet: 3 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:37:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:37:07 +0000 Subject: libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 10:38:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 10:38:17 +0000 Subject: [MERGED] libosmocore[master]: add vty call show asciidoc: generate a documentation for cou... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add vty call show asciidoc: generate a documentation for counters ...................................................................... add vty call show asciidoc: generate a documentation for counters For each counter group a ascii doc table is generated containing all single counter with a reference to a section to add additional information to the counter Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Reviewed-on: https://gerrit.osmocom.org/70 Reviewed-by: Harald Welte Tested-by: Harald Welte --- M include/osmocom/vty/command.h M src/vty/command.c M src/vty/stats_vty.c 3 files changed, 197 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index 9a02575..135ef2f 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -379,6 +379,8 @@ char *host_config_file(); void host_config_set(const char *); +char *osmo_asciidoc_escape(const char *inp); + /* This is called from main when a daemon is invoked with -v or --version. */ void print_version(int print_copyright); diff --git a/src/vty/command.c b/src/vty/command.c index 1f1dddb..483ca80 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -402,6 +402,59 @@ return cnode->prompt; } +/*! + * \brief escape all special asciidoc symbols + * \param unsafe string + * \return a new talloc char * + */ +char *osmo_asciidoc_escape(const char *inp) +{ + int _strlen; + char *out, *out_ptr; + int len = 0, i, j; + + if (!inp) + return NULL; + _strlen = strlen(inp); + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '|': + len += 2; + break; + default: + len += 1; + break; + } + } + + out = talloc_size(NULL, len + 1); + if (!out) + return NULL; + + out_ptr = out; + +#define ADD(out, str) \ + for (j = 0; j < strlen(str); ++j) \ + *(out++) = str[j]; + + for (i = 0; i < _strlen; ++i) { + switch (inp[i]) { + case '|': + ADD(out_ptr, "\\|"); + break; + default: + *(out_ptr++) = inp[i]; + break; + } + } + +#undef ADD + + out_ptr[0] = '\0'; + return out; +} + static char *xml_escape(const char *inp) { int _strlen; diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index e0239bf..be5a6aa 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -33,6 +33,8 @@ #include #include +#include +#include #define CFG_STATS_STR "Configure stats sub-system\n" #define CFG_REPORTER_STR "Configure a stats reporter\n" @@ -355,6 +357,144 @@ return CMD_SUCCESS; } +static int asciidoc_handle_counter(struct osmo_counter *counter, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = osmo_asciidoc_escape(counter->name); + char *description = osmo_asciidoc_escape(counter->description); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <> | %s%s", + name, + name, + description ? description : "", + VTY_NEWLINE); + + talloc_free(name); + talloc_free(description); + + return 0; +} + +static void asciidoc_counter_generate(struct vty *vty) +{ + vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE); + vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + osmo_counters_for_each(asciidoc_handle_counter, vty); + vty_out(vty, "|===%s", VTY_NEWLINE); +} + +static int asciidoc_rate_ctr_handler( + struct rate_ctr_group *ctrg, struct rate_ctr *ctr, + const struct rate_ctr_desc *desc, void *sctx_) +{ + struct vty *vty = sctx_; + char *name = osmo_asciidoc_escape(desc->name); + char *description = osmo_asciidoc_escape(desc->description); + char *group_name_prefix = osmo_asciidoc_escape(ctrg->desc->group_name_prefix); + + /* | name | This document & | description | */ + vty_out(vty, "| %s | <<%s_%s>> | %s%s", + name, + group_name_prefix, + name, + description ? description : NULL, + VTY_NEWLINE); + + /* description seems to be optional */ + talloc_free(name); + talloc_free(group_name_prefix); + talloc_free(description); + + return 0; +} + +static int asciidoc_rate_ctr_group_handler(struct rate_ctr_group *ctrg, void *sctx_) +{ + struct vty *vty = sctx_; + + char *group_description = osmo_asciidoc_escape(ctrg->desc->group_description); + char *group_name_prefix = osmo_asciidoc_escape(ctrg->desc->group_name_prefix); + + vty_out(vty, "// rate_ctr_group table %s%s", group_description, VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description, VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description%s", VTY_NEWLINE); + rate_ctr_for_each_counter(ctrg, asciidoc_rate_ctr_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + talloc_free(group_description); + + return 0; +} + +static int asciidoc_osmo_stat_item_handler( + struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_) +{ + struct vty *vty = sctx_; + + char *name = osmo_asciidoc_escape(item->desc->name); + char *description = osmo_asciidoc_escape(item->desc->description); + char *group_name_prefix = osmo_asciidoc_escape(statg->desc->group_name_prefix); + char *unit = osmo_asciidoc_escape(item->desc->unit); + + /* | name | This document & | description | unit | */ + vty_out(vty, "| %s | <<%s_%s>> | %s | %s%s", + name, + group_name_prefix, + name, + description ? description : "", + unit ? unit : "", + VTY_NEWLINE); + + talloc_free(name); + talloc_free(group_name_prefix); + talloc_free(description); + talloc_free(unit); + + return 0; +} + +static int asciidoc_osmo_stat_item_group_handler(struct osmo_stat_item_group *statg, void *sctx_) +{ + char *group_name_prefix = osmo_asciidoc_escape(statg->desc->group_name_prefix); + char *group_description = osmo_asciidoc_escape(statg->desc->group_description); + + struct vty *vty = sctx_; + vty_out(vty, "%s%s", group_description ? group_description : "" , VTY_NEWLINE); + + vty_out(vty, "// osmo_stat_item_group table %s%s", group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, ".%s - %s %s", group_name_prefix, group_description ? group_description : "", VTY_NEWLINE); + vty_out(vty, "|===%s", VTY_NEWLINE); + vty_out(vty, "| name | This document & | description | unit%s", VTY_NEWLINE); + osmo_stat_item_for_each_item(statg, asciidoc_osmo_stat_item_handler, sctx_); + vty_out(vty, "|===%s", VTY_NEWLINE); + + talloc_free(group_name_prefix); + talloc_free(group_description); + + return 0; +} + +DEFUN(show_stats_asciidoc_table, + show_stats_asciidoc_table_cmd, + "show asciidoc counters", + "Generate an ascii doc table of all registered counters.\n") +{ + vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); + rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE); + osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty); + + vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE); + asciidoc_counter_generate(vty); + return CMD_SUCCESS; +} + static int config_write_stats_reporter(struct vty *vty, struct osmo_stats_reporter *srep) { if (srep == NULL) @@ -443,4 +583,6 @@ install_element(CFG_STATS_NODE, &cfg_stats_reporter_level_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_enable_cmd); install_element(CFG_STATS_NODE, &cfg_stats_reporter_disable_cmd); + + install_element_ve(&show_stats_asciidoc_table_cmd); } -- To view, visit https://gerrit.osmocom.org/70 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jun 14 11:47:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 14 Jun 2016 11:47:07 +0000 Subject: [PATCH] openbsc[master]: rm dup: use channel type names from libosmocore Message-ID: Review at https://gerrit.osmocom.org/267 rm dup: use channel type names from libosmocore In gsm_lchant_name(enum gsm_chan_t), use the gsm_chan_t_names value strings from libosmocore instead of redefining the same strings. The list from libosmocore is also more complete, including CCCH and PDTCH. Add a todo comment to move to libosmocore. In consequence, libosmogsm linkage needs to be added to osmo-bsc_mgcp, mgcp_test and smpp_mirror, smpp_test. Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data_shared.c M openbsc/src/osmo-bsc_mgcp/Makefile.am M openbsc/src/utils/Makefile.am M openbsc/tests/mgcp/Makefile.am M openbsc/tests/smpp/Makefile.am 6 files changed, 7 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/67/267/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 8ed11b6..1070f0a 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -774,7 +774,6 @@ const struct value_string gsm_pchant_names[12]; const struct value_string gsm_pchant_descs[12]; -const struct value_string gsm_lchant_names[8]; const char *gsm_pchan_name(enum gsm_phys_chan_config c); enum gsm_phys_chan_config gsm_pchan_parse(const char *name); const char *gsm_lchant_name(enum gsm_chan_t c); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 9f9eb1e..e9eb4b0 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -92,19 +92,10 @@ return get_string_value(gsm_pchant_names, name); } -const struct value_string gsm_lchant_names[8] = { - { GSM_LCHAN_NONE, "NONE" }, - { GSM_LCHAN_SDCCH, "SDCCH" }, - { GSM_LCHAN_TCH_F, "TCH/F" }, - { GSM_LCHAN_TCH_H, "TCH/H" }, - { GSM_LCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_LCHAN_CBCH, "CBCH" }, - { 0, NULL } -}; - +/* TODO: move to libosmocore, next to gsm_chan_t_names? */ const char *gsm_lchant_name(enum gsm_chan_t c) { - return get_value_string(gsm_lchant_names, c); + return get_value_string(gsm_chan_t_names, c); } static const struct value_string lchan_s_names[] = { diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/openbsc/src/osmo-bsc_mgcp/Makefile.am index 949cb64..a48f24b 100644 --- a/openbsc/src/osmo-bsc_mgcp/Makefile.am +++ b/openbsc/src/osmo-bsc_mgcp/Makefile.am @@ -9,6 +9,6 @@ osmo_bsc_mgcp_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libmgcp/libmgcp.a -lrt \ - $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ $(LIBOSMONETIF_LIBS) $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) diff --git a/openbsc/src/utils/Makefile.am b/openbsc/src/utils/Makefile.am index 4521130..5a2e2d2 100644 --- a/openbsc/src/utils/Makefile.am +++ b/openbsc/src/utils/Makefile.am @@ -27,7 +27,7 @@ smpp_mirror_SOURCES = smpp_mirror.c smpp_mirror_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) $(LIBSMPP34_LIBS) + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBSMPP34_LIBS) meas_vis_SOURCES = meas_vis.c meas_vis_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -lcdk -lncurses diff --git a/openbsc/tests/mgcp/Makefile.am b/openbsc/tests/mgcp/Makefile.am index ec7cc99..76aa656 100644 --- a/openbsc/tests/mgcp/Makefile.am +++ b/openbsc/tests/mgcp/Makefile.am @@ -15,7 +15,8 @@ mgcp_test_LDADD = $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ + -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) $(LIBOSMONETIF_LIBS) mgcp_transcoding_test_SOURCES = mgcp_transcoding_test.c diff --git a/openbsc/tests/smpp/Makefile.am b/openbsc/tests/smpp/Makefile.am index 9ab15c5..aab4de9 100644 --- a/openbsc/tests/smpp/Makefile.am +++ b/openbsc/tests/smpp/Makefile.am @@ -10,4 +10,4 @@ $(top_builddir)/src/libmsc/smpp_utils.c smpp_test_LDADD = \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 14 13:34:55 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 14 Jun 2016 13:34:55 +0000 Subject: [PATCH] osmo-pcu[master]: Remove GMSK only check in EGPRS UL Message-ID: Review at https://gerrit.osmocom.org/268 Remove GMSK only check in EGPRS UL Since we are supporting MCS 5-9 in this patch series for EGPRS UL, This condition is not relevant. So removing it. Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a --- M src/bts.cpp 1 file changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/68/268/1 diff --git a/src/bts.cpp b/src/bts.cpp index 9e91b87..8692065 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1344,15 +1344,6 @@ cs.name()); return -EINVAL; } - - if (!cs.isEgprsGmsk()) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not implemented " - "for 8PSK yet\n", - cs.name()); - bts()->decode_error(); - return -EINVAL; - } } LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); -- To view, visit https://gerrit.osmocom.org/268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Jun 14 13:34:56 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 14 Jun 2016 13:34:56 +0000 Subject: [PATCH] osmo-pcu[master]: Add Header Type2 support in EGPRS UL Message-ID: Review at https://gerrit.osmocom.org/269 Add Header Type2 support in EGPRS UL This patch will add support for MCS5,6 in EGPRS UL along with incorrect assert correction to let MCS 6 work. Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba --- M src/decoding.cpp M src/decoding.h M src/tbf_ul.cpp 3 files changed, 54 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/69/269/1 diff --git a/src/decoding.cpp b/src/decoding.cpp index 2600879..e1f8134 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -353,9 +353,11 @@ case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3 : cur_bit = rlc_parse_ul_data_header_egprs_type_3(rlc, data, cs); break; - case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1: - case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2: - /* TODO: Support both header types */ + case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2 : + cur_bit = rlc_parse_ul_data_header_egprs_type_2(rlc, data, cs); + break; + case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1 : + /* TODO: Support both header type 1 */ /* fall through */ default: LOGP(DRLCMACDL, LOGL_ERROR, @@ -409,6 +411,50 @@ return cur_bit; } +int Decoding::rlc_parse_ul_data_header_egprs_type_2( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs) +{ + const struct gprs_rlc_ul_header_egprs_2 *egprs2; + unsigned int e_ti_header, offs, cur_bit = 0; + int punct, punct2, with_padding, cps; + + egprs2 = static_cast < struct gprs_rlc_ul_header_egprs_2 * > + ((void *)data); + + cps = (egprs2->cps_a << 0) | (egprs2->cps_b << 2); + gprs_rlc_mcs_cps_decode(cps, cs, &punct, &punct2, &with_padding); + gprs_rlc_data_info_init_ul(rlc, cs, with_padding); + + rlc->r = egprs2->r; + rlc->si = egprs2->si; + rlc->tfi = (egprs2->tfi_a << 0) | (egprs2->tfi_b << 2); + rlc->cps = cps; + rlc->rsb = egprs2->rsb; + + rlc->num_data_blocks = 1; + rlc->block_info[0].cv = egprs2->cv; + rlc->block_info[0].pi = egprs2->pi; + rlc->block_info[0].bsn = + (egprs2->bsn1_a << 0) | (egprs2->bsn1_b << 5); + + cur_bit += rlc->data_offs_bits[0] - 2; + + offs = rlc->data_offs_bits[0] / 8; + OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 7); + + e_ti_header = (data[offs] & 0x60) >> 5; + rlc->block_info[0].e = !!(e_ti_header & 0x01); + rlc->block_info[0].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + + /* skip data area */ + cur_bit += cs.maxDataBlockBytes() * 8; + + return cur_bit; +} + int Decoding::rlc_parse_ul_data_header_gprs(struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs) { diff --git a/src/decoding.h b/src/decoding.h index 50c9e7d..736adf1 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -48,6 +48,10 @@ struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs); + static int rlc_parse_ul_data_header_egprs_type_2( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs); static int rlc_parse_ul_data_header_gprs( struct gprs_rlc_data_info *rlc, const uint8_t *data, diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 98962d1..4d283a9 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -225,7 +225,7 @@ block = m_rlc.block(rdbi->bsn); block->block_info = *rdbi; block->cs = rlc->cs; - OSMO_ASSERT(rdbi->data_len < sizeof(block->block)); + OSMO_ASSERT(rdbi->data_len <= sizeof(block->block)); rlc_data = &(block->block[0]); /* TODO: Handle SPB != 0 -> Set length to 2*len, add offset if * 2nd part. Note that resegmentation is currently disabled -- To view, visit https://gerrit.osmocom.org/269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Jun 14 13:34:56 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 14 Jun 2016 13:34:56 +0000 Subject: [PATCH] osmo-pcu[master]: Add header type 1 support for EGPRS uplink Message-ID: Review at https://gerrit.osmocom.org/270 Add header type 1 support for EGPRS uplink Function is added to parse the EGPRS header type 1 in uplink tbf path. along with configuration parameter updation to reflect max mcs in UL Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a --- M src/bts.h M src/decoding.cpp M src/decoding.h M src/encoding.cpp M src/gprs_ms.cpp M src/pcu_main.cpp 6 files changed, 73 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/70/270/1 diff --git a/src/bts.h b/src/bts.h index a713c46..63bb3cd 100644 --- a/src/bts.h +++ b/src/bts.h @@ -188,7 +188,7 @@ uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; - struct {int16_t low; int16_t high;} cs_lqual_ranges[4]; + struct {int16_t low; int16_t high; } cs_lqual_ranges[9]; uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */ uint16_t ws_base; uint16_t ws_pdch; /* increase WS by this value per PDCH */ diff --git a/src/decoding.cpp b/src/decoding.cpp index e1f8134..7865be0 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -357,8 +357,8 @@ cur_bit = rlc_parse_ul_data_header_egprs_type_2(rlc, data, cs); break; case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1 : - /* TODO: Support both header type 1 */ - /* fall through */ + cur_bit = rlc_parse_ul_data_header_egprs_type_1(rlc, data, cs); + break; default: LOGP(DRLCMACDL, LOGL_ERROR, "Decoding of uplink %s data blocks not yet supported.\n", @@ -455,6 +455,65 @@ return cur_bit; } +int Decoding::rlc_parse_ul_data_header_egprs_type_1( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, const GprsCodingScheme &cs) +{ + struct gprs_rlc_ul_header_egprs_1 *egprs1; + unsigned int e_ti_header, cur_bit = 0, offs; + int punct, punct2, with_padding; + + egprs1 = static_cast < struct gprs_rlc_ul_header_egprs_1 * > + ((void *)data); + gprs_rlc_mcs_cps_decode(egprs1->cps, cs, &punct, &punct2, + &with_padding); + gprs_rlc_data_info_init_ul(rlc, cs, with_padding); + + rlc->r = egprs1->r; + rlc->si = egprs1->si; + rlc->tfi = (egprs1->tfi_a << 0) | (egprs1->tfi_b << 2); + rlc->cps = egprs1->cps; + rlc->rsb = egprs1->rsb; + rlc->num_data_blocks = 2; + rlc->block_info[0].cv = egprs1->cv; + rlc->block_info[0].pi = egprs1->pi; + rlc->block_info[0].bsn = + (egprs1->bsn1_a << 0) | (egprs1->bsn1_b << 5); + + cur_bit += rlc->data_offs_bits[0] - 2; + offs = rlc->data_offs_bits[0] / 8; + OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 0); + + e_ti_header = data[offs - 1] >> 6; + rlc->block_info[0].e = (e_ti_header & 0x01); + rlc->block_info[0].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + + rlc->block_info[1].cv = egprs1->cv; + rlc->block_info[1].pi = egprs1->pi; + rlc->block_info[1].bsn = rlc->block_info[0].bsn + + ((egprs1->bsn2_a << 0) | (egprs1->bsn2_b << 2)); + rlc->block_info[1].bsn = rlc->block_info[1].bsn & (RLC_EGPRS_SNS - 1); + + if ((rlc->block_info[1].bsn != rlc->block_info[0].bsn) && + (rlc->block_info[0].cv == 0)) + rlc->block_info[0].cv = 1; + + cur_bit = rlc->data_offs_bits[1] - 2; + + offs = rlc->data_offs_bits[1] / 8; + OSMO_ASSERT(rlc->data_offs_bits[1] % 8 == 2); + + e_ti_header = (data[offs] & (0x03)); + rlc->block_info[1].e = (e_ti_header & 0x01); + rlc->block_info[1].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + /* skip data area */ + cur_bit += cs.maxDataBlockBytes() * 8; + + return cur_bit; +} + int Decoding::rlc_parse_ul_data_header_gprs(struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs) { diff --git a/src/decoding.h b/src/decoding.h index 736adf1..d1371d5 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -52,6 +52,10 @@ struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs); + static int rlc_parse_ul_data_header_egprs_type_1( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs); static int rlc_parse_ul_data_header_gprs( struct gprs_rlc_data_info *rlc, const uint8_t *data, diff --git a/src/encoding.cpp b/src/encoding.cpp index 2102a1e..e174c80 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -610,8 +610,9 @@ struct gprs_rlcmac_ul_tbf *tbf, bool is_final) { bitvec_write_field(dest, wp, 0, 2); // fixed 00 - bitvec_write_field(dest, wp, 2, 4); // CHANNEL_CODING_COMMAND: MCS-3 - // bitvec_write_field(dest, wp, tbf->current_cs() - 1, 4); // CHANNEL_CODING_COMMAND + /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, wp, + tbf->current_cs().to_num() - 1, 4); bitvec_write_field(dest, wp, 0, 1); // 0: no RESEGMENT (nyi) bitvec_write_field(dest, wp, 1, 1); // PRE_EMPTIVE_TRANSMISSION, TODO: This resembles GPRS, change it? bitvec_write_field(dest, wp, 0, 1); // 0: no PRR_RETRANSMISSION_REQUEST, TODO: clarify diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 4296fd3..83f1cbf 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -632,8 +632,8 @@ high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else if (m_current_cs_ul.isEgprs()) { /* TODO, use separate table */ - if (current_cs_num > 4) - current_cs_num = 4; + if (current_cs_num > 9) + current_cs_num = 9; low = bts_data->cs_lqual_ranges[current_cs_num-1].low; high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else { diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index f66c631..82e1005 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -189,8 +189,8 @@ bts->cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */ bts->max_cs_ul = 4; bts->max_cs_dl = 4; - bts->max_mcs_ul = 4; - bts->max_mcs_dl = 4; + bts->max_mcs_ul = 9; + bts->max_mcs_dl = 9; /* CS-1 to CS-4 */ bts->cs_lqual_ranges[0].low = -256; bts->cs_lqual_ranges[0].high = 6; -- To view, visit https://gerrit.osmocom.org/270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Jun 14 13:34:56 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 14 Jun 2016 13:34:56 +0000 Subject: [PATCH] osmo-pcu[master]: Add test cases for Header Type 2 in EGPRS UL Message-ID: Review at https://gerrit.osmocom.org/271 Add test cases for Header Type 2 in EGPRS UL Updates the test suite to add test cases for Header type 2 parsing in EGPRS UL. Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 --- M tests/edge/EdgeTest.cpp M tests/edge/EdgeTest.ok 2 files changed, 128 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/271/1 diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 68a0d0b..f8adbbb 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -26,7 +26,7 @@ #include "encoding.h" #include "rlc.h" #include "llc.h" - +#include "bts.h" extern "C" { #include "pcu_vty.h" @@ -1156,6 +1156,130 @@ ARRAY_SIZE(default_categories), }; +static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1) +{ + gprs_rlcmac_bts *bts; + gprs_rlcmac_trx *trx; + + bts = the_bts->bts_data(); + bts->egprs_enabled = true; + bts->alloc_algorithm = alloc_algorithm_a; + bts->initial_cs_dl = cs; + bts->initial_cs_ul = cs; + trx = &bts->trx[0]; + trx->pdch[ts_no].enable(); +} +static void uplink_header_type_2_parsing_test(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class) +{ + GprsMs *ms; + struct pcu_l1_meas meas; + int tfi = 0; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + uint8_t data[79] = {0}; + struct gprs_rlc_ul_header_egprs_2 *egprs2 = NULL; + + egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data; + bts = the_bts->bts_data(); + + tfi = 1; + + struct gprs_rlc_data_info rlc; + GprsCodingScheme cs; + int rc, offs; + + /*without padding*/ + cs = GprsCodingScheme::MCS5; + egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data; + egprs2->r = 1; + egprs2->si = 1; + egprs2->cv = 7; + egprs2->tfi_a = tfi & 0x03; + egprs2->tfi_b = (tfi & 0x1c) >> 2; + egprs2->bsn1_a = 0; + egprs2->bsn1_b = 0; + egprs2->cps_a = 3; + egprs2->cps_b = 0; + egprs2->rsb = 0; + egprs2->pi = 0; + data[4] = 0x20; /* Setting E field */ + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + offs = rlc.data_offs_bits[0] / 8; + OSMO_ASSERT(offs == 4); + OSMO_ASSERT(rlc.tfi == 1); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + + /* with padding case */ + cs = GprsCodingScheme::MCS6; + egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data; + egprs2->r = 1; + egprs2->si = 1; + egprs2->cv = 7; + egprs2->tfi_a = tfi & 0x03; + egprs2->tfi_b = (tfi & 0x1c) >> 2; + egprs2->bsn1_a = 0; + egprs2->bsn1_b = 0; + egprs2->cps_a = 3; + egprs2->cps_b = 0; + egprs2->rsb = 0; + egprs2->pi = 0; + data[10] = 0x20; /* Setting E field */ + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + offs = rlc.data_offs_bits[0] / 8; + OSMO_ASSERT(offs == 10); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.tfi == 1); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + + egprs2->r = 1; + egprs2->si = 1; + egprs2->cv = 7; + egprs2->tfi_a = tfi & 0x03; + egprs2->tfi_b = (tfi & 0x1c) >> 2; + egprs2->bsn1_a = 1; + egprs2->bsn1_b = 0; + egprs2->cps_a = 2; + egprs2->cps_b = 0; + egprs2->rsb = 0; + egprs2->pi = 0; + data[10] = 0x20; /* Setting E field */ + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + offs = rlc.data_offs_bits[0] / 8; + OSMO_ASSERT(offs == 10); + OSMO_ASSERT(rlc.tfi == 1); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 1); +} + +static void uplink_header_type2_test(void) +{ + BTS the_bts; + int ts_no = 7; + uint32_t fn = 2654218; + uint16_t qta = 31; + uint32_t tlli = 0xf1223344; + const char *imsi = "0011223344"; + uint8_t ms_class = 1; + gprs_rlcmac_ul_tbf *ul_tbf; + GprsMs *ms; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, ts_no, 10); + + uplink_header_type_2_parsing_test(&the_bts, ts_no, + tlli, &fn, qta, ms_class); + printf("=== end %s ===\n", __func__); +} + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -1178,6 +1302,7 @@ test_rlc_unaligned_copy(); test_rlc_unit_encoder(); + uplink_header_type2_test(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); return EXIT_SUCCESS; diff --git a/tests/edge/EdgeTest.ok b/tests/edge/EdgeTest.ok index 9554df3..95ca60b 100644 --- a/tests/edge/EdgeTest.ok +++ b/tests/edge/EdgeTest.ok @@ -6,3 +6,5 @@ === end test_rlc_unit_decoder === === start test_rlc_unit_encoder === === end test_rlc_unit_encoder === +=== start uplink_header_type2_test === +=== end uplink_header_type2_test === -- To view, visit https://gerrit.osmocom.org/271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Jun 14 13:34:56 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 14 Jun 2016 13:34:56 +0000 Subject: [PATCH] osmo-pcu[master]: Add test cases for Header type1 in EGPRS UL Message-ID: Review at https://gerrit.osmocom.org/272 Add test cases for Header type1 in EGPRS UL Update test suite with test cases for Header type 1 in EGPRS UL Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 --- M tests/edge/EdgeTest.cpp M tests/edge/EdgeTest.ok 2 files changed, 124 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/272/1 diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index f8adbbb..8b5746a 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -1280,6 +1280,126 @@ printf("=== end %s ===\n", __func__); } +static void uplink_header_type_1_parsing_test(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class) +{ + uint8_t trx_no = 0; + int tfi = 0; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + uint8_t data[155] = {0}; + struct gprs_rlc_ul_header_egprs_1 *egprs1 = NULL; + struct gprs_rlc_data_info rlc; + GprsCodingScheme cs; + int rc, offs; + + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + bts = the_bts->bts_data(); + + tfi = 1; + + /* MCS 7 */ + cs = GprsCodingScheme::MCS7; + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + egprs1->si = 1; + egprs1->r = 1; + egprs1->cv = 7; + egprs1->tfi_a = tfi & 0x03; + egprs1->tfi_b = (tfi & 0x1c) >> 2; + egprs1->bsn1_a = 0; + egprs1->bsn1_b = 0; + egprs1->bsn2_a = 1; + egprs1->bsn2_b = 0; + egprs1->cps = 15; + egprs1->rsb = 0; + egprs1->pi = 0; + data[5] = 0xc0; + data[5 + 57] = 1; + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + OSMO_ASSERT(rlc.num_data_blocks == 2); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 1); + OSMO_ASSERT(rlc.block_info[1].e == 1); + OSMO_ASSERT(rlc.block_info[1].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + OSMO_ASSERT(rlc.block_info[1].bsn == 1); + OSMO_ASSERT(rlc.tfi == 1); + + /* MCS 8 */ + cs = GprsCodingScheme::MCS8; + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + egprs1->si = 1; + egprs1->r = 1; + egprs1->cv = 7; + egprs1->tfi_a = tfi & 0x03; + egprs1->tfi_b = (tfi & 0x1c) >> 2; + egprs1->bsn1_a = 0; + egprs1->bsn1_b = 0; + egprs1->bsn2_a = 1; + egprs1->bsn2_b = 0; + egprs1->cps = 15; + egprs1->rsb = 0; + egprs1->pi = 0; + data[5] = 0xc0; + data[5 + 69] = 1; + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + OSMO_ASSERT(rlc.num_data_blocks == 2); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 1); + OSMO_ASSERT(rlc.block_info[1].e == 1); + OSMO_ASSERT(rlc.block_info[1].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + OSMO_ASSERT(rlc.block_info[1].bsn == 1); + OSMO_ASSERT(rlc.tfi == 1); + + /* MCS 9 */ + cs = GprsCodingScheme::MCS9; + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + egprs1->si = 1; + egprs1->r = 1; + egprs1->cv = 7; + egprs1->tfi_a = tfi & 0x03; + egprs1->tfi_b = (tfi & 0x1c) >> 2; + egprs1->bsn1_a = 0; + egprs1->bsn1_b = 0; + egprs1->bsn2_a = 1; + egprs1->bsn2_b = 0; + egprs1->cps = 15; + egprs1->rsb = 0; + egprs1->pi = 0; + data[5] = 0xc0; + data[5 + 75] = 1; + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + OSMO_ASSERT(rlc.num_data_blocks == 2); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 1); + OSMO_ASSERT(rlc.block_info[1].e == 1); + OSMO_ASSERT(rlc.block_info[1].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + OSMO_ASSERT(rlc.block_info[1].bsn == 1); + OSMO_ASSERT(rlc.tfi == 1); +} + +void uplink_header_type1_test(void) +{ + BTS the_bts; + int ts_no = 7; + uint32_t fn = 2654218; + uint16_t qta = 31; + uint32_t tlli = 0xf1223344; + const char *imsi = "0011223344"; + uint8_t ms_class = 1; + gprs_rlcmac_ul_tbf *ul_tbf; + GprsMs *ms; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, ts_no, 12); + uplink_header_type_1_parsing_test(&the_bts, ts_no, tlli, &fn, + qta, ms_class); + printf("=== end %s ===\n", __func__); +} + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -1303,6 +1423,8 @@ test_rlc_unit_encoder(); uplink_header_type2_test(); + uplink_header_type1_test(); + if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); return EXIT_SUCCESS; diff --git a/tests/edge/EdgeTest.ok b/tests/edge/EdgeTest.ok index 95ca60b..cdc5cc3 100644 --- a/tests/edge/EdgeTest.ok +++ b/tests/edge/EdgeTest.ok @@ -8,3 +8,5 @@ === end test_rlc_unit_encoder === === start uplink_header_type2_test === === end uplink_header_type2_test === +=== start uplink_header_type1_test === +=== end uplink_header_type1_test === -- To view, visit https://gerrit.osmocom.org/272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Formatted O&M with BTS number i... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/256 to look at the new patch set (#2). LC15: common/oml.c : Alarm - Formatted O&M with BTS number is out of range Change-Id: I15a227a60c75b8a91005b18afb6256f34d6b71b4 --- M src/common/oml.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/256/2 diff --git a/src/common/oml.c b/src/common/oml.c index b5394dc..c840f11 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1006,7 +1006,23 @@ } if (foh->obj_inst.bts_nr != 0 && foh->obj_inst.bts_nr != 0xff) { - LOGP(DOML, LOGL_INFO, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + snprintf(log_msg, 100, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); + LOGP(DOML, LOGL_INFO,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx){ + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + return oml_fom_ack_nack(msg, NM_NACK_BTSNR_UNKN); } -- To view, visit https://gerrit.osmocom.org/256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I15a227a60c75b8a91005b18afb6256f34d6b71b4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Unknown formatted O&M message type In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/257 to look at the new patch set (#2). LC15: common/oml.c : Alarm - Unknown formatted O&M message type Change-Id: I6b700c58b3780d401968610965f07b63872b578c --- M src/common/oml.c 1 file changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/57/257/2 diff --git a/src/common/oml.c b/src/common/oml.c index c840f11..a93f5b9 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1054,8 +1054,25 @@ ret = oml_ipa_set_attr(bts, msg); break; default: - LOGP(DOML, LOGL_INFO, "unknown Formatted O&M msg_type 0x%02x\n", - foh->msg_type); + snprintf(log_msg, 100, "unknown Formatted O&M msg_type 0x%02x\n", foh->msg_type); + LOGP(DOML, LOGL_INFO,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } else { + oml_tx_failure_event_rep(&bts->mo, failure_rep); + } + ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL); } -- To view, visit https://gerrit.osmocom.org/257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6b700c58b3780d401968610965f07b63872b578c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported IPA set attributes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/258 to look at the new patch set (#2). LC15: common/oml.c : Alarm - Unsupported IPA set attributes Change-Id: I78f2f846132f9996bb4008643f1a666e366d2f85 --- M src/common/oml.c 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/258/2 diff --git a/src/common/oml.c b/src/common/oml.c index a93f5b9..6b42b16 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1236,13 +1236,26 @@ struct tlv_parsed tp; void *obj; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx IPA SET ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for IPAC Set Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); + oml_tx_failure_event_rep(mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* Resolve MO by obj_class/obj_inst */ mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst); -- To view, visit https://gerrit.osmocom.org/258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I78f2f846132f9996bb4008643f1a666e366d2f85 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/l1sap.c : Alarm - Unknown uplink L1SAP primitive In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/259 to look at the new patch set (#2). LC15: common/l1sap.c : Alarm - Unknown uplink L1SAP primitive Change-Id: I4943eabecb971f7cfece24c35b0e9e0e660f31a0 --- M src/common/l1sap.c 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/59/259/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 77fd1a0..78e15e7 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -46,6 +46,7 @@ #include #include #include +#include "osmo-bts/oml.h" static struct gsm_lchan * get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) @@ -933,6 +934,8 @@ { struct msgb *msg = l1sap->oph.msg; int rc = 0; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; switch (OSMO_PRIM_HDR(&l1sap->oph)) { case OSMO_PRIM(PRIM_MPH_INFO, PRIM_OP_INDICATION): @@ -959,8 +962,16 @@ rc = l1sap_ph_rach_ind(trx, l1sap, &l1sap->u.rach_ind); break; default: - LOGP(DL1P, LOGL_NOTICE, "unknown prim %d op %d\n", - l1sap->oph.primitive, l1sap->oph.operation); + snprintf(log_msg, 100, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + LOGP(DL1P, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&trx->mo, failure_rep); break; } -- To view, visit https://gerrit.osmocom.org/259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4943eabecb971f7cfece24c35b0e9e0e660f31a0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Introduce measurement management messages, TS 12.21 se... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/260 to look at the new patch set (#2). LC15: Introduce measurement management messages, TS 12.21 section 8.10 Change-Id: Ic930baa69fc09ad5059627ed3d85cce5474085b0 --- M include/osmo-bts/oml.h M include/osmo-bts/pcu_if.h M include/osmo-bts/pcuif_proto.h M src/common/oml.c M src/common/pcu_sock.c 5 files changed, 455 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/260/2 diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index 1182437..77ba751 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -16,6 +16,14 @@ }; /* FIXME: can move to libosmocore */ +enum abis_nm_msgtype_ipacc_appended { + NM_MT_IPACC_START_MEAS_ACK = 0xde, + NM_MT_IPACC_MEAS_RES_REQ_NACK = 0xfc, + NM_MT_IPACC_START_MEAS_NACK = 0xfd, + NM_MT_IPACC_STOP_MEAS_ACK = 0xdf, + NM_MT_IPACC_STOP_MEAS_NACK = 0xfe, +}; + enum abis_mm_event_causes { /* Critical causes */ NM_MM_EVT_CRIT_SW_FATAL = 0x0000, @@ -72,4 +80,11 @@ /* Transmit failure event report */ int oml_tx_failure_event_rep(struct gsm_abis_mo *mo, struct gsm_failure_evt_rep failure_evt_rep); +/* Transmit start/stop/request measurement messages*/ +int oml_tx_mm_start_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause); +int oml_tx_mm_meas_res_req_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause); +int oml_tx_mm_meas_res_resp(struct gsm_abis_mo *mo, struct gsm_pcu_if_meas_resp meas_resp); +int oml_tx_mm_stop_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause); + + #endif // _OML_H */ diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 0c4fb69..ea00493 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -19,4 +19,8 @@ int pcu_sock_init(const char *path); void pcu_sock_exit(void); +int pcu_tx_mm_start_meas(struct gsm_bts *bts, uint8_t meas_id); +int pcu_tx_mm_meas_res_req(struct gsm_bts *bts, uint8_t meas_id); +int pcu_tx_mm_stop_meas(struct gsm_bts *bts, uint8_t meas_id); + #endif /* _PCU_IF_H */ diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index 75e911b..14cb770 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -1,5 +1,6 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H +#include #define PCU_IF_VERSION 0x05 @@ -15,7 +16,17 @@ #define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ /*alarms & performance counters */ +#define PCU_IF_MSG_START_MEAS_REQ 0x61 /* PCU start measurement request */ +#define PCU_IF_MSG_START_MEAS_ACK 0x62 /* PCU start measurement ACK */ +#define PCU_IF_MSG_START_MEAS_NACK 0x63 /* PCU start measurement NACK */ +#define PCU_IF_MSG_MEAS_RES_REQ 0x64 /* PCU measurement result request*/ +#define PCU_IF_MSG_MEAS_RES_RESP 0x65 /* PCU measurement result response*/ +#define PCU_IF_MSG_MEAS_RES_NACK 0x66 /* PCU measurement result NACK*/ #define PCU_IF_MSG_FAILURE_EVT_IND 0x67 /* PCU failure event report indication*/ +#define PCU_IF_MSG_STOP_MEAS_REQ 0x68 /* PCU stop measurement request */ +#define PCU_IF_MSG_STOP_MEAS_ACK 0x69 /* PCU stop measurement ACK */ +#define PCU_IF_MSG_STOP_MEAS_NACK 0x6a /* PCU stop measurement NACK */ + /* sapi */ #define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ @@ -142,6 +153,24 @@ char add_text[100]; }__attribute__ ((packed)); +struct gsm_pcu_if_start_meas_req { + uint8_t meas_id; /*measurement ID */ + uint8_t nack_cause; + uint8_t spare[2]; +}__attribute__ ((packed)); + +struct gsm_pcu_if_meas_req { + uint8_t meas_id; /*measurement ID */ + uint8_t spare[2]; +}__attribute__ ((packed)); + +struct gsm_pcu_if_meas_resp { + uint8_t meas_id; /*measurement ID */ + uint8_t nack_cause; /*NACK cause */ + uint16_t len; /*total result length */ + uint8_t data[100]; /*PM counter result must be started from here */ +}__attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -159,6 +188,10 @@ struct gsm_pcu_if_time_ind time_ind; struct gsm_pcu_if_pag_req pag_req; struct gsm_pcu_if_fail_evt_ind failure_evt_ind; + struct gsm_pcu_if_start_meas_req start_meas_req; + struct gsm_pcu_if_start_meas_req stop_meas_req; + struct gsm_pcu_if_meas_req meas_req; + struct gsm_pcu_if_meas_resp meas_resp; } u; } __attribute__ ((packed)); diff --git a/src/common/oml.c b/src/common/oml.c index 6b42b16..f7f2444 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -90,6 +90,9 @@ [NM_ATT_IPACC_SEC_POSSIBLE] = { TLV_TYPE_TL16V }, [NM_ATT_IPACC_IML_SSL_STATE] = { TLV_TYPE_TL16V }, [NM_ATT_IPACC_REVOC_DATE] = { TLV_TYPE_TL16V }, + /* GSM 12.21 attributes */ + [NM_ATT_MEAS_TYPE] = { TLV_TYPE_TV }, + [NM_ATT_MEAS_RES] = { TLV_TYPE_TV }, }, }; @@ -401,6 +404,81 @@ return oml_mo_send_msg(mo, nmsg, NM_MT_FAILURE_EVENT_REP); +} + +/* TS 12.21 8.10.2 */ +int oml_tx_mm_meas_res_resp(struct gsm_abis_mo *mo, struct gsm_pcu_if_meas_resp meas_resp) +{ + struct msgb *nmsg; + + LOGP(DOML, LOGL_INFO, "%s Tx MEASurement RESult RESPonse\n", gsm_abis_mo_name(mo)); + + nmsg = oml_msgb_alloc(); + if (!nmsg) + return -ENOMEM; + + msgb_tv_put(nmsg, NM_ATT_MEAS_TYPE, meas_resp.meas_id); + msgb_tl16v_put(nmsg, NM_ATT_MEAS_RES, meas_resp.len, meas_resp.data); + + return oml_mo_send_msg(mo, nmsg, NM_MT_MEAS_RES_RESP); +} + +int oml_tx_mm_start_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause) +{ + struct msgb *msg; + uint8_t msg_type; + + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + + if (nack_cause) { + msg_type = NM_MT_IPACC_START_MEAS_NACK; + msgb_tv_put(msg, NM_ATT_NACK_CAUSES, nack_cause); + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } else { + msg_type = NM_MT_IPACC_START_MEAS_ACK; + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } + + return oml_mo_send_msg(mo, msg, msg_type); +} + +int oml_tx_mm_stop_meas_ack_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause) +{ + struct msgb *msg; + uint8_t msg_type; + + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + + if (nack_cause) { + msg_type = NM_MT_IPACC_STOP_MEAS_NACK; + msgb_tv_put(msg, NM_ATT_NACK_CAUSES, nack_cause); + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } else { + msg_type = NM_MT_IPACC_STOP_MEAS_ACK; + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + } + + return oml_mo_send_msg(mo, msg, msg_type); +} + +int oml_tx_mm_meas_res_req_nack(struct gsm_abis_mo *mo, uint8_t meas_id, uint8_t nack_cause) +{ + struct msgb *msg; + uint8_t msg_type; + + msg = oml_msgb_alloc(); + if (!msg) + return -ENOMEM; + + msg_type = NM_MT_IPACC_MEAS_RES_REQ_NACK; + msgb_tv_put(msg, NM_ATT_NACK_CAUSES, nack_cause); + msgb_tv_put(msg, NM_ATT_MEAS_TYPE, meas_id); + + return oml_mo_send_msg(mo, msg, msg_type); } /* TS 12.21 9.4.53 */ @@ -976,6 +1054,197 @@ return bts_model_chg_adm_state(bts, mo, obj, adm_state); } +/* GSM 12.21 section 8.10.1 */ +static int oml_rx_mm_meas_res_req(struct gsm_bts *bts, struct msgb *msg) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + struct gsm_abis_mo *mo = &bts->gprs.cell.mo; + struct tlv_parsed tp; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + uint8_t meas_id; + + LOGP(DOML, LOGL_DEBUG, "%s Rx MEAS RES REQ\n", gsm_abis_mo_name(mo)); + + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + if (!TLVP_PRESENT(&tp, NM_ATT_MEAS_TYPE)) { + snprintf(log_msg, 100, "%s NM_ATT_MEAS_TYPE not found\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + /* Get measurement ID */ + meas_id = *TLVP_VAL(&tp, NM_ATT_MEAS_TYPE); + + /* send request to PCU */ + rc = pcu_tx_mm_meas_res_req(bts, meas_id); + if (rc < 0) { + snprintf(log_msg, 100, "%s PCU socket may not be ready for measurement ID (%d)\n", gsm_abis_mo_name(mo), meas_id); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_NET_CONGEST; + failure_rep.add_text = (char *)&log_msg; + + /*send alarm to indicate PCU link is not ready */ + oml_tx_failure_event_rep(mo, failure_rep); + + /*send MEAS RES REQ NACK */ + return oml_tx_mm_meas_res_req_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); + } + + return 0; +} + +/* GSM 12.21 section 8.10.3 */ +static int oml_rx_mm_start_meas(struct gsm_bts *bts, struct msgb *msg) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + struct gsm_abis_mo *mo = &bts->gprs.cell.mo; + struct tlv_parsed tp; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + uint8_t meas_id; + + LOGP(DOML, LOGL_DEBUG, "%s Rx START MEAS\n", gsm_abis_mo_name(mo)); + + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + if (!TLVP_PRESENT(&tp, NM_ATT_MEAS_TYPE)) { + snprintf(log_msg, 100, "%s PCU socket may not be ready for measurement ID (%d)\n", gsm_abis_mo_name(mo), meas_id); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + /* Get measurement ID */ + meas_id = *TLVP_VAL(&tp, NM_ATT_MEAS_TYPE); + + /* send request to PCU */ + rc = pcu_tx_mm_start_meas(bts, meas_id); + if (rc < 0) { + snprintf(log_msg, 100, "%s PCU socket may not be ready\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_NET_CONGEST; + failure_rep.add_text = (char *)&log_msg; + + /*send alarm to indicate PCU link is not ready */ + oml_tx_failure_event_rep(mo, failure_rep); + + /*send START MEAS NACK */ + return oml_tx_mm_start_meas_ack_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); + } + + return 0; +} + +static int oml_rx_mm_stop_meas(struct gsm_bts *bts, struct msgb *msg) +{ + struct abis_om_fom_hdr *foh = msgb_l3(msg); + struct gsm_abis_mo *mo = &bts->gprs.cell.mo; + struct tlv_parsed tp; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + uint8_t meas_id; + + LOGP(DOML, LOGL_DEBUG, "%s Rx STOP MEAS\n", gsm_abis_mo_name(mo)); + + rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + if (!TLVP_PRESENT(&tp, NM_ATT_MEAS_TYPE)) { + snprintf(log_msg, 100, "%s PCU socket may not be ready for measurement ID (%d)\n", gsm_abis_mo_name(mo), meas_id); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(mo, failure_rep); + return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } + + /* Get measurement ID */ + meas_id = *TLVP_VAL(&tp, NM_ATT_MEAS_TYPE); + + /* send request to PCU */ + rc = pcu_tx_mm_stop_meas(bts, meas_id); + if (rc < 0) { + snprintf(log_msg, 100, "%s PCU socket may not be ready\n", gsm_abis_mo_name(mo)); + LOGP(DOML, LOGL_ERROR,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_NET_CONGEST; + failure_rep.add_text = (char *)&log_msg; + + /*send alarm to indicate PCU link is not ready */ + oml_tx_failure_event_rep(mo, failure_rep); + + /*send STOP MEAS NACK */ + return oml_tx_mm_stop_meas_ack_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); + } + + return 0; +} + static int down_fom(struct gsm_bts *bts, struct msgb *msg) { struct abis_om_fom_hdr *foh = msgb_l3(msg); @@ -1053,6 +1322,15 @@ case NM_MT_IPACC_SET_ATTR: ret = oml_ipa_set_attr(bts, msg); break; + case NM_MT_START_MEAS: + ret = oml_rx_mm_start_meas(bts, msg); + break; + case NM_MT_MEAS_RES_REQ: + ret = oml_rx_mm_meas_res_req(bts, msg); + break; + case NM_MT_STOP_MEAS: + ret = oml_rx_mm_stop_meas(bts, msg); + break; default: snprintf(log_msg, 100, "unknown Formatted O&M msg_type 0x%02x\n", foh->msg_type); LOGP(DOML, LOGL_INFO,"%s", log_msg); diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 77186c0..bff65c6 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -449,6 +449,64 @@ return pcu_sock_send(&bts_gsmnet, msg); } +int pcu_tx_mm_start_meas(struct gsm_bts *bts, uint8_t meas_id) +{ + struct gsm_pcu_if *pcu_prim; + struct gsm_pcu_if_start_meas_req *start_meas_req; + struct msgb *msg; + + msg = pcu_msgb_alloc(PCU_IF_MSG_START_MEAS_REQ, bts->nr); + if (!msg) + return -ENOMEM; + + pcu_prim = (struct gsm_pcu_if *) msg->data; + start_meas_req = &pcu_prim->u.start_meas_req; + start_meas_req->meas_id = meas_id; + + LOGP(DPCU, LOGL_INFO, "[BTS->PCU] Sent STAT MEASurement REQuest: 0x%02x\n", start_meas_req->meas_id); + + return pcu_sock_send(&bts_gsmnet, msg); +} + +int pcu_tx_mm_stop_meas(struct gsm_bts *bts, uint8_t meas_id) +{ + struct gsm_pcu_if *pcu_prim; + struct gsm_pcu_if_start_meas_req *stop_meas_req; + struct msgb *msg; + + msg = pcu_msgb_alloc(PCU_IF_MSG_STOP_MEAS_REQ, bts->nr); + if (!msg) + return -ENOMEM; + + pcu_prim = (struct gsm_pcu_if *) msg->data; + stop_meas_req = &pcu_prim->u.start_meas_req; + stop_meas_req->meas_id = meas_id; + + LOGP(DPCU, LOGL_INFO, "[BTS->PCU] Sent STOP MEASurement REQuest: 0x%02x\n", stop_meas_req->meas_id); + + return pcu_sock_send(&bts_gsmnet, msg); +} + +int pcu_tx_mm_meas_res_req(struct gsm_bts *bts, uint8_t meas_id) +{ + struct gsm_pcu_if *pcu_prim; + struct gsm_pcu_if_meas_req *meas_req; + struct msgb *msg; + + msg = pcu_msgb_alloc(PCU_IF_MSG_MEAS_RES_REQ, bts->nr); + if (!msg) + return -ENOMEM; + + pcu_prim = (struct gsm_pcu_if *) msg->data; + meas_req = &pcu_prim->u.meas_req; + meas_req->meas_id = meas_id; + + LOGP(DPCU, LOGL_INFO, "[BTS->PCU ]Sent MEASurement RESult REQuest: 0x%02x\n", meas_req->meas_id); + + return pcu_sock_send(&bts_gsmnet, msg); +} + + static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type, struct gsm_pcu_if_data *data_req) { @@ -573,6 +631,55 @@ return rc; } +static int pcu_rx_mm_start_meas_ack_nack(struct gsm_bts *bts, struct gsm_pcu_if_start_meas_req *start_meas, uint8_t nack_cause) +{ + int rc; + rc = oml_tx_mm_start_meas_ack_nack(&bts->gprs.cell.mo, start_meas->meas_id, nack_cause); + if (rc < 0 ) + return rc; + + return 0; +} + +static int pcu_rx_mm_stop_meas_ack_nack(struct gsm_bts *bts, struct gsm_pcu_if_start_meas_req *stop_meas, uint8_t nack_cause) +{ + int rc; + + rc = oml_tx_mm_stop_meas_ack_nack(&bts->gprs.cell.mo, stop_meas->meas_id, nack_cause); + if (rc < 0 ) + return rc; + + return 0; +} + +static int pcu_rx_mm_meas_res_req_nack(struct gsm_bts *bts, struct gsm_pcu_if_meas_resp *meas_resp, uint8_t nack_cause) +{ + int rc; + + rc = oml_tx_mm_meas_res_req_nack(&bts->gprs.cell.mo, meas_resp->meas_id, nack_cause); + if (rc < 0 ) + return rc; + + return 0; +} + +static int pcu_rx_mm_meas_res_resp(struct gsm_bts *bts, struct gsm_pcu_if_meas_resp *meas_resp) +{ + struct gsm_pcu_if_meas_resp res_resp; + int rc; + + res_resp.meas_id = meas_resp->meas_id; + res_resp.len = meas_resp->len; + memcpy(res_resp.data, meas_resp->data, meas_resp->len); + + rc = oml_tx_mm_meas_res_resp(&bts->gprs.cell.mo, res_resp); + if (rc < 0 ) + return rc; + + return 0; +} + + static int pcu_rx(struct gsm_network *net, uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { @@ -595,6 +702,24 @@ case PCU_IF_MSG_FAILURE_EVT_IND: rc = pcu_rx_failure_event_rep(bts, &pcu_prim->u.failure_evt_ind); break; + case PCU_IF_MSG_START_MEAS_ACK: + rc = pcu_rx_mm_start_meas_ack_nack(bts, &pcu_prim->u.start_meas_req, 0); + break; + case PCU_IF_MSG_START_MEAS_NACK: + rc = pcu_rx_mm_start_meas_ack_nack(bts, &pcu_prim->u.start_meas_req, pcu_prim->u.start_meas_req.nack_cause); + break; + case PCU_IF_MSG_MEAS_RES_NACK: + rc = pcu_rx_mm_meas_res_req_nack(bts, &pcu_prim->u.meas_resp, pcu_prim->u.meas_resp.nack_cause); + break; + case PCU_IF_MSG_MEAS_RES_RESP: + rc = pcu_rx_mm_meas_res_resp(bts, &pcu_prim->u.meas_resp); + break; + case PCU_IF_MSG_STOP_MEAS_ACK: + rc = pcu_rx_mm_stop_meas_ack_nack(bts, &pcu_prim->u.stop_meas_req, 0); + break; + case PCU_IF_MSG_STOP_MEAS_NACK: + rc = pcu_rx_mm_stop_meas_ack_nack(bts, &pcu_prim->u.stop_meas_req, pcu_prim->u.stop_meas_req.nack_cause); + break; default: snprintf(log_msg, 100, "Received unknown PCU msg type %d\n", msg_type); LOGP(DPCU, LOGL_ERROR,"%s", log_msg); -- To view, visit https://gerrit.osmocom.org/260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic930baa69fc09ad5059627ed3d85cce5474085b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/rsl.c : Alarm - BTS page table is full In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/261 to look at the new patch set (#2). LC15: common/rsl.c : Alarm - BTS page table is full Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 --- M src/common/rsl.c 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/261/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index dddde69..e661b18 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -50,6 +50,7 @@ #include #include #include +#include "osmo-bts/oml.h" //#define FAKE_CIPH_MODE_COMPL @@ -415,6 +416,8 @@ uint8_t chan_needed = 0, paging_group; const uint8_t *identity_lv; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)); @@ -432,6 +435,26 @@ identity_lv, chan_needed); if (rc < 0) { /* FIXME: notfiy the BSC somehow ?*/ + switch(rc) { + /* Send Failure event report of BTS page table is full to BSC */ + case -ENOSPC: + snprintf(log_msg, 100, "BTS page table is full\n"); + if(trx) { + + failure_rep.event_type = NM_EVT_ENV_FAIL; + failure_rep.event_serverity = NM_SEVER_MINOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MIN_PAG_TAB_FULL; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + break; + + default: + break; + } + } pcu_tx_pag_req(identity_lv, chan_needed); -- To view, visit https://gerrit.osmocom.org/261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie17a87103e289fbbf3fcb3cd60dfd9a1b48d8824 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to create IPAC RTP/RTCP ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/262 to look at the new patch set (#2). LC15: common/rsl.c : Alarm - Failed to create IPAC RTP/RTCP socket Change-Id: I6426f7fcb1e2e25f8143c0b5835c24fedc8089be --- M src/common/rsl.c 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/262/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index e661b18..4fee48b 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1461,6 +1461,8 @@ int rc, inc_ip_port = 0, port; char *name; struct in_addr ia; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; if (dch->c.msg_type == RSL_MT_IPAC_CRCX) name = "CRCX"; @@ -1517,9 +1519,18 @@ lchan->abis_ip.rtp_socket = osmo_rtp_socket_create(lchan->ts->trx, OSMO_RTP_F_POLL); if (!lchan->abis_ip.rtp_socket) { - LOGP(DRSL, LOGL_ERROR, - "%s IPAC Failed to create RTP/RTCP sockets\n", - gsm_lchan_name(lchan)); + + snprintf(log_msg, 100, "%s IPAC Failed to create RTP/RTCP sockets\n", gsm_lchan_name(lchan)); + LOGP(DRSL, LOGL_ERROR,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_RTP_TOUT; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&lchan->ts->trx->mo, failure_rep); + return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL, inc_ip_port, dch->c.msg_type); } -- To view, visit https://gerrit.osmocom.org/262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6426f7fcb1e2e25f8143c0b5835c24fedc8089be Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to bind RTP/RTCP socket In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/263 to look at the new patch set (#2). LC15: common/rsl.c : Alarm - Failed to bind RTP/RTCP socket Change-Id: Ief24e775dd186dbf2bb773afbc3e16d7037f179d --- M src/common/rsl.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/63/263/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index 4fee48b..d9af705 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1557,9 +1557,17 @@ rc = osmo_rtp_socket_bind(lchan->abis_ip.rtp_socket, ipstr, -1); if (rc < 0) { - LOGP(DRSL, LOGL_ERROR, - "%s IPAC Failed to bind RTP/RTCP sockets\n", - gsm_lchan_name(lchan)); + snprintf(log_msg, 100, "%s IPAC Failed to bind RTP/RTCP sockets\n", gsm_lchan_name(lchan)); + LOGP(DRSL, LOGL_ERROR,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_RTP_TOUT; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&lchan->ts->trx->mo, failure_rep); + osmo_rtp_socket_free(lchan->abis_ip.rtp_socket); lchan->abis_ip.rtp_socket = NULL; msgb_queue_flush(&lchan->dl_tch_queue); -- To view, visit https://gerrit.osmocom.org/263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief24e775dd186dbf2bb773afbc3e16d7037f179d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation acc... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/234 to look at the new patch set (#2). LC15: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6 Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 --- M include/osmo-bts/l1sap.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/34/234/2 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index e76aca6..1f8b2a5 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -25,7 +25,7 @@ /* PTCH layout from frame number */ #define L1SAP_FN2MACBLOCK(fn) ((fn % 52) / 4) -#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 52) & 7) +#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 104) & 3) #define L1SAP_IS_PTCCH(fn) ((fn % 52) == 12) /* subslot from any chan_nr */ -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/abis.c: fix 100% CPU usage after disconnecting ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/235 to look at the new patch set (#2). LC15: common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d --- M src/common/abis.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/235/2 diff --git a/src/common/abis.c b/src/common/abis.c index defdb44..6753149 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -144,7 +144,6 @@ if (trx->rsl_link) { e1inp_sign_link_destroy(trx->rsl_link); trx->rsl_link = NULL; - trx_link_estab(trx); } } -- To view, visit https://gerrit.osmocom.org/235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Bring back DSP trace argument In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/236 to look at the new patch set (#2). LC15: Bring back DSP trace argument Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/main.c 2 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/236/2 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 1054aba..f7ecc7a 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -67,6 +67,8 @@ #include "misc/lc15bts_bid.h" #include "utils.h" +extern unsigned int dsp_trace; + struct wait_l1_conf { struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ @@ -1397,6 +1399,10 @@ return -EIO; } + + struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; + fl1h->dsp_trace_f = dsp_trace; + l1if_reset(pinst->u.lc15.hdl); phy_link_state_set(plink, PHY_LINK_CONNECTED); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ef132f8..2aaacd3 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -60,6 +60,8 @@ #include "oml_router.h" #include "misc/lc15bts_bid.h" +unsigned int dsp_trace = 0x00000000; + int bts_model_init(struct gsm_bts *bts) { struct gsm_bts_trx *trx; @@ -133,8 +135,8 @@ void bts_model_print_help() { printf( " -w --hw-version Print the targeted HW Version\n" - " -M --pcu-direct Force PCU to access message queue for " - "PDCH dchannel directly\n" + " -M --pcu-direct Force PCU to access message queue for PDCH dchannel directly\n" + " -p --dsp-trace Set DSP trace flags\n" ); } @@ -180,6 +182,9 @@ break; switch (c) { + case 'p': + dsp_trace = strtoul(optarg, NULL, 16); + break; case 'M': pcu_direct = 1; break; -- To view, visit https://gerrit.osmocom.org/236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Hardware changes: - Change system devices path - Remov... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/237 to look at the new patch set (#2). LC15: Hardware changes: - Change system devices path - Remove obsoleted sensors and add new sensors - Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD) Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 --- M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/hw_misc.c M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c M src/osmo-bts-litecell15/misc/lc15bts_clock.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 17 files changed, 322 insertions(+), 336 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/37/237/2 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index da79df6..c6be4f0 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -53,31 +53,31 @@ static const struct calib_file_desc calib_files[] = { { - .fname = "calib_rx1a.conf", + .fname = "calib_rx0a.conf", .rx = 1, .trx = 0, + .rxpath = 0, + }, { + .fname = "calib_rx0b.conf", + .rx = 1, + .trx = 0, + .rxpath = 1, + }, { + .fname = "calib_rx1a.conf", + .rx = 1, + .trx = 1, .rxpath = 0, }, { .fname = "calib_rx1b.conf", .rx = 1, - .trx = 0, - .rxpath = 1, - }, { - .fname = "calib_rx2a.conf", - .rx = 1, - .trx = 1, - .rxpath = 0, - }, { - .fname = "calib_rx2b.conf", - .rx = 1, .trx = 1, .rxpath = 1, }, { - .fname = "calib_tx1.conf", + .fname = "calib_tx0.conf", .rx = 0, .trx = 0, }, { - .fname = "calib_tx2.conf", + .fname = "calib_tx1.conf", .rx = 0, .trx = 1, }, diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index cd53e26..49232b2 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -63,7 +63,7 @@ return -EINVAL; } - fd = open("/sys/class/leds/usr0/brightness", O_WRONLY); + fd = open("/var/lc15/leds/led0/brightness", O_WRONLY); if (fd < 0) return -ENODEV; @@ -73,7 +73,7 @@ } close(fd); - fd = open("/sys/class/leds/usr1/brightness", O_WRONLY); + fd = open("/var/lc15/leds/led1/brightness", O_WRONLY); if (fd < 0) return -ENODEV; diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 7e6cd68..6381864 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -249,7 +249,7 @@ struct osmo_wqueue *wq = &hdl->write_q[q]; struct osmo_fd *write_ofd = &hdl->write_q[q].bfd; - snprintf(buf, sizeof(buf)-1, "%s%d", rd_devnames[q], plink->num+1); + snprintf(buf, sizeof(buf)-1, "%s%d", rd_devnames[q], plink->num); buf[sizeof(buf)-1] = '\0'; rc = open(buf, O_RDONLY); @@ -270,7 +270,7 @@ return rc; } - snprintf(buf, sizeof(buf)-1, "%s%d", wr_devnames[q], plink->num+1); + snprintf(buf, sizeof(buf)-1, "%s%d", wr_devnames[q], plink->num); buf[sizeof(buf)-1] = '\0'; rc = open(buf, O_WRONLY); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 1fb5851..06a126a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -27,8 +27,8 @@ #include "lc15bts_bid.h" -#define BOARD_REV_SYSFS "/sys/devices/0.lc15/revision" -#define BOARD_OPT_SYSFS "/sys/devices/0.lc15/option" +#define BOARD_REV_SYSFS "/var/lc15/platform/revision" +#define BOARD_OPT_SYSFS "/var/lc15/platform/option" static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index 90ecb7a..f4df5d3 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -27,15 +27,15 @@ #include "lc15bts_clock.h" -#define CLKERR_ERR_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average" -#define CLKERR_ACC_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average_accuracy" -#define CLKERR_INT_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average_interval" -#define CLKERR_FLT_SYSFS "/sys/devices/5002000.clkerr/clkerr1_fault" -#define CLKERR_RFS_SYSFS "/sys/devices/5002000.clkerr/refresh" -#define CLKERR_RST_SYSFS "/sys/devices/5002000.clkerr/reset" +#define CLKERR_ERR_SYSFS "/var/lc15/clkerr/clkerr1_average" +#define CLKERR_ACC_SYSFS "/var/lc15/clkerr/clkerr1_average_accuracy" +#define CLKERR_INT_SYSFS "/var/lc15/clkerr/clkerr1_average_interval" +#define CLKERR_FLT_SYSFS "/var/lc15/clkerr/clkerr1_fault" +#define CLKERR_RFS_SYSFS "/var/lc15/clkerr/refresh" +#define CLKERR_RST_SYSFS "/var/lc15/clkerr/reset" -#define OCXODAC_VAL_SYSFS "/sys/bus/iio/devices/iio:device0/out_voltage0_raw" -#define OCXODAC_ROM_SYSFS "/sys/bus/iio/devices/iio:device0/store_eeprom" +#define OCXODAC_VAL_SYSFS "/var/lc15/ocxo/voltage" +#define OCXODAC_ROM_SYSFS "/var/lc15/ocxo/eeprom" /* clock error */ static int clkerr_fd_err = -1; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index a4c5650..506e525 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -74,7 +74,15 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .memory_limit = { + .logrf_limit = { + .thresh_warn = 60, + .thresh_crit = 78, + }, + .ocxo_limit = { + .thresh_warn = 60, + .thresh_crit = 78, + }, + .tx0_limit = { .thresh_warn = 60, .thresh_crit = 78, }, @@ -82,7 +90,7 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .tx2_limit = { + .pa0_limit = { .thresh_warn = 60, .thresh_crit = 78, }, @@ -90,12 +98,8 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .pa2_limit = { - .thresh_warn = 60, - .thresh_crit = 78, - }, .action_warn = 0, - .action_crit = TEMP_ACT_PA1_OFF | TEMP_ACT_PA2_OFF, + .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, .state = STATE_NORMAL, } }; @@ -260,12 +264,12 @@ hours_timer_cb(NULL); /* Enable the PAs */ - rc = lc15bts_power_set(LC15BTS_POWER_PA1, 1); + rc = lc15bts_power_set(LC15BTS_POWER_PA0, 1); if (rc < 0) { exit(3); } - rc = lc15bts_power_set(LC15BTS_POWER_PA2, 1); + rc = lc15bts_power_set(LC15BTS_POWER_PA1, 1); if (rc < 0) { exit(3); } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 466d0b2..98bd701 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -21,8 +21,8 @@ #if 0 TEMP_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA1_OFF = 0x2, - TEMP_ACT_PA2_OFF = 0x4, + TEMP_ACT_PA0_OFF = 0x2, + TEMP_ACT_PA1_OFF = 0x4, TEMP_ACT_BTS_SRV_OFF = 0x10, }; @@ -31,8 +31,8 @@ #if 0 TEMP_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA1_ON = 0x2, - TEMP_ACT_NORM_PA2_ON = 0x4, + TEMP_ACT_NORM_PA0_ON = 0x2, + TEMP_ACT_NORM_PA1_ON = 0x4, TEMP_ACT_NORM_BTS_SRV_ON= 0x10, }; @@ -62,11 +62,12 @@ LIMIT_SUPPLY_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_MEMORY_NODE, + LIMIT_LOGRF_NODE, + LIMIT_OCXO_NODE, + LIMIT_TX0_NODE, LIMIT_TX1_NODE, - LIMIT_TX2_NODE, + LIMIT_PA0_NODE, LIMIT_PA1_NODE, - LIMIT_PA2_NODE, }; struct lc15bts_mgr_instance { @@ -82,11 +83,12 @@ struct lc15bts_temp_limit supply_limit; struct lc15bts_temp_limit soc_limit; struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit memory_limit; + struct lc15bts_temp_limit logrf_limit; + struct lc15bts_temp_limit ocxo_limit; + struct lc15bts_temp_limit tx0_limit; struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit tx2_limit; + struct lc15bts_temp_limit pa0_limit; struct lc15bts_temp_limit pa1_limit; - struct lc15bts_temp_limit pa2_limit; } temp; struct { diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index d2100eb..903c5fe 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -47,7 +47,7 @@ #include #include -#define ETH0_ADDR_SYSFS "/sys/class/net/eth0/address" +#define ETH0_ADDR_SYSFS "/var/lc15/net/eth0/address" static struct osmo_fd nl_fd; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 00b8657..042fc87 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -85,6 +85,16 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ + if (actions & TEMP_ACT_NORM_PA0_ON) { + if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch on the PA #0\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched on the PA #0 as normal action.\n"); + } + } + if (actions & TEMP_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, @@ -92,16 +102,6 @@ } else { LOGP(DTEMP, LOGL_NOTICE, "Switched on the PA #1 as normal action.\n"); - } - } - - if (actions & TEMP_ACT_NORM_PA2_ON) { - if (lc15bts_power_set(LC15BTS_POWER_PA2, 1) != 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to switch on the PA #2\n"); - } else { - LOGP(DTEMP, LOGL_NOTICE, - "Switched on the PA #2 as normal action.\n"); } } @@ -120,16 +120,6 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA2_OFF) { - if (lc15bts_power_set(LC15BTS_POWER_PA2, 0) != 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to switch off the PA #2. Stop BTS?\n"); - } else { - LOGP(DTEMP, LOGL_NOTICE, - "Switched off the PA #2 due temperature.\n"); - } - } - if (actions & TEMP_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, @@ -137,6 +127,16 @@ } else { LOGP(DTEMP, LOGL_NOTICE, "Switched off the PA #1 due temperature.\n"); + } + } + + if (actions & TEMP_ACT_PA0_OFF) { + if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch off the PA #0. Stop BTS?\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched off the PA #0 due temperature.\n"); } } @@ -215,7 +215,7 @@ LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); @@ -230,7 +230,7 @@ } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); @@ -245,7 +245,7 @@ } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); @@ -259,23 +259,53 @@ LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current memory temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_MEMORY, LC15BTS_TEMP_INPUT); + /* Read the current RF log detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the memory temperature. rc=%d\n", rc); + "Failed to read the RF log detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { int temp = rc / 1000; - if (temp > s_mgr->temp.memory_limit.thresh_warn) + if (temp > s_mgr->temp.logrf_limit.thresh_warn) warn_thresh_passed = 1; - if (temp > s_mgr->temp.memory_limit.thresh_crit) + if (temp > s_mgr->temp.logrf_limit.thresh_crit) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "Memory temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + } + + /* Read the current OCXO temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to read the OCXO temperature. rc=%d\n", rc); + warn_thresh_passed = crit_thresh_passed = 1; + } else { + int temp = rc / 1000; + if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + warn_thresh_passed = 1; + if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + crit_thresh_passed = 1; + LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to read the TX #0 temperature. rc=%d\n", rc); + warn_thresh_passed = crit_thresh_passed = 1; + } else { + int temp = rc / 1000; + if (temp > s_mgr->temp.tx0_limit.thresh_warn) + warn_thresh_passed = 1; + if (temp > s_mgr->temp.tx0_limit.thresh_crit) + crit_thresh_passed = 1; + LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); + } + + /* Read the current TX #2 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); @@ -289,23 +319,23 @@ LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX2, LC15BTS_TEMP_INPUT); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the TX #2 temperature. rc=%d\n", rc); + "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { int temp = rc / 1000; - if (temp > s_mgr->temp.tx2_limit.thresh_warn) + if (temp > s_mgr->temp.pa0_limit.thresh_warn) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx2_limit.thresh_crit) + if (temp > s_mgr->temp.pa0_limit.thresh_crit) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "TX #2 temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, LC15BTS_TEMP_INPUT); + /* Read the current PA #2 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); @@ -317,21 +347,6 @@ if (temp > s_mgr->temp.pa1_limit.thresh_crit) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); - } - - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA2, LC15BTS_TEMP_INPUT); - if (rc < 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to read the PA #2 temperature. rc=%d\n", rc); - warn_thresh_passed = crit_thresh_passed = 1; - } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa2_limit.thresh_warn) - warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa2_limit.thresh_crit) - crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "PA #2 temperature is: %d\n", temp); } lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index e5ef55f..280c9c7 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -67,11 +67,12 @@ case LIMIT_SUPPLY_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_MEMORY_NODE: + case LIMIT_LOGRF_NODE: + case LIMIT_OCXO_NODE: + case LIMIT_TX0_NODE: case LIMIT_TX1_NODE: - case LIMIT_TX2_NODE: + case LIMIT_PA0_NODE: case LIMIT_PA1_NODE: - case LIMIT_PA2_NODE: vty->node = MGR_NODE; break; default: @@ -90,11 +91,12 @@ case LIMIT_SUPPLY_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_MEMORY_NODE: + case LIMIT_LOGRF_NODE: + case LIMIT_OCXO_NODE: + case LIMIT_TX0_NODE: case LIMIT_TX1_NODE: - case LIMIT_TX2_NODE: + case LIMIT_PA0_NODE: case LIMIT_PA1_NODE: - case LIMIT_PA2_NODE: return 1; default: return 0; @@ -154,30 +156,36 @@ 1, }; -static struct cmd_node limit_memory_node = { - LIMIT_MEMORY_NODE, - "%s(limit-memory)# ", +static struct cmd_node limit_logrf_node = { + LIMIT_LOGRF_NODE, + "%s(limit-logrf)# ", 1, }; +static struct cmd_node limit_ocxo_node = { + LIMIT_OCXO_NODE, + "%s(limit-ocxo)# ", + 1, +}; + +static struct cmd_node limit_tx0_node = { + LIMIT_TX0_NODE, + "%s(limit-tx0)# ", + 1, +}; static struct cmd_node limit_tx1_node = { LIMIT_TX1_NODE, "%s(limit-tx1)# ", 1, }; -static struct cmd_node limit_tx2_node = { - LIMIT_TX2_NODE, - "%s(limit-tx2)# ", +static struct cmd_node limit_pa0_node = { + LIMIT_PA0_NODE, + "%s(limit-pa0)# ", 1, }; static struct cmd_node limit_pa1_node = { LIMIT_PA1_NODE, "%s(limit-pa1)# ", - 1, -}; -static struct cmd_node limit_pa2_node = { - LIMIT_PA2_NODE, - "%s(limit-pa2)# ", 1, }; @@ -202,10 +210,10 @@ static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " %spa0-on%s", + (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " %spa2-on%s", - (actions & TEMP_ACT_NORM_PA2_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } @@ -213,10 +221,10 @@ static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " %spa0-off%s", + (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " %spa2-off%s", - (actions & TEMP_ACT_PA2_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } @@ -228,11 +236,12 @@ write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits memory", &s_mgr->temp.memory_limit); + write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); + write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); + write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits tx2", &s_mgr->temp.tx2_limit); + write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); - write_temp_limit(vty, "limits pa2", &s_mgr->temp.pa2_limit); write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); write_action(vty, "actions warn", s_mgr->temp.action_warn); @@ -259,11 +268,12 @@ CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(memory, "MEMORY\n", LIMIT_MEMORY_NODE, memory_limit) +CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) +CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) +CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(tx2, "TX2\n", LIMIT_TX2_NODE, tx2_limit) +CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -CFG_LIMIT(pa2, "PA2\n", LIMIT_PA2_NODE, pa2_limit) #undef CFG_LIMIT DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, @@ -298,6 +308,24 @@ CFG_ACTION(critical, "Critical Actions\n", ACT_CRIT_NODE, action_crit) #undef CFG_ACTION +DEFUN(cfg_action_pa0_on, cfg_action_pa0_on_cmd, + "pa0-on", + "Switch the Power Amplifier #0 on\n") +{ + int *action = vty->index; + *action |= TEMP_ACT_NORM_PA0_ON; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_action_pa0_on, cfg_no_action_pa0_on_cmd, + "no pa0-on", + NO_STR "Switch the Power Amplifieri #0 on\n") +{ + int *action = vty->index; + *action &= ~TEMP_ACT_NORM_PA0_ON; + return CMD_SUCCESS; +} + DEFUN(cfg_action_pa1_on, cfg_action_pa1_on_cmd, "pa1-on", "Switch the Power Amplifier #1 on\n") @@ -313,24 +341,6 @@ { int *action = vty->index; *action &= ~TEMP_ACT_NORM_PA1_ON; - return CMD_SUCCESS; -} - -DEFUN(cfg_action_pa2_on, cfg_action_pa2_on_cmd, - "pa2-on", - "Switch the Power Amplifier #2 on\n") -{ - int *action = vty->index; - *action |= TEMP_ACT_NORM_PA2_ON; - return CMD_SUCCESS; -} - -DEFUN(cfg_no_action_pa2_on, cfg_no_action_pa2_on_cmd, - "no pa2-on", - NO_STR "Switch the Power Amplifieri #2 on\n") -{ - int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA2_ON; return CMD_SUCCESS; } @@ -352,39 +362,39 @@ return CMD_SUCCESS; } +DEFUN(cfg_action_pa0_off, cfg_action_pa0_off_cmd, + "pa0-off", + "Switch the Power Amplifier #0 off\n") +{ + int *action = vty->index; + *action |= TEMP_ACT_PA0_OFF; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_action_pa0_off, cfg_no_action_pa0_off_cmd, + "no pa0-off", + NO_STR "Do not switch off the Power Amplifier #0\n") +{ + int *action = vty->index; + *action &= ~TEMP_ACT_PA0_OFF; + return CMD_SUCCESS; +} + DEFUN(cfg_action_pa1_off, cfg_action_pa1_off_cmd, - "pa1-off", - "Switch the Power Amplifier #1 off\n") -{ - int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; - return CMD_SUCCESS; -} - -DEFUN(cfg_no_action_pa1_off, cfg_no_action_pa1_off_cmd, - "no pa1-off", - NO_STR "Do not switch off the Power Amplifier #1\n") -{ - int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; - return CMD_SUCCESS; -} - -DEFUN(cfg_action_pa2_off, cfg_action_pa2_off_cmd, - "pa2-off", - "Switch the Power Amplifier #2 off\n") + "pa1-off", + "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA2_OFF; + *action |= TEMP_ACT_PA1_OFF; return CMD_SUCCESS; } -DEFUN(cfg_no_action_pa2_off, cfg_no_action_pa2_off_cmd, - "no pa2-off", - NO_STR "Do not switch off the Power Amplifier #2\n") +DEFUN(cfg_no_action_pa1_off, cfg_no_action_pa1_off_cmd, + "no pa1-off", + NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA2_OFF; + *action &= ~TEMP_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -413,45 +423,49 @@ lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, VTY_NEWLINE); vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, VTY_NEWLINE); vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Memory (DDR): %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_MEMORY, - LC15BTS_TEMP_INPUT) / 1000.0f, + vty_out(vty, " LogRF : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + VTY_NEWLINE); + vty_out(vty, " OCXO : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + VTY_NEWLINE); + vty_out(vty, " TX 0 : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, VTY_NEWLINE); vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 2 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX2, - LC15BTS_TEMP_INPUT) / 1000.0f, + vty_out(vty, " Power Amp #0: %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, VTY_NEWLINE); vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1, - LC15BTS_TEMP_INPUT) / 1000.0f, - VTY_NEWLINE); - vty_out(vty, " Power Amp #2: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA2, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : (ON) [%6.2f Vdc, %4.2f A, %6.2f W]%s", + vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, LC15BTS_POWER_VOLTAGE)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, LC15BTS_POWER_CURRENT)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER)/1000000.0f, + VTY_NEWLINE); + vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", + lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE)/1000.0f, + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT)/1000.0f, + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, LC15BTS_POWER_POWER)/1000000.0f, VTY_NEWLINE); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", @@ -461,15 +475,6 @@ lc15bts_power_sensor_get(LC15BTS_POWER_PA1, LC15BTS_POWER_CURRENT)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, - VTY_NEWLINE); - vty_out(vty, " Power Amp #2: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_get(LC15BTS_POWER_PA2) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, LC15BTS_POWER_POWER)/1000000.0f, VTY_NEWLINE); @@ -496,20 +501,20 @@ static void register_normal_action(int act) { + install_element(act, &cfg_action_pa0_on_cmd); + install_element(act, &cfg_no_action_pa0_on_cmd); install_element(act, &cfg_action_pa1_on_cmd); install_element(act, &cfg_no_action_pa1_on_cmd); - install_element(act, &cfg_action_pa2_on_cmd); - install_element(act, &cfg_no_action_pa2_on_cmd); install_element(act, &cfg_action_bts_srv_on_cmd); install_element(act, &cfg_no_action_bts_srv_on_cmd); } static void register_action(int act) { + install_element(act, &cfg_action_pa0_off_cmd); + install_element(act, &cfg_no_action_pa0_off_cmd); install_element(act, &cfg_action_pa1_off_cmd); install_element(act, &cfg_no_action_pa1_off_cmd); - install_element(act, &cfg_action_pa2_off_cmd); - install_element(act, &cfg_no_action_pa2_off_cmd); install_element(act, &cfg_action_bts_srv_off_cmd); install_element(act, &cfg_no_action_bts_srv_off_cmd); } @@ -542,30 +547,35 @@ register_limit(LIMIT_FPGA_NODE); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_memory_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_memory_cmd); - register_limit(LIMIT_MEMORY_NODE); - vty_install_default(LIMIT_MEMORY_NODE); + install_node(&limit_logrf_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_logrf_cmd); + register_limit(LIMIT_LOGRF_NODE); + vty_install_default(LIMIT_LOGRF_NODE); + + install_node(&limit_ocxo_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_ocxo_cmd); + register_limit(LIMIT_OCXO_NODE); + vty_install_default(LIMIT_OCXO_NODE); + + install_node(&limit_tx0_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_cmd); + register_limit(LIMIT_TX0_NODE); + vty_install_default(LIMIT_TX0_NODE); install_node(&limit_tx1_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_tx1_cmd); register_limit(LIMIT_TX1_NODE); vty_install_default(LIMIT_TX1_NODE); - install_node(&limit_tx2_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx2_cmd); - register_limit(LIMIT_TX2_NODE); - vty_install_default(LIMIT_TX2_NODE); + install_node(&limit_pa0_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_cmd); + register_limit(LIMIT_PA0_NODE); + vty_install_default(LIMIT_PA0_NODE); install_node(&limit_pa1_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa1_cmd); register_limit(LIMIT_PA1_NODE); vty_install_default(LIMIT_PA1_NODE); - - install_node(&limit_pa2_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa2_cmd); - register_limit(LIMIT_PA2_NODE); - vty_install_default(LIMIT_PA2_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index e0602c8..5ff8e31 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -74,37 +74,41 @@ .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "memory", + .name = "logrf", .has_max = 1, - .sensor = LC15BTS_TEMP_MEMORY, - .ee_par = LC15BTS_PAR_TEMP_MEMORY_MAX, + .sensor = LC15BTS_TEMP_LOGRF, + .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + }, { + .name = "ocxo", + .has_max = 1, + .sensor = LC15BTS_TEMP_OCXO, + .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, + }, { + .name = "tx0", + .has_max = 0, + .sensor = LC15BTS_TEMP_TX0, + .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { .name = "tx1", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "tx2", - .has_max = 0, - .sensor = LC15BTS_TEMP_TX2, - .ee_par = LC15BTS_PAR_TEMP_TX2_MAX, + .name = "pa0", + .has_max = 1, + .sensor = LC15BTS_TEMP_PA0, + .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { .name = "pa1", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, - }, { - .name = "pa2", - .has_max = 1, - .sensor = LC15BTS_TEMP_PA2, - .ee_par = LC15BTS_PAR_TEMP_PA2_MAX, } }; void lc15bts_check_temp(int no_rom_write) { int temp_old[ARRAY_SIZE(temp_data)]; - int temp_hi[ARRAY_SIZE(temp_data)]; int temp_cur[ARRAY_SIZE(temp_data)]; int i, rc; @@ -112,40 +116,24 @@ int ret; rc = lc15bts_par_get_int(temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - if (temp_data[i].has_max) { - temp_hi[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_HIGHEST); - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_INPUT); - if ((temp_cur[i] < 0 && temp_cur[i] > -1000) || - (temp_hi[i] < 0 && temp_hi[i] > -1000)) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n"); - continue; - } + temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + if (temp_cur[i] < 0 && temp_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d)\n", temp_data[i].sensor); + continue; } - else { - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_INPUT); - - if (temp_cur[i] < 0 && temp_cur[i] > -1000) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n"); - continue; - } - temp_hi[i] = temp_cur[i]; - } - + LOGP(DTEMP, LOGL_DEBUG, "Current %s temperature: %d.%d C\n", temp_data[i].name, temp_cur[i]/1000, temp_cur[i]%1000); - if (temp_hi[i] > temp_old[i]) { + if (temp_cur[i] > temp_old[i]) { LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " "temperature: %d.%d C\n", temp_data[i].name, - temp_hi[i]/1000, temp_hi[i]%1000); + temp_cur[i]/1000, temp_old[i]%1000); if (!no_rom_write) { rc = lc15bts_par_set_int(temp_data[i].ee_par, - temp_hi[i]/1000); + temp_cur[i]/1000); if (rc < 0) LOGP(DTEMP, LOGL_ERROR, "error writing new %s " "max temp %d (%s)\n", temp_data[i].name, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 7154426..3d80e67 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -46,11 +46,12 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_MEMORY_MAX, "temp-memory-max" }, + { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, + { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, - { LC15BTS_PAR_TEMP_TX2_MAX, "temp-tx2-max" }, + { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, - { LC15BTS_PAR_TEMP_PA2_MAX, "temp-pa2-max" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -64,11 +65,12 @@ case LC15BTS_PAR_TEMP_SUPPLY_MAX: case LC15BTS_PAR_TEMP_SOC_MAX: case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_MEMORY_MAX: + case LC15BTS_PAR_TEMP_LOGRF_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_TX2_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: case LC15BTS_PAR_TEMP_PA1_MAX: - case LC15BTS_PAR_TEMP_PA2_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index 7c18271..c50a69f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -7,11 +7,12 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_MEMORY_MAX, + LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_OCXO_MAX, + LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, - LC15BTS_PAR_TEMP_TX2_MAX, + LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, - LC15BTS_PAR_TEMP_PA2_MAX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index a2997ee..5b01d36 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -30,24 +30,24 @@ #define LC15BTS_PA_VOLTAGE 24000000 -#define PA_SUPPLY_MIN_SYSFS "/sys/devices/0.pa-supply/min_microvolts" -#define PA_SUPPLY_MAX_SYSFS "/sys/devices/0.pa-supply/max_microvolts" +#define PA_SUPPLY_MIN_SYSFS "/var/lc15/pa-supply/min_microvolts" +#define PA_SUPPLY_MAX_SYSFS "/var/lc15/pa-supply/max_microvolts" static const char *power_enable_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_PA1] = "/sys/devices/0.pa1/state", - [LC15BTS_POWER_PA2] = "/sys/devices/0.pa2/state", + [LC15BTS_POWER_PA0] = "/var/lc15/pa-state/pa0/state", + [LC15BTS_POWER_PA1] = "/var/lc15/pa-state/pa1/state", }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/sys/bus/i2c/devices/2-0040/hwmon/hwmon6/", - [LC15BTS_POWER_PA1] = "/sys/bus/i2c/devices/2-0044/hwmon/hwmon7/", - [LC15BTS_POWER_PA2] = "/sys/bus/i2c/devices/2-0045/hwmon/hwmon8/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", + [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; static const char *power_sensor_type_str[_NUM_POWER_TYPES] = { - [LC15BTS_POWER_POWER] = "power1_input", - [LC15BTS_POWER_VOLTAGE] = "in1_input", - [LC15BTS_POWER_CURRENT] = "curr1_input", + [LC15BTS_POWER_POWER] = "power", + [LC15BTS_POWER_VOLTAGE] = "voltage", + [LC15BTS_POWER_CURRENT] = "current", }; int lc15bts_power_sensor_get( @@ -94,8 +94,8 @@ int fd; int rc; - if ((source != LC15BTS_POWER_PA1) - && (source != LC15BTS_POWER_PA2) ) { + if ((source != LC15BTS_POWER_PA0) + && (source != LC15BTS_POWER_PA1) ) { return -EINVAL; } @@ -144,6 +144,7 @@ { int fd; int rc; + int retVal = 0; char enstr[10]; fd = open(power_enable_devs[source], O_RDONLY); @@ -152,7 +153,7 @@ } rc = read(fd, enstr, sizeof(enstr)); - enstr[sizeof(enstr)-1] = '\0'; + enstr[rc-1] = '\0'; close(fd); @@ -163,5 +164,10 @@ return -EIO; } - return atoi(enstr); + rc = strcmp(enstr, "enabled"); + if(rc == 0) { + retVal = 1; + } + + return retVal; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 4bb2748..8963b76 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -3,8 +3,8 @@ enum lc15bts_power_source { LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_PA0, LC15BTS_POWER_PA1, - LC15BTS_POWER_PA2, _NUM_POWER_SOURCES }; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index fa6300e..aa35854 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -31,43 +31,27 @@ static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/sys/bus/i2c/devices/2-004d/hwmon/hwmon5/temp1_", - [LC15BTS_TEMP_SOC] = "/sys/class/hwmon/hwmon1/temp1_", - [LC15BTS_TEMP_FPGA] = "/sys/devices/0.iio_hwmon/temp1_", - [LC15BTS_TEMP_MEMORY] = "/sys/bus/i2c/devices/2-004c/hwmon/hwmon4/temp1_", - [LC15BTS_TEMP_TX1] = "/sys/devices/0.ncp15xh103_tx1/temp1_", - [LC15BTS_TEMP_TX2] = "/sys/devices/0.ncp15xh103_tx2/temp1_", - [LC15BTS_TEMP_PA1] = "/sys/bus/i2c/devices/2-004d/hwmon/hwmon5/temp2_", - [LC15BTS_TEMP_PA2] = "/sys/bus/i2c/devices/2-004c/hwmon/hwmon4/temp2_", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -static const int temp_has_fault[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_PA1] = 1, - [LC15BTS_TEMP_PA2] = 1, -}; - -static const char *temp_type_str[_NUM_TEMP_TYPES] = { - [LC15BTS_TEMP_INPUT] = "input", - [LC15BTS_TEMP_LOWEST] = "lowest", - [LC15BTS_TEMP_HIGHEST] = "highest", - [LC15BTS_TEMP_FAULT] = "fault", -}; - -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, - enum lc15bts_temp_type type) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) { char buf[PATH_MAX]; char tempstr[8]; - char faultstr[8]; int fd, rc; if (sensor < 0 || sensor >= _NUM_TEMP_SENSORS) return -EINVAL; - if (type >= ARRAY_SIZE(temp_type_str)) - return -EINVAL; - - snprintf(buf, sizeof(buf)-1, "%s%s", temp_devs[sensor], temp_type_str[type]); + snprintf(buf, sizeof(buf)-1, "%s", temp_devs[sensor]); buf[sizeof(buf)-1] = '\0'; fd = open(buf, O_RDONLY); @@ -85,32 +69,6 @@ return -EIO; } close(fd); - - // Check fault - if (type == LC15BTS_TEMP_FAULT || !temp_has_fault[sensor]) - return atoi(tempstr); - - snprintf(buf, sizeof(buf)-1, "%s%s", temp_devs[sensor], temp_type_str[LC15BTS_TEMP_FAULT]); - buf[sizeof(buf)-1] = '\0'; - - fd = open(buf, O_RDONLY); - if (fd < 0) - return fd; - - rc = read(fd, faultstr, sizeof(faultstr)); - tempstr[sizeof(faultstr)-1] = '\0'; - if (rc < 0) { - close(fd); - return rc; - } - if (rc == 0) { - close(fd); - return -EIO; - } - close(fd); - - if (atoi(faultstr)) - return -EIO; return atoi(tempstr); } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index 4b70cb8..aca8fe2 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,11 +5,12 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_MEMORY, + LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_OCXO, + LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, - LC15BTS_TEMP_TX2, + LC15BTS_TEMP_PA0, LC15BTS_TEMP_PA1, - LC15BTS_TEMP_PA2, _NUM_TEMP_SENSORS }; @@ -21,7 +22,6 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, - enum lc15bts_temp_type type); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); #endif -- To view, visit https://gerrit.osmocom.org/237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: TRX nominal TX power can be used from EEPROM or from B... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/238 to look at the new patch set (#2). LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e --- M include/osmo-bts/phy_link.h M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 4 files changed, 226 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/238/2 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index edc6cc0..b3db4ce 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -103,7 +103,8 @@ /* configuration */ uint32_t dsp_trace_f; char *calib_path; - + int minTxPower; + int maxTxPower; struct lc15l1_hdl *hdl; } lc15; } u; diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index c6be4f0..3bc788c 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -42,7 +42,11 @@ #include "lc15bts.h" #include "utils.h" - +/** + * * Maximum calibration data chunk size + * */ +#define MAX_CALIB_TBL_SIZE 65536 +#define CALIB_HDR_V1 0x01 struct calib_file_desc { const char *fname; @@ -83,9 +87,37 @@ }, }; +static struct calTbl_t +{ + union + { + struct + { + uint8_t u8Version; // Header version (1) + uint8_t u8Parity; // Parity byte (xor) + uint8_t u8Type; // Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) + uint8_t u8Band; // GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) + uint32_t u32Len; // Table length in bytes including the header + struct + { + uint32_t u32DescOfst; // Description section offset + uint32_t u32DateOfst; // Date section offset + uint32_t u32StationOfst; // Calibration test station section offset + uint32_t u32FpgaFwVerOfst; // Calibration FPGA firmware version section offset + uint32_t u32DspFwVerOfst; // Calibration DSP firmware section offset + uint32_t u32DataOfst; // Calibration data section offset + } toc; + } v1; + } hdr; + + uint8_t u8RawData[MAX_CALIB_TBL_SIZE - 32]; +}; + static int calib_file_send(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc); +static int calib_verify(struct lc15l1_hdl *fl1h, + const struct calib_file_desc *desc); /* determine next calibration file index based on supported bands */ static int get_next_calib_file_idx(struct lc15l1_hdl *fl1h, int last_idx) @@ -203,6 +235,20 @@ return 0; } + rc = calib_verify(fl1h, desc); + if ( rc < 0 ) { + LOGP(DL1C, LOGL_ERROR, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + st->last_file_idx = get_next_calib_file_idx(fl1h, st->last_file_idx); + + if (st->last_file_idx >= 0) + return calib_file_send(fl1h, + &calib_files[st->last_file_idx]); + return 0; + + } + + LOGP(DL1C, LOGL_INFO, "Verify L1 calibration table %s -> done\n", desc->fname); + return calib_file_send_next_chunk(fl1h); } @@ -258,3 +304,155 @@ return calib_file_send(fl1h, &calib_files[st->last_file_idx]); } + +static int calib_verify(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc) +{ + int i, rc, sz; + struct calib_send_state *st = &fl1h->st; + struct phy_link *plink = fl1h->phy_inst->phy_link; + char *rbuf; + struct calTbl_t *calTbl; + char calChkSum ; + + + //calculate file size in bytes + fseek(st->fp, 0L, SEEK_END); + sz = ftell(st->fp); + + //rewind read poiner + fseek(st->fp, 0L, SEEK_SET); + + //read file + rbuf = (char *) malloc( sizeof(char) * sz ); + + rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); + if ( rc != sz) { + + LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); + free(rbuf); + + //close file + rc = calib_file_close(fl1h); + if (rc < 0 ) { + LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); + return rc; + } + + return -2; + } + + + calTbl = (struct calTbl_t*) rbuf; + //calcualte file checksum + calChkSum = 0; + while ( sz-- ) { + calChkSum ^= rbuf[sz]; + } + + //validate Tx calibration parity + if ( calChkSum ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); + return -4; + } + + //validate Tx calibration header + if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); + return -5; + } + + //validate calibration description + if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); + return -6; + } + + //validate calibration date + if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); + return -7; + } + + LOGP(DL1C, LOGL_INFO, "L1 calibration table %s created on %s\n", + desc->fname, + calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); + + //validate calibration station + if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); + return -8; + } + + //validate FPGA FW version + if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); + return -9; + } + //validate DSP FW version + if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); + return -10; + } + + //validate Tx calibration data offset + if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); + return -11; + } + + if ( !desc->rx ) { + + //parse min/max Tx power + fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; + fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; + + //override nominal Tx power of given TRX if needed + if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", + plink->num, + fl1h->phy_inst->u.lc15.maxTxPower, + fl1h->phy_inst->trx->nominal_power); + + fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.maxTxPower; + } + + if ( fl1h->phy_inst->trx->nominal_power < fl1h->phy_inst->u.lc15.minTxPower) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", + plink->num, + fl1h->phy_inst->u.lc15.minTxPower, + fl1h->phy_inst->trx->nominal_power); + + fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.minTxPower; + } + + if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm > to_mdB(fl1h->phy_inst->u.lc15.maxTxPower) ) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", + plink->num, + to_mdB(fl1h->phy_inst->u.lc15.maxTxPower), + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm); + + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.maxTxPower); + } + + if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm < to_mdB(fl1h->phy_inst->u.lc15.minTxPower) ) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", + plink->num, + to_mdB(fl1h->phy_inst->u.lc15.minTxPower), + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm); + + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.minTxPower); + } + + LOGP(DL1C, LOGL_DEBUG, "%s: minTxPower=%d, maxTxPower=%d\n", + desc->fname, + fl1h->phy_inst->u.lc15.minTxPower, + fl1h->phy_inst->u.lc15.maxTxPower ); + } + + //rewind read poiner for subsequence tasks + fseek(st->fp, 0L, SEEK_SET); + free(rbuf); + + return 0; +} + diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index d0288ab..8c4364c 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -218,6 +218,8 @@ vty_out(vty, "%s ", gsm_band_name(1 << i)); } vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "Min Tx Power: %d dBm%s", fl1h->phy_inst->u.lc15.minTxPower, VTY_NEWLINE); + vty_out(vty, "Max Tx Power: %d dBm%s", fl1h->phy_inst->u.lc15.maxTxPower, VTY_NEWLINE); return CMD_SUCCESS; } @@ -246,8 +248,9 @@ } DEFUN(set_tx_power, set_tx_power_cmd, - "trx <0-0> tx-power <-110-100>", + "trx nr <0-1> tx-power <-110-100>", TRX_STR + "TRX number \n" "Set transmit power (override BSC)\n" "Transmit power in dBm\n") { @@ -298,6 +301,25 @@ return CMD_SUCCESS; } +DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd, + "nominal-tx-power <0-40>", + "Set the nominal transmit output power in dBm\n" + "Nominal transmit output power level in dBm\n") +{ + int nominal_power = atoi(argv[0]); + struct gsm_bts_trx *trx = vty->index; + + if (( nominal_power > 40 ) || ( nominal_power < 0 )) { + vty_out(vty, "Nominal Tx power level must be between 0 and 40 dBm (%d) %s", + nominal_power, VTY_NEWLINE); + return CMD_WARNING; + } + + trx->nominal_power = nominal_power; + trx->power_params.trx_p_max_out_mdBm = to_mdB(nominal_power); + + return CMD_SUCCESS; +} void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { @@ -305,6 +327,7 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) { + vty_out(vty, " nominal-tx-power %d%s", trx->nominal_power,VTY_NEWLINE); } static void write_phy_inst(struct vty *vty, struct phy_instance *pinst) diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index 2aaacd3..352949b 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -81,7 +81,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - trx->nominal_power = 37; + trx->nominal_power = 40; trx->power_params.trx_p_max_out_mdBm = to_mdB(bts->c0->nominal_power); } -- To view, visit https://gerrit.osmocom.org/238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: BTS parameters are configurable via configuration file... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/239 to look at the new patch set (#2). LC15: BTS parameters are configurable via configuration file : - Maximum cell size - Diversity - Unused TS pedestal - Adjustment of Tx output power - Reduction Tx power level in 8-PSK modulation scheme Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 --- M include/osmo-bts/gsm_data.h M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 6 files changed, 196 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/39/239/2 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 7a48667..6bbbd5f 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -111,6 +111,14 @@ struct { char *sock_path; } pcu; +#ifdef ENABLE_LC15BTS + /* specific to LC15 BTS */ + uint8_t max_cell_size; /* 166 qbits */ + uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ + uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ + uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ +#endif }; enum lchan_ciph_state { diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 768e29d..6d6ca25 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -4,6 +4,10 @@ AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +if ENABLE_LC15BTS +AM_CFLAGS += -DENABLE_LC15BTS +endif + EXTRA_DIST = misc/lc15bts_mgr.h misc/lc15bts_misc.h misc/lc15bts_par.h \ misc/lc15bts_temp.h misc/lc15bts_power.h misc/lc15bts_clock.h \ misc/lc15bts_bid.h misc/lc15bts_nl.h \ diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index f7ecc7a..e94db84 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1077,6 +1077,7 @@ oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); } else { bts_update_status(BTS_STATUS_RF_ACTIVE, 0); + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); } @@ -1091,17 +1092,27 @@ { struct msgb *msg = sysp_msgb_alloc(); Litecell15_Prim_t *sysp = msgb_sysprim(msg); + struct gsm_bts_role_bts *btsb = bts_role_bts(hdl->phy_inst->trx->bts); if (on) { sysp->id = Litecell15_PrimId_ActivateRfReq; sysp->u.activateRfReq.msgq.u8UseTchMsgq = 0; sysp->u.activateRfReq.msgq.u8UsePdtchMsgq = pcu_direct; - sysp->u.activateRfReq.u8UnusedTsMode = 0; + sysp->u.activateRfReq.u8UnusedTsMode = btsb->pedestal_mode; sysp->u.activateRfReq.u8McCorrMode = 0; + /* diversity mode: 0: SISO-A, 1: SISO-B, 2: MRC */ + sysp->u.activateRfReq.u8DiversityMode = btsb->diversity_mode; + /* maximum cell size in quarter-bits, 90 == 12.456 km */ - sysp->u.activateRfReq.u8MaxCellSize = 90; + sysp->u.activateRfReq.u8MaxCellSize = btsb->max_cell_size; + + /* auto tx power adjustment mode 0:none, 1: automatic*/ + sysp->u.activateRfReq.autoPowerAdjust.u8EnAutoPowerAdjust = btsb->tx_pwr_adj_mode; + + /* PSK modulation scheme maximum power level */ + sysp->u.activateRfReq.autoPowerAdjust.u8PowerReduction8Psk = btsb->tx_pwr_red_8psk; } else { sysp->id = Litecell15_PrimId_DeactivateRfReq; } diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index 4c40db0..f6a7e3f 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -22,6 +22,22 @@ L1P_T_IND, }; +enum lc15_diversity_mode{ + LC15_DIVERSITY_SISO_A = 0, + LC15_DIVERSITY_SISO_B, + LC15_DIVERSITY_MRC, +}; + +enum lc15_pedestal_mode{ + LC15_PEDESTAL_OFF = 0, + LC15_PEDESTAL_ON, +}; + +enum lc15_auto_pwr_adjust_mode{ + LC15_TX_PWR_ADJ_NONE = 0, + LC15_TX_PWR_ADJ_AUTO, +}; + enum l1prim_type lc15bts_get_l1prim_type(GsmL1_PrimId_t id); const struct value_string lc15bts_l1prim_names[GsmL1_PrimId_NUM+1]; GsmL1_PrimId_t lc15bts_get_l1prim_conf(GsmL1_PrimId_t id); @@ -61,4 +77,11 @@ const uint8_t pdch_msu_size[_NUM_PDCH_CS]; +/* LC15 default parameters */ +#define GSM_BTS_MAX_CELL_SIZE_DEFAULT 166 /* 166 qbits is default value */ +#define GSM_BTS_DIVERSITY_MODE_DEFAULT 2 /* MRC is default mode */ +#define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ +#define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ +#define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ + #endif /* LC15BTS_H */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 8c4364c..fcace3f 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -65,6 +65,35 @@ static struct gsm_bts *vty_bts; +static const struct value_string lc15_diversity_mode_strs[] = { + { LC15_DIVERSITY_SISO_A, "siso-a" }, + { LC15_DIVERSITY_SISO_B, "siso-b" }, + { LC15_DIVERSITY_MRC, "mrc" }, + { 0, NULL } +}; + +static const struct value_string lc15_pedestal_mode_strs[] = { + { LC15_PEDESTAL_OFF, "off" }, + { LC15_PEDESTAL_ON, "on" }, + { 0, NULL } +}; + +static const struct value_string lc15_auto_adj_pwr_strs[] = { + { LC15_TX_PWR_ADJ_NONE, "none" }, + { LC15_TX_PWR_ADJ_AUTO, "auto" }, + { 0, NULL } +}; + +static int parse_mdbm(const char *valstr, const char *unit) +{ + int val = atoi(valstr); + + if (!strcmp(unit, "dB") || !strcmp(unit, "dBm")) + return val * 1000; + else + return val; +} + /* configuration */ DEFUN(cfg_phy_cal_path, cfg_phy_cal_path_cmd, @@ -321,8 +350,114 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_max_cell_size, cfg_bts_max_cell_size_cmd, + "max-cell-size <0-166>", + "Set the maximum cell size in qbits\n") +{ + struct gsm_bts *bts = vty->index;; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int cell_size = (uint8_t)atoi(argv[0]); + + if (( cell_size > 166 ) || ( cell_size < 0 )) { + vty_out(vty, "Max cell size must be between 0 and 166 qbits (%d) %s", + cell_size, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->max_cell_size = (uint8_t)cell_size; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_diversity_mode, cfg_bts_diversity_mode_cmd, + "diversity-mode (siso-a|siso-b|mrc)", + "Set reception diversity mode \n" + "Reception diversity mode can be (siso-a, siso-b, mrc)\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_diversity_mode_strs, argv[0]); + + if((val < LC15_DIVERSITY_SISO_A) || (val > LC15_DIVERSITY_MRC)) { + vty_out(vty, "Invalid reception diversity mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->diversity_mode = (uint8_t)val; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_pedestal_mode, cfg_bts_pedestal_mode_cmd, + "pedestal-mode (on|off)", + "Set unused time-slot transmission in pedestal mode\n" + "Transmission pedestal mode can be (off, on)\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_pedestal_mode_strs, argv[0]); + + if((val < LC15_PEDESTAL_OFF) || (val > LC15_PEDESTAL_ON)) { + vty_out(vty, "Invalid unused time-slot transmission mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->pedestal_mode = (uint8_t)val; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, + "pwr-adj-mode (none|auto)", + "Set output power adjustment mode\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_auto_adj_pwr_strs, argv[0]); + + if((val < LC15_TX_PWR_ADJ_NONE) || (val > LC15_TX_PWR_ADJ_AUTO)) { + vty_out(vty, "Invalid output power adjustment mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->tx_pwr_adj_mode = (uint8_t)val; + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_tx_red_pwr_8psk, cfg_bts_tx_red_pwr_8psk_cmd, + "tx-red-pwr-8psk <0-40>", + "Set reduction output power for 8-PSK scheme in dB unit\n") +{ + struct gsm_bts *bts = vty->index;; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = atoi(argv[0]); + + if (( val > 40 ) || ( val < 0 )) { + vty_out(vty, "Reduction Tx power level must be between 0 and 40 dB (%d) %s", + val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->tx_pwr_red_8psk = (uint8_t)val; + return CMD_SUCCESS; +} + void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + + vty_out(vty, " max-cell-size %d%s", + btsb->max_cell_size, VTY_NEWLINE); + + vty_out(vty, " diversity-mode %s%s", + get_value_string(lc15_diversity_mode_strs, btsb->diversity_mode), VTY_NEWLINE); + + vty_out(vty, " pedestal-mode %s%s", + get_value_string(lc15_pedestal_mode_strs, btsb->pedestal_mode) , VTY_NEWLINE); + + vty_out(vty, " pwr-adj-mode %s%s", + get_value_string(lc15_auto_adj_pwr_strs, btsb->tx_pwr_adj_mode), VTY_NEWLINE); + + vty_out(vty, " tx-red-pwr-8psk %d%s", + btsb->tx_pwr_red_8psk, VTY_NEWLINE); + } void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) @@ -405,6 +540,13 @@ install_element(BTS_NODE, &cfg_bts_auto_band_cmd); install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd); + install_element(BTS_NODE, &cfg_bts_diversity_mode_cmd); + install_element(BTS_NODE, &cfg_bts_pedestal_mode_cmd); + install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); + install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); + install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); + + install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); install_element(PHY_INST_NODE, &cfg_phy_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_no_dsp_trace_f_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index 352949b..b2f0f77 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -72,6 +72,12 @@ btsb = bts_role_bts(bts); btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + /* specific default values for LC15 platform */ + btsb->max_cell_size = GSM_BTS_MAX_CELL_SIZE_DEFAULT; + btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; + btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; + btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; + btsb->tx_pwr_red_8psk = GSM_BTS_TX_RED_PWR_8PSK_DEFAULT; rc = oml_router_init(bts, OML_ROUTER_PATH, &accept_fd, &read_fd); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Enable to bypass LED control by the BTS via configurat... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/240 to look at the new patch set (#2). LC15: Enable to bypass LED control by the BTS via configuration file Change-Id: I17639bfffa2429d70eb254427812260ec8802ef6 --- M include/osmo-bts/gsm_data.h M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 5 files changed, 48 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/40/240/2 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 6bbbd5f..101cbfc 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -116,6 +116,7 @@ uint8_t max_cell_size; /* 166 qbits */ uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ + uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ #endif diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index e94db84..0f10fcb 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1046,6 +1046,8 @@ GsmL1_Status_t status; int on = 0; unsigned int i; + struct gsm_bts *bts = trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); if (sysp->id == Litecell15_PrimId_ActivateRfCnf) on = 1; @@ -1064,8 +1066,10 @@ LOGP(DL1C, LOGL_FATAL, "RF-ACT.conf with status %s\n", get_value_string(lc15bts_l1status_names, status)); bts_shutdown(trx->bts, "RF-ACT failure"); - } else - bts_update_status(BTS_STATUS_RF_ACTIVE, 1); + } else { + if(btsb->led_ctrl_mode == LC15_LED_CONTROL_BTS) + bts_update_status(BTS_STATUS_RF_ACTIVE, 1); + } /* signal availability */ oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); @@ -1076,8 +1080,8 @@ for (i = 0; i < ARRAY_SIZE(trx->ts); i++) oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); } else { - bts_update_status(BTS_STATUS_RF_ACTIVE, 0); - + if(btsb->led_ctrl_mode == LC15_LED_CONTROL_BTS) + bts_update_status(BTS_STATUS_RF_ACTIVE, 0); oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); } @@ -1162,10 +1166,13 @@ oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 0); } else { int i; + struct gsm_bts *bts = trx->bts; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); LOGP(DL1C, LOGL_INFO, "Rx RF-MUTE.conf with status=%s\n", get_value_string(lc15bts_l1status_names, status)); - bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]); + if(btsb->led_ctrl_mode == LC15_LED_CONTROL_BTS) + bts_update_status(BTS_STATUS_RF_MUTE, fl1h->last_rf_mute[0]); oml_mo_rf_lock_chg(&trx->mo, fl1h->last_rf_mute, 1); osmo_static_assert( diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index f6a7e3f..4822893 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -33,6 +33,11 @@ LC15_PEDESTAL_ON, }; +enum lc15_led_control_mode{ + LC15_LED_CONTROL_BTS = 0, + LC15_LED_CONTROL_EXT, +}; + enum lc15_auto_pwr_adjust_mode{ LC15_TX_PWR_ADJ_NONE = 0, LC15_TX_PWR_ADJ_AUTO, @@ -81,6 +86,7 @@ #define GSM_BTS_MAX_CELL_SIZE_DEFAULT 166 /* 166 qbits is default value */ #define GSM_BTS_DIVERSITY_MODE_DEFAULT 2 /* MRC is default mode */ #define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ +#define GSM_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */ #define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ #define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index fcace3f..7762a57 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -78,6 +78,12 @@ { 0, NULL } }; +static const struct value_string lc15_led_mode_strs[] = { + { LC15_LED_CONTROL_BTS, "bts" }, + { LC15_LED_CONTROL_EXT, "external" }, + { 0, NULL } +}; + static const struct value_string lc15_auto_adj_pwr_strs[] = { { LC15_TX_PWR_ADJ_NONE, "none" }, { LC15_TX_PWR_ADJ_AUTO, "auto" }, @@ -404,6 +410,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_led_mode, cfg_bts_led_mode_cmd, + "led-control-mode (bts|external)", + "Set LED controlled by BTS or external software\n" + "LED can be controlled by (bts, external)\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + int val = get_string_value(lc15_led_mode_strs, argv[0]); + + if((val < LC15_LED_CONTROL_BTS) || (val > LC15_LED_CONTROL_EXT)) { + vty_out(vty, "Invalid LED control mode %d%s", val, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->led_ctrl_mode = (uint8_t)val; + return CMD_SUCCESS; +} + DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, "pwr-adj-mode (none|auto)", "Set output power adjustment mode\n") @@ -451,6 +475,9 @@ vty_out(vty, " pedestal-mode %s%s", get_value_string(lc15_pedestal_mode_strs, btsb->pedestal_mode) , VTY_NEWLINE); + + vty_out(vty, " led-control-mode %s%s", + get_value_string(lc15_led_mode_strs, btsb->led_ctrl_mode), VTY_NEWLINE); vty_out(vty, " pwr-adj-mode %s%s", get_value_string(lc15_auto_adj_pwr_strs, btsb->tx_pwr_adj_mode), VTY_NEWLINE); @@ -542,6 +569,7 @@ install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd); install_element(BTS_NODE, &cfg_bts_diversity_mode_cmd); install_element(BTS_NODE, &cfg_bts_pedestal_mode_cmd); + install_element(BTS_NODE, &cfg_bts_led_mode_cmd); install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index b2f0f77..b172c5c 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -74,6 +74,7 @@ btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); /* specific default values for LC15 platform */ btsb->max_cell_size = GSM_BTS_MAX_CELL_SIZE_DEFAULT; + btsb->led_ctrl_mode = GSM_BTS_LED_CTRL_MODE_DEFAULT; btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; -- To view, visit https://gerrit.osmocom.org/240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I17639bfffa2429d70eb254427812260ec8802ef6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/241 to look at the new patch set (#2). LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB step Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 --- M include/osmo-bts/gsm_data.h M src/common/oml.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 5 files changed, 41 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/241/2 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 101cbfc..001dacb 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -117,6 +117,7 @@ uint8_t diversity_mode; /* 0: SISO A, 1: SISO B, 2: MRC */ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ + uint8_t pwr_red_step; /* Tx power reduction steps in 1 dB or 2 dB */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ #endif diff --git a/src/common/oml.c b/src/common/oml.c index 86ec1bf..e7953c9 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -637,9 +637,20 @@ /* 9.4.47 RF Max Power Reduction */ if (TLVP_PRESENT(&tp, NM_ATT_RF_MAXPOWR_R)) { +#ifdef ENABLE_LC15BTS + struct gsm_bts_role_bts *btsb = bts_role_bts(trx->bts); + if( btsb->pwr_red_step == 2) + trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R) * 2; + else + trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R); + + LOGP(DOML, LOGL_INFO, "Set RF Max Power Reduction=%d dB, step=%d dB\n", + trx->max_power_red, btsb->pwr_red_step); +#else trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R) * 2; - LOGP(DOML, LOGL_INFO, "Set RF Max Power Reduction = %d dBm\n", - trx->max_power_red); + LOGP(DOML, LOGL_INFO, "Set RF Max Power Reduction = %d dB\n", + trx->max_power_red); +#endif } /* 9.4.5 ARFCN List */ #if 0 diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index 4822893..cada00d 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -87,6 +87,7 @@ #define GSM_BTS_DIVERSITY_MODE_DEFAULT 2 /* MRC is default mode */ #define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ #define GSM_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */ +#define GSM_BTS_PWR_RED_STEP_DEFAULT 2 /* Default Tx power reduction step is 2 dB */ #define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ #define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 7762a57..1b2ff61 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -428,6 +428,26 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_pwr_red_step, cfg_bts_pwr_red_step_cmd, + "pwr-red-step <1-2>", + "Set the transmit output power reduction step in dB\n" + "Power reduction step in dB\n") +{ + struct gsm_bts *bts = vty->index; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + uint8_t pwr_red_step = (uint8_t)atoi(argv[0]); + + if (( pwr_red_step > 2 ) || ( pwr_red_step < 1 )) { + vty_out(vty, "Tx power reduction step must be either 1 or 2 dB (%d) %s", + pwr_red_step, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->pwr_red_step = pwr_red_step; + + return CMD_SUCCESS; +} + DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, "pwr-adj-mode (none|auto)", "Set output power adjustment mode\n") @@ -484,6 +504,10 @@ vty_out(vty, " tx-red-pwr-8psk %d%s", btsb->tx_pwr_red_8psk, VTY_NEWLINE); + + vty_out(vty, " pwr-red-step %d%s", + btsb->pwr_red_step, VTY_NEWLINE); + } @@ -571,6 +595,7 @@ install_element(BTS_NODE, &cfg_bts_pedestal_mode_cmd); install_element(BTS_NODE, &cfg_bts_led_mode_cmd); install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); + install_element(BTS_NODE, &cfg_bts_pwr_red_step_cmd); install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index b172c5c..ce30021 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -77,6 +77,7 @@ btsb->led_ctrl_mode = GSM_BTS_LED_CTRL_MODE_DEFAULT; btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; + btsb->pwr_red_step = GSM_BTS_PWR_RED_STEP_DEFAULT; btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; btsb->tx_pwr_red_8psk = GSM_BTS_TX_RED_PWR_8PSK_DEFAULT; -- To view, visit https://gerrit.osmocom.org/241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Introduce TS 12.21 8.8.2 Abis/OML failure event report In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/242 to look at the new patch set (#2). LC15: Introduce TS 12.21 8.8.2 Abis/OML failure event report Change-Id: Id710f452c4e0eecbba855e87ab86a3087988e326 --- M include/osmo-bts/oml.h M include/osmo-bts/pcuif_proto.h M src/common/main.c M src/common/oml.c M src/common/pcu_sock.c 5 files changed, 135 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/42/242/2 diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index 9f49444..1182437 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -1,11 +1,38 @@ #ifndef _OML_H #define _OML_H +#include struct gsm_bts; struct gsm_abis_mo; struct msgb; struct gsm_lchan; +struct gsm_failure_evt_rep { + uint8_t event_type; + uint8_t event_serverity; + uint8_t cause_type; + uint16_t event_cause; + char *add_text; +}; + +/* FIXME: can move to libosmocore */ +enum abis_mm_event_causes { + /* Critical causes */ + NM_MM_EVT_CRIT_SW_FATAL = 0x0000, + NM_MM_EVT_CRIT_PROC_STOP = 0x0002, + NM_MM_EVT_CRIT_RTP_TOUT = 0x032c, + NM_MM_EVT_CRIT_BOOT_FAIL = 0x0401, + /* Major causes */ + NM_MM_EVT_MAJ_UKWN_MSG = 0x0002, + NM_MM_EVT_MAJ_RSL_FAIL = 0x0309, + NM_MM_EVT_MAJ_UNSUP_ATTR = 0x0318, + NM_MM_EVT_MAJ_NET_CONGEST = 0x032b, + /* Minor causes */ + NM_MM_EVT_MIN_PAG_TAB_FULL = 0x0401, + /* Warning causes */ + NM_MM_EVT_WARN_SW_WARN = 0x0001, + +}; int oml_init(void); int down_oml(struct gsm_bts *bts, struct msgb *msg); @@ -42,4 +69,7 @@ int oml_set_lchan_t200(struct gsm_lchan *lchan); extern const unsigned int oml_default_t200_ms[7]; +/* Transmit failure event report */ +int oml_tx_failure_event_rep(struct gsm_abis_mo *mo, struct gsm_failure_evt_rep failure_evt_rep); + #endif // _OML_H */ diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index 9d740ac..75e911b 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -14,6 +14,9 @@ #define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ #define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ +/*alarms & performance counters */ +#define PCU_IF_MSG_FAILURE_EVT_IND 0x67 /* PCU failure event report indication*/ + /* sapi */ #define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ #define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ @@ -131,6 +134,14 @@ uint8_t identity_lv[9]; } __attribute__ ((packed)); +struct gsm_pcu_if_fail_evt_ind { + uint8_t event_type; + uint8_t event_serverity; + uint8_t cause_type; + uint16_t event_cause; + char add_text[100]; +}__attribute__ ((packed)); + struct gsm_pcu_if { /* context based information */ uint8_t msg_type; /* message type */ @@ -147,6 +158,7 @@ struct gsm_pcu_if_act_req act_req; struct gsm_pcu_if_time_ind time_ind; struct gsm_pcu_if_pag_req pag_req; + struct gsm_pcu_if_fail_evt_ind failure_evt_ind; } u; } __attribute__ ((packed)); diff --git a/src/common/main.c b/src/common/main.c index d19c284..a0edbff 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -50,6 +50,7 @@ #include #include #include +#include int quit = 0; static const char *config_file = "osmo-bts.cfg"; @@ -176,18 +177,38 @@ static void signal_handler(int signal) { + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + fprintf(stderr, "signal %u received\n", signal); switch (signal) { case SIGINT: //osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); - if (!quit) + if (!quit) { + snprintf(log_msg, 100, "BTS: signal SIGINT received -> shutdown\n"); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_PROC_STOP; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&bts->mo, failure_rep); + bts_shutdown(bts, "SIGINT"); + } quit++; break; case SIGABRT: case SIGUSR1: case SIGUSR2: + snprintf(log_msg, 100, "BTS: signal %d received\n", signal); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_PROC_STOP; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&bts->mo, failure_rep); + talloc_report_full(tall_bts_ctx, stderr); break; default: diff --git a/src/common/oml.c b/src/common/oml.c index e7953c9..2277c37 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -41,6 +41,8 @@ #include #include #include +#include +#include /* FIXME: move this to libosmocore */ static struct tlv_definition abis_nm_att_tlvdef_ipa = { @@ -369,6 +371,38 @@ return oml_mo_send_msg(mo, nmsg, NM_MT_SW_ACTIVATED_REP); } +/* TS 12.21 8.8.2 */ +int oml_tx_failure_event_rep(struct gsm_abis_mo *mo, struct gsm_failure_evt_rep failure_evt_rep) +{ + struct msgb *nmsg; + uint8_t cause[3]; + int i, len; + + LOGP(DOML, LOGL_INFO, "%s Tx FAILure EVT REP\n", gsm_abis_mo_name(mo)); + + nmsg = oml_msgb_alloc(); + if (!nmsg) + return -ENOMEM; + + msgb_tv_put(nmsg, NM_ATT_EVENT_TYPE, failure_evt_rep.event_type); + msgb_tv_put(nmsg, NM_ATT_SEVERITY, failure_evt_rep.event_serverity); + + cause[0] = failure_evt_rep.cause_type; + for (i = 0; i < 2 ; i++) + cause[i + 1] = ((uint8_t*)&failure_evt_rep.event_cause)[1 - i]; + + msgb_tv_fixed_put(nmsg, NM_ATT_PROB_CAUSE, 3, cause); + + len = strlen(failure_evt_rep.add_text); + if(len){ + LOGP(DOML, LOGL_DEBUG, "%s Tx FAILure EVT REP Additional Text = %s (%d)\n", gsm_abis_mo_name(mo), failure_evt_rep.add_text, len); + msgb_tl16v_put(nmsg, NM_ATT_ADD_TEXT, len, failure_evt_rep.add_text); + } + + return oml_mo_send_msg(mo, nmsg, NM_MT_FAILURE_EVENT_REP); + +} + /* TS 12.21 9.4.53 */ enum abis_nm_t200_idx { T200_SDCCH = 0, diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 7c835fb..77186c0 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -40,6 +40,7 @@ #include #include #include +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -550,11 +551,35 @@ return 0; } +static int pcu_rx_failure_event_rep(struct gsm_bts *bts, struct gsm_pcu_if_fail_evt_ind *fail_ind) +{ + struct gsm_failure_evt_rep failure_rep; + int rc; + + LOGP(DPCU, LOGL_DEBUG, "[PCU] Failure EVT REP detailed: evt_type=%02x, evt_serv=%02x, cause_type=%02x, cause_id=%04x, text=%s\n", + fail_ind->event_type, + fail_ind->event_serverity, + fail_ind->cause_type, + fail_ind->event_cause, + fail_ind->add_text); + + failure_rep.event_type = fail_ind->event_type; + failure_rep.event_serverity = fail_ind->event_serverity; + failure_rep.cause_type = fail_ind->cause_type; + failure_rep.event_cause = fail_ind->event_cause; + failure_rep.add_text = &fail_ind->add_text[0]; + + rc = oml_tx_failure_event_rep(&bts->gprs.cell.mo, failure_rep); + return rc; +} + static int pcu_rx(struct gsm_network *net, uint8_t msg_type, struct gsm_pcu_if *pcu_prim) { int rc = 0; struct gsm_bts *bts; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; /* FIXME: allow multiple BTS */ bts = llist_entry(net->bts_list.next, struct gsm_bts, list); @@ -567,9 +592,19 @@ case PCU_IF_MSG_ACT_REQ: rc = pcu_rx_act_req(bts, &pcu_prim->u.act_req); break; + case PCU_IF_MSG_FAILURE_EVT_IND: + rc = pcu_rx_failure_event_rep(bts, &pcu_prim->u.failure_evt_ind); + break; default: - LOGP(DPCU, LOGL_ERROR, "Received unknwon PCU msg type %d\n", - msg_type); + snprintf(log_msg, 100, "Received unknown PCU msg type %d\n", msg_type); + LOGP(DPCU, LOGL_ERROR,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&bts->mo, failure_rep); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id710f452c4e0eecbba855e87ab86a3087988e326 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Introduce DSP alive timer per TRX In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/243 to look at the new patch set (#2). LC15: Introduce DSP alive timer per TRX Change-Id: Ic075063a5b3294b72cc502a01e9616c296797238 --- M include/osmo-bts/gsm_data.h M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/l1_if.h M src/osmo-bts-litecell15/lc15bts.c M src/osmo-bts-litecell15/lc15bts.h M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 7 files changed, 125 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/243/2 diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index 001dacb..ef569f8 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -118,6 +118,7 @@ uint8_t pedestal_mode; /* 0: unused TS is OFF, 1: unused TS is in minimum Tx power */ uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ uint8_t pwr_red_step; /* Tx power reduction steps in 1 dB or 2 dB */ + uint8_t dsp_alive_period; /* DSP alive timer period */ uint8_t tx_pwr_adj_mode; /* 0: no auto adjust power, 1: auto adjust power using RMS detector */ uint8_t tx_pwr_red_8psk; /* 8-PSK maximum Tx power reduction level in dB */ #endif diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0f10fcb..1faa00b 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -66,6 +66,7 @@ #include "misc/lc15bts_par.h" #include "misc/lc15bts_bid.h" #include "utils.h" +#include "osmo-bts/oml.h" extern unsigned int dsp_trace; @@ -1398,6 +1399,73 @@ return 0; } +static void dsp_alive_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) +{ + Litecell15_Prim_t *sysp = msgb_sysprim(resp); + Litecell15_IsAliveCnf_t *sac = &sysp->u.IsAliveCnf; + struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(trx); + + fl1h->hw_alive.dsp_alive_cnt++; + fl1h->failure_rep_sent = 0; + LOGP(DL1C, LOGL_NOTICE, "Rx SYS prim %s, status=%d (%d)\n", + get_value_string(lc15bts_sysprim_names, sysp->id), sac->status, trx->nr); + + msgb_free(resp); +} + +static int dsp_alive_timer_cb(void *data) +{ + struct lc15l1_hdl *fl1h = data; + struct gsm_bts_trx *trx = fl1h->phy_inst->trx; + struct msgb *msg = sysp_msgb_alloc(); + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + + Litecell15_Prim_t *sys_prim = msgb_sysprim(msg); + sys_prim->id = Litecell15_PrimId_IsAliveReq; + + if (fl1h->hw_alive.dsp_alive_cnt == 0) { + + if(fl1h->failure_rep_sent) + exit(23); + + snprintf(log_msg, 100, "Timeout waiting for SYS prim %s primitive (%d)\n", + get_value_string(lc15bts_sysprim_names, sys_prim->id + 1), trx->nr); + + LOGP(DL1C, LOGL_ERROR,"%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + if(!rc) + fl1h->failure_rep_sent = 1; + } + } + + LOGP(DL1C, LOGL_NOTICE, "Tx SYS prim %s (%d)\n", + get_value_string(lc15bts_sysprim_names, sys_prim->id), trx->nr); + + rc = l1if_req_compl(fl1h, msg, dsp_alive_compl_cb, NULL); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id)); + return -EIO; + } + + /* restart timer */ + fl1h->hw_alive.dsp_alive_cnt = 0; + osmo_timer_schedule(&fl1h->hw_alive.dsp_alive_timer, fl1h->hw_alive.dsp_alive_period, 0); + + return 0; +} + int bts_model_phy_link_open(struct phy_link *plink) { struct phy_instance *pinst = phy_instance_by_num(plink, 0); @@ -1425,6 +1493,26 @@ phy_link_state_set(plink, PHY_LINK_CONNECTED); + /* Send first IS_ALIVE primitive */ + struct msgb *msg = sysp_msgb_alloc(); + int rc; + + Litecell15_Prim_t *sys_prim = msgb_sysprim(msg); + sys_prim->id = Litecell15_PrimId_IsAliveReq; + + rc = l1if_req_compl(fl1h, msg, dsp_alive_compl_cb, NULL); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id)); + return -EIO; + } + + /* initialize DSP heart beat alive timer */ + struct gsm_bts_role_bts *btsb = bts_role_bts(pinst->trx->bts); + fl1h->hw_alive.dsp_alive_timer.cb = dsp_alive_timer_cb; + fl1h->hw_alive.dsp_alive_timer.data = fl1h; + fl1h->hw_alive.dsp_alive_cnt = 0; + fl1h->hw_alive.dsp_alive_period = btsb->dsp_alive_period; + osmo_timer_schedule(&fl1h->hw_alive.dsp_alive_timer, fl1h->hw_alive.dsp_alive_period, 0); return 0; } diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h index 0c8843b..ad75ea6 100644 --- a/src/osmo-bts-litecell15/l1_if.h +++ b/src/osmo-bts-litecell15/l1_if.h @@ -59,6 +59,13 @@ struct calib_send_state st; uint8_t last_rf_mute[8]; + + struct { + struct osmo_timer_list dsp_alive_timer; + unsigned int dsp_alive_cnt; + uint8_t dsp_alive_period; + } hw_alive; + uint8_t failure_rep_sent; /* Flag to indicate the failure report has already sent to network before stop BTS itself*/ }; #define msgb_l1prim(msg) ((GsmL1_Prim_t *)(msg)->l1h) diff --git a/src/osmo-bts-litecell15/lc15bts.c b/src/osmo-bts-litecell15/lc15bts.c index 172a7e4..6ce82e3 100644 --- a/src/osmo-bts-litecell15/lc15bts.c +++ b/src/osmo-bts-litecell15/lc15bts.c @@ -121,6 +121,8 @@ case Litecell15_PrimId_MuteRfCnf: return L1P_T_CONF; case Litecell15_PrimId_SetRxAttenReq: return L1P_T_REQ; case Litecell15_PrimId_SetRxAttenCnf: return L1P_T_CONF; + case Litecell15_PrimId_IsAliveReq: return L1P_T_REQ; + case Litecell15_PrimId_IsAliveCnf: return L1P_T_CONF; default: return L1P_T_INVALID; } } @@ -142,6 +144,8 @@ { Litecell15_PrimId_MuteRfCnf, "MUTE-RF.cnf" }, { Litecell15_PrimId_SetRxAttenReq, "SET-RX-ATTEN.req" }, { Litecell15_PrimId_SetRxAttenCnf, "SET-RX-ATTEN-CNF.cnf" }, + { Litecell15_PrimId_IsAliveReq, "IS-ALIVE.req" }, + { Litecell15_PrimId_IsAliveCnf, "IS-ALIVE-CNF.cnf" }, { 0, NULL } }; @@ -155,6 +159,7 @@ case Litecell15_PrimId_SetCalibTblReq: return Litecell15_PrimId_SetCalibTblCnf; case Litecell15_PrimId_MuteRfReq: return Litecell15_PrimId_MuteRfCnf; case Litecell15_PrimId_SetRxAttenReq: return Litecell15_PrimId_SetRxAttenCnf; + case Litecell15_PrimId_IsAliveReq: return Litecell15_PrimId_IsAliveCnf; default: return -1; // Weak } } diff --git a/src/osmo-bts-litecell15/lc15bts.h b/src/osmo-bts-litecell15/lc15bts.h index cada00d..a00c48f 100644 --- a/src/osmo-bts-litecell15/lc15bts.h +++ b/src/osmo-bts-litecell15/lc15bts.h @@ -88,6 +88,7 @@ #define GSM_BTS_PEDESTAL_MODE_DEFAULT 0 /* Unused TS is off by default */ #define GSM_BTS_LED_CTRL_MODE_DEFAULT 0 /* LED is controlled by BTS by default */ #define GSM_BTS_PWR_RED_STEP_DEFAULT 2 /* Default Tx power reduction step is 2 dB */ +#define GSM_BTS_DSP_ALIVE_TMR_DEFAULT 5 /* Default DSP alive timer is 5 seconds */ #define GSM_BTS_TX_PWR_ADJ_DEFAULT 0 /* Default Tx power auto adjustment is none */ #define GSM_BTS_TX_RED_PWR_8PSK_DEFAULT 0 /* Default 8-PSK maximum power level is 0 dB */ diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 1b2ff61..4150504 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -448,6 +448,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_bts_dsp_alive_timer, cfg_bts_dsp_alive_timer_cmd, + "dsp-alive-period <0-60>", + "Set DSP alive timer period in second\n") +{ + struct gsm_bts *bts = vty->index;; + struct gsm_bts_role_bts *btsb = bts_role_bts(bts); + uint8_t period = (uint8_t)atoi(argv[0]); + + if (( period > 60 ) || ( period < 0 )) { + vty_out(vty, "DSP heart beat alive timer period must be between 0 and 60 seconds (%d) %s", + period, VTY_NEWLINE); + return CMD_WARNING; + } + + btsb->dsp_alive_period = period; + return CMD_SUCCESS; +} + DEFUN(cfg_bts_auto_tx_pwr_adj, cfg_bts_auto_tx_pwr_adj_cmd, "pwr-adj-mode (none|auto)", "Set output power adjustment mode\n") @@ -498,6 +516,9 @@ vty_out(vty, " led-control-mode %s%s", get_value_string(lc15_led_mode_strs, btsb->led_ctrl_mode), VTY_NEWLINE); + + vty_out(vty, " dsp-alive-period %d%s", + btsb->dsp_alive_period, VTY_NEWLINE); vty_out(vty, " pwr-adj-mode %s%s", get_value_string(lc15_auto_adj_pwr_strs, btsb->tx_pwr_adj_mode), VTY_NEWLINE); @@ -596,6 +617,7 @@ install_element(BTS_NODE, &cfg_bts_led_mode_cmd); install_element(BTS_NODE, &cfg_bts_max_cell_size_cmd); install_element(BTS_NODE, &cfg_bts_pwr_red_step_cmd); + install_element(BTS_NODE, &cfg_bts_dsp_alive_timer_cmd); install_element(BTS_NODE, &cfg_bts_auto_tx_pwr_adj_cmd); install_element(BTS_NODE, &cfg_bts_tx_red_pwr_8psk_cmd); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ce30021..6a2509b 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -78,6 +78,7 @@ btsb->diversity_mode = GSM_BTS_DIVERSITY_MODE_DEFAULT; btsb->pedestal_mode = GSM_BTS_PEDESTAL_MODE_DEFAULT; btsb->pwr_red_step = GSM_BTS_PWR_RED_STEP_DEFAULT; + btsb->dsp_alive_period = GSM_BTS_DSP_ALIVE_TMR_DEFAULT; btsb->tx_pwr_adj_mode = GSM_BTS_TX_PWR_ADJ_DEFAULT; btsb->tx_pwr_red_8psk = GSM_BTS_TX_RED_PWR_8PSK_DEFAULT; -- To view, visit https://gerrit.osmocom.org/243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic075063a5b3294b72cc502a01e9616c296797238 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - DSP L1 is no long... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/244 to look at the new patch set (#2). LC15: osmo-bts-litecell15/l1_if.c: Alarm - DSP L1 is no longer sending primitives Change-Id: Ic19e21c31a8f95c5e15c91cd886788ec4e83ec13 --- M src/osmo-bts-litecell15/oml.c 1 file changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/44/244/2 diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 7aedee1..d4a8c75 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -782,10 +782,32 @@ static void alive_timer_cb(void *data) { struct lc15l1_hdl *fl1h = data; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + int rc; if (fl1h->alive_prim_cnt == 0) { - LOGP(DL1C, LOGL_FATAL, "DSP L1 is no longer sending primitives!\n"); - exit(23); + + if(fl1h->failure_rep_sent) + exit(23); + + snprintf(log_msg, 100, "DSP L1 is no longer sending primitives!\n"); + LOGP(DL1C, LOGL_FATAL,"%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + if(!rc) + fl1h->failure_rep_sent = 1; + } + } fl1h->alive_prim_cnt = 0; osmo_timer_schedule(&fl1h->alive_timer, 5, 0); -- To view, visit https://gerrit.osmocom.org/244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic19e21c31a8f95c5e15c91cd886788ec4e83ec13 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/oml.c: Alarm - Timeout waiting for... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/245 to look at the new patch set (#2). LC15: osmo-bts-litecell15/oml.c: Alarm - Timeout waiting for primitives Change-Id: If35dc4c0d3c04d328d0d8f85d5cfa4038afe723b --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 38 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/245/2 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 1faa00b..8193030 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -75,6 +75,7 @@ struct osmo_timer_list timer; /* timer for L1 timeout */ unsigned int conf_prim_id; /* primitive we expect in response */ unsigned int is_sys_prim; /* is this a system (1) or L1 (0) primitive */ + struct lc15l1_hdl *fl1h; l1if_compl_cb *cb; void *cb_data; }; @@ -88,14 +89,43 @@ static void l1if_req_timeout(void *data) { struct wait_l1_conf *wlc = data; + struct lc15l1_hdl *fl1h = wlc->fl1h; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + int rc; - if (wlc->is_sys_prim) - LOGP(DL1C, LOGL_FATAL, "Timeout waiting for SYS primitive %s\n", - get_value_string(lc15bts_sysprim_names, wlc->conf_prim_id)); - else - LOGP(DL1C, LOGL_FATAL, "Timeout waiting for L1 primitive %s\n", - get_value_string(lc15bts_l1prim_names, wlc->conf_prim_id)); - exit(23); + if(fl1h->failure_rep_sent) + exit(23); + + if (wlc->is_sys_prim) { + snprintf(log_msg, 100, "Timeout waiting for SYS primitive %s\n", + get_value_string(lc15bts_sysprim_names, wlc->conf_prim_id)); + + } else { + snprintf(log_msg, 100, "Timeout waiting for L1 primitive %s\n", + get_value_string(lc15bts_l1prim_names, wlc->conf_prim_id)); + } + + LOGP(DL1C, LOGL_FATAL, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_SW_FATAL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + + if(!rc) + fl1h->failure_rep_sent = 1; + + } + + osmo_timer_schedule(&wlc->timer, 1, 0); + } static int _l1if_req_compl(struct lc15l1_hdl *fl1h, struct msgb *msg, @@ -155,6 +185,7 @@ llist_add(&wlc->list, &fl1h->wlc_list); /* schedule a timer for timeout_secs seconds. If DSP fails to respond, we terminate */ + wlc->fl1h = fl1h; wlc->timer.data = wlc; wlc->timer.cb = l1if_req_timeout; osmo_timer_schedule(&wlc->timer, timeout_secs, 0); -- To view, visit https://gerrit.osmocom.org/245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If35dc4c0d3c04d328d0d8f85d5cfa4038afe723b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - Unknown MPH-INFO.req In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/246 to look at the new patch set (#2). LC15: osmo-bts-litecell15/l1_if.c: Alarm - Unknown MPH-INFO.req Change-Id: Iff984987ac0db06825afccfcb982d33f53c70a04 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/246/2 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 8193030..d60ea57 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -492,6 +492,8 @@ uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: @@ -532,8 +534,15 @@ msgb_free(msg); break; default: - LOGP(DL1C, LOGL_NOTICE, "unknown MPH-INFO.req %d\n", - l1sap->u.info.type); + snprintf(log_msg, 100, "unknown MPH-INFO.req %d\n", l1sap->u.info.type); + LOGP(DL1C, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&trx->mo, failure_rep); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iff984987ac0db06825afccfcb982d33f53c70a04 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c : Alarm - Unknown l1sap do... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/247 to look at the new patch set (#2). LC15: osmo-bts-litecell15/l1_if.c : Alarm - Unknown l1sap downlink operation Change-Id: Ia31720a495fb460a6449d89e02a29ef18503b885 --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/247/2 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d60ea57..6f06ede 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -554,6 +554,8 @@ { struct msgb *msg = l1sap->oph.msg; int rc = 0; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; switch (OSMO_PRIM_HDR(&l1sap->oph)) { case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_REQUEST): @@ -566,8 +568,16 @@ rc = mph_info_req(trx, msg, l1sap); break; default: - LOGP(DL1C, LOGL_NOTICE, "unknown prim %d op %d\n", - l1sap->oph.primitive, l1sap->oph.operation); + snprintf(log_msg, 100, "unknown prim %d op %d\n", + l1sap->oph.primitive, l1sap->oph.operation); + LOGP(DL1C, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&trx->mo, failure_rep); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia31720a495fb460a6449d89e02a29ef18503b885 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to op... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/248 to look at the new patch set (#2). LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to open calibration data file Change-Id: If2829d68531494f0ede8f9dd2fe19ea99c63ea99 --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/248/2 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 3bc788c..1b60d3e 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -41,6 +41,7 @@ #include "l1_if.h" #include "lc15bts.h" #include "utils.h" +#include "osmo-bts/oml.h" /** * * Maximum calibration data chunk size @@ -137,7 +138,9 @@ { struct calib_send_state *st = &fl1h->st; char *calib_path = fl1h->phy_inst->u.lc15.calib_path; - char fname[PATH_MAX]; + char fname[PATH_MAX]; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; if (st->fp) { LOGP(DL1C, LOGL_NOTICE, "L1 calibration file was left opened !!\n"); @@ -151,9 +154,21 @@ st->fp = fopen(fname, "rb"); if (!st->fp) { - LOGP(DL1C, LOGL_ERROR, - "Failed to open '%s' for calibration data.\n", fname); - return -1; + snprintf(log_msg, 100, "Failed to open '%s' for calibration data.\n", fname); + LOGP(DL1C, LOGL_ERROR, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_BOOT_FAIL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + } + return -1; } return 0; } -- To view, visit https://gerrit.osmocom.org/248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If2829d68531494f0ede8f9dd2fe19ea99c63ea99 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to ve... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/249 to look at the new patch set (#2). LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to verify calibration data file Change-Id: I0472ca8024124a9123eef1a2a93742cf15e1371f --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 18 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/49/249/2 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 1b60d3e..87b9764 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -252,7 +252,24 @@ rc = calib_verify(fl1h, desc); if ( rc < 0 ) { - LOGP(DL1C, LOGL_ERROR, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; + + snprintf(log_msg, 100, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + LOGP(DL1C, LOGL_ERROR, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_CRIT_BOOT_FAIL; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + } + st->last_file_idx = get_next_calib_file_idx(fl1h, st->last_file_idx); if (st->last_file_idx >= 0) -- To view, visit https://gerrit.osmocom.org/249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0472ca8024124a9123eef1a2a93742cf15e1371f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Calibration ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/250 to look at the new patch set (#2). LC15: osmo-bts-litecell15/calib_file.c: Alarm - Calibration file path not specified Change-Id: Iff46e7ed6093cf77b95758a866a58991cd807bfa --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/250/2 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 87b9764..857e6d0 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -321,11 +321,26 @@ int rc; struct calib_send_state *st = &fl1h->st; char *calib_path = fl1h->phy_inst->u.lc15.calib_path; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; - if (!calib_path) { - LOGP(DL1C, LOGL_ERROR, "Calibration file path not specified\n"); - return -1; - } + if (!calib_path) { + snprintf(log_msg, 100, "Calibration file path not specified\n"); + LOGP(DL1C, LOGL_ERROR, "%s", log_msg); + + if( fl1h->phy_inst->trx ){ + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = 0x0401; + failure_rep.add_text = (char *)&log_msg; + + fl1h->phy_inst->trx->mo.obj_inst.trx_nr = fl1h->phy_inst->trx->nr; + + oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); + } + return -1; + } rc = get_next_calib_file_idx(fl1h, -1); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iff46e7ed6093cf77b95758a866a58991cd807bfa Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/bts.c : Alarm - Failed to establish RSL link an... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/251 to look at the new patch set (#2). LC15: common/bts.c : Alarm - Failed to establish RSL link and deactivate RF Change-Id: I8adac2c9dd1570feec14b3e66f8b05c4274cf127 --- M src/common/bts.c 1 file changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/251/2 diff --git a/src/common/bts.c b/src/common/bts.c index 6f621c4..69692b9 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -44,6 +44,7 @@ #include #include #include +#include "osmo-bts/oml.h" #define MIN_QUAL_RACH 5.0f /* at least 5 dB C/I */ #define MIN_QUAL_NORM -0.5f /* at least -1 dB C/I */ @@ -250,6 +251,9 @@ int trx_link_estab(struct gsm_bts_trx *trx) { struct e1inp_sign_link *link = trx->rsl_link; + int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; uint8_t radio_state = link ? NM_OPSTATE_ENABLED : NM_OPSTATE_DISABLED; LOGP(DSUM, LOGL_INFO, "RSL link (TRX %02x) state changed to %s, sending Status'.\n", @@ -258,11 +262,26 @@ oml_mo_state_chg(&trx->mo, radio_state, NM_AVSTATE_OK); if (link) - rsl_tx_rf_res(trx); + rc = rsl_tx_rf_res(trx); else - bts_model_trx_deact_rf(trx); + rc = bts_model_trx_deact_rf(trx); - return 0; + if(rc < 0) { + if(link) + snprintf(log_msg, 100, "Failed to establish RSL link (%d)\n", rc); + else + snprintf(log_msg, 100, "Failed to deactivate RF (%d)\n", rc); + + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_RSL_FAIL; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + + return rc; } /* set the availability of the TRX (used by PHY driver) */ -- To view, visit https://gerrit.osmocom.org/251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8adac2c9dd1570feec14b3e66f8b05c4274cf127 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c: Alarm - Unsupported BTS attributes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/252 to look at the new patch set (#2). LC15: common/oml.c: Alarm - Unsupported BTS attributes Change-Id: I1a515a8fca128b924c82d8a88eb5d420e14b3604 --- M src/common/oml.c 1 file changed, 34 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/252/2 diff --git a/src/common/oml.c b/src/common/oml.c index 2277c37..ccafc66 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -495,24 +495,56 @@ struct gsm_bts_role_bts *btsb = bts_role_bts(bts); int rc, i; const uint8_t *payload; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx SET BTS ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&bts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* Test for globally unsupported stuff here */ if (TLVP_PRESENT(&tp, NM_ATT_BCCH_ARFCN)) { uint16_t arfcn = ntohs(tlvp_val16_unal(&tp, NM_ATT_BCCH_ARFCN)); if (arfcn > 1024) { - LOGP(DOML, LOGL_NOTICE, "Given ARFCN %d is not supported.\n", arfcn); + snprintf(log_msg, 100, "Given ARFCN %d is not supported.\n", + arfcn); + + LOGP(DOML, LOGL_NOTICE, "%s", log_msg); + + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_WARNING; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_WARN_SW_WARN; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&bts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL); } } /* 9.4.52 Starting Time */ if (TLVP_PRESENT(&tp, NM_ATT_START_TIME)) { + snprintf(log_msg, 100, "NM_ATT_START_TIME Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_CRITICAL; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&bts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP); } -- To view, visit https://gerrit.osmocom.org/252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1a515a8fca128b924c82d8a88eb5d420e14b3604 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c: Alarm - Unsupported radio attributes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/253 to look at the new patch set (#2). LC15: common/oml.c: Alarm - Unsupported radio attributes Change-Id: I209ea1ca0b54fb36189ca1154134344f57c1898c --- M src/common/oml.c 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/253/2 diff --git a/src/common/oml.c b/src/common/oml.c index ccafc66..cc87ec4 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -676,13 +676,25 @@ struct abis_om_fom_hdr *foh = msgb_l3(msg); struct tlv_parsed tp, *tp_merged; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx SET RADIO CARRIER ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for Set Radio Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + + oml_tx_failure_event_rep(&trx->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* merge existing BTS attributes with new attributes */ tp_merged = tlvp_copy(trx->mo.nm_attr, trx->bts); -- To view, visit https://gerrit.osmocom.org/253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I209ea1ca0b54fb36189ca1154134344f57c1898c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported channel attributes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/254 to look at the new patch set (#2). LC15: common/oml.c : Alarm - Unsupported channel attributes Change-Id: I52fd6f3edb0e7eb88c6ea97454696fa84e322cf9 --- M src/common/oml.c 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/254/2 diff --git a/src/common/oml.c b/src/common/oml.c index cc87ec4..b32231b 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -838,13 +838,24 @@ struct gsm_bts *bts = ts->trx->bts; struct tlv_parsed tp, *tp_merged; int rc; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; abis_nm_debugp_foh(DOML, foh); DEBUGPC(DOML, "Rx SET CHAN ATTR\n"); rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh)); - if (rc < 0) + if (rc < 0) { + snprintf(log_msg, 100, "New value for Set Channel Attribute not supported\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + failure_rep.event_type = NM_EVT_PROC_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UNSUP_ATTR; + failure_rep.add_text = (char *)&log_msg; + oml_tx_failure_event_rep(&ts->mo, failure_rep); return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT); + } /* 9.4.21 HSN... */ /* 9.4.27 MAIO */ -- To view, visit https://gerrit.osmocom.org/254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I52fd6f3edb0e7eb88c6ea97454696fa84e322cf9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:06 +0000 Subject: [PATCH] osmo-bts[master]: LC15: common/oml.c : Alarm - Formatted O&M message too short In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/255 to look at the new patch set (#2). LC15: common/oml.c : Alarm - Formatted O&M message too short Change-Id: I697c7e14efb2ebdbf789b2e0db13c43521791d85 --- M src/common/oml.c 1 file changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/255/2 diff --git a/src/common/oml.c b/src/common/oml.c index b32231b..b5394dc 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -981,9 +981,27 @@ struct abis_om_fom_hdr *foh = msgb_l3(msg); struct gsm_bts_trx *trx; int ret; + char log_msg[100]; + struct gsm_failure_evt_rep failure_rep; if (msgb_l2len(msg) < sizeof(*foh)) { - LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too short\n"); + snprintf(log_msg, 100, "Formatted O&M message too short\n"); + LOGP(DOML, LOGL_NOTICE,"%s", log_msg); + + failure_rep.event_type = NM_EVT_COMM_FAIL; + failure_rep.event_serverity = NM_SEVER_MAJOR; + failure_rep.cause_type = NM_PCAUSE_T_MANUF; + failure_rep.event_cause = NM_MM_EVT_MAJ_UKWN_MSG; + failure_rep.add_text = (char *)&log_msg; + + trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr); + if (trx) { + trx->mo.obj_inst.bts_nr = 0; + trx->mo.obj_inst.trx_nr = foh->obj_inst.trx_nr; + trx->mo.obj_inst.ts_nr = 0xff; + oml_tx_failure_event_rep(&trx->mo, failure_rep); + } + return -EIO; } -- To view, visit https://gerrit.osmocom.org/255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I697c7e14efb2ebdbf789b2e0db13c43521791d85 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 15:23:11 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Tue, 14 Jun 2016 15:23:11 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Fix coding style Message-ID: Review at https://gerrit.osmocom.org/273 LC15: Fix coding style Change-Id: Icb8100eb9a3f89f2f6dfdcc7d5b33efab48e7860 --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 35 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/73/273/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 857e6d0..ccb4629 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -43,10 +43,10 @@ #include "utils.h" #include "osmo-bts/oml.h" -/** - * * Maximum calibration data chunk size - * */ + +/* Maximum calibration data chunk size */ #define MAX_CALIB_TBL_SIZE 65536 +/* Calibration header version */ #define CALIB_HDR_V1 0x01 struct calib_file_desc { @@ -362,25 +362,25 @@ char calChkSum ; - //calculate file size in bytes + /* calculate file size in bytes */ fseek(st->fp, 0L, SEEK_END); sz = ftell(st->fp); - //rewind read poiner + /* rewind read poiner */ fseek(st->fp, 0L, SEEK_SET); - //read file + /* read file */ rbuf = (char *) malloc( sizeof(char) * sz ); rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); - if ( rc != sz) { + if (rc != sz) { LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); free(rbuf); - //close file + /* close file */ rc = calib_file_close(fl1h); - if (rc < 0 ) { + if (rc < 0) { LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); return rc; } @@ -390,32 +390,32 @@ calTbl = (struct calTbl_t*) rbuf; - //calcualte file checksum + /* calcualte file checksum */ calChkSum = 0; - while ( sz-- ) { + while (sz--) { calChkSum ^= rbuf[sz]; } - //validate Tx calibration parity - if ( calChkSum ) { + /* validate Tx calibration parity */ + if (calChkSum) { LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); return -4; } - //validate Tx calibration header - if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { + /* validate Tx calibration header */ + if (calTbl->hdr.v1.u8Version != CALIB_HDR_V1) { LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); return -5; } - //validate calibration description - if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { + /* validate calibration description */ + if (calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); return -6; } - //validate calibration date - if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { + /* validate calibration date */ + if (calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); return -7; } @@ -424,37 +424,37 @@ desc->fname, calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); - //validate calibration station - if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { + /* validate calibration station */ + if (calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); return -8; } - //validate FPGA FW version - if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { + /* validate FPGA FW version */ + if (calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF) { LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); return -9; } - //validate DSP FW version - if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { + /* validate DSP FW version */ + if (calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF) { LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); return -10; } - //validate Tx calibration data offset - if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { + /* validate Tx calibration data offset */ + if (calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF) { LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); return -11; } - if ( !desc->rx ) { + if (!desc->rx) { - //parse min/max Tx power + /* parse min/max Tx power */ fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; - //override nominal Tx power of given TRX if needed - if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { + /* override nominal Tx power of given TRX if needed */ + if (fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", plink->num, fl1h->phy_inst->u.lc15.maxTxPower, @@ -463,7 +463,7 @@ fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.maxTxPower; } - if ( fl1h->phy_inst->trx->nominal_power < fl1h->phy_inst->u.lc15.minTxPower) { + if (fl1h->phy_inst->trx->nominal_power < fl1h->phy_inst->u.lc15.minTxPower) { LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", plink->num, fl1h->phy_inst->u.lc15.minTxPower, @@ -472,7 +472,7 @@ fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.minTxPower; } - if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm > to_mdB(fl1h->phy_inst->u.lc15.maxTxPower) ) { + if (fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm > to_mdB(fl1h->phy_inst->u.lc15.maxTxPower)) { LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", plink->num, to_mdB(fl1h->phy_inst->u.lc15.maxTxPower), @@ -481,7 +481,7 @@ fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.maxTxPower); } - if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm < to_mdB(fl1h->phy_inst->u.lc15.minTxPower) ) { + if (fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm < to_mdB(fl1h->phy_inst->u.lc15.minTxPower)) { LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", plink->num, to_mdB(fl1h->phy_inst->u.lc15.minTxPower), @@ -496,7 +496,7 @@ fl1h->phy_inst->u.lc15.maxTxPower ); } - //rewind read poiner for subsequence tasks + /* rewind read pointer for subsequence tasks */ fseek(st->fp, 0L, SEEK_SET); free(rbuf); -- To view, visit https://gerrit.osmocom.org/273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb8100eb9a3f89f2f6dfdcc7d5b33efab48e7860 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jun 14 16:28:56 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 14 Jun 2016 16:28:56 +0000 Subject: [PATCH] libosmocore[master]: Fix retrieving rate_ctr over control interface Message-ID: Review at https://gerrit.osmocom.org/274 Fix retrieving rate_ctr over control interface Allow getting either particular counter (e. g. rate_ctr.per_hour.e1inp.0.hdlc.abort) or entire rate counter group for a given index (e. g. rate_ctr.per_hour.e1inp.0). Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Fixes: OS#1730 --- M src/ctrl/control_if.c 1 file changed, 7 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/274/1 diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index bde245d..6d9a9fb 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -552,35 +552,29 @@ } ctr_group = strtok_r(NULL, ".", &saveptr); - tmp = strtok_r(NULL, ".", &saveptr); - if (!ctr_group || !tmp) { + ctr_idx = strtok_r(NULL, ".", &saveptr); + if (!ctr_group || !ctr_idx) { talloc_free(dup); - cmd->reply = "Counter group must be of form a.b"; + cmd->reply = "Counter group must be of name.index form e. g. " + "e1inp.0"; goto err; } - ctr_group[strlen(ctr_group)] = '.'; - ctr_idx = strtok_r(NULL, ".", &saveptr); - if (!ctr_idx) { - talloc_free(dup); - return get_rate_ctr_group(ctr_group, intv, cmd); - } idx = atoi(ctr_idx); ctrg = rate_ctr_get_group_by_name_idx(ctr_group, idx); if (!ctrg) { talloc_free(dup); - cmd->reply = "Counter group not found."; + cmd->reply = "Counter group with given name and index not found"; goto err; } - ctr_name = strtok_r(NULL, "\0", &saveptr); - if (!ctr_name) { + if (!strlen(saveptr)) { talloc_free(dup); return get_rate_ctr_group_idx(ctrg, intv, cmd); } - ctr = rate_ctr_get_by_name(ctrg, ctr_name); + ctr = rate_ctr_get_by_name(ctrg, saveptr); if (!ctr) { cmd->reply = "Counter name not found."; talloc_free(dup); -- To view, visit https://gerrit.osmocom.org/274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 14 17:02:43 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 14 Jun 2016 17:02:43 +0000 Subject: osmo-pcu[master]: Remove GMSK only check in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 1: I think some of the previous patches were sent around the time transition to gerrit happend so they might have slipped through in the process. Could you please double-check and re-send to gerrit if necessary? -- To view, visit https://gerrit.osmocom.org/268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 17:04:18 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 14 Jun 2016 17:04:18 +0000 Subject: osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported IPA set attributes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78f2f846132f9996bb4008643f1a666e366d2f85 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:54:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:54:53 +0000 Subject: osmo-bts[master]: LC15: Fix coding style In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb8100eb9a3f89f2f6dfdcc7d5b33efab48e7860 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:56:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:56:51 +0000 Subject: [PATCH] osmo-bts[master]: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/234 to look at the new patch set (#3). l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6 We have seen that the DSP time to time rejects PTCCH message from BTS due to invalid block number. As a result, we patched FN2PTCCHBLOCK calculation according TS 45.0002 Table 6. Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 --- M include/osmo-bts/l1sap.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/34/234/3 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index e76aca6..1f8b2a5 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -25,7 +25,7 @@ /* PTCH layout from frame number */ #define L1SAP_FN2MACBLOCK(fn) ((fn % 52) / 4) -#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 52) & 7) +#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 104) & 3) #define L1SAP_IS_PTCCH(fn) ((fn % 52) == 12) /* subslot from any chan_nr */ -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:56:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:56:54 +0000 Subject: osmo-bts[master]: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:57:06 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:57:06 +0000 Subject: [MERGED] osmo-bts[master]: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6 ...................................................................... l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6 We have seen that the DSP time to time rejects PTCCH message from BTS due to invalid block number. As a result, we patched FN2PTCCHBLOCK calculation according TS 45.0002 Table 6. Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 --- M include/osmo-bts/l1sap.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index e76aca6..1f8b2a5 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -25,7 +25,7 @@ /* PTCH layout from frame number */ #define L1SAP_FN2MACBLOCK(fn) ((fn % 52) / 4) -#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 52) & 7) +#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 104) & 3) #define L1SAP_IS_PTCCH(fn) ((fn % 52) == 12) /* subslot from any chan_nr */ -- To view, visit https://gerrit.osmocom.org/234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:57:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:57:44 +0000 Subject: [PATCH] osmo-bts[master]: common/abis.c: fix 100% CPU usage after disconnecting OML/RS... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/235 to look at the new patch set (#3). common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d --- M src/common/abis.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/235/3 diff --git a/src/common/abis.c b/src/common/abis.c index defdb44..6753149 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -144,7 +144,6 @@ if (trx->rsl_link) { e1inp_sign_link_destroy(trx->rsl_link); trx->rsl_link = NULL; - trx_link_estab(trx); } } -- To view, visit https://gerrit.osmocom.org/235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:57:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:57:56 +0000 Subject: osmo-bts[master]: common/abis.c: fix 100% CPU usage after disconnecting OML/RS... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:57:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:57:57 +0000 Subject: [MERGED] osmo-bts[master]: common/abis.c: fix 100% CPU usage after disconnecting OML/RS... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) ...................................................................... common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703) Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d --- M src/common/abis.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/abis.c b/src/common/abis.c index defdb44..6753149 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -144,7 +144,6 @@ if (trx->rsl_link) { e1inp_sign_link_destroy(trx->rsl_link); trx->rsl_link = NULL; - trx_link_estab(trx); } } -- To view, visit https://gerrit.osmocom.org/235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:58:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:58:46 +0000 Subject: osmo-bts[master]: LC15: Hardware changes: - Change system devices path - Remov... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 21:59:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 21:59:22 +0000 Subject: osmo-bts[master]: LC15: TRX nominal TX power can be used from EEPROM or from B... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:02:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:02:46 +0000 Subject: osmo-bts[master]: LC15: BTS parameters are configurable via configuration file... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/239/2/include/osmo-bts/gsm_data.h File include/osmo-bts/gsm_data.h: Line 115: /* specific to LC15 BTS */ I think I commented on this before, but somehow the comment doesn't seem to show up in gerrit anymore. Please don't add members to struct gsm_bts_role_bts like this. Don't introduce #ifdefs in the code. My first question is: Does this data really belong here, or does it belong into the phy_link structure? If it does belong here, then please introduce a union u { struct { } lc15; }; for your private data members, and skip the #ifdef. Thanks! -- To view, visit https://gerrit.osmocom.org/239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:05:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:05:24 +0000 Subject: osmo-bts[master]: LC15: BTS parameters are configurable via configuration file... In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/239/2/src/osmo-bts-litecell15/lc15bts.h File src/osmo-bts-litecell15/lc15bts.h: Line 81: #define GSM_BTS_MAX_CELL_SIZE_DEFAULT 166 /* 166 qbits is default value */ I also commented on this before, but somehow it got lost in gerrit. Are you sure you submitted your updated patch with the same change-id as the old patch? In either case, the #defines are LC15 specific and they should not pollute the global namespace with GSM_BTS_ prefix, which implies they are applicable to any type of BTS. https://gerrit.osmocom.org/#/c/239/2/src/osmo-bts-litecell15/lc15bts_vty.c File src/osmo-bts-litecell15/lc15bts_vty.c: Line 354: "max-cell-size <0-166>", and here my comment was that normally, all of this is configured via A-bis OML, as the BTS should not have any local configuration beyond how to reach the BSC and how to identify to it. Local config settings breaks the data model that operators generally expect, i.e. all configuration is maintained (and under revision control, ...) at the central BSC, and not at the remote BTSs. -- To view, visit https://gerrit.osmocom.org/239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:05:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:05:51 +0000 Subject: osmo-bts[master]: LC15: Enable to bypass LED control by the BTS via configurat... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/240/2/include/osmo-bts/gsm_data.h File include/osmo-bts/gsm_data.h: Line 119: uint8_t led_ctrl_mode; /* 0: control by BTS, 1: not control by BTS */ see my comment in the other patch -- To view, visit https://gerrit.osmocom.org/240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I17639bfffa2429d70eb254427812260ec8802ef6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:06:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:06:58 +0000 Subject: osmo-bts[master]: LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/241/2/src/common/oml.c File src/common/oml.c: Line 643: trx->max_power_red = *TLVP_VAL(&tp, NM_ATT_RF_MAXPOWR_R) * 2; also as commented before, you cannot re-define the meaning of an existing information element. This is a clear violation of the A-bis OML specification and will break compatibility and interoperability. Introduce a private/proprietary IE for this. -- To view, visit https://gerrit.osmocom.org/241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:09:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:09:07 +0000 Subject: osmo-pcu[master]: Remove GMSK only check in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 ideally this change should not be a separate patch, but it should be made at the same time that you introduce MCS5-9. But let's not waste time on this. -- To view, visit https://gerrit.osmocom.org/268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:09:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:09:55 +0000 Subject: osmo-pcu[master]: Add Header Type2 support in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:12:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:12:10 +0000 Subject: osmo-pcu[master]: Add header type 1 support for EGPRS uplink In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/270/1/src/bts.h File src/bts.h: PS1, Line 191: 9 Don't we already have a #define somewhere that allows us to avoid magic numbers but have a NR_GPRS_CS or similar here? If not, please introduce it. https://gerrit.osmocom.org/#/c/270/1/src/gprs_ms.cpp File src/gprs_ms.cpp: PS1, Line 635: 9 same here, let's use a #define. If it would have been used in the old code, we would have had only to change one location in the code, rather than various occurrences of the magic number '4'. -- To view, visit https://gerrit.osmocom.org/270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:13:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:13:19 +0000 Subject: osmo-pcu[master]: Add test cases for Header Type 2 in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/271/1/tests/edge/EdgeTest.cpp File tests/edge/EdgeTest.cpp: PS1, Line 1159: uint8_t cs = 1) we don't typically use that notation, but for a test case I'm sure it is ok -- To view, visit https://gerrit.osmocom.org/271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:13:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:13:46 +0000 Subject: osmo-pcu[master]: Add test cases for Header type1 in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:14:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:14:53 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:16:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:16:00 +0000 Subject: osmo-bts[master]: sysmo: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 general review is OK, but the same change must be made to the lc15 code base. please follow up with separate patch. -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:18:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:18:44 +0000 Subject: libosmocore[master]: lapdm: Fix malformed Abis messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/266/1//COMMIT_MSG Commit Message: Line 7: lapdm: Fix malformed Abis messages I'd like to request more verbose commit message, explaining in which way whihc particular messages were malformed, to make it explicit what particular issue was fixed. -- To view, visit https://gerrit.osmocom.org/266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:19:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:19:10 +0000 Subject: libosmo-sccp[master]: fix log msg typo, x5 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00ff99ef14d62d3b353fe69762ae49f374938f94 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:19:11 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:19:11 +0000 Subject: [MERGED] libosmo-sccp[master]: fix log msg typo, x5 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix log msg typo, x5 ...................................................................... fix log msg typo, x5 Change-Id: I00ff99ef14d62d3b353fe69762ae49f374938f94 Reviewed-on: https://gerrit.osmocom.org/265 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/sua.c 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sua.c b/src/sua.c index 89182d2..5575d58 100644 --- a/src/sua.c +++ b/src/sua.c @@ -844,7 +844,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "COAK for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "COAK for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -906,7 +906,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "COREF for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "COREF for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -959,7 +959,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "RELRE for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "RELRE for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -1009,7 +1009,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "RELCO for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "RELCO for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; @@ -1056,7 +1056,7 @@ /* resolve conn */ conn = conn_find_by_id(link, conn_id); if (!conn) { - LOGP(DSUA, LOGL_ERROR, "DT1 for unknwon reference %u\n", + LOGP(DSUA, LOGL_ERROR, "DT1 for unknown reference %u\n", conn_id); /* FIXME: send error reply down the sua link? */ return -1; -- To view, visit https://gerrit.osmocom.org/265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00ff99ef14d62d3b353fe69762ae49f374938f94 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:20:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:20:25 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: Let's review the radisys osmo-pcu repository and coordinate with them on what they did to overcome this issue. Maybe they have a proper fix rather than reverting the WAIT_ASSIGN state altogether. -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:20:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:20:38 +0000 Subject: openbsc[master]: Make random extension range configurable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:20:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:20:40 +0000 Subject: [MERGED] openbsc[master]: Make random extension range configurable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make random extension range configurable ...................................................................... Make random extension range configurable Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 11 files changed, 78 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6699a86..6ffe1ad 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -35,13 +35,15 @@ int db_fini(void); /* subscriber management */ -struct gsm_subscriber *db_create_subscriber(const char *imsi); +struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, + uint64_t smax); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); int db_subscriber_expire(void *priv, void (*callback)(void *priv, long long unsigned int id)); int db_subscriber_alloc_tmsi(struct gsm_subscriber *subscriber); -int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber); +int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, + uint64_t smax); int db_subscriber_alloc_token(struct gsm_subscriber *subscriber, uint32_t* token); int db_subscriber_assoc_imei(struct gsm_subscriber *subscriber, char *imei); int db_subscriber_delete(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 31a4ed5..e7cd520 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -290,6 +290,8 @@ /* subscriber related features */ int subscr_creation_mode; + uint64_t ext_min; + uint64_t ext_max; struct gsm_subscriber_group *subscr_group; struct gsm_sms_queue *sms_queue; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 9df989a..3cba5d1 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -90,7 +90,8 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi); + const char *imsi, uint64_t smin, + uint64_t smax); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index afcaaf3..4636d57 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -104,7 +104,8 @@ net->stats.bts.rsl_fail = osmo_counter_alloc("net.bts.rsl_fail"); net->mncc_recv = mncc_recv; - + net->ext_min = GSM_MIN_EXTEN; + net->ext_max = GSM_MAX_EXTEN; gsm_net_update_ctype(net); return net; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index 0d6a37c..a02db36 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -18,6 +18,7 @@ * along with this program. If not, see . * */ + #include #include #include @@ -95,7 +96,9 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi); + subscr = subscr_create_subscriber(net->subscr_group, imsi, + net->ext_min, + net->ext_max); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 9e3fb36..b367139 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -518,7 +518,8 @@ return 0; } -struct gsm_subscriber *db_create_subscriber(const char *imsi) +struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, + uint64_t smax) { dbi_result result; struct gsm_subscriber *subscr; @@ -550,7 +551,7 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr); + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -1249,13 +1250,14 @@ return 0; } -int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber) +int db_subscriber_alloc_exten(struct gsm_subscriber *subscriber, uint64_t smin, + uint64_t smax) { dbi_result result = NULL; uint32_t try; for (;;) { - try = (rand()%(GSM_MAX_EXTEN-GSM_MIN_EXTEN+1)+GSM_MIN_EXTEN); + try = (rand() % (smax - smin + 1) + smin); result = dbi_conn_queryf(conn, "SELECT * FROM Subscriber " "WHERE extension = %i", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 92c4cfe..6704497 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -537,7 +537,8 @@ if (!subscr_regexp_check(net, imsi)) return NULL; - return subscr_create_subscriber(net->subscr_group, imsi); + return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, + net->ext_max); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 57c10cf..1dc2cc2 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -203,9 +203,10 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi) + const char *imsi, uint64_t smin, + uint64_t smax) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 3f67b9a..a035bf9 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -240,7 +242,9 @@ if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], + gsmnet->ext_min, + gsmnet->ext_max); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1031,6 +1035,25 @@ return CMD_SUCCESS; } +/* Note: limit on the parameter length is set by internal vty code limitations */ +DEFUN(cfg_nitb_subscr_random, cfg_nitb_subscr_random_cmd, + "subscriber-create-on-demand random <1-9999999999> <2-9999999999>", + "Set random parameters for a new record when a subscriber is first seen.\n" + "Set random parameters for a new record when a subscriber is first seen.\n" + "Minimum for subscriber extension\n""Maximum for subscriber extension\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + if (mi >= ma) { + vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", + argv[0], argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + gsmnet->ext_min = mi; + gsmnet->ext_max = ma; + return CMD_SUCCESS; +} + DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, "subscriber-create-on-demand [regexp]", "Make a new record when a subscriber is first seen.\n" @@ -1080,6 +1103,10 @@ vty_out(vty, "nitb%s", VTY_NEWLINE); vty_out(vty, " %ssubscriber-create-on-demand%s%s", pref, reg, VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) + vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" + PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, + VTY_NEWLINE); vty_out(vty, " %sassign-tmsi%s", gsmnet->avoid_tmsi ? "no " : "", VTY_NEWLINE); return CMD_SUCCESS; @@ -1134,6 +1161,7 @@ install_element(CONFIG_NODE, &cfg_nitb_cmd); install_node(&nitb_node, config_write_nitb); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd); install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd); diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index ee0cbca..dc81481 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -164,7 +164,7 @@ struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -217,7 +217,7 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); @@ -228,7 +228,7 @@ test_subs("9993245423445", "1234567890", "6543560920"); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index c264328..9ea988d 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -424,11 +424,13 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913769" wrong_imsi = "204300999999999" # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) self.vty.verify('subscriber imsi '+wrong_imsi+' name wrong', ['% No subscriber found for imsi '+wrong_imsi]) res = self.vty.command('subscriber imsi '+imsi+' name '+('X' * 160)) @@ -442,9 +444,28 @@ self.vty.verify('subscriber imsi '+imsi+' extension '+('1' * 14), ['']) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:21:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:21:23 +0000 Subject: libosmocore[master]: Fix retrieving rate_ctr over control interface In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 14 22:21:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 14 Jun 2016 22:21:24 +0000 Subject: [MERGED] libosmocore[master]: Fix retrieving rate_ctr over control interface In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix retrieving rate_ctr over control interface ...................................................................... Fix retrieving rate_ctr over control interface Allow getting either particular counter (e. g. rate_ctr.per_hour.e1inp.0.hdlc.abort) or entire rate counter group for a given index (e. g. rate_ctr.per_hour.e1inp.0). Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Fixes: OS#1730 Reviewed-on: https://gerrit.osmocom.org/274 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/ctrl/control_if.c 1 file changed, 7 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index bde245d..6d9a9fb 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -552,35 +552,29 @@ } ctr_group = strtok_r(NULL, ".", &saveptr); - tmp = strtok_r(NULL, ".", &saveptr); - if (!ctr_group || !tmp) { + ctr_idx = strtok_r(NULL, ".", &saveptr); + if (!ctr_group || !ctr_idx) { talloc_free(dup); - cmd->reply = "Counter group must be of form a.b"; + cmd->reply = "Counter group must be of name.index form e. g. " + "e1inp.0"; goto err; } - ctr_group[strlen(ctr_group)] = '.'; - ctr_idx = strtok_r(NULL, ".", &saveptr); - if (!ctr_idx) { - talloc_free(dup); - return get_rate_ctr_group(ctr_group, intv, cmd); - } idx = atoi(ctr_idx); ctrg = rate_ctr_get_group_by_name_idx(ctr_group, idx); if (!ctrg) { talloc_free(dup); - cmd->reply = "Counter group not found."; + cmd->reply = "Counter group with given name and index not found"; goto err; } - ctr_name = strtok_r(NULL, "\0", &saveptr); - if (!ctr_name) { + if (!strlen(saveptr)) { talloc_free(dup); return get_rate_ctr_group_idx(ctrg, intv, cmd); } - ctr = rate_ctr_get_by_name(ctrg, ctr_name); + ctr = rate_ctr_get_by_name(ctrg, saveptr); if (!ctr) { cmd->reply = "Counter name not found."; talloc_free(dup); -- To view, visit https://gerrit.osmocom.org/274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 07:33:30 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 07:33:30 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: Add the barebox boot state reservation Message-ID: Review at https://gerrit.osmocom.org/275 sysmobts: Add the barebox boot state reservation We are using up to 48 (actually only 8) bytes to manage the boot state of the device. Add it to the eeprom reservation. It turns out the current padding was too large (37 + 84 don't end at 120). Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de --- M src/osmo-bts-sysmo/misc/sysmobts_eeprom.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/275/1 diff --git a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h index e9828a1..ecb86e1 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h +++ b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h @@ -15,7 +15,8 @@ uint16_t model_nr; /* 32-33 */ uint16_t model_flags; /* 34-35 */ uint8_t trx_nr; /* 36 */ - uint8_t _pad1[84]; /* 37-120 */ + uint8_t boot_state[48]; /* 37-84 */ + uint8_t _pad1[35]; /* 85-120 */ uint8_t gpg_key[128]; /* 121-249 */ } __attribute__((packed)); -- To view, visit https://gerrit.osmocom.org/275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:27:53 2016 From: gerrit-no-reply at lists.osmocom.org (laforge) Date: Wed, 15 Jun 2016 09:27:53 +0000 Subject: osmo-bts[master]: sysmobts: Add the barebox boot state reservation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:29:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:29:41 +0000 Subject: osmo-bts[master]: sysmobts: Add the barebox boot state reservation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:29:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:29:44 +0000 Subject: [MERGED] osmo-bts[master]: sysmobts: Add the barebox boot state reservation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmobts: Add the barebox boot state reservation ...................................................................... sysmobts: Add the barebox boot state reservation We are using up to 48 (actually only 8) bytes to manage the boot state of the device. Add it to the eeprom reservation. It turns out the current padding was too large (37 + 84 don't end at 120). Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de --- M src/osmo-bts-sysmo/misc/sysmobts_eeprom.h 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h index e9828a1..ecb86e1 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h +++ b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h @@ -15,7 +15,8 @@ uint16_t model_nr; /* 32-33 */ uint16_t model_flags; /* 34-35 */ uint8_t trx_nr; /* 36 */ - uint8_t _pad1[84]; /* 37-120 */ + uint8_t boot_state[48]; /* 37-84 */ + uint8_t _pad1[35]; /* 85-120 */ uint8_t gpg_key[128]; /* 121-249 */ } __attribute__((packed)); -- To view, visit https://gerrit.osmocom.org/275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:30:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:30:24 +0000 Subject: [MERGED] osmo-bts[master]: sysmo: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmo: add L3 handle to l1prim messages ...................................................................... sysmo: add L3 handle to l1prim messages Place a layer 3 handle into GSM L1 messages to better match up confirmations to respective requests. This handle is a uint32_t transparently returned in the confirmation messages, so a match-up is easy to add. So far, a GSM L1 confirmation message received for a preceding L1 Request was matched only by the prim_id. That meant that only one instance of the same primitive could be waiting for a confirmation at any given time, or the responses would get mixed up: the struct wait_l1_conf instances entered into the fl1h->wlc_list queue would be returned to a possibly mismatching confirmation handler. (Seen during testing of dyn pdch switching.) Send the hLayer3 handle out via prim_init(), using new static functions to produce handles on different scopes: * l1p_handle_for_trx() * l1p_handle_for_ts() * l1p_handle_for_lchan() (These could possibly move to a more general .h/.c file later.) Remember the hLayer3 handle in * struct wait_l1_conf. Match the incoming confirmations' and stored hLayer3 handles up in, and remove a now obsolete comment from: * is_prim_compat() Since the hLayer3 members are at different byte offsets in GsmL1_Prim_t.u.*, use large switch statements to set/get the value: * In prim_init(), extend existing switch statement to set in GsmL1_Prim_t. * Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a more general .h/.c file later). Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b --- M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/oml.c 2 files changed, 128 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 84fad99..14de251 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -67,6 +67,7 @@ struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ unsigned int conf_prim_id; /* primitive we expect in response */ + HANDLE conf_hLayer3; /* layer 3 handle we expect in response */ unsigned int is_sys_prim; /* is this a system (1) or L1 (0) primitive */ l1if_compl_cb *cb; void *cb_data; @@ -90,6 +91,58 @@ get_value_string(femtobts_l1prim_names, wlc->conf_prim_id)); exit(23); } + +static HANDLE l1p_get_hLayer3(GsmL1_Prim_t *prim) +{ + switch (prim->id) { + case GsmL1_PrimId_MphInitReq: + return prim->u.mphInitReq.hLayer3; + case GsmL1_PrimId_MphCloseReq: + return prim->u.mphCloseReq.hLayer3; + case GsmL1_PrimId_MphConnectReq: + return prim->u.mphConnectReq.hLayer3; + case GsmL1_PrimId_MphDisconnectReq: + return prim->u.mphDisconnectReq.hLayer3; + case GsmL1_PrimId_MphActivateReq: + return prim->u.mphActivateReq.hLayer3; + case GsmL1_PrimId_MphDeactivateReq: + return prim->u.mphDeactivateReq.hLayer3; + case GsmL1_PrimId_MphConfigReq: + return prim->u.mphConfigReq.hLayer3; + case GsmL1_PrimId_MphMeasureReq: + return prim->u.mphMeasureReq.hLayer3; + case GsmL1_PrimId_MphInitCnf: + return prim->u.mphInitCnf.hLayer3; + case GsmL1_PrimId_MphCloseCnf: + return prim->u.mphCloseCnf.hLayer3; + case GsmL1_PrimId_MphConnectCnf: + return prim->u.mphConnectCnf.hLayer3; + case GsmL1_PrimId_MphDisconnectCnf: + return prim->u.mphDisconnectCnf.hLayer3; + case GsmL1_PrimId_MphActivateCnf: + return prim->u.mphActivateCnf.hLayer3; + case GsmL1_PrimId_MphDeactivateCnf: + return prim->u.mphDeactivateCnf.hLayer3; + case GsmL1_PrimId_MphConfigCnf: + return prim->u.mphConfigCnf.hLayer3; + case GsmL1_PrimId_MphMeasureCnf: + return prim->u.mphMeasureCnf.hLayer3; + case GsmL1_PrimId_MphTimeInd: + case GsmL1_PrimId_MphSyncInd: + case GsmL1_PrimId_PhEmptyFrameReq: + case GsmL1_PrimId_PhDataReq: + case GsmL1_PrimId_PhConnectInd: + case GsmL1_PrimId_PhReadyToSendInd: + case GsmL1_PrimId_PhDataInd: + case GsmL1_PrimId_PhRaInd: + break; + default: + LOGP(DL1C, LOGL_ERROR, "unknown L1 primitive %u\n", prim->id); + break; + } + return 0; +} + static int _l1if_req_compl(struct femtol1_hdl *fl1h, struct msgb *msg, int is_system_prim, l1if_compl_cb *cb, void *data) @@ -118,6 +171,7 @@ } wlc->is_sys_prim = 0; wlc->conf_prim_id = femtobts_l1prim_req2conf[l1p->id]; + wlc->conf_hLayer3 = l1p_get_hLayer3(l1p); wqueue = &fl1h->write_q[MQ_L1_WRITE]; timeout_secs = 30; } else { @@ -943,12 +997,12 @@ static inline int is_prim_compat(GsmL1_Prim_t *l1p, struct wait_l1_conf *wlc) { - /* the limitation here is that we cannot have multiple callers - * sending the same primitive */ if (wlc->is_sys_prim != 0) return 0; if (l1p->id != wlc->conf_prim_id) return 0; + if (l1p_get_hLayer3(l1p) != wlc->conf_hLayer3) + return 0; return 1; } diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index cd03b22..6951f84 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -92,45 +92,70 @@ static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); -static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct femtol1_hdl *gl1) +static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct femtol1_hdl *gl1, + HANDLE hLayer3) { prim->id = id; - /* for some reason the hLayer1 field is not always at the same position - * in the GsmL1_Prim_t, so we have to have this ugly case statement here... */ + /* for some reason the hLayer1 and hlayer3 fields are not always at the + * same position in the GsmL1_Prim_t, so we have to have this ugly case + * statement here... */ switch (id) { case GsmL1_PrimId_MphInitReq: //prim->u.mphInitReq.hLayer1 = gl1->hLayer1; + prim->u.mphInitReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphCloseReq: prim->u.mphCloseReq.hLayer1 = gl1->hLayer1; + prim->u.mphCloseReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConnectReq: prim->u.mphConnectReq.hLayer1 = gl1->hLayer1; + prim->u.mphConnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDisconnectReq: prim->u.mphDisconnectReq.hLayer1 = gl1->hLayer1; + prim->u.mphDisconnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphActivateReq: prim->u.mphActivateReq.hLayer1 = gl1->hLayer1; + prim->u.mphActivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDeactivateReq: prim->u.mphDeactivateReq.hLayer1 = gl1->hLayer1; + prim->u.mphDeactivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConfigReq: prim->u.mphConfigReq.hLayer1 = gl1->hLayer1; + prim->u.mphConfigReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphMeasureReq: prim->u.mphMeasureReq.hLayer1 = gl1->hLayer1; + prim->u.mphMeasureReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphInitCnf: + prim->u.mphInitCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphCloseCnf: + prim->u.mphCloseCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConnectCnf: + prim->u.mphConnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDisconnectCnf: + prim->u.mphDisconnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphActivateCnf: + prim->u.mphActivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDeactivateCnf: + prim->u.mphDeactivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConfigCnf: + prim->u.mphConfigCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphMeasureCnf: + prim->u.mphMeasureCnf.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphTimeInd: break; @@ -155,6 +180,35 @@ break; } return &prim->u; +} + +static HANDLE l1p_handle_for_trx(struct gsm_bts_trx *trx) +{ + struct gsm_bts *bts = trx->bts; + + osmo_static_assert(sizeof(HANDLE) >= 4, l1p_handle_is_at_least_32bit); + osmo_static_assert(sizeof(trx->nr) == 1, trx_nr_is_8bit); + osmo_static_assert(sizeof(bts->nr) == 1, bts_nr_is_8bit); + + return bts->nr << 24 + | trx->nr << 16; +} + +static HANDLE l1p_handle_for_ts(struct gsm_bts_trx_ts *ts) +{ + osmo_static_assert(sizeof(ts->nr) == 1, ts_nr_is_8bit); + + return l1p_handle_for_trx(ts->trx) + | ts->nr << 8; +} + + +static HANDLE l1p_handle_for_lchan(struct gsm_lchan *lchan) +{ + osmo_static_assert(sizeof(lchan->nr) == 1, lchan_nr_is_8bit); + + return l1p_handle_for_ts(lchan->ts) + | lchan->nr; } GsmL1_Status_t prim_status(GsmL1_Prim_t *prim) @@ -346,7 +400,8 @@ } msg = l1p_msgb_alloc(); - mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h); + mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h, + l1p_handle_for_trx(trx)); dev_par = &mi_req->deviceParam; dev_par->devType = GsmL1_DevType_TxdRxu; dev_par->freqBand = femto_band; @@ -385,7 +440,8 @@ struct msgb *msg; msg = l1p_msgb_alloc(); - prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h); + prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h, + l1p_handle_for_trx(trx)); LOGP(DL1C, LOGL_NOTICE, "Close TRX %u\n", trx->nr); return l1if_gsm_req_compl(fl1h, msg, trx_close_compl_cb, NULL); @@ -430,7 +486,8 @@ struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); GsmL1_MphConnectReq_t *cr; - cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, + l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; cr->logChComb = pchan_to_logChComb[ts->pchan]; @@ -917,7 +974,8 @@ GsmL1_MphActivateReq_t *act_req; GsmL1_LogChParam_t *lch_par; - act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, fl1h); + act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, + fl1h, l1p_handle_for_lchan(lchan)); lch_par = &act_req->logChPrm; act_req->u8Tn = lchan->ts->nr; act_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); @@ -1210,7 +1268,8 @@ /* channel mode, encryption and/or multirate have changed */ /* update multi-rate config */ - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); conf_req->cfgParamId = GsmL1_ConfigParamId_SetLogChParams; conf_req->cfgParams.setLogChParams.sapi = cmd->sapi; conf_req->cfgParams.setLogChParams.u8Tn = lchan->ts->nr; @@ -1263,7 +1322,7 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphConfigReq_t *conf_req; - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, 0); conf_req->cfgParamId = GsmL1_ConfigParamId_SetTxPowerLevel; conf_req->cfgParams.setTxPowerLevel.fTxPowerLevel = tx_power; @@ -1284,7 +1343,8 @@ struct msgb *msg = l1p_msgb_alloc(); struct GsmL1_MphConfigReq_t *cfgr; - cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); cfgr->cfgParamId = GsmL1_ConfigParamId_SetCipheringParams; cfgr->cfgParams.setCipheringParams.u8Tn = lchan->ts->nr; @@ -1431,7 +1491,8 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphDeactivateReq_t *deact_req; - deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, fl1h); + deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, + fl1h, l1p_handle_for_lchan(lchan)); deact_req->u8Tn = lchan->ts->nr; deact_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); deact_req->dir = cmd->dir; -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:37:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:37:25 +0000 Subject: [PATCH] libosmocore[master]: vty: Fix documentation of 'show asciidoc counters' VTY command Message-ID: Review at https://gerrit.osmocom.org/276 vty: Fix documentation of 'show asciidoc counters' VTY command VTY documentations strings follow a certain structure, and we need to follow that to make the interactive help work. Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c --- M src/vty/stats_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/276/1 diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index be5a6aa..59befd2 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -482,7 +482,7 @@ DEFUN(show_stats_asciidoc_table, show_stats_asciidoc_table_cmd, "show asciidoc counters", - "Generate an ascii doc table of all registered counters.\n") + SHOW_STR "Asciidoc generation\n" "Generate table of all registered counters\n") { vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); -- To view, visit https://gerrit.osmocom.org/276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:38:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:38:30 +0000 Subject: libosmocore[master]: vty: Fix documentation of 'show asciidoc counters' VTY command In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:39:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:39:18 +0000 Subject: libosmocore[master]: vty: Fix documentation of 'show asciidoc counters' VTY command In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:39:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:39:20 +0000 Subject: [MERGED] libosmocore[master]: vty: Fix documentation of 'show asciidoc counters' VTY command In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: Fix documentation of 'show asciidoc counters' VTY command ...................................................................... vty: Fix documentation of 'show asciidoc counters' VTY command VTY documentations strings follow a certain structure, and we need to follow that to make the interactive help work. Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Reviewed-on: https://gerrit.osmocom.org/276 Reviewed-by: Harald Welte Tested-by: Harald Welte --- M src/vty/stats_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index be5a6aa..59befd2 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -482,7 +482,7 @@ DEFUN(show_stats_asciidoc_table, show_stats_asciidoc_table_cmd, "show asciidoc counters", - "Generate an ascii doc table of all registered counters.\n") + SHOW_STR "Asciidoc generation\n" "Generate table of all registered counters\n") { vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); -- To view, visit https://gerrit.osmocom.org/276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:40:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:40:45 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:41:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:41:07 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: -Verified -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:44:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:44:47 +0000 Subject: osmo-bts[master]: LC15: Bring back DSP trace argument In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:44:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:44:51 +0000 Subject: [MERGED] osmo-bts[master]: LC15: Bring back DSP trace argument In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: Bring back DSP trace argument ...................................................................... LC15: Bring back DSP trace argument Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/main.c 2 files changed, 13 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 54fd2d3..6d4fc55 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -67,6 +67,8 @@ #include "misc/lc15bts_bid.h" #include "utils.h" +extern unsigned int dsp_trace; + struct wait_l1_conf { struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ @@ -1397,6 +1399,10 @@ return -EIO; } + + struct lc15l1_hdl *fl1h = pinst->u.lc15.hdl; + fl1h->dsp_trace_f = dsp_trace; + l1if_reset(pinst->u.lc15.hdl); phy_link_state_set(plink, PHY_LINK_CONNECTED); diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index ef132f8..2aaacd3 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -60,6 +60,8 @@ #include "oml_router.h" #include "misc/lc15bts_bid.h" +unsigned int dsp_trace = 0x00000000; + int bts_model_init(struct gsm_bts *bts) { struct gsm_bts_trx *trx; @@ -133,8 +135,8 @@ void bts_model_print_help() { printf( " -w --hw-version Print the targeted HW Version\n" - " -M --pcu-direct Force PCU to access message queue for " - "PDCH dchannel directly\n" + " -M --pcu-direct Force PCU to access message queue for PDCH dchannel directly\n" + " -p --dsp-trace Set DSP trace flags\n" ); } @@ -180,6 +182,9 @@ break; switch (c) { + case 'p': + dsp_trace = strtoul(optarg, NULL, 16); + break; case 'M': pcu_direct = 1; break; -- To view, visit https://gerrit.osmocom.org/236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:44:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:44:58 +0000 Subject: [MERGED] osmo-bts[master]: LC15: Hardware changes: - Change system devices path - Remov... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: Hardware changes: - Change system devices path - Remove obsoleted sensors and add new sensors - Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD) ...................................................................... LC15: Hardware changes: - Change system devices path - Remove obsoleted sensors and add new sensors - Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD) Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 --- M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/hw_misc.c M src/osmo-bts-litecell15/l1_transp_hw.c M src/osmo-bts-litecell15/misc/lc15bts_bid.c M src/osmo-bts-litecell15/misc/lc15bts_clock.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.c M src/osmo-bts-litecell15/misc/lc15bts_mgr.h M src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c M src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c M src/osmo-bts-litecell15/misc/lc15bts_misc.c M src/osmo-bts-litecell15/misc/lc15bts_par.c M src/osmo-bts-litecell15/misc/lc15bts_par.h M src/osmo-bts-litecell15/misc/lc15bts_power.c M src/osmo-bts-litecell15/misc/lc15bts_power.h M src/osmo-bts-litecell15/misc/lc15bts_temp.c M src/osmo-bts-litecell15/misc/lc15bts_temp.h 17 files changed, 322 insertions(+), 336 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index da79df6..c6be4f0 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -53,31 +53,31 @@ static const struct calib_file_desc calib_files[] = { { - .fname = "calib_rx1a.conf", + .fname = "calib_rx0a.conf", .rx = 1, .trx = 0, + .rxpath = 0, + }, { + .fname = "calib_rx0b.conf", + .rx = 1, + .trx = 0, + .rxpath = 1, + }, { + .fname = "calib_rx1a.conf", + .rx = 1, + .trx = 1, .rxpath = 0, }, { .fname = "calib_rx1b.conf", .rx = 1, - .trx = 0, - .rxpath = 1, - }, { - .fname = "calib_rx2a.conf", - .rx = 1, - .trx = 1, - .rxpath = 0, - }, { - .fname = "calib_rx2b.conf", - .rx = 1, .trx = 1, .rxpath = 1, }, { - .fname = "calib_tx1.conf", + .fname = "calib_tx0.conf", .rx = 0, .trx = 0, }, { - .fname = "calib_tx2.conf", + .fname = "calib_tx1.conf", .rx = 0, .trx = 1, }, diff --git a/src/osmo-bts-litecell15/hw_misc.c b/src/osmo-bts-litecell15/hw_misc.c index cd53e26..49232b2 100644 --- a/src/osmo-bts-litecell15/hw_misc.c +++ b/src/osmo-bts-litecell15/hw_misc.c @@ -63,7 +63,7 @@ return -EINVAL; } - fd = open("/sys/class/leds/usr0/brightness", O_WRONLY); + fd = open("/var/lc15/leds/led0/brightness", O_WRONLY); if (fd < 0) return -ENODEV; @@ -73,7 +73,7 @@ } close(fd); - fd = open("/sys/class/leds/usr1/brightness", O_WRONLY); + fd = open("/var/lc15/leds/led1/brightness", O_WRONLY); if (fd < 0) return -ENODEV; diff --git a/src/osmo-bts-litecell15/l1_transp_hw.c b/src/osmo-bts-litecell15/l1_transp_hw.c index 7e6cd68..6381864 100644 --- a/src/osmo-bts-litecell15/l1_transp_hw.c +++ b/src/osmo-bts-litecell15/l1_transp_hw.c @@ -249,7 +249,7 @@ struct osmo_wqueue *wq = &hdl->write_q[q]; struct osmo_fd *write_ofd = &hdl->write_q[q].bfd; - snprintf(buf, sizeof(buf)-1, "%s%d", rd_devnames[q], plink->num+1); + snprintf(buf, sizeof(buf)-1, "%s%d", rd_devnames[q], plink->num); buf[sizeof(buf)-1] = '\0'; rc = open(buf, O_RDONLY); @@ -270,7 +270,7 @@ return rc; } - snprintf(buf, sizeof(buf)-1, "%s%d", wr_devnames[q], plink->num+1); + snprintf(buf, sizeof(buf)-1, "%s%d", wr_devnames[q], plink->num); buf[sizeof(buf)-1] = '\0'; rc = open(buf, O_WRONLY); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_bid.c b/src/osmo-bts-litecell15/misc/lc15bts_bid.c index 1fb5851..06a126a 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_bid.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_bid.c @@ -27,8 +27,8 @@ #include "lc15bts_bid.h" -#define BOARD_REV_SYSFS "/sys/devices/0.lc15/revision" -#define BOARD_OPT_SYSFS "/sys/devices/0.lc15/option" +#define BOARD_REV_SYSFS "/var/lc15/platform/revision" +#define BOARD_OPT_SYSFS "/var/lc15/platform/option" static const int option_type_mask[_NUM_OPTION_TYPES] = { [LC15BTS_OPTION_OCXO] = 0x07, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_clock.c b/src/osmo-bts-litecell15/misc/lc15bts_clock.c index 90ecb7a..f4df5d3 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_clock.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_clock.c @@ -27,15 +27,15 @@ #include "lc15bts_clock.h" -#define CLKERR_ERR_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average" -#define CLKERR_ACC_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average_accuracy" -#define CLKERR_INT_SYSFS "/sys/devices/5002000.clkerr/clkerr1_average_interval" -#define CLKERR_FLT_SYSFS "/sys/devices/5002000.clkerr/clkerr1_fault" -#define CLKERR_RFS_SYSFS "/sys/devices/5002000.clkerr/refresh" -#define CLKERR_RST_SYSFS "/sys/devices/5002000.clkerr/reset" +#define CLKERR_ERR_SYSFS "/var/lc15/clkerr/clkerr1_average" +#define CLKERR_ACC_SYSFS "/var/lc15/clkerr/clkerr1_average_accuracy" +#define CLKERR_INT_SYSFS "/var/lc15/clkerr/clkerr1_average_interval" +#define CLKERR_FLT_SYSFS "/var/lc15/clkerr/clkerr1_fault" +#define CLKERR_RFS_SYSFS "/var/lc15/clkerr/refresh" +#define CLKERR_RST_SYSFS "/var/lc15/clkerr/reset" -#define OCXODAC_VAL_SYSFS "/sys/bus/iio/devices/iio:device0/out_voltage0_raw" -#define OCXODAC_ROM_SYSFS "/sys/bus/iio/devices/iio:device0/store_eeprom" +#define OCXODAC_VAL_SYSFS "/var/lc15/ocxo/voltage" +#define OCXODAC_ROM_SYSFS "/var/lc15/ocxo/eeprom" /* clock error */ static int clkerr_fd_err = -1; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index a4c5650..506e525 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -74,7 +74,15 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .memory_limit = { + .logrf_limit = { + .thresh_warn = 60, + .thresh_crit = 78, + }, + .ocxo_limit = { + .thresh_warn = 60, + .thresh_crit = 78, + }, + .tx0_limit = { .thresh_warn = 60, .thresh_crit = 78, }, @@ -82,7 +90,7 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .tx2_limit = { + .pa0_limit = { .thresh_warn = 60, .thresh_crit = 78, }, @@ -90,12 +98,8 @@ .thresh_warn = 60, .thresh_crit = 78, }, - .pa2_limit = { - .thresh_warn = 60, - .thresh_crit = 78, - }, .action_warn = 0, - .action_crit = TEMP_ACT_PA1_OFF | TEMP_ACT_PA2_OFF, + .action_crit = TEMP_ACT_PA0_OFF | TEMP_ACT_PA1_OFF, .state = STATE_NORMAL, } }; @@ -260,12 +264,12 @@ hours_timer_cb(NULL); /* Enable the PAs */ - rc = lc15bts_power_set(LC15BTS_POWER_PA1, 1); + rc = lc15bts_power_set(LC15BTS_POWER_PA0, 1); if (rc < 0) { exit(3); } - rc = lc15bts_power_set(LC15BTS_POWER_PA2, 1); + rc = lc15bts_power_set(LC15BTS_POWER_PA1, 1); if (rc < 0) { exit(3); } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h index 466d0b2..98bd701 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.h @@ -21,8 +21,8 @@ #if 0 TEMP_ACT_PWR_CONTRL = 0x1, #endif - TEMP_ACT_PA1_OFF = 0x2, - TEMP_ACT_PA2_OFF = 0x4, + TEMP_ACT_PA0_OFF = 0x2, + TEMP_ACT_PA1_OFF = 0x4, TEMP_ACT_BTS_SRV_OFF = 0x10, }; @@ -31,8 +31,8 @@ #if 0 TEMP_ACT_NORM_PW_CONTRL = 0x1, #endif - TEMP_ACT_NORM_PA1_ON = 0x2, - TEMP_ACT_NORM_PA2_ON = 0x4, + TEMP_ACT_NORM_PA0_ON = 0x2, + TEMP_ACT_NORM_PA1_ON = 0x4, TEMP_ACT_NORM_BTS_SRV_ON= 0x10, }; @@ -62,11 +62,12 @@ LIMIT_SUPPLY_NODE, LIMIT_SOC_NODE, LIMIT_FPGA_NODE, - LIMIT_MEMORY_NODE, + LIMIT_LOGRF_NODE, + LIMIT_OCXO_NODE, + LIMIT_TX0_NODE, LIMIT_TX1_NODE, - LIMIT_TX2_NODE, + LIMIT_PA0_NODE, LIMIT_PA1_NODE, - LIMIT_PA2_NODE, }; struct lc15bts_mgr_instance { @@ -82,11 +83,12 @@ struct lc15bts_temp_limit supply_limit; struct lc15bts_temp_limit soc_limit; struct lc15bts_temp_limit fpga_limit; - struct lc15bts_temp_limit memory_limit; + struct lc15bts_temp_limit logrf_limit; + struct lc15bts_temp_limit ocxo_limit; + struct lc15bts_temp_limit tx0_limit; struct lc15bts_temp_limit tx1_limit; - struct lc15bts_temp_limit tx2_limit; + struct lc15bts_temp_limit pa0_limit; struct lc15bts_temp_limit pa1_limit; - struct lc15bts_temp_limit pa2_limit; } temp; struct { diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c index d2100eb..903c5fe 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_nl.c @@ -47,7 +47,7 @@ #include #include -#define ETH0_ADDR_SYSFS "/sys/class/net/eth0/address" +#define ETH0_ADDR_SYSFS "/var/lc15/net/eth0/address" static struct osmo_fd nl_fd; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c index 00b8657..042fc87 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_temp.c @@ -85,6 +85,16 @@ static void handle_normal_actions(int actions) { /* switch on the PA */ + if (actions & TEMP_ACT_NORM_PA0_ON) { + if (lc15bts_power_set(LC15BTS_POWER_PA0, 1) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch on the PA #0\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched on the PA #0 as normal action.\n"); + } + } + if (actions & TEMP_ACT_NORM_PA1_ON) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 1) != 0) { LOGP(DTEMP, LOGL_ERROR, @@ -92,16 +102,6 @@ } else { LOGP(DTEMP, LOGL_NOTICE, "Switched on the PA #1 as normal action.\n"); - } - } - - if (actions & TEMP_ACT_NORM_PA2_ON) { - if (lc15bts_power_set(LC15BTS_POWER_PA2, 1) != 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to switch on the PA #2\n"); - } else { - LOGP(DTEMP, LOGL_NOTICE, - "Switched on the PA #2 as normal action.\n"); } } @@ -120,16 +120,6 @@ static void handle_actions(int actions) { /* switch off the PA */ - if (actions & TEMP_ACT_PA2_OFF) { - if (lc15bts_power_set(LC15BTS_POWER_PA2, 0) != 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to switch off the PA #2. Stop BTS?\n"); - } else { - LOGP(DTEMP, LOGL_NOTICE, - "Switched off the PA #2 due temperature.\n"); - } - } - if (actions & TEMP_ACT_PA1_OFF) { if (lc15bts_power_set(LC15BTS_POWER_PA1, 0) != 0) { LOGP(DTEMP, LOGL_ERROR, @@ -137,6 +127,16 @@ } else { LOGP(DTEMP, LOGL_NOTICE, "Switched off the PA #1 due temperature.\n"); + } + } + + if (actions & TEMP_ACT_PA0_OFF) { + if (lc15bts_power_set(LC15BTS_POWER_PA0, 0) != 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to switch off the PA #0. Stop BTS?\n"); + } else { + LOGP(DTEMP, LOGL_NOTICE, + "Switched off the PA #0 due temperature.\n"); } } @@ -215,7 +215,7 @@ LOGP(DTEMP, LOGL_DEBUG, "Going to check the temperature.\n"); /* Read the current supply temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_SUPPLY); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the supply temperature. rc=%d\n", rc); @@ -230,7 +230,7 @@ } /* Read the current SoC temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_SOC, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_SOC); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the SoC temperature. rc=%d\n", rc); @@ -245,7 +245,7 @@ } /* Read the current fpga temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_FPGA); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the fpga temperature. rc=%d\n", rc); @@ -259,23 +259,53 @@ LOGP(DTEMP, LOGL_DEBUG, "FPGA temperature is: %d\n", temp); } - /* Read the current memory temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_MEMORY, LC15BTS_TEMP_INPUT); + /* Read the current RF log detector temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_LOGRF); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the memory temperature. rc=%d\n", rc); + "Failed to read the RF log detector temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { int temp = rc / 1000; - if (temp > s_mgr->temp.memory_limit.thresh_warn) + if (temp > s_mgr->temp.logrf_limit.thresh_warn) warn_thresh_passed = 1; - if (temp > s_mgr->temp.memory_limit.thresh_crit) + if (temp > s_mgr->temp.logrf_limit.thresh_crit) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "Memory temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "RF log detector temperature is: %d\n", temp); + } + + /* Read the current OCXO temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_OCXO); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to read the OCXO temperature. rc=%d\n", rc); + warn_thresh_passed = crit_thresh_passed = 1; + } else { + int temp = rc / 1000; + if (temp > s_mgr->temp.ocxo_limit.thresh_warn) + warn_thresh_passed = 1; + if (temp > s_mgr->temp.ocxo_limit.thresh_crit) + crit_thresh_passed = 1; + LOGP(DTEMP, LOGL_DEBUG, "OCXO temperature is: %d\n", temp); } /* Read the current TX #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX1, LC15BTS_TEMP_INPUT); + rc = lc15bts_temp_get(LC15BTS_TEMP_TX0); + if (rc < 0) { + LOGP(DTEMP, LOGL_ERROR, + "Failed to read the TX #0 temperature. rc=%d\n", rc); + warn_thresh_passed = crit_thresh_passed = 1; + } else { + int temp = rc / 1000; + if (temp > s_mgr->temp.tx0_limit.thresh_warn) + warn_thresh_passed = 1; + if (temp > s_mgr->temp.tx0_limit.thresh_crit) + crit_thresh_passed = 1; + LOGP(DTEMP, LOGL_DEBUG, "TX #0 temperature is: %d\n", temp); + } + + /* Read the current TX #2 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_TX1); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the TX #1 temperature. rc=%d\n", rc); @@ -289,23 +319,23 @@ LOGP(DTEMP, LOGL_DEBUG, "TX #1 temperature is: %d\n", temp); } - /* Read the current TX #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_TX2, LC15BTS_TEMP_INPUT); + /* Read the current PA #1 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA0); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, - "Failed to read the TX #2 temperature. rc=%d\n", rc); + "Failed to read the PA #0 temperature. rc=%d\n", rc); warn_thresh_passed = crit_thresh_passed = 1; } else { int temp = rc / 1000; - if (temp > s_mgr->temp.tx2_limit.thresh_warn) + if (temp > s_mgr->temp.pa0_limit.thresh_warn) warn_thresh_passed = 1; - if (temp > s_mgr->temp.tx2_limit.thresh_crit) + if (temp > s_mgr->temp.pa0_limit.thresh_crit) crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "TX #2 temperature is: %d\n", temp); + LOGP(DTEMP, LOGL_DEBUG, "PA #0 temperature is: %d\n", temp); } - /* Read the current PA #1 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA1, LC15BTS_TEMP_INPUT); + /* Read the current PA #2 temperature */ + rc = lc15bts_temp_get(LC15BTS_TEMP_PA1); if (rc < 0) { LOGP(DTEMP, LOGL_ERROR, "Failed to read the PA #1 temperature. rc=%d\n", rc); @@ -317,21 +347,6 @@ if (temp > s_mgr->temp.pa1_limit.thresh_crit) crit_thresh_passed = 1; LOGP(DTEMP, LOGL_DEBUG, "PA #1 temperature is: %d\n", temp); - } - - /* Read the current PA #2 temperature */ - rc = lc15bts_temp_get(LC15BTS_TEMP_PA2, LC15BTS_TEMP_INPUT); - if (rc < 0) { - LOGP(DTEMP, LOGL_ERROR, - "Failed to read the PA #2 temperature. rc=%d\n", rc); - warn_thresh_passed = crit_thresh_passed = 1; - } else { - int temp = rc / 1000; - if (temp > s_mgr->temp.pa2_limit.thresh_warn) - warn_thresh_passed = 1; - if (temp > s_mgr->temp.pa2_limit.thresh_crit) - crit_thresh_passed = 1; - LOGP(DTEMP, LOGL_DEBUG, "PA #2 temperature is: %d\n", temp); } lc15bts_mgr_temp_handle(s_mgr, crit_thresh_passed, warn_thresh_passed); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c index e5ef55f..280c9c7 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr_vty.c @@ -67,11 +67,12 @@ case LIMIT_SUPPLY_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_MEMORY_NODE: + case LIMIT_LOGRF_NODE: + case LIMIT_OCXO_NODE: + case LIMIT_TX0_NODE: case LIMIT_TX1_NODE: - case LIMIT_TX2_NODE: + case LIMIT_PA0_NODE: case LIMIT_PA1_NODE: - case LIMIT_PA2_NODE: vty->node = MGR_NODE; break; default: @@ -90,11 +91,12 @@ case LIMIT_SUPPLY_NODE: case LIMIT_SOC_NODE: case LIMIT_FPGA_NODE: - case LIMIT_MEMORY_NODE: + case LIMIT_LOGRF_NODE: + case LIMIT_OCXO_NODE: + case LIMIT_TX0_NODE: case LIMIT_TX1_NODE: - case LIMIT_TX2_NODE: + case LIMIT_PA0_NODE: case LIMIT_PA1_NODE: - case LIMIT_PA2_NODE: return 1; default: return 0; @@ -154,30 +156,36 @@ 1, }; -static struct cmd_node limit_memory_node = { - LIMIT_MEMORY_NODE, - "%s(limit-memory)# ", +static struct cmd_node limit_logrf_node = { + LIMIT_LOGRF_NODE, + "%s(limit-logrf)# ", 1, }; +static struct cmd_node limit_ocxo_node = { + LIMIT_OCXO_NODE, + "%s(limit-ocxo)# ", + 1, +}; + +static struct cmd_node limit_tx0_node = { + LIMIT_TX0_NODE, + "%s(limit-tx0)# ", + 1, +}; static struct cmd_node limit_tx1_node = { LIMIT_TX1_NODE, "%s(limit-tx1)# ", 1, }; -static struct cmd_node limit_tx2_node = { - LIMIT_TX2_NODE, - "%s(limit-tx2)# ", +static struct cmd_node limit_pa0_node = { + LIMIT_PA0_NODE, + "%s(limit-pa0)# ", 1, }; static struct cmd_node limit_pa1_node = { LIMIT_PA1_NODE, "%s(limit-pa1)# ", - 1, -}; -static struct cmd_node limit_pa2_node = { - LIMIT_PA2_NODE, - "%s(limit-pa2)# ", 1, }; @@ -202,10 +210,10 @@ static void write_norm_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " %spa0-on%s", + (actions & TEMP_ACT_NORM_PA0_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-on%s", (actions & TEMP_ACT_NORM_PA1_ON) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " %spa2-on%s", - (actions & TEMP_ACT_NORM_PA2_ON) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-on%s", (actions & TEMP_ACT_NORM_BTS_SRV_ON) ? "" : "no ", VTY_NEWLINE); } @@ -213,10 +221,10 @@ static void write_action(struct vty *vty, const char *name, int actions) { vty_out(vty, " %s%s", name, VTY_NEWLINE); + vty_out(vty, " %spa0-off%s", + (actions & TEMP_ACT_PA0_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %spa1-off%s", (actions & TEMP_ACT_PA1_OFF) ? "" : "no ", VTY_NEWLINE); - vty_out(vty, " %spa2-off%s", - (actions & TEMP_ACT_PA2_OFF) ? "" : "no ", VTY_NEWLINE); vty_out(vty, " %sbts-service-off%s", (actions & TEMP_ACT_BTS_SRV_OFF) ? "" : "no ", VTY_NEWLINE); } @@ -228,11 +236,12 @@ write_temp_limit(vty, "limits supply", &s_mgr->temp.supply_limit); write_temp_limit(vty, "limits soc", &s_mgr->temp.soc_limit); write_temp_limit(vty, "limits fpga", &s_mgr->temp.fpga_limit); - write_temp_limit(vty, "limits memory", &s_mgr->temp.memory_limit); + write_temp_limit(vty, "limits logrf", &s_mgr->temp.logrf_limit); + write_temp_limit(vty, "limits ocxo", &s_mgr->temp.ocxo_limit); + write_temp_limit(vty, "limits tx0", &s_mgr->temp.tx0_limit); write_temp_limit(vty, "limits tx1", &s_mgr->temp.tx1_limit); - write_temp_limit(vty, "limits tx2", &s_mgr->temp.tx2_limit); + write_temp_limit(vty, "limits pa0", &s_mgr->temp.pa0_limit); write_temp_limit(vty, "limits pa1", &s_mgr->temp.pa1_limit); - write_temp_limit(vty, "limits pa2", &s_mgr->temp.pa2_limit); write_norm_action(vty, "actions normal", s_mgr->temp.action_norm); write_action(vty, "actions warn", s_mgr->temp.action_warn); @@ -259,11 +268,12 @@ CFG_LIMIT(supply, "SUPPLY\n", LIMIT_SUPPLY_NODE, supply_limit) CFG_LIMIT(soc, "SOC\n", LIMIT_SOC_NODE, soc_limit) CFG_LIMIT(fpga, "FPGA\n", LIMIT_FPGA_NODE, fpga_limit) -CFG_LIMIT(memory, "MEMORY\n", LIMIT_MEMORY_NODE, memory_limit) +CFG_LIMIT(logrf, "LOGRF\n", LIMIT_LOGRF_NODE, logrf_limit) +CFG_LIMIT(ocxo, "OCXO\n", LIMIT_OCXO_NODE, ocxo_limit) +CFG_LIMIT(tx0, "TX0\n", LIMIT_TX0_NODE, tx0_limit) CFG_LIMIT(tx1, "TX1\n", LIMIT_TX1_NODE, tx1_limit) -CFG_LIMIT(tx2, "TX2\n", LIMIT_TX2_NODE, tx2_limit) +CFG_LIMIT(pa0, "PA0\n", LIMIT_PA0_NODE, pa0_limit) CFG_LIMIT(pa1, "PA1\n", LIMIT_PA1_NODE, pa1_limit) -CFG_LIMIT(pa2, "PA2\n", LIMIT_PA2_NODE, pa2_limit) #undef CFG_LIMIT DEFUN(cfg_limit_warning, cfg_thresh_warning_cmd, @@ -298,6 +308,24 @@ CFG_ACTION(critical, "Critical Actions\n", ACT_CRIT_NODE, action_crit) #undef CFG_ACTION +DEFUN(cfg_action_pa0_on, cfg_action_pa0_on_cmd, + "pa0-on", + "Switch the Power Amplifier #0 on\n") +{ + int *action = vty->index; + *action |= TEMP_ACT_NORM_PA0_ON; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_action_pa0_on, cfg_no_action_pa0_on_cmd, + "no pa0-on", + NO_STR "Switch the Power Amplifieri #0 on\n") +{ + int *action = vty->index; + *action &= ~TEMP_ACT_NORM_PA0_ON; + return CMD_SUCCESS; +} + DEFUN(cfg_action_pa1_on, cfg_action_pa1_on_cmd, "pa1-on", "Switch the Power Amplifier #1 on\n") @@ -313,24 +341,6 @@ { int *action = vty->index; *action &= ~TEMP_ACT_NORM_PA1_ON; - return CMD_SUCCESS; -} - -DEFUN(cfg_action_pa2_on, cfg_action_pa2_on_cmd, - "pa2-on", - "Switch the Power Amplifier #2 on\n") -{ - int *action = vty->index; - *action |= TEMP_ACT_NORM_PA2_ON; - return CMD_SUCCESS; -} - -DEFUN(cfg_no_action_pa2_on, cfg_no_action_pa2_on_cmd, - "no pa2-on", - NO_STR "Switch the Power Amplifieri #2 on\n") -{ - int *action = vty->index; - *action &= ~TEMP_ACT_NORM_PA2_ON; return CMD_SUCCESS; } @@ -352,39 +362,39 @@ return CMD_SUCCESS; } +DEFUN(cfg_action_pa0_off, cfg_action_pa0_off_cmd, + "pa0-off", + "Switch the Power Amplifier #0 off\n") +{ + int *action = vty->index; + *action |= TEMP_ACT_PA0_OFF; + return CMD_SUCCESS; +} + +DEFUN(cfg_no_action_pa0_off, cfg_no_action_pa0_off_cmd, + "no pa0-off", + NO_STR "Do not switch off the Power Amplifier #0\n") +{ + int *action = vty->index; + *action &= ~TEMP_ACT_PA0_OFF; + return CMD_SUCCESS; +} + DEFUN(cfg_action_pa1_off, cfg_action_pa1_off_cmd, - "pa1-off", - "Switch the Power Amplifier #1 off\n") -{ - int *action = vty->index; - *action |= TEMP_ACT_PA1_OFF; - return CMD_SUCCESS; -} - -DEFUN(cfg_no_action_pa1_off, cfg_no_action_pa1_off_cmd, - "no pa1-off", - NO_STR "Do not switch off the Power Amplifier #1\n") -{ - int *action = vty->index; - *action &= ~TEMP_ACT_PA1_OFF; - return CMD_SUCCESS; -} - -DEFUN(cfg_action_pa2_off, cfg_action_pa2_off_cmd, - "pa2-off", - "Switch the Power Amplifier #2 off\n") + "pa1-off", + "Switch the Power Amplifier #1 off\n") { int *action = vty->index; - *action |= TEMP_ACT_PA2_OFF; + *action |= TEMP_ACT_PA1_OFF; return CMD_SUCCESS; } -DEFUN(cfg_no_action_pa2_off, cfg_no_action_pa2_off_cmd, - "no pa2-off", - NO_STR "Do not switch off the Power Amplifier #2\n") +DEFUN(cfg_no_action_pa1_off, cfg_no_action_pa1_off_cmd, + "no pa1-off", + NO_STR "Do not switch off the Power Amplifier #1\n") { int *action = vty->index; - *action &= ~TEMP_ACT_PA2_OFF; + *action &= ~TEMP_ACT_PA1_OFF; return CMD_SUCCESS; } @@ -413,45 +423,49 @@ lc15bts_mgr_temp_get_state(s_mgr->temp.state), VTY_NEWLINE); vty_out(vty, "Current Temperatures%s", VTY_NEWLINE); vty_out(vty, " Main Supply : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SUPPLY, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SUPPLY) / 1000.0f, VTY_NEWLINE); vty_out(vty, " SoC : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_SOC, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_SOC) / 1000.0f, VTY_NEWLINE); vty_out(vty, " FPGA : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_FPGA) / 1000.0f, VTY_NEWLINE); - vty_out(vty, " Memory (DDR): %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_MEMORY, - LC15BTS_TEMP_INPUT) / 1000.0f, + vty_out(vty, " LogRF : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_LOGRF) / 1000.0f, + VTY_NEWLINE); + vty_out(vty, " OCXO : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_OCXO) / 1000.0f, + VTY_NEWLINE); + vty_out(vty, " TX 0 : %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_TX0) / 1000.0f, VTY_NEWLINE); vty_out(vty, " TX 1 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX1, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_TX1) / 1000.0f, VTY_NEWLINE); - vty_out(vty, " TX 2 : %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_TX2, - LC15BTS_TEMP_INPUT) / 1000.0f, + vty_out(vty, " Power Amp #0: %f Celcius%s", + lc15bts_temp_get(LC15BTS_TEMP_PA0) / 1000.0f, VTY_NEWLINE); vty_out(vty, " Power Amp #1: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA1, - LC15BTS_TEMP_INPUT) / 1000.0f, - VTY_NEWLINE); - vty_out(vty, " Power Amp #2: %f Celcius%s", - lc15bts_temp_get(LC15BTS_TEMP_PA2, - LC15BTS_TEMP_INPUT) / 1000.0f, + lc15bts_temp_get(LC15BTS_TEMP_PA1) / 1000.0f, VTY_NEWLINE); vty_out(vty, "Power Status%s", VTY_NEWLINE); - vty_out(vty, " Main Supply : (ON) [%6.2f Vdc, %4.2f A, %6.2f W]%s", + vty_out(vty, " Main Supply : ON [%6.2f Vdc, %4.2f A, %6.2f W]%s", lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, LC15BTS_POWER_VOLTAGE)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, LC15BTS_POWER_CURRENT)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_POWER)/1000000.0f, + VTY_NEWLINE); + vty_out(vty, " Power Amp #0: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", + lc15bts_power_get(LC15BTS_POWER_PA0) ? "ON " : "OFF", + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_VOLTAGE)/1000.0f, + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, + LC15BTS_POWER_CURRENT)/1000.0f, + lc15bts_power_sensor_get(LC15BTS_POWER_PA0, LC15BTS_POWER_POWER)/1000000.0f, VTY_NEWLINE); vty_out(vty, " Power Amp #1: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", @@ -461,15 +475,6 @@ lc15bts_power_sensor_get(LC15BTS_POWER_PA1, LC15BTS_POWER_CURRENT)/1000.0f, lc15bts_power_sensor_get(LC15BTS_POWER_PA1, - LC15BTS_POWER_POWER)/1000000.0f, - VTY_NEWLINE); - vty_out(vty, " Power Amp #2: %s [%6.2f Vdc, %4.2f A, %6.2f W]%s", - lc15bts_power_get(LC15BTS_POWER_PA2) ? "ON " : "OFF", - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, - LC15BTS_POWER_VOLTAGE)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, - LC15BTS_POWER_CURRENT)/1000.0f, - lc15bts_power_sensor_get(LC15BTS_POWER_PA2, LC15BTS_POWER_POWER)/1000000.0f, VTY_NEWLINE); @@ -496,20 +501,20 @@ static void register_normal_action(int act) { + install_element(act, &cfg_action_pa0_on_cmd); + install_element(act, &cfg_no_action_pa0_on_cmd); install_element(act, &cfg_action_pa1_on_cmd); install_element(act, &cfg_no_action_pa1_on_cmd); - install_element(act, &cfg_action_pa2_on_cmd); - install_element(act, &cfg_no_action_pa2_on_cmd); install_element(act, &cfg_action_bts_srv_on_cmd); install_element(act, &cfg_no_action_bts_srv_on_cmd); } static void register_action(int act) { + install_element(act, &cfg_action_pa0_off_cmd); + install_element(act, &cfg_no_action_pa0_off_cmd); install_element(act, &cfg_action_pa1_off_cmd); install_element(act, &cfg_no_action_pa1_off_cmd); - install_element(act, &cfg_action_pa2_off_cmd); - install_element(act, &cfg_no_action_pa2_off_cmd); install_element(act, &cfg_action_bts_srv_off_cmd); install_element(act, &cfg_no_action_bts_srv_off_cmd); } @@ -542,30 +547,35 @@ register_limit(LIMIT_FPGA_NODE); vty_install_default(LIMIT_FPGA_NODE); - install_node(&limit_memory_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_memory_cmd); - register_limit(LIMIT_MEMORY_NODE); - vty_install_default(LIMIT_MEMORY_NODE); + install_node(&limit_logrf_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_logrf_cmd); + register_limit(LIMIT_LOGRF_NODE); + vty_install_default(LIMIT_LOGRF_NODE); + + install_node(&limit_ocxo_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_ocxo_cmd); + register_limit(LIMIT_OCXO_NODE); + vty_install_default(LIMIT_OCXO_NODE); + + install_node(&limit_tx0_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_tx0_cmd); + register_limit(LIMIT_TX0_NODE); + vty_install_default(LIMIT_TX0_NODE); install_node(&limit_tx1_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_tx1_cmd); register_limit(LIMIT_TX1_NODE); vty_install_default(LIMIT_TX1_NODE); - install_node(&limit_tx2_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_tx2_cmd); - register_limit(LIMIT_TX2_NODE); - vty_install_default(LIMIT_TX2_NODE); + install_node(&limit_pa0_node, config_write_dummy); + install_element(MGR_NODE, &cfg_limit_pa0_cmd); + register_limit(LIMIT_PA0_NODE); + vty_install_default(LIMIT_PA0_NODE); install_node(&limit_pa1_node, config_write_dummy); install_element(MGR_NODE, &cfg_limit_pa1_cmd); register_limit(LIMIT_PA1_NODE); vty_install_default(LIMIT_PA1_NODE); - - install_node(&limit_pa2_node, config_write_dummy); - install_element(MGR_NODE, &cfg_limit_pa2_cmd); - register_limit(LIMIT_PA2_NODE); - vty_install_default(LIMIT_PA2_NODE); /* install the normal node */ install_node(&act_norm_node, config_write_dummy); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_misc.c b/src/osmo-bts-litecell15/misc/lc15bts_misc.c index e0602c8..5ff8e31 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_misc.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_misc.c @@ -74,37 +74,41 @@ .ee_par = LC15BTS_PAR_TEMP_FPGA_MAX, }, { - .name = "memory", + .name = "logrf", .has_max = 1, - .sensor = LC15BTS_TEMP_MEMORY, - .ee_par = LC15BTS_PAR_TEMP_MEMORY_MAX, + .sensor = LC15BTS_TEMP_LOGRF, + .ee_par = LC15BTS_PAR_TEMP_LOGRF_MAX, + }, { + .name = "ocxo", + .has_max = 1, + .sensor = LC15BTS_TEMP_OCXO, + .ee_par = LC15BTS_PAR_TEMP_OCXO_MAX, + }, { + .name = "tx0", + .has_max = 0, + .sensor = LC15BTS_TEMP_TX0, + .ee_par = LC15BTS_PAR_TEMP_TX0_MAX, }, { .name = "tx1", .has_max = 0, .sensor = LC15BTS_TEMP_TX1, .ee_par = LC15BTS_PAR_TEMP_TX1_MAX, }, { - .name = "tx2", - .has_max = 0, - .sensor = LC15BTS_TEMP_TX2, - .ee_par = LC15BTS_PAR_TEMP_TX2_MAX, + .name = "pa0", + .has_max = 1, + .sensor = LC15BTS_TEMP_PA0, + .ee_par = LC15BTS_PAR_TEMP_PA0_MAX, }, { .name = "pa1", .has_max = 1, .sensor = LC15BTS_TEMP_PA1, .ee_par = LC15BTS_PAR_TEMP_PA1_MAX, - }, { - .name = "pa2", - .has_max = 1, - .sensor = LC15BTS_TEMP_PA2, - .ee_par = LC15BTS_PAR_TEMP_PA2_MAX, } }; void lc15bts_check_temp(int no_rom_write) { int temp_old[ARRAY_SIZE(temp_data)]; - int temp_hi[ARRAY_SIZE(temp_data)]; int temp_cur[ARRAY_SIZE(temp_data)]; int i, rc; @@ -112,40 +116,24 @@ int ret; rc = lc15bts_par_get_int(temp_data[i].ee_par, &ret); temp_old[i] = ret * 1000; - if (temp_data[i].has_max) { - temp_hi[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_HIGHEST); - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_INPUT); - if ((temp_cur[i] < 0 && temp_cur[i] > -1000) || - (temp_hi[i] < 0 && temp_hi[i] > -1000)) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n"); - continue; - } + temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor); + if (temp_cur[i] < 0 && temp_cur[i] > -1000) { + LOGP(DTEMP, LOGL_ERROR, "Error reading temperature (%d)\n", temp_data[i].sensor); + continue; } - else { - temp_cur[i] = lc15bts_temp_get(temp_data[i].sensor, - LC15BTS_TEMP_INPUT); - - if (temp_cur[i] < 0 && temp_cur[i] > -1000) { - LOGP(DTEMP, LOGL_ERROR, "Error reading temperature\n"); - continue; - } - temp_hi[i] = temp_cur[i]; - } - + LOGP(DTEMP, LOGL_DEBUG, "Current %s temperature: %d.%d C\n", temp_data[i].name, temp_cur[i]/1000, temp_cur[i]%1000); - if (temp_hi[i] > temp_old[i]) { + if (temp_cur[i] > temp_old[i]) { LOGP(DTEMP, LOGL_NOTICE, "New maximum %s " "temperature: %d.%d C\n", temp_data[i].name, - temp_hi[i]/1000, temp_hi[i]%1000); + temp_cur[i]/1000, temp_old[i]%1000); if (!no_rom_write) { rc = lc15bts_par_set_int(temp_data[i].ee_par, - temp_hi[i]/1000); + temp_cur[i]/1000); if (rc < 0) LOGP(DTEMP, LOGL_ERROR, "error writing new %s " "max temp %d (%s)\n", temp_data[i].name, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.c b/src/osmo-bts-litecell15/misc/lc15bts_par.c index 7154426..3d80e67 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.c @@ -46,11 +46,12 @@ { LC15BTS_PAR_TEMP_SUPPLY_MAX, "temp-supply-max" }, { LC15BTS_PAR_TEMP_SOC_MAX, "temp-soc-max" }, { LC15BTS_PAR_TEMP_FPGA_MAX, "temp-fpga-max" }, - { LC15BTS_PAR_TEMP_MEMORY_MAX, "temp-memory-max" }, + { LC15BTS_PAR_TEMP_LOGRF_MAX, "temp-logrf-max" }, + { LC15BTS_PAR_TEMP_OCXO_MAX, "temp-ocxo-max" }, + { LC15BTS_PAR_TEMP_TX0_MAX, "temp-tx0-max" }, { LC15BTS_PAR_TEMP_TX1_MAX, "temp-tx1-max" }, - { LC15BTS_PAR_TEMP_TX2_MAX, "temp-tx2-max" }, + { LC15BTS_PAR_TEMP_PA0_MAX, "temp-pa0-max" }, { LC15BTS_PAR_TEMP_PA1_MAX, "temp-pa1-max" }, - { LC15BTS_PAR_TEMP_PA2_MAX, "temp-pa2-max" }, { LC15BTS_PAR_SERNR, "serial-nr" }, { LC15BTS_PAR_HOURS, "hours-running" }, { LC15BTS_PAR_BOOTS, "boot-count" }, @@ -64,11 +65,12 @@ case LC15BTS_PAR_TEMP_SUPPLY_MAX: case LC15BTS_PAR_TEMP_SOC_MAX: case LC15BTS_PAR_TEMP_FPGA_MAX: - case LC15BTS_PAR_TEMP_MEMORY_MAX: + case LC15BTS_PAR_TEMP_LOGRF_MAX: + case LC15BTS_PAR_TEMP_OCXO_MAX: + case LC15BTS_PAR_TEMP_TX0_MAX: case LC15BTS_PAR_TEMP_TX1_MAX: - case LC15BTS_PAR_TEMP_TX2_MAX: + case LC15BTS_PAR_TEMP_PA0_MAX: case LC15BTS_PAR_TEMP_PA1_MAX: - case LC15BTS_PAR_TEMP_PA2_MAX: case LC15BTS_PAR_SERNR: case LC15BTS_PAR_HOURS: case LC15BTS_PAR_BOOTS: diff --git a/src/osmo-bts-litecell15/misc/lc15bts_par.h b/src/osmo-bts-litecell15/misc/lc15bts_par.h index 7c18271..c50a69f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_par.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_par.h @@ -7,11 +7,12 @@ LC15BTS_PAR_TEMP_SUPPLY_MAX, LC15BTS_PAR_TEMP_SOC_MAX, LC15BTS_PAR_TEMP_FPGA_MAX, - LC15BTS_PAR_TEMP_MEMORY_MAX, + LC15BTS_PAR_TEMP_LOGRF_MAX, + LC15BTS_PAR_TEMP_OCXO_MAX, + LC15BTS_PAR_TEMP_TX0_MAX, LC15BTS_PAR_TEMP_TX1_MAX, - LC15BTS_PAR_TEMP_TX2_MAX, + LC15BTS_PAR_TEMP_PA0_MAX, LC15BTS_PAR_TEMP_PA1_MAX, - LC15BTS_PAR_TEMP_PA2_MAX, LC15BTS_PAR_SERNR, LC15BTS_PAR_HOURS, LC15BTS_PAR_BOOTS, diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.c b/src/osmo-bts-litecell15/misc/lc15bts_power.c index a2997ee..5b01d36 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.c @@ -30,24 +30,24 @@ #define LC15BTS_PA_VOLTAGE 24000000 -#define PA_SUPPLY_MIN_SYSFS "/sys/devices/0.pa-supply/min_microvolts" -#define PA_SUPPLY_MAX_SYSFS "/sys/devices/0.pa-supply/max_microvolts" +#define PA_SUPPLY_MIN_SYSFS "/var/lc15/pa-supply/min_microvolts" +#define PA_SUPPLY_MAX_SYSFS "/var/lc15/pa-supply/max_microvolts" static const char *power_enable_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_PA1] = "/sys/devices/0.pa1/state", - [LC15BTS_POWER_PA2] = "/sys/devices/0.pa2/state", + [LC15BTS_POWER_PA0] = "/var/lc15/pa-state/pa0/state", + [LC15BTS_POWER_PA1] = "/var/lc15/pa-state/pa1/state", }; static const char *power_sensor_devs[_NUM_POWER_SOURCES] = { - [LC15BTS_POWER_SUPPLY] = "/sys/bus/i2c/devices/2-0040/hwmon/hwmon6/", - [LC15BTS_POWER_PA1] = "/sys/bus/i2c/devices/2-0044/hwmon/hwmon7/", - [LC15BTS_POWER_PA2] = "/sys/bus/i2c/devices/2-0045/hwmon/hwmon8/", + [LC15BTS_POWER_SUPPLY] = "/var/lc15/pwr-sense/pa-supply/", + [LC15BTS_POWER_PA0] = "/var/lc15/pwr-sense/pa0/", + [LC15BTS_POWER_PA1] = "/var/lc15/pwr-sense/pa1/", }; static const char *power_sensor_type_str[_NUM_POWER_TYPES] = { - [LC15BTS_POWER_POWER] = "power1_input", - [LC15BTS_POWER_VOLTAGE] = "in1_input", - [LC15BTS_POWER_CURRENT] = "curr1_input", + [LC15BTS_POWER_POWER] = "power", + [LC15BTS_POWER_VOLTAGE] = "voltage", + [LC15BTS_POWER_CURRENT] = "current", }; int lc15bts_power_sensor_get( @@ -94,8 +94,8 @@ int fd; int rc; - if ((source != LC15BTS_POWER_PA1) - && (source != LC15BTS_POWER_PA2) ) { + if ((source != LC15BTS_POWER_PA0) + && (source != LC15BTS_POWER_PA1) ) { return -EINVAL; } @@ -144,6 +144,7 @@ { int fd; int rc; + int retVal = 0; char enstr[10]; fd = open(power_enable_devs[source], O_RDONLY); @@ -152,7 +153,7 @@ } rc = read(fd, enstr, sizeof(enstr)); - enstr[sizeof(enstr)-1] = '\0'; + enstr[rc-1] = '\0'; close(fd); @@ -163,5 +164,10 @@ return -EIO; } - return atoi(enstr); + rc = strcmp(enstr, "enabled"); + if(rc == 0) { + retVal = 1; + } + + return retVal; } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_power.h b/src/osmo-bts-litecell15/misc/lc15bts_power.h index 4bb2748..8963b76 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_power.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_power.h @@ -3,8 +3,8 @@ enum lc15bts_power_source { LC15BTS_POWER_SUPPLY, + LC15BTS_POWER_PA0, LC15BTS_POWER_PA1, - LC15BTS_POWER_PA2, _NUM_POWER_SOURCES }; diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.c b/src/osmo-bts-litecell15/misc/lc15bts_temp.c index fa6300e..aa35854 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.c @@ -31,43 +31,27 @@ static const char *temp_devs[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_SUPPLY] = "/sys/bus/i2c/devices/2-004d/hwmon/hwmon5/temp1_", - [LC15BTS_TEMP_SOC] = "/sys/class/hwmon/hwmon1/temp1_", - [LC15BTS_TEMP_FPGA] = "/sys/devices/0.iio_hwmon/temp1_", - [LC15BTS_TEMP_MEMORY] = "/sys/bus/i2c/devices/2-004c/hwmon/hwmon4/temp1_", - [LC15BTS_TEMP_TX1] = "/sys/devices/0.ncp15xh103_tx1/temp1_", - [LC15BTS_TEMP_TX2] = "/sys/devices/0.ncp15xh103_tx2/temp1_", - [LC15BTS_TEMP_PA1] = "/sys/bus/i2c/devices/2-004d/hwmon/hwmon5/temp2_", - [LC15BTS_TEMP_PA2] = "/sys/bus/i2c/devices/2-004c/hwmon/hwmon4/temp2_", + [LC15BTS_TEMP_SUPPLY] = "/var/lc15/temp/pa-supply/temp", + [LC15BTS_TEMP_SOC] = "/var/lc15/temp/cpu/temp", + [LC15BTS_TEMP_FPGA] = "/var/lc15/temp/fpga/temp", + [LC15BTS_TEMP_LOGRF] = "/var/lc15/temp/logrf/temp", + [LC15BTS_TEMP_OCXO] = "/var/lc15/temp/ocxo/temp", + [LC15BTS_TEMP_TX0] = "/var/lc15/temp/tx0/temp", + [LC15BTS_TEMP_TX1] = "/var/lc15/temp/tx1/temp", + [LC15BTS_TEMP_PA0] = "/var/lc15/temp/pa0/temp", + [LC15BTS_TEMP_PA1] = "/var/lc15/temp/pa1/temp", }; -static const int temp_has_fault[_NUM_TEMP_SENSORS] = { - [LC15BTS_TEMP_PA1] = 1, - [LC15BTS_TEMP_PA2] = 1, -}; - -static const char *temp_type_str[_NUM_TEMP_TYPES] = { - [LC15BTS_TEMP_INPUT] = "input", - [LC15BTS_TEMP_LOWEST] = "lowest", - [LC15BTS_TEMP_HIGHEST] = "highest", - [LC15BTS_TEMP_FAULT] = "fault", -}; - -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, - enum lc15bts_temp_type type) +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor) { char buf[PATH_MAX]; char tempstr[8]; - char faultstr[8]; int fd, rc; if (sensor < 0 || sensor >= _NUM_TEMP_SENSORS) return -EINVAL; - if (type >= ARRAY_SIZE(temp_type_str)) - return -EINVAL; - - snprintf(buf, sizeof(buf)-1, "%s%s", temp_devs[sensor], temp_type_str[type]); + snprintf(buf, sizeof(buf)-1, "%s", temp_devs[sensor]); buf[sizeof(buf)-1] = '\0'; fd = open(buf, O_RDONLY); @@ -85,32 +69,6 @@ return -EIO; } close(fd); - - // Check fault - if (type == LC15BTS_TEMP_FAULT || !temp_has_fault[sensor]) - return atoi(tempstr); - - snprintf(buf, sizeof(buf)-1, "%s%s", temp_devs[sensor], temp_type_str[LC15BTS_TEMP_FAULT]); - buf[sizeof(buf)-1] = '\0'; - - fd = open(buf, O_RDONLY); - if (fd < 0) - return fd; - - rc = read(fd, faultstr, sizeof(faultstr)); - tempstr[sizeof(faultstr)-1] = '\0'; - if (rc < 0) { - close(fd); - return rc; - } - if (rc == 0) { - close(fd); - return -EIO; - } - close(fd); - - if (atoi(faultstr)) - return -EIO; return atoi(tempstr); } diff --git a/src/osmo-bts-litecell15/misc/lc15bts_temp.h b/src/osmo-bts-litecell15/misc/lc15bts_temp.h index 4b70cb8..aca8fe2 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_temp.h +++ b/src/osmo-bts-litecell15/misc/lc15bts_temp.h @@ -5,11 +5,12 @@ LC15BTS_TEMP_SUPPLY, LC15BTS_TEMP_SOC, LC15BTS_TEMP_FPGA, - LC15BTS_TEMP_MEMORY, + LC15BTS_TEMP_LOGRF, + LC15BTS_TEMP_OCXO, + LC15BTS_TEMP_TX0, LC15BTS_TEMP_TX1, - LC15BTS_TEMP_TX2, + LC15BTS_TEMP_PA0, LC15BTS_TEMP_PA1, - LC15BTS_TEMP_PA2, _NUM_TEMP_SENSORS }; @@ -21,7 +22,6 @@ _NUM_TEMP_TYPES }; -int lc15bts_temp_get(enum lc15bts_temp_sensor sensor, - enum lc15bts_temp_type type); +int lc15bts_temp_get(enum lc15bts_temp_sensor sensor); #endif -- To view, visit https://gerrit.osmocom.org/237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:45:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 09:45:02 +0000 Subject: [MERGED] osmo-bts[master]: LC15: TRX nominal TX power can be used from EEPROM or from B... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration ...................................................................... LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e --- M include/osmo-bts/phy_link.h M src/osmo-bts-litecell15/calib_file.c M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/main.c 4 files changed, 226 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index edc6cc0..b3db4ce 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -103,7 +103,8 @@ /* configuration */ uint32_t dsp_trace_f; char *calib_path; - + int minTxPower; + int maxTxPower; struct lc15l1_hdl *hdl; } lc15; } u; diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index c6be4f0..3bc788c 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -42,7 +42,11 @@ #include "lc15bts.h" #include "utils.h" - +/** + * * Maximum calibration data chunk size + * */ +#define MAX_CALIB_TBL_SIZE 65536 +#define CALIB_HDR_V1 0x01 struct calib_file_desc { const char *fname; @@ -83,9 +87,37 @@ }, }; +static struct calTbl_t +{ + union + { + struct + { + uint8_t u8Version; // Header version (1) + uint8_t u8Parity; // Parity byte (xor) + uint8_t u8Type; // Table type (0:TX Downlink, 1:RX-A Uplink, 2:RX-B Uplink) + uint8_t u8Band; // GSM Band (0:GSM-850, 1:EGSM-900, 2:DCS-1800, 3:PCS-1900) + uint32_t u32Len; // Table length in bytes including the header + struct + { + uint32_t u32DescOfst; // Description section offset + uint32_t u32DateOfst; // Date section offset + uint32_t u32StationOfst; // Calibration test station section offset + uint32_t u32FpgaFwVerOfst; // Calibration FPGA firmware version section offset + uint32_t u32DspFwVerOfst; // Calibration DSP firmware section offset + uint32_t u32DataOfst; // Calibration data section offset + } toc; + } v1; + } hdr; + + uint8_t u8RawData[MAX_CALIB_TBL_SIZE - 32]; +}; + static int calib_file_send(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc); +static int calib_verify(struct lc15l1_hdl *fl1h, + const struct calib_file_desc *desc); /* determine next calibration file index based on supported bands */ static int get_next_calib_file_idx(struct lc15l1_hdl *fl1h, int last_idx) @@ -203,6 +235,20 @@ return 0; } + rc = calib_verify(fl1h, desc); + if ( rc < 0 ) { + LOGP(DL1C, LOGL_ERROR, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc); + st->last_file_idx = get_next_calib_file_idx(fl1h, st->last_file_idx); + + if (st->last_file_idx >= 0) + return calib_file_send(fl1h, + &calib_files[st->last_file_idx]); + return 0; + + } + + LOGP(DL1C, LOGL_INFO, "Verify L1 calibration table %s -> done\n", desc->fname); + return calib_file_send_next_chunk(fl1h); } @@ -258,3 +304,155 @@ return calib_file_send(fl1h, &calib_files[st->last_file_idx]); } + +static int calib_verify(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc) +{ + int i, rc, sz; + struct calib_send_state *st = &fl1h->st; + struct phy_link *plink = fl1h->phy_inst->phy_link; + char *rbuf; + struct calTbl_t *calTbl; + char calChkSum ; + + + //calculate file size in bytes + fseek(st->fp, 0L, SEEK_END); + sz = ftell(st->fp); + + //rewind read poiner + fseek(st->fp, 0L, SEEK_SET); + + //read file + rbuf = (char *) malloc( sizeof(char) * sz ); + + rc = fread(rbuf, 1, sizeof(char) * sz, st->fp); + if ( rc != sz) { + + LOGP(DL1C, LOGL_ERROR, "%s reading error\n", desc->fname); + free(rbuf); + + //close file + rc = calib_file_close(fl1h); + if (rc < 0 ) { + LOGP(DL1C, LOGL_ERROR, "%s can not close\n", desc->fname); + return rc; + } + + return -2; + } + + + calTbl = (struct calTbl_t*) rbuf; + //calcualte file checksum + calChkSum = 0; + while ( sz-- ) { + calChkSum ^= rbuf[sz]; + } + + //validate Tx calibration parity + if ( calChkSum ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid checksum %x.\n", desc->fname, calChkSum); + return -4; + } + + //validate Tx calibration header + if ( calTbl->hdr.v1.u8Version != CALIB_HDR_V1 ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid header version %u.\n", desc->fname, calTbl->hdr.v1.u8Version); + return -5; + } + + //validate calibration description + if ( calTbl->hdr.v1.toc.u32DescOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration description offset.\n", desc->fname); + return -6; + } + + //validate calibration date + if ( calTbl->hdr.v1.toc.u32DateOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration date offset.\n", desc->fname); + return -7; + } + + LOGP(DL1C, LOGL_INFO, "L1 calibration table %s created on %s\n", + desc->fname, + calTbl->u8RawData + calTbl->hdr.v1.toc.u32DateOfst); + + //validate calibration station + if ( calTbl->hdr.v1.toc.u32StationOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration station ID offset.\n", desc->fname); + return -8; + } + + //validate FPGA FW version + if ( calTbl->hdr.v1.toc.u32FpgaFwVerOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid FPGA FW version offset.\n", desc->fname); + return -9; + } + //validate DSP FW version + if ( calTbl->hdr.v1.toc.u32DspFwVerOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid DSP FW version offset.\n", desc->fname); + return -10; + } + + //validate Tx calibration data offset + if ( calTbl->hdr.v1.toc.u32DataOfst == 0xFFFFFFFF ) { + LOGP(DL1C, LOGL_ERROR, "%s has invalid calibration data offset.\n", desc->fname); + return -11; + } + + if ( !desc->rx ) { + + //parse min/max Tx power + fl1h->phy_inst->u.lc15.minTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (5 << 2)]; + fl1h->phy_inst->u.lc15.maxTxPower = calTbl->u8RawData[calTbl->hdr.v1.toc.u32DataOfst + (6 << 2)]; + + //override nominal Tx power of given TRX if needed + if ( fl1h->phy_inst->trx->nominal_power > fl1h->phy_inst->u.lc15.maxTxPower) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", + plink->num, + fl1h->phy_inst->u.lc15.maxTxPower, + fl1h->phy_inst->trx->nominal_power); + + fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.maxTxPower; + } + + if ( fl1h->phy_inst->trx->nominal_power < fl1h->phy_inst->u.lc15.minTxPower) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u nominal Tx power to %d dBm (%d)\n", + plink->num, + fl1h->phy_inst->u.lc15.minTxPower, + fl1h->phy_inst->trx->nominal_power); + + fl1h->phy_inst->trx->nominal_power = fl1h->phy_inst->u.lc15.minTxPower; + } + + if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm > to_mdB(fl1h->phy_inst->u.lc15.maxTxPower) ) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", + plink->num, + to_mdB(fl1h->phy_inst->u.lc15.maxTxPower), + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm); + + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.maxTxPower); + } + + if ( fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm < to_mdB(fl1h->phy_inst->u.lc15.minTxPower) ) { + LOGP(DL1C, LOGL_INFO, "Set TRX %u Tx power parameter to %d dBm (%d)\n", + plink->num, + to_mdB(fl1h->phy_inst->u.lc15.minTxPower), + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm); + + fl1h->phy_inst->trx->power_params.trx_p_max_out_mdBm = to_mdB(fl1h->phy_inst->u.lc15.minTxPower); + } + + LOGP(DL1C, LOGL_DEBUG, "%s: minTxPower=%d, maxTxPower=%d\n", + desc->fname, + fl1h->phy_inst->u.lc15.minTxPower, + fl1h->phy_inst->u.lc15.maxTxPower ); + } + + //rewind read poiner for subsequence tasks + fseek(st->fp, 0L, SEEK_SET); + free(rbuf); + + return 0; +} + diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index d0288ab..8c4364c 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -218,6 +218,8 @@ vty_out(vty, "%s ", gsm_band_name(1 << i)); } vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, "Min Tx Power: %d dBm%s", fl1h->phy_inst->u.lc15.minTxPower, VTY_NEWLINE); + vty_out(vty, "Max Tx Power: %d dBm%s", fl1h->phy_inst->u.lc15.maxTxPower, VTY_NEWLINE); return CMD_SUCCESS; } @@ -246,8 +248,9 @@ } DEFUN(set_tx_power, set_tx_power_cmd, - "trx <0-0> tx-power <-110-100>", + "trx nr <0-1> tx-power <-110-100>", TRX_STR + "TRX number \n" "Set transmit power (override BSC)\n" "Transmit power in dBm\n") { @@ -298,6 +301,25 @@ return CMD_SUCCESS; } +DEFUN(cfg_trx_nominal_power, cfg_trx_nominal_power_cmd, + "nominal-tx-power <0-40>", + "Set the nominal transmit output power in dBm\n" + "Nominal transmit output power level in dBm\n") +{ + int nominal_power = atoi(argv[0]); + struct gsm_bts_trx *trx = vty->index; + + if (( nominal_power > 40 ) || ( nominal_power < 0 )) { + vty_out(vty, "Nominal Tx power level must be between 0 and 40 dBm (%d) %s", + nominal_power, VTY_NEWLINE); + return CMD_WARNING; + } + + trx->nominal_power = nominal_power; + trx->power_params.trx_p_max_out_mdBm = to_mdB(nominal_power); + + return CMD_SUCCESS; +} void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts) { @@ -305,6 +327,7 @@ void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx) { + vty_out(vty, " nominal-tx-power %d%s", trx->nominal_power,VTY_NEWLINE); } static void write_phy_inst(struct vty *vty, struct phy_instance *pinst) diff --git a/src/osmo-bts-litecell15/main.c b/src/osmo-bts-litecell15/main.c index 2aaacd3..352949b 100644 --- a/src/osmo-bts-litecell15/main.c +++ b/src/osmo-bts-litecell15/main.c @@ -81,7 +81,7 @@ } llist_for_each_entry(trx, &bts->trx_list, list) { - trx->nominal_power = 37; + trx->nominal_power = 40; trx->power_params.trx_p_max_out_mdBm = to_mdB(bts->c0->nominal_power); } -- To view, visit https://gerrit.osmocom.org/238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 09:51:12 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 09:51:12 +0000 Subject: libosmocore[master]: lapdm: Fix malformed Abis messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 And refer to the bug report (e.g. this one http://osmocom.org/issues/1635)? We use "Fixes: OS#1635" in the commit message to refer to the bug. And the existing testcase needs to be updated and preferable extended for all your messages. You can execute tests using make check. -- To view, visit https://gerrit.osmocom.org/266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 10:03:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 15 Jun 2016 10:03:14 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 the build failure in http://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/205/ is a real one, something doesn't want to link due to a missing symbol. -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 11:19:25 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 15 Jun 2016 11:19:25 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/201 to look at the new patch set (#2). Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new subscriber-create-no-extension vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Fixes: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 10 files changed, 120 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/2 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ad..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e7cd520..d70db1b 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -25,6 +25,7 @@ GSM_SUBSCR_DONT_CREATE = 0, GSM_SUBSCR_CREAT_W_RAND_EXT = 1, GSM_SUBSCR_CREAT_W_REGEXP = 2, + GSM_SUBSCR_CREAT_W_NO_EXT = 4, }; enum gsm_security_event { diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 3cba5d1..114ceae 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -91,7 +91,8 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, + enum gsm_subscr_creation_mode scm); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index a02db36..9b2e4c9 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -19,6 +19,8 @@ * */ +#include + #include #include #include @@ -98,7 +100,8 @@ if (!subscr) subscr = subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + net->ext_max, + net->subscr_creation_mode); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index b367139..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ } struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -551,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr, smin, smax); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -956,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1062,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..1ef1abd 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -530,6 +530,9 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { + bool alloc = (GSM_SUBSCR_CREAT_W_NO_EXT & net->subscr_creation_mode) ? + false : true; + if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) return NULL; @@ -538,7 +541,7 @@ return NULL; return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + net->ext_max, alloc); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1dc2cc2..d308e7a 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -204,9 +205,12 @@ struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, + enum gsm_subscr_creation_mode scm) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); + bool alloc_ext = (GSM_SUBSCR_CREAT_W_NO_EXT & scm) ? false : true; + struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax, + alloc_ext); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index a035bf9..5e54c7b 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -244,7 +244,8 @@ else { subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], gsmnet->ext_min, - gsmnet->ext_max); + gsmnet->ext_max, + gsmnet->subscr_creation_mode); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1054,6 +1055,15 @@ return CMD_SUCCESS; } +DEFUN(cfg_nitb_subscr_noext, cfg_nitb_subscr_noext_cmd, + "subscriber-create-no-extension", + "Do not assign extension when creating subscriber on demand.\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_NO_EXT; + return CMD_SUCCESS; +} + DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, "subscriber-create-on-demand [regexp]", "Make a new record when a subscriber is first seen.\n" @@ -1061,7 +1071,8 @@ "authorized-regexp command\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + if (!gsmnet->subscr_creation_mode) + gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; if (argc) gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; return CMD_SUCCESS; @@ -1103,6 +1114,8 @@ vty_out(vty, "nitb%s", VTY_NEWLINE); vty_out(vty, " %ssubscriber-create-on-demand%s%s", pref, reg, VTY_NEWLINE); + if(scm & GSM_SUBSCR_CREAT_W_NO_EXT) + vty_out(vty, " subscriber-create-no-extension%s", VTY_NEWLINE); if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, @@ -1162,6 +1175,7 @@ install_node(&nitb_node, config_write_nitb); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_noext_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd); install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd); diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index dc81481..a689789 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *alice_imsi, char *imei1, char *imei2, bool ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -187,8 +189,10 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } SUBSCR_PUT(alice); } @@ -217,18 +221,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..514c494 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -400,6 +400,9 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913769" + imsi3 = "100500854113769" + imsi4 = "100583744053769" # Initially we don't have this subscriber self.vty.verify('show subscriber imsi '+imsi, ['% No subscriber found for imsi '+imsi]) @@ -407,14 +410,60 @@ # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) # Now we have it res = self.vty.command('show subscriber imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-no-extension", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi3) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi4) + self.assert_(res != "") # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:00:08 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Wed, 15 Jun 2016 12:00:08 +0000 Subject: libosmocore[master]: lapdm: Fix malformed Abis messages In-Reply-To: References: Message-ID: Patch Set 1: This commit relates to the bug #1635 that I have already reported this March. I will rename commit message using "Fixes: OS#1635" instead. -- To view, visit https://gerrit.osmocom.org/266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:02:33 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Wed, 15 Jun 2016 12:02:33 +0000 Subject: osmo-bts[master]: LC15: common/oml.c: Support Tx power reduction 1 dB and 2 dB... In-Reply-To: References: Message-ID: Patch Set 2: I will introduce a private/proprietary IE for this feature -- To view, visit https://gerrit.osmocom.org/241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16c66452acad1a0fb52561d829d708206ab4a5f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:09:47 2016 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Wed, 15 Jun 2016 12:09:47 +0000 Subject: osmo-bts[master]: LC15: BTS parameters are configurable via configuration file... In-Reply-To: References: Message-ID: Patch Set 2: > (2 comments) I added new commit and rebased origin/master. I don't understand why Jenkins Builder re-run untouched commits. -- To view, visit https://gerrit.osmocom.org/239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3622d5b6f22525b798b0c75bbc2bab3767aba923 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:30:39 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 15 Jun 2016 12:30:39 +0000 Subject: [PATCH] osmo-pcu[master]: Add header type 1 support for EGPRS uplink In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/270 to look at the new patch set (#2). Add header type 1 support for EGPRS uplink Function is added to parse the EGPRS header type 1 in uplink tbf path. along with configuration parameter updation to reflect max mcs in UL Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a --- M src/bts.h M src/decoding.cpp M src/decoding.h M src/encoding.cpp M src/gprs_ms.cpp M src/pcu_main.cpp 6 files changed, 75 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/70/270/2 diff --git a/src/bts.h b/src/bts.h index a713c46..807ce08 100644 --- a/src/bts.h +++ b/src/bts.h @@ -41,6 +41,8 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) +#define MAX_GPRS_CS 9 + struct BTS; struct GprsMs; @@ -188,7 +190,7 @@ uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; - struct {int16_t low; int16_t high;} cs_lqual_ranges[4]; + struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS]; uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */ uint16_t ws_base; uint16_t ws_pdch; /* increase WS by this value per PDCH */ diff --git a/src/decoding.cpp b/src/decoding.cpp index e1f8134..7865be0 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -357,8 +357,8 @@ cur_bit = rlc_parse_ul_data_header_egprs_type_2(rlc, data, cs); break; case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1 : - /* TODO: Support both header type 1 */ - /* fall through */ + cur_bit = rlc_parse_ul_data_header_egprs_type_1(rlc, data, cs); + break; default: LOGP(DRLCMACDL, LOGL_ERROR, "Decoding of uplink %s data blocks not yet supported.\n", @@ -455,6 +455,65 @@ return cur_bit; } +int Decoding::rlc_parse_ul_data_header_egprs_type_1( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, const GprsCodingScheme &cs) +{ + struct gprs_rlc_ul_header_egprs_1 *egprs1; + unsigned int e_ti_header, cur_bit = 0, offs; + int punct, punct2, with_padding; + + egprs1 = static_cast < struct gprs_rlc_ul_header_egprs_1 * > + ((void *)data); + gprs_rlc_mcs_cps_decode(egprs1->cps, cs, &punct, &punct2, + &with_padding); + gprs_rlc_data_info_init_ul(rlc, cs, with_padding); + + rlc->r = egprs1->r; + rlc->si = egprs1->si; + rlc->tfi = (egprs1->tfi_a << 0) | (egprs1->tfi_b << 2); + rlc->cps = egprs1->cps; + rlc->rsb = egprs1->rsb; + rlc->num_data_blocks = 2; + rlc->block_info[0].cv = egprs1->cv; + rlc->block_info[0].pi = egprs1->pi; + rlc->block_info[0].bsn = + (egprs1->bsn1_a << 0) | (egprs1->bsn1_b << 5); + + cur_bit += rlc->data_offs_bits[0] - 2; + offs = rlc->data_offs_bits[0] / 8; + OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 0); + + e_ti_header = data[offs - 1] >> 6; + rlc->block_info[0].e = (e_ti_header & 0x01); + rlc->block_info[0].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + + rlc->block_info[1].cv = egprs1->cv; + rlc->block_info[1].pi = egprs1->pi; + rlc->block_info[1].bsn = rlc->block_info[0].bsn + + ((egprs1->bsn2_a << 0) | (egprs1->bsn2_b << 2)); + rlc->block_info[1].bsn = rlc->block_info[1].bsn & (RLC_EGPRS_SNS - 1); + + if ((rlc->block_info[1].bsn != rlc->block_info[0].bsn) && + (rlc->block_info[0].cv == 0)) + rlc->block_info[0].cv = 1; + + cur_bit = rlc->data_offs_bits[1] - 2; + + offs = rlc->data_offs_bits[1] / 8; + OSMO_ASSERT(rlc->data_offs_bits[1] % 8 == 2); + + e_ti_header = (data[offs] & (0x03)); + rlc->block_info[1].e = (e_ti_header & 0x01); + rlc->block_info[1].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + /* skip data area */ + cur_bit += cs.maxDataBlockBytes() * 8; + + return cur_bit; +} + int Decoding::rlc_parse_ul_data_header_gprs(struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs) { diff --git a/src/decoding.h b/src/decoding.h index 736adf1..d1371d5 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -52,6 +52,10 @@ struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs); + static int rlc_parse_ul_data_header_egprs_type_1( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs); static int rlc_parse_ul_data_header_gprs( struct gprs_rlc_data_info *rlc, const uint8_t *data, diff --git a/src/encoding.cpp b/src/encoding.cpp index 2102a1e..e174c80 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -610,8 +610,9 @@ struct gprs_rlcmac_ul_tbf *tbf, bool is_final) { bitvec_write_field(dest, wp, 0, 2); // fixed 00 - bitvec_write_field(dest, wp, 2, 4); // CHANNEL_CODING_COMMAND: MCS-3 - // bitvec_write_field(dest, wp, tbf->current_cs() - 1, 4); // CHANNEL_CODING_COMMAND + /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, wp, + tbf->current_cs().to_num() - 1, 4); bitvec_write_field(dest, wp, 0, 1); // 0: no RESEGMENT (nyi) bitvec_write_field(dest, wp, 1, 1); // PRE_EMPTIVE_TRANSMISSION, TODO: This resembles GPRS, change it? bitvec_write_field(dest, wp, 0, 1); // 0: no PRR_RETRANSMISSION_REQUEST, TODO: clarify diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 4296fd3..4f71892 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -632,8 +632,8 @@ high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else if (m_current_cs_ul.isEgprs()) { /* TODO, use separate table */ - if (current_cs_num > 4) - current_cs_num = 4; + if (current_cs_num > MAX_GPRS_CS) + current_cs_num = MAX_GPRS_CS; low = bts_data->cs_lqual_ranges[current_cs_num-1].low; high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else { diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index f66c631..2d86cda 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -189,8 +189,8 @@ bts->cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */ bts->max_cs_ul = 4; bts->max_cs_dl = 4; - bts->max_mcs_ul = 4; - bts->max_mcs_dl = 4; + bts->max_mcs_ul = MAX_GPRS_CS; + bts->max_mcs_dl = MAX_GPRS_CS; /* CS-1 to CS-4 */ bts->cs_lqual_ranges[0].low = -256; bts->cs_lqual_ranges[0].high = 6; -- To view, visit https://gerrit.osmocom.org/270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:39:42 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 12:39:42 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (4 comments) * Code duplication for alloc is a concern * And bigger is the question if we want to overload the field and start setting some extra bits? I would prefer not to. https://gerrit.osmocom.org/#/c/201/2/openbsc/src/libmsc/ctrl_commands.c File openbsc/src/libmsc/ctrl_commands.c: Line 22: #include classic debate. I am in favor of including system headers last. this makes sure our header are resolving all its dependencies. https://gerrit.osmocom.org/#/c/201/2/openbsc/src/libmsc/gsm_04_08.c File openbsc/src/libmsc/gsm_04_08.c: Line 533: bool alloc = (GSM_SUBSCR_CREAT_W_NO_EXT & net->subscr_creation_mode) ? alloc what? :) https://gerrit.osmocom.org/#/c/201/2/openbsc/src/libmsc/vty_interface_layer3.c File openbsc/src/libmsc/vty_interface_layer3.c: Line 1063: gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_NO_EXT; I find it unfortunate that we use this variable for both the state and as a flag. Can you make this mode a new command with a new variable? 1st decide if to allocate a subscriber 2nd check a separate flag. And maybe change the random extension as well? https://gerrit.osmocom.org/#/c/201/2/openbsc/tests/db/db_test.c File openbsc/tests/db/db_test.c: Line 192: if (alice_db) { nack. We had this before. We need _strong_ post conditions in the test. -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:43:37 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 12:43:37 +0000 Subject: osmo-bts[master]: sysmo: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/264/2/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 143: return 0; It would be nice if '0' wouldn't be a legal hLayer3 handle. -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 15 12:53:05 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 15 Jun 2016 12:53:05 +0000 Subject: [PATCH] openbsc[master]: configure: require libgsm for --enable-mgcp-transcoding Message-ID: Review at https://gerrit.osmocom.org/277 configure: require libgsm for --enable-mgcp-transcoding Fail in configure if libgsm is not found. Before this, the --enable-mgcp-transcoding would gladly accept that libgsm is missing and the build would fail later because of missing linking and undefined references. Change-Id: Ic23157cc5b75694f400a176c31f97d71e861ea02 --- M openbsc/configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/77/277/1 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 5cd5d2d..0980413 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -63,7 +63,7 @@ AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""]) + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) AC_SUBST(LIBRARY_GSM) if test "$osmo_ac_with_g729" = "yes" ; then PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) -- To view, visit https://gerrit.osmocom.org/277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic23157cc5b75694f400a176c31f97d71e861ea02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 15 13:04:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 15 Jun 2016 13:04:48 +0000 Subject: [PATCH] openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/267 to look at the new patch set (#3). rm dup: use channel type names from libosmocore In gsm_lchant_name(enum gsm_chan_t), use the gsm_chan_t_names value strings from libosmocore instead of redefining the same strings. The list from libosmocore is also more complete, including CCCH and PDTCH. Add a todo comment to move to libosmocore. In consequence, libosmogsm linkage needs to be added to osmo-bsc_mgcp, mgcp_test, mgcp_transcoding_test and smpp_mirror, smpp_test. Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data_shared.c M openbsc/src/osmo-bsc_mgcp/Makefile.am M openbsc/src/utils/Makefile.am M openbsc/tests/mgcp/Makefile.am M openbsc/tests/smpp/Makefile.am 6 files changed, 10 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/67/267/3 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 0b6bf60..b16cf1b 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -780,7 +780,6 @@ const struct value_string gsm_pchant_names[12]; const struct value_string gsm_pchant_descs[12]; -const struct value_string gsm_lchant_names[8]; const char *gsm_pchan_name(enum gsm_phys_chan_config c); enum gsm_phys_chan_config gsm_pchan_parse(const char *name); const char *gsm_lchant_name(enum gsm_chan_t c); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 9f9eb1e..e9eb4b0 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -92,19 +92,10 @@ return get_string_value(gsm_pchant_names, name); } -const struct value_string gsm_lchant_names[8] = { - { GSM_LCHAN_NONE, "NONE" }, - { GSM_LCHAN_SDCCH, "SDCCH" }, - { GSM_LCHAN_TCH_F, "TCH/F" }, - { GSM_LCHAN_TCH_H, "TCH/H" }, - { GSM_LCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_LCHAN_CBCH, "CBCH" }, - { 0, NULL } -}; - +/* TODO: move to libosmocore, next to gsm_chan_t_names? */ const char *gsm_lchant_name(enum gsm_chan_t c) { - return get_value_string(gsm_lchant_names, c); + return get_value_string(gsm_chan_t_names, c); } static const struct value_string lchan_s_names[] = { diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/openbsc/src/osmo-bsc_mgcp/Makefile.am index 949cb64..a48f24b 100644 --- a/openbsc/src/osmo-bsc_mgcp/Makefile.am +++ b/openbsc/src/osmo-bsc_mgcp/Makefile.am @@ -9,6 +9,6 @@ osmo_bsc_mgcp_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libmgcp/libmgcp.a -lrt \ - $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ $(LIBOSMONETIF_LIBS) $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) diff --git a/openbsc/src/utils/Makefile.am b/openbsc/src/utils/Makefile.am index 4521130..5a2e2d2 100644 --- a/openbsc/src/utils/Makefile.am +++ b/openbsc/src/utils/Makefile.am @@ -27,7 +27,7 @@ smpp_mirror_SOURCES = smpp_mirror.c smpp_mirror_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) $(LIBSMPP34_LIBS) + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBSMPP34_LIBS) meas_vis_SOURCES = meas_vis.c meas_vis_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -lcdk -lncurses diff --git a/openbsc/tests/mgcp/Makefile.am b/openbsc/tests/mgcp/Makefile.am index ec7cc99..82d6ac6 100644 --- a/openbsc/tests/mgcp/Makefile.am +++ b/openbsc/tests/mgcp/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir) -AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(COVERAGE_CFLAGS) $(LIBBCG729_CFLAGS) +AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_FLAGS) $(LIBOSMONETIF_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(COVERAGE_CFLAGS) $(LIBBCG729_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) EXTRA_DIST = mgcp_test.ok mgcp_transcoding_test.ok @@ -15,7 +15,8 @@ mgcp_test_LDADD = $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ + -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) $(LIBOSMONETIF_LIBS) mgcp_transcoding_test_SOURCES = mgcp_transcoding_test.c @@ -24,5 +25,6 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) $(LIBBCG729_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ + $(LIBBCG729_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) $(LIBOSMONETIF_LIBS) $(LIBRARY_GSM) diff --git a/openbsc/tests/smpp/Makefile.am b/openbsc/tests/smpp/Makefile.am index 9ab15c5..aab4de9 100644 --- a/openbsc/tests/smpp/Makefile.am +++ b/openbsc/tests/smpp/Makefile.am @@ -10,4 +10,4 @@ $(top_builddir)/src/libmsc/smpp_utils.c smpp_test_LDADD = \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 13:30:01 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 15 Jun 2016 13:30:01 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/267/3/openbsc/src/libcommon/gsm_data_shared.c File openbsc/src/libcommon/gsm_data_shared.c: Line 95: /* TODO: move to libosmocore, next to gsm_chan_t_names? */ I think both comment and gsm_lchant_name() wrapper can be removed: we can use get_value_string() directly. -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 15 14:05:25 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 14:05:25 +0000 Subject: osmo-pcu[master]: Add test cases for Header Type 2 in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 14:05:28 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 14:05:28 +0000 Subject: [MERGED] osmo-pcu[master]: Add test cases for Header Type 2 in EGPRS UL In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: Add test cases for Header Type 2 in EGPRS UL ...................................................................... Add test cases for Header Type 2 in EGPRS UL Updates the test suite to add test cases for Header type 2 parsing in EGPRS UL. Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Reviewed-on: https://gerrit.osmocom.org/271 Reviewed-by: Harald Welte Tested-by: Jenkins Builder Reviewed-by: Holger Freyther --- M tests/edge/EdgeTest.cpp M tests/edge/EdgeTest.ok 2 files changed, 128 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 68a0d0b..f8adbbb 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -26,7 +26,7 @@ #include "encoding.h" #include "rlc.h" #include "llc.h" - +#include "bts.h" extern "C" { #include "pcu_vty.h" @@ -1156,6 +1156,130 @@ ARRAY_SIZE(default_categories), }; +static void setup_bts(BTS *the_bts, uint8_t ts_no, uint8_t cs = 1) +{ + gprs_rlcmac_bts *bts; + gprs_rlcmac_trx *trx; + + bts = the_bts->bts_data(); + bts->egprs_enabled = true; + bts->alloc_algorithm = alloc_algorithm_a; + bts->initial_cs_dl = cs; + bts->initial_cs_ul = cs; + trx = &bts->trx[0]; + trx->pdch[ts_no].enable(); +} +static void uplink_header_type_2_parsing_test(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class) +{ + GprsMs *ms; + struct pcu_l1_meas meas; + int tfi = 0; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + uint8_t data[79] = {0}; + struct gprs_rlc_ul_header_egprs_2 *egprs2 = NULL; + + egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data; + bts = the_bts->bts_data(); + + tfi = 1; + + struct gprs_rlc_data_info rlc; + GprsCodingScheme cs; + int rc, offs; + + /*without padding*/ + cs = GprsCodingScheme::MCS5; + egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data; + egprs2->r = 1; + egprs2->si = 1; + egprs2->cv = 7; + egprs2->tfi_a = tfi & 0x03; + egprs2->tfi_b = (tfi & 0x1c) >> 2; + egprs2->bsn1_a = 0; + egprs2->bsn1_b = 0; + egprs2->cps_a = 3; + egprs2->cps_b = 0; + egprs2->rsb = 0; + egprs2->pi = 0; + data[4] = 0x20; /* Setting E field */ + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + offs = rlc.data_offs_bits[0] / 8; + OSMO_ASSERT(offs == 4); + OSMO_ASSERT(rlc.tfi == 1); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + + /* with padding case */ + cs = GprsCodingScheme::MCS6; + egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data; + egprs2->r = 1; + egprs2->si = 1; + egprs2->cv = 7; + egprs2->tfi_a = tfi & 0x03; + egprs2->tfi_b = (tfi & 0x1c) >> 2; + egprs2->bsn1_a = 0; + egprs2->bsn1_b = 0; + egprs2->cps_a = 3; + egprs2->cps_b = 0; + egprs2->rsb = 0; + egprs2->pi = 0; + data[10] = 0x20; /* Setting E field */ + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + offs = rlc.data_offs_bits[0] / 8; + OSMO_ASSERT(offs == 10); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.tfi == 1); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + + egprs2->r = 1; + egprs2->si = 1; + egprs2->cv = 7; + egprs2->tfi_a = tfi & 0x03; + egprs2->tfi_b = (tfi & 0x1c) >> 2; + egprs2->bsn1_a = 1; + egprs2->bsn1_b = 0; + egprs2->cps_a = 2; + egprs2->cps_b = 0; + egprs2->rsb = 0; + egprs2->pi = 0; + data[10] = 0x20; /* Setting E field */ + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + offs = rlc.data_offs_bits[0] / 8; + OSMO_ASSERT(offs == 10); + OSMO_ASSERT(rlc.tfi == 1); + OSMO_ASSERT(rlc.num_data_blocks == 1); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 1); +} + +static void uplink_header_type2_test(void) +{ + BTS the_bts; + int ts_no = 7; + uint32_t fn = 2654218; + uint16_t qta = 31; + uint32_t tlli = 0xf1223344; + const char *imsi = "0011223344"; + uint8_t ms_class = 1; + gprs_rlcmac_ul_tbf *ul_tbf; + GprsMs *ms; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, ts_no, 10); + + uplink_header_type_2_parsing_test(&the_bts, ts_no, + tlli, &fn, qta, ms_class); + printf("=== end %s ===\n", __func__); +} + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -1178,6 +1302,7 @@ test_rlc_unaligned_copy(); test_rlc_unit_encoder(); + uplink_header_type2_test(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); return EXIT_SUCCESS; diff --git a/tests/edge/EdgeTest.ok b/tests/edge/EdgeTest.ok index 9554df3..95ca60b 100644 --- a/tests/edge/EdgeTest.ok +++ b/tests/edge/EdgeTest.ok @@ -6,3 +6,5 @@ === end test_rlc_unit_decoder === === start test_rlc_unit_encoder === === end test_rlc_unit_encoder === +=== start uplink_header_type2_test === +=== end uplink_header_type2_test === -- To view, visit https://gerrit.osmocom.org/271 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1dd46010065a6d6da21e8e45af71e6d5f649b0b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 14:41:28 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 15 Jun 2016 14:41:28 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/201 to look at the new patch set (#3). Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new subscriber-create-no-extension vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Fixes: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 11 files changed, 139 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/3 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ad..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e7cd520..f61ed4e 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] enum gsm_subscr_creation_mode { - GSM_SUBSCR_DONT_CREATE = 0, GSM_SUBSCR_CREAT_W_RAND_EXT = 1, GSM_SUBSCR_CREAT_W_REGEXP = 2, }; @@ -290,6 +290,8 @@ /* subscriber related features */ int subscr_creation_mode; + bool auto_create_subscr; + bool auto_assign_exten; uint64_t ext_min; uint64_t ext_max; struct gsm_subscriber_group *subscr_group; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 3cba5d1..45e5816 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -5,6 +5,8 @@ #include #include +#include + #define GSM_NAME_LENGTH 160 #define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */ @@ -91,7 +93,8 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, + bool alloc_exten); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4636d57..c3095c4 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -21,6 +21,8 @@ #include #include +#include + struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code, int (*mncc_recv)(struct gsm_network *, struct msgb *)) { @@ -49,6 +51,8 @@ net->subscr_group->net = net; net->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + net->auto_create_subscr = true; + net->auto_assign_exten = true; net->country_code = country_code; net->network_code = network_code; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index a02db36..a2a1511 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -25,6 +25,8 @@ #include #include +#include + static bool alg_supported(const char *alg) { /* @@ -98,7 +100,8 @@ if (!subscr) subscr = subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + net->ext_max, + net->auto_assign_exten); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index b367139..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ } struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -551,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr, smin, smax); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -956,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1062,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..e182c48 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -530,15 +530,15 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { - if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) + if (!net->auto_create_subscr) return NULL; - if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP) + if (net->subscr_creation_mode == GSM_SUBSCR_CREAT_W_REGEXP) if (!subscr_regexp_check(net, imsi)) return NULL; return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + net->ext_max, net->auto_assign_exten); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1dc2cc2..147524b 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -204,9 +205,11 @@ struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, + bool alloc_exten) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax, + alloc_exten); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index a035bf9..a009e95 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -244,7 +244,8 @@ else { subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], gsmnet->ext_min, - gsmnet->ext_max); + gsmnet->ext_max, + gsmnet->auto_assign_exten); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1044,6 +1045,8 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = true; if (mi >= ma) { vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", argv[0], argv[1], VTY_NEWLINE); @@ -1054,6 +1057,15 @@ return CMD_SUCCESS; } +DEFUN(cfg_nitb_subscr_noext, cfg_nitb_subscr_noext_cmd, + "subscriber-create-no-extension", + "Do not assign extension when creating subscriber on demand.\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->auto_assign_exten = false; + return CMD_SUCCESS; +} + DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, "subscriber-create-on-demand [regexp]", "Make a new record when a subscriber is first seen.\n" @@ -1061,9 +1073,12 @@ "authorized-regexp command\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = true; if (argc) - gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; + gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_REGEXP; + else + gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; return CMD_SUCCESS; } @@ -1072,7 +1087,7 @@ NO_STR "Make a new record when a subscriber is first seen.\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_DONT_CREATE; + gsmnet->auto_create_subscr = false; return CMD_SUCCESS; } @@ -1098,11 +1113,13 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); enum gsm_subscr_creation_mode scm = gsmnet->subscr_creation_mode; - const char *reg = (scm & GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", - *pref = scm ? "" : "no "; + const char *reg = (scm == GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", + *pref = gsmnet->auto_create_subscr ? "" : "no "; vty_out(vty, "nitb%s", VTY_NEWLINE); vty_out(vty, " %ssubscriber-create-on-demand%s%s", pref, reg, VTY_NEWLINE); + if(!gsmnet->auto_assign_exten) + vty_out(vty, " subscriber-create-no-extension%s", VTY_NEWLINE); if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, @@ -1162,6 +1179,7 @@ install_node(&nitb_node, config_write_nitb); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_noext_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd); install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd); diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index dc81481..755a6e9 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *imsi, char *imei1, char *imei2, bool make_ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + make_ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -177,7 +179,7 @@ COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by IMSI */ - alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice_imsi); + alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by id */ @@ -187,8 +189,14 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + if (!make_ext) + printf("FAIL: bogus extension created for IMSI %s\n", + imsi); + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } else if (make_ext) + printf("FAIL: no subscriber extension for IMSI %s\n", imsi); SUBSCR_PUT(alice); } @@ -217,18 +225,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..da1a8fe 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -400,6 +400,9 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913762" + imsi3 = "100500854113763" + imsi4 = "100583744053764" # Initially we don't have this subscriber self.vty.verify('show subscriber imsi '+imsi, ['% No subscriber found for imsi '+imsi]) @@ -407,14 +410,60 @@ # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) # Now we have it res = self.vty.command('show subscriber imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-no-extension", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi3) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi4) + self.assert_(res != "") # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 15 14:54:54 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 14:54:54 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 Looks good enough. I would have to review the true/true/false settings and how show running-config looks after them. I _assume_ we have good coverage for the write handling right now. -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 14:57:45 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 15 Jun 2016 14:57:45 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 3: (3 comments) https://gerrit.osmocom.org/#/c/201/3/openbsc/src/libmsc/gsm_subscriber.c File openbsc/src/libmsc/gsm_subscriber.c: Line 212: alloc_exten); sgrp should have a pointer to the network? So we wouldn't need to duplicate the parameters here? https://gerrit.osmocom.org/#/c/201/3/openbsc/src/libmsc/vty_interface_layer3.c File openbsc/src/libmsc/vty_interface_layer3.c: Line 1060: DEFUN(cfg_nitb_subscr_noext, cfg_nitb_subscr_noext_cmd, So to mix create-on-demand with regexp + no extension we would need a new command? Can you think of something better? https://gerrit.osmocom.org/#/c/201/3/openbsc/tests/db/db_test.c File openbsc/tests/db/db_test.c: Line 192: if (alice_db) { Drop the if. We had that before, didn't we? Let the test crash... if it doesn't behave as expected. -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 15 15:01:38 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 15 Jun 2016 15:01:38 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 3: The expected behavior for this test is changed with this commit: - it have to return extension when expected - it have to return NULL when no extension So simply dropping the if is not a solution because it will make test crash when it supposed to work. -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 15 16:00:31 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 15 Jun 2016 16:00:31 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Add vty command to power on/off transceiver Message-ID: Review at https://gerrit.osmocom.org/278 TRX: Add vty command to power on/off transceiver Add vty command (under "phy X instance Y" hierarchy) to manually send POWERON or POWEROFF command. It's useful for debugging issues related to BTS/TRX initialization. Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Related: OS#1648 --- M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_vty.c 2 files changed, 21 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/278/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a4c16dc..0cb5eda 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -195,9 +195,10 @@ va_list ap; int l, pending = 0; - if (!transceiver_available && !!strcmp(cmd, "POWEROFF")) { - LOGP(DTRX, LOGL_ERROR, "CTRL ignored: No clock from " - "transceiver, please fix!\n"); + if (!transceiver_available && + !(!strcmp(cmd, "POWEROFF") || !strcmp(cmd, "POWERON"))) { + LOGP(DTRX, LOGL_ERROR, "CTRL %s ignored: No clock from " + "transceiver, please fix!\n", cmd); return -EIO; } diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index d2feea4..d8baf75 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -273,6 +273,22 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_power_on, cfg_phy_power_on_cmd, + "osmotrx power (on|off)", + OSMOTRX_STR + "Change TRX state\n" + "Turn it ON or OFF\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + if (strcmp(argv[0], "on")) + vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); + else + vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); + + return CMD_SUCCESS; +} DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd, "osmotrx fn-advance <0-30>", @@ -499,6 +515,7 @@ install_element(PHY_NODE, &cfg_phy_no_tx_atten_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_slotmask_cmd); + install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd); -- To view, visit https://gerrit.osmocom.org/278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 15 16:25:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 15 Jun 2016 16:25:23 +0000 Subject: [PATCH] osmo-bts[master]: doc: add ladder diagram on dynamic PDCH, add msc-README Message-ID: Review at https://gerrit.osmocom.org/279 doc: add ladder diagram on dynamic PDCH, add msc-README Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 --- A doc/dyn_pdch.msc A doc/msc-README 2 files changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/279/1 diff --git a/doc/dyn_pdch.msc b/doc/dyn_pdch.msc new file mode 100644 index 0000000..3ee3a90 --- /dev/null +++ b/doc/dyn_pdch.msc @@ -0,0 +1,36 @@ +msc { + hscale = "1.2"; + phy,bts,pcu,bsc; + + phy box bsc [ label = "PDCH Deactivation" ]; + bsc => bts [ label = "IPAC PDCH DEACT" ]; + --- [ label = "Disconnect PDTCH" ]; + bts => pcu [ label = "info ind (Disconnect)" ]; + pcu => bts [ label = "chan Disconnect request" ]; + bts => phy [ label = "L1 chan Disconnect PDTCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + bts -> pcu [ label = "chan Disconnect confirm" ]; + --- [ label = "Connect TCH" ]; + bts => phy [ label = "L1 chan Connect TCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + + phy box bsc [ label = "Now BSC may use TCH (example)" ]; + bsc => bts [ label = "Activate TCH/F" ]; + --- [ label = "Voice call..." ]; + bsc => bts [ label = "Deactivate TCH/F" ]; + + phy box bsc [ label = "PDCH Activation" ]; + bsc => bts [ label = "IPAC PDCH ACT" ]; + --- [ label = "Disconnect TCH" ]; + bts => phy [ label = "L1 chan Disconnect TCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect PDTCH" ]; + bts => pcu [ label = "info ind (Connect)" ]; + pcu => bts [ label = "chan Connect request" ]; + bts => phy [ label = "L1 chan Connect PDTCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts -> pcu [ label = "chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + +} diff --git a/doc/msc-README b/doc/msc-README new file mode 100644 index 0000000..55d6bae --- /dev/null +++ b/doc/msc-README @@ -0,0 +1,2 @@ +sudo apt-get install mscgen +mscgen -T svg dyn_pdch.msc -- To view, visit https://gerrit.osmocom.org/279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 15 16:30:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 15 Jun 2016 16:30:30 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/267/3/openbsc/src/libcommon/gsm_data_shared.c File openbsc/src/libcommon/gsm_data_shared.c: Line 95: /* TODO: move to libosmocore, next to gsm_chan_t_names? */ > I think both comment and gsm_lchant_name() wrapper can be removed: we can u we often have gsm_foo_name() functions to help in constructing log messages. I want to keep gsm_chant_name() just like gsm_lchan_name(), gsm_chans_name(), gsm_pchan_name()... Ususally the gsm_foo_name() is right next to the value strings array (if it uses one). The gsm_lchant_name() is different for hysterical raisins, because for some odd reason it wasn't added in libosmocore in the first place. I was lazy and wanted to avoid pushing a change to libosmocore and openbsc for now, since one of them would definitely be rejected by the jenkins build. Hence the comment. I want to keep the comment as well. -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 15 16:42:22 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 15 Jun 2016 16:42:22 +0000 Subject: [PATCH] osmo-bts[master]: doc: add ladder diagram on dynamic PDCH, add msc-README In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/279 to look at the new patch set (#2). doc: add ladder diagram on dynamic PDCH, add msc-README Adjust .gitignore for dyn_pdch.svg and .png. Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 --- M .gitignore A doc/dyn_pdch.msc A doc/msc-README 3 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/279/2 diff --git a/.gitignore b/.gitignore index 224b77c..8b8864d 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,8 @@ # Possible generated file doc/vty_reference.xml +doc/dyn_pdch.svg +doc/dyn_pdch.png # Backups, vi, merges *~ diff --git a/doc/dyn_pdch.msc b/doc/dyn_pdch.msc new file mode 100644 index 0000000..3ee3a90 --- /dev/null +++ b/doc/dyn_pdch.msc @@ -0,0 +1,36 @@ +msc { + hscale = "1.2"; + phy,bts,pcu,bsc; + + phy box bsc [ label = "PDCH Deactivation" ]; + bsc => bts [ label = "IPAC PDCH DEACT" ]; + --- [ label = "Disconnect PDTCH" ]; + bts => pcu [ label = "info ind (Disconnect)" ]; + pcu => bts [ label = "chan Disconnect request" ]; + bts => phy [ label = "L1 chan Disconnect PDTCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + bts -> pcu [ label = "chan Disconnect confirm" ]; + --- [ label = "Connect TCH" ]; + bts => phy [ label = "L1 chan Connect TCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + + phy box bsc [ label = "Now BSC may use TCH (example)" ]; + bsc => bts [ label = "Activate TCH/F" ]; + --- [ label = "Voice call..." ]; + bsc => bts [ label = "Deactivate TCH/F" ]; + + phy box bsc [ label = "PDCH Activation" ]; + bsc => bts [ label = "IPAC PDCH ACT" ]; + --- [ label = "Disconnect TCH" ]; + bts => phy [ label = "L1 chan Disconnect TCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect PDTCH" ]; + bts => pcu [ label = "info ind (Connect)" ]; + pcu => bts [ label = "chan Connect request" ]; + bts => phy [ label = "L1 chan Connect PDTCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts -> pcu [ label = "chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + +} diff --git a/doc/msc-README b/doc/msc-README new file mode 100644 index 0000000..55d6bae --- /dev/null +++ b/doc/msc-README @@ -0,0 +1,2 @@ +sudo apt-get install mscgen +mscgen -T svg dyn_pdch.msc -- To view, visit https://gerrit.osmocom.org/279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:29:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:29:59 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: TS flags: rename one, add three, as enum Message-ID: Review at https://gerrit.osmocom.org/280 dyn PDCH: TS flags: rename one, add three, as enum Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth value's meaning. Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and possibly other BTS implementations) to remember what to do when the PCU replies with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both. Change from #define to an enum. Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH commits, so osmo-bts submission depends on this commit. Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_vty.c 3 files changed, 12 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/80/280/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 0b6bf60..e46647c 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -332,7 +332,14 @@ #endif }; -#define TS_F_PDCH_MODE 0x1000 +enum { + TS_F_PDCH_ACTIVE = 0x1000, + TS_F_PDCH_ACT_PENDING = 0x2000, + TS_F_PDCH_DEACT_PENDING = 0x4000, + TS_F_PDCH_PENDING_MASK = 0x6000 /*< + TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ +} gsm_bts_trx_ts_flags; + /* One Timeslot in a TRX */ struct gsm_bts_trx_ts { struct gsm_bts_trx *trx; diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 59176df..338c00a 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -472,7 +472,7 @@ /* if channel is in PDCH mode, deactivate PDCH first */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH - && (lchan->ts->flags & TS_F_PDCH_MODE)) { + && (lchan->ts->flags & TS_F_PDCH_ACTIVE)) { /* store activation type and handover reference */ lchan->dyn_pdch.act_type = act_type; lchan->dyn_pdch.ho_ref = ho_ref; @@ -1203,7 +1203,7 @@ static int rsl_rx_pdch_act_ack(struct msgb *msg) { - msg->lchan->ts->flags |= TS_F_PDCH_MODE; + msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; /* We have activated PDCH, so now the channel is available again. */ do_lchan_free(msg->lchan); @@ -1213,7 +1213,7 @@ static int rsl_rx_pdch_deact_ack(struct msgb *msg) { - msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE; rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, msg->lchan->dyn_pdch.ho_ref); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index b0f2f62..578b005 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -919,7 +919,7 @@ gsm_pchan_name(ts->pchan), gsm_ts_tsc(ts)); if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) vty_out(vty, " (%s mode)", - ts->flags & TS_F_PDCH_MODE ? "PDCH" : "TCH/F"); + ts->flags & TS_F_PDCH_ACTIVE ? "PDCH" : "TCH/F"); vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " NM State: "); net_dump_nmstate(vty, &ts->mo.nm_state); -- To view, visit https://gerrit.osmocom.org/280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:30:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:30:00 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re... Message-ID: Review at https://gerrit.osmocom.org/281 dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect) Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704 --- M openbsc/src/libbsc/bsc_dyn_pdch.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/81/281/1 diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c index 717880b..6e5fe83 100644 --- a/openbsc/src/libbsc/bsc_dyn_pdch.c +++ b/openbsc/src/libbsc/bsc_dyn_pdch.c @@ -27,6 +27,8 @@ { int rc; + ts->flags &= ~(TS_F_PDCH_PENDING_MASK | TS_F_PDCH_ACTIVE); + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on" " BTS %u TRX %u TS %u\n", -- To view, visit https://gerrit.osmocom.org/281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:30:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:30:00 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: track pending PDCH de-/activation Message-ID: Review at https://gerrit.osmocom.org/282 dyn PDCH: track pending PDCH de-/activation Set and clear pending flags on the TS according to PDCH de-/activation. This will allow changing the time we set the channel state to after PDCH DEACT and before PDCH ACT, in a subsequent commit. Also add a sanity check on whether we're sending conflicting or superfluous PDCH de-/activations on the same TS. Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/82/282/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 338c00a..349b3de 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1204,6 +1204,7 @@ static int rsl_rx_pdch_act_ack(struct msgb *msg) { msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; + msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING; /* We have activated PDCH, so now the channel is available again. */ do_lchan_free(msg->lchan); @@ -1214,6 +1215,7 @@ static int rsl_rx_pdch_deact_ack(struct msgb *msg) { msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE; + msg->lchan->ts->flags &= ~TS_F_PDCH_DEACT_PENDING; rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, msg->lchan->dyn_pdch.ho_ref); @@ -1975,10 +1977,24 @@ struct abis_rsl_dchan_hdr *dh; uint8_t msg_type; - if (act) + if (ts->flags & TS_F_PDCH_PENDING_MASK) { + LOGP(DRSL, LOGL_ERROR, + "%s PDCH %s requested, but a PDCH%s%s is still pending\n", + gsm_ts_name(ts), + act ? "ACT" : "DEACT", + ts->flags & TS_F_PDCH_ACT_PENDING? " ACT" : "", + ts->flags & TS_F_PDCH_DEACT_PENDING? " DEACT" : ""); + return -EINVAL; + } + + if (act){ msg_type = RSL_MT_IPAC_PDCH_ACT; - else + ts->flags |= TS_F_PDCH_ACT_PENDING; + } else { msg_type = RSL_MT_IPAC_PDCH_DEACT; + ts->flags |= TS_F_PDCH_DEACT_PENDING; + } + /* TODO add timeout to cancel PDCH DE/ACT */ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); -- To view, visit https://gerrit.osmocom.org/282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:30:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:30:00 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK Message-ID: Review at https://gerrit.osmocom.org/283 dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 54 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/283/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 349b3de..3aefd9c 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1201,8 +1201,59 @@ return 0; } +static bool lchan_may_change_pdch(struct gsm_lchan *lchan, bool pdch_act) +{ + struct gsm_bts_trx_ts *ts; + bool ok; + + OSMO_ASSERT(lchan); + + ts = lchan->ts; + OSMO_ASSERT(ts); + OSMO_ASSERT(ts->trx); + OSMO_ASSERT(ts->trx->bts); + + if (lchan->ts->pchan != GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" + " Rx PDCH %s ACK for channel that is no TCH/F_PDCH\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + pdch_act? "ACT" : "DEACT"); + return false; + } + + /* During BTS initialization, we expect to PDCH ACT in channel state == + * NONE. However, during dynamic channel switching, we will PDCH ACT + * while in state DEACTIVATION REQUESTED (we're deactivating TCH/F + * while activating PDCH); and we will PDCH DEACT while in state + * ACTIVATION REQUESTED (we're activating TCH/F while deactivating + * PDCH). */ + /* FIXME: rather switch PDCH while in state NONE, i.e. after + * deactivation of TCH/F and before activation of TCH/F? */ + if (pdch_act) + ok = (lchan->state == LCHAN_S_NONE + || lchan->state == LCHAN_S_REL_REQ); + else + ok = (lchan->state == LCHAN_S_NONE + || lchan->state == LCHAN_S_ACT_REQ); + + if (!ok) { + LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" + " Rx PDCH %s ACK in unexpected state: %s\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + pdch_act? "ACT" : "DEACT", + gsm_lchans_name(lchan->state)); + return false; + } + return true; +} + static int rsl_rx_pdch_act_ack(struct msgb *msg) { + if (!lchan_may_change_pdch(msg->lchan, true)) + return -EINVAL; + msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING; @@ -1214,6 +1265,9 @@ static int rsl_rx_pdch_deact_ack(struct msgb *msg) { + if (!lchan_may_change_pdch(msg->lchan, false)) + return -EINVAL; + msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE; msg->lchan->ts->flags &= ~TS_F_PDCH_DEACT_PENDING; -- To view, visit https://gerrit.osmocom.org/283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:30:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:30:00 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT Message-ID: Review at https://gerrit.osmocom.org/284 dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT Do the PDCH DE/ACT before we set the lchan->state to De-/Activation Requested. It makes more sense semantically to change PDCH mode while the lchan is still in NONE status. Thus slightly move some invocations: PDCH ACT: Free the lchan before PDCH activation. Hence remove the lchan_free() call from the rsl_rx_pdch_act_ack() code path; it used to do the PDCH activation first and call lchan_free() in the callback. PDCH DEACT: Set the (TCH) Activation Requested state only within rsl_chan_activate_lchan(), after the PDCH deact is complete. Channel allocator: don't pick channels that have a PDCH PENDING flag set, to avoid using channels that are still in PDCH switchover (despite their state being NONE). The lchan_may_change_pdch() sanity checks are becoming a lot simpler. Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066 --- M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/chan_alloc.c 2 files changed, 12 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/84/284/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 3aefd9c..fc56862 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -479,6 +479,8 @@ return rsl_ipacc_pdch_activate(lchan->ts, 0); } + rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + ta = lchan->rqd_ta; /* BS11 requires TA shifted by 2 bits */ @@ -756,11 +758,11 @@ gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + do_lchan_free(lchan); + /* Put PDCH channel back into PDCH mode first */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) return rsl_ipacc_pdch_activate(lchan->ts, 1); - - do_lchan_free(lchan); return 0; } @@ -1204,7 +1206,6 @@ static bool lchan_may_change_pdch(struct gsm_lchan *lchan, bool pdch_act) { struct gsm_bts_trx_ts *ts; - bool ok; OSMO_ASSERT(lchan); @@ -1222,22 +1223,7 @@ return false; } - /* During BTS initialization, we expect to PDCH ACT in channel state == - * NONE. However, during dynamic channel switching, we will PDCH ACT - * while in state DEACTIVATION REQUESTED (we're deactivating TCH/F - * while activating PDCH); and we will PDCH DEACT while in state - * ACTIVATION REQUESTED (we're activating TCH/F while deactivating - * PDCH). */ - /* FIXME: rather switch PDCH while in state NONE, i.e. after - * deactivation of TCH/F and before activation of TCH/F? */ - if (pdch_act) - ok = (lchan->state == LCHAN_S_NONE - || lchan->state == LCHAN_S_REL_REQ); - else - ok = (lchan->state == LCHAN_S_NONE - || lchan->state == LCHAN_S_ACT_REQ); - - if (!ok) { + if (lchan->state != LCHAN_S_NONE) { LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" " Rx PDCH %s ACK in unexpected state: %s\n", ts->trx->bts->nr, ts->trx->nr, ts->nr, @@ -1256,9 +1242,6 @@ msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING; - - /* We have activated PDCH, so now the channel is available again. */ - do_lchan_free(msg->lchan); return 0; } @@ -1532,7 +1515,6 @@ return -ENOMEM; } - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); memcpy(lchan->rqd_ref, rqd_ref, sizeof(*rqd_ref)); lchan->rqd_ta = rqd_ta; diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 4715780..f4ed530 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -43,6 +43,13 @@ return 0; } + /* If a dyn PDCH channel is busy changing, it is already taken or not + * yet available. */ + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + if (ts->flags & TS_F_PDCH_PENDING_MASK) + return 0; + } + return 1; } -- To view, visit https://gerrit.osmocom.org/284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:33:37 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:33:37 +0000 Subject: [PATCH] osmo-bts[master]: tests/stubs.c: remove unused stubs Message-ID: Review at https://gerrit.osmocom.org/285 tests/stubs.c: remove unused stubs Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b --- M tests/stubs.c 1 file changed, 0 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/85/285/1 diff --git a/tests/stubs.c b/tests/stubs.c index 17354b7..d6ef263 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -13,11 +13,6 @@ int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int kind, void *obj) { return 0; } -int bts_model_rsl_chan_rel(struct gsm_lchan *lchan) -{ return 0;} - -int bts_model_rsl_deact_sacch(struct gsm_lchan *lchan) -{ return 0; } int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) { return 0; } @@ -30,19 +25,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { return 0; } -int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp) -{ return 0; } -int bts_model_rsl_mode_modify(struct gsm_lchan *lchan) -{ return 0; } -int bts_model_rsl_chan_mod(struct gsm_lchan *lchan) -{ return 0; } -void bts_model_rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl, - unsigned int rtp_pl_len) {} int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) -{ return 0; } - -int l1if_pdch_req(struct gsm_bts_trx_ts *ts, int is_ptcch, uint32_t fn, - uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len) { return 0; } uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) -- To view, visit https://gerrit.osmocom.org/285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:33:37 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:33:37 +0000 Subject: [PATCH] osmo-bts[master]: fix typo in error message ('at lEast') Message-ID: Review at https://gerrit.osmocom.org/286 fix typo in error message ('at lEast') Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f --- M src/common/main.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/286/1 diff --git a/src/common/main.c b/src/common/main.c index d19c284..5e0f1a1 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -287,7 +287,7 @@ } if (!phy_link_by_num(0)) { - fprintf(stderr, "You need to configure at last phy0\n"); + fprintf(stderr, "You need to configure at least phy0\n"); exit(1); } -- To view, visit https://gerrit.osmocom.org/286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:33:37 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:33:37 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warning: printf format for sizeof() -> %PRIuPTR Message-ID: Review at https://gerrit.osmocom.org/287 fix compiler warning: printf format for sizeof() -> %PRIuPTR Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 --- M src/common/cbch.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/287/1 diff --git a/src/common/cbch.c b/src/common/cbch.c index 75bcf28..afe6326 100644 --- a/src/common/cbch.c +++ b/src/common/cbch.c @@ -19,6 +19,7 @@ */ #include +#include #include #include @@ -111,7 +112,7 @@ if (msg_len > sizeof(scm->msg)) { LOGP(DLSMS, LOGL_ERROR, - "Cannot process SMSCB of %u bytes (max %lu)\n", + "Cannot process SMSCB of %u bytes (max %" PRIuPTR ")\n", msg_len, sizeof(scm->msg)); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:33:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:33:38 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warning: add explicit switch default Message-ID: Review at https://gerrit.osmocom.org/288 fix compiler warning: add explicit switch default Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 --- M src/common/phy_link.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/88/288/1 diff --git a/src/common/phy_link.c b/src/common/phy_link.c index 131fd2c..1a21a4e 100644 --- a/src/common/phy_link.c +++ b/src/common/phy_link.c @@ -71,6 +71,9 @@ LOGP(DL1C, LOGL_INFO, "trx_set_avail(0)\n"); trx_set_available(trx, 0); break; + default: + /* nothing to do */ + break; } } -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:33:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:33:38 +0000 Subject: [PATCH] osmo-bts[master]: fix two compiler warnings: add two opaque struct declarations Message-ID: Review at https://gerrit.osmocom.org/289 fix two compiler warnings: add two opaque struct declarations Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025 --- M tests/stubs.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/89/289/1 diff --git a/tests/stubs.c b/tests/stubs.c index d6ef263..aeb7014 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -1,5 +1,8 @@ #include +struct femtol1_hdl; +struct bts_model_set_dyn_pdch_data; + /* * Stubs to provide an empty bts model implementation for testing. * If we ever want to re-define such a symbol we can make them weak -- To view, visit https://gerrit.osmocom.org/289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:39:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:39:17 +0000 Subject: [PATCH] osmo-bts[master]: oml, Set Chan Attr: treat unknown PCHAN types as error Message-ID: Review at https://gerrit.osmocom.org/290 oml, Set Chan Attr: treat unknown PCHAN types as error Change-Id: Id79585993df15362ba0e1271d03302597182ceff --- M src/common/oml.c 1 file changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/90/290/1 diff --git a/src/common/oml.c b/src/common/oml.c index 86ec1bf..bee2f84 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -736,8 +736,9 @@ lchan->type = GSM_LCHAN_PDTCH; break; default: - /* FIXME */ - break; + LOGP(DOML, LOGL_ERROR, "Unknown/unhandled PCHAN type: %u %s\n", + ts->pchan, gsm_pchan_name(ts->pchan)); + return -NM_NACK_PARAM_RANGE; } return 0; } @@ -790,7 +791,12 @@ if (TLVP_PRESENT(&tp, NM_ATT_CHAN_COMB)) { uint8_t comb = *TLVP_VAL(&tp, NM_ATT_CHAN_COMB); ts->pchan = abis_nm_pchan4chcomb(comb); - conf_lchans_for_pchan(ts); + rc = conf_lchans_for_pchan(ts); + if (rc < 0) { + talloc_free(tp_merged); + /* Send NACK */ + return oml_fom_ack_nack(msg, -rc); + } } /* 9.4.5 ARFCN List */ -- To view, visit https://gerrit.osmocom.org/290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id79585993df15362ba0e1271d03302597182ceff Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:45:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:45:20 +0000 Subject: [PATCH] osmo-bts[master]: pcu_sock: add pcu_connected() to query PCU availability Message-ID: Review at https://gerrit.osmocom.org/291 pcu_sock: add pcu_connected() to query PCU availability Will be used in upcoming dyn PDCH switching. Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a --- M include/osmo-bts/pcu_if.h M src/common/pcu_sock.c 2 files changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/91/291/1 diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 0c4fb69..3ce4d0b 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -19,4 +19,6 @@ int pcu_sock_init(const char *path); void pcu_sock_exit(void); +bool pcu_connected(void); + #endif /* _PCU_IF_H */ diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 7c835fb..ea4267d 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -922,3 +922,13 @@ return 0; } +bool pcu_connected(void) { + struct gsm_network *net = &bts_gsmnet; + struct pcu_sock_state *state = net->pcu_state; + + if (!state) + return false; + if (state->conn_bfd.fd <= 0) + return false; + return true; +} -- To view, visit https://gerrit.osmocom.org/291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:45:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:45:21 +0000 Subject: [PATCH] osmo-bts[master]: rsl rx dchan: also log ip.access message names like PDCH DE/ACT Message-ID: Review at https://gerrit.osmocom.org/292 rsl rx dchan: also log ip.access message names like PDCH DE/ACT The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan() should be able to log ip.access message types properly. Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f --- M src/common/rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/292/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index dddde69..7e8d48c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1838,13 +1838,13 @@ msg->lchan = rsl_lchan_lookup(trx, dch->chan_nr); if (!msg->lchan) { LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknow lchan\n", - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); msgb_free(msg); return report_error(trx); } LOGP(DRSL, LOGL_INFO, "%s Rx RSL %s\n", gsm_lchan_name(msg->lchan), - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); switch (dch->c.msg_type) { case RSL_MT_CHAN_ACTIV: -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:45:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:45:21 +0000 Subject: [PATCH] osmo-bts[master]: oml: handle TCH/F_PDCH (as TCH/F) in conf_lchans_for_pchan() Message-ID: Review at https://gerrit.osmocom.org/293 oml: handle TCH/F_PDCH (as TCH/F) in conf_lchans_for_pchan() Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 --- M src/common/oml.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/293/1 diff --git a/src/common/oml.c b/src/common/oml.c index 86ec1bf..db0dea7 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -708,6 +708,8 @@ lchan = &ts->lchan[4]; lchan->type = GSM_LCHAN_CCCH; break; + case GSM_PCHAN_TCH_F_PDCH: + /* fall through, intially handle dyn PDCH as TCH/F */ case GSM_PCHAN_TCH_F: lchan = &ts->lchan[0]; lchan->type = GSM_LCHAN_TCH_F; -- To view, visit https://gerrit.osmocom.org/293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:45:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:45:21 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH Message-ID: Review at https://gerrit.osmocom.org/294 cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f --- M src/osmo-bts-sysmo/oml.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/294/1 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 6951f84..60ab7a8 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -525,6 +525,7 @@ case GSM_PCHAN_CCCH: case GSM_PCHAN_TCH_F: case GSM_PCHAN_PDCH: + case GSM_PCHAN_TCH_F_PDCH: case GSM_PCHAN_UNKNOWN: default: return GsmL1_SubCh_NA; -- To view, visit https://gerrit.osmocom.org/294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 02:45:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 02:45:21 +0000 Subject: [PATCH] osmo-bts[master]: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect()... Message-ID: Review at https://gerrit.osmocom.org/295 sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically upon ts_connect(). Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan) and leave ts_connect() as a thin wrapper to leave init code unchanged. Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 --- M src/osmo-bts-sysmo/oml.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/295/1 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 60ab7a8..7ce94f1 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -480,7 +480,7 @@ } } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config pchan) { struct msgb *msg = l1p_msgb_alloc(); struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); @@ -489,11 +489,16 @@ cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; - cr->logChComb = pchan_to_logChComb[ts->pchan]; + cr->logChComb = pchan_to_logChComb[pchan]; return l1if_gsm_req_compl(fl1h, msg, opstart_compl_cb, NULL); } +static int ts_connect(struct gsm_bts_trx_ts *ts) +{ + return ts_connect_as(ts, ts->pchan); +} + GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan) { switch (lchan->type) { -- To view, visit https://gerrit.osmocom.org/295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 08:56:48 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 08:56:48 +0000 Subject: [PATCH] osmo-bts[master]: TRX: Add vty command to power on/off transceiver In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/278 to look at the new patch set (#2). TRX: Add vty command to power on/off transceiver Add vty command (under "phy X instance Y" hierarchy) to manually send POWERON or POWEROFF command. It's useful for debugging issues related to BTS/TRX initialization. Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Related: OS#1648 --- M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_vty.c 2 files changed, 23 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/278/2 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a4c16dc..0cb5eda 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -195,9 +195,10 @@ va_list ap; int l, pending = 0; - if (!transceiver_available && !!strcmp(cmd, "POWEROFF")) { - LOGP(DTRX, LOGL_ERROR, "CTRL ignored: No clock from " - "transceiver, please fix!\n"); + if (!transceiver_available && + !(!strcmp(cmd, "POWEROFF") || !strcmp(cmd, "POWERON"))) { + LOGP(DTRX, LOGL_ERROR, "CTRL %s ignored: No clock from " + "transceiver, please fix!\n", cmd); return -EIO; } diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index d2feea4..3aec8ba 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -273,6 +273,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_power_on, cfg_phy_power_on_cmd, + "osmotrx power (on|off)", + OSMOTRX_STR + "Change TRX state\n" + "Turn it ON or OFF\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + if (strcmp(argv[0], "on")) + vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); + else { + vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); + settsc_enabled = 1; + } + + return CMD_SUCCESS; +} DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd, "osmotrx fn-advance <0-30>", @@ -499,6 +517,7 @@ install_element(PHY_NODE, &cfg_phy_no_tx_atten_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_slotmask_cmd); + install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd); -- To view, visit https://gerrit.osmocom.org/278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 10:44:14 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 10:44:14 +0000 Subject: [PATCH] osmo-bts[master]: Fix OML activation Message-ID: Review at https://gerrit.osmocom.org/296 Fix OML activation Previously software activation could have been reported multiple times which broke proper BTS init. Introduce guard variable to ensure reporting happens only once. Note: this is just minimal workaround - ideally proper OML state machine should be implemented. Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Related: OS#1648 --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/trx_if.c 3 files changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/296/1 diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index b3db4ce..82e73c8 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -94,6 +95,7 @@ } sysmobts; struct { struct trx_l1h *hdl; + bool sw_act_reported; } osmotrx; struct { /* logical transceiver number within one PHY */ diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index befaffd..8ccba90 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -23,10 +23,12 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -106,9 +108,12 @@ if (avail) { /* signal availability */ oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); - oml_mo_tx_sw_act_rep(&trx->mo); oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); - oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + if (!pinst->u.osmotrx.sw_act_reported) { + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + pinst->u.osmotrx.sw_act_reported = true; + } for (tn = 0; tn < TRX_NR_TS; tn++) oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, @@ -685,7 +690,8 @@ void *obj) { int rc; - + LOGP(DOML, LOGL_DEBUG, "bts_model_opstart: %s received\n", + get_value_string(abis_nm_obj_class_names, mo->obj_class)); switch (mo->obj_class) { case NM_OC_RADIO_CARRIER: /* activate transceiver */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a4c16dc..c448006 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -518,7 +518,9 @@ if (!pinst->u.osmotrx.hdl) goto cleanup; } - + /* FIXME: is there better way to check/report TRX availability? */ + transceiver_available = 1; + phy_link_state_set(plink, PHY_LINK_CONNECTED); return 0; cleanup: -- To view, visit https://gerrit.osmocom.org/296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 11:21:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 11:21:13 +0000 Subject: osmo-bts[master]: sysmo: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Patch Set 2: > (1 comment) why? to make sure that a hLayer3 is applied? I have since noticed that some of the messages were already using hLayer3. After the current patch, the prim_init() sets a hLayer3 which is overwritten shortly after that, so the other functionality is not affected by this patch. Some functions to generate hLayer3 for a timeslot and similar already existed, and also to retrieve a timeslot and similar back from a hLayer3 handle. And also, the other hLayer3 functions use a "magic" byte (like the most significant byte always set to 0xbb). So in fact, we should have rejected this patch, and I should follow up with a merger of my hLayer3 to the existing hLayer3 infrastructure. The priority is low though, since no harm is done. -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 11:21:32 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 11:21:32 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/201 to look at the new patch set (#4). Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new subscriber-create-no-extension vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Fixes: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 11 files changed, 153 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/4 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ad..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e7cd520..f61ed4e 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -22,7 +23,6 @@ #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] enum gsm_subscr_creation_mode { - GSM_SUBSCR_DONT_CREATE = 0, GSM_SUBSCR_CREAT_W_RAND_EXT = 1, GSM_SUBSCR_CREAT_W_REGEXP = 2, }; @@ -290,6 +290,8 @@ /* subscriber related features */ int subscr_creation_mode; + bool auto_create_subscr; + bool auto_assign_exten; uint64_t ext_min; uint64_t ext_max; struct gsm_subscriber_group *subscr_group; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 3cba5d1..3d7c244 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -5,6 +5,8 @@ #include #include +#include + #define GSM_NAME_LENGTH 160 #define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */ @@ -90,8 +92,7 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax); + const char *imsi); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4636d57..c3095c4 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -21,6 +21,8 @@ #include #include +#include + struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code, int (*mncc_recv)(struct gsm_network *, struct msgb *)) { @@ -49,6 +51,8 @@ net->subscr_group->net = net; net->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + net->auto_create_subscr = true; + net->auto_assign_exten = true; net->country_code = country_code; net->network_code = network_code; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index a02db36..79e136d 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -25,6 +25,8 @@ #include #include +#include + static bool alg_supported(const char *alg) { /* @@ -96,9 +98,7 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi, - net->ext_min, - net->ext_max); + subscr = subscr_create_subscriber(net->subscr_group, imsi); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index b367139..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ } struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -551,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr, smin, smax); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -956,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1062,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..b588bed 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -530,15 +530,14 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { - if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) + if (!net->auto_create_subscr) return NULL; - if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP) + if (net->subscr_creation_mode == GSM_SUBSCR_CREAT_W_REGEXP) if (!subscr_regexp_check(net, imsi)) return NULL; - return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + return subscr_create_subscriber(net->subscr_group, imsi); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1dc2cc2..08198c7 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -203,10 +204,12 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax) + const char *imsi) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, + sgrp->net->ext_min, + sgrp->net->ext_max, + sgrp->net->auto_assign_exten); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index a035bf9..1c2b5f6 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -242,9 +242,7 @@ if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], - gsmnet->ext_min, - gsmnet->ext_max); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1044,6 +1042,8 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = true; if (mi >= ma) { vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", argv[0], argv[1], VTY_NEWLINE); @@ -1054,16 +1054,29 @@ return CMD_SUCCESS; } +DEFUN(cfg_nitb_subscr_noext, cfg_nitb_subscr_noext_cmd, + "subscriber-create-no-extension", + "Do not assign extension when creating subscriber on demand.\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->auto_assign_exten = false; + return CMD_SUCCESS; +} + DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, - "subscriber-create-on-demand [regexp]", + "subscriber-create-on-demand [regexp] [noextension]", "Make a new record when a subscriber is first seen.\n" "Create subscribers only if IMSI matches the regexp specified in " - "authorized-regexp command\n") + "authorized-regexp command\n" + "Do not automatically assign extension to created subscribers\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = (argc > 1) ? false : true; if (argc) - gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; + gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_REGEXP; + else + gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; return CMD_SUCCESS; } @@ -1072,7 +1085,7 @@ NO_STR "Make a new record when a subscriber is first seen.\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_DONT_CREATE; + gsmnet->auto_create_subscr = false; return CMD_SUCCESS; } @@ -1098,11 +1111,23 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); enum gsm_subscr_creation_mode scm = gsmnet->subscr_creation_mode; - const char *reg = (scm & GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", - *pref = scm ? "" : "no "; + vty_out(vty, "nitb%s", VTY_NEWLINE); - vty_out(vty, " %ssubscriber-create-on-demand%s%s", - pref, reg, VTY_NEWLINE); + if (!gsmnet->auto_create_subscr) + vty_out(vty, " no subscriber-create-on-demand%s", VTY_NEWLINE); + else { + vty_out(vty, " subscriber-create-on-demand"); + if (scm == GSM_SUBSCR_CREAT_W_REGEXP) { + vty_out(vty, " regexp"); + if(!gsmnet->auto_assign_exten) + vty_out(vty, " noextension"); + } + vty_out(vty, "%s", VTY_NEWLINE); + } + + if(!gsmnet->auto_assign_exten) + vty_out(vty, " subscriber-create-no-extension%s", VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, @@ -1162,6 +1187,7 @@ install_node(&nitb_node, config_write_nitb); install_element(NITB_NODE, &cfg_nitb_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_subscr_random_cmd); + install_element(NITB_NODE, &cfg_nitb_subscr_noext_cmd); install_element(NITB_NODE, &cfg_nitb_no_subscr_create_cmd); install_element(NITB_NODE, &cfg_nitb_assign_tmsi_cmd); install_element(NITB_NODE, &cfg_nitb_no_assign_tmsi_cmd); diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index dc81481..755a6e9 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *imsi, char *imei1, char *imei2, bool make_ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + make_ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -177,7 +179,7 @@ COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by IMSI */ - alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice_imsi); + alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by id */ @@ -187,8 +189,14 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + if (!make_ext) + printf("FAIL: bogus extension created for IMSI %s\n", + imsi); + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } else if (make_ext) + printf("FAIL: no subscriber extension for IMSI %s\n", imsi); SUBSCR_PUT(alice); } @@ -217,18 +225,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..cf02739 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -245,6 +245,7 @@ self.vty.command("nitb") self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) self.assertTrue(self.vty.verify("subscriber-create-on-demand regexp", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand regexp noextension", [''])) self.vty.command("end") def testSi2Q(self): @@ -400,6 +401,9 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913762" + imsi3 = "100500854113763" + imsi4 = "100583744053764" # Initially we don't have this subscriber self.vty.verify('show subscriber imsi '+imsi, ['% No subscriber found for imsi '+imsi]) @@ -407,14 +411,60 @@ # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) # Now we have it res = self.vty.command('show subscriber imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-no-extension", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi3) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi4) + self.assert_(res != "") # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 11:28:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 11:28:29 +0000 Subject: osmo-bts[master]: sysmo: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Patch Set 2: > So in fact, we should have rejected this patch http://osmocom.org/issues/1755 -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 12:35:04 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 12:35:04 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 4: On a 2nd thought, if we have not made "authorize regexp" change part of any release yet, than I can drop regexp keyword, switch it on by default with regexp '*' for backward compatibility and simplify this patch quite a bit. What do you think? -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 12:40:21 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 12:40:21 +0000 Subject: [PATCH] libosmocore[master]: Add missing names for Abis NM objects Message-ID: Review at https://gerrit.osmocom.org/297 Add missing names for Abis NM objects Change-Id: I742c6a1965c4da6623b08637639b1fe4d285d42c --- M src/gsm/abis_nm.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/297/1 diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c index 6a1831c..469f95f 100644 --- a/src/gsm/abis_nm.c +++ b/src/gsm/abis_nm.c @@ -344,6 +344,10 @@ /*! \brief Human-readable strings for A-bis OML Object Class */ const struct value_string abis_nm_obj_class_names[] = { + { NM_OC_IPAC_E1_TRUNK, "IPAC E1-TRUNK" }, + { NM_OC_IPAC_E1_PORT, "IPAC E1-PORT" }, + { NM_OC_IPAC_E1_CHAN, "IPAC E1-CHAN" }, + { NM_OC_IPAC_CLK_MODULE,"IPAC CLK-MODULE" }, { NM_OC_SITE_MANAGER, "SITE-MANAGER" }, { NM_OC_BTS, "BTS" }, { NM_OC_RADIO_CARRIER, "RADIO-CARRIER" }, -- To view, visit https://gerrit.osmocom.org/297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I742c6a1965c4da6623b08637639b1fe4d285d42c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:20:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:20:54 -0000 Subject: osmo-bts[master]: Fix OML activation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:21:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:21:29 -0000 Subject: osmo-bts[master]: TRX: Add vty command to power on/off transceiver In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:29:03 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 13:29:03 -0000 Subject: libosmocore[master]: Add missing names for Abis NM objects In-Reply-To: References: Message-ID: Patch Set 1: I have not changed numeric values - just added corresponding strings for the sake of completeness. So this patch should not break anything unless some code uses abis_nm_obj_class_names for anything other than debug printing. If that's the case than we should not merge it of course. -- To view, visit https://gerrit.osmocom.org/297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I742c6a1965c4da6623b08637639b1fe4d285d42c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:30:16 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:30:16 -0000 Subject: openbsc[master]: dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:31:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:31:01 -0000 Subject: openbsc[master]: dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:31:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:31:45 -0000 Subject: openbsc[master]: dyn PDCH: track pending PDCH de-/activation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:32:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:32:59 -0000 Subject: openbsc[master]: dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:39:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:39:27 -0000 Subject: openbsc[master]: dyn PDCH: TS flags: rename one, add three, as enum In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:39:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:39:37 -0000 Subject: [MERGED] osmo-bts[master]: Fix OML activation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix OML activation ...................................................................... Fix OML activation Previously software activation could have been reported multiple times which broke proper BTS init. Introduce guard variable to ensure reporting happens only once. Note: this is just minimal workaround - ideally proper OML state machine should be implemented. Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Related: OS#1648 --- M include/osmo-bts/phy_link.h M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/trx_if.c 3 files changed, 14 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h index b3db4ce..82e73c8 100644 --- a/include/osmo-bts/phy_link.h +++ b/include/osmo-bts/phy_link.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -94,6 +95,7 @@ } sysmobts; struct { struct trx_l1h *hdl; + bool sw_act_reported; } osmotrx; struct { /* logical transceiver number within one PHY */ diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index befaffd..8ccba90 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -23,10 +23,12 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -106,9 +108,12 @@ if (avail) { /* signal availability */ oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); - oml_mo_tx_sw_act_rep(&trx->mo); oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); - oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + if (!pinst->u.osmotrx.sw_act_reported) { + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + pinst->u.osmotrx.sw_act_reported = true; + } for (tn = 0; tn < TRX_NR_TS; tn++) oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, @@ -685,7 +690,8 @@ void *obj) { int rc; - + LOGP(DOML, LOGL_DEBUG, "bts_model_opstart: %s received\n", + get_value_string(abis_nm_obj_class_names, mo->obj_class)); switch (mo->obj_class) { case NM_OC_RADIO_CARRIER: /* activate transceiver */ diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a4c16dc..c448006 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -518,7 +518,9 @@ if (!pinst->u.osmotrx.hdl) goto cleanup; } - + /* FIXME: is there better way to check/report TRX availability? */ + transceiver_available = 1; + phy_link_state_set(plink, PHY_LINK_CONNECTED); return 0; cleanup: -- To view, visit https://gerrit.osmocom.org/296 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:39:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:39:42 -0000 Subject: [MERGED] osmo-bts[master]: TRX: Add vty command to power on/off transceiver In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: Add vty command to power on/off transceiver ...................................................................... TRX: Add vty command to power on/off transceiver Add vty command (under "phy X instance Y" hierarchy) to manually send POWERON or POWEROFF command. It's useful for debugging issues related to BTS/TRX initialization. Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Related: OS#1648 --- M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_vty.c 2 files changed, 23 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index c448006..04d8fea 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -195,9 +195,10 @@ va_list ap; int l, pending = 0; - if (!transceiver_available && !!strcmp(cmd, "POWEROFF")) { - LOGP(DTRX, LOGL_ERROR, "CTRL ignored: No clock from " - "transceiver, please fix!\n"); + if (!transceiver_available && + !(!strcmp(cmd, "POWEROFF") || !strcmp(cmd, "POWERON"))) { + LOGP(DTRX, LOGL_ERROR, "CTRL %s ignored: No clock from " + "transceiver, please fix!\n", cmd); return -EIO; } diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index d2feea4..3aec8ba 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -273,6 +273,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_phy_power_on, cfg_phy_power_on_cmd, + "osmotrx power (on|off)", + OSMOTRX_STR + "Change TRX state\n" + "Turn it ON or OFF\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + if (strcmp(argv[0], "on")) + vty_out(vty, "OFF: %d%s", trx_if_cmd_poweroff(l1h), VTY_NEWLINE); + else { + vty_out(vty, "ON: %d%s", trx_if_cmd_poweron(l1h), VTY_NEWLINE); + settsc_enabled = 1; + } + + return CMD_SUCCESS; +} DEFUN(cfg_phy_fn_advance, cfg_phy_fn_advance_cmd, "osmotrx fn-advance <0-30>", @@ -499,6 +517,7 @@ install_element(PHY_NODE, &cfg_phy_no_tx_atten_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_slotmask_cmd); + install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd); -- To view, visit https://gerrit.osmocom.org/278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:42:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:42:02 -0000 Subject: osmo-bts[master]: doc: add ladder diagram on dynamic PDCH, add msc-README In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:42:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:42:27 -0000 Subject: osmo-bts[master]: tests/stubs.c: remove unused stubs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:43:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:43:31 -0000 Subject: osmo-bts[master]: fix typo in error message ('at lEast') In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/286/1//COMMIT_MSG Commit Message: PS1, Line 7: 'at lEast') it's supposed to mean a l'Est ? SCNR. -- To view, visit https://gerrit.osmocom.org/286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:43:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:43:47 -0000 Subject: osmo-bts[master]: fix two compiler warnings: add two opaque struct declarations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:55:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:55:02 -0000 Subject: osmo-bts[master]: fix compiler warning: add explicit switch default In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/288/1/src/common/phy_link.c File src/common/phy_link.c: Line 74: default: I'd prefer an explicit PHY_LINK_CONNECTING here. This way, if new states are introduced, people get a reminder in form of a compiler warning that the new state should be considered in the respective switch statements. -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:57:08 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 13:57:08 -0000 Subject: [PATCH] osmo-bts[master]: Add .gitreview Message-ID: Review at https://gerrit.osmocom.org/298 Add .gitreview Similar to other projects, add helper file for "git review" command. More information: https://www.mediawiki.org/wiki/Gerrit/git-review Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/298/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..2fcadd2 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-bts -- To view, visit https://gerrit.osmocom.org/298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:00:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:00:48 -0000 Subject: osmo-bts[master]: fix compiler warning: printf format for sizeof() -> %PRIuPTR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 the usual format string for [s]size_t is %z / %zu, isn't it? Seems much shorter and more convenient... -- To view, visit https://gerrit.osmocom.org/287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:01:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:01:08 -0000 Subject: osmo-bts[master]: fix compiler warning: add explicit switch default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:01:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:01:13 -0000 Subject: osmo-bts[master]: fix compiler warning: add explicit switch default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:01:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:01:34 -0000 Subject: osmo-bts[master]: Add .gitreview In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:01:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:01:53 -0000 Subject: osmo-bts[master]: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:02:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:02:22 -0000 Subject: osmo-bts[master]: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect()... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:02:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:02:36 -0000 Subject: osmo-bts[master]: oml: handle TCH/F_PDCH (as TCH/F) in conf_lchans_for_pchan() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:02:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:02:52 -0000 Subject: osmo-bts[master]: rsl rx dchan: also log ip.access message names like PDCH DE/ACT In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:04:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:04:40 -0000 Subject: osmo-bts[master]: pcu_sock: add pcu_connected() to query PCU availability In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:06:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:06:56 -0000 Subject: osmo-bts[master]: oml, Set Chan Attr: treat unknown PCHAN types as error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id79585993df15362ba0e1271d03302597182ceff Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:08:45 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 16 Jun 2016 14:08:45 -0000 Subject: osmo-bts[master]: sysmo: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/264/2/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 143: return 0; > It would be nice if '0' wouldn't be a legal hLayer3 handle. The reason is that '0' is a valid BTS Nr, TRX Nr, TS NO, Lchan Num. So you can not distinguish zero initialized, zero default from valid lchan? I would have sacrificed the limit of 256 BTS and set the MSB to distinguish valid from invalid numbers. -- To view, visit https://gerrit.osmocom.org/264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:15:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:15:58 -0000 Subject: libosmocore[master]: Add missing names for Abis NM objects In-Reply-To: References: Message-ID: Patch Set 1: > I have not changed numeric values - just added corresponding > strings for the sake of completeness. So this patch should not > break anything unless some code uses abis_nm_obj_class_names for > anything other than debug printing. If that's the case than we > should not merge it of course. The point is: The original values could be overlapping numerically. Every BTS manufacturer is using partially different and possibly ovrelapping values. two #defines could thus map to the same integer. So you have to manually check for that before writing such patches. -- To view, visit https://gerrit.osmocom.org/297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I742c6a1965c4da6623b08637639b1fe4d285d42c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 13:19:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 13:19:08 -0000 Subject: libosmocore[master]: Add missing names for Abis NM objects In-Reply-To: References: Message-ID: Patch Set 1: did you actually encounter any of them anywhere? Those are ip.access specific managed objects, and they related to E1 interfaces. I've never seen any ip.access BTS with E1. Also, did you verify that the ip.access MO numeric values are not overlapping with any of the other MO numeric values? In that case this "improvement" might actually break things, as the new strings might match the MO numeric value before the existing values... -- To view, visit https://gerrit.osmocom.org/297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I742c6a1965c4da6623b08637639b1fe4d285d42c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:17:16 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:17:16 -0000 Subject: osmo-pcu[master]: Remove GMSK only check in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:17:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:17:17 -0000 Subject: [MERGED] osmo-pcu[master]: Remove GMSK only check in EGPRS UL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove GMSK only check in EGPRS UL ...................................................................... Remove GMSK only check in EGPRS UL Since we are supporting MCS 5-9 in this patch series for EGPRS UL, This condition is not relevant. So removing it. Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Reviewed-on: https://gerrit.osmocom.org/268 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/bts.cpp 1 file changed, 0 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 9e91b87..8692065 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1344,15 +1344,6 @@ cs.name()); return -EINVAL; } - - if (!cs.isEgprsGmsk()) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not implemented " - "for 8PSK yet\n", - cs.name()); - bts()->decode_error(); - return -EINVAL; - } } LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); -- To view, visit https://gerrit.osmocom.org/268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I567acc012d8ad49681715f0104ba7e91625e1e7a Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:18:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:18:49 -0000 Subject: osmo-pcu[master]: Add Header Type2 support in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:18:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:18:54 -0000 Subject: [MERGED] osmo-pcu[master]: Add Header Type2 support in EGPRS UL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add Header Type2 support in EGPRS UL ...................................................................... Add Header Type2 support in EGPRS UL This patch will add support for MCS5,6 in EGPRS UL along with incorrect assert correction to let MCS 6 work. Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba Reviewed-on: https://gerrit.osmocom.org/269 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M src/decoding.cpp M src/decoding.h M src/tbf_ul.cpp 3 files changed, 54 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/decoding.cpp b/src/decoding.cpp index 2600879..e1f8134 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -353,9 +353,11 @@ case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3 : cur_bit = rlc_parse_ul_data_header_egprs_type_3(rlc, data, cs); break; - case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1: - case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2: - /* TODO: Support both header types */ + case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2 : + cur_bit = rlc_parse_ul_data_header_egprs_type_2(rlc, data, cs); + break; + case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1 : + /* TODO: Support both header type 1 */ /* fall through */ default: LOGP(DRLCMACDL, LOGL_ERROR, @@ -409,6 +411,50 @@ return cur_bit; } +int Decoding::rlc_parse_ul_data_header_egprs_type_2( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs) +{ + const struct gprs_rlc_ul_header_egprs_2 *egprs2; + unsigned int e_ti_header, offs, cur_bit = 0; + int punct, punct2, with_padding, cps; + + egprs2 = static_cast < struct gprs_rlc_ul_header_egprs_2 * > + ((void *)data); + + cps = (egprs2->cps_a << 0) | (egprs2->cps_b << 2); + gprs_rlc_mcs_cps_decode(cps, cs, &punct, &punct2, &with_padding); + gprs_rlc_data_info_init_ul(rlc, cs, with_padding); + + rlc->r = egprs2->r; + rlc->si = egprs2->si; + rlc->tfi = (egprs2->tfi_a << 0) | (egprs2->tfi_b << 2); + rlc->cps = cps; + rlc->rsb = egprs2->rsb; + + rlc->num_data_blocks = 1; + rlc->block_info[0].cv = egprs2->cv; + rlc->block_info[0].pi = egprs2->pi; + rlc->block_info[0].bsn = + (egprs2->bsn1_a << 0) | (egprs2->bsn1_b << 5); + + cur_bit += rlc->data_offs_bits[0] - 2; + + offs = rlc->data_offs_bits[0] / 8; + OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 7); + + e_ti_header = (data[offs] & 0x60) >> 5; + rlc->block_info[0].e = !!(e_ti_header & 0x01); + rlc->block_info[0].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + + /* skip data area */ + cur_bit += cs.maxDataBlockBytes() * 8; + + return cur_bit; +} + int Decoding::rlc_parse_ul_data_header_gprs(struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs) { diff --git a/src/decoding.h b/src/decoding.h index 50c9e7d..736adf1 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -48,6 +48,10 @@ struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs); + static int rlc_parse_ul_data_header_egprs_type_2( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs); static int rlc_parse_ul_data_header_gprs( struct gprs_rlc_data_info *rlc, const uint8_t *data, diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 98962d1..4d283a9 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -225,7 +225,7 @@ block = m_rlc.block(rdbi->bsn); block->block_info = *rdbi; block->cs = rlc->cs; - OSMO_ASSERT(rdbi->data_len < sizeof(block->block)); + OSMO_ASSERT(rdbi->data_len <= sizeof(block->block)); rlc_data = &(block->block[0]); /* TODO: Handle SPB != 0 -> Set length to 2*len, add offset if * 2nd part. Note that resegmentation is currently disabled -- To view, visit https://gerrit.osmocom.org/269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac2422c8acbdcefe20aafbba6a4eb87c9893e3ba Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:21:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:21:39 -0000 Subject: osmo-pcu[master]: Add header type 1 support for EGPRS uplink In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:32:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 14:32:08 -0000 Subject: [MERGED] osmo-pcu[master]: Add header type 1 support for EGPRS uplink In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add header type 1 support for EGPRS uplink ...................................................................... Add header type 1 support for EGPRS uplink Function is added to parse the EGPRS header type 1 in uplink tbf path. along with configuration parameter updation to reflect max mcs in UL Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a Reviewed-on: https://gerrit.osmocom.org/270 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M src/bts.h M src/decoding.cpp M src/decoding.h M src/encoding.cpp M src/gprs_ms.cpp M src/pcu_main.cpp 6 files changed, 75 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.h b/src/bts.h index a713c46..807ce08 100644 --- a/src/bts.h +++ b/src/bts.h @@ -41,6 +41,8 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) +#define MAX_GPRS_CS 9 + struct BTS; struct GprsMs; @@ -188,7 +190,7 @@ uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; uint8_t cs_adj_lower_limit; - struct {int16_t low; int16_t high;} cs_lqual_ranges[4]; + struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS]; uint16_t cs_downgrade_threshold; /* downgrade if less packets left (DL) */ uint16_t ws_base; uint16_t ws_pdch; /* increase WS by this value per PDCH */ diff --git a/src/decoding.cpp b/src/decoding.cpp index e1f8134..7865be0 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -357,8 +357,8 @@ cur_bit = rlc_parse_ul_data_header_egprs_type_2(rlc, data, cs); break; case GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_1 : - /* TODO: Support both header type 1 */ - /* fall through */ + cur_bit = rlc_parse_ul_data_header_egprs_type_1(rlc, data, cs); + break; default: LOGP(DRLCMACDL, LOGL_ERROR, "Decoding of uplink %s data blocks not yet supported.\n", @@ -455,6 +455,65 @@ return cur_bit; } +int Decoding::rlc_parse_ul_data_header_egprs_type_1( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, const GprsCodingScheme &cs) +{ + struct gprs_rlc_ul_header_egprs_1 *egprs1; + unsigned int e_ti_header, cur_bit = 0, offs; + int punct, punct2, with_padding; + + egprs1 = static_cast < struct gprs_rlc_ul_header_egprs_1 * > + ((void *)data); + gprs_rlc_mcs_cps_decode(egprs1->cps, cs, &punct, &punct2, + &with_padding); + gprs_rlc_data_info_init_ul(rlc, cs, with_padding); + + rlc->r = egprs1->r; + rlc->si = egprs1->si; + rlc->tfi = (egprs1->tfi_a << 0) | (egprs1->tfi_b << 2); + rlc->cps = egprs1->cps; + rlc->rsb = egprs1->rsb; + rlc->num_data_blocks = 2; + rlc->block_info[0].cv = egprs1->cv; + rlc->block_info[0].pi = egprs1->pi; + rlc->block_info[0].bsn = + (egprs1->bsn1_a << 0) | (egprs1->bsn1_b << 5); + + cur_bit += rlc->data_offs_bits[0] - 2; + offs = rlc->data_offs_bits[0] / 8; + OSMO_ASSERT(rlc->data_offs_bits[0] % 8 == 0); + + e_ti_header = data[offs - 1] >> 6; + rlc->block_info[0].e = (e_ti_header & 0x01); + rlc->block_info[0].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + + rlc->block_info[1].cv = egprs1->cv; + rlc->block_info[1].pi = egprs1->pi; + rlc->block_info[1].bsn = rlc->block_info[0].bsn + + ((egprs1->bsn2_a << 0) | (egprs1->bsn2_b << 2)); + rlc->block_info[1].bsn = rlc->block_info[1].bsn & (RLC_EGPRS_SNS - 1); + + if ((rlc->block_info[1].bsn != rlc->block_info[0].bsn) && + (rlc->block_info[0].cv == 0)) + rlc->block_info[0].cv = 1; + + cur_bit = rlc->data_offs_bits[1] - 2; + + offs = rlc->data_offs_bits[1] / 8; + OSMO_ASSERT(rlc->data_offs_bits[1] % 8 == 2); + + e_ti_header = (data[offs] & (0x03)); + rlc->block_info[1].e = (e_ti_header & 0x01); + rlc->block_info[1].ti = !!(e_ti_header & 0x02); + cur_bit += 2; + /* skip data area */ + cur_bit += cs.maxDataBlockBytes() * 8; + + return cur_bit; +} + int Decoding::rlc_parse_ul_data_header_gprs(struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs) { diff --git a/src/decoding.h b/src/decoding.h index 736adf1..d1371d5 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -52,6 +52,10 @@ struct gprs_rlc_data_info *rlc, const uint8_t *data, const GprsCodingScheme &cs); + static int rlc_parse_ul_data_header_egprs_type_1( + struct gprs_rlc_data_info *rlc, + const uint8_t *data, + const GprsCodingScheme &cs); static int rlc_parse_ul_data_header_gprs( struct gprs_rlc_data_info *rlc, const uint8_t *data, diff --git a/src/encoding.cpp b/src/encoding.cpp index 2102a1e..e174c80 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -610,8 +610,9 @@ struct gprs_rlcmac_ul_tbf *tbf, bool is_final) { bitvec_write_field(dest, wp, 0, 2); // fixed 00 - bitvec_write_field(dest, wp, 2, 4); // CHANNEL_CODING_COMMAND: MCS-3 - // bitvec_write_field(dest, wp, tbf->current_cs() - 1, 4); // CHANNEL_CODING_COMMAND + /* CHANNEL_CODING_COMMAND */ + bitvec_write_field(dest, wp, + tbf->current_cs().to_num() - 1, 4); bitvec_write_field(dest, wp, 0, 1); // 0: no RESEGMENT (nyi) bitvec_write_field(dest, wp, 1, 1); // PRE_EMPTIVE_TRANSMISSION, TODO: This resembles GPRS, change it? bitvec_write_field(dest, wp, 0, 1); // 0: no PRR_RETRANSMISSION_REQUEST, TODO: clarify diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 4296fd3..4f71892 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -632,8 +632,8 @@ high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else if (m_current_cs_ul.isEgprs()) { /* TODO, use separate table */ - if (current_cs_num > 4) - current_cs_num = 4; + if (current_cs_num > MAX_GPRS_CS) + current_cs_num = MAX_GPRS_CS; low = bts_data->cs_lqual_ranges[current_cs_num-1].low; high = bts_data->cs_lqual_ranges[current_cs_num-1].high; } else { diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index f66c631..2d86cda 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -189,8 +189,8 @@ bts->cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */ bts->max_cs_ul = 4; bts->max_cs_dl = 4; - bts->max_mcs_ul = 4; - bts->max_mcs_dl = 4; + bts->max_mcs_ul = MAX_GPRS_CS; + bts->max_mcs_dl = MAX_GPRS_CS; /* CS-1 to CS-4 */ bts->cs_lqual_ranges[0].low = -256; bts->cs_lqual_ranges[0].high = 6; -- To view, visit https://gerrit.osmocom.org/270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13c250e2e07377982ac3f29745f3cffd4088552a Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:53:41 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 14:53:41 -0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: > Let's review the radisys osmo-pcu repository and coordinate with > them on what they did to overcome this issue. Maybe they have a > proper fix rather than reverting the WAIT_ASSIGN state altogether. radisys seems to have no fix either, at least not pushed to the radisys git: http://osmocom.org/issues/1756 -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 14:57:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 16 Jun 2016 14:57:23 -0000 Subject: [PATCH] osmo-bts[master]: add missing DSUM entry to bts_log_info_cat Message-ID: Review at https://gerrit.osmocom.org/299 add missing DSUM entry to bts_log_info_cat This allows setting the 'sum' log level to debug in osmo-bts.cfg. Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72 --- M src/common/logging.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/299/1 diff --git a/src/common/logging.c b/src/common/logging.c index 5ce9b8b..2911692 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -136,6 +136,12 @@ .enabled = 1, .loglevel = LOGL_DEBUG, }, #endif + [DSUM] = { + .name = "DSUM", + .description = "DSUM", + .loglevel = LOGL_NOTICE, + .enabled = 1, + }, }; const struct log_info bts_log_info = { -- To view, visit https://gerrit.osmocom.org/299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jun 16 15:03:36 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 15:03:36 -0000 Subject: [PATCH] osmo-bts[master]: TRX: add configuration example Message-ID: Review at https://gerrit.osmocom.org/300 TRX: add configuration example Related: OS#1648 Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef --- A doc/examples/trx/osmo-bts.cfg 1 file changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/300/1 diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg new file mode 100644 index 0000000..29d5655 --- /dev/null +++ b/doc/examples/trx/osmo-bts.cfg @@ -0,0 +1,34 @@ +! +! OsmoBTS () configuration saved from vty +!! +! +log stderr + logging color 1 + logging timestamp 0 + logging level all everything + logging level rsl notice + logging level oml notice + logging level rll notice + logging level rr notice + logging level meas error + logging level pag error + logging level l1c error + logging level l1p error + logging level dsp error + logging level abis error +! +line vty + no login +! +phy 0 + instance 0 + osmotrx rx-gain 1 +bts 0 + band 1800 + ipa unit-id 6969 0 + oml remote-ip 192.168.122.1 + settsc + gsmtap-sapi ccch + gsmtap-sapi pdtch + trx 0 + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 15:05:20 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 15:05:20 -0000 Subject: [ABANDON] libosmocore[master]: Add missing names for Abis NM objects In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Add missing names for Abis NM objects ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I742c6a1965c4da6623b08637639b1fe4d285d42c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 16 16:48:09 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 16 Jun 2016 16:48:09 -0000 Subject: [PATCH] osmo-bts[master]: configure: Add LT_INIT macro to enable libtool configuration. Message-ID: Review at https://gerrit.osmocom.org/301 configure: Add LT_INIT macro to enable libtool configuration. Now we can use --enable-shared, --disable-shared, --enable-static, --disable-static, --with-pic, and --without-pic configure flags to choose whether we want dynamic or static library linking, etc. See the link for details: https://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/301/1 diff --git a/configure.ac b/configure.ac index 0951e18..88e5b86 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_INSTALL -AC_PROG_RANLIB +LT_INIT dnl checks for header files AC_HEADER_STDC -- To view, visit https://gerrit.osmocom.org/301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Thu Jun 16 16:54:44 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 16:54:44 -0000 Subject: osmo-bts[master]: configure: Add LT_INIT macro to enable libtool configuration. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 16:59:28 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 16 Jun 2016 16:59:28 -0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: I recall someone (Harald?) recommended me to use get_value_string() directly. Having 1-line wrappers doesn't seem to bring much value anyway. -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 17:51:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 17:51:42 -0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: > I recall someone (Harald?) recommended me to use get_value_string() > directly. Having 1-line wrappers doesn't seem to bring much value > anyway. Yes, it was most likely me. The dedicated get_*_name() functions come from a time when we didn't have struct value_string yet, but dedicated array and hand-coded conversion functions. That's long gone. calling get_value_string() with the name of the array leads in a lot more typing on the other hand. Introducing new symbols menas the .map files need to be updated... What could be a reasonable compromise is to have a static inline function declared in the .h file. This way we don't intrduce new symbols but still have shorter-to-type convenience wrappers around get_value_string() without any performance impact, as they will be in-lined (as opposed to the extra function call of a non-inline function). so let's go this way. -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 17:55:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 17:55:53 -0000 Subject: libosmocore[master]: lapdm: Fix malformed Abis messages In-Reply-To: References: Message-ID: Patch Set 1: > This commit relates to the bug #1635 that I have already reported > this March. I will rename commit message using "Fixes: OS#1635" > instead. you can even do this in gerrit by selecting the commit message and clicking on edit, no need to re-work the patch locally and re-push. Up to you :) -- To view, visit https://gerrit.osmocom.org/266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:15:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:15:27 +0000 Subject: [PATCH] libosmocore[master]: Add Finite State Machine abstraction code In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/163 to look at the new patch set (#6). Add Finite State Machine abstraction code This code is supposed to formalize some of the state machine handling in Osmocom code. Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466 --- M include/Makefile.am A include/osmocom/core/fsm.h M src/Makefile.am A src/fsm.c M tests/Makefile.am A tests/fsm/fsm_test.c A tests/fsm/fsm_test.err A tests/fsm/fsm_test.ok M tests/testsuite.at 9 files changed, 738 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/163/6 diff --git a/include/Makefile.am b/include/Makefile.am index 04a8b23..7aa9c27 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -17,6 +17,7 @@ osmocom/core/crcgen.h \ osmocom/core/endian.h \ osmocom/core/defs.h \ + osmocom/core/fsm.h \ osmocom/core/gsmtap.h \ osmocom/core/gsmtap_util.h \ osmocom/core/linuxlist.h \ diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h new file mode 100644 index 0000000..401ee04 --- /dev/null +++ b/include/osmocom/core/fsm.h @@ -0,0 +1,135 @@ +#pragma once + +#include +#include + +#include +#include +#include + +/*! \defgroup fsm Finite State Machine abstraction + * @{ + */ + +/*! \file fsm.h + * \brief Finite State Machine + */ + +struct osmo_fsm_inst; + +enum osmo_fsm_term_cause { + /*! \brief terminate because parent terminated */ + OSMO_FSM_TERM_PARENT, + /*! \brief terminate on explicit user request */ + OSMO_FSM_TERM_REQUEST, + /*! \brief regular termination of process */ + OSMO_FSM_TERM_REGULAR, + /*! \brief erroneous termination of process */ + OSMO_FSM_TERM_ERROR, +}; + +/*! \brief description of a rule in the FSM */ +struct osmo_fsm_state { + /*! \brief bit-mask of permitted input events for this state */ + uint32_t in_event_mask; + /*! \brief bit-mask to which other states this state may transiton */ + uint32_t out_state_mask; + /*! \brief human-readable name of this state */ + const char *name; + /*! \brief function to be called for events arriving in this state */ + void (*action)(struct osmo_fsm_inst *fi, uint32_t event, void *data); + /*! \brief function to be called just after entering the state */ + void (*onenter)(struct osmo_fsm_inst *fi, uint32_t prev_state); + /*! \brief function to be called just before leaving the state */ + void (*onleave)(struct osmo_fsm_inst *fi, uint32_t next_state); +}; + +/*! \brief a description of an osmocom finite state machine */ +struct osmo_fsm { + /*! \brief global list */ + struct llist_head list; + /*! \brief list of instances of this FSM */ + struct llist_head instances; + /*! \brief human readable name */ + const char *name; + /*! \brief table of state transition rules */ + const struct osmo_fsm_state *states; + /*! \brief number of entries in \ref states */ + unsigned int num_states; + /*! \brief bit-mask of events permitted in all states */ + uint32_t allstate_event_mask; + /*! \brief function pointer to be called for allstate events */ + void (*allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void *data); + /*! \breif clean-up function, called during termination */ + void (*cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause); + /*! \brief timer call-back for states with time-out */ + void (*timer_cb)(struct osmo_fsm_inst *fi); + /*! \brief logging sub-system for this FSM */ + int log_subsys; + /*! \brief human-readable names of events */ + const struct value_string *event_names; +}; + +/*! \brief a single instanceof an osmocom finite state machine */ +struct osmo_fsm_inst { + /*! \brief member in the fsm->instances list */ + struct llist_head list; + /*! \brief back-pointer to the FSM of which we are an instance */ + struct osmo_fsm *fsm; + /*! \brief human readable identifier */ + const char *id; + /*! \brief human readable fully-qualified name */ + const char *name; + /*! \brief some private data of this instance */ + void *priv; + /*! \brief logging level for this FSM */ + int log_level; + /*! \brief current state of the FSM */ + uint32_t state; + + /*! \brief timer number for states with time-out */ + int T; + /*! \brief timer back-end for states with time-out */ + struct osmo_timer_list timer; + + /*! \brief support for fsm-based procedures */ + struct { + /*! \brief the parent FSM that has created us */ + struct osmo_fsm_inst *parent; + /*! \brief the event we should send upon termination */ + uint32_t parent_term_event; + /*! \brief a list of children processes */ + struct llist_head children; + /*! \brief \ref llist_head linked to parent->proc.children */ + struct llist_head child; + } proc; +}; + +void osmo_fsm_log_addr(bool log_addr); + +#define LOGPFSM(fi, fmt, args...) \ + LOGP((fi)->fsm->log_subsys, (fi)->log_level, "%s{%s}: " fmt, \ + osmo_fsm_inst_name(fi), \ + osmo_fsm_state_name((fi)->fsm, (fi)->state), ## args) + +int osmo_fsm_register(struct osmo_fsm *fsm); + +struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, + int log_level, const char *id); +struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event); +void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); + +const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); +const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi); +const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state); + +int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, + unsigned long timeout_secs, int T); +int osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data); + +void osmo_fsm_inst_term(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause, void *data); + +/*! @} */ diff --git a/src/Makefile.am b/src/Makefile.am index 45a77e3..7a6f464 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,7 +9,7 @@ libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) libosmocore_la_SOURCES = timer.c select.c signal.c msgb.c bits.c \ - bitvec.c bitcomp.c statistics.c \ + bitvec.c bitcomp.c statistics.c fsm.c \ write_queue.c utils.c socket.c \ logging.c logging_syslog.c rate_ctr.c \ gsmtap_util.c crc16.c panic.c backtrace.c \ diff --git a/src/fsm.c b/src/fsm.c new file mode 100644 index 0000000..ede769d --- /dev/null +++ b/src/fsm.c @@ -0,0 +1,422 @@ +/* Osmocom generic Finite State Machine implementation + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include +#include + +#include +#include +#include +#include + +/*! \addtogroup fsm + * @{ + */ + +/*! \file fsm.c + * \brief Finite State Machine abstraction + * + * This is a generic C-language abstraction for implementing finite + * state machines within the Osmocom framework. It is intended to + * replace existing hand-coded or even only implicitly existing FSMs + * all over the existing code base. + * + * An libosmocore FSM is described by its \ref osmo_fsm description, + * which in turn refers to an array of \ref osmo_fsm_state descriptor, + * each describing a single state in the FSM. + * + * The general idea is that all actions performed within one state are + * located at one position in the code (the state's action function), + * as opposed to the 'message-centric' view of e.g. the existing + * state machines of the LAPD(m) coe, where there is one message for + * eahc possible event (primitive), and the function then needs to + * concern itself on how to handle that event over all possible states. + * + * For each state, there is a bit-mask of permitted input events for + * this state, as well as a bit-mask of permitted new output states to + * which the state can change. Furthermore, there is a function + * pointer implementing the actual handling of the input events + * occurring whilst in thta state. + * + * Furthermore, each state offers a function pointer that can be + * executed just before leaving a state, and another one just after + * entering a state. + * + * When transitioning into a new state, an optional timer number and + * time-out can be passed along. The timer is started just after + * entering the new state, and will call the \ref osmo_fsm timer_cb + * function once it expires. This is intended to be used in telecom + * state machines where a given timer (identified by a certain number) + * is started to terminate the fsm or terminate the fsm once expected + * events are not happening before timeout expiration. + * + * As there can often be many concurrent FSMs of one given class, we + * introduce the concept of \ref osmo_fsm_inst, i.e. an FSM instance. + * The instance keeps the actual state, while the \ref osmo_fsm + * descriptor contains the static/const descriptor of the FSM's states + * and possible transitions. + * + * osmo_fsm are integrated with the libosmocore logging system. The + * logging sub-system is determined by the FSM descriptor, as we assume + * one FSM (let's say one related to a location update procedure) is + * inevitably always tied to a sub-system. The logging level however + * is configurable for each FSM instance, to ensure that e.g. DEBUG + * logging can be used for the LU procedure of one subscriber, while + * NOTICE level is used for all other subscribers. + * + * In order to attach private state to the \ref osmo_fsm_inst, it + * offers an opaque priv pointer. + * + */ + +static LLIST_HEAD(g_fsms); +static bool fsm_log_addr = true; + +/*! \brief specify if FSM instance addresses should be logged or not + * + * By default, the FSM name includes the pointer address of the \ref + * osmo_fsm_inst. This behaviro can be disabled (and re-enabled) + * using this function. + * + * \param[in] log_addr Indicate if FSM instance address shall be logged + */ +void osmo_fsm_log_addr(bool log_addr) +{ + fsm_log_addr = false; +} + +/*! \brief register a FSM with the core + * + * A FSM descriptor needs to be registered with the core before any + * instances can be created for it. + * + * \param[in] fsm Descriptor of Finite State Machine to be registered + * \returns 0 on success; negative on error + */ +int osmo_fsm_register(struct osmo_fsm *fsm) +{ + /* FIXME:check for duplicate name? */ + llist_add_tail(&fsm->list, &g_fsms); + INIT_LLIST_HEAD(&fsm->instances); + + return 0; +} + +/*! \brief unregister a FSM from the core + * + * Once the FSM descriptor is unregistered, active instances can still + * use it, but no new instances may be created for it. + * + * \param[in] fsm Descriptor of Finite State Machine to be removed + */ +void osmo_fsm_unregister(struct osmo_fsm *fsm) +{ + llist_del(&fsm->list); +} + +/* small wrapper function around timer expiration (for logging) */ +static void fsm_tmr_cb(void *data) +{ + struct osmo_fsm_inst *fi = data; + struct osmo_fsm *fsm = fi->fsm; + + LOGPFSM(fi, "Timeout of T%u\n", fi->T); + + fsm->timer_cb(fi); +} + +/*! \brief allocate a new instance of a specified FSM + * \param[in] fsm Descriptor of the FSM + * \param[in] ctx talloc context from which to allocate memory + * \param[in] priv private data reference store in fsm instance + * \param[in] log_level The log level for events of this FSM + * \returns newly-allocated, initialized and registered FSM instance + */ +struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, + int log_level, const char *id) +{ + struct osmo_fsm_inst *fi = talloc_zero(ctx, struct osmo_fsm_inst); + + fi->fsm = fsm; + fi->priv = priv; + fi->log_level = log_level; + fi->timer.data = fi; + fi->timer.cb = fsm_tmr_cb; + fi->id = id; + + if (!fsm_log_addr) { + if (id) + fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id); + else + fi->name = talloc_asprintf(fi, "%s", fsm->name); + } else { + if (id) + fi->name = talloc_asprintf(fi, "%s(%s)[%p]", fsm->name, + id, fi); + else + fi->name = talloc_asprintf(fi, "%s[%p]", fsm->name, fi); + } + + INIT_LLIST_HEAD(&fi->proc.children); + INIT_LLIST_HEAD(&fi->proc.child); + llist_add(&fi->list, &fsm->instances); + + LOGPFSM(fi, "Allocated\n"); + + return fi; +} + +/*! \brief allocate a new instance of a specified FSM as child of + * other FSM instance + * + * This is like \ref osmo_fsm_inst_alloc but using the parent FSM as + * talloc context, and inheriting the log level of the parent. + * + * \param[in] fsm Descriptor of the to-be-allocated FSM + * \param[in] parent Parent FSM instance + * \param[in] parent_term_event Event to be sent to parent when terminating + * \returns newly-allocated, initialized and registered FSM instance + */ +struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc(fsm, parent, NULL, parent->log_level, + parent->id); + if (!fi) { + /* indicate immediate termination to caller */ + osmo_fsm_inst_dispatch(parent, parent_term_event, NULL); + return NULL; + } + + LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); + + fi->proc.parent = parent; + fi->proc.parent_term_event = parent_term_event; + llist_add(&fi->proc.child, &parent->proc.children); + + return fi; +} + +/*! \brief delete a given instance of a FSM + * \param[in] fsm The FSM to be un-registered and deleted + */ +void osmo_fsm_inst_free(struct osmo_fsm_inst *fi) +{ + osmo_timer_del(&fi->timer); + llist_del(&fi->list); + talloc_free(fi); +} + +/*! \brief get human-readable name of FSM event + * \param[in] fsm FSM descriptor of event + * \param[in] event Event integer value + * \returns string rendering of the event + */ +const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event) +{ + static char buf[32]; + if (!fsm->event_names) { + snprintf(buf, sizeof(buf), "%u", event); + return buf; + } else + return get_value_string(fsm->event_names, event); +} + +/*! \brief get human-readable name of FSM instance + * \param[in] fi FSM instance + * \returns string rendering of the FSM identity + */ +const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi) +{ + if (!fi) + return "NULL"; + + if (fi->name) + return fi->name; + else + return fi->fsm->name; +} + +/*! \brief get human-readable name of FSM instance + * \param[in] fsm FSM descriptor + * \param[in] state FSM state number + * \returns string rendering of the FSM state + */ +const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state) +{ + static char buf[32]; + if (state >= fsm->num_states) { + snprintf(buf, sizeof(buf), "unknown %u", state); + return buf; + } else + return fsm->states[state].name; +} + +/*! \brief perform a state change of the given FSM instance + * + * All changes to the FSM instance state must be made via this + * function. It verifies that the existing state actually permits a + * transiiton to new_state. + * + * timeout_secs and T are optional parameters, and only have any effect + * if timeout_secs is not 0. If the timeout function is used, then the + * new_state is entered, and the FSM instances timer is set to expire + * in timeout_secs functions. At that time, the FSM's timer_cb + * function will be called for handling of the timeout by the user. + * + * \param[in] fi FSM instance whose state is to change + * \param[in] new_state The new state into which we should change + * \param[in] timeout_secs Timeout in seconds (if !=0) + * \param[in] T Timer number (if \ref timeout_secs != 0) + * \returns 0 on success; negative on error + */ +int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, + unsigned long timeout_secs, int T) +{ + struct osmo_fsm *fsm = fi->fsm; + uint32_t old_state = fi->state; + const struct osmo_fsm_state *st = &fsm->states[fi->state]; + + /* validate if new_state is a valid state */ + if (!(st->out_state_mask & (1 << new_state))) { + LOGP(fsm->log_subsys, LOGL_ERROR, "%s(%s): transition to " + "state %s not permitted!\n", + osmo_fsm_inst_name(fi), + osmo_fsm_state_name(fsm, fi->state), + osmo_fsm_state_name(fsm, new_state)); + return -EPERM; + } + + if (st->onleave) + st->onleave(fi, new_state); + + LOGPFSM(fi, "state_chg to %s\n", osmo_fsm_state_name(fsm, new_state)); + fi->state = new_state; + + if (st->onenter) + st->onenter(fi, old_state); + + if (timeout_secs) { + if (!fsm->timer_cb) + LOGP(fsm->log_subsys, LOGL_ERROR, "cannot start " + "timer for FSM without timer call-back\n"); + else { + fi->T = T; + osmo_timer_schedule(&fi->timer, timeout_secs, 0); + } + } + + return 0; +} + +/*! \brief dispatch an event to an osmocom finite state machine instance + * + * Any incoming events to \ref osmo_fsm instances must be dispatched to + * them via this function. It verifies, whether the event is permitted + * based on the current state of the FSM. If not, -1 is returned. + * + * \param[in] fi FSM instance + * \param[in] event Event to send to FSM instance + * \param[in] data Data to pass along with the event + * \returns 0 in case of success; negative on error + */ +int osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm *fsm; + const struct osmo_fsm_state *fs; + + if (!fi) { + LOGP(DLGLOBAL, LOGL_ERROR, "Trying to dispatch event %u to " + "non-existing FSM Instance!\n", event); + osmo_log_backtrace(DLGLOBAL, LOGL_ERROR); + return -ENODEV; + } + + fsm = fi->fsm; + OSMO_ASSERT(fi->state < fsm->num_states); + fs = &fi->fsm->states[fi->state]; + + LOGPFSM(fi, "Received Event %s\n", osmo_fsm_event_name(fsm, event)); + + if (((1 << event) & fsm->allstate_event_mask) && fsm->allstate_action) { + fsm->allstate_action(fi, event, data); + return 0; + } + + if (!((1 << event) & fs->in_event_mask)) { + LOGP(fsm->log_subsys, LOGL_ERROR, "%s(%s): Event %s not " + "permitted\n", osmo_fsm_inst_name(fi), + osmo_fsm_state_name(fsm, fi->state), + osmo_fsm_event_name(fsm, event)); + return -1; + } + fs->action(fi, event, data); + + return 0; +} + +/*! \brief Terminate FSM instance with given cause + * + * This safely terminates the given FSM instance by first iterating + * over all children and sending them a termination event. Next, it + * calls the FSM descriptors cleanup function (if any), followed by + * releasing any memory associated with the FSM instance. + * + * Finally, the parent FSM instance (if any) is notified using the + * parent termination event configured at time of FSM instance start. + * + * \param[in] fi FSM instance to be terminated + * \param[in] cause Cause / reason for termination + * \param[in] data Opaqueevent data to be passed to parent + */ +void osmo_fsm_inst_term(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause, void *data) +{ + struct osmo_fsm_inst *child, *child2; + struct osmo_fsm_inst *parent = fi->proc.parent; + uint32_t parent_term_event = fi->proc.parent_term_event; + + LOGPFSM(fi, "Terminating (cause = %u)\n", cause); + + /* iterate over all children */ + llist_for_each_entry_safe(child, child2, &fi->proc.children, proc.child) { + /* terminate child */ + osmo_fsm_inst_term(child, OSMO_FSM_TERM_PARENT, NULL); + } + + /* delete ourselves from the parent */ + llist_del(&fi->proc.child); + + /* call destructor / clean-up function */ + if (fi->fsm->cleanup) + fi->fsm->cleanup(fi, cause); + + LOGPFSM(fi, "Release\n"); + osmo_fsm_inst_free(fi); + + /* indicate our termination to the parent */ + if (parent && cause != OSMO_FSM_TERM_PARENT) + osmo_fsm_inst_dispatch(parent, parent_term_event, data); +} + +/*! @} */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 55aaa07..73b2d6a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,7 +13,7 @@ vty/vty_test comp128/comp128_test utils/utils_test \ smscb/gsm0341_test stats/stats_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ - sim/sim_test tlv/tlv_test gsup/gsup_test + sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -118,6 +118,9 @@ gsup_gsup_test_SOURCES = gsup/gsup_test.c gsup_gsup_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la +fsm_fsm_test_SOURCES = fsm/fsm_test.c +fsm_fsm_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -152,7 +155,8 @@ vty/vty_test.ok comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ - sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok + sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok \ + fsm/fsm_test.ok fsm/fsm_test.err DISTCLEANFILES = atconfig diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c new file mode 100644 index 0000000..84c2ae4 --- /dev/null +++ b/tests/fsm/fsm_test.c @@ -0,0 +1,155 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +enum { + DMAIN, +}; + +static void *g_ctx; + + +enum test_fsm_states { + ST_NULL = 0, + ST_ONE, + ST_TWO, +}; + +enum test_fsm_evt { + EV_A, + EV_B, +}; + +static void test_fsm_null(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case EV_A: + OSMO_ASSERT(data == (void *) 23); + osmo_fsm_inst_state_chg(fi, ST_ONE, 0, 0); + break; + default: + OSMO_ASSERT(0); + break; + } +} + +static void test_fsm_one(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case EV_B: + OSMO_ASSERT(data == (void *) 42); + osmo_fsm_inst_state_chg(fi,ST_TWO, 1, 2342); + break; + default: + OSMO_ASSERT(0); + break; + } +} + +static void test_fsm_tmr_cb(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi->T == 2342); + OSMO_ASSERT(fi->state == ST_TWO); + LOGP(DMAIN, LOGL_INFO, "Timer\n"); + + exit(0); +} + +static struct osmo_fsm_state test_fsm_states[] = { + [ST_NULL] = { + .in_event_mask = (1 << EV_A), + .out_state_mask = (1 << ST_ONE), + .name = "NULL", + .action = test_fsm_null, + }, + [ST_ONE]= { + .in_event_mask = (1 << EV_B), + .out_state_mask = (1 << ST_TWO), + .name = "ONE", + .action= test_fsm_one, + }, + [ST_TWO]= { + .in_event_mask = 0, + .name = "TWO", + .action = NULL, + }, +}; + +static struct osmo_fsm fsm = { + .name = "Test FSM", + .states = test_fsm_states, + .num_states = ARRAY_SIZE(test_fsm_states), + .log_subsys = DMAIN, +}; + +static int foo(void) +{ + struct osmo_fsm_inst *fi; + + LOGP(DMAIN, LOGL_INFO, "Checking FSM allocation\n"); + fi = osmo_fsm_inst_alloc(&fsm, g_ctx, NULL, LOGL_DEBUG, NULL); + OSMO_ASSERT(fi); + OSMO_ASSERT(fi->fsm == &fsm); + OSMO_ASSERT(!strncmp(osmo_fsm_inst_name(fi), fsm.name, strlen(fsm.name))); + OSMO_ASSERT(fi->state == ST_NULL); + OSMO_ASSERT(fi->log_level == LOGL_DEBUG); + + /* Try invalid state transition */ + osmo_fsm_inst_dispatch(fi, EV_B, (void *) 42); + OSMO_ASSERT(fi->state == ST_NULL); + + /* Legitimate state transition */ + osmo_fsm_inst_dispatch(fi, EV_A, (void *) 23); + OSMO_ASSERT(fi->state == ST_ONE); + + /* Legitimate transition with timer */ + fsm.timer_cb = test_fsm_tmr_cb; + osmo_fsm_inst_dispatch(fi, EV_B, (void *) 42); + OSMO_ASSERT(fi->state == ST_TWO); + + + return 0; +} + +static const struct log_info_cat default_categories[] = { + [DMAIN] = { + .name = "DMAIN", + .description = "Main", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +int main(int argc, char **argv) +{ + struct log_target *stderr_target; + + osmo_fsm_log_addr(false); + + log_init(&log_info, NULL); + stderr_target = log_target_create_stderr(); + log_add_target(stderr_target); + log_set_print_filename(stderr_target, 0); + + g_ctx = NULL; + osmo_fsm_register(&fsm); + + foo(); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} diff --git a/tests/fsm/fsm_test.err b/tests/fsm/fsm_test.err new file mode 100644 index 0000000..b9c738c --- /dev/null +++ b/tests/fsm/fsm_test.err @@ -0,0 +1,11 @@ +Checking FSM allocation +Test FSM{NULL}: Allocated +Test FSM{NULL}: Received Event 1 +Test FSM(NULL): Event 1 not permitted +Test FSM{NULL}: Received Event 0 +Test FSM{NULL}: state_chg to ONE +Test FSM{ONE}: Received Event 1 +Test FSM{ONE}: state_chg to TWO +Test FSM{TWO}: Timeout of T2342 +Timer + \ No newline at end of file diff --git a/tests/fsm/fsm_test.ok b/tests/fsm/fsm_test.ok new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/fsm/fsm_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index d49f7ff..93373c1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -201,3 +201,10 @@ cat $abs_srcdir/gsup/gsup_test.ok > expout AT_CHECK([$abs_top_builddir/tests/gsup/gsup_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([fsm]) +AT_KEYWORDS([fsm]) +cat $abs_srcdir/fsm/fsm_test.ok > expout +cat $abs_srcdir/fsm/fsm_test.err > experr +AT_CHECK([$abs_top_builddir/tests/fsm/fsm_test], [0], [expout], [experr]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:15:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:15:28 +0000 Subject: [PATCH] libosmocore[master]: gsup.c: Fix encoding of UMTS auth vectors Message-ID: Review at https://gerrit.osmocom.org/302 gsup.c: Fix encoding of UMTS auth vectors Encoding auth vectors worked fine for GSM authentication, but didn't yet include the new IEs for UMTS authentication yet. Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d --- M src/gsm/gsup.c 1 file changed, 22 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/302/1 diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 3697958..af3c409 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -394,14 +394,30 @@ len_field = msgb_tlv_put(msg, iei, 0, NULL) - 1; old_len = msgb_length(msg); - msgb_tlv_put(msg, OSMO_GSUP_RAND_IE, - sizeof(auth_vector->rand), auth_vector->rand); + if (auth_vector->auth_types & OSMO_AUTH_TYPE_GSM) { + msgb_tlv_put(msg, OSMO_GSUP_RAND_IE, + sizeof(auth_vector->rand), auth_vector->rand); - msgb_tlv_put(msg, OSMO_GSUP_SRES_IE, - sizeof(auth_vector->sres), auth_vector->sres); + msgb_tlv_put(msg, OSMO_GSUP_SRES_IE, + sizeof(auth_vector->sres), auth_vector->sres); - msgb_tlv_put(msg, OSMO_GSUP_KC_IE, - sizeof(auth_vector->kc), auth_vector->kc); + msgb_tlv_put(msg, OSMO_GSUP_KC_IE, + sizeof(auth_vector->kc), auth_vector->kc); + } + + if (auth_vector->auth_types & OSMO_AUTH_TYPE_UMTS) { + msgb_tlv_put(msg, OSMO_GSUP_IK_IE, + sizeof(auth_vector->ik), auth_vector->ik); + + msgb_tlv_put(msg, OSMO_GSUP_CK_IE, + sizeof(auth_vector->ck), auth_vector->ck); + + msgb_tlv_put(msg, OSMO_GSUP_AUTN_IE, + sizeof(auth_vector->autn), auth_vector->autn); + + msgb_tlv_put(msg, OSMO_GSUP_RES_IE, + auth_vector->res_len, auth_vector->res); + } /* Update length field */ *len_field = msgb_length(msg) - old_len; -- To view, visit https://gerrit.osmocom.org/302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:15:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:15:28 +0000 Subject: [PATCH] libosmocore[master]: gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT Message-ID: Review at https://gerrit.osmocom.org/303 gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT The VLR must be able to notify the HLR of authentication failures. Change-Id: I156cff76e092b3548b05534141b61887ee6be3f3 --- M include/osmocom/gsm/gsup.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/303/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 660ffd4..ed1ef2a 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -72,6 +72,8 @@ OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR = 0b00001001, OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT = 0b00001010, + OSMO_GSUP_MSGT_AUTH_FAIL_REPORT = 0b00001011, + OSMO_GSUP_MSGT_PURGE_MS_REQUEST = 0b00001100, OSMO_GSUP_MSGT_PURGE_MS_ERROR = 0b00001101, OSMO_GSUP_MSGT_PURGE_MS_RESULT = 0b00001110, -- To view, visit https://gerrit.osmocom.org/303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I156cff76e092b3548b05534141b61887ee6be3f3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:15:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:15:28 +0000 Subject: [PATCH] libosmocore[master]: Add structures defining decoded TS 23.003 identities Message-ID: Review at https://gerrit.osmocom.org/304 Add structures defining decoded TS 23.003 identities Change-Id: I6423f8d75bb3e7aeca285854ab3232a087d62b57 --- M include/Makefile.am A include/osmocom/gsm/gsm23003.h 2 files changed, 81 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/304/1 diff --git a/include/Makefile.am b/include/Makefile.am index 2e58d7e..04a8b23 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -67,6 +67,7 @@ osmocom/gsm/gsm0502.h \ osmocom/gsm/gsm0503.h \ osmocom/gsm/gsm0808.h \ + osmocom/gsm/gsm23003.h \ osmocom/gsm/gsm48.h \ osmocom/gsm/gsm48_ie.h \ osmocom/gsm/gsm_utils.h \ diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h new file mode 100644 index 0000000..29e646c --- /dev/null +++ b/include/osmocom/gsm/gsm23003.h @@ -0,0 +1,80 @@ +#pragma once +#include + +/* 23.003 Chapter 12.1 */ +struct osmo_plmn_id { + uint16_t mcc; + uint16_t mnc; +}; + +/* 4.1 */ +struct osmo_location_area_id { + struct osmo_plmn_id plmn; + uint16_t lac; +}; + +/* 4.2 */ +struct osmo_routing_area_id { + struct osmo_location_area_id lac; + uint8_t rac; +}; + +/* 4.3.1 */ +struct osmo_cell_global_id { + struct osmo_location_area_id lai; + uint16_t cell_identity; +}; + +/* 12.5 */ +struct osmo_service_area_id { + struct osmo_location_area_id lai; + uint16_t sac; +}; + +/* 12.6 */ +struct osmo_shared_network_area_id { + struct osmo_plmn_id plmn; + uint32_t snac; +}; + +/* 5.1 */ +enum osmo_gsn_addr_type { + GSN_ADDR_TYPE_IPV4 = 0, + GSN_ADDR_TYPE_IPV6 = 1, +}; + +/* 5.1 */ +struct osmo_gsn_address { + enum osmo_gsn_addr_type type; + uint8_t length; + uint8_t addr[16]; +}; + +/* 19.4.2.3 */ +struct osmo_tracking_area_id { + struct osmo_plmn_id plmn; + uint16_t tac; +}; + +struct osmo_eutran_cell_global_id { + struct osmo_plmn_id plmn; + uint32_t eci; /* FIXME */ +}; + +/* 2.8.1 */ +struct osmo_mme_id { + uint16_t group_id; + uint8_t code; +}; + +/* 2.8.1 */ +struct osmo_gummei { + struct osmo_plmn_id plmn; + struct osmo_mme_id mme; +}; + +/* 2.8.1 */ +struct osmo_guti { + struct osmo_gummei gummei; + uint32_t mtmsi; +}; -- To view, visit https://gerrit.osmocom.org/304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6423f8d75bb3e7aeca285854ab3232a087d62b57 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:15:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:15:28 +0000 Subject: [PATCH] libosmocore[master]: Add UMTS AKA related MM/GMM message type and IE definitions Message-ID: Review at https://gerrit.osmocom.org/305 Add UMTS AKA related MM/GMM message type and IE definitions Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 --- M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M src/gsm/gsm_04_08_gprs.c 3 files changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/305/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 0c2fcf2..074c258 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1272,6 +1272,7 @@ /* Additional MM elements */ #define GSM48_IE_LOCATION_AREA 0x13 +#define GSM48_IE_AUTN 0x20 #define GSM48_IE_PRIORITY_LEV 0x80 #define GSM48_IE_FOLLOW_ON_PROC 0xa1 #define GSM48_IE_CTS_PERMISSION 0xa2 diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index f35d11b..e0e887f 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -22,6 +22,7 @@ #define GSM48_MT_GMM_AUTH_CIPH_REQ 0x12 #define GSM48_MT_GMM_AUTH_CIPH_RESP 0x13 #define GSM48_MT_GMM_AUTH_CIPH_REJ 0x14 +#define GSM48_MT_GMM_AUTH_CIPH_FAIL 0x1C #define GSM48_MT_GMM_ID_REQ 0x15 #define GSM48_MT_GMM_ID_RESP 0x16 #define GSM48_MT_GMM_STATUS 0x20 @@ -79,6 +80,9 @@ GSM48_IE_GMM_IMEISV = 0x23, /* 10.5.1.4 */ GSM48_IE_GMM_CAUSE = 0x25, /* 10.5.5.14 */ GSM48_IE_GMM_DRX_PARAM = 0x27, /* 10.5.5.6 */ + GSM48_IE_GMM_AUTN = 0x28, /* 10.5.3.1.1 */ + GSM48_IE_GMM_AUTH_RES_EXT = 0x29, /* 10.5.3.2.1 */ + GSM48_IE_GMM_AUTH_FAIL_PAR = 0x30, /* 10.5.3.2.2 */ GSM48_IE_GMM_MS_NET_CAPA = 0x31, /* 10.5.5.12 */ GSM48_IE_GMM_PDP_CTX_STATUS = 0x32, /* 10.5.7.1 */ GSM48_IE_GMM_PS_LCS_CAPA = 0x33, /* 10.5.5.22 */ @@ -160,6 +164,7 @@ enum gsm48_gmm_cause { GMM_CAUSE_IMSI_UNKNOWN = 0x02, GMM_CAUSE_ILLEGAL_MS = 0x03, + GMM_CAUSE_IMEI_NOT_ACCEPTED = 0x05, GMM_CAUSE_ILLEGAL_ME = 0x06, GMM_CAUSE_GPRS_NOTALLOWED = 0x07, GMM_CAUSE_GPRS_OTHER_NOTALLOWED = 0x08, @@ -169,9 +174,16 @@ GMM_CAUSE_LA_NOTALLOWED = 0x0c, GMM_CAUSE_ROAMING_NOTALLOWED = 0x0d, GMM_CAUSE_NO_GPRS_PLMN = 0x0e, + GMM_CAUSE_NO_SUIT_CELL_IN_LA = 0x0f, GMM_CAUSE_MSC_TEMP_NOTREACH = 0x10, GMM_CAUSE_NET_FAIL = 0x11, + GMM_CAUSE_MAC_FAIL = 0x14, + GMM_CAUSE_SYNC_FAIL = 0x15, GMM_CAUSE_CONGESTION = 0x16, + GMM_CAUSE_GSM_AUTH_UNACCEPT = 0x17, + GMM_CAUSE_NOT_AUTH_FOR_CSG = 0x19, + GMM_CAUSE_SMS_VIA_GPRS_IN_RA = 0x1c, + GMM_CAUSE_NO_PDP_ACTIVATED = 0x28, GMM_CAUSE_SEM_INCORR_MSG = 0x5f, GMM_CAUSE_INV_MAND_INFO = 0x60, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL = 0x61, diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 6ce9415..5c00ea0 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -1,4 +1,4 @@ -/* (C) 2009-2010 by Harald Welte +/* (C) 2009-2016 by Harald Welte * (C) 2010 by On-Waves * (C) 2014-2015 by Sysmocom s.f.m.c. GmbH * @@ -30,6 +30,7 @@ const struct value_string gsm48_gmm_cause_names_[] = { { GMM_CAUSE_IMSI_UNKNOWN, "IMSI unknown in HLR" }, { GMM_CAUSE_ILLEGAL_MS, "Illegal MS" }, + { GMM_CAUSE_IMEI_NOT_ACCEPTED, "IMEI not accepted" }, { GMM_CAUSE_ILLEGAL_ME, "Illegal ME" }, { GMM_CAUSE_GPRS_NOTALLOWED, "GPRS services not allowed" }, { GMM_CAUSE_GPRS_OTHER_NOTALLOWED, @@ -43,9 +44,16 @@ "Roaming not allowed in this location area" }, { GMM_CAUSE_NO_GPRS_PLMN, "GPRS services not allowed in this PLMN" }, + { GMM_CAUSE_NO_SUIT_CELL_IN_LA, "No suitable cell in LA" }, { GMM_CAUSE_MSC_TEMP_NOTREACH, "MSC temporarily not reachable" }, { GMM_CAUSE_NET_FAIL, "Network failure" }, + { GMM_CAUSE_MAC_FAIL, "MAC failure" }, + { GMM_CAUSE_SYNC_FAIL, "SYNC failure" }, { GMM_CAUSE_CONGESTION, "Congestion" }, + { GMM_CAUSE_GSM_AUTH_UNACCEPT, "GSM authentication unacceptable" }, + { GMM_CAUSE_NOT_AUTH_FOR_CSG, "Not authorized for this CSG" }, + { GMM_CAUSE_SMS_VIA_GPRS_IN_RA, "SMS provided via GPRS in this RA" }, + { GMM_CAUSE_NO_PDP_ACTIVATED, "No PDP context activated" }, { GMM_CAUSE_SEM_INCORR_MSG, "Semantically incorrect message" }, { GMM_CAUSE_INV_MAND_INFO, "Invalid mandatory information" }, { GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL, -- To view, visit https://gerrit.osmocom.org/305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:16:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:16:29 +0000 Subject: libosmocore[master]: gsup.c: Fix encoding of UMTS auth vectors In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:16:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:16:40 +0000 Subject: libosmocore[master]: gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I156cff76e092b3548b05534141b61887ee6be3f3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:17:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:17:05 +0000 Subject: libosmocore[master]: Add structures defining decoded TS 23.003 identities In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6423f8d75bb3e7aeca285854ab3232a087d62b57 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:17:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:17:19 +0000 Subject: libosmocore[master]: Add UMTS AKA related MM/GMM message type and IE definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:25:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:25:18 +0000 Subject: [MERGED] libosmocore[master]: gsup.c: Fix encoding of UMTS auth vectors In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsup.c: Fix encoding of UMTS auth vectors ...................................................................... gsup.c: Fix encoding of UMTS auth vectors Encoding auth vectors worked fine for GSM authentication, but didn't yet include the new IEs for UMTS authentication yet. Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d Reviewed-on: https://gerrit.osmocom.org/302 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M src/gsm/gsup.c 1 file changed, 22 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index 3697958..af3c409 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -394,14 +394,30 @@ len_field = msgb_tlv_put(msg, iei, 0, NULL) - 1; old_len = msgb_length(msg); - msgb_tlv_put(msg, OSMO_GSUP_RAND_IE, - sizeof(auth_vector->rand), auth_vector->rand); + if (auth_vector->auth_types & OSMO_AUTH_TYPE_GSM) { + msgb_tlv_put(msg, OSMO_GSUP_RAND_IE, + sizeof(auth_vector->rand), auth_vector->rand); - msgb_tlv_put(msg, OSMO_GSUP_SRES_IE, - sizeof(auth_vector->sres), auth_vector->sres); + msgb_tlv_put(msg, OSMO_GSUP_SRES_IE, + sizeof(auth_vector->sres), auth_vector->sres); - msgb_tlv_put(msg, OSMO_GSUP_KC_IE, - sizeof(auth_vector->kc), auth_vector->kc); + msgb_tlv_put(msg, OSMO_GSUP_KC_IE, + sizeof(auth_vector->kc), auth_vector->kc); + } + + if (auth_vector->auth_types & OSMO_AUTH_TYPE_UMTS) { + msgb_tlv_put(msg, OSMO_GSUP_IK_IE, + sizeof(auth_vector->ik), auth_vector->ik); + + msgb_tlv_put(msg, OSMO_GSUP_CK_IE, + sizeof(auth_vector->ck), auth_vector->ck); + + msgb_tlv_put(msg, OSMO_GSUP_AUTN_IE, + sizeof(auth_vector->autn), auth_vector->autn); + + msgb_tlv_put(msg, OSMO_GSUP_RES_IE, + auth_vector->res_len, auth_vector->res); + } /* Update length field */ *len_field = msgb_length(msg) - old_len; -- To view, visit https://gerrit.osmocom.org/302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:25:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:25:22 +0000 Subject: [MERGED] libosmocore[master]: gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT ...................................................................... gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT The VLR must be able to notify the HLR of authentication failures. Change-Id: I156cff76e092b3548b05534141b61887ee6be3f3 Reviewed-on: https://gerrit.osmocom.org/303 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M include/osmocom/gsm/gsup.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 660ffd4..ed1ef2a 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -72,6 +72,8 @@ OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR = 0b00001001, OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT = 0b00001010, + OSMO_GSUP_MSGT_AUTH_FAIL_REPORT = 0b00001011, + OSMO_GSUP_MSGT_PURGE_MS_REQUEST = 0b00001100, OSMO_GSUP_MSGT_PURGE_MS_ERROR = 0b00001101, OSMO_GSUP_MSGT_PURGE_MS_RESULT = 0b00001110, -- To view, visit https://gerrit.osmocom.org/303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I156cff76e092b3548b05534141b61887ee6be3f3 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:25:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:25:26 +0000 Subject: [MERGED] libosmocore[master]: Add structures defining decoded TS 23.003 identities In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add structures defining decoded TS 23.003 identities ...................................................................... Add structures defining decoded TS 23.003 identities Change-Id: I6423f8d75bb3e7aeca285854ab3232a087d62b57 Reviewed-on: https://gerrit.osmocom.org/304 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M include/Makefile.am A include/osmocom/gsm/gsm23003.h 2 files changed, 81 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index 2e58d7e..04a8b23 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -67,6 +67,7 @@ osmocom/gsm/gsm0502.h \ osmocom/gsm/gsm0503.h \ osmocom/gsm/gsm0808.h \ + osmocom/gsm/gsm23003.h \ osmocom/gsm/gsm48.h \ osmocom/gsm/gsm48_ie.h \ osmocom/gsm/gsm_utils.h \ diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h new file mode 100644 index 0000000..29e646c --- /dev/null +++ b/include/osmocom/gsm/gsm23003.h @@ -0,0 +1,80 @@ +#pragma once +#include + +/* 23.003 Chapter 12.1 */ +struct osmo_plmn_id { + uint16_t mcc; + uint16_t mnc; +}; + +/* 4.1 */ +struct osmo_location_area_id { + struct osmo_plmn_id plmn; + uint16_t lac; +}; + +/* 4.2 */ +struct osmo_routing_area_id { + struct osmo_location_area_id lac; + uint8_t rac; +}; + +/* 4.3.1 */ +struct osmo_cell_global_id { + struct osmo_location_area_id lai; + uint16_t cell_identity; +}; + +/* 12.5 */ +struct osmo_service_area_id { + struct osmo_location_area_id lai; + uint16_t sac; +}; + +/* 12.6 */ +struct osmo_shared_network_area_id { + struct osmo_plmn_id plmn; + uint32_t snac; +}; + +/* 5.1 */ +enum osmo_gsn_addr_type { + GSN_ADDR_TYPE_IPV4 = 0, + GSN_ADDR_TYPE_IPV6 = 1, +}; + +/* 5.1 */ +struct osmo_gsn_address { + enum osmo_gsn_addr_type type; + uint8_t length; + uint8_t addr[16]; +}; + +/* 19.4.2.3 */ +struct osmo_tracking_area_id { + struct osmo_plmn_id plmn; + uint16_t tac; +}; + +struct osmo_eutran_cell_global_id { + struct osmo_plmn_id plmn; + uint32_t eci; /* FIXME */ +}; + +/* 2.8.1 */ +struct osmo_mme_id { + uint16_t group_id; + uint8_t code; +}; + +/* 2.8.1 */ +struct osmo_gummei { + struct osmo_plmn_id plmn; + struct osmo_mme_id mme; +}; + +/* 2.8.1 */ +struct osmo_guti { + struct osmo_gummei gummei; + uint32_t mtmsi; +}; -- To view, visit https://gerrit.osmocom.org/304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6423f8d75bb3e7aeca285854ab3232a087d62b57 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:43:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:43:21 +0000 Subject: [MERGED] libosmocore[master]: Add UMTS AKA related MM/GMM message type and IE definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add UMTS AKA related MM/GMM message type and IE definitions ...................................................................... Add UMTS AKA related MM/GMM message type and IE definitions Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Reviewed-on: https://gerrit.osmocom.org/305 Reviewed-by: Harald Welte Tested-by: Jenkins Builder --- M include/osmocom/gsm/protocol/gsm_04_08.h M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M src/gsm/gsm_04_08_gprs.c 3 files changed, 22 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 0c2fcf2..074c258 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1272,6 +1272,7 @@ /* Additional MM elements */ #define GSM48_IE_LOCATION_AREA 0x13 +#define GSM48_IE_AUTN 0x20 #define GSM48_IE_PRIORITY_LEV 0x80 #define GSM48_IE_FOLLOW_ON_PROC 0xa1 #define GSM48_IE_CTS_PERMISSION 0xa2 diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index f35d11b..e0e887f 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -22,6 +22,7 @@ #define GSM48_MT_GMM_AUTH_CIPH_REQ 0x12 #define GSM48_MT_GMM_AUTH_CIPH_RESP 0x13 #define GSM48_MT_GMM_AUTH_CIPH_REJ 0x14 +#define GSM48_MT_GMM_AUTH_CIPH_FAIL 0x1C #define GSM48_MT_GMM_ID_REQ 0x15 #define GSM48_MT_GMM_ID_RESP 0x16 #define GSM48_MT_GMM_STATUS 0x20 @@ -79,6 +80,9 @@ GSM48_IE_GMM_IMEISV = 0x23, /* 10.5.1.4 */ GSM48_IE_GMM_CAUSE = 0x25, /* 10.5.5.14 */ GSM48_IE_GMM_DRX_PARAM = 0x27, /* 10.5.5.6 */ + GSM48_IE_GMM_AUTN = 0x28, /* 10.5.3.1.1 */ + GSM48_IE_GMM_AUTH_RES_EXT = 0x29, /* 10.5.3.2.1 */ + GSM48_IE_GMM_AUTH_FAIL_PAR = 0x30, /* 10.5.3.2.2 */ GSM48_IE_GMM_MS_NET_CAPA = 0x31, /* 10.5.5.12 */ GSM48_IE_GMM_PDP_CTX_STATUS = 0x32, /* 10.5.7.1 */ GSM48_IE_GMM_PS_LCS_CAPA = 0x33, /* 10.5.5.22 */ @@ -160,6 +164,7 @@ enum gsm48_gmm_cause { GMM_CAUSE_IMSI_UNKNOWN = 0x02, GMM_CAUSE_ILLEGAL_MS = 0x03, + GMM_CAUSE_IMEI_NOT_ACCEPTED = 0x05, GMM_CAUSE_ILLEGAL_ME = 0x06, GMM_CAUSE_GPRS_NOTALLOWED = 0x07, GMM_CAUSE_GPRS_OTHER_NOTALLOWED = 0x08, @@ -169,9 +174,16 @@ GMM_CAUSE_LA_NOTALLOWED = 0x0c, GMM_CAUSE_ROAMING_NOTALLOWED = 0x0d, GMM_CAUSE_NO_GPRS_PLMN = 0x0e, + GMM_CAUSE_NO_SUIT_CELL_IN_LA = 0x0f, GMM_CAUSE_MSC_TEMP_NOTREACH = 0x10, GMM_CAUSE_NET_FAIL = 0x11, + GMM_CAUSE_MAC_FAIL = 0x14, + GMM_CAUSE_SYNC_FAIL = 0x15, GMM_CAUSE_CONGESTION = 0x16, + GMM_CAUSE_GSM_AUTH_UNACCEPT = 0x17, + GMM_CAUSE_NOT_AUTH_FOR_CSG = 0x19, + GMM_CAUSE_SMS_VIA_GPRS_IN_RA = 0x1c, + GMM_CAUSE_NO_PDP_ACTIVATED = 0x28, GMM_CAUSE_SEM_INCORR_MSG = 0x5f, GMM_CAUSE_INV_MAND_INFO = 0x60, GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL = 0x61, diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 6ce9415..5c00ea0 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -1,4 +1,4 @@ -/* (C) 2009-2010 by Harald Welte +/* (C) 2009-2016 by Harald Welte * (C) 2010 by On-Waves * (C) 2014-2015 by Sysmocom s.f.m.c. GmbH * @@ -30,6 +30,7 @@ const struct value_string gsm48_gmm_cause_names_[] = { { GMM_CAUSE_IMSI_UNKNOWN, "IMSI unknown in HLR" }, { GMM_CAUSE_ILLEGAL_MS, "Illegal MS" }, + { GMM_CAUSE_IMEI_NOT_ACCEPTED, "IMEI not accepted" }, { GMM_CAUSE_ILLEGAL_ME, "Illegal ME" }, { GMM_CAUSE_GPRS_NOTALLOWED, "GPRS services not allowed" }, { GMM_CAUSE_GPRS_OTHER_NOTALLOWED, @@ -43,9 +44,16 @@ "Roaming not allowed in this location area" }, { GMM_CAUSE_NO_GPRS_PLMN, "GPRS services not allowed in this PLMN" }, + { GMM_CAUSE_NO_SUIT_CELL_IN_LA, "No suitable cell in LA" }, { GMM_CAUSE_MSC_TEMP_NOTREACH, "MSC temporarily not reachable" }, { GMM_CAUSE_NET_FAIL, "Network failure" }, + { GMM_CAUSE_MAC_FAIL, "MAC failure" }, + { GMM_CAUSE_SYNC_FAIL, "SYNC failure" }, { GMM_CAUSE_CONGESTION, "Congestion" }, + { GMM_CAUSE_GSM_AUTH_UNACCEPT, "GSM authentication unacceptable" }, + { GMM_CAUSE_NOT_AUTH_FOR_CSG, "Not authorized for this CSG" }, + { GMM_CAUSE_SMS_VIA_GPRS_IN_RA, "SMS provided via GPRS in this RA" }, + { GMM_CAUSE_NO_PDP_ACTIVATED, "No PDP context activated" }, { GMM_CAUSE_SEM_INCORR_MSG, "Semantically incorrect message" }, { GMM_CAUSE_INV_MAND_INFO, "Invalid mandatory information" }, { GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL, -- To view, visit https://gerrit.osmocom.org/305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:43:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:43:43 +0000 Subject: libosmocore[master]: Add Finite State Machine abstraction code In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 16 21:43:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 16 Jun 2016 21:43:45 +0000 Subject: [MERGED] libosmocore[master]: Add Finite State Machine abstraction code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add Finite State Machine abstraction code ...................................................................... Add Finite State Machine abstraction code This code is supposed to formalize some of the state machine handling in Osmocom code. Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466 Reviewed-on: https://gerrit.osmocom.org/163 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M include/Makefile.am A include/osmocom/core/fsm.h M src/Makefile.am A src/fsm.c M tests/Makefile.am A tests/fsm/fsm_test.c A tests/fsm/fsm_test.err A tests/fsm/fsm_test.ok M tests/testsuite.at 9 files changed, 738 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/Makefile.am b/include/Makefile.am index 04a8b23..7aa9c27 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -17,6 +17,7 @@ osmocom/core/crcgen.h \ osmocom/core/endian.h \ osmocom/core/defs.h \ + osmocom/core/fsm.h \ osmocom/core/gsmtap.h \ osmocom/core/gsmtap_util.h \ osmocom/core/linuxlist.h \ diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h new file mode 100644 index 0000000..401ee04 --- /dev/null +++ b/include/osmocom/core/fsm.h @@ -0,0 +1,135 @@ +#pragma once + +#include +#include + +#include +#include +#include + +/*! \defgroup fsm Finite State Machine abstraction + * @{ + */ + +/*! \file fsm.h + * \brief Finite State Machine + */ + +struct osmo_fsm_inst; + +enum osmo_fsm_term_cause { + /*! \brief terminate because parent terminated */ + OSMO_FSM_TERM_PARENT, + /*! \brief terminate on explicit user request */ + OSMO_FSM_TERM_REQUEST, + /*! \brief regular termination of process */ + OSMO_FSM_TERM_REGULAR, + /*! \brief erroneous termination of process */ + OSMO_FSM_TERM_ERROR, +}; + +/*! \brief description of a rule in the FSM */ +struct osmo_fsm_state { + /*! \brief bit-mask of permitted input events for this state */ + uint32_t in_event_mask; + /*! \brief bit-mask to which other states this state may transiton */ + uint32_t out_state_mask; + /*! \brief human-readable name of this state */ + const char *name; + /*! \brief function to be called for events arriving in this state */ + void (*action)(struct osmo_fsm_inst *fi, uint32_t event, void *data); + /*! \brief function to be called just after entering the state */ + void (*onenter)(struct osmo_fsm_inst *fi, uint32_t prev_state); + /*! \brief function to be called just before leaving the state */ + void (*onleave)(struct osmo_fsm_inst *fi, uint32_t next_state); +}; + +/*! \brief a description of an osmocom finite state machine */ +struct osmo_fsm { + /*! \brief global list */ + struct llist_head list; + /*! \brief list of instances of this FSM */ + struct llist_head instances; + /*! \brief human readable name */ + const char *name; + /*! \brief table of state transition rules */ + const struct osmo_fsm_state *states; + /*! \brief number of entries in \ref states */ + unsigned int num_states; + /*! \brief bit-mask of events permitted in all states */ + uint32_t allstate_event_mask; + /*! \brief function pointer to be called for allstate events */ + void (*allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void *data); + /*! \breif clean-up function, called during termination */ + void (*cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause); + /*! \brief timer call-back for states with time-out */ + void (*timer_cb)(struct osmo_fsm_inst *fi); + /*! \brief logging sub-system for this FSM */ + int log_subsys; + /*! \brief human-readable names of events */ + const struct value_string *event_names; +}; + +/*! \brief a single instanceof an osmocom finite state machine */ +struct osmo_fsm_inst { + /*! \brief member in the fsm->instances list */ + struct llist_head list; + /*! \brief back-pointer to the FSM of which we are an instance */ + struct osmo_fsm *fsm; + /*! \brief human readable identifier */ + const char *id; + /*! \brief human readable fully-qualified name */ + const char *name; + /*! \brief some private data of this instance */ + void *priv; + /*! \brief logging level for this FSM */ + int log_level; + /*! \brief current state of the FSM */ + uint32_t state; + + /*! \brief timer number for states with time-out */ + int T; + /*! \brief timer back-end for states with time-out */ + struct osmo_timer_list timer; + + /*! \brief support for fsm-based procedures */ + struct { + /*! \brief the parent FSM that has created us */ + struct osmo_fsm_inst *parent; + /*! \brief the event we should send upon termination */ + uint32_t parent_term_event; + /*! \brief a list of children processes */ + struct llist_head children; + /*! \brief \ref llist_head linked to parent->proc.children */ + struct llist_head child; + } proc; +}; + +void osmo_fsm_log_addr(bool log_addr); + +#define LOGPFSM(fi, fmt, args...) \ + LOGP((fi)->fsm->log_subsys, (fi)->log_level, "%s{%s}: " fmt, \ + osmo_fsm_inst_name(fi), \ + osmo_fsm_state_name((fi)->fsm, (fi)->state), ## args) + +int osmo_fsm_register(struct osmo_fsm *fsm); + +struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, + int log_level, const char *id); +struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event); +void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); + +const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); +const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi); +const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state); + +int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, + unsigned long timeout_secs, int T); +int osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data); + +void osmo_fsm_inst_term(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause, void *data); + +/*! @} */ diff --git a/src/Makefile.am b/src/Makefile.am index 45a77e3..7a6f464 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,7 +9,7 @@ libosmocore_la_LIBADD = $(BACKTRACE_LIB) $(TALLOC_LIBS) libosmocore_la_SOURCES = timer.c select.c signal.c msgb.c bits.c \ - bitvec.c bitcomp.c statistics.c \ + bitvec.c bitcomp.c statistics.c fsm.c \ write_queue.c utils.c socket.c \ logging.c logging_syslog.c rate_ctr.c \ gsmtap_util.c crc16.c panic.c backtrace.c \ diff --git a/src/fsm.c b/src/fsm.c new file mode 100644 index 0000000..ede769d --- /dev/null +++ b/src/fsm.c @@ -0,0 +1,422 @@ +/* Osmocom generic Finite State Machine implementation + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +#include +#include + +#include +#include +#include +#include + +/*! \addtogroup fsm + * @{ + */ + +/*! \file fsm.c + * \brief Finite State Machine abstraction + * + * This is a generic C-language abstraction for implementing finite + * state machines within the Osmocom framework. It is intended to + * replace existing hand-coded or even only implicitly existing FSMs + * all over the existing code base. + * + * An libosmocore FSM is described by its \ref osmo_fsm description, + * which in turn refers to an array of \ref osmo_fsm_state descriptor, + * each describing a single state in the FSM. + * + * The general idea is that all actions performed within one state are + * located at one position in the code (the state's action function), + * as opposed to the 'message-centric' view of e.g. the existing + * state machines of the LAPD(m) coe, where there is one message for + * eahc possible event (primitive), and the function then needs to + * concern itself on how to handle that event over all possible states. + * + * For each state, there is a bit-mask of permitted input events for + * this state, as well as a bit-mask of permitted new output states to + * which the state can change. Furthermore, there is a function + * pointer implementing the actual handling of the input events + * occurring whilst in thta state. + * + * Furthermore, each state offers a function pointer that can be + * executed just before leaving a state, and another one just after + * entering a state. + * + * When transitioning into a new state, an optional timer number and + * time-out can be passed along. The timer is started just after + * entering the new state, and will call the \ref osmo_fsm timer_cb + * function once it expires. This is intended to be used in telecom + * state machines where a given timer (identified by a certain number) + * is started to terminate the fsm or terminate the fsm once expected + * events are not happening before timeout expiration. + * + * As there can often be many concurrent FSMs of one given class, we + * introduce the concept of \ref osmo_fsm_inst, i.e. an FSM instance. + * The instance keeps the actual state, while the \ref osmo_fsm + * descriptor contains the static/const descriptor of the FSM's states + * and possible transitions. + * + * osmo_fsm are integrated with the libosmocore logging system. The + * logging sub-system is determined by the FSM descriptor, as we assume + * one FSM (let's say one related to a location update procedure) is + * inevitably always tied to a sub-system. The logging level however + * is configurable for each FSM instance, to ensure that e.g. DEBUG + * logging can be used for the LU procedure of one subscriber, while + * NOTICE level is used for all other subscribers. + * + * In order to attach private state to the \ref osmo_fsm_inst, it + * offers an opaque priv pointer. + * + */ + +static LLIST_HEAD(g_fsms); +static bool fsm_log_addr = true; + +/*! \brief specify if FSM instance addresses should be logged or not + * + * By default, the FSM name includes the pointer address of the \ref + * osmo_fsm_inst. This behaviro can be disabled (and re-enabled) + * using this function. + * + * \param[in] log_addr Indicate if FSM instance address shall be logged + */ +void osmo_fsm_log_addr(bool log_addr) +{ + fsm_log_addr = false; +} + +/*! \brief register a FSM with the core + * + * A FSM descriptor needs to be registered with the core before any + * instances can be created for it. + * + * \param[in] fsm Descriptor of Finite State Machine to be registered + * \returns 0 on success; negative on error + */ +int osmo_fsm_register(struct osmo_fsm *fsm) +{ + /* FIXME:check for duplicate name? */ + llist_add_tail(&fsm->list, &g_fsms); + INIT_LLIST_HEAD(&fsm->instances); + + return 0; +} + +/*! \brief unregister a FSM from the core + * + * Once the FSM descriptor is unregistered, active instances can still + * use it, but no new instances may be created for it. + * + * \param[in] fsm Descriptor of Finite State Machine to be removed + */ +void osmo_fsm_unregister(struct osmo_fsm *fsm) +{ + llist_del(&fsm->list); +} + +/* small wrapper function around timer expiration (for logging) */ +static void fsm_tmr_cb(void *data) +{ + struct osmo_fsm_inst *fi = data; + struct osmo_fsm *fsm = fi->fsm; + + LOGPFSM(fi, "Timeout of T%u\n", fi->T); + + fsm->timer_cb(fi); +} + +/*! \brief allocate a new instance of a specified FSM + * \param[in] fsm Descriptor of the FSM + * \param[in] ctx talloc context from which to allocate memory + * \param[in] priv private data reference store in fsm instance + * \param[in] log_level The log level for events of this FSM + * \returns newly-allocated, initialized and registered FSM instance + */ +struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, + int log_level, const char *id) +{ + struct osmo_fsm_inst *fi = talloc_zero(ctx, struct osmo_fsm_inst); + + fi->fsm = fsm; + fi->priv = priv; + fi->log_level = log_level; + fi->timer.data = fi; + fi->timer.cb = fsm_tmr_cb; + fi->id = id; + + if (!fsm_log_addr) { + if (id) + fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id); + else + fi->name = talloc_asprintf(fi, "%s", fsm->name); + } else { + if (id) + fi->name = talloc_asprintf(fi, "%s(%s)[%p]", fsm->name, + id, fi); + else + fi->name = talloc_asprintf(fi, "%s[%p]", fsm->name, fi); + } + + INIT_LLIST_HEAD(&fi->proc.children); + INIT_LLIST_HEAD(&fi->proc.child); + llist_add(&fi->list, &fsm->instances); + + LOGPFSM(fi, "Allocated\n"); + + return fi; +} + +/*! \brief allocate a new instance of a specified FSM as child of + * other FSM instance + * + * This is like \ref osmo_fsm_inst_alloc but using the parent FSM as + * talloc context, and inheriting the log level of the parent. + * + * \param[in] fsm Descriptor of the to-be-allocated FSM + * \param[in] parent Parent FSM instance + * \param[in] parent_term_event Event to be sent to parent when terminating + * \returns newly-allocated, initialized and registered FSM instance + */ +struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc(fsm, parent, NULL, parent->log_level, + parent->id); + if (!fi) { + /* indicate immediate termination to caller */ + osmo_fsm_inst_dispatch(parent, parent_term_event, NULL); + return NULL; + } + + LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); + + fi->proc.parent = parent; + fi->proc.parent_term_event = parent_term_event; + llist_add(&fi->proc.child, &parent->proc.children); + + return fi; +} + +/*! \brief delete a given instance of a FSM + * \param[in] fsm The FSM to be un-registered and deleted + */ +void osmo_fsm_inst_free(struct osmo_fsm_inst *fi) +{ + osmo_timer_del(&fi->timer); + llist_del(&fi->list); + talloc_free(fi); +} + +/*! \brief get human-readable name of FSM event + * \param[in] fsm FSM descriptor of event + * \param[in] event Event integer value + * \returns string rendering of the event + */ +const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event) +{ + static char buf[32]; + if (!fsm->event_names) { + snprintf(buf, sizeof(buf), "%u", event); + return buf; + } else + return get_value_string(fsm->event_names, event); +} + +/*! \brief get human-readable name of FSM instance + * \param[in] fi FSM instance + * \returns string rendering of the FSM identity + */ +const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi) +{ + if (!fi) + return "NULL"; + + if (fi->name) + return fi->name; + else + return fi->fsm->name; +} + +/*! \brief get human-readable name of FSM instance + * \param[in] fsm FSM descriptor + * \param[in] state FSM state number + * \returns string rendering of the FSM state + */ +const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state) +{ + static char buf[32]; + if (state >= fsm->num_states) { + snprintf(buf, sizeof(buf), "unknown %u", state); + return buf; + } else + return fsm->states[state].name; +} + +/*! \brief perform a state change of the given FSM instance + * + * All changes to the FSM instance state must be made via this + * function. It verifies that the existing state actually permits a + * transiiton to new_state. + * + * timeout_secs and T are optional parameters, and only have any effect + * if timeout_secs is not 0. If the timeout function is used, then the + * new_state is entered, and the FSM instances timer is set to expire + * in timeout_secs functions. At that time, the FSM's timer_cb + * function will be called for handling of the timeout by the user. + * + * \param[in] fi FSM instance whose state is to change + * \param[in] new_state The new state into which we should change + * \param[in] timeout_secs Timeout in seconds (if !=0) + * \param[in] T Timer number (if \ref timeout_secs != 0) + * \returns 0 on success; negative on error + */ +int osmo_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t new_state, + unsigned long timeout_secs, int T) +{ + struct osmo_fsm *fsm = fi->fsm; + uint32_t old_state = fi->state; + const struct osmo_fsm_state *st = &fsm->states[fi->state]; + + /* validate if new_state is a valid state */ + if (!(st->out_state_mask & (1 << new_state))) { + LOGP(fsm->log_subsys, LOGL_ERROR, "%s(%s): transition to " + "state %s not permitted!\n", + osmo_fsm_inst_name(fi), + osmo_fsm_state_name(fsm, fi->state), + osmo_fsm_state_name(fsm, new_state)); + return -EPERM; + } + + if (st->onleave) + st->onleave(fi, new_state); + + LOGPFSM(fi, "state_chg to %s\n", osmo_fsm_state_name(fsm, new_state)); + fi->state = new_state; + + if (st->onenter) + st->onenter(fi, old_state); + + if (timeout_secs) { + if (!fsm->timer_cb) + LOGP(fsm->log_subsys, LOGL_ERROR, "cannot start " + "timer for FSM without timer call-back\n"); + else { + fi->T = T; + osmo_timer_schedule(&fi->timer, timeout_secs, 0); + } + } + + return 0; +} + +/*! \brief dispatch an event to an osmocom finite state machine instance + * + * Any incoming events to \ref osmo_fsm instances must be dispatched to + * them via this function. It verifies, whether the event is permitted + * based on the current state of the FSM. If not, -1 is returned. + * + * \param[in] fi FSM instance + * \param[in] event Event to send to FSM instance + * \param[in] data Data to pass along with the event + * \returns 0 in case of success; negative on error + */ +int osmo_fsm_inst_dispatch(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct osmo_fsm *fsm; + const struct osmo_fsm_state *fs; + + if (!fi) { + LOGP(DLGLOBAL, LOGL_ERROR, "Trying to dispatch event %u to " + "non-existing FSM Instance!\n", event); + osmo_log_backtrace(DLGLOBAL, LOGL_ERROR); + return -ENODEV; + } + + fsm = fi->fsm; + OSMO_ASSERT(fi->state < fsm->num_states); + fs = &fi->fsm->states[fi->state]; + + LOGPFSM(fi, "Received Event %s\n", osmo_fsm_event_name(fsm, event)); + + if (((1 << event) & fsm->allstate_event_mask) && fsm->allstate_action) { + fsm->allstate_action(fi, event, data); + return 0; + } + + if (!((1 << event) & fs->in_event_mask)) { + LOGP(fsm->log_subsys, LOGL_ERROR, "%s(%s): Event %s not " + "permitted\n", osmo_fsm_inst_name(fi), + osmo_fsm_state_name(fsm, fi->state), + osmo_fsm_event_name(fsm, event)); + return -1; + } + fs->action(fi, event, data); + + return 0; +} + +/*! \brief Terminate FSM instance with given cause + * + * This safely terminates the given FSM instance by first iterating + * over all children and sending them a termination event. Next, it + * calls the FSM descriptors cleanup function (if any), followed by + * releasing any memory associated with the FSM instance. + * + * Finally, the parent FSM instance (if any) is notified using the + * parent termination event configured at time of FSM instance start. + * + * \param[in] fi FSM instance to be terminated + * \param[in] cause Cause / reason for termination + * \param[in] data Opaqueevent data to be passed to parent + */ +void osmo_fsm_inst_term(struct osmo_fsm_inst *fi, + enum osmo_fsm_term_cause cause, void *data) +{ + struct osmo_fsm_inst *child, *child2; + struct osmo_fsm_inst *parent = fi->proc.parent; + uint32_t parent_term_event = fi->proc.parent_term_event; + + LOGPFSM(fi, "Terminating (cause = %u)\n", cause); + + /* iterate over all children */ + llist_for_each_entry_safe(child, child2, &fi->proc.children, proc.child) { + /* terminate child */ + osmo_fsm_inst_term(child, OSMO_FSM_TERM_PARENT, NULL); + } + + /* delete ourselves from the parent */ + llist_del(&fi->proc.child); + + /* call destructor / clean-up function */ + if (fi->fsm->cleanup) + fi->fsm->cleanup(fi, cause); + + LOGPFSM(fi, "Release\n"); + osmo_fsm_inst_free(fi); + + /* indicate our termination to the parent */ + if (parent && cause != OSMO_FSM_TERM_PARENT) + osmo_fsm_inst_dispatch(parent, parent_term_event, data); +} + +/*! @} */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 55aaa07..73b2d6a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,7 +13,7 @@ vty/vty_test comp128/comp128_test utils/utils_test \ smscb/gsm0341_test stats/stats_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ - sim/sim_test tlv/tlv_test gsup/gsup_test + sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -118,6 +118,9 @@ gsup_gsup_test_SOURCES = gsup/gsup_test.c gsup_gsup_test_LDADD = $(top_builddir)/src/gsm/libosmogsm.la $(top_builddir)/src/libosmocore.la +fsm_fsm_test_SOURCES = fsm/fsm_test.c +fsm_fsm_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -152,7 +155,8 @@ vty/vty_test.ok comp128/comp128_test.ok \ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ - sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok + sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok \ + fsm/fsm_test.ok fsm/fsm_test.err DISTCLEANFILES = atconfig diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c new file mode 100644 index 0000000..84c2ae4 --- /dev/null +++ b/tests/fsm/fsm_test.c @@ -0,0 +1,155 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +enum { + DMAIN, +}; + +static void *g_ctx; + + +enum test_fsm_states { + ST_NULL = 0, + ST_ONE, + ST_TWO, +}; + +enum test_fsm_evt { + EV_A, + EV_B, +}; + +static void test_fsm_null(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case EV_A: + OSMO_ASSERT(data == (void *) 23); + osmo_fsm_inst_state_chg(fi, ST_ONE, 0, 0); + break; + default: + OSMO_ASSERT(0); + break; + } +} + +static void test_fsm_one(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case EV_B: + OSMO_ASSERT(data == (void *) 42); + osmo_fsm_inst_state_chg(fi,ST_TWO, 1, 2342); + break; + default: + OSMO_ASSERT(0); + break; + } +} + +static void test_fsm_tmr_cb(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi->T == 2342); + OSMO_ASSERT(fi->state == ST_TWO); + LOGP(DMAIN, LOGL_INFO, "Timer\n"); + + exit(0); +} + +static struct osmo_fsm_state test_fsm_states[] = { + [ST_NULL] = { + .in_event_mask = (1 << EV_A), + .out_state_mask = (1 << ST_ONE), + .name = "NULL", + .action = test_fsm_null, + }, + [ST_ONE]= { + .in_event_mask = (1 << EV_B), + .out_state_mask = (1 << ST_TWO), + .name = "ONE", + .action= test_fsm_one, + }, + [ST_TWO]= { + .in_event_mask = 0, + .name = "TWO", + .action = NULL, + }, +}; + +static struct osmo_fsm fsm = { + .name = "Test FSM", + .states = test_fsm_states, + .num_states = ARRAY_SIZE(test_fsm_states), + .log_subsys = DMAIN, +}; + +static int foo(void) +{ + struct osmo_fsm_inst *fi; + + LOGP(DMAIN, LOGL_INFO, "Checking FSM allocation\n"); + fi = osmo_fsm_inst_alloc(&fsm, g_ctx, NULL, LOGL_DEBUG, NULL); + OSMO_ASSERT(fi); + OSMO_ASSERT(fi->fsm == &fsm); + OSMO_ASSERT(!strncmp(osmo_fsm_inst_name(fi), fsm.name, strlen(fsm.name))); + OSMO_ASSERT(fi->state == ST_NULL); + OSMO_ASSERT(fi->log_level == LOGL_DEBUG); + + /* Try invalid state transition */ + osmo_fsm_inst_dispatch(fi, EV_B, (void *) 42); + OSMO_ASSERT(fi->state == ST_NULL); + + /* Legitimate state transition */ + osmo_fsm_inst_dispatch(fi, EV_A, (void *) 23); + OSMO_ASSERT(fi->state == ST_ONE); + + /* Legitimate transition with timer */ + fsm.timer_cb = test_fsm_tmr_cb; + osmo_fsm_inst_dispatch(fi, EV_B, (void *) 42); + OSMO_ASSERT(fi->state == ST_TWO); + + + return 0; +} + +static const struct log_info_cat default_categories[] = { + [DMAIN] = { + .name = "DMAIN", + .description = "Main", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +int main(int argc, char **argv) +{ + struct log_target *stderr_target; + + osmo_fsm_log_addr(false); + + log_init(&log_info, NULL); + stderr_target = log_target_create_stderr(); + log_add_target(stderr_target); + log_set_print_filename(stderr_target, 0); + + g_ctx = NULL; + osmo_fsm_register(&fsm); + + foo(); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} diff --git a/tests/fsm/fsm_test.err b/tests/fsm/fsm_test.err new file mode 100644 index 0000000..b9c738c --- /dev/null +++ b/tests/fsm/fsm_test.err @@ -0,0 +1,11 @@ +Checking FSM allocation +Test FSM{NULL}: Allocated +Test FSM{NULL}: Received Event 1 +Test FSM(NULL): Event 1 not permitted +Test FSM{NULL}: Received Event 0 +Test FSM{NULL}: state_chg to ONE +Test FSM{ONE}: Received Event 1 +Test FSM{ONE}: state_chg to TWO +Test FSM{TWO}: Timeout of T2342 +Timer + \ No newline at end of file diff --git a/tests/fsm/fsm_test.ok b/tests/fsm/fsm_test.ok new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/fsm/fsm_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index d49f7ff..93373c1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -201,3 +201,10 @@ cat $abs_srcdir/gsup/gsup_test.ok > expout AT_CHECK([$abs_top_builddir/tests/gsup/gsup_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([fsm]) +AT_KEYWORDS([fsm]) +cat $abs_srcdir/fsm/fsm_test.ok > expout +cat $abs_srcdir/fsm/fsm_test.err > experr +AT_CHECK([$abs_top_builddir/tests/fsm/fsm_test], [0], [expout], [experr]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:17:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:17:07 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: TS flags: rename one, add three, as enum In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: TS flags: rename one, add three, as enum ...................................................................... dyn PDCH: TS flags: rename one, add three, as enum Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth value's meaning. Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and possibly other BTS implementations) to remember what to do when the PCU replies with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both. Change from #define to an enum. Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH commits, so osmo-bts submission depends on this commit. Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/bsc_vty.c 3 files changed, 12 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 0b6bf60..e46647c 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -332,7 +332,14 @@ #endif }; -#define TS_F_PDCH_MODE 0x1000 +enum { + TS_F_PDCH_ACTIVE = 0x1000, + TS_F_PDCH_ACT_PENDING = 0x2000, + TS_F_PDCH_DEACT_PENDING = 0x4000, + TS_F_PDCH_PENDING_MASK = 0x6000 /*< + TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ +} gsm_bts_trx_ts_flags; + /* One Timeslot in a TRX */ struct gsm_bts_trx_ts { struct gsm_bts_trx *trx; diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 59176df..338c00a 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -472,7 +472,7 @@ /* if channel is in PDCH mode, deactivate PDCH first */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH - && (lchan->ts->flags & TS_F_PDCH_MODE)) { + && (lchan->ts->flags & TS_F_PDCH_ACTIVE)) { /* store activation type and handover reference */ lchan->dyn_pdch.act_type = act_type; lchan->dyn_pdch.ho_ref = ho_ref; @@ -1203,7 +1203,7 @@ static int rsl_rx_pdch_act_ack(struct msgb *msg) { - msg->lchan->ts->flags |= TS_F_PDCH_MODE; + msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; /* We have activated PDCH, so now the channel is available again. */ do_lchan_free(msg->lchan); @@ -1213,7 +1213,7 @@ static int rsl_rx_pdch_deact_ack(struct msgb *msg) { - msg->lchan->ts->flags &= ~TS_F_PDCH_MODE; + msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE; rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, msg->lchan->dyn_pdch.ho_ref); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index b0f2f62..578b005 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -919,7 +919,7 @@ gsm_pchan_name(ts->pchan), gsm_ts_tsc(ts)); if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) vty_out(vty, " (%s mode)", - ts->flags & TS_F_PDCH_MODE ? "PDCH" : "TCH/F"); + ts->flags & TS_F_PDCH_ACTIVE ? "PDCH" : "TCH/F"); vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " NM State: "); net_dump_nmstate(vty, &ts->mo.nm_state); -- To view, visit https://gerrit.osmocom.org/280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:24:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:24:25 +0000 Subject: [MERGED] osmo-bts[master]: pcu_sock: add pcu_connected() to query PCU availability In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: pcu_sock: add pcu_connected() to query PCU availability ...................................................................... pcu_sock: add pcu_connected() to query PCU availability Will be used in upcoming dyn PDCH switching. Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a --- M include/osmo-bts/pcu_if.h M src/common/pcu_sock.c 2 files changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 0c4fb69..3ce4d0b 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -19,4 +19,6 @@ int pcu_sock_init(const char *path); void pcu_sock_exit(void); +bool pcu_connected(void); + #endif /* _PCU_IF_H */ diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 7c835fb..ea4267d 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -922,3 +922,13 @@ return 0; } +bool pcu_connected(void) { + struct gsm_network *net = &bts_gsmnet; + struct pcu_sock_state *state = net->pcu_state; + + if (!state) + return false; + if (state->conn_bfd.fd <= 0) + return false; + return true; +} -- To view, visit https://gerrit.osmocom.org/291 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:30:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:30:00 +0000 Subject: [MERGED] osmo-bts[master]: tests/stubs.c: remove unused stubs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: tests/stubs.c: remove unused stubs ...................................................................... tests/stubs.c: remove unused stubs Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b --- M tests/stubs.c 1 file changed, 0 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/stubs.c b/tests/stubs.c index 17354b7..d6ef263 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -13,11 +13,6 @@ int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg, struct tlv_parsed *new_attr, int kind, void *obj) { return 0; } -int bts_model_rsl_chan_rel(struct gsm_lchan *lchan) -{ return 0;} - -int bts_model_rsl_deact_sacch(struct gsm_lchan *lchan) -{ return 0; } int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) { return 0; } @@ -30,19 +25,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { return 0; } -int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp) -{ return 0; } -int bts_model_rsl_mode_modify(struct gsm_lchan *lchan) -{ return 0; } -int bts_model_rsl_chan_mod(struct gsm_lchan *lchan) -{ return 0; } -void bts_model_rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl, - unsigned int rtp_pl_len) {} int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap) -{ return 0; } - -int l1if_pdch_req(struct gsm_bts_trx_ts *ts, int is_ptcch, uint32_t fn, - uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len) { return 0; } uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) -- To view, visit https://gerrit.osmocom.org/285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:30:08 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:30:08 +0000 Subject: [MERGED] osmo-bts[master]: fix typo in error message ('at lEast') In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix typo in error message ('at lEast') ...................................................................... fix typo in error message ('at lEast') Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f --- M src/common/main.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/main.c b/src/common/main.c index d19c284..5e0f1a1 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -287,7 +287,7 @@ } if (!phy_link_by_num(0)) { - fprintf(stderr, "You need to configure at last phy0\n"); + fprintf(stderr, "You need to configure at least phy0\n"); exit(1); } -- To view, visit https://gerrit.osmocom.org/286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:31:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:31:03 +0000 Subject: [MERGED] osmo-bts[master]: oml, Set Chan Attr: treat unknown PCHAN types as error In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: oml, Set Chan Attr: treat unknown PCHAN types as error ...................................................................... oml, Set Chan Attr: treat unknown PCHAN types as error Change-Id: Id79585993df15362ba0e1271d03302597182ceff --- M src/common/oml.c 1 file changed, 9 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/oml.c b/src/common/oml.c index 86ec1bf..bee2f84 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -736,8 +736,9 @@ lchan->type = GSM_LCHAN_PDTCH; break; default: - /* FIXME */ - break; + LOGP(DOML, LOGL_ERROR, "Unknown/unhandled PCHAN type: %u %s\n", + ts->pchan, gsm_pchan_name(ts->pchan)); + return -NM_NACK_PARAM_RANGE; } return 0; } @@ -790,7 +791,12 @@ if (TLVP_PRESENT(&tp, NM_ATT_CHAN_COMB)) { uint8_t comb = *TLVP_VAL(&tp, NM_ATT_CHAN_COMB); ts->pchan = abis_nm_pchan4chcomb(comb); - conf_lchans_for_pchan(ts); + rc = conf_lchans_for_pchan(ts); + if (rc < 0) { + talloc_free(tp_merged); + /* Send NACK */ + return oml_fom_ack_nack(msg, -rc); + } } /* 9.4.5 ARFCN List */ -- To view, visit https://gerrit.osmocom.org/290 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id79585993df15362ba0e1271d03302597182ceff Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:23 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: rsl rx dchan: also log ip.access message names In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/292 to look at the new patch set (#2). dyn PDCH: rsl rx dchan: also log ip.access message names The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan() should be able to log ip.access message types properly. Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f --- M src/common/rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/292/2 diff --git a/src/common/rsl.c b/src/common/rsl.c index dddde69..7e8d48c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1838,13 +1838,13 @@ msg->lchan = rsl_lchan_lookup(trx, dch->chan_nr); if (!msg->lchan) { LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknow lchan\n", - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); msgb_free(msg); return report_error(trx); } LOGP(DRSL, LOGL_INFO, "%s Rx RSL %s\n", gsm_lchan_name(msg->lchan), - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); switch (dch->c.msg_type) { case RSL_MT_CHAN_ACTIV: -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:23 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/293 to look at the new patch set (#2). dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH Depending on the PDCH active flag, handle a TCH/F_PDCH like TCH/F or PDCH. Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 --- M src/common/oml.c 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/293/2 diff --git a/src/common/oml.c b/src/common/oml.c index bee2f84..9d3c454 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -689,14 +689,19 @@ { struct gsm_lchan *lchan; unsigned int i; + enum gsm_phys_chan_config pchan = ts->pchan; - switch (ts->pchan) { + if (pchan == GSM_PCHAN_TCH_F_PDCH) + pchan = ts->flags & TS_F_PDCH_ACTIVE? GSM_PCHAN_PDCH + : GSM_PCHAN_TCH_F; + + switch (pchan) { case GSM_PCHAN_CCCH_SDCCH4_CBCH: /* fallthrough */ case GSM_PCHAN_CCCH_SDCCH4: for (i = 0; i < 4; i++) { lchan = &ts->lchan[i]; - if (ts->pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH + if (pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH && i == 2) { lchan->type = GSM_LCHAN_CBCH; } else { @@ -723,7 +728,7 @@ case GSM_PCHAN_SDCCH8_SACCH8C: for (i = 0; i < 8; i++) { lchan = &ts->lchan[i]; - if (ts->pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH + if (pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH && i == 2) { lchan->type = GSM_LCHAN_CBCH; } else { -- To view, visit https://gerrit.osmocom.org/293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:23 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for T... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/294 to look at the new patch set (#2). dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH It is cosmetic since the 'default:' case already caught TCH_F_PDCH, but it's good to mention all expected pchans explicitly. Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f --- M src/osmo-bts-sysmo/oml.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/294/2 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 6951f84..60ab7a8 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -525,6 +525,7 @@ case GSM_PCHAN_CCCH: case GSM_PCHAN_TCH_F: case GSM_PCHAN_PDCH: + case GSM_PCHAN_TCH_F_PDCH: case GSM_PCHAN_UNKNOWN: default: return GsmL1_SubCh_NA; -- To view, visit https://gerrit.osmocom.org/294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:23 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/295 to look at the new patch set (#2). dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH. Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave ts_connect() as a thin wrapper to leave init code unchanged. Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 --- M src/osmo-bts-sysmo/oml.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/295/2 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 5d24bcb..ce8d2f4 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -480,7 +480,9 @@ } } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan, + l1if_compl_cb *cb, void *data) { struct msgb *msg = l1p_msgb_alloc(); struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); @@ -489,9 +491,14 @@ cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; - cr->logChComb = pchan_to_logChComb[ts->pchan]; + cr->logChComb = pchan_to_logChComb[pchan]; - return l1if_gsm_req_compl(fl1h, msg, opstart_compl_cb, NULL); + return l1if_gsm_req_compl(fl1h, msg, cb, NULL); +} + +static int ts_connect(struct gsm_bts_trx_ts *ts) +{ + return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL); } GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan) -- To view, visit https://gerrit.osmocom.org/295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:23 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs Message-ID: Review at https://gerrit.osmocom.org/306 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH. All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT or DEACT *NACK* to be sent to the BSC as soon as these messages are handled. Also add stubs in tests. Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d --- M include/osmo-bts/bts_model.h M src/osmo-bts-litecell15/oml.c M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/oml.c M src/osmo-bts-trx/l1_if.c M tests/handover/handover_test.c M tests/stubs.c 7 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/06/306/1 diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index 6252557..7e2d088 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -55,4 +55,7 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink); void bts_model_phy_instance_set_defaults(struct phy_instance *pinst); +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts); +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan); + #endif diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 7aedee1..fa9f601 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1764,3 +1764,14 @@ { return l1if_set_txpower(trx_lc15l1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 401201a..c893b04 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1585,3 +1585,14 @@ #warning "Implement bts_model_change_power based on TRX_MODIFY_RF_CID" return 0; } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 60ab7a8..5d24bcb 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1837,3 +1837,14 @@ { return l1if_set_txpower(trx_femtol1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 8ccba90..59442d9 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -747,3 +747,14 @@ LOGP(DL1C, LOGL_NOTICE, "Setting TRX output power not supported!\n"); return 0; } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 8b299d0..e1f4d86 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -275,3 +275,5 @@ int bts_model_trx_close(struct gsm_bts_trx *trx) { return 0; } void trx_get_hlayer1(void) {} int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { return 0; } +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { return 0; } +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { return 0; } diff --git a/tests/stubs.c b/tests/stubs.c index d6ef263..c15a315 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -43,3 +43,10 @@ void bts_model_abis_close(struct gsm_bts *bts) { } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ return 0; } + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ return 0; } -- To view, visit https://gerrit.osmocom.org/306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode Message-ID: Review at https://gerrit.osmocom.org/307 dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode Introduce a static function to encapsulate the decision whether a TS is used for PDCH. Depending on the ts->flags, handle a TCH/F_PDCH TS exactly like a standard PDCH TS. Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b --- M src/common/pcu_sock.c 1 file changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/307/1 diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index ea4267d..cfffb2e 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -95,6 +95,24 @@ return msg; } +static bool ts_is_pdch(struct gsm_bts_trx_ts *ts) { + if (ts->pchan == GSM_PCHAN_PDCH) + return true; + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + /* When we're busy deactivating the PDCH, we first set + * DEACT_PENDING, tell the PCU about it and wait for a + * response. So DEACT_PENDING means "no PDCH" to the PCU. + * Similarly, when we're activating PDCH, we set the + * ACT_PENDING and wait for an activation response from the + * PCU, so ACT_PENDING means "is PDCH". */ + if (ts->flags & TS_F_PDCH_ACTIVE) + return !(ts->flags & TS_F_PDCH_DEACT_PENDING); + else + return (ts->flags & TS_F_PDCH_ACT_PENDING); + } + return false; +} + int pcu_tx_info_ind(void) { struct gsm_network *net = &bts_gsmnet; @@ -207,7 +225,7 @@ for (j = 0; j < 8; j++) { ts = &trx->ts[j]; if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED - && ts->pchan == GSM_PCHAN_PDCH) { + && ts_is_pdch(ts)) { info_ind->trx[i].pdch_mask |= (1 << j); info_ind->trx[i].tsc[j] = (ts->tsc >= 0) ? ts->tsc : bts->bsic & 7; -- To view, visit https://gerrit.osmocom.org/307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ... Message-ID: Review at https://gerrit.osmocom.org/308 dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/308/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 14de251..0330308 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -611,11 +611,23 @@ return l1sap_up(trx, &l1sap); } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) + return ts->pchan; + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + switch (sapi) { case GsmL1_Sapi_Bcch: cbits = 0x10; @@ -724,7 +736,7 @@ uint32_t fn; /* check if primitive should be handled by common part */ - chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi, rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn); if (chan_nr) { fn = rts_ind->u32Fn; @@ -848,7 +860,7 @@ uint32_t fn; int rc = 0; - chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " -- To view, visit https://gerrit.osmocom.org/308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: implement main dyn PDCH logic in common/ Message-ID: Review at https://gerrit.osmocom.org/309 dyn PDCH: implement main dyn PDCH logic in common/ React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_* APIs to effect switchover. The dyn PDCH interaction is described in the comment to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover. In case the bts_model_ts_* are not implemented (or return other errors), reply with an IPAC PDCH ACT/DEACT NACK. Add callbacks that mark steps in the PDCH switchover process, dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete(). Add hooks in l1sap.c on channel activation and release confirmation, to call dyn PDCH callbacks. BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and dyn_pdch_ts_connected() when bts_model_ts_disconnect() or bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS) Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab --- M include/osmo-bts/rsl.h M src/common/l1sap.c M src/common/rsl.c 3 files changed, 284 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/09/309/1 diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 6cb40dd..173e086 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -35,5 +35,9 @@ struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr); +void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts); +void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts); +void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc); + #endif // _RSL_H */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 163e129..0af7343 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -440,6 +440,12 @@ else rsl_tx_chan_act_ack(lchan); + /* During PDCH ACT, this is where we know that the PCU is done + * activating a PDCH, and PDCH switchover is complete. See + * rsl_rx_dyn_pdch() */ + if (lchan->ts->flags & TS_F_PDCH_ACT_PENDING) + dyn_pdch_complete(lchan->ts, info_act_cnf->cause? -EIO : 0); + return 0; } @@ -457,6 +463,12 @@ rsl_tx_rf_rel_ack(lchan); + /* During PDCH DEACT, this marks the deactivation of the PDTCH as + * requested by the PCU. Next up, we disconnect the TS completely and + * call back to dyn_pdch_ts_disconnected(). See rsl_rx_dyn_pdch(). */ + if (lchan->ts->flags & TS_F_PDCH_DEACT_PENDING) + bts_model_ts_disconnect(lchan->ts); + return 0; } diff --git a/src/common/rsl.c b/src/common/rsl.c index 7e8d48c..3f32c1b 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1622,6 +1622,269 @@ } /* + * dynamic TCH/F_PDCH related messages, originally ip.access specific but + * reused for other BTS models (sysmo-bts, ...) + */ + +/* PDCH ACT/DEACT ACKNOWLEDGE */ +static int rsl_tx_dyn_pdch_ack(struct gsm_lchan *lchan, bool pdch_act) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s ACK\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT"); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + msg->len = 0; + msg->data = msg->tail = msg->l3h; + + rsl_dch_push_hdr(msg, + pdch_act? RSL_MT_IPAC_PDCH_ACT_ACK + : RSL_MT_IPAC_PDCH_DEACT_ACK, + chan_nr); + msg->lchan = lchan; + msg->trx = lchan->ts->trx; + + return abis_bts_rsl_sendmsg(msg); +} + +/* PDCH ACT/DEACT NEGATIVE ACKNOWLEDGE */ +static int rsl_tx_dyn_pdch_nack(struct gsm_lchan *lchan, bool pdch_act, + uint8_t cause) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s NACK (cause = 0x%02x)\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", cause); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + msg->len = 0; + msg->data = msg->tail = msg->l3h; + + /* 9.3.26 Cause */ + msgb_tlv_put(msg, RSL_IE_CAUSE, 1, &cause); + rsl_dch_push_hdr(msg, + pdch_act? RSL_MT_IPAC_PDCH_ACT_NACK + : RSL_MT_IPAC_PDCH_DEACT_NACK, + chan_nr); + msg->lchan = lchan; + msg->trx = lchan->ts->trx; + + return abis_bts_rsl_sendmsg(msg); +} + +/* Starting point for dynamic PDCH switching. See doc/dyn_pdch.msc for a + * diagram of what will happen here. The implementation is as follows: + * + * PDCH ACT == TCH/F -> PDCH: + * 1. call bts_model_ts_disconnect() to disconnect TCH/F; + * 2. dyn_pdch_ts_disconnected() is called when done; + * 3. call bts_model_ts_connect() to connect as PDTCH; + * 4. dyn_pdch_ts_connected() is called when done; + * 5. instruct the PCU to enable PDTCH; + * 6. the PCU will call back with an activation request; + * 7. l1sap_info_act_cnf() will call dyn_pdch_complete() when SAPI activations + * are done; + * 8. send a PDCH ACT ACK. + * + * PDCH DEACT == PDCH -> TCH/F: + * 1. instruct the PCU to disable PDTCH; + * 2. the PCU will call back with a deactivation request; + * 3. l1sap_info_rel_cnf() will call bts_model_ts_disconnect() when SAPI + * deactivations are done; + * 4. dyn_pdch_ts_disconnected() is called when done; + * 5. call bts_model_ts_connect() to connect as TCH/F; + * 6. dyn_pdch_ts_connected() is called when done; + * 7. directly call dyn_pdch_complete(), since no further action required for + * TCH/F; + * 8. send a PDCH DEACT ACK. + * + * When an error happens along the way, a PDCH DE/ACT NACK is sent. + * TODO: may need to be made more waterproof in all stages, to send a NACK and + * clear the PDCH pending flags from ts->flags. + */ +static void rsl_rx_dyn_pdch(struct msgb *msg, bool pdch_act) +{ + int rc; + struct gsm_lchan *lchan = msg->lchan; + struct gsm_bts_trx_ts *ts = lchan->ts; + bool is_pdch_act = (ts->flags & TS_F_PDCH_ACTIVE); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) { + /* Only one of the pending flags should ever be set at the same + * time, but just log both in case both should be set. */ + LOGP(DL1C, LOGL_ERROR, + "%s Request to PDCH %s, but PDCH%s%s is still pending\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", + (ts->flags & TS_F_PDCH_ACT_PENDING)? " ACT" : "", + (ts->flags & TS_F_PDCH_DEACT_PENDING)? " DEACT" : ""); + rsl_tx_dyn_pdch_nack(lchan, pdch_act, RSL_ERR_NORMAL_UNSPEC); + return; + } + + ts->flags |= pdch_act? TS_F_PDCH_ACT_PENDING + : TS_F_PDCH_DEACT_PENDING; + + /* ensure that this is indeed a dynamic-PDCH channel */ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_ERROR, + "%s Attempt to PDCH %s on TS that is not a TCH/F_PDCH (is %s)\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", + gsm_pchan_name(ts->pchan)); + dyn_pdch_complete(ts, -EINVAL); + return; + } + + if (is_pdch_act == pdch_act) { + LOGP(DL1C, LOGL_NOTICE, + "%s Request to PDCH %s, but is already so\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT"); + dyn_pdch_complete(ts, 0); + return; + } + + if (pdch_act) { + /* First, disconnect the TCH channel, to connect PDTCH later */ + rc = bts_model_ts_disconnect(ts); + } else { + /* First, deactivate PDTCH through the PCU, to connect TCH + * later. + * pcu_tx_info_ind() will pick up TS_F_PDCH_DEACT_PENDING and + * trigger a deactivation. + * Except when the PCU is not connected yet, then trigger + * disconnect immediately from here. The PCU will catch up when + * it connects. */ + /* TODO: timeout on channel connect / disconnect request from PCU? */ + if (pcu_connected()) + rc = pcu_tx_info_ind(); + else + rc = bts_model_ts_disconnect(ts); + } + + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); +} + +void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts) +{ + int rc; + enum gsm_phys_chan_config as_pchan; + + if (ts->flags & TS_F_PDCH_DEACT_PENDING) { + LOGP(DRSL, LOGL_DEBUG, + "%s PDCH DEACT operation: channel disconnected, will reconnect as TCH\n", + gsm_lchan_name(ts->lchan)); + ts->lchan[0].type = GSM_LCHAN_TCH_F; + as_pchan = GSM_PCHAN_TCH_F; + } else if (ts->flags & TS_F_PDCH_ACT_PENDING) { + LOGP(DRSL, LOGL_DEBUG, + "%s PDCH ACT operation: channel disconnected, will reconnect as PDTCH\n", + gsm_lchan_name(ts->lchan)); + ts->lchan[0].type = GSM_LCHAN_PDTCH; + as_pchan = GSM_PCHAN_PDCH; + } + + rc = bts_model_ts_connect(ts, as_pchan); + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); +} + +void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts) +{ + int rc; + + if (ts->flags & TS_F_PDCH_DEACT_PENDING) { + if (ts->lchan[0].type != GSM_LCHAN_TCH_F) + LOGP(DRSL, LOGL_ERROR, "%s PDCH DEACT error:" + " timeslot connected, so expecting" + " lchan type TCH/F, but is %s\n", + gsm_lchan_name(ts->lchan), + gsm_chant_name(ts->lchan[0].type)); + + LOGP(DRSL, LOGL_DEBUG, "%s PDCH DEACT operation:" + " timeslot connected as TCH/F\n", + gsm_lchan_name(ts->lchan)); + + /* During PDCH DEACT, we're done right after the TCH/F came + * back up. */ + dyn_pdch_complete(ts, 0); + + } else if (ts->flags & TS_F_PDCH_ACT_PENDING) { + if (ts->lchan[0].type != GSM_LCHAN_PDTCH) + LOGP(DRSL, LOGL_ERROR, "%s PDCH ACT error:" + " timeslot connected, so expecting" + " lchan type PDTCH, but is %s\n", + gsm_lchan_name(ts->lchan), + gsm_chant_name(ts->lchan[0].type)); + + LOGP(DRSL, LOGL_DEBUG, "%s PDCH ACT operation:" + " timeslot connected as PDTCH\n", + gsm_lchan_name(ts->lchan)); + + /* The PDTCH is connected, now tell the PCU about it. Except + * when the PCU is not connected (yet), then there's nothing + * left to do now. The PCU will catch up when it connects. */ + if (!pcu_connected()) { + dyn_pdch_complete(ts, 0); + return; + } + + /* The PCU will request to activate the PDTCH SAPIs, which, + * when done, will call back to dyn_pdch_complete(). */ + /* TODO: timeout on channel connect / disconnect request from PCU? */ + rc = pcu_tx_info_ind(); + + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); + } +} + +void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc) +{ + bool pdch_act = ts->flags & TS_F_PDCH_ACT_PENDING; + + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == TS_F_PDCH_PENDING_MASK) + LOGP(DRSL, LOGL_ERROR, + "%s Internal Error: both PDCH ACT and PDCH DEACT pending\n", + gsm_lchan_name(ts->lchan)); + + ts->flags &= ~TS_F_PDCH_PENDING_MASK; + + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "PDCH %s on dynamic TCH/F_PDCH returned error %d\n", + pdch_act? "ACT" : "DEACT", rc); + rsl_tx_dyn_pdch_nack(ts->lchan, pdch_act, RSL_ERR_NORMAL_UNSPEC); + return; + } + + if (pdch_act) + ts->flags |= TS_F_PDCH_ACTIVE; + else + ts->flags &= ~TS_F_PDCH_ACTIVE; + DEBUGP(DL1C, "%s %s switched to %s mode (ts->flags == %x)\n", + gsm_lchan_name(ts->lchan), gsm_pchan_name(ts->pchan), + pdch_act? "PDCH" : "TCH/F", ts->flags); + + rc = rsl_tx_dyn_pdch_ack(ts->lchan, pdch_act); + if (rc) + LOGP(DRSL, LOGL_ERROR, + "Failed to transmit PDCH %s ACK, rc %d\n", + pdch_act? "ACT" : "DEACT", rc); +} + +/* * selecting message */ @@ -1868,6 +2131,11 @@ case RSL_MT_MS_POWER_CONTROL: ret = rsl_rx_ms_pwr_ctrl(msg); break; + case RSL_MT_IPAC_PDCH_ACT: + case RSL_MT_IPAC_PDCH_DEACT: + rsl_rx_dyn_pdch(msg, dch->c.msg_type == RSL_MT_IPAC_PDCH_ACT); + ret = 0; + break; case RSL_MT_PHY_CONTEXT_REQ: case RSL_MT_PREPROC_CONFIG: case RSL_MT_RTD_REP: -- To view, visit https://gerrit.osmocom.org/309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F Message-ID: Review at https://gerrit.osmocom.org/310 dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef --- M src/osmo-bts-sysmo/oml.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/10/310/1 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index ce8d2f4..2eafa71 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -86,7 +86,8 @@ [GSM_PCHAN_SDCCH8_SACCH8C] = GsmL1_LogChComb_VII, [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = GsmL1_LogChComb_VII, [GSM_PCHAN_PDCH] = GsmL1_LogChComb_XIII, - //[GSM_PCHAN_TCH_F_PDCH] = FIXME, + [GSM_PCHAN_TCH_F_PDCH] = GsmL1_LogChComb_I, /*< first init + like TCH/F, until PDCH ACT */ [GSM_PCHAN_UNKNOWN] = GsmL1_LogChComb_0, }; -- To view, visit https://gerrit.osmocom.org/310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() Message-ID: Review at https://gerrit.osmocom.org/311 dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1. Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in common/rsl.c. Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb to invoke dyn_pdch_connected() in common/rsl.c. Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae --- M src/osmo-bts-sysmo/oml.c 1 file changed, 49 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/311/1 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 2eafa71..559c6a5 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1846,13 +1846,60 @@ return l1if_set_txpower(trx_femtol1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } +static int ts_disconnect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphDisconnectCnf_t *cnf = &l1p->u.mphDisconnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + LOGP(DL1C, LOGL_DEBUG, "%s Rx mphDisconnectCnf\n", + gsm_lchan_name(ts->lchan)); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_disconnected(ts); + + return 0; +} + int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { - return -ENOTSUP; + struct msgb *msg = l1p_msgb_alloc(); + struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); + GsmL1_MphDisconnectReq_t *cr; + + DEBUGP(DRSL, "%s TS disconnect\n", gsm_lchan_name(ts->lchan)); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDisconnectReq, fl1h, + l1p_handle_for_ts(ts)); + cr->u8Tn = ts->nr; + + return l1if_gsm_req_compl(fl1h, msg, ts_disconnect_cb, NULL); +} + +static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphConnectCnf_t *cnf = &l1p->u.mphConnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + DEBUGP(DL1C, "%s %s Rx mphConnectCnf flags=%s%s%s\n", + gsm_lchan_name(ts->lchan), + gsm_pchan_name(ts->pchan), + ts->flags & TS_F_PDCH_ACTIVE ? "ACTIVE " : "", + ts->flags & TS_F_PDCH_ACT_PENDING ? "ACT_PENDING " : "", + ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : ""); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_connected(ts); + + return 0; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return -ENOTSUP; + return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: error log: two minor clarifications Message-ID: Review at https://gerrit.osmocom.org/312 error log: two minor clarifications Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779 --- M src/common/pcu_sock.c M src/common/rsl.c 2 files changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/12/312/1 diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index cfffb2e..d52cdb1 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -556,8 +556,10 @@ lchan = trx->ts[act_req->ts_nr].lchan; lchan->rel_act_kind = LCHAN_REL_ACT_PCU; if (lchan->type != GSM_LCHAN_PDTCH) { - LOGP(DPCU, LOGL_ERROR, "Lchan is not of type PDCH, but %d.\n", - lchan->type); + LOGP(DPCU, LOGL_ERROR, + "%s request, but lchan is not of type PDTCH (is %s)\n", + (act_req->activate) ? "Activate" : "Deactivate", + gsm_lchant_name(lchan->type)); return -EINVAL; } if (act_req->activate) diff --git a/src/common/rsl.c b/src/common/rsl.c index 3f32c1b..2dd3888 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -755,7 +755,7 @@ if (lchan->state != LCHAN_S_NONE) { LOGP(DRSL, LOGL_ERROR, - "%s: error lchan is not available state: %s.\n", + "%s: error: lchan is not available, but in state: %s.\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL); } -- To view, visit https://gerrit.osmocom.org/312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:24 +0000 Subject: [PATCH] osmo-bts[master]: debug log: log lchan state transitions Message-ID: Review at https://gerrit.osmocom.org/313 debug log: log lchan state transitions Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23 --- M src/common/lchan.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/13/313/1 diff --git a/src/common/lchan.c b/src/common/lchan.c index 5b6786a..fbc2636 100644 --- a/src/common/lchan.c +++ b/src/common/lchan.c @@ -19,9 +19,15 @@ * */ +#include +#include #include void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state) { + DEBUGP(DL1C, "%s state %s -> %s\n", + gsm_lchan_name(lchan), + gsm_lchans_name(lchan->state), + gsm_lchans_name(state)); lchan->state = state; } -- To view, visit https://gerrit.osmocom.org/313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:51:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:51:25 +0000 Subject: [PATCH] osmo-bts[master]: debug log: log TS pchan type on connect Message-ID: Review at https://gerrit.osmocom.org/314 debug log: log TS pchan type on connect A whitespace error is fixed along the way. Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d --- M src/osmo-bts-sysmo/oml.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/314/1 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 559c6a5..0700561 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -493,7 +493,11 @@ l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; cr->logChComb = pchan_to_logChComb[pchan]; - + + DEBUGP(DL1C, "%s pchan=%s ts_connect_as(%s) logChComb=%d\n", + gsm_lchan_name(ts->lchan), gsm_pchan_name(ts->pchan), + gsm_pchan_name(pchan), cr->logChComb); + return l1if_gsm_req_compl(fl1h, msg, cb, NULL); } -- To view, visit https://gerrit.osmocom.org/314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:52:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:52:06 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect) ...................................................................... dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect) Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704 --- M openbsc/src/libbsc/bsc_dyn_pdch.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c index 717880b..6e5fe83 100644 --- a/openbsc/src/libbsc/bsc_dyn_pdch.c +++ b/openbsc/src/libbsc/bsc_dyn_pdch.c @@ -27,6 +27,8 @@ { int rc; + ts->flags &= ~(TS_F_PDCH_PENDING_MASK | TS_F_PDCH_ACTIVE); + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on" " BTS %u TRX %u TS %u\n", -- To view, visit https://gerrit.osmocom.org/281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:52:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:52:06 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: track pending PDCH de-/activation In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: track pending PDCH de-/activation ...................................................................... dyn PDCH: track pending PDCH de-/activation Set and clear pending flags on the TS according to PDCH de-/activation. This will allow changing the time we set the channel state to after PDCH DEACT and before PDCH ACT, in a subsequent commit. Also add a sanity check on whether we're sending conflicting or superfluous PDCH de-/activations on the same TS. Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 18 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 338c00a..349b3de 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1204,6 +1204,7 @@ static int rsl_rx_pdch_act_ack(struct msgb *msg) { msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; + msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING; /* We have activated PDCH, so now the channel is available again. */ do_lchan_free(msg->lchan); @@ -1214,6 +1215,7 @@ static int rsl_rx_pdch_deact_ack(struct msgb *msg) { msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE; + msg->lchan->ts->flags &= ~TS_F_PDCH_DEACT_PENDING; rsl_chan_activate_lchan(msg->lchan, msg->lchan->dyn_pdch.act_type, msg->lchan->dyn_pdch.ho_ref); @@ -1975,10 +1977,24 @@ struct abis_rsl_dchan_hdr *dh; uint8_t msg_type; - if (act) + if (ts->flags & TS_F_PDCH_PENDING_MASK) { + LOGP(DRSL, LOGL_ERROR, + "%s PDCH %s requested, but a PDCH%s%s is still pending\n", + gsm_ts_name(ts), + act ? "ACT" : "DEACT", + ts->flags & TS_F_PDCH_ACT_PENDING? " ACT" : "", + ts->flags & TS_F_PDCH_DEACT_PENDING? " DEACT" : ""); + return -EINVAL; + } + + if (act){ msg_type = RSL_MT_IPAC_PDCH_ACT; - else + ts->flags |= TS_F_PDCH_ACT_PENDING; + } else { msg_type = RSL_MT_IPAC_PDCH_DEACT; + ts->flags |= TS_F_PDCH_DEACT_PENDING; + } + /* TODO add timeout to cancel PDCH DE/ACT */ dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); init_dchan_hdr(dh, msg_type); -- To view, visit https://gerrit.osmocom.org/282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:52:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:52:06 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK ...................................................................... dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 54 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 349b3de..3aefd9c 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1201,8 +1201,59 @@ return 0; } +static bool lchan_may_change_pdch(struct gsm_lchan *lchan, bool pdch_act) +{ + struct gsm_bts_trx_ts *ts; + bool ok; + + OSMO_ASSERT(lchan); + + ts = lchan->ts; + OSMO_ASSERT(ts); + OSMO_ASSERT(ts->trx); + OSMO_ASSERT(ts->trx->bts); + + if (lchan->ts->pchan != GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" + " Rx PDCH %s ACK for channel that is no TCH/F_PDCH\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + pdch_act? "ACT" : "DEACT"); + return false; + } + + /* During BTS initialization, we expect to PDCH ACT in channel state == + * NONE. However, during dynamic channel switching, we will PDCH ACT + * while in state DEACTIVATION REQUESTED (we're deactivating TCH/F + * while activating PDCH); and we will PDCH DEACT while in state + * ACTIVATION REQUESTED (we're activating TCH/F while deactivating + * PDCH). */ + /* FIXME: rather switch PDCH while in state NONE, i.e. after + * deactivation of TCH/F and before activation of TCH/F? */ + if (pdch_act) + ok = (lchan->state == LCHAN_S_NONE + || lchan->state == LCHAN_S_REL_REQ); + else + ok = (lchan->state == LCHAN_S_NONE + || lchan->state == LCHAN_S_ACT_REQ); + + if (!ok) { + LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" + " Rx PDCH %s ACK in unexpected state: %s\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr, + gsm_pchan_name(ts->pchan), + pdch_act? "ACT" : "DEACT", + gsm_lchans_name(lchan->state)); + return false; + } + return true; +} + static int rsl_rx_pdch_act_ack(struct msgb *msg) { + if (!lchan_may_change_pdch(msg->lchan, true)) + return -EINVAL; + msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING; @@ -1214,6 +1265,9 @@ static int rsl_rx_pdch_deact_ack(struct msgb *msg) { + if (!lchan_may_change_pdch(msg->lchan, false)) + return -EINVAL; + msg->lchan->ts->flags &= ~TS_F_PDCH_ACTIVE; msg->lchan->ts->flags &= ~TS_F_PDCH_DEACT_PENDING; -- To view, visit https://gerrit.osmocom.org/283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:52:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:52:07 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT ...................................................................... dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT Do the PDCH DE/ACT before we set the lchan->state to De-/Activation Requested. It makes more sense semantically to change PDCH mode while the lchan is still in NONE status. Thus slightly move some invocations: PDCH ACT: Free the lchan before PDCH activation. Hence remove the lchan_free() call from the rsl_rx_pdch_act_ack() code path; it used to do the PDCH activation first and call lchan_free() in the callback. PDCH DEACT: Set the (TCH) Activation Requested state only within rsl_chan_activate_lchan(), after the PDCH deact is complete. Channel allocator: don't pick channels that have a PDCH PENDING flag set, to avoid using channels that are still in PDCH switchover (despite their state being NONE). The lchan_may_change_pdch() sanity checks are becoming a lot simpler. Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066 --- M openbsc/src/libbsc/abis_rsl.c M openbsc/src/libbsc/chan_alloc.c 2 files changed, 12 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 3aefd9c..fc56862 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -479,6 +479,8 @@ return rsl_ipacc_pdch_activate(lchan->ts, 0); } + rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); + ta = lchan->rqd_ta; /* BS11 requires TA shifted by 2 bits */ @@ -756,11 +758,11 @@ gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); + do_lchan_free(lchan); + /* Put PDCH channel back into PDCH mode first */ if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) return rsl_ipacc_pdch_activate(lchan->ts, 1); - - do_lchan_free(lchan); return 0; } @@ -1204,7 +1206,6 @@ static bool lchan_may_change_pdch(struct gsm_lchan *lchan, bool pdch_act) { struct gsm_bts_trx_ts *ts; - bool ok; OSMO_ASSERT(lchan); @@ -1222,22 +1223,7 @@ return false; } - /* During BTS initialization, we expect to PDCH ACT in channel state == - * NONE. However, during dynamic channel switching, we will PDCH ACT - * while in state DEACTIVATION REQUESTED (we're deactivating TCH/F - * while activating PDCH); and we will PDCH DEACT while in state - * ACTIVATION REQUESTED (we're activating TCH/F while deactivating - * PDCH). */ - /* FIXME: rather switch PDCH while in state NONE, i.e. after - * deactivation of TCH/F and before activation of TCH/F? */ - if (pdch_act) - ok = (lchan->state == LCHAN_S_NONE - || lchan->state == LCHAN_S_REL_REQ); - else - ok = (lchan->state == LCHAN_S_NONE - || lchan->state == LCHAN_S_ACT_REQ); - - if (!ok) { + if (lchan->state != LCHAN_S_NONE) { LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" " Rx PDCH %s ACK in unexpected state: %s\n", ts->trx->bts->nr, ts->trx->nr, ts->nr, @@ -1256,9 +1242,6 @@ msg->lchan->ts->flags |= TS_F_PDCH_ACTIVE; msg->lchan->ts->flags &= ~TS_F_PDCH_ACT_PENDING; - - /* We have activated PDCH, so now the channel is available again. */ - do_lchan_free(msg->lchan); return 0; } @@ -1532,7 +1515,6 @@ return -ENOMEM; } - rsl_lchan_set_state(lchan, LCHAN_S_ACT_REQ); memcpy(lchan->rqd_ref, rqd_ref, sizeof(*rqd_ref)); lchan->rqd_ta = rqd_ta; diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index 4715780..f4ed530 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -43,6 +43,13 @@ return 0; } + /* If a dyn PDCH channel is busy changing, it is already taken or not + * yet available. */ + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + if (ts->flags & TS_F_PDCH_PENDING_MASK) + return 0; + } + return 1; } -- To view, visit https://gerrit.osmocom.org/284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:53:40 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:53:40 +0000 Subject: osmo-bts[master]: dyn PDCH: rsl rx dchan: also log ip.access message names In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 re-add +2 from hwelte from previous patch set. (this is only a commit log tweak) -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 01:54:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 01:54:14 +0000 Subject: osmo-bts[master]: dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for T... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 re-add +2 from hwelte from previous patch set. (this is only a commit log tweak) -- To view, visit https://gerrit.osmocom.org/294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:02:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:02:12 +0000 Subject: [PATCH] osmo-bts[master]: doc: add ladder diagram on dynamic PDCH, add msc-README In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/279 to look at the new patch set (#3). doc: add ladder diagram on dynamic PDCH, add msc-README Adjust .gitignore for dyn_pdch.svg and .png. Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 --- M .gitignore A doc/dyn_pdch.msc A doc/msc-README 3 files changed, 43 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/279/3 diff --git a/.gitignore b/.gitignore index 224b77c..8b8864d 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,8 @@ # Possible generated file doc/vty_reference.xml +doc/dyn_pdch.svg +doc/dyn_pdch.png # Backups, vi, merges *~ diff --git a/doc/dyn_pdch.msc b/doc/dyn_pdch.msc new file mode 100644 index 0000000..ae7c0d0 --- /dev/null +++ b/doc/dyn_pdch.msc @@ -0,0 +1,39 @@ +msc { + hscale = "1.2"; + phy,bts,pcu,bsc; + + phy box bsc [ label = "PDCH Deactivation" ]; + bsc => bts [ label = "IPAC PDCH DEACT" ]; + --- [ label = "Disconnect PDTCH" ]; + bts => pcu [ label = "info ind (Deactivate)" ]; + pcu => bts [ label = "chan Deactivate request" ]; + bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ]; + bts => phy [ label = "L1 chan Disconnect PDTCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect TCH" ]; + bts => phy [ label = "L1 chan Connect TCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + + phy box bsc [ label = "Now BSC may use TCH (example)" ]; + bsc => bts [ label = "Activate TCH/F" ]; + bts => phy [ label = "L1 chan Activate SAPIs" ]; + --- [ label = "Voice call..." ]; + bsc => bts [ label = "Deactivate TCH/F" ]; + bts => phy [ label = "L1 chan Deactivate SAPIs" ]; + + phy box bsc [ label = "PDCH Activation" ]; + bsc => bts [ label = "IPAC PDCH ACT" ]; + --- [ label = "Disconnect TCH" ]; + bts => phy [ label = "L1 chan Disconnect TCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect PDTCH" ]; + bts => phy [ label = "L1 chan Connect PDTCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => pcu [ label = "info ind (Activate)" ]; + pcu => bts [ label = "chan Activate request" ]; + bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Activate SAPIs confirm" ]; + bts => bsc [ label = "IPAC PDCH ACT ACK" ]; +} diff --git a/doc/msc-README b/doc/msc-README new file mode 100644 index 0000000..55d6bae --- /dev/null +++ b/doc/msc-README @@ -0,0 +1,2 @@ +sudo apt-get install mscgen +mscgen -T svg dyn_pdch.msc -- To view, visit https://gerrit.osmocom.org/279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:03:32 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:03:32 +0000 Subject: osmo-bts[master]: doc: add ladder diagram on dynamic PDCH, add msc-README In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 re-adding +2 from hwelte, only graph tweaks -- To view, visit https://gerrit.osmocom.org/279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:11:44 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:11:44 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warning: add missing case (PHY_LINK_CONNECTING) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/288 to look at the new patch set (#2). fix compiler warning: add missing case (PHY_LINK_CONNECTING) Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 --- M src/common/phy_link.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/88/288/2 diff --git a/src/common/phy_link.c b/src/common/phy_link.c index 131fd2c..43bb31c 100644 --- a/src/common/phy_link.c +++ b/src/common/phy_link.c @@ -71,6 +71,9 @@ LOGP(DL1C, LOGL_INFO, "trx_set_avail(0)\n"); trx_set_available(trx, 0); break; + case PHY_LINK_CONNECTING: + /* nothing to do */ + break; } } -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:11:44 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:11:44 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warning: printf format for sizeof() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/287 to look at the new patch set (#2). fix compiler warning: printf format for sizeof() Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 --- M src/common/cbch.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/287/2 diff --git a/src/common/cbch.c b/src/common/cbch.c index 75bcf28..e511c67 100644 --- a/src/common/cbch.c +++ b/src/common/cbch.c @@ -111,7 +111,7 @@ if (msg_len > sizeof(scm->msg)) { LOGP(DLSMS, LOGL_ERROR, - "Cannot process SMSCB of %u bytes (max %lu)\n", + "Cannot process SMSCB of %u bytes (max %zu)\n", msg_len, sizeof(scm->msg)); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: rsl rx dchan: also log ip.access message names In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/292 to look at the new patch set (#3). dyn PDCH: rsl rx dchan: also log ip.access message names Before, only standard ABIS RSL message names were logged, add ip.access specific ones. The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan() should be able to log ip.access message types properly. Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f --- M src/common/rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/292/3 diff --git a/src/common/rsl.c b/src/common/rsl.c index dddde69..7e8d48c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1838,13 +1838,13 @@ msg->lchan = rsl_lchan_lookup(trx, dch->chan_nr); if (!msg->lchan) { LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknow lchan\n", - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); msgb_free(msg); return report_error(trx); } LOGP(DRSL, LOGL_INFO, "%s Rx RSL %s\n", gsm_lchan_name(msg->lchan), - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); switch (dch->c.msg_type) { case RSL_MT_CHAN_ACTIV: -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/293 to look at the new patch set (#3). dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH Depending on the PDCH active flag, handle a TCH/F_PDCH like TCH/F or PDCH. Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 --- M src/common/oml.c 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/293/3 diff --git a/src/common/oml.c b/src/common/oml.c index bee2f84..9d3c454 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -689,14 +689,19 @@ { struct gsm_lchan *lchan; unsigned int i; + enum gsm_phys_chan_config pchan = ts->pchan; - switch (ts->pchan) { + if (pchan == GSM_PCHAN_TCH_F_PDCH) + pchan = ts->flags & TS_F_PDCH_ACTIVE? GSM_PCHAN_PDCH + : GSM_PCHAN_TCH_F; + + switch (pchan) { case GSM_PCHAN_CCCH_SDCCH4_CBCH: /* fallthrough */ case GSM_PCHAN_CCCH_SDCCH4: for (i = 0; i < 4; i++) { lchan = &ts->lchan[i]; - if (ts->pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH + if (pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH && i == 2) { lchan->type = GSM_LCHAN_CBCH; } else { @@ -723,7 +728,7 @@ case GSM_PCHAN_SDCCH8_SACCH8C: for (i = 0; i < 8; i++) { lchan = &ts->lchan[i]; - if (ts->pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH + if (pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH && i == 2) { lchan->type = GSM_LCHAN_CBCH; } else { -- To view, visit https://gerrit.osmocom.org/293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for T... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/294 to look at the new patch set (#3). dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH It is cosmetic since the 'default:' case already caught TCH_F_PDCH, but it's good to mention all expected pchans explicitly. Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f --- M src/osmo-bts-sysmo/oml.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/294/3 diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 6951f84..60ab7a8 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -525,6 +525,7 @@ case GSM_PCHAN_CCCH: case GSM_PCHAN_TCH_F: case GSM_PCHAN_PDCH: + case GSM_PCHAN_TCH_F_PDCH: case GSM_PCHAN_UNKNOWN: default: return GsmL1_SubCh_NA; -- To view, visit https://gerrit.osmocom.org/294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/306 to look at the new patch set (#2). dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH. All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT or DEACT *NACK* to be sent to the BSC as soon as these messages are handled. Also add stubs in tests. Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d --- M include/osmo-bts/bts_model.h M src/osmo-bts-litecell15/oml.c M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/oml.c M src/osmo-bts-trx/l1_if.c M tests/handover/handover_test.c M tests/stubs.c 7 files changed, 56 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/06/306/2 diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index 6252557..7e2d088 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -55,4 +55,7 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink); void bts_model_phy_instance_set_defaults(struct phy_instance *pinst); +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts); +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan); + #endif diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 7aedee1..fa9f601 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1764,3 +1764,14 @@ { return l1if_set_txpower(trx_lc15l1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 401201a..c893b04 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1585,3 +1585,14 @@ #warning "Implement bts_model_change_power based on TRX_MODIFY_RF_CID" return 0; } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 60ab7a8..5d24bcb 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1837,3 +1837,14 @@ { return l1if_set_txpower(trx_femtol1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 8ccba90..59442d9 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -747,3 +747,14 @@ LOGP(DL1C, LOGL_NOTICE, "Setting TRX output power not supported!\n"); return 0; } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 8b299d0..e1f4d86 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -275,3 +275,5 @@ int bts_model_trx_close(struct gsm_bts_trx *trx) { return 0; } void trx_get_hlayer1(void) {} int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { return 0; } +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { return 0; } +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { return 0; } diff --git a/tests/stubs.c b/tests/stubs.c index d6ef263..c15a315 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -43,3 +43,10 @@ void bts_model_abis_close(struct gsm_bts *bts) { } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ return 0; } + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ return 0; } -- To view, visit https://gerrit.osmocom.org/306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/307 to look at the new patch set (#2). dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode Introduce a static function to encapsulate the decision whether a TS is used for PDCH. Depending on the ts->flags, handle a TCH/F_PDCH TS exactly like a standard PDCH TS. Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b --- M src/common/pcu_sock.c 1 file changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/307/2 diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index ea4267d..cfffb2e 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -95,6 +95,24 @@ return msg; } +static bool ts_is_pdch(struct gsm_bts_trx_ts *ts) { + if (ts->pchan == GSM_PCHAN_PDCH) + return true; + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + /* When we're busy deactivating the PDCH, we first set + * DEACT_PENDING, tell the PCU about it and wait for a + * response. So DEACT_PENDING means "no PDCH" to the PCU. + * Similarly, when we're activating PDCH, we set the + * ACT_PENDING and wait for an activation response from the + * PCU, so ACT_PENDING means "is PDCH". */ + if (ts->flags & TS_F_PDCH_ACTIVE) + return !(ts->flags & TS_F_PDCH_DEACT_PENDING); + else + return (ts->flags & TS_F_PDCH_ACT_PENDING); + } + return false; +} + int pcu_tx_info_ind(void) { struct gsm_network *net = &bts_gsmnet; @@ -207,7 +225,7 @@ for (j = 0; j < 8; j++) { ts = &trx->ts[j]; if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED - && ts->pchan == GSM_PCHAN_PDCH) { + && ts_is_pdch(ts)) { info_ind->trx[i].pdch_mask |= (1 << j); info_ind->trx[i].tsc[j] = (ts->tsc >= 0) ? ts->tsc : bts->bsic & 7; -- To view, visit https://gerrit.osmocom.org/307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/308 to look at the new patch set (#2). dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/308/2 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 14de251..0330308 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -611,11 +611,23 @@ return l1sap_up(trx, &l1sap); } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) + return ts->pchan; + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + switch (sapi) { case GsmL1_Sapi_Bcch: cbits = 0x10; @@ -724,7 +736,7 @@ uint32_t fn; /* check if primitive should be handled by common part */ - chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi, rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn); if (chan_nr) { fn = rts_ind->u32Fn; @@ -848,7 +860,7 @@ uint32_t fn; int rc = 0; - chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " -- To view, visit https://gerrit.osmocom.org/308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:26:29 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: implement main dyn PDCH logic in common/ In-Reply-To: References: Message-ID: dyn PDCH: implement main dyn PDCH logic in common/ React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_* APIs to effect switchover. The dyn PDCH interaction is described in the comment to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover. In case the bts_model_ts_* are not implemented (or return other errors), reply with an IPAC PDCH ACT/DEACT NACK. Add callbacks that mark steps in the PDCH switchover process, dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete(). Add hooks in l1sap.c on channel activation and release confirmation, to call dyn PDCH callbacks. BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and dyn_pdch_ts_connected() when bts_model_ts_disconnect() or bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS) Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab --- M include/osmo-bts/rsl.h M src/common/l1sap.c M src/common/rsl.c 3 files changed, 284 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/09/309/2 diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 6cb40dd..173e086 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -35,5 +35,9 @@ struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr); +void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts); +void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts); +void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc); + #endif // _RSL_H */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 163e129..0af7343 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -440,6 +440,12 @@ else rsl_tx_chan_act_ack(lchan); + /* During PDCH ACT, this is where we know that the PCU is done + * activating a PDCH, and PDCH switchover is complete. See + * rsl_rx_dyn_pdch() */ + if (lchan->ts->flags & TS_F_PDCH_ACT_PENDING) + dyn_pdch_complete(lchan->ts, info_act_cnf->cause? -EIO : 0); + return 0; } @@ -457,6 +463,12 @@ rsl_tx_rf_rel_ack(lchan); + /* During PDCH DEACT, this marks the deactivation of the PDTCH as + * requested by the PCU. Next up, we disconnect the TS completely and + * call back to dyn_pdch_ts_disconnected(). See rsl_rx_dyn_pdch(). */ + if (lchan->ts->flags & TS_F_PDCH_DEACT_PENDING) + bts_model_ts_disconnect(lchan->ts); + return 0; } diff --git a/src/common/rsl.c b/src/common/rsl.c index 7e8d48c..adf17f6 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1622,6 +1622,269 @@ } /* + * dynamic TCH/F_PDCH related messages, originally ip.access specific but + * reused for other BTS models (sysmo-bts, ...) + */ + +/* PDCH ACT/DEACT ACKNOWLEDGE */ +static int rsl_tx_dyn_pdch_ack(struct gsm_lchan *lchan, bool pdch_act) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s ACK\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT"); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + msg->len = 0; + msg->data = msg->tail = msg->l3h; + + rsl_dch_push_hdr(msg, + pdch_act? RSL_MT_IPAC_PDCH_ACT_ACK + : RSL_MT_IPAC_PDCH_DEACT_ACK, + chan_nr); + msg->lchan = lchan; + msg->trx = lchan->ts->trx; + + return abis_bts_rsl_sendmsg(msg); +} + +/* PDCH ACT/DEACT NEGATIVE ACKNOWLEDGE */ +static int rsl_tx_dyn_pdch_nack(struct gsm_lchan *lchan, bool pdch_act, + uint8_t cause) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s NACK (cause = 0x%02x)\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", cause); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + msg->len = 0; + msg->data = msg->tail = msg->l3h; + + /* 9.3.26 Cause */ + msgb_tlv_put(msg, RSL_IE_CAUSE, 1, &cause); + rsl_dch_push_hdr(msg, + pdch_act? RSL_MT_IPAC_PDCH_ACT_NACK + : RSL_MT_IPAC_PDCH_DEACT_NACK, + chan_nr); + msg->lchan = lchan; + msg->trx = lchan->ts->trx; + + return abis_bts_rsl_sendmsg(msg); +} + +/* Starting point for dynamic PDCH switching. See doc/dyn_pdch.msc for a + * diagram of what will happen here. The implementation is as follows: + * + * PDCH ACT == TCH/F -> PDCH: + * 1. call bts_model_ts_disconnect() to disconnect TCH/F; + * 2. dyn_pdch_ts_disconnected() is called when done; + * 3. call bts_model_ts_connect() to connect as PDTCH; + * 4. dyn_pdch_ts_connected() is called when done; + * 5. instruct the PCU to enable PDTCH; + * 6. the PCU will call back with an activation request; + * 7. l1sap_info_act_cnf() will call dyn_pdch_complete() when SAPI activations + * are done; + * 8. send a PDCH ACT ACK. + * + * PDCH DEACT == PDCH -> TCH/F: + * 1. instruct the PCU to disable PDTCH; + * 2. the PCU will call back with a deactivation request; + * 3. l1sap_info_rel_cnf() will call bts_model_ts_disconnect() when SAPI + * deactivations are done; + * 4. dyn_pdch_ts_disconnected() is called when done; + * 5. call bts_model_ts_connect() to connect as TCH/F; + * 6. dyn_pdch_ts_connected() is called when done; + * 7. directly call dyn_pdch_complete(), since no further action required for + * TCH/F; + * 8. send a PDCH DEACT ACK. + * + * When an error happens along the way, a PDCH DE/ACT NACK is sent. + * TODO: may need to be made more waterproof in all stages, to send a NACK and + * clear the PDCH pending flags from ts->flags. + */ +static void rsl_rx_dyn_pdch(struct msgb *msg, bool pdch_act) +{ + int rc; + struct gsm_lchan *lchan = msg->lchan; + struct gsm_bts_trx_ts *ts = lchan->ts; + bool is_pdch_act = (ts->flags & TS_F_PDCH_ACTIVE); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) { + /* Only one of the pending flags should ever be set at the same + * time, but just log both in case both should be set. */ + LOGP(DL1C, LOGL_ERROR, + "%s Request to PDCH %s, but PDCH%s%s is still pending\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", + (ts->flags & TS_F_PDCH_ACT_PENDING)? " ACT" : "", + (ts->flags & TS_F_PDCH_DEACT_PENDING)? " DEACT" : ""); + rsl_tx_dyn_pdch_nack(lchan, pdch_act, RSL_ERR_NORMAL_UNSPEC); + return; + } + + ts->flags |= pdch_act? TS_F_PDCH_ACT_PENDING + : TS_F_PDCH_DEACT_PENDING; + + /* ensure that this is indeed a dynamic-PDCH channel */ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_ERROR, + "%s Attempt to PDCH %s on TS that is not a TCH/F_PDCH (is %s)\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", + gsm_pchan_name(ts->pchan)); + dyn_pdch_complete(ts, -EINVAL); + return; + } + + if (is_pdch_act == pdch_act) { + LOGP(DL1C, LOGL_NOTICE, + "%s Request to PDCH %s, but is already so\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT"); + dyn_pdch_complete(ts, 0); + return; + } + + if (pdch_act) { + /* First, disconnect the TCH channel, to connect PDTCH later */ + rc = bts_model_ts_disconnect(ts); + } else { + /* First, deactivate PDTCH through the PCU, to connect TCH + * later. + * pcu_tx_info_ind() will pick up TS_F_PDCH_DEACT_PENDING and + * trigger a deactivation. + * Except when the PCU is not connected yet, then trigger + * disconnect immediately from here. The PCU will catch up when + * it connects. */ + /* TODO: timeout on channel connect / disconnect request from PCU? */ + if (pcu_connected()) + rc = pcu_tx_info_ind(); + else + rc = bts_model_ts_disconnect(ts); + } + + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); +} + +void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts) +{ + int rc; + enum gsm_phys_chan_config as_pchan; + + if (ts->flags & TS_F_PDCH_DEACT_PENDING) { + LOGP(DRSL, LOGL_DEBUG, + "%s PDCH DEACT operation: channel disconnected, will reconnect as TCH\n", + gsm_lchan_name(ts->lchan)); + ts->lchan[0].type = GSM_LCHAN_TCH_F; + as_pchan = GSM_PCHAN_TCH_F; + } else if (ts->flags & TS_F_PDCH_ACT_PENDING) { + LOGP(DRSL, LOGL_DEBUG, + "%s PDCH ACT operation: channel disconnected, will reconnect as PDTCH\n", + gsm_lchan_name(ts->lchan)); + ts->lchan[0].type = GSM_LCHAN_PDTCH; + as_pchan = GSM_PCHAN_PDCH; + } + + rc = bts_model_ts_connect(ts, as_pchan); + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); +} + +void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts) +{ + int rc; + + if (ts->flags & TS_F_PDCH_DEACT_PENDING) { + if (ts->lchan[0].type != GSM_LCHAN_TCH_F) + LOGP(DRSL, LOGL_ERROR, "%s PDCH DEACT error:" + " timeslot connected, so expecting" + " lchan type TCH/F, but is %s\n", + gsm_lchan_name(ts->lchan), + gsm_lchant_name(ts->lchan[0].type)); + + LOGP(DRSL, LOGL_DEBUG, "%s PDCH DEACT operation:" + " timeslot connected as TCH/F\n", + gsm_lchan_name(ts->lchan)); + + /* During PDCH DEACT, we're done right after the TCH/F came + * back up. */ + dyn_pdch_complete(ts, 0); + + } else if (ts->flags & TS_F_PDCH_ACT_PENDING) { + if (ts->lchan[0].type != GSM_LCHAN_PDTCH) + LOGP(DRSL, LOGL_ERROR, "%s PDCH ACT error:" + " timeslot connected, so expecting" + " lchan type PDTCH, but is %s\n", + gsm_lchan_name(ts->lchan), + gsm_lchant_name(ts->lchan[0].type)); + + LOGP(DRSL, LOGL_DEBUG, "%s PDCH ACT operation:" + " timeslot connected as PDTCH\n", + gsm_lchan_name(ts->lchan)); + + /* The PDTCH is connected, now tell the PCU about it. Except + * when the PCU is not connected (yet), then there's nothing + * left to do now. The PCU will catch up when it connects. */ + if (!pcu_connected()) { + dyn_pdch_complete(ts, 0); + return; + } + + /* The PCU will request to activate the PDTCH SAPIs, which, + * when done, will call back to dyn_pdch_complete(). */ + /* TODO: timeout on channel connect / disconnect request from PCU? */ + rc = pcu_tx_info_ind(); + + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); + } +} + +void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc) +{ + bool pdch_act = ts->flags & TS_F_PDCH_ACT_PENDING; + + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == TS_F_PDCH_PENDING_MASK) + LOGP(DRSL, LOGL_ERROR, + "%s Internal Error: both PDCH ACT and PDCH DEACT pending\n", + gsm_lchan_name(ts->lchan)); + + ts->flags &= ~TS_F_PDCH_PENDING_MASK; + + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "PDCH %s on dynamic TCH/F_PDCH returned error %d\n", + pdch_act? "ACT" : "DEACT", rc); + rsl_tx_dyn_pdch_nack(ts->lchan, pdch_act, RSL_ERR_NORMAL_UNSPEC); + return; + } + + if (pdch_act) + ts->flags |= TS_F_PDCH_ACTIVE; + else + ts->flags &= ~TS_F_PDCH_ACTIVE; + DEBUGP(DL1C, "%s %s switched to %s mode (ts->flags == %x)\n", + gsm_lchan_name(ts->lchan), gsm_pchan_name(ts->pchan), + pdch_act? "PDCH" : "TCH/F", ts->flags); + + rc = rsl_tx_dyn_pdch_ack(ts->lchan, pdch_act); + if (rc) + LOGP(DRSL, LOGL_ERROR, + "Failed to transmit PDCH %s ACK, rc %d\n", + pdch_act? "ACT" : "DEACT", rc); +} + +/* * selecting message */ @@ -1868,6 +2131,11 @@ case RSL_MT_MS_POWER_CONTROL: ret = rsl_rx_ms_pwr_ctrl(msg); break; + case RSL_MT_IPAC_PDCH_ACT: + case RSL_MT_IPAC_PDCH_DEACT: + rsl_rx_dyn_pdch(msg, dch->c.msg_type == RSL_MT_IPAC_PDCH_ACT); + ret = 0; + break; case RSL_MT_PHY_CONTEXT_REQ: case RSL_MT_PREPROC_CONFIG: case RSL_MT_RTD_REP: -- To view, visit https://gerrit.osmocom.org/309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:39:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:39:04 +0000 Subject: osmo-bts[master]: dyn PDCH: rsl rx dchan: also log ip.access message names In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 and again, re-add +2 from hwelte from previous patch set. (this is only a commit log tweak to trick gerrit into accepting patch updates) -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:45:56 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:45:56 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: rsl rx dchan: also log ip.access message names In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: rsl rx dchan: also log ip.access message names ...................................................................... dyn PDCH: rsl rx dchan: also log ip.access message names Before, only standard ABIS RSL message names were logged, add ip.access specific ones. The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan() should be able to log ip.access message types properly. Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f --- M src/common/rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/rsl.c b/src/common/rsl.c index dddde69..7e8d48c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1838,13 +1838,13 @@ msg->lchan = rsl_lchan_lookup(trx, dch->chan_nr); if (!msg->lchan) { LOGP(DRSL, LOGL_ERROR, "Rx RSL %s for unknow lchan\n", - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); msgb_free(msg); return report_error(trx); } LOGP(DRSL, LOGL_INFO, "%s Rx RSL %s\n", gsm_lchan_name(msg->lchan), - rsl_msg_name(dch->c.msg_type)); + rsl_or_ipac_msg_name(dch->c.msg_type)); switch (dch->c.msg_type) { case RSL_MT_CHAN_ACTIV: -- To view, visit https://gerrit.osmocom.org/292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:46:01 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:46:01 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for T... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH ...................................................................... dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH It is cosmetic since the 'default:' case already caught TCH_F_PDCH, but it's good to mention all expected pchans explicitly. Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f --- M src/osmo-bts-sysmo/oml.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 6951f84..60ab7a8 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -525,6 +525,7 @@ case GSM_PCHAN_CCCH: case GSM_PCHAN_TCH_F: case GSM_PCHAN_PDCH: + case GSM_PCHAN_TCH_F_PDCH: case GSM_PCHAN_UNKNOWN: default: return GsmL1_SubCh_NA; -- To view, visit https://gerrit.osmocom.org/294 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:46:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:46:13 +0000 Subject: [MERGED] osmo-bts[master]: doc: add ladder diagram on dynamic PDCH, add msc-README In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: doc: add ladder diagram on dynamic PDCH, add msc-README ...................................................................... doc: add ladder diagram on dynamic PDCH, add msc-README Adjust .gitignore for dyn_pdch.svg and .png. Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 --- M .gitignore A doc/dyn_pdch.msc A doc/msc-README 3 files changed, 43 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 224b77c..8b8864d 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,8 @@ # Possible generated file doc/vty_reference.xml +doc/dyn_pdch.svg +doc/dyn_pdch.png # Backups, vi, merges *~ diff --git a/doc/dyn_pdch.msc b/doc/dyn_pdch.msc new file mode 100644 index 0000000..ae7c0d0 --- /dev/null +++ b/doc/dyn_pdch.msc @@ -0,0 +1,39 @@ +msc { + hscale = "1.2"; + phy,bts,pcu,bsc; + + phy box bsc [ label = "PDCH Deactivation" ]; + bsc => bts [ label = "IPAC PDCH DEACT" ]; + --- [ label = "Disconnect PDTCH" ]; + bts => pcu [ label = "info ind (Deactivate)" ]; + pcu => bts [ label = "chan Deactivate request" ]; + bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ]; + bts => phy [ label = "L1 chan Disconnect PDTCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect TCH" ]; + bts => phy [ label = "L1 chan Connect TCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + + phy box bsc [ label = "Now BSC may use TCH (example)" ]; + bsc => bts [ label = "Activate TCH/F" ]; + bts => phy [ label = "L1 chan Activate SAPIs" ]; + --- [ label = "Voice call..." ]; + bsc => bts [ label = "Deactivate TCH/F" ]; + bts => phy [ label = "L1 chan Deactivate SAPIs" ]; + + phy box bsc [ label = "PDCH Activation" ]; + bsc => bts [ label = "IPAC PDCH ACT" ]; + --- [ label = "Disconnect TCH" ]; + bts => phy [ label = "L1 chan Disconnect TCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect PDTCH" ]; + bts => phy [ label = "L1 chan Connect PDTCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => pcu [ label = "info ind (Activate)" ]; + pcu => bts [ label = "chan Activate request" ]; + bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Activate SAPIs confirm" ]; + bts => bsc [ label = "IPAC PDCH ACT ACK" ]; +} diff --git a/doc/msc-README b/doc/msc-README new file mode 100644 index 0000000..55d6bae --- /dev/null +++ b/doc/msc-README @@ -0,0 +1,2 @@ +sudo apt-get install mscgen +mscgen -T svg dyn_pdch.msc -- To view, visit https://gerrit.osmocom.org/279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 02:53:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 02:53:20 +0000 Subject: [PATCH] openbsc[master]: bsc_version.c: update copyright date, add contributor Message-ID: Review at https://gerrit.osmocom.org/315 bsc_version.c: update copyright date, add contributor Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48 --- M openbsc/src/libcommon/bsc_version.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/15/315/1 diff --git a/openbsc/src/libcommon/bsc_version.c b/openbsc/src/libcommon/bsc_version.c index 04acf04..f0369bf 100644 --- a/openbsc/src/libcommon/bsc_version.c +++ b/openbsc/src/libcommon/bsc_version.c @@ -1,5 +1,5 @@ /* Hold the copyright and version string */ -/* (C) 2010 by Harald Welte +/* (C) 2010-2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -20,9 +20,9 @@ #include "../../bscconfig.h" const char *openbsc_copyright = - "Copyright (C) 2008-2012 Harald Welte, Holger Freyther\r\n" + "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n" "Contributions by Daniel Willmann, Jan L?bbe, Stefan Schmidt\r\n" - "Dieter Spaar, Andreas Eversberg, Sylvain Munaut\r\n\r\n" + "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n" "License AGPLv3+: GNU AGPL version 3 or later \r\n" "This is free software: you are free to change and redistribute it.\r\n" "There is NO WARRANTY, to the extent permitted by law.\r\n"; -- To view, visit https://gerrit.osmocom.org/315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:32:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:32:59 +0000 Subject: [PATCH] openbsc[master]: TEST 1: cherry pick strategy 1 Message-ID: Review at https://gerrit.osmocom.org/316 TEST 1: cherry pick strategy 1 Change-Id: I7ade77d2529577c00ed3f44aea47835aea5168b9 --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/316/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..64beeb3 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST COMMIT + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ade77d2529577c00ed3f44aea47835aea5168b9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:33:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:33:00 +0000 Subject: [PATCH] openbsc[master]: TEST 1: cherry pick strategy 2 Message-ID: Review at https://gerrit.osmocom.org/317 TEST 1: cherry pick strategy 2 Change-Id: Idd8b25dbf6fc74be6de93fec2024cef26343051a --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/317/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..a83a521 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST COMMIT + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd8b25dbf6fc74be6de93fec2024cef26343051a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:33:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:33:00 +0000 Subject: [PATCH] openbsc[master]: TEST 1: cherry pick strategy 3 Message-ID: Review at https://gerrit.osmocom.org/318 TEST 1: cherry pick strategy 3 Change-Id: I14042fb6e27db1aeb2bd40da80ff289bf2063c83 --- M openbsc/doc/BS11-OML.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/318/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index 64beeb3..c6d0de4 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,4 +1,4 @@ -TEST COMMIT +TEST dependent COMMIT The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I14042fb6e27db1aeb2bd40da80ff289bf2063c83 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:33:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:33:00 +0000 Subject: [PATCH] openbsc[master]: TEST 1: cherry pick strategy 4 Message-ID: Review at https://gerrit.osmocom.org/319 TEST 1: cherry pick strategy 4 Change-Id: I3cfab1291728fa062c35d7ae1bdab4e0c62022a4 --- M openbsc/doc/call-routing.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/319/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index a83a521..4d4556e 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -20,7 +20,7 @@ * If subscriber is not found: # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - +TEST independent COMMIT Thoughts about RR/MM: -- To view, visit https://gerrit.osmocom.org/319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3cfab1291728fa062c35d7ae1bdab4e0c62022a4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:36:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:36:55 +0000 Subject: [ABANDON] openbsc[master]: TEST 1: cherry pick strategy 1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 1: cherry pick strategy 1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I7ade77d2529577c00ed3f44aea47835aea5168b9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:36:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:36:59 +0000 Subject: [ABANDON] openbsc[master]: TEST 1: cherry pick strategy 2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 1: cherry pick strategy 2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Idd8b25dbf6fc74be6de93fec2024cef26343051a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:37:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:37:02 +0000 Subject: [ABANDON] openbsc[master]: TEST 1: cherry pick strategy 3 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 1: cherry pick strategy 3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I14042fb6e27db1aeb2bd40da80ff289bf2063c83 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:37:05 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:37:05 +0000 Subject: [ABANDON] openbsc[master]: TEST 1: cherry pick strategy 4 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 1: cherry pick strategy 4 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/319 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I3cfab1291728fa062c35d7ae1bdab4e0c62022a4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:38:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:38:12 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 1 Message-ID: Review at https://gerrit.osmocom.org/320 TEST 2: cherry pick strategy 1 Change-Id: I308db870ce3f37d4db97c327552471958dffbeed --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/20/320/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..64beeb3 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST COMMIT + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I308db870ce3f37d4db97c327552471958dffbeed Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:38:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:38:12 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 2 Message-ID: Review at https://gerrit.osmocom.org/321 TEST 2: cherry pick strategy 2 Change-Id: I954ecdd1480dbe5859a0478d7cc88fdc9c3c356a --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/321/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..739160b 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST amended COMMIT + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I954ecdd1480dbe5859a0478d7cc88fdc9c3c356a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:38:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:38:12 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 3 Message-ID: Review at https://gerrit.osmocom.org/322 TEST 2: cherry pick strategy 3 Change-Id: I9fd88c022344e7d8139971d4d2c138cefaec8618 --- M openbsc/doc/BS11-OML.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/322/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index 64beeb3..c6d0de4 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,4 +1,4 @@ -TEST COMMIT +TEST dependent COMMIT The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9fd88c022344e7d8139971d4d2c138cefaec8618 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 14:38:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 14:38:12 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 4 Message-ID: Review at https://gerrit.osmocom.org/323 TEST 2: cherry pick strategy 4 Change-Id: I1a9dca58a447dc19aebbc7e990ad03847ce7546b --- M openbsc/doc/call-routing.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/323/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 739160b..2bfb905 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -20,7 +20,7 @@ * If subscriber is not found: # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - +TEST independent COMMIT Thoughts about RR/MM: -- To view, visit https://gerrit.osmocom.org/323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a9dca58a447dc19aebbc7e990ad03847ce7546b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:31:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:31:04 +0000 Subject: osmo-pcu[master]: Add test cases for Header type1 in EGPRS UL In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:31:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:31:08 +0000 Subject: [MERGED] osmo-pcu[master]: Add test cases for Header type1 in EGPRS UL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add test cases for Header type1 in EGPRS UL ...................................................................... Add test cases for Header type1 in EGPRS UL Update test suite with test cases for Header type 1 in EGPRS UL Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Reviewed-on: https://gerrit.osmocom.org/272 Tested-by: Jenkins Builder Reviewed-by: Harald Welte --- M tests/edge/EdgeTest.cpp M tests/edge/EdgeTest.ok 2 files changed, 124 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index f8adbbb..8b5746a 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -1280,6 +1280,126 @@ printf("=== end %s ===\n", __func__); } +static void uplink_header_type_1_parsing_test(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class) +{ + uint8_t trx_no = 0; + int tfi = 0; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + uint8_t data[155] = {0}; + struct gprs_rlc_ul_header_egprs_1 *egprs1 = NULL; + struct gprs_rlc_data_info rlc; + GprsCodingScheme cs; + int rc, offs; + + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + bts = the_bts->bts_data(); + + tfi = 1; + + /* MCS 7 */ + cs = GprsCodingScheme::MCS7; + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + egprs1->si = 1; + egprs1->r = 1; + egprs1->cv = 7; + egprs1->tfi_a = tfi & 0x03; + egprs1->tfi_b = (tfi & 0x1c) >> 2; + egprs1->bsn1_a = 0; + egprs1->bsn1_b = 0; + egprs1->bsn2_a = 1; + egprs1->bsn2_b = 0; + egprs1->cps = 15; + egprs1->rsb = 0; + egprs1->pi = 0; + data[5] = 0xc0; + data[5 + 57] = 1; + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + OSMO_ASSERT(rlc.num_data_blocks == 2); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 1); + OSMO_ASSERT(rlc.block_info[1].e == 1); + OSMO_ASSERT(rlc.block_info[1].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + OSMO_ASSERT(rlc.block_info[1].bsn == 1); + OSMO_ASSERT(rlc.tfi == 1); + + /* MCS 8 */ + cs = GprsCodingScheme::MCS8; + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + egprs1->si = 1; + egprs1->r = 1; + egprs1->cv = 7; + egprs1->tfi_a = tfi & 0x03; + egprs1->tfi_b = (tfi & 0x1c) >> 2; + egprs1->bsn1_a = 0; + egprs1->bsn1_b = 0; + egprs1->bsn2_a = 1; + egprs1->bsn2_b = 0; + egprs1->cps = 15; + egprs1->rsb = 0; + egprs1->pi = 0; + data[5] = 0xc0; + data[5 + 69] = 1; + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + OSMO_ASSERT(rlc.num_data_blocks == 2); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 1); + OSMO_ASSERT(rlc.block_info[1].e == 1); + OSMO_ASSERT(rlc.block_info[1].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + OSMO_ASSERT(rlc.block_info[1].bsn == 1); + OSMO_ASSERT(rlc.tfi == 1); + + /* MCS 9 */ + cs = GprsCodingScheme::MCS9; + egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data; + egprs1->si = 1; + egprs1->r = 1; + egprs1->cv = 7; + egprs1->tfi_a = tfi & 0x03; + egprs1->tfi_b = (tfi & 0x1c) >> 2; + egprs1->bsn1_a = 0; + egprs1->bsn1_b = 0; + egprs1->bsn2_a = 1; + egprs1->bsn2_b = 0; + egprs1->cps = 15; + egprs1->rsb = 0; + egprs1->pi = 0; + data[5] = 0xc0; + data[5 + 75] = 1; + rc = Decoding::rlc_parse_ul_data_header(&rlc, data, cs); + OSMO_ASSERT(rlc.num_data_blocks == 2); + OSMO_ASSERT(rlc.block_info[0].e == 1); + OSMO_ASSERT(rlc.block_info[0].ti == 1); + OSMO_ASSERT(rlc.block_info[1].e == 1); + OSMO_ASSERT(rlc.block_info[1].ti == 0); + OSMO_ASSERT(rlc.block_info[0].bsn == 0); + OSMO_ASSERT(rlc.block_info[1].bsn == 1); + OSMO_ASSERT(rlc.tfi == 1); +} + +void uplink_header_type1_test(void) +{ + BTS the_bts; + int ts_no = 7; + uint32_t fn = 2654218; + uint16_t qta = 31; + uint32_t tlli = 0xf1223344; + const char *imsi = "0011223344"; + uint8_t ms_class = 1; + gprs_rlcmac_ul_tbf *ul_tbf; + GprsMs *ms; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, ts_no, 12); + uplink_header_type_1_parsing_test(&the_bts, ts_no, tlli, &fn, + qta, ms_class); + printf("=== end %s ===\n", __func__); +} + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -1303,6 +1423,8 @@ test_rlc_unit_encoder(); uplink_header_type2_test(); + uplink_header_type1_test(); + if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); return EXIT_SUCCESS; diff --git a/tests/edge/EdgeTest.ok b/tests/edge/EdgeTest.ok index 95ca60b..cdc5cc3 100644 --- a/tests/edge/EdgeTest.ok +++ b/tests/edge/EdgeTest.ok @@ -8,3 +8,5 @@ === end test_rlc_unit_encoder === === start uplink_header_type2_test === === end uplink_header_type2_test === +=== start uplink_header_type1_test === +=== end uplink_header_type1_test === -- To view, visit https://gerrit.osmocom.org/272 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21811bb126dbe151b0708a964d3143bc2fd52389 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:31:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:31:39 +0000 Subject: openbsc[master]: bsc_version.c: update copyright date, add contributor In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:31:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:31:41 +0000 Subject: [MERGED] openbsc[master]: bsc_version.c: update copyright date, add contributor In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_version.c: update copyright date, add contributor ...................................................................... bsc_version.c: update copyright date, add contributor Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48 --- M openbsc/src/libcommon/bsc_version.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libcommon/bsc_version.c b/openbsc/src/libcommon/bsc_version.c index 04acf04..f0369bf 100644 --- a/openbsc/src/libcommon/bsc_version.c +++ b/openbsc/src/libcommon/bsc_version.c @@ -1,5 +1,5 @@ /* Hold the copyright and version string */ -/* (C) 2010 by Harald Welte +/* (C) 2010-2016 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -20,9 +20,9 @@ #include "../../bscconfig.h" const char *openbsc_copyright = - "Copyright (C) 2008-2012 Harald Welte, Holger Freyther\r\n" + "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n" "Contributions by Daniel Willmann, Jan L?bbe, Stefan Schmidt\r\n" - "Dieter Spaar, Andreas Eversberg, Sylvain Munaut\r\n\r\n" + "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n" "License AGPLv3+: GNU AGPL version 3 or later \r\n" "This is free software: you are free to change and redistribute it.\r\n" "There is NO WARRANTY, to the extent permitted by law.\r\n"; -- To view, visit https://gerrit.osmocom.org/315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:32:01 +0000 Subject: osmo-bts[master]: add missing DSUM entry to bts_log_info_cat In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:32:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:32:03 +0000 Subject: [MERGED] osmo-bts[master]: add missing DSUM entry to bts_log_info_cat In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add missing DSUM entry to bts_log_info_cat ...................................................................... add missing DSUM entry to bts_log_info_cat This allows setting the 'sum' log level to debug in osmo-bts.cfg. Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72 --- M src/common/logging.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/logging.c b/src/common/logging.c index 5ce9b8b..2911692 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -136,6 +136,12 @@ .enabled = 1, .loglevel = LOGL_DEBUG, }, #endif + [DSUM] = { + .name = "DSUM", + .description = "DSUM", + .loglevel = LOGL_NOTICE, + .enabled = 1, + }, }; const struct log_info bts_log_info = { -- To view, visit https://gerrit.osmocom.org/299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:32:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:32:25 +0000 Subject: osmo-bts[master]: TRX: add configuration example In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:32:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:32:28 +0000 Subject: [MERGED] osmo-bts[master]: TRX: add configuration example In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: add configuration example ...................................................................... TRX: add configuration example Related: OS#1648 Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef --- A doc/examples/trx/osmo-bts.cfg 1 file changed, 34 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/trx/osmo-bts.cfg b/doc/examples/trx/osmo-bts.cfg new file mode 100644 index 0000000..29d5655 --- /dev/null +++ b/doc/examples/trx/osmo-bts.cfg @@ -0,0 +1,34 @@ +! +! OsmoBTS () configuration saved from vty +!! +! +log stderr + logging color 1 + logging timestamp 0 + logging level all everything + logging level rsl notice + logging level oml notice + logging level rll notice + logging level rr notice + logging level meas error + logging level pag error + logging level l1c error + logging level l1p error + logging level dsp error + logging level abis error +! +line vty + no login +! +phy 0 + instance 0 + osmotrx rx-gain 1 +bts 0 + band 1800 + ipa unit-id 6969 0 + oml remote-ip 192.168.122.1 + settsc + gsmtap-sapi ccch + gsmtap-sapi pdtch + trx 0 + phy 0 instance 0 -- To view, visit https://gerrit.osmocom.org/300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:33:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:33:01 +0000 Subject: [MERGED] osmo-bts[master]: Add .gitreview In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add .gitreview ...................................................................... Add .gitreview Similar to other projects, add helper file for "git review" command. More information: https://www.mediawiki.org/wiki/Gerrit/git-review Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..2fcadd2 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=osmo-bts -- To view, visit https://gerrit.osmocom.org/298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:33:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:33:19 +0000 Subject: openbsc[master]: configure: require libgsm for --enable-mgcp-transcoding In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic23157cc5b75694f400a176c31f97d71e861ea02 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:33:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:33:22 +0000 Subject: [MERGED] openbsc[master]: configure: require libgsm for --enable-mgcp-transcoding In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure: require libgsm for --enable-mgcp-transcoding ...................................................................... configure: require libgsm for --enable-mgcp-transcoding Fail in configure if libgsm is not found. Before this, the --enable-mgcp-transcoding would gladly accept that libgsm is missing and the build would fail later because of missing linking and undefined references. Change-Id: Ic23157cc5b75694f400a176c31f97d71e861ea02 --- M openbsc/configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 5cd5d2d..0980413 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -63,7 +63,7 @@ AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) if test "$osmo_ac_mgcp_transcoding" = "yes" ; then - AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""]) + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) AC_SUBST(LIBRARY_GSM) if test "$osmo_ac_with_g729" = "yes" ; then PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) -- To view, visit https://gerrit.osmocom.org/277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic23157cc5b75694f400a176c31f97d71e861ea02 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:33:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:33:57 +0000 Subject: osmo-bts[master]: fix compiler warning: add missing case (PHY_LINK_CONNECTING) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:34:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:34:40 +0000 Subject: osmo-bts[master]: fix compiler warning: printf format for sizeof() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:34:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:34:42 +0000 Subject: [MERGED] osmo-bts[master]: fix compiler warning: printf format for sizeof() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix compiler warning: printf format for sizeof() ...................................................................... fix compiler warning: printf format for sizeof() Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 --- M src/common/cbch.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/cbch.c b/src/common/cbch.c index 75bcf28..e511c67 100644 --- a/src/common/cbch.c +++ b/src/common/cbch.c @@ -111,7 +111,7 @@ if (msg_len > sizeof(scm->msg)) { LOGP(DLSMS, LOGL_ERROR, - "Cannot process SMSCB of %u bytes (max %lu)\n", + "Cannot process SMSCB of %u bytes (max %zu)\n", msg_len, sizeof(scm->msg)); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:34:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:34:48 +0000 Subject: [MERGED] osmo-bts[master]: fix compiler warning: add missing case (PHY_LINK_CONNECTING) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix compiler warning: add missing case (PHY_LINK_CONNECTING) ...................................................................... fix compiler warning: add missing case (PHY_LINK_CONNECTING) Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 --- M src/common/phy_link.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/phy_link.c b/src/common/phy_link.c index 131fd2c..43bb31c 100644 --- a/src/common/phy_link.c +++ b/src/common/phy_link.c @@ -71,6 +71,9 @@ LOGP(DL1C, LOGL_INFO, "trx_set_avail(0)\n"); trx_set_available(trx, 0); break; + case PHY_LINK_CONNECTING: + /* nothing to do */ + break; } } -- To view, visit https://gerrit.osmocom.org/288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:34:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:34:57 +0000 Subject: [MERGED] osmo-bts[master]: fix two compiler warnings: add two opaque struct declarations In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix two compiler warnings: add two opaque struct declarations ...................................................................... fix two compiler warnings: add two opaque struct declarations Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025 --- M tests/stubs.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/stubs.c b/tests/stubs.c index d6ef263..aeb7014 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -1,5 +1,8 @@ #include +struct femtol1_hdl; +struct bts_model_set_dyn_pdch_data; + /* * Stubs to provide an empty bts model implementation for testing. * If we ever want to re-define such a symbol we can make them weak -- To view, visit https://gerrit.osmocom.org/289 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:37:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:37:10 +0000 Subject: osmo-bts[master]: dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:38:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:38:25 +0000 Subject: osmo-bts[master]: dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:38:26 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 17 Jun 2016 15:38:26 +0000 Subject: [PATCH] osmo-bts[master]: DTX: add support for AMR/HR Message-ID: Review at https://gerrit.osmocom.org/324 DTX: add support for AMR/HR Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04 Fixes: OS#1562 --- M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 2 files changed, 70 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/24/324/1 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index e92c57b..add7951 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -431,7 +431,7 @@ GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len; + uint8_t payload_len, sid_first[7] = {0}; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -469,6 +469,32 @@ frame and drop last SID */ lchan->rtp_tx_marker = true; break; + case GsmL1_TchPlType_Amr_SidFirstP1: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstP2: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidUpdateInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + "(%d bytes)\n", payload_len); + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -490,6 +516,14 @@ case GsmL1_TchPlType_Amr: rmsg = l1_to_rtppayload_amr(payload, payload_len, lchan); break; + case GsmL1_TchPlType_Amr_SidFirstP2: + /* L1 do not give us SID_FIRST data, just indication */ + memcpy(sid_first, payload, payload_len); + int len = osmo_amr_rtp_enc(sid_first, 0, AMR_SID, AMR_GOOD); + if (len < 0) + return 0; + rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); + break; } if (rmsg) { diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a391fcc..e027408 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -523,7 +523,7 @@ GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len; + uint8_t payload_len, sid_first[7] = {0}; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -563,6 +563,32 @@ frame and drop last SID */ lchan->rtp_tx_marker = true; break; + case GsmL1_TchPlType_Amr_SidFirstP1: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstP2: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidUpdateInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + "(%d bytes)\n", payload_len); + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -586,6 +612,14 @@ case GsmL1_TchPlType_Amr: rmsg = l1_to_rtppayload_amr(payload, payload_len, lchan); break; + case GsmL1_TchPlType_Amr_SidFirstP2: + /* L1 do not give us SID_FIRST data, just indication */ + memcpy(sid_first, payload, payload_len); + int len = osmo_amr_rtp_enc(sid_first, 0, AMR_SID, AMR_GOOD); + if (len < 0) + return 0; + rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); + break; } if (rmsg) { -- To view, visit https://gerrit.osmocom.org/324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:38:26 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 17 Jun 2016 15:38:26 +0000 Subject: [PATCH] osmo-bts[master]: Move copy-pasted code into common part Message-ID: Review at https://gerrit.osmocom.org/325 Move copy-pasted code into common part Related: OS#1750 Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9 --- M include/osmo-bts/amr.h M include/osmo-bts/l1sap.h M include/osmo-bts/msg_utils.h M src/common/Makefile.am M src/common/amr.c M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/tch.c 10 files changed, 94 insertions(+), 165 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/25/325/1 diff --git a/include/osmo-bts/amr.h b/include/osmo-bts/amr.h index ba66e4d..6bdc41f 100644 --- a/include/osmo-bts/amr.h +++ b/include/osmo-bts/amr.h @@ -11,7 +11,7 @@ int amr_parse_mr_conf(struct amr_multirate_conf *amr_mrc, const uint8_t *mr_conf, unsigned int len); - +int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi); unsigned int amr_get_initial_mode(struct gsm_lchan *lchan); #endif /* _OSMO_BTS_AMR_H */ diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 1f8b2a5..dd25161 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -66,6 +66,9 @@ extern uint32_t gsmtap_sapi_mask; extern uint8_t gsmtap_sapi_acch; +int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn); + #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) int bts_check_for_first_ciphrd(struct gsm_lchan *lchan, diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index f63c096..73f8c96 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -4,6 +4,10 @@ #pragma once +#include + +#include + struct msgb; /** @@ -16,5 +20,8 @@ OML_MSG_TYPE_OSMO, }; +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update); +bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn); int msg_verify_ipa_structure(struct msgb *msg); int msg_verify_oml_structure(struct msgb *msg); diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 8df6513..fbb6572 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -6,7 +6,6 @@ libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ load_indication.c pcu_sock.c handover.c msg_utils.c \ - load_indication.c pcu_sock.c handover.c msg_utils.c \ tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c \ l1sap.c cbch.c power_control.c main.c phy_link.c diff --git a/src/common/amr.c b/src/common/amr.c index 80c5fb6..56ed430 100644 --- a/src/common/amr.c +++ b/src/common/amr.c @@ -22,6 +22,15 @@ LOGPC(ss, logl, "\n"); } +int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) +{ + unsigned int i; + for (i = 0; i < amr_mrc->num_modes; i++) { + if (amr_mrc->bts_mode[i].mode == cmi) + return i; + } + return -EINVAL; +} /* parse a GSM 04.08 MultiRate Config IE (10.5.2.21aa) in a more * comfortable internal data structure */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 163e129..d1aa090 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -104,6 +104,26 @@ return msg; } +int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn) +{ + struct osmo_phsap_prim *l1sap; + + LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", + gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); + + rmsg->l2h = rmsg->data; + msgb_push(rmsg, sizeof(*l1sap)); + rmsg->l1h = rmsg->data; + l1sap = msgb_l1sap_prim(rmsg); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, + rmsg); + l1sap->u.tch.chan_nr = chan_nr; + l1sap->u.tch.fn = fn; + + return l1sap_up(trx, l1sap); +} + static int l1sap_tx_ciph_req(struct gsm_bts_trx *trx, uint8_t chan_nr, uint8_t downlink, uint8_t uplink) { diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 841ffe6..6f42f73 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -86,6 +86,49 @@ return type; } +/* store the last SID frame in lchan context */ +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update) +{ + size_t copy_len = OSMO_MIN(length + 1, + ARRAY_SIZE(lchan->tch.last_sid.buf)); + + lchan->tch.last_sid.len = copy_len; + lchan->tch.last_sid.fn = fn; + lchan->tch.last_sid.is_update = update; + + memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); +} + +static inline bool fn_chk(uint8_t *t, uint32_t fn) +{ + uint8_t i; + for (i = 0; i < ARRAY_SIZE(t); i++) + if (fn % 104 == t[i]) + return false; + return true; +} + +/*! \brief Check if TX scheduling is optional for a given FN in case of DTX + * \param[in] lchan Logical channel on which we check scheduling + * \param[in] fn Frame Number for which we check scheduling + * \returns true if transmission can be omitted, false otherwise + */ +bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) +{ + /* According to 3GPP TS 45.008 ? 8.3: */ + uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, + h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, + h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; + if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if (lchan->type == GSM_LCHAN_TCH_F) + return fn_chk(f, fn); + else + return fn_chk(lchan->nr ? h1 : h0, fn); + } + return false; +} + /** * Return 0 in case the IPA structure is okay and in this * case the l2h will be set to the beginning of the data. diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index add7951..ec43c10 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -92,14 +93,6 @@ if (num_nibbles & 1) out[i] = (in[i] & 0xF) << 4; } - - -#define GSM_FR_BITS 260 -#define GSM_EFR_BITS 244 - -#define GSM_FR_BYTES 33 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */ -#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ -#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, struct gsm_lchan *lchan) @@ -250,16 +243,6 @@ lchan->tch.last_cmr = cur[0] >> 4; return msg; -} - -int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) -{ - unsigned int i; - for (i = 0; i < amr_mrc->num_modes; i++) { - if (amr_mrc->bts_mode[i].mode == cmi) - return i; - } - return -EINVAL; } /*! \brief convert AMR from RTP payload to L1 format @@ -526,23 +509,9 @@ break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - l1sap->u.tch.fn = data_ind->u32Fn; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); return 0; @@ -551,30 +520,6 @@ gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; -} - -static inline bool fn_chk(uint8_t *t, uint32_t fn) -{ - uint8_t i; - for (i = 0; i < ARRAY_SIZE(t); i++) - if (fn % 104 == t[i]) - return false; - return true; -} - -static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) -{ - /* 3GPP TS 45.008 ? 8.3 */ - uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, - h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, - h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; - if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { - if (lchan->type == GSM_LCHAN_TCH_F) - return fn_chk(f, fn); - else - return fn_chk(lchan->nr ? h1 : h0, fn); - } - return false; } static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) @@ -596,20 +541,6 @@ return true; } return false; -} - -/* store the last SID frame in lchan context */ -void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, - uint32_t fn, bool update) -{ - size_t copy_len = OSMO_MIN(length + 1, - ARRAY_SIZE(lchan->tch.last_sid.buf)); - - lchan->tch.last_sid.len = copy_len; - lchan->tch.last_sid.fn = fn; - lchan->tch.last_sid.is_update = update; - - memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); } struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index a000161..af78980 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -38,13 +38,6 @@ #include "l1_if.h" -#define GSM_FR_BITS 260 -#define GSM_EFR_BITS 244 - -#define GSM_FR_BYTES 33 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */ -#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ -#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ - /* input octet-aligned, output not octet-aligned */ void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, unsigned int num_nibbles) @@ -298,24 +291,9 @@ break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, - rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, - PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); return 0; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e027408..17469f0 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -328,16 +329,6 @@ return msg; } -int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) -{ - unsigned int i; - for (i = 0; i < amr_mrc->num_modes; i++) { - if (amr_mrc->bts_mode[i].mode == cmi) - return i; - } - return -EINVAL; -} - /*! \brief convert AMR from RTP payload to L1 format * \param[out] l1_payload payload part of L1 buffer * \param[in] rtp_payload pointer to RTP payload data @@ -622,23 +613,9 @@ break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - l1sap->u.tch.fn = data_ind->u32Fn; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); return 0; @@ -647,30 +624,6 @@ gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; -} - -static inline bool fn_chk(uint8_t *t, uint32_t fn) -{ - uint8_t i; - for (i = 0; i < ARRAY_SIZE(t); i++) - if (fn % 104 == t[i]) - return false; - return true; -} - -static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) -{ - /* 3GPP TS 45.008 ? 8.3 */ - uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, - h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, - h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; - if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { - if (lchan->type == GSM_LCHAN_TCH_F) - return fn_chk(f, fn); - else - return fn_chk(lchan->nr ? h1 : h0, fn); - } - return false; } static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) @@ -692,20 +645,6 @@ return true; } return false; -} - -/* store the last SID frame in lchan context */ -void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, - uint32_t fn, bool update) -{ - size_t copy_len = OSMO_MIN(length + 1, - ARRAY_SIZE(lchan->tch.last_sid.buf)); - - lchan->tch.last_sid.len = copy_len; - lchan->tch.last_sid.fn = fn; - lchan->tch.last_sid.is_update = update; - - memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); } struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) -- To view, visit https://gerrit.osmocom.org/325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:40:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:40:08 +0000 Subject: osmo-bts[master]: dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:40:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:40:31 +0000 Subject: osmo-bts[master]: dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:41:16 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 17 Jun 2016 15:41:16 +0000 Subject: osmo-bts[master]: configure: Add LT_INIT macro to enable libtool configuration. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Breaks build for me, not sure yet why. -- To view, visit https://gerrit.osmocom.org/301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:41:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:41:36 +0000 Subject: osmo-bts[master]: dyn PDCH: implement main dyn PDCH logic in common/ In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:42:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:42:01 +0000 Subject: osmo-bts[master]: dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:42:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:42:17 +0000 Subject: osmo-bts[master]: dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:43:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:43:49 +0000 Subject: osmo-bts[master]: dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:45:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:45:31 +0000 Subject: osmo-bts[master]: error log: two minor clarifications In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:46:09 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 17 Jun 2016 15:46:09 +0000 Subject: osmo-bts[master]: configure: Add LT_INIT macro to enable libtool configuration. In-Reply-To: References: Message-ID: Patch Set 1: The error doesn't seem relevant: arm-poky-linux-gnueabi-libtool: link: cannot find the library `/usr/lib/libortp.la' or unhandled argument `/usr/lib/libortp.la' -- To view, visit https://gerrit.osmocom.org/301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:49:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:49:56 +0000 Subject: osmo-bts[master]: debug log: log lchan state transitions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:44 +0000 Subject: osmo-bts[master]: debug log: log TS pchan type on connect In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:48 +0000 Subject: [MERGED] osmo-bts[master]: debug log: log TS pchan type on connect In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debug log: log TS pchan type on connect ...................................................................... debug log: log TS pchan type on connect A whitespace error is fixed along the way. Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d --- M src/osmo-bts-sysmo/oml.c 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 559c6a5..0700561 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -493,7 +493,11 @@ l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; cr->logChComb = pchan_to_logChComb[pchan]; - + + DEBUGP(DL1C, "%s pchan=%s ts_connect_as(%s) logChComb=%d\n", + gsm_lchan_name(ts->lchan), gsm_pchan_name(ts->pchan), + gsm_pchan_name(pchan), cr->logChComb); + return l1if_gsm_req_compl(fl1h, msg, cb, NULL); } -- To view, visit https://gerrit.osmocom.org/314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:48 +0000 Subject: [MERGED] osmo-bts[master]: debug log: log lchan state transitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debug log: log lchan state transitions ...................................................................... debug log: log lchan state transitions Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23 --- M src/common/lchan.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/lchan.c b/src/common/lchan.c index 5b6786a..fbc2636 100644 --- a/src/common/lchan.c +++ b/src/common/lchan.c @@ -19,9 +19,15 @@ * */ +#include +#include #include void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state) { + DEBUGP(DL1C, "%s state %s -> %s\n", + gsm_lchan_name(lchan), + gsm_lchans_name(lchan->state), + gsm_lchans_name(state)); lchan->state = state; } -- To view, visit https://gerrit.osmocom.org/313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:48 +0000 Subject: [MERGED] osmo-bts[master]: error log: two minor clarifications In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: error log: two minor clarifications ...................................................................... error log: two minor clarifications Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779 --- M src/common/pcu_sock.c M src/common/rsl.c 2 files changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index cfffb2e..d52cdb1 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -556,8 +556,10 @@ lchan = trx->ts[act_req->ts_nr].lchan; lchan->rel_act_kind = LCHAN_REL_ACT_PCU; if (lchan->type != GSM_LCHAN_PDTCH) { - LOGP(DPCU, LOGL_ERROR, "Lchan is not of type PDCH, but %d.\n", - lchan->type); + LOGP(DPCU, LOGL_ERROR, + "%s request, but lchan is not of type PDTCH (is %s)\n", + (act_req->activate) ? "Activate" : "Deactivate", + gsm_lchant_name(lchan->type)); return -EINVAL; } if (act_req->activate) diff --git a/src/common/rsl.c b/src/common/rsl.c index adf17f6..224a41a 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -755,7 +755,7 @@ if (lchan->state != LCHAN_S_NONE) { LOGP(DRSL, LOGL_ERROR, - "%s: error lchan is not available state: %s.\n", + "%s: error: lchan is not available, but in state: %s.\n", gsm_lchan_name(lchan), gsm_lchans_name(lchan->state)); return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL); } -- To view, visit https://gerrit.osmocom.org/312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:48 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() ...................................................................... dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*() Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1. Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in common/rsl.c. Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb to invoke dyn_pdch_connected() in common/rsl.c. Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae --- M src/osmo-bts-sysmo/oml.c 1 file changed, 49 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 2eafa71..559c6a5 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1846,13 +1846,60 @@ return l1if_set_txpower(trx_femtol1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } +static int ts_disconnect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphDisconnectCnf_t *cnf = &l1p->u.mphDisconnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + LOGP(DL1C, LOGL_DEBUG, "%s Rx mphDisconnectCnf\n", + gsm_lchan_name(ts->lchan)); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_disconnected(ts); + + return 0; +} + int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { - return -ENOTSUP; + struct msgb *msg = l1p_msgb_alloc(); + struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); + GsmL1_MphDisconnectReq_t *cr; + + DEBUGP(DRSL, "%s TS disconnect\n", gsm_lchan_name(ts->lchan)); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDisconnectReq, fl1h, + l1p_handle_for_ts(ts)); + cr->u8Tn = ts->nr; + + return l1if_gsm_req_compl(fl1h, msg, ts_disconnect_cb, NULL); +} + +static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphConnectCnf_t *cnf = &l1p->u.mphConnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + DEBUGP(DL1C, "%s %s Rx mphConnectCnf flags=%s%s%s\n", + gsm_lchan_name(ts->lchan), + gsm_pchan_name(ts->pchan), + ts->flags & TS_F_PDCH_ACTIVE ? "ACTIVE " : "", + ts->flags & TS_F_PDCH_ACT_PENDING ? "ACT_PENDING " : "", + ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : ""); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_connected(ts); + + return 0; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return -ENOTSUP; + return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:48 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F ...................................................................... dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef --- M src/osmo-bts-sysmo/oml.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index ce8d2f4..2eafa71 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -86,7 +86,8 @@ [GSM_PCHAN_SDCCH8_SACCH8C] = GsmL1_LogChComb_VII, [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = GsmL1_LogChComb_VII, [GSM_PCHAN_PDCH] = GsmL1_LogChComb_XIII, - //[GSM_PCHAN_TCH_F_PDCH] = FIXME, + [GSM_PCHAN_TCH_F_PDCH] = GsmL1_LogChComb_I, /*< first init + like TCH/F, until PDCH ACT */ [GSM_PCHAN_UNKNOWN] = GsmL1_LogChComb_0, }; -- To view, visit https://gerrit.osmocom.org/310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:49 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts ...................................................................... dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH. Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave ts_connect() as a thin wrapper to leave init code unchanged. Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 --- M src/osmo-bts-sysmo/oml.c 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 5d24bcb..ce8d2f4 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -480,7 +480,9 @@ } } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan, + l1if_compl_cb *cb, void *data) { struct msgb *msg = l1p_msgb_alloc(); struct femtol1_hdl *fl1h = trx_femtol1_hdl(ts->trx); @@ -489,9 +491,14 @@ cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; - cr->logChComb = pchan_to_logChComb[ts->pchan]; + cr->logChComb = pchan_to_logChComb[pchan]; - return l1if_gsm_req_compl(fl1h, msg, opstart_compl_cb, NULL); + return l1if_gsm_req_compl(fl1h, msg, cb, NULL); +} + +static int ts_connect(struct gsm_bts_trx_ts *ts) +{ + return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL); } GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan) -- To view, visit https://gerrit.osmocom.org/295 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:49 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: implement main dyn PDCH logic in common/ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: implement main dyn PDCH logic in common/ ...................................................................... dyn PDCH: implement main dyn PDCH logic in common/ React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_* APIs to effect switchover. The dyn PDCH interaction is described in the comment to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover. In case the bts_model_ts_* are not implemented (or return other errors), reply with an IPAC PDCH ACT/DEACT NACK. Add callbacks that mark steps in the PDCH switchover process, dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete(). Add hooks in l1sap.c on channel activation and release confirmation, to call dyn PDCH callbacks. BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and dyn_pdch_ts_connected() when bts_model_ts_disconnect() or bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS) Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab --- M include/osmo-bts/rsl.h M src/common/l1sap.c M src/common/rsl.c 3 files changed, 284 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 6cb40dd..173e086 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -35,5 +35,9 @@ struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr); +void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts); +void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts); +void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc); + #endif // _RSL_H */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 163e129..0af7343 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -440,6 +440,12 @@ else rsl_tx_chan_act_ack(lchan); + /* During PDCH ACT, this is where we know that the PCU is done + * activating a PDCH, and PDCH switchover is complete. See + * rsl_rx_dyn_pdch() */ + if (lchan->ts->flags & TS_F_PDCH_ACT_PENDING) + dyn_pdch_complete(lchan->ts, info_act_cnf->cause? -EIO : 0); + return 0; } @@ -457,6 +463,12 @@ rsl_tx_rf_rel_ack(lchan); + /* During PDCH DEACT, this marks the deactivation of the PDTCH as + * requested by the PCU. Next up, we disconnect the TS completely and + * call back to dyn_pdch_ts_disconnected(). See rsl_rx_dyn_pdch(). */ + if (lchan->ts->flags & TS_F_PDCH_DEACT_PENDING) + bts_model_ts_disconnect(lchan->ts); + return 0; } diff --git a/src/common/rsl.c b/src/common/rsl.c index 7e8d48c..adf17f6 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1622,6 +1622,269 @@ } /* + * dynamic TCH/F_PDCH related messages, originally ip.access specific but + * reused for other BTS models (sysmo-bts, ...) + */ + +/* PDCH ACT/DEACT ACKNOWLEDGE */ +static int rsl_tx_dyn_pdch_ack(struct gsm_lchan *lchan, bool pdch_act) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s ACK\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT"); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + msg->len = 0; + msg->data = msg->tail = msg->l3h; + + rsl_dch_push_hdr(msg, + pdch_act? RSL_MT_IPAC_PDCH_ACT_ACK + : RSL_MT_IPAC_PDCH_DEACT_ACK, + chan_nr); + msg->lchan = lchan; + msg->trx = lchan->ts->trx; + + return abis_bts_rsl_sendmsg(msg); +} + +/* PDCH ACT/DEACT NEGATIVE ACKNOWLEDGE */ +static int rsl_tx_dyn_pdch_nack(struct gsm_lchan *lchan, bool pdch_act, + uint8_t cause) +{ + struct msgb *msg; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + + LOGP(DRSL, LOGL_NOTICE, "%s Tx PDCH %s NACK (cause = 0x%02x)\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", cause); + + msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); + if (!msg) + return -ENOMEM; + + msg->len = 0; + msg->data = msg->tail = msg->l3h; + + /* 9.3.26 Cause */ + msgb_tlv_put(msg, RSL_IE_CAUSE, 1, &cause); + rsl_dch_push_hdr(msg, + pdch_act? RSL_MT_IPAC_PDCH_ACT_NACK + : RSL_MT_IPAC_PDCH_DEACT_NACK, + chan_nr); + msg->lchan = lchan; + msg->trx = lchan->ts->trx; + + return abis_bts_rsl_sendmsg(msg); +} + +/* Starting point for dynamic PDCH switching. See doc/dyn_pdch.msc for a + * diagram of what will happen here. The implementation is as follows: + * + * PDCH ACT == TCH/F -> PDCH: + * 1. call bts_model_ts_disconnect() to disconnect TCH/F; + * 2. dyn_pdch_ts_disconnected() is called when done; + * 3. call bts_model_ts_connect() to connect as PDTCH; + * 4. dyn_pdch_ts_connected() is called when done; + * 5. instruct the PCU to enable PDTCH; + * 6. the PCU will call back with an activation request; + * 7. l1sap_info_act_cnf() will call dyn_pdch_complete() when SAPI activations + * are done; + * 8. send a PDCH ACT ACK. + * + * PDCH DEACT == PDCH -> TCH/F: + * 1. instruct the PCU to disable PDTCH; + * 2. the PCU will call back with a deactivation request; + * 3. l1sap_info_rel_cnf() will call bts_model_ts_disconnect() when SAPI + * deactivations are done; + * 4. dyn_pdch_ts_disconnected() is called when done; + * 5. call bts_model_ts_connect() to connect as TCH/F; + * 6. dyn_pdch_ts_connected() is called when done; + * 7. directly call dyn_pdch_complete(), since no further action required for + * TCH/F; + * 8. send a PDCH DEACT ACK. + * + * When an error happens along the way, a PDCH DE/ACT NACK is sent. + * TODO: may need to be made more waterproof in all stages, to send a NACK and + * clear the PDCH pending flags from ts->flags. + */ +static void rsl_rx_dyn_pdch(struct msgb *msg, bool pdch_act) +{ + int rc; + struct gsm_lchan *lchan = msg->lchan; + struct gsm_bts_trx_ts *ts = lchan->ts; + bool is_pdch_act = (ts->flags & TS_F_PDCH_ACTIVE); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) { + /* Only one of the pending flags should ever be set at the same + * time, but just log both in case both should be set. */ + LOGP(DL1C, LOGL_ERROR, + "%s Request to PDCH %s, but PDCH%s%s is still pending\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", + (ts->flags & TS_F_PDCH_ACT_PENDING)? " ACT" : "", + (ts->flags & TS_F_PDCH_DEACT_PENDING)? " DEACT" : ""); + rsl_tx_dyn_pdch_nack(lchan, pdch_act, RSL_ERR_NORMAL_UNSPEC); + return; + } + + ts->flags |= pdch_act? TS_F_PDCH_ACT_PENDING + : TS_F_PDCH_DEACT_PENDING; + + /* ensure that this is indeed a dynamic-PDCH channel */ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) { + LOGP(DRSL, LOGL_ERROR, + "%s Attempt to PDCH %s on TS that is not a TCH/F_PDCH (is %s)\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT", + gsm_pchan_name(ts->pchan)); + dyn_pdch_complete(ts, -EINVAL); + return; + } + + if (is_pdch_act == pdch_act) { + LOGP(DL1C, LOGL_NOTICE, + "%s Request to PDCH %s, but is already so\n", + gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT"); + dyn_pdch_complete(ts, 0); + return; + } + + if (pdch_act) { + /* First, disconnect the TCH channel, to connect PDTCH later */ + rc = bts_model_ts_disconnect(ts); + } else { + /* First, deactivate PDTCH through the PCU, to connect TCH + * later. + * pcu_tx_info_ind() will pick up TS_F_PDCH_DEACT_PENDING and + * trigger a deactivation. + * Except when the PCU is not connected yet, then trigger + * disconnect immediately from here. The PCU will catch up when + * it connects. */ + /* TODO: timeout on channel connect / disconnect request from PCU? */ + if (pcu_connected()) + rc = pcu_tx_info_ind(); + else + rc = bts_model_ts_disconnect(ts); + } + + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); +} + +void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts) +{ + int rc; + enum gsm_phys_chan_config as_pchan; + + if (ts->flags & TS_F_PDCH_DEACT_PENDING) { + LOGP(DRSL, LOGL_DEBUG, + "%s PDCH DEACT operation: channel disconnected, will reconnect as TCH\n", + gsm_lchan_name(ts->lchan)); + ts->lchan[0].type = GSM_LCHAN_TCH_F; + as_pchan = GSM_PCHAN_TCH_F; + } else if (ts->flags & TS_F_PDCH_ACT_PENDING) { + LOGP(DRSL, LOGL_DEBUG, + "%s PDCH ACT operation: channel disconnected, will reconnect as PDTCH\n", + gsm_lchan_name(ts->lchan)); + ts->lchan[0].type = GSM_LCHAN_PDTCH; + as_pchan = GSM_PCHAN_PDCH; + } + + rc = bts_model_ts_connect(ts, as_pchan); + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); +} + +void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts) +{ + int rc; + + if (ts->flags & TS_F_PDCH_DEACT_PENDING) { + if (ts->lchan[0].type != GSM_LCHAN_TCH_F) + LOGP(DRSL, LOGL_ERROR, "%s PDCH DEACT error:" + " timeslot connected, so expecting" + " lchan type TCH/F, but is %s\n", + gsm_lchan_name(ts->lchan), + gsm_lchant_name(ts->lchan[0].type)); + + LOGP(DRSL, LOGL_DEBUG, "%s PDCH DEACT operation:" + " timeslot connected as TCH/F\n", + gsm_lchan_name(ts->lchan)); + + /* During PDCH DEACT, we're done right after the TCH/F came + * back up. */ + dyn_pdch_complete(ts, 0); + + } else if (ts->flags & TS_F_PDCH_ACT_PENDING) { + if (ts->lchan[0].type != GSM_LCHAN_PDTCH) + LOGP(DRSL, LOGL_ERROR, "%s PDCH ACT error:" + " timeslot connected, so expecting" + " lchan type PDTCH, but is %s\n", + gsm_lchan_name(ts->lchan), + gsm_lchant_name(ts->lchan[0].type)); + + LOGP(DRSL, LOGL_DEBUG, "%s PDCH ACT operation:" + " timeslot connected as PDTCH\n", + gsm_lchan_name(ts->lchan)); + + /* The PDTCH is connected, now tell the PCU about it. Except + * when the PCU is not connected (yet), then there's nothing + * left to do now. The PCU will catch up when it connects. */ + if (!pcu_connected()) { + dyn_pdch_complete(ts, 0); + return; + } + + /* The PCU will request to activate the PDTCH SAPIs, which, + * when done, will call back to dyn_pdch_complete(). */ + /* TODO: timeout on channel connect / disconnect request from PCU? */ + rc = pcu_tx_info_ind(); + + /* Error? then NACK right now. */ + if (rc) + dyn_pdch_complete(ts, rc); + } +} + +void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc) +{ + bool pdch_act = ts->flags & TS_F_PDCH_ACT_PENDING; + + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == TS_F_PDCH_PENDING_MASK) + LOGP(DRSL, LOGL_ERROR, + "%s Internal Error: both PDCH ACT and PDCH DEACT pending\n", + gsm_lchan_name(ts->lchan)); + + ts->flags &= ~TS_F_PDCH_PENDING_MASK; + + if (rc != 0) { + LOGP(DRSL, LOGL_ERROR, + "PDCH %s on dynamic TCH/F_PDCH returned error %d\n", + pdch_act? "ACT" : "DEACT", rc); + rsl_tx_dyn_pdch_nack(ts->lchan, pdch_act, RSL_ERR_NORMAL_UNSPEC); + return; + } + + if (pdch_act) + ts->flags |= TS_F_PDCH_ACTIVE; + else + ts->flags &= ~TS_F_PDCH_ACTIVE; + DEBUGP(DL1C, "%s %s switched to %s mode (ts->flags == %x)\n", + gsm_lchan_name(ts->lchan), gsm_pchan_name(ts->pchan), + pdch_act? "PDCH" : "TCH/F", ts->flags); + + rc = rsl_tx_dyn_pdch_ack(ts->lchan, pdch_act); + if (rc) + LOGP(DRSL, LOGL_ERROR, + "Failed to transmit PDCH %s ACK, rc %d\n", + pdch_act? "ACT" : "DEACT", rc); +} + +/* * selecting message */ @@ -1868,6 +2131,11 @@ case RSL_MT_MS_POWER_CONTROL: ret = rsl_rx_ms_pwr_ctrl(msg); break; + case RSL_MT_IPAC_PDCH_ACT: + case RSL_MT_IPAC_PDCH_DEACT: + rsl_rx_dyn_pdch(msg, dch->c.msg_type == RSL_MT_IPAC_PDCH_ACT); + ret = 0; + break; case RSL_MT_PHY_CONTEXT_REQ: case RSL_MT_PREPROC_CONFIG: case RSL_MT_RTD_REP: -- To view, visit https://gerrit.osmocom.org/309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:49 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags ...................................................................... dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 15 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 14de251..0330308 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -611,11 +611,23 @@ return l1sap_up(trx, &l1sap); } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) + return ts->pchan; + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + switch (sapi) { case GsmL1_Sapi_Bcch: cbits = 0x10; @@ -724,7 +736,7 @@ uint32_t fn; /* check if primitive should be handled by common part */ - chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi, rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn); if (chan_nr) { fn = rts_ind->u32Fn; @@ -848,7 +860,7 @@ uint32_t fn; int rc = 0; - chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " -- To view, visit https://gerrit.osmocom.org/308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:49 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode ...................................................................... dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode Introduce a static function to encapsulate the decision whether a TS is used for PDCH. Depending on the ts->flags, handle a TCH/F_PDCH TS exactly like a standard PDCH TS. Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b --- M src/common/pcu_sock.c 1 file changed, 19 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index ea4267d..cfffb2e 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -95,6 +95,24 @@ return msg; } +static bool ts_is_pdch(struct gsm_bts_trx_ts *ts) { + if (ts->pchan == GSM_PCHAN_PDCH) + return true; + if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { + /* When we're busy deactivating the PDCH, we first set + * DEACT_PENDING, tell the PCU about it and wait for a + * response. So DEACT_PENDING means "no PDCH" to the PCU. + * Similarly, when we're activating PDCH, we set the + * ACT_PENDING and wait for an activation response from the + * PCU, so ACT_PENDING means "is PDCH". */ + if (ts->flags & TS_F_PDCH_ACTIVE) + return !(ts->flags & TS_F_PDCH_DEACT_PENDING); + else + return (ts->flags & TS_F_PDCH_ACT_PENDING); + } + return false; +} + int pcu_tx_info_ind(void) { struct gsm_network *net = &bts_gsmnet; @@ -207,7 +225,7 @@ for (j = 0; j < 8; j++) { ts = &trx->ts[j]; if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED - && ts->pchan == GSM_PCHAN_PDCH) { + && ts_is_pdch(ts)) { info_ind->trx[i].pdch_mask |= (1 << j); info_ind->trx[i].tsc[j] = (ts->tsc >= 0) ? ts->tsc : bts->bsic & 7; -- To view, visit https://gerrit.osmocom.org/307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:49 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs ...................................................................... dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH. All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT or DEACT *NACK* to be sent to the BSC as soon as these messages are handled. Also add stubs in tests. Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d --- M include/osmo-bts/bts_model.h M src/osmo-bts-litecell15/oml.c M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/oml.c M src/osmo-bts-trx/l1_if.c M tests/handover/handover_test.c M tests/stubs.c 7 files changed, 56 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index 6252557..7e2d088 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -55,4 +55,7 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink); void bts_model_phy_instance_set_defaults(struct phy_instance *pinst); +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts); +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan); + #endif diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 7aedee1..fa9f601 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1764,3 +1764,14 @@ { return l1if_set_txpower(trx_lc15l1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index 401201a..c893b04 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -1585,3 +1585,14 @@ #warning "Implement bts_model_change_power based on TRX_MODIFY_RF_CID" return 0; } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index 60ab7a8..5d24bcb 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1837,3 +1837,14 @@ { return l1if_set_txpower(trx_femtol1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 8ccba90..59442d9 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -747,3 +747,14 @@ LOGP(DL1C, LOGL_NOTICE, "Setting TRX output power not supported!\n"); return 0; } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ + return -ENOTSUP; +} + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ + return -ENOTSUP; +} diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 8b299d0..e1f4d86 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -275,3 +275,5 @@ int bts_model_trx_close(struct gsm_bts_trx *trx) { return 0; } void trx_get_hlayer1(void) {} int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { return 0; } +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { return 0; } +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { return 0; } diff --git a/tests/stubs.c b/tests/stubs.c index aeb7014..c680db0 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -46,3 +46,10 @@ void bts_model_abis_close(struct gsm_bts *bts) { } + +int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) +{ return 0; } + +int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config as_pchan) +{ return 0; } -- To view, visit https://gerrit.osmocom.org/306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:50:49 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH ...................................................................... dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH Depending on the PDCH active flag, handle a TCH/F_PDCH like TCH/F or PDCH. Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 --- M src/common/oml.c 1 file changed, 8 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/oml.c b/src/common/oml.c index bee2f84..9d3c454 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -689,14 +689,19 @@ { struct gsm_lchan *lchan; unsigned int i; + enum gsm_phys_chan_config pchan = ts->pchan; - switch (ts->pchan) { + if (pchan == GSM_PCHAN_TCH_F_PDCH) + pchan = ts->flags & TS_F_PDCH_ACTIVE? GSM_PCHAN_PDCH + : GSM_PCHAN_TCH_F; + + switch (pchan) { case GSM_PCHAN_CCCH_SDCCH4_CBCH: /* fallthrough */ case GSM_PCHAN_CCCH_SDCCH4: for (i = 0; i < 4; i++) { lchan = &ts->lchan[i]; - if (ts->pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH + if (pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH && i == 2) { lchan->type = GSM_LCHAN_CBCH; } else { @@ -723,7 +728,7 @@ case GSM_PCHAN_SDCCH8_SACCH8C: for (i = 0; i < 8; i++) { lchan = &ts->lchan[i]; - if (ts->pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH + if (pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH && i == 2) { lchan->type = GSM_LCHAN_CBCH; } else { -- To view, visit https://gerrit.osmocom.org/293 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:54:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:54:27 +0000 Subject: osmo-bts[master]: Move copy-pasted code into common part In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:54:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 15:54:47 +0000 Subject: osmo-bts[master]: DTX: add support for AMR/HR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:57:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 15:57:55 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 1 In-Reply-To: References: Message-ID: TEST 2: cherry pick strategy 1 x Change-Id: I308db870ce3f37d4db97c327552471958dffbeed --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/20/320/2 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..64beeb3 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST COMMIT + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I308db870ce3f37d4db97c327552471958dffbeed Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:57:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 15:57:55 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 2 In-Reply-To: References: Message-ID: TEST 2: cherry pick strategy 2 Change-Id: I954ecdd1480dbe5859a0478d7cc88fdc9c3c356a --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/321/2 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..528dcb0 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST really amended COMMIT + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I954ecdd1480dbe5859a0478d7cc88fdc9c3c356a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 15:57:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 15:57:55 +0000 Subject: [PATCH] openbsc[master]: TEST 2: cherry pick strategy 3 In-Reply-To: References: Message-ID: TEST 2: cherry pick strategy 3 Change-Id: I9fd88c022344e7d8139971d4d2c138cefaec8618 --- M openbsc/doc/BS11-OML.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/322/2 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index 64beeb3..e5ba667 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,4 +1,4 @@ -TEST COMMIT +TEST dependent amended COMMIT The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9fd88c022344e7d8139971d4d2c138cefaec8618 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:02:22 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 17 Jun 2016 16:02:22 +0000 Subject: [PATCH] libosmocore[master]: Add octet-aligned/unaligned shift functions Message-ID: Review at https://gerrit.osmocom.org/326 Add octet-aligned/unaligned shift functions The actual code is from OsmoBTS' tch.c by Harald Welte. Change-Id: I2b1901c4161e8035f059585901dca593b661556d --- M include/osmocom/core/bits.h M src/bits.c 2 files changed, 49 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/326/1 diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 3218330..5535920 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -41,6 +41,11 @@ int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits); +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); + void osmo_ubit2sbit(sbit_t *out, const ubit_t *in, unsigned int num_bits); void osmo_sbit2ubit(ubit_t *out, const sbit_t *in, unsigned int num_bits); diff --git a/src/bits.c b/src/bits.c index 569a10f..613e258 100644 --- a/src/bits.c +++ b/src/bits.c @@ -61,6 +61,50 @@ return outptr - out; } +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, unaligned + * \param[in] in input buffer, octet-aligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + + /* first byte: upper nibble empty, lower nibble from src */ + out[0] = (in[0] >> 4); + + /* bytes 1.. */ + for (i = 1; i < num_whole_bytes; i++) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + else + out[i] = (in[i - 1] & 0xF) << 4; +} + +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, octet-aligned + * \param[in] in input buffer, unaligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + + for (i = 0; i < num_whole_bytes; i++) + out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = (in[i] & 0xF) << 4; +} + /*! \brief convert unpacked bits to soft bits * \param[out] out output buffer of soft bits * \param[in] in input buffer of unpacked bits -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:04:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 17 Jun 2016 16:04:53 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I think we should have some at least minimalistic test case for the newly introduced functions. -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:09:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:09:36 +0000 Subject: [ABANDON] openbsc[master]: TEST 2: cherry pick strategy 1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 2: cherry pick strategy 1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I308db870ce3f37d4db97c327552471958dffbeed Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:09:41 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:09:41 +0000 Subject: [ABANDON] openbsc[master]: TEST 2: cherry pick strategy 2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 2: cherry pick strategy 2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I954ecdd1480dbe5859a0478d7cc88fdc9c3c356a Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:09:44 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:09:44 +0000 Subject: [ABANDON] openbsc[master]: TEST 2: cherry pick strategy 3 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 2: cherry pick strategy 3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I9fd88c022344e7d8139971d4d2c138cefaec8618 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:09:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:09:49 +0000 Subject: [ABANDON] openbsc[master]: TEST 2: cherry pick strategy 4 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 2: cherry pick strategy 4 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1a9dca58a447dc19aebbc7e990ad03847ce7546b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:12:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:12:58 +0000 Subject: [PATCH] openbsc[master]: TEST 3-1 Message-ID: Review at https://gerrit.osmocom.org/327 TEST 3-1 Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/327/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..64beeb3 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST COMMIT + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:12:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:12:58 +0000 Subject: [PATCH] openbsc[master]: TEST 3-2 Message-ID: Review at https://gerrit.osmocom.org/328 TEST 3-2 Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/328/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..528dcb0 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST really amended COMMIT + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:12:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:12:58 +0000 Subject: [PATCH] openbsc[master]: TEST 3-3 Message-ID: Review at https://gerrit.osmocom.org/329 TEST 3-3 Change-Id: I345f473fb1ccb238cf8d815c9752991a038c1b7b --- M openbsc/doc/BS11-OML.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/329/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index 64beeb3..e5ba667 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,4 +1,4 @@ -TEST COMMIT +TEST dependent amended COMMIT The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I345f473fb1ccb238cf8d815c9752991a038c1b7b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:12:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:12:59 +0000 Subject: [PATCH] openbsc[master]: TEST 3-4 Message-ID: Review at https://gerrit.osmocom.org/330 TEST 3-4 Change-Id: Ie2e28f3b41c966f55c4800828aba8e47d119eeaa --- M openbsc/doc/call-routing.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/30/330/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 528dcb0..5be21a1 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -20,7 +20,7 @@ * If subscriber is not found: # send RELEASE COMPLETE with apropriate cause to MO (1: unalloacated 3: no route) - +TEST independent COMMIT Thoughts about RR/MM: -- To view, visit https://gerrit.osmocom.org/330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2e28f3b41c966f55c4800828aba8e47d119eeaa Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:14:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:14:18 +0000 Subject: [PATCH] openbsc[master]: TEST 3-1 In-Reply-To: References: Message-ID: TEST 3-1 x Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/327/2 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..64beeb3 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST COMMIT + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:14:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:14:18 +0000 Subject: [PATCH] openbsc[master]: TEST 3-2 In-Reply-To: References: Message-ID: TEST 3-2 Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/328/2 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..528dcb0 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST really amended COMMIT + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:14:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:14:18 +0000 Subject: [PATCH] openbsc[master]: TEST 3-3 In-Reply-To: References: Message-ID: TEST 3-3 Change-Id: I345f473fb1ccb238cf8d815c9752991a038c1b7b --- M openbsc/doc/BS11-OML.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/329/2 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index 64beeb3..b76c8c5 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,4 +1,4 @@ -TEST COMMIT +TEST dependent amended again COMMIT The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I345f473fb1ccb238cf8d815c9752991a038c1b7b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:33:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:33:55 +0000 Subject: [PATCH] openbsc[master]: TEST 3-1 In-Reply-To: References: Message-ID: TEST 3-1 y Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/327/3 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..64beeb3 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST COMMIT + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:33:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:33:55 +0000 Subject: [PATCH] openbsc[master]: TEST 3-2 In-Reply-To: References: Message-ID: TEST 3-2 Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 --- M openbsc/doc/call-routing.txt M openbsc/doc/gsm-hopping.txt 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/328/3 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..528dcb0 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST really amended COMMIT + Call routing in OpenBSC Flow of events: diff --git a/openbsc/doc/gsm-hopping.txt b/openbsc/doc/gsm-hopping.txt index c964963..b0d96b1 100644 --- a/openbsc/doc/gsm-hopping.txt +++ b/openbsc/doc/gsm-hopping.txt @@ -1,3 +1,5 @@ +TEST + according to GSM 05.02: general parameters from CCCH: -- To view, visit https://gerrit.osmocom.org/328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:35:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:35:02 +0000 Subject: [ABANDON] openbsc[master]: TEST 3-4 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 3-4 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie2e28f3b41c966f55c4800828aba8e47d119eeaa Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:35:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:35:06 +0000 Subject: [ABANDON] openbsc[master]: TEST 3-3 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 3-3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I345f473fb1ccb238cf8d815c9752991a038c1b7b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:35:08 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:35:08 +0000 Subject: [ABANDON] openbsc[master]: TEST 3-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 3-2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I65cae587132bec2e13dbda94489297d8bd026999 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 16:35:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 16:35:11 +0000 Subject: [ABANDON] openbsc[master]: TEST 3-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 3-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I33aa2155d990a9f77ddb787d0d5f74461c20e3fb Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 17 18:08:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 18:08:18 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: In some instances, we have the string list "hidden" in a .c file, for example rsl_msg_name(); we could change that one day. Otherwise: +1 for inlines in the headers! -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 18:11:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 18:11:30 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: But we agree that we don't want to have two lists for channel type names, right? ... so, Max, can I get your +N? :) -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 17 20:07:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 17 Jun 2016 20:07:11 +0000 Subject: [PATCH] openbsc[master]: Remove unused auth code and add comment Message-ID: Review at https://gerrit.osmocom.org/331 Remove unused auth code and add comment The GSM_SECURITY_AUTH_FAILED path is never invoked by the gsm48_secure_channel() function as it is today. Keep the GSM_SECURITY_AUTH_FAILED case, since the upcoming Iu auth will use it. But rather return an error, which will lead to a timeout, and a LU Reject will be sent. If the GSM_SECURITY_AUTH_FAILED code path removed by this patch were invoked, it would never send out a LU Reject, since a call to release_loc_updating_req() only releases the connection. To reject, a call to gsm0408_loc_upd_rej() would be necessary, as seen in loc_upd_rej_cb(). Arguably, it may be desirable to omit a LU Reject in case of an auth failure, to be less friendly to auth attackers? So far that was not the case (since that code path was never used), so not adding this behavior now. Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f --- M openbsc/src/libmsc/gsm_04_08.c 1 file changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/31/331/1 diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..5e4b466 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -361,10 +361,6 @@ int rc = 0; switch (event) { - case GSM_SECURITY_AUTH_FAILED: - release_loc_updating_req(conn, 1); - break; - case GSM_SECURITY_ALREADY: LOGP(DMM, LOGL_ERROR, "We don't expect LOCATION " "UPDATING after CM SERVICE REQUEST\n"); @@ -375,6 +371,19 @@ rc = finish_lu(conn); break; + case GSM_SECURITY_AUTH_FAILED: + /* + * gsm48_secure_channel() will pass only + * GSM_SECURITY_NOAVAIL in case of failure. If future + * code should add a GSM_SECURITY_AUTH_FAILED status in + * this code path, letting the Location Update time out + * will do all necessary error messaging and logging, + * see loc_upd_rej_cb(). + */ + LOGP(DMM, LOGL_ERROR, + "Authorization failed for subscriber %s\n", + subscr_name(conn->subscr)); + /* fall through */ default: rc = -EINVAL; }; -- To view, visit https://gerrit.osmocom.org/331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 18 11:34:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 18 Jun 2016 11:34:18 +0000 Subject: openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jun 18 11:34:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 18 Jun 2016 11:34:21 +0000 Subject: [MERGED] openbsc[master]: rm dup: use channel type names from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rm dup: use channel type names from libosmocore ...................................................................... rm dup: use channel type names from libosmocore In gsm_lchant_name(enum gsm_chan_t), use the gsm_chan_t_names value strings from libosmocore instead of redefining the same strings. The list from libosmocore is also more complete, including CCCH and PDTCH. Add a todo comment to move to libosmocore. In consequence, libosmogsm linkage needs to be added to osmo-bsc_mgcp, mgcp_test, mgcp_transcoding_test and smpp_mirror, smpp_test. Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libcommon/gsm_data_shared.c M openbsc/src/osmo-bsc_mgcp/Makefile.am M openbsc/src/utils/Makefile.am M openbsc/tests/mgcp/Makefile.am M openbsc/tests/smpp/Makefile.am 6 files changed, 10 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index e46647c..d3a61af 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -787,7 +787,6 @@ const struct value_string gsm_pchant_names[12]; const struct value_string gsm_pchant_descs[12]; -const struct value_string gsm_lchant_names[8]; const char *gsm_pchan_name(enum gsm_phys_chan_config c); enum gsm_phys_chan_config gsm_pchan_parse(const char *name); const char *gsm_lchant_name(enum gsm_chan_t c); diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c index 9f9eb1e..e9eb4b0 100644 --- a/openbsc/src/libcommon/gsm_data_shared.c +++ b/openbsc/src/libcommon/gsm_data_shared.c @@ -92,19 +92,10 @@ return get_string_value(gsm_pchant_names, name); } -const struct value_string gsm_lchant_names[8] = { - { GSM_LCHAN_NONE, "NONE" }, - { GSM_LCHAN_SDCCH, "SDCCH" }, - { GSM_LCHAN_TCH_F, "TCH/F" }, - { GSM_LCHAN_TCH_H, "TCH/H" }, - { GSM_LCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_LCHAN_CBCH, "CBCH" }, - { 0, NULL } -}; - +/* TODO: move to libosmocore, next to gsm_chan_t_names? */ const char *gsm_lchant_name(enum gsm_chan_t c) { - return get_value_string(gsm_lchant_names, c); + return get_value_string(gsm_chan_t_names, c); } static const struct value_string lchan_s_names[] = { diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/openbsc/src/osmo-bsc_mgcp/Makefile.am index 949cb64..a48f24b 100644 --- a/openbsc/src/osmo-bsc_mgcp/Makefile.am +++ b/openbsc/src/osmo-bsc_mgcp/Makefile.am @@ -9,6 +9,6 @@ osmo_bsc_mgcp_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libmgcp/libmgcp.a -lrt \ - $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ $(LIBOSMONETIF_LIBS) $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) diff --git a/openbsc/src/utils/Makefile.am b/openbsc/src/utils/Makefile.am index 4521130..5a2e2d2 100644 --- a/openbsc/src/utils/Makefile.am +++ b/openbsc/src/utils/Makefile.am @@ -27,7 +27,7 @@ smpp_mirror_SOURCES = smpp_mirror.c smpp_mirror_LDADD = $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) $(LIBSMPP34_LIBS) + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBSMPP34_LIBS) meas_vis_SOURCES = meas_vis.c meas_vis_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -lcdk -lncurses diff --git a/openbsc/tests/mgcp/Makefile.am b/openbsc/tests/mgcp/Makefile.am index ec7cc99..82d6ac6 100644 --- a/openbsc/tests/mgcp/Makefile.am +++ b/openbsc/tests/mgcp/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir) -AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMONETIF_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(COVERAGE_CFLAGS) $(LIBBCG729_CFLAGS) +AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_FLAGS) $(LIBOSMONETIF_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(COVERAGE_CFLAGS) $(LIBBCG729_CFLAGS) AM_LDFLAGS = $(COVERAGE_LDFLAGS) EXTRA_DIST = mgcp_test.ok mgcp_transcoding_test.ok @@ -15,7 +15,8 @@ mgcp_test_LDADD = $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ + -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) $(LIBOSMONETIF_LIBS) mgcp_transcoding_test_SOURCES = mgcp_transcoding_test.c @@ -24,5 +25,6 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) $(LIBBCG729_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ + $(LIBBCG729_LIBS) -lrt -lm $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) \ $(LIBRARY_DL) $(LIBOSMONETIF_LIBS) $(LIBRARY_GSM) diff --git a/openbsc/tests/smpp/Makefile.am b/openbsc/tests/smpp/Makefile.am index 9ab15c5..aab4de9 100644 --- a/openbsc/tests/smpp/Makefile.am +++ b/openbsc/tests/smpp/Makefile.am @@ -10,4 +10,4 @@ $(top_builddir)/src/libmsc/smpp_utils.c smpp_test_LDADD = \ $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) + $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) -- To view, visit https://gerrit.osmocom.org/267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jun 18 11:34:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 18 Jun 2016 11:34:51 +0000 Subject: [MERGED] osmo-bts[master]: DTX: add support for AMR/HR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTX: add support for AMR/HR ...................................................................... DTX: add support for AMR/HR Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04 Fixes: OS#1562 --- M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 2 files changed, 70 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index e92c57b..add7951 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -431,7 +431,7 @@ GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len; + uint8_t payload_len, sid_first[7] = {0}; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -469,6 +469,32 @@ frame and drop last SID */ lchan->rtp_tx_marker = true; break; + case GsmL1_TchPlType_Amr_SidFirstP1: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstP2: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidUpdateInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + "(%d bytes)\n", payload_len); + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -490,6 +516,14 @@ case GsmL1_TchPlType_Amr: rmsg = l1_to_rtppayload_amr(payload, payload_len, lchan); break; + case GsmL1_TchPlType_Amr_SidFirstP2: + /* L1 do not give us SID_FIRST data, just indication */ + memcpy(sid_first, payload, payload_len); + int len = osmo_amr_rtp_enc(sid_first, 0, AMR_SID, AMR_GOOD); + if (len < 0) + return 0; + rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); + break; } if (rmsg) { diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index a391fcc..e027408 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -523,7 +523,7 @@ GsmL1_PhDataInd_t *data_ind = &l1p->u.phDataInd; uint8_t payload_type = data_ind->msgUnitParam.u8Buffer[0]; uint8_t *payload = data_ind->msgUnitParam.u8Buffer + 1; - uint8_t payload_len; + uint8_t payload_len, sid_first[7] = {0}; struct msgb *rmsg = NULL; struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; @@ -563,6 +563,32 @@ frame and drop last SID */ lchan->rtp_tx_marker = true; break; + case GsmL1_TchPlType_Amr_SidFirstP1: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P1 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstP2: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_P2 from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidFirstInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_FIRST_INH from L1 " + "(%d bytes)\n", payload_len); + break; + case GsmL1_TchPlType_Amr_SidUpdateInH: + if (lchan->type != GSM_LCHAN_TCH_H) + goto err_payload_match; + lchan->rtp_tx_marker = true; + LOGP(DL1C, LOGL_DEBUG, "DTX: received SID_UPDATE_INH from L1 " + "(%d bytes)\n", payload_len); + break; default: LOGP(DL1C, LOGL_NOTICE, "%s Rx Payload Type %s is unsupported\n", gsm_lchan_name(lchan), @@ -586,6 +612,14 @@ case GsmL1_TchPlType_Amr: rmsg = l1_to_rtppayload_amr(payload, payload_len, lchan); break; + case GsmL1_TchPlType_Amr_SidFirstP2: + /* L1 do not give us SID_FIRST data, just indication */ + memcpy(sid_first, payload, payload_len); + int len = osmo_amr_rtp_enc(sid_first, 0, AMR_SID, AMR_GOOD); + if (len < 0) + return 0; + rmsg = l1_to_rtppayload_amr(sid_first, len, lchan); + break; } if (rmsg) { -- To view, visit https://gerrit.osmocom.org/324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jun 18 11:35:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 18 Jun 2016 11:35:12 +0000 Subject: [MERGED] osmo-bts[master]: Move copy-pasted code into common part In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move copy-pasted code into common part ...................................................................... Move copy-pasted code into common part Related: OS#1750 Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9 --- M include/osmo-bts/amr.h M include/osmo-bts/l1sap.h M include/osmo-bts/msg_utils.h M src/common/Makefile.am M src/common/amr.c M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/tch.c 10 files changed, 94 insertions(+), 165 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/amr.h b/include/osmo-bts/amr.h index ba66e4d..6bdc41f 100644 --- a/include/osmo-bts/amr.h +++ b/include/osmo-bts/amr.h @@ -11,7 +11,7 @@ int amr_parse_mr_conf(struct amr_multirate_conf *amr_mrc, const uint8_t *mr_conf, unsigned int len); - +int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi); unsigned int amr_get_initial_mode(struct gsm_lchan *lchan); #endif /* _OSMO_BTS_AMR_H */ diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 1f8b2a5..dd25161 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -66,6 +66,9 @@ extern uint32_t gsmtap_sapi_mask; extern uint8_t gsmtap_sapi_acch; +int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn); + #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) int bts_check_for_first_ciphrd(struct gsm_lchan *lchan, diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index f63c096..73f8c96 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -4,6 +4,10 @@ #pragma once +#include + +#include + struct msgb; /** @@ -16,5 +20,8 @@ OML_MSG_TYPE_OSMO, }; +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update); +bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn); int msg_verify_ipa_structure(struct msgb *msg); int msg_verify_oml_structure(struct msgb *msg); diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 8df6513..fbb6572 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -6,7 +6,6 @@ libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \ rsl.c vty.c paging.c measurement.c amr.c lchan.c \ load_indication.c pcu_sock.c handover.c msg_utils.c \ - load_indication.c pcu_sock.c handover.c msg_utils.c \ tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c \ l1sap.c cbch.c power_control.c main.c phy_link.c diff --git a/src/common/amr.c b/src/common/amr.c index 80c5fb6..56ed430 100644 --- a/src/common/amr.c +++ b/src/common/amr.c @@ -22,6 +22,15 @@ LOGPC(ss, logl, "\n"); } +int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) +{ + unsigned int i; + for (i = 0; i < amr_mrc->num_modes; i++) { + if (amr_mrc->bts_mode[i].mode == cmi) + return i; + } + return -EINVAL; +} /* parse a GSM 04.08 MultiRate Config IE (10.5.2.21aa) in a more * comfortable internal data structure */ diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 0af7343..0a6bc49 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -104,6 +104,26 @@ return msg; } +int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, + struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn) +{ + struct osmo_phsap_prim *l1sap; + + LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", + gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); + + rmsg->l2h = rmsg->data; + msgb_push(rmsg, sizeof(*l1sap)); + rmsg->l1h = rmsg->data; + l1sap = msgb_l1sap_prim(rmsg); + osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, + rmsg); + l1sap->u.tch.chan_nr = chan_nr; + l1sap->u.tch.fn = fn; + + return l1sap_up(trx, l1sap); +} + static int l1sap_tx_ciph_req(struct gsm_bts_trx *trx, uint8_t chan_nr, uint8_t downlink, uint8_t uplink) { diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 841ffe6..6f42f73 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -86,6 +86,49 @@ return type; } +/* store the last SID frame in lchan context */ +void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, + uint32_t fn, bool update) +{ + size_t copy_len = OSMO_MIN(length + 1, + ARRAY_SIZE(lchan->tch.last_sid.buf)); + + lchan->tch.last_sid.len = copy_len; + lchan->tch.last_sid.fn = fn; + lchan->tch.last_sid.is_update = update; + + memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); +} + +static inline bool fn_chk(uint8_t *t, uint32_t fn) +{ + uint8_t i; + for (i = 0; i < ARRAY_SIZE(t); i++) + if (fn % 104 == t[i]) + return false; + return true; +} + +/*! \brief Check if TX scheduling is optional for a given FN in case of DTX + * \param[in] lchan Logical channel on which we check scheduling + * \param[in] fn Frame Number for which we check scheduling + * \returns true if transmission can be omitted, false otherwise + */ +bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) +{ + /* According to 3GPP TS 45.008 ? 8.3: */ + uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, + h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, + h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; + if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if (lchan->type == GSM_LCHAN_TCH_F) + return fn_chk(f, fn); + else + return fn_chk(lchan->nr ? h1 : h0, fn); + } + return false; +} + /** * Return 0 in case the IPA structure is okay and in this * case the l2h will be set to the beginning of the data. diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index add7951..ec43c10 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -92,14 +93,6 @@ if (num_nibbles & 1) out[i] = (in[i] & 0xF) << 4; } - - -#define GSM_FR_BITS 260 -#define GSM_EFR_BITS 244 - -#define GSM_FR_BYTES 33 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */ -#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ -#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, struct gsm_lchan *lchan) @@ -250,16 +243,6 @@ lchan->tch.last_cmr = cur[0] >> 4; return msg; -} - -int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) -{ - unsigned int i; - for (i = 0; i < amr_mrc->num_modes; i++) { - if (amr_mrc->bts_mode[i].mode == cmi) - return i; - } - return -EINVAL; } /*! \brief convert AMR from RTP payload to L1 format @@ -526,23 +509,9 @@ break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - l1sap->u.tch.fn = data_ind->u32Fn; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); return 0; @@ -551,30 +520,6 @@ gsm_lchan_name(lchan), get_value_string(lc15bts_tch_pl_names, payload_type)); return -EINVAL; -} - -static inline bool fn_chk(uint8_t *t, uint32_t fn) -{ - uint8_t i; - for (i = 0; i < ARRAY_SIZE(t); i++) - if (fn % 104 == t[i]) - return false; - return true; -} - -static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) -{ - /* 3GPP TS 45.008 ? 8.3 */ - uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, - h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, - h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; - if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { - if (lchan->type == GSM_LCHAN_TCH_F) - return fn_chk(f, fn); - else - return fn_chk(lchan->nr ? h1 : h0, fn); - } - return false; } static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) @@ -596,20 +541,6 @@ return true; } return false; -} - -/* store the last SID frame in lchan context */ -void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, - uint32_t fn, bool update) -{ - size_t copy_len = OSMO_MIN(length + 1, - ARRAY_SIZE(lchan->tch.last_sid.buf)); - - lchan->tch.last_sid.len = copy_len; - lchan->tch.last_sid.fn = fn; - lchan->tch.last_sid.is_update = update; - - memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); } struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index a000161..af78980 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -38,13 +38,6 @@ #include "l1_if.h" -#define GSM_FR_BITS 260 -#define GSM_EFR_BITS 244 - -#define GSM_FR_BYTES 33 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */ -#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */ -#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ - /* input octet-aligned, output not octet-aligned */ void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, unsigned int num_nibbles) @@ -298,24 +291,9 @@ break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, - rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, - PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); return 0; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index e027408..17469f0 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -328,16 +329,6 @@ return msg; } -int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi) -{ - unsigned int i; - for (i = 0; i < amr_mrc->num_modes; i++) { - if (amr_mrc->bts_mode[i].mode == cmi) - return i; - } - return -EINVAL; -} - /*! \brief convert AMR from RTP payload to L1 format * \param[out] l1_payload payload part of L1 buffer * \param[in] rtp_payload pointer to RTP payload data @@ -622,23 +613,9 @@ break; } - if (rmsg) { - struct osmo_phsap_prim *l1sap; - - LOGP(DL1C, LOGL_DEBUG, "%s Rx -> RTP: %s\n", - gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); - - /* add l1sap header */ - rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; - l1sap = msgb_l1sap_prim(rmsg); - osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); - l1sap->u.tch.chan_nr = chan_nr; - l1sap->u.tch.fn = data_ind->u32Fn; - - return l1sap_up(trx, l1sap); - } + if (rmsg) + return add_l1sap_header(trx, rmsg, lchan, chan_nr, + data_ind->u32Fn); return 0; @@ -647,30 +624,6 @@ gsm_lchan_name(lchan), get_value_string(femtobts_tch_pl_names, payload_type)); return -EINVAL; -} - -static inline bool fn_chk(uint8_t *t, uint32_t fn) -{ - uint8_t i; - for (i = 0; i < ARRAY_SIZE(t); i++) - if (fn % 104 == t[i]) - return false; - return true; -} - -static bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn) -{ - /* 3GPP TS 45.008 ? 8.3 */ - uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, - h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, - h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; - if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { - if (lchan->type == GSM_LCHAN_TCH_F) - return fn_chk(f, fn); - else - return fn_chk(lchan->nr ? h1 : h0, fn); - } - return false; } static bool repeat_last_sid(struct gsm_lchan *lchan, struct msgb *msg) @@ -692,20 +645,6 @@ return true; } return false; -} - -/* store the last SID frame in lchan context */ -void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, - uint32_t fn, bool update) -{ - size_t copy_len = OSMO_MIN(length + 1, - ARRAY_SIZE(lchan->tch.last_sid.buf)); - - lchan->tch.last_sid.len = copy_len; - lchan->tch.last_sid.fn = fn; - lchan->tch.last_sid.is_update = update; - - memcpy(lchan->tch.last_sid.buf, l1_payload, copy_len); } struct msgb *gen_empty_tch_msg(struct gsm_lchan *lchan, uint32_t fn) -- To view, visit https://gerrit.osmocom.org/325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jun 18 11:37:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 18 Jun 2016 11:37:44 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 1: see also https://projects.osmocom.org/issues/1756#change-1626 -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 07:37:07 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 20 Jun 2016 07:37:07 +0000 Subject: [PATCH] osmo-pcu[master]: Add data structure for ARQ-II in EGPRS DL Message-ID: Review at https://gerrit.osmocom.org/332 Add data structure for ARQ-II in EGPRS DL Modify the existing data structure to support ARQ-II for Retx in EGPRS DL. Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe --- M src/gprs_coding_scheme.cpp M src/gprs_coding_scheme.h M src/rlc.h 3 files changed, 53 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/332/1 diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp index 8601d4f..4b47c0b 100644 --- a/src/gprs_coding_scheme.cpp +++ b/src/gprs_coding_scheme.cpp @@ -21,6 +21,42 @@ #include "gprs_coding_scheme.h" +/* + * 44.060 Table 8.1.1.1 and Table 8.1.1.2 + * In has 3 level indexing. 0th level is ARQ type + * 1st level is Original MCS( index 0 corresponds to MCS1 and so on) + * 2nd level is MS MCS (index 0 corresponds to MCS1 and so on) + * in 0th level indexing only ARQ type 2 is supported i.e index 1 for + * incremental redundancy + */ + +/* TODO: Need to support ARQ type 1 */ +enum GprsCodingScheme::Scheme GprsCodingScheme::egprs_mcs_retx_tbl[MAX_NUM_ARQ] + [MAX_NUM_MCS][MAX_NUM_MCS] = { + { + {MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1}, + {MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2}, + {MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3}, + {MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4}, + {MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7}, + {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9}, + {MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7}, + {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8}, + {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9} + }, + { + {MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1}, + {MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2}, + {MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3}, + {MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4}, + {MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7}, + {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9}, + {MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7}, + {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8}, + {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9} + } + }; + static struct { struct { unsigned int bytes; diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h index aec3762..bb0bad4 100644 --- a/src/gprs_coding_scheme.h +++ b/src/gprs_coding_scheme.h @@ -26,6 +26,12 @@ class GprsCodingScheme { public: + +#define MAX_NUM_ARQ 2 /* max. number of ARQ */ +#define MAX_NUM_MCS 9 /* max. number of MCS */ +#define EGPRS_ARQ1 0x0 +#define EGPRS_ARQ2 0x1 + enum Scheme { UNKNOWN, CS1, CS2, CS3, CS4, @@ -105,6 +111,8 @@ static GprsCodingScheme getEgprsByNum(unsigned num); static const char *modeName(Mode mode); + static enum Scheme egprs_mcs_retx_tbl[MAX_NUM_ARQ] + [MAX_NUM_MCS][MAX_NUM_MCS]; private: GprsCodingScheme(int s); /* fail on use */ GprsCodingScheme& operator =(int s); /* fail on use */ diff --git a/src/rlc.h b/src/rlc.h index ad10b3a..d601d7d 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -119,6 +119,15 @@ uint8_t len; struct gprs_rlc_data_block_info block_info; + /* + * cs_current_trans is variable to hold the cs value for + * current transmission. cs_current_trans is same as cs during + * transmission case. during retransmission cs_current_trans is + * fetched from egprs_mcs_retx_tbl table based on + * cs and demanded cs.reference is 44.060 Table + * 8.1.1.1 and Table 8.1.1.2 + */ + GprsCodingScheme cs_current_trans; GprsCodingScheme cs; /* puncturing scheme value to be used for next transmission*/ -- To view, visit https://gerrit.osmocom.org/332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Jun 20 07:37:13 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 20 Jun 2016 07:37:13 +0000 Subject: [PATCH] osmo-pcu[master]: Add Accessor functions for ARQ-II in EGPRS DL Message-ID: Review at https://gerrit.osmocom.org/333 Add Accessor functions for ARQ-II in EGPRS DL Add accessor function in existing classes to support ARQ-II for retransmission in EGPRS DL Change-Id: Iefff956bf2dcfe8fb0b2f5a7a7a2122d5d555f9e --- M src/gprs_coding_scheme.h M src/gprs_ms.cpp M src/gprs_ms.h 3 files changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/33/333/1 diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h index bb0bad4..fb3a191 100644 --- a/src/gprs_coding_scheme.h +++ b/src/gprs_coding_scheme.h @@ -70,6 +70,7 @@ unsigned int to_num() const; GprsCodingScheme& operator =(Scheme s); + bool operator == (Scheme s); GprsCodingScheme& operator =(GprsCodingScheme o); bool isValid() const {return UNKNOWN <= m_scheme && m_scheme <= MCS9;} @@ -111,6 +112,9 @@ static GprsCodingScheme getEgprsByNum(unsigned num); static const char *modeName(Mode mode); + static Scheme get_retx_mcs(const GprsCodingScheme &mcs, + const GprsCodingScheme &retx_mcs); + static enum Scheme egprs_mcs_retx_tbl[MAX_NUM_ARQ] [MAX_NUM_MCS][MAX_NUM_MCS]; private: @@ -196,6 +200,13 @@ return GprsCodingScheme::Scheme(a) == GprsCodingScheme::Scheme(b); } +inline bool GprsCodingScheme::operator == (Scheme scheme) +{ + if (this->m_scheme == scheme) + return true; + return false; +} + inline bool operator !=(GprsCodingScheme a, GprsCodingScheme b) { return !(a == b); @@ -221,4 +232,10 @@ { return a == b || a > b; } - +inline GprsCodingScheme::Scheme GprsCodingScheme::get_retx_mcs( + const GprsCodingScheme &mcs, + const GprsCodingScheme &demanded_mcs) +{ + return egprs_mcs_retx_tbl[EGPRS_ARQ2][mcs.to_num() - 1] + [demanded_mcs.to_num() - 1]; +} diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 4f71892..b3270b1 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -574,6 +574,11 @@ return GprsCodingScheme(GprsCodingScheme::MCS4); } +void GprsMs::set_current_cs_dl(GprsCodingScheme::Scheme scheme) +{ + m_current_cs_dl = scheme; +} + GprsCodingScheme GprsMs::max_cs_dl() const { struct gprs_rlcmac_bts *bts_data; diff --git a/src/gprs_ms.h b/src/gprs_ms.h index b07f175..bcc4fb3 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -86,6 +86,7 @@ uint8_t egprs_ms_class() const; void set_ms_class(uint8_t ms_class); void set_egprs_ms_class(uint8_t ms_class); + void set_current_cs_dl(GprsCodingScheme::Scheme scheme); GprsCodingScheme current_cs_ul() const; GprsCodingScheme current_cs_dl() const; -- To view, visit https://gerrit.osmocom.org/333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefff956bf2dcfe8fb0b2f5a7a7a2122d5d555f9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Jun 20 07:37:14 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 20 Jun 2016 07:37:14 +0000 Subject: [PATCH] osmo-pcu[master]: Modify DL tbf flow for ARQ-II in EGPRS DL Retx Message-ID: Review at https://gerrit.osmocom.org/334 Modify DL tbf flow for ARQ-II in EGPRS DL Retx Modify the DL TBF flow to support ARQ-II EGPRS DL retransmission Change-Id: I7a845c98f2018795f0f62240f228411b0bc030c7 --- M src/tbf_dl.cpp M tests/tbf/TbfTest.err 2 files changed, 37 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/334/1 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 9dd4bfc..fb7649d 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -361,7 +361,7 @@ bsn = m_window.resend_needed(); if (previous_bsn >= 0) { - force_cs = m_rlc.block(previous_bsn)->cs; + force_cs = m_rlc.block(previous_bsn)->cs_current_trans; if (!force_cs.isEgprs()) return -1; force_data_len = m_rlc.block(previous_bsn)->len; @@ -375,7 +375,27 @@ m_window.mod_sns(bsn - previous_bsn) > RLC_EGPRS_MAX_BSN_DELTA) return -1; - cs2 = m_rlc.block(bsn)->cs; + if (is_egprs_enabled()) { + m_rlc.block(bsn)->cs_current_trans = + GprsCodingScheme::get_retx_mcs( + m_rlc.block(bsn)->cs, ms()->current_cs_dl()); + + LOGP(DRLCMACDL, LOGL_DEBUG, + "- current_cs_dl(%d) demanded_mcs(%d) cs_trans(%d)\n", + m_rlc.block(bsn)->cs.to_num(), + ms()->current_cs_dl().to_num(), + m_rlc.block(bsn)->cs_current_trans.to_num()); + + /* TODO: Need to remove this check when MCS-8 -> MCS-6 + * transistion is handled + */ + if (m_rlc.block(bsn)->cs == GprsCodingScheme::MCS8) + m_rlc.block(bsn)->cs_current_trans = + GprsCodingScheme::MCS8; + } else + m_rlc.block(bsn)->cs_current_trans = + m_rlc.block(bsn)->cs; + data_len2 = m_rlc.block(bsn)->len; if (force_data_len > 0 && force_data_len != data_len2) return -1; @@ -418,7 +438,7 @@ "- Sending new dummy block at BSN %d, CS=%s\n", m_window.v_s(), current_cs().name()); bsn = create_new_bsn(fn, current_cs()); - /* Don't send a second block, so don't set cs2 */ + /* Don't send a second block, so don't set cs_current_trans*/ } if (bsn < 0) { @@ -429,7 +449,7 @@ bts->rlc_resent(); } - *may_combine = cs2.numDataBlocks() > 1; + *may_combine = m_rlc.block(bsn)->cs_current_trans.numDataBlocks() > 1; return bsn; } @@ -501,6 +521,7 @@ rlc_data = m_rlc.block(bsn); data = rlc_data->prepare(block_data_len); rlc_data->cs = cs; + rlc_data->cs_current_trans = cs; rlc_data->len = block_data_len; rdbi = &(rlc_data->block_info); @@ -590,7 +611,6 @@ bool is_final = false; gprs_rlc_data_info rlc; GprsCodingScheme cs; - GprsCodingScheme cs_current_trans; int bsns[ARRAY_SIZE(rlc.block_info)]; unsigned num_bsns; enum egprs_puncturing_values punct[ARRAY_SIZE(rlc.block_info)]; @@ -604,7 +624,7 @@ * be put into the data area, even if the resulting CS is higher than * the current limit. */ - cs = m_rlc.block(index)->cs; + cs = m_rlc.block(index)->cs_current_trans; bsns[0] = index; num_bsns = 1; @@ -616,6 +636,9 @@ if (num_bsns == 1) { /* TODO: remove the conditional when MCS-6 padding isn't * failing to be decoded by MEs anymore */ + /* TODO: support of MCS-8 -> MCS-6 transition should be + * handled + */ if (cs != GprsCodingScheme(GprsCodingScheme::MCS8)) cs.decToSingleBlock(&need_padding); } @@ -650,18 +673,15 @@ else bsn = bsns[0]; - cs_enc = m_rlc.block(bsn)->cs; + cs_enc = m_rlc.block(bsn)->cs_current_trans; /* get data and header from current block */ block_data = m_rlc.block(bsn)->block; - /* TODO: Need to support MCS change during retx */ - cs_current_trans = cs; - /* Get current puncturing scheme from block */ punct_scheme = gprs_get_punct_scheme( m_rlc.block(bsn)->next_ps, - cs, cs_current_trans); + m_rlc.block(bsn)->cs, cs); if (cs.isEgprs()) { OSMO_ASSERT(punct_scheme >= EGPRS_PS_1); @@ -685,7 +705,9 @@ * in header type 1 */ gprs_update_punct_scheme(&m_rlc.block(bsn)->next_ps, - cs_current_trans); + cs); + + m_rlc.block(bsn)->cs = cs; rdbi->e = block_info->e; rdbi->cv = block_info->cv; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 4e83ce2..6f38de7 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -4746,6 +4746,7 @@ Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- current_cs_dl(5) demanded_mcs(7) cs_trans(7) - Resending BSN 0 - Sending new block at BSN 1, CS=MCS-7 - Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=512) @@ -4895,6 +4896,7 @@ Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- current_cs_dl(8) demanded_mcs(8) cs_trans(8) - Resending BSN 0 - Sending new block at BSN 1, CS=MCS-8 - Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=512) @@ -5030,6 +5032,7 @@ Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- current_cs_dl(6) demanded_mcs(9) cs_trans(9) - Resending BSN 0 - Sending new block at BSN 1, CS=MCS-9 - Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=512) -- To view, visit https://gerrit.osmocom.org/334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a845c98f2018795f0f62240f228411b0bc030c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Jun 20 07:37:14 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 20 Jun 2016 07:37:14 +0000 Subject: [PATCH] osmo-pcu[master]: Add test cases to support ARQ-II for EGPRS DL Retx Message-ID: Review at https://gerrit.osmocom.org/335 Add test cases to support ARQ-II for EGPRS DL Retx During MCS upgradation such as MCS6->MCS9, 2 blocks which were sent separately as MCS6, will be clubbed into one MCS9 block during retransmission. Same holds good for MCS5->MCS7 transistion. During MCS reduction such as MCS9->MCS6,2 blocks which were sent together will be sent separately during the retransmission case. Same is verified through the generated log file. Currently MCS8->MCS6 transition is not supported. The retransmission MCS is being calculated from Table 8.1.1.2 of TS 44.060. The same test cases are also integration tested on Nuran 1.0 platform. Change-Id: Ia357acfe30f4dea95e00749916c6818354f93285 --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 3 files changed, 639 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/335/1 diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index e1be844..e3f9d06 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1272,6 +1272,227 @@ tbf_free(dl_tbf); } +static gprs_rlcmac_dl_tbf *tbf_init(BTS *the_bts, + int mcs) +{ + unsigned i; + uint8_t ms_class = 11; + uint8_t egprs_ms_class = 11; + uint32_t fn = 0; + uint8_t trx_no; + uint32_t tlli = 0xffeeddcc; + uint8_t test_data[512]; + + uint8_t rbb[64/8]; + + gprs_rlcmac_dl_tbf *dl_tbf; + + memset(test_data, 1, sizeof(test_data)); + the_bts->bts_data()->initial_mcs_dl = mcs; + + dl_tbf = create_dl_tbf(the_bts, ms_class, egprs_ms_class, &trx_no); + dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); + + for (i = 0; i < sizeof(test_data); i++) + test_data[i] = i%256; + + OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW)); + + /* Schedule a LLC frame + * passing only 100 bytes, since it is enough to construct + * 2 RLC data blocks. Which are enough to test Header Type 1 + * cases + */ + dl_tbf->append_data(ms_class, 1000, test_data, 100); + + OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW)); + + return dl_tbf; + +} + +static void tbf_cleanup(gprs_rlcmac_dl_tbf *dl_tbf) +{ + uint32_t fn = 0; + uint8_t rbb[64/8]; + + /* Receive a final ACK */ + dl_tbf->rcvd_dl_ack(1, dl_tbf->m_window.v_s(), rbb); + + /* Clean up and ensure tbfs are in the correct state */ + OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); + dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + check_tbf(dl_tbf); + tbf_free(dl_tbf); + +} +static void establish_and_use_egprs_dl_tbf_for_retx(BTS *the_bts, + int mcs, int demanded_mcs) +{ + uint32_t fn = 0; + gprs_rlcmac_dl_tbf *dl_tbf; + uint8_t block_nr = 0; + int index1 = 0; + uint8_t bn; + struct msgb *msg; + + printf("Testing retx for MCS %d - %d\n", mcs, demanded_mcs); + + dl_tbf = tbf_init(the_bts, mcs); + + /* For MCS reduction cases like MCS9->MCS6, MCS7->MCS5 + * The MCS transition are referred from table Table 8.1.1.2 + * of TS 44.060 + */ + /* TODO: Need to support of MCS8 -> MCS6 transistion */ + if (((mcs == 9) && (demanded_mcs < 9)) || + ((mcs == 7) && (demanded_mcs < 7))) { + fn = fn_add_blocks(fn, 1); + /* Send 2 RLC data block */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == mcs); + OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() + == mcs); + + dl_tbf->m_window.m_v_b.mark_nacked(0); + dl_tbf->m_window.m_v_b.mark_nacked(1); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + + /* Set the demanded MCS to demanded_mcs */ + dl_tbf->ms()->set_current_cs_dl + ((GprsCodingScheme::Scheme)(GprsCodingScheme::CS4 + + demanded_mcs)); + + fn = fn_add_blocks(fn, 1); + /* Retransmit the first RLC data block with demanded_mcs */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == demanded_mcs); + + fn = fn_add_blocks(fn, 1); + /* Retransmit the second RLC data block with demanded_mcs */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() + == demanded_mcs); + } else if (((mcs == 5) && (demanded_mcs > 6)) || + ((mcs == 6) && (demanded_mcs > 8))) { + fn = fn_add_blocks(fn, 1); + /* Send first RLC data block BSN 0 */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == mcs); + + fn = fn_add_blocks(fn, 1); + /* Send second RLC data block BSN 1 */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() + == mcs); + + dl_tbf->m_window.m_v_b.mark_nacked(0); + dl_tbf->m_window.m_v_b.mark_nacked(1); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + + dl_tbf->ms()->set_current_cs_dl + ((GprsCodingScheme::Scheme)(GprsCodingScheme::CS4 + + demanded_mcs)); + + fn = fn_add_blocks(fn, 1); + /* Send first, second RLC data blocks with demanded_mcs */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == demanded_mcs); + OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() + == demanded_mcs); + } else if (mcs > 6) { + /* No Mcs change cases are handled here for mcs > MCS6*/ + fn = fn_add_blocks(fn, 1); + /* Send first,second RLC data blocks */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == mcs); + OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() + == mcs); + + dl_tbf->m_window.m_v_b.mark_nacked(0); + dl_tbf->m_window.m_v_b.mark_nacked(1); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + + fn = fn_add_blocks(fn, 1); + /* Send first,second RLC data blocks with demanded_mcs*/ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == mcs); + OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() + == mcs); + } else { + + /* No MCS change cases are handled here for mcs <= MCS6*/ + fn = fn_add_blocks(fn, 1); + /* Send first RLC data block */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == mcs); + + dl_tbf->m_window.m_v_b.mark_nacked(0); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + + fn = fn_add_blocks(fn, 1); + /* Send first RLC data block with demanded_mcs */ + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); + OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); + OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() + == mcs); + } + + tbf_cleanup(dl_tbf); +} + +static void test_tbf_egprs_retx_dl(void) +{ + BTS the_bts; + gprs_rlcmac_bts *bts; + uint8_t ts_no = 4; + int i, j; + + printf("=== start %s ===\n", __func__); + + bts = the_bts.bts_data(); + bts->cs_downgrade_threshold = 0; + setup_bts(&the_bts, ts_no); + bts->dl_tbf_idle_msec = 200; + bts->egprs_enabled = 1; + + /* First parameter is current MCS, second one is demanded_mcs */ + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 6, 6); + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 1, 9); + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 2, 8); + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 5, 7); + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 6, 9); + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 7, 5); + establish_and_use_egprs_dl_tbf_for_retx(&the_bts, 9, 6); + + printf("=== end %s ===\n", __func__); +} static void test_tbf_egprs_dl() { BTS the_bts; @@ -1356,6 +1577,7 @@ test_tbf_ws(); test_tbf_egprs_two_phase(); test_tbf_egprs_dl(); + test_tbf_egprs_retx_dl(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 6f38de7..dc984af 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -5116,3 +5116,411 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-6 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- current_cs_dl(6) demanded_mcs(6) cs_trans(6) +- Resending BSN 0 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-6): 07 00 00 12 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-1 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (22) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-1): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-1): 07 00 00 96 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- current_cs_dl(1) demanded_mcs(1) cs_trans(1) +- Resending BSN 0 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-1): 07 00 00 98 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-2 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (28) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-2): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-2): 07 00 00 92 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- current_cs_dl(2) demanded_mcs(2) cs_trans(2) +- Resending BSN 0 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-2): 07 00 00 94 00 02 04 06 08 0a 0c 0e 10 12 14 16 18 1a 1c 1e 20 22 24 26 28 2a 2c 2e 30 32 34 36 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-5 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-5): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- Sending new block at BSN 1, CS=MCS-5 +-- Chunk with length 44 is less than remaining space (56): add length header to to delimit LLC frame +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=100 +-- Empty chunk, added LLC dummy command of size 10, drained_since=0 +-- Chunk with length 10 is less than remaining space (11): add length header to to delimit LLC frame +-- No space left, so we are done. +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 +data block (BSN 1, MCS-5): 58 15 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b +- Copying data unit 0 (BSN 1) +- Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 +Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 +msg block (BSN 1, MCS-5): 0f 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) +- current_cs_dl(5) demanded_mcs(7) cs_trans(7) +- Resending BSN 0 +- current_cs_dl(5) demanded_mcs(7) cs_trans(7) +- Resending BSN 1 +- Copying data unit 0 (BSN 0) +- Copying data unit 1 (BSN 1) +msg block (BSN 0, MCS-7): 07 00 00 02 c0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-6 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-6): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-6): 07 00 00 10 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==1) +- Sending new block at BSN 1, CS=MCS-6 +-- Chunk with length 26 is less than remaining space (74): add length header to to delimit LLC frame +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=100 +-- Empty chunk, added LLC dummy command of size 46, drained_since=0 +-- Chunk with length 46 is less than remaining space (47): add length header to to delimit LLC frame +-- No space left, so we are done. +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 +data block (BSN 1, MCS-6): 34 5d 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +- Copying data unit 0 (BSN 1) +- Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 21 TS 4 +Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=21, TS=4 +msg block (BSN 1, MCS-6): 0f 40 00 00 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) +- current_cs_dl(6) demanded_mcs(9) cs_trans(9) +- Resending BSN 0 +- current_cs_dl(6) demanded_mcs(9) cs_trans(9) +- Resending BSN 1 +- Copying data unit 0 (BSN 0) +- Copying data unit 1 (BSN 1) +msg block (BSN 0, MCS-9): 07 00 00 02 28 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-7 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-7): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 +- Sending new block at BSN 1, CS=MCS-7 +-- Chunk with length 44 is less than remaining space (56): add length header to to delimit LLC frame +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=100 +-- Empty chunk, added LLC dummy command of size 10, drained_since=0 +-- Chunk with length 10 is less than remaining space (11): add length header to to delimit LLC frame +-- No space left, so we are done. +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=10 +data block (BSN 1, MCS-7): 58 15 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b +- Copying data unit 0 (BSN 0) +- Copying data unit 1 (BSN 1) +- Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 +Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 +msg block (BSN 0, MCS-7): 0f 00 00 02 a0 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc 80 55 81 93 a3 b3 c3 d3 e3 f3 03 14 24 34 44 54 64 74 84 94 a4 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 02 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) +- current_cs_dl(7) demanded_mcs(5) cs_trans(5) +- Resending BSN 0 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-5): 07 00 00 18 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) +- current_cs_dl(7) demanded_mcs(5) cs_trans(5) +- Resending BSN 1 +- Copying data unit 0 (BSN 1) +msg block (BSN 1, MCS-5): 07 40 00 08 56 05 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 92 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca 0a +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) +- Sending new block at BSN 0, CS=MCS-9 +- Dequeue next LLC for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) (len=100) +-- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done +data block (BSN 0, MCS-9): 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 +- Sending new block at BSN 1, CS=MCS-9 +-- Chunk with length 26 is less than remaining space (74): add length header to to delimit LLC frame +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=100 +-- Empty chunk, added LLC dummy command of size 46, drained_since=0 +-- Chunk with length 46 is less than remaining space (47): add length header to to delimit LLC frame +-- No space left, so we are done. +Complete DL frame for TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS)len=46 +data block (BSN 1, MCS-9): 34 5d 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +- Copying data unit 0 (BSN 0) +- Copying data unit 1 (BSN 1) +- Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS): Scheduling polling at FN 17 TS 4 +Polling scheduled in this TS 4 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduled Ack/Nack polling on FN=17, TS=4 +msg block (BSN 0, MCS-9): 0f 00 00 02 00 01 04 08 0c 10 14 18 1c 20 24 28 2c 30 34 38 3c 40 44 48 4c 50 54 58 5c 60 64 68 6c 70 74 78 7c 80 84 88 8c 90 94 98 9c a0 a4 a8 ac b0 b4 b8 bc c0 c4 c8 cc d0 d4 d8 dc e0 e4 e8 ec f0 f4 f8 fc 00 05 09 0d 11 15 19 1d 21 25 41 d3 a5 b4 c4 d4 e4 f4 04 15 25 35 45 55 65 75 85 95 a5 b5 c5 d5 e5 f5 05 16 26 36 36 04 1c b0 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) +- current_cs_dl(9) demanded_mcs(6) cs_trans(6) +- Resending BSN 0 +- Copying data unit 0 (BSN 0) +msg block (BSN 0, MCS-6): 07 00 00 12 40 80 c0 00 41 81 c1 01 42 82 c2 02 43 83 c3 03 44 84 c4 04 45 85 c5 05 46 86 c6 06 47 87 c7 07 48 88 c8 08 49 89 c9 09 4a 8a ca 0a 4b 8b cb 0b 4c 8c cc 0c 4d 8d cd 0d 4e 8e ce 0e 4f 8f cf 0f 50 90 d0 10 51 91 d1 11 52 12 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) +- current_cs_dl(9) demanded_mcs(6) cs_trans(6) +- Resending BSN 1 +- Copying data unit 0 (BSN 1) +msg block (BSN 1, MCS-6): 07 40 00 02 4d 97 d2 12 53 93 d3 13 54 94 d4 14 55 95 d5 15 56 96 d6 16 57 97 d7 17 58 98 d8 d8 10 70 c0 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge +- Final ACK received. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer 3193. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer 3193. +PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 441b444..8a7862f 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -43,3 +43,12 @@ Testing MCS-8 Testing MCS-9 === end test_tbf_egprs_dl === +=== start test_tbf_egprs_retx_dl === +Testing retx for MCS 6 - 6 +Testing retx for MCS 1 - 9 +Testing retx for MCS 2 - 8 +Testing retx for MCS 5 - 7 +Testing retx for MCS 6 - 9 +Testing retx for MCS 7 - 5 +Testing retx for MCS 9 - 6 +=== end test_tbf_egprs_retx_dl === -- To view, visit https://gerrit.osmocom.org/335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia357acfe30f4dea95e00749916c6818354f93285 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Jun 20 11:41:39 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 11:41:39 +0000 Subject: osmo-pcu[master]: Add test cases to support ARQ-II for EGPRS DL Retx In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) looks mostly good! https://gerrit.osmocom.org/#/c/335/1/tests/tbf/TbfTest.cpp File tests/tbf/TbfTest.cpp: Line 1347: /* TODO: Need to support of MCS8 -> MCS6 transistion */ Can you add to the comment what would be needed for MCS8->MCS6? Line 1368: ((GprsCodingScheme::Scheme)(GprsCodingScheme::CS4 + Which constructor is attempted to be picked here? What is the compile error if you remove the c cast. -- To view, visit https://gerrit.osmocom.org/335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia357acfe30f4dea95e00749916c6818354f93285 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 11:46:04 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 11:46:04 +0000 Subject: osmo-pcu[master]: Modify DL tbf flow for ARQ-II in EGPRS DL Retx In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/334/1/src/tbf_dl.cpp File src/tbf_dl.cpp: Line 379: m_rlc.block(bsn)->cs_current_trans = See the previous commit. I would prefer that this is a setter instead of accessing it directly Line 389: /* TODO: Need to remove this check when MCS-8 -> MCS-6 Maybe a single sentence of what is involved in that case? Line 627: cs = m_rlc.block(index)->cs_current_trans; maybe as a general stratgey let's rename the cs field of the struct so we catch _all_ old usages? -- To view, visit https://gerrit.osmocom.org/334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a845c98f2018795f0f62240f228411b0bc030c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 11:47:53 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 11:47:53 +0000 Subject: osmo-pcu[master]: Add Accessor functions for ARQ-II in EGPRS DL In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/333/1/src/gprs_coding_scheme.h File src/gprs_coding_scheme.h: Line 73: bool operator == (Scheme s); bool operator == (Scheme s) const? Line 116: const GprsCodingScheme &retx_mcs); see Jacob's previous commit. mcs and retx_mcs will fill a register and it might be better to skip the reference and the indirect memory load? At least it would be consistent. -- To view, visit https://gerrit.osmocom.org/333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iefff956bf2dcfe8fb0b2f5a7a7a2122d5d555f9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 11:50:32 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 11:50:32 +0000 Subject: osmo-pcu[master]: Add data structure for ARQ-II in EGPRS DL In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/332/1/src/gprs_coding_scheme.cpp File src/gprs_coding_scheme.cpp: Line 26: * In has 3 level indexing. 0th level is ARQ type It instead of In? Line 33: /* TODO: Need to support ARQ type 1 */ There will be more than two dimensions in that array? What is missing? What is the impact? https://gerrit.osmocom.org/#/c/332/1/src/rlc.h File src/rlc.h: Line 130: GprsCodingScheme cs_current_trans; I would prefer to cs and cs_current_trans being private here. * The setter/getter can be inline so we have no performance difference * We find all places that use cs and see if they are updated to use cs_current_trans -- To view, visit https://gerrit.osmocom.org/332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 11:58:30 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 11:58:30 +0000 Subject: openbsc[master]: Remove unused auth code and add comment In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) What am I missing? static int gsm0408_authorize(struct gsm_subscriber_connection *conn, struct msgb *msg) will check for LU (loc_operation) and pass _gsm0408_authorize_sec_cb as callback? authorize_subscriber will check if there is a subscriber and we are not waiting for an answer and then call gsm48_secure_channel. And gsm48_rx_mm_auth_resp will call the CB GSM_SECURITY_AUTH_FAILED? Is there something wrong going from gsm48_rx_mm_auth_resp to the LU handling for auth failed? Did you find the issue while trying to provoke auth failures? https://gerrit.osmocom.org/#/c/331/1/openbsc/src/libmsc/gsm_04_08.c File openbsc/src/libmsc/gsm_04_08.c: Line 382: */ But that will keep the radio resources allocated longer than necessary? -- To view, visit https://gerrit.osmocom.org/331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 11:59:15 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 11:59:15 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 1: Where do you plan to use it and is there a testcase? -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:00:26 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:00:26 +0000 Subject: osmo-bts[master]: configure: Add LT_INIT macro to enable libtool configuration. In-Reply-To: References: Message-ID: Patch Set 1: Why would you like to add static linking? But please update debian/control with the libtool dependency as well. -- To view, visit https://gerrit.osmocom.org/301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:00:32 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:00:32 +0000 Subject: osmo-bts[master]: configure: Add LT_INIT macro to enable libtool configuration. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93ed9e3191a29776fbd54031177463bae353a05d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:32:10 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:32:10 +0000 Subject: osmo-bts[master]: LC15: common/oml.c : Alarm - Formatted O&M with BTS number i... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 (1 comment) Based on the general approach and me favoring to use signal dispatching https://gerrit.osmocom.org/#/c/256/2/src/common/oml.c File src/common/oml.c: Line 1009: snprintf(log_msg, 100, "Formatted O&M with BTS %d out of range.\n", foh->obj_inst.bts_nr); What extra value does this OML alarm has? BTSNR unknown is already the NACK to the command? If you want to be helpful then maybe list the two valid numbers? -- To view, visit https://gerrit.osmocom.org/256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15a227a60c75b8a91005b18afb6256f34d6b71b4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:32:43 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:32:43 +0000 Subject: osmo-bts[master]: LC15: common/oml.c : Alarm - Unknown formatted O&M message type In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 What is the general benefit of answering with a NACK + an alarm? Based on the general approach and me favoring to use signal dispatching -- To view, visit https://gerrit.osmocom.org/257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6b700c58b3780d401968610965f07b63872b578c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:33:09 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:33:09 +0000 Subject: osmo-bts[master]: LC15: common/l1sap.c : Alarm - Unknown uplink L1SAP primitive In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 Based on the general approach and me favoring to use signal dispatching -- To view, visit https://gerrit.osmocom.org/259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4943eabecb971f7cfece24c35b0e9e0e660f31a0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:46:59 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:46:59 +0000 Subject: osmo-bts[master]: LC15: Introduce measurement management messages, TS 12.21 se... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 (4 comments) For the general approach to alarms https://gerrit.osmocom.org/#/c/260/2/include/osmo-bts/pcuif_proto.h File include/osmo-bts/pcuif_proto.h: Line 5: #define PCU_IF_VERSION 0x05 If you change the protocol, you should bump the version number on both sides as well (or propose a scheme of majory/minor.. or compat level). It might not be obvious why the PCU doesn't respond to the measurement request sent to the BTS? https://gerrit.osmocom.org/#/c/260/2/src/common/oml.c File src/common/oml.c: Line 93: /* GSM 12.21 attributes */ Look at the name of this array. 12.21 TLV do not seem to belong here. Line 414: LOGP(DOML, LOGL_INFO, "%s Tx MEASurement RESult RESPonse\n", gsm_abis_mo_name(mo)); Info might be a bit too verbose here? Line 1242: return oml_tx_mm_stop_meas_ack_nack(mo, meas_id, NM_NACK_NOTH_REPORT_EXIST); That is way too verbose -- To view, visit https://gerrit.osmocom.org/260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic930baa69fc09ad5059627ed3d85cce5474085b0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:47:41 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:47:41 +0000 Subject: osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to create IPAC RTP/RTCP ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6426f7fcb1e2e25f8143c0b5835c24fedc8089be Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:48:39 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:48:39 +0000 Subject: osmo-bts[master]: LC15: common/rsl.c : Alarm - Failed to bind RTP/RTCP socket In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages.. What extra value does the message has over the NACK? The message does not include if it is a temporary issue, if it will fix itself, if it is permanently broken. It does not seem to carry any additional information. -- To view, visit https://gerrit.osmocom.org/263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief24e775dd186dbf2bb773afbc3e16d7037f179d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:52:05 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:52:05 +0000 Subject: osmo-bts[master]: LC15: Introduce TS 12.21 8.8.2 Abis/OML failure event report In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 (1 comment) General approach to send out the OML message. https://gerrit.osmocom.org/#/c/242/2/include/osmo-bts/pcuif_proto.h File include/osmo-bts/pcuif_proto.h: Line 4: #define PCU_IF_VERSION 0x05 This is a versioned protocol. So bump the version if the messages changes. In this case the "txt" might be so big that the size of the union increases? -- To view, visit https://gerrit.osmocom.org/242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id710f452c4e0eecbba855e87ab86a3087988e326 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:55:57 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:55:57 +0000 Subject: osmo-bts[master]: LC15: Introduce DSP alive timer per TRX In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (9 comments) https://gerrit.osmocom.org/#/c/243/2/src/osmo-bts-litecell15/l1_if.c File src/osmo-bts-litecell15/l1_if.c: Line 1420: struct msgb *msg = sysp_msgb_alloc(); NULL check? Line 1430: if(fl1h->failure_rep_sent) coding style Line 1458: LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id)); DSP alive handling just stops here? Line 1497: struct msgb *msg = sysp_msgb_alloc(); error handling Line 1505: LOGP(DL1C, LOGL_FATAL, "Failed to send %s primitive\n", get_value_string(lc15bts_sysprim_names, sys_prim->id)); recovery from error and code duplication. https://gerrit.osmocom.org/#/c/243/2/src/osmo-bts-litecell15/l1_if.h File src/osmo-bts-litecell15/l1_if.h: Line 68: uint8_t failure_rep_sent; /* Flag to indicate the failure report has already sent to network before stop BTS itself*/ has already been sent? https://gerrit.osmocom.org/#/c/243/2/src/osmo-bts-litecell15/lc15bts.c File src/osmo-bts-litecell15/lc15bts.c: Line 124: case Litecell15_PrimId_IsAliveReq: return L1P_T_REQ; tabs vs. spaces here. please be consistent https://gerrit.osmocom.org/#/c/243/2/src/osmo-bts-litecell15/lc15bts_vty.c File src/osmo-bts-litecell15/lc15bts_vty.c: Line 453: "Set DSP alive timer period in second\n") all parameters in VTY need to be documented Line 459: if (( period > 60 ) || ( period < 0 )) { 0-60 range is enforced by the VTY code -- To view, visit https://gerrit.osmocom.org/243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic075063a5b3294b72cc502a01e9616c296797238 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:56:50 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:56:50 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - DSP L1 is no long... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/244/2/src/osmo-bts-litecell15/oml.c File src/osmo-bts-litecell15/oml.c: Line 790: Please avoid the code duplication and re-use the error report, remembering it has not worked with the other commit. -- To view, visit https://gerrit.osmocom.org/244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic19e21c31a8f95c5e15c91cd886788ec4e83ec13 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:58:31 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:58:31 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/oml.c: Alarm - Timeout waiting for... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 (1 comment) https://gerrit.osmocom.org/#/c/245/2/src/osmo-bts-litecell15/l1_if.c File src/osmo-bts-litecell15/l1_if.c: Line 120: rc = oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, failure_rep); general approach of using our signal code here. -- To view, visit https://gerrit.osmocom.org/245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If35dc4c0d3c04d328d0d8f85d5cfa4038afe723b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:58:45 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:58:45 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c: Alarm - Unknown MPH-INFO.req In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff984987ac0db06825afccfcb982d33f53c70a04 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:58:59 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:58:59 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/l1_if.c : Alarm - Unknown l1sap do... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia31720a495fb460a6449d89e02a29ef18503b885 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:59:12 +0000 Subject: osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported IPA set attributes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78f2f846132f9996bb4008643f1a666e366d2f85 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:59:29 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:59:29 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to op... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2829d68531494f0ede8f9dd2fe19ea99c63ea99 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 12:59:43 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 12:59:43 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Failed to ve... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0472ca8024124a9123eef1a2a93742cf15e1371f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 13:00:05 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 13:00:05 +0000 Subject: osmo-bts[master]: LC15: osmo-bts-litecell15/calib_file.c: Alarm - Calibration ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff46e7ed6093cf77b95758a866a58991cd807bfa Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 13:00:34 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 13:00:34 +0000 Subject: osmo-bts[master]: LC15: common/bts.c : Alarm - Failed to establish RSL link an... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8adac2c9dd1570feec14b3e66f8b05c4274cf127 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 13:01:07 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 13:01:07 +0000 Subject: osmo-bts[master]: LC15: common/oml.c: Alarm - Unsupported BTS attributes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a515a8fca128b924c82d8a88eb5d420e14b3604 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 13:01:51 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 13:01:51 +0000 Subject: osmo-bts[master]: LC15: common/oml.c: Alarm - Unsupported radio attributes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I209ea1ca0b54fb36189ca1154134344f57c1898c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 13:02:17 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 13:02:17 +0000 Subject: osmo-bts[master]: LC15: common/oml.c : Alarm - Unsupported channel attributes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52fd6f3edb0e7eb88c6ea97454696fa84e322cf9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 13:02:44 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 13:02:44 +0000 Subject: osmo-bts[master]: LC15: common/oml.c : Alarm - Formatted O&M message too short In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 General approach to generate OML messages. -- To view, visit https://gerrit.osmocom.org/255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I697c7e14efb2ebdbf789b2e0db13c43521791d85 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 14:49:34 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 14:49:34 +0000 Subject: openbsc[master]: Remove unused auth code and add comment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 > And gsm48_rx_mm_auth_resp will call the CB GSM_SECURITY_AUTH_FAILED? This is actually a slightly old commit I still found in my queue. It seems I overlooked the gsm48_rx_mm_auth_resp() case, so you're completely right and _AUTH_FAILED is indeed invoked. So we should handle the _AUTH_FAILED properly, and it's not exclusive to 3G. So then this question remains: On auth failure, do we reply with a LU reject, or do we just close down the connection? (The current code just terminates the connection without a LU reject.) (And 3G would then behave the same as 2G) -- To view, visit https://gerrit.osmocom.org/331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 15:42:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 20 Jun 2016 15:42:09 +0000 Subject: openbsc[master]: Remove unused auth code and add comment In-Reply-To: References: Message-ID: Patch Set 1: > > And gsm48_rx_mm_auth_resp will call the CB GSM_SECURITY_AUTH_FAILED? > > This is actually a slightly old commit I still found in my queue. > It seems I overlooked the gsm48_rx_mm_auth_resp() case, so you're > completely right and _AUTH_FAILED is indeed invoked. > > So we should handle the _AUTH_FAILED properly, and it's not > exclusive to 3G. > > So then this question remains: On auth failure, do we reply with a > LU reject, or do we just close down the connection? (The current > code just terminates the connection without a LU reject.) > > (And 3G would then behave the same as 2G) Beware that all of this code dealing with authentication and LU will be replaced with the libvlr anyway, so it might not make sense to spend time on improvements now; rathe they might introduce mere conflicts. -- To view, visit https://gerrit.osmocom.org/331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:03:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:03:25 +0000 Subject: [PATCH] openbsc[master]: TEST 6 COMMIT 1 Message-ID: Review at https://gerrit.osmocom.org/338 TEST 6 COMMIT 1 Change-Id: I143701f5e9837df29e6e1ada5026a340ef42c17d --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/338/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..25fd1dd 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST 1 + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I143701f5e9837df29e6e1ada5026a340ef42c17d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:03:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:03:25 +0000 Subject: [PATCH] openbsc[master]: TEST 6 COMMIT 2 Message-ID: Review at https://gerrit.osmocom.org/339 TEST 6 COMMIT 2 Change-Id: If7e514f350414c8ee8de56f5ebe22d2483437933 --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/39/339/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..5bbdcbc 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST 2 + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7e514f350414c8ee8de56f5ebe22d2483437933 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:08:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:08:09 +0000 Subject: [PATCH] openbsc[master]: TEST 6 COMMIT 1 b In-Reply-To: References: Message-ID: TEST 6 COMMIT 1 b Change-Id: I143701f5e9837df29e6e1ada5026a340ef42c17d --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/338/2 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..25fd1dd 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST 1 + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I143701f5e9837df29e6e1ada5026a340ef42c17d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:08:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:08:09 +0000 Subject: [PATCH] openbsc[master]: TEST 6 COMMIT 2 In-Reply-To: References: Message-ID: TEST 6 COMMIT 2 Change-Id: If7e514f350414c8ee8de56f5ebe22d2483437933 --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/39/339/2 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..5927264 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST 2 amend 1 + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If7e514f350414c8ee8de56f5ebe22d2483437933 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:09:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:09:36 +0000 Subject: [PATCH] openbsc[master]: TEST 7 COMMIT 1 b Message-ID: Review at https://gerrit.osmocom.org/340 TEST 7 COMMIT 1 b Change-Id: Ia01fd029011ba6c25d4001dc4efd0659e5751ea8 --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/340/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..25fd1dd 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST 1 + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia01fd029011ba6c25d4001dc4efd0659e5751ea8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:09:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:09:36 +0000 Subject: [PATCH] openbsc[master]: TEST 7 COMMIT 2 Message-ID: Review at https://gerrit.osmocom.org/341 TEST 7 COMMIT 2 Change-Id: I6ed1f96751826dde1c6277a02608840505091d2e --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/41/341/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..5927264 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST 2 amend 1 + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ed1f96751826dde1c6277a02608840505091d2e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:11:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:11:09 +0000 Subject: [PATCH] openbsc[master]: TEST 8 COMMIT 1 b Message-ID: Review at https://gerrit.osmocom.org/342 TEST 8 COMMIT 1 b Change-Id: I64bca5151aa628792f179ed5b4a5987238ab58fa --- M openbsc/doc/BS11-OML.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/42/342/1 diff --git a/openbsc/doc/BS11-OML.txt b/openbsc/doc/BS11-OML.txt index e5c3299..25fd1dd 100644 --- a/openbsc/doc/BS11-OML.txt +++ b/openbsc/doc/BS11-OML.txt @@ -1,3 +1,5 @@ +TEST 1 + The Siemens BS-11 supports the following additional GSM 12.21 OML operations: -- To view, visit https://gerrit.osmocom.org/342 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64bca5151aa628792f179ed5b4a5987238ab58fa Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:11:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:11:09 +0000 Subject: [PATCH] openbsc[master]: TEST 8 COMMIT 2 Message-ID: Review at https://gerrit.osmocom.org/343 TEST 8 COMMIT 2 Change-Id: I831e071f2b4cffd86ef0504fb6073467df06d886 --- M openbsc/doc/call-routing.txt 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/43/343/1 diff --git a/openbsc/doc/call-routing.txt b/openbsc/doc/call-routing.txt index 3402f9e..5927264 100644 --- a/openbsc/doc/call-routing.txt +++ b/openbsc/doc/call-routing.txt @@ -1,3 +1,5 @@ +TEST 2 amend 1 + Call routing in OpenBSC Flow of events: -- To view, visit https://gerrit.osmocom.org/343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I831e071f2b4cffd86ef0504fb6073467df06d886 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:15:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 20 Jun 2016 16:15:23 +0000 Subject: [PATCH] libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/326 to look at the new patch set (#2). Add octet-aligned/unaligned shift functions The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests and doxygen annotation. Those functions are used in several BTS implementations but seems generic enough to be generally useful. Change-Id: I2b1901c4161e8035f059585901dca593b661556d --- M include/osmocom/core/bits.h M src/bits.c M tests/bits/bitrev_test.c M tests/bits/bitrev_test.ok 4 files changed, 179 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/326/2 diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 3218330..5535920 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -41,6 +41,11 @@ int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits); +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); + void osmo_ubit2sbit(sbit_t *out, const ubit_t *in, unsigned int num_bits); void osmo_sbit2ubit(ubit_t *out, const sbit_t *in, unsigned int num_bits); diff --git a/src/bits.c b/src/bits.c index 569a10f..613e258 100644 --- a/src/bits.c +++ b/src/bits.c @@ -61,6 +61,50 @@ return outptr - out; } +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, unaligned + * \param[in] in input buffer, octet-aligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + + /* first byte: upper nibble empty, lower nibble from src */ + out[0] = (in[0] >> 4); + + /* bytes 1.. */ + for (i = 1; i < num_whole_bytes; i++) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + else + out[i] = (in[i - 1] & 0xF) << 4; +} + +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, octet-aligned + * \param[in] in input buffer, unaligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + + for (i = 0; i < num_whole_bytes; i++) + out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = (in[i] & 0xF) << 4; +} + /*! \brief convert unpacked bits to soft bits * \param[out] out output buffer of soft bits * \param[in] in input buffer of unpacked bits diff --git a/tests/bits/bitrev_test.c b/tests/bits/bitrev_test.c index 987f4d5..36c9925 100644 --- a/tests/bits/bitrev_test.c +++ b/tests/bits/bitrev_test.c @@ -205,6 +205,20 @@ printcheck16(e, test, test, (BE == e) ? s : NULL, print); } +static void sh_chk(const uint8_t *in, size_t len, unsigned int nib, bool r) +{ + uint8_t x[len]; + if (r) + osmo_nibble_shift_right(x, in, nib); + else + osmo_nibble_shift_left_unal(x, in, nib); + + printf("[%u] %s IN: %s, nibble %u:", len, r ? "R" : "L", + osmo_hexdump_nospc(in, len), nib); + /* do NOT combine those printfs: osmo_hexdump* use static buffer which + WILL screw things up in that case */ + printf("\n OUT: %s\n", osmo_hexdump_nospc(x, nib/2)); +} int main(int argc, char **argv) { @@ -274,5 +288,16 @@ check16(0, BE); check16(0, LE); + printf("running nibble tests...\n"); + + const uint8_t in1[] = { 0xF0, 0x0D, 0xCA, 0xFE, 0xDE, 0xAD, 0xBE, 0xEF }, + in2[] = { 0xB0, 0x0B, 0xBA, 0xBE, 0xFA, 0xCE }; + + for (offs = 0; offs < 13; offs++) { + sh_chk(in1, ARRAY_SIZE(in1), offs, true); + sh_chk(in1, ARRAY_SIZE(in1), offs, false); + sh_chk(in2, ARRAY_SIZE(in2), offs, true); + sh_chk(in2, ARRAY_SIZE(in2), offs, false); + } return 0; } diff --git a/tests/bits/bitrev_test.ok b/tests/bits/bitrev_test.ok index 90cb295..9fbb4d9 100644 --- a/tests/bits/bitrev_test.ok +++ b/tests/bits/bitrev_test.ok @@ -53,3 +53,108 @@ 24 LE OK 16 BE OK, storage OK 16 LE OK +running nibble tests... +[8] R IN: f00dcafedeadbeef, nibble 0: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 0: + OUT: +[6] R IN: b00bbabeface, nibble 0: + OUT: +[6] L IN: b00bbabeface, nibble 0: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 1: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 1: + OUT: +[6] R IN: b00bbabeface, nibble 1: + OUT: +[6] L IN: b00bbabeface, nibble 1: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 2: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 2: + OUT: 00 +[6] R IN: b00bbabeface, nibble 2: + OUT: 0b +[6] L IN: b00bbabeface, nibble 2: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 3: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 3: + OUT: 00 +[6] R IN: b00bbabeface, nibble 3: + OUT: 0b +[6] L IN: b00bbabeface, nibble 3: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 4: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 4: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 4: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 4: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 5: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 5: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 5: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 5: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 6: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 6: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 6: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 6: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 7: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 7: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 7: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 7: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 8: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 8: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 8: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 8: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 9: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 9: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 9: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 9: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 10: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 10: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 10: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 10: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 11: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 11: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 11: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 11: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 12: + OUT: 0f00dcafedea +[8] L IN: f00dcafedeadbeef, nibble 12: + OUT: 00dcafedeadb +[6] R IN: b00bbabeface, nibble 12: + OUT: 0b00bbabefac +[6] L IN: b00bbabeface, nibble 12: + OUT: 00bbabeface0 -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:18:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:18:04 +0000 Subject: [PATCH] osmo-pcu[master]: typo in warning Message-ID: Review at https://gerrit.osmocom.org/344 typo in warning (actually committing just to test gerrit, and if it goes through it's still a valid change.) Change-Id: I2ca9a1cc2f250801fbe62f3c50b73dff7101ee08 --- M src/bts.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/44/344/1 diff --git a/src/bts.cpp b/src/bts.cpp index 8692065..c53c92c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -513,7 +513,7 @@ tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; } else { // Create new TBF - #warning "Copy and pate with other routines.." + #warning "Copy and paste with other routines.." /* set class to 0, since we don't know the multislot class yet */ tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); if (!tbf) { -- To view, visit https://gerrit.osmocom.org/344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2ca9a1cc2f250801fbe62f3c50b73dff7101ee08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:18:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:18:27 +0000 Subject: osmo-pcu[master]: typo in warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 cosmetic -- To view, visit https://gerrit.osmocom.org/344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2ca9a1cc2f250801fbe62f3c50b73dff7101ee08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:18:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:18:28 +0000 Subject: [MERGED] osmo-pcu[master]: typo in warning In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: typo in warning ...................................................................... typo in warning (actually committing just to test gerrit, and if it goes through it's still a valid change.) Change-Id: I2ca9a1cc2f250801fbe62f3c50b73dff7101ee08 --- M src/bts.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/src/bts.cpp b/src/bts.cpp index 8692065..c53c92c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -513,7 +513,7 @@ tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; } else { // Create new TBF - #warning "Copy and pate with other routines.." + #warning "Copy and paste with other routines.." /* set class to 0, since we don't know the multislot class yet */ tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); if (!tbf) { -- To view, visit https://gerrit.osmocom.org/344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ca9a1cc2f250801fbe62f3c50b73dff7101ee08 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:19:37 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:19:37 +0000 Subject: [ABANDON] openbsc[master]: TEST 8 COMMIT 2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 8 COMMIT 2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I831e071f2b4cffd86ef0504fb6073467df06d886 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:19:40 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:19:40 +0000 Subject: [ABANDON] openbsc[master]: TEST 8 COMMIT 1 b In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 8 COMMIT 1 b ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/342 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I64bca5151aa628792f179ed5b4a5987238ab58fa Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:19:45 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:19:45 +0000 Subject: [ABANDON] openbsc[master]: TEST 7 COMMIT 2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 7 COMMIT 2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6ed1f96751826dde1c6277a02608840505091d2e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:19:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:19:48 +0000 Subject: [ABANDON] openbsc[master]: TEST 7 COMMIT 1 b In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 7 COMMIT 1 b ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ia01fd029011ba6c25d4001dc4efd0659e5751ea8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:19:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:19:53 +0000 Subject: [ABANDON] openbsc[master]: TEST 6 COMMIT 1 b In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 6 COMMIT 1 b ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I143701f5e9837df29e6e1ada5026a340ef42c17d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:19:56 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:19:56 +0000 Subject: [ABANDON] openbsc[master]: TEST 6 COMMIT 2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: TEST 6 COMMIT 2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: If7e514f350414c8ee8de56f5ebe22d2483437933 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:27:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:27:12 +0000 Subject: [PATCH] openbsc[master]: typo in sgsn_test Message-ID: Review at https://gerrit.osmocom.org/345 typo in sgsn_test (committing just to test gerrit, if it goes through it's still a valid change) Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8 --- M openbsc/tests/sgsn/sgsn_test.c M openbsc/tests/sgsn/sgsn_test.ok 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/45/345/1 diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 48f013d..f425c33 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -536,7 +536,7 @@ 0x10, 0x01, 0x03, }; - printf("Testing subcriber GSUP handling\n"); + printf("Testing subscriber GSUP handling\n"); update_subscriber_data_cb = my_dummy_sgsn_update_subscriber_data; diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/openbsc/tests/sgsn/sgsn_test.ok index cdd2006..c7a53b9 100644 --- a/openbsc/tests/sgsn/sgsn_test.ok +++ b/openbsc/tests/sgsn/sgsn_test.ok @@ -1,7 +1,7 @@ Testing LLME allocations Testing core subscriber data API Testing authentication triplet handling -Testing subcriber GSUP handling +Testing subscriber GSUP handling Testing GMM detach Testing GMM detach (power off) Testing GMM detach (no MMCTX) -- To view, visit https://gerrit.osmocom.org/345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:28:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:28:14 +0000 Subject: openbsc[master]: typo in sgsn_test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 testing gerrit, so fast-tracking this -- To view, visit https://gerrit.osmocom.org/345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:28:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:28:17 +0000 Subject: [MERGED] openbsc[master]: typo in sgsn_test In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: typo in sgsn_test ...................................................................... typo in sgsn_test (committing just to test gerrit, if it goes through it's still a valid change) Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8 --- M openbsc/tests/sgsn/sgsn_test.c M openbsc/tests/sgsn/sgsn_test.ok 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 48f013d..f425c33 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -536,7 +536,7 @@ 0x10, 0x01, 0x03, }; - printf("Testing subcriber GSUP handling\n"); + printf("Testing subscriber GSUP handling\n"); update_subscriber_data_cb = my_dummy_sgsn_update_subscriber_data; diff --git a/openbsc/tests/sgsn/sgsn_test.ok b/openbsc/tests/sgsn/sgsn_test.ok index cdd2006..c7a53b9 100644 --- a/openbsc/tests/sgsn/sgsn_test.ok +++ b/openbsc/tests/sgsn/sgsn_test.ok @@ -1,7 +1,7 @@ Testing LLME allocations Testing core subscriber data API Testing authentication triplet handling -Testing subcriber GSUP handling +Testing subscriber GSUP handling Testing GMM detach Testing GMM detach (power off) Testing GMM detach (no MMCTX) -- To view, visit https://gerrit.osmocom.org/345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:33:45 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 20 Jun 2016 16:33:45 +0000 Subject: [PATCH] libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/326 to look at the new patch set (#3). Add octet-aligned/unaligned shift functions The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests and doxygen annotation. Those functions are used in several BTS implementations but seems generic enough to be generally useful. Change-Id: I2b1901c4161e8035f059585901dca593b661556d --- M include/osmocom/core/bits.h M src/bits.c M tests/bits/bitrev_test.c M tests/bits/bitrev_test.ok 4 files changed, 179 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/326/3 diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 3218330..5535920 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -41,6 +41,11 @@ int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits); +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); + void osmo_ubit2sbit(sbit_t *out, const ubit_t *in, unsigned int num_bits); void osmo_sbit2ubit(ubit_t *out, const sbit_t *in, unsigned int num_bits); diff --git a/src/bits.c b/src/bits.c index 569a10f..613e258 100644 --- a/src/bits.c +++ b/src/bits.c @@ -61,6 +61,50 @@ return outptr - out; } +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, unaligned + * \param[in] in input buffer, octet-aligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + + /* first byte: upper nibble empty, lower nibble from src */ + out[0] = (in[0] >> 4); + + /* bytes 1.. */ + for (i = 1; i < num_whole_bytes; i++) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + else + out[i] = (in[i - 1] & 0xF) << 4; +} + +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, octet-aligned + * \param[in] in input buffer, unaligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + + for (i = 0; i < num_whole_bytes; i++) + out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = (in[i] & 0xF) << 4; +} + /*! \brief convert unpacked bits to soft bits * \param[out] out output buffer of soft bits * \param[in] in input buffer of unpacked bits diff --git a/tests/bits/bitrev_test.c b/tests/bits/bitrev_test.c index 987f4d5..08f0827 100644 --- a/tests/bits/bitrev_test.c +++ b/tests/bits/bitrev_test.c @@ -205,6 +205,20 @@ printcheck16(e, test, test, (BE == e) ? s : NULL, print); } +static void sh_chk(const uint8_t *in, uint8_t len, unsigned int nib, bool r) +{ + uint8_t x[len]; + if (r) + osmo_nibble_shift_right(x, in, nib); + else + osmo_nibble_shift_left_unal(x, in, nib); + + printf("[%u] %s IN: %s, nibble %u:", len, r ? "R" : "L", + osmo_hexdump_nospc(in, len), nib); + /* do NOT combine those printfs: osmo_hexdump* use static buffer which + WILL screw things up in that case */ + printf("\n OUT: %s\n", osmo_hexdump_nospc(x, nib/2)); +} int main(int argc, char **argv) { @@ -274,5 +288,16 @@ check16(0, BE); check16(0, LE); + printf("running nibble tests...\n"); + + const uint8_t in1[] = { 0xF0, 0x0D, 0xCA, 0xFE, 0xDE, 0xAD, 0xBE, 0xEF }, + in2[] = { 0xB0, 0x0B, 0xBA, 0xBE, 0xFA, 0xCE }; + + for (offs = 0; offs < 13; offs++) { + sh_chk(in1, ARRAY_SIZE(in1), offs, true); + sh_chk(in1, ARRAY_SIZE(in1), offs, false); + sh_chk(in2, ARRAY_SIZE(in2), offs, true); + sh_chk(in2, ARRAY_SIZE(in2), offs, false); + } return 0; } diff --git a/tests/bits/bitrev_test.ok b/tests/bits/bitrev_test.ok index 90cb295..9fbb4d9 100644 --- a/tests/bits/bitrev_test.ok +++ b/tests/bits/bitrev_test.ok @@ -53,3 +53,108 @@ 24 LE OK 16 BE OK, storage OK 16 LE OK +running nibble tests... +[8] R IN: f00dcafedeadbeef, nibble 0: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 0: + OUT: +[6] R IN: b00bbabeface, nibble 0: + OUT: +[6] L IN: b00bbabeface, nibble 0: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 1: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 1: + OUT: +[6] R IN: b00bbabeface, nibble 1: + OUT: +[6] L IN: b00bbabeface, nibble 1: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 2: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 2: + OUT: 00 +[6] R IN: b00bbabeface, nibble 2: + OUT: 0b +[6] L IN: b00bbabeface, nibble 2: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 3: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 3: + OUT: 00 +[6] R IN: b00bbabeface, nibble 3: + OUT: 0b +[6] L IN: b00bbabeface, nibble 3: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 4: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 4: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 4: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 4: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 5: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 5: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 5: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 5: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 6: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 6: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 6: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 6: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 7: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 7: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 7: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 7: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 8: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 8: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 8: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 8: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 9: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 9: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 9: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 9: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 10: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 10: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 10: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 10: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 11: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 11: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 11: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 11: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 12: + OUT: 0f00dcafedea +[8] L IN: f00dcafedeadbeef, nibble 12: + OUT: 00dcafedeadb +[6] R IN: b00bbabeface, nibble 12: + OUT: 0b00bbabefac +[6] L IN: b00bbabeface, nibble 12: + OUT: 00bbabeface0 -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:50:33 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:50:33 +0000 Subject: sandbox[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6435a0d6877091ed178b37e67dba592223118dd3 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: refs/meta/config Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:50:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:50:49 +0000 Subject: [PATCH] sandbox[refs/meta/config]: Edit Project Config Message-ID: Review at https://gerrit.osmocom.org/346 Edit Project Config Change-Id: I6435a0d6877091ed178b37e67dba592223118dd3 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/46/346/1 -- To view, visit https://gerrit.osmocom.org/346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6435a0d6877091ed178b37e67dba592223118dd3 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: refs/meta/config Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:54:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:54:04 +0000 Subject: [PATCH] sandbox[master]: x Message-ID: Review at https://gerrit.osmocom.org/349 x Change-Id: I0fb03965fe909bdbe5cb49bc5afaf51cfff90c34 --- A x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/49/349/1 diff --git a/x b/x new file mode 100644 index 0000000..587be6b --- /dev/null +++ b/x @@ -0,0 +1 @@ +x -- To view, visit https://gerrit.osmocom.org/349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0fb03965fe909bdbe5cb49bc5afaf51cfff90c34 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:54:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:54:25 +0000 Subject: sandbox[master]: x In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0fb03965fe909bdbe5cb49bc5afaf51cfff90c34 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:54:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:54:27 +0000 Subject: [MERGED] sandbox[master]: x In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: x ...................................................................... x Change-Id: I0fb03965fe909bdbe5cb49bc5afaf51cfff90c34 --- A x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x new file mode 100644 index 0000000..587be6b --- /dev/null +++ b/x @@ -0,0 +1 @@ +x -- To view, visit https://gerrit.osmocom.org/349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0fb03965fe909bdbe5cb49bc5afaf51cfff90c34 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:56:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:56:58 +0000 Subject: [PATCH] sandbox[master]: t1 Message-ID: Review at https://gerrit.osmocom.org/350 t1 Change-Id: I8358907899c0fe51e218f08e22d79f66507f22f1 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/50/350/1 diff --git a/x b/x index 587be6b..560e017 100644 --- a/x +++ b/x @@ -1 +1,2 @@ x +x -- To view, visit https://gerrit.osmocom.org/350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8358907899c0fe51e218f08e22d79f66507f22f1 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:56:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:56:58 +0000 Subject: [PATCH] sandbox[master]: t2 Message-ID: Review at https://gerrit.osmocom.org/351 t2 Change-Id: I78421040613b98304d584e753c0174f846269edb --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/51/351/1 diff --git a/x b/x index 560e017..f3eae69 100644 --- a/x +++ b/x @@ -1,2 +1,3 @@ x x +x -- To view, visit https://gerrit.osmocom.org/351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78421040613b98304d584e753c0174f846269edb Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:56:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:56:59 +0000 Subject: [PATCH] sandbox[master]: t3 Message-ID: Review at https://gerrit.osmocom.org/352 t3 Change-Id: I641b6cdaf8139dc41613defef2f58d61e226db71 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/52/352/1 diff --git a/x b/x index f3eae69..789582c 100644 --- a/x +++ b/x @@ -1,3 +1,4 @@ x x x +x -- To view, visit https://gerrit.osmocom.org/352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I641b6cdaf8139dc41613defef2f58d61e226db71 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:57:32 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:57:32 +0000 Subject: sandbox[master]: t1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8358907899c0fe51e218f08e22d79f66507f22f1 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:57:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:57:38 +0000 Subject: sandbox[master]: t2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I78421040613b98304d584e753c0174f846269edb Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 16:57:45 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 16:57:45 +0000 Subject: sandbox[master]: t3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I641b6cdaf8139dc41613defef2f58d61e226db71 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:03:12 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 20 Jun 2016 17:03:12 +0000 Subject: [PATCH] libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/326 to look at the new patch set (#4). Add octet-aligned/unaligned shift functions The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests, doxygen annotation and extra memory safety check. Those functions are used in several BTS implementations but seems generic enough to be generally useful. Change-Id: I2b1901c4161e8035f059585901dca593b661556d --- M include/osmocom/core/bits.h M src/bits.c M tests/bits/bitrev_test.c M tests/bits/bitrev_test.ok 4 files changed, 183 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/326/4 diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 3218330..5535920 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -41,6 +41,11 @@ int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits); +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); + void osmo_ubit2sbit(sbit_t *out, const ubit_t *in, unsigned int num_bits); void osmo_sbit2ubit(ubit_t *out, const sbit_t *in, unsigned int num_bits); diff --git a/src/bits.c b/src/bits.c index 569a10f..0c77b27 100644 --- a/src/bits.c +++ b/src/bits.c @@ -61,6 +61,54 @@ return outptr - out; } +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, unaligned + * \param[in] in input buffer, octet-aligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + if (!num_whole_bytes) + return; + + /* first byte: upper nibble empty, lower nibble from src */ + out[0] = (in[0] >> 4); + + /* bytes 1.. */ + for (i = 1; i < num_whole_bytes; i++) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + else + out[i] = (in[i - 1] & 0xF) << 4; +} + +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, octet-aligned + * \param[in] in input buffer, unaligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + if (!num_whole_bytes) + return; + + for (i = 0; i < num_whole_bytes; i++) + out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = (in[i] & 0xF) << 4; +} + /*! \brief convert unpacked bits to soft bits * \param[out] out output buffer of soft bits * \param[in] in input buffer of unpacked bits diff --git a/tests/bits/bitrev_test.c b/tests/bits/bitrev_test.c index 987f4d5..08f0827 100644 --- a/tests/bits/bitrev_test.c +++ b/tests/bits/bitrev_test.c @@ -205,6 +205,20 @@ printcheck16(e, test, test, (BE == e) ? s : NULL, print); } +static void sh_chk(const uint8_t *in, uint8_t len, unsigned int nib, bool r) +{ + uint8_t x[len]; + if (r) + osmo_nibble_shift_right(x, in, nib); + else + osmo_nibble_shift_left_unal(x, in, nib); + + printf("[%u] %s IN: %s, nibble %u:", len, r ? "R" : "L", + osmo_hexdump_nospc(in, len), nib); + /* do NOT combine those printfs: osmo_hexdump* use static buffer which + WILL screw things up in that case */ + printf("\n OUT: %s\n", osmo_hexdump_nospc(x, nib/2)); +} int main(int argc, char **argv) { @@ -274,5 +288,16 @@ check16(0, BE); check16(0, LE); + printf("running nibble tests...\n"); + + const uint8_t in1[] = { 0xF0, 0x0D, 0xCA, 0xFE, 0xDE, 0xAD, 0xBE, 0xEF }, + in2[] = { 0xB0, 0x0B, 0xBA, 0xBE, 0xFA, 0xCE }; + + for (offs = 0; offs < 13; offs++) { + sh_chk(in1, ARRAY_SIZE(in1), offs, true); + sh_chk(in1, ARRAY_SIZE(in1), offs, false); + sh_chk(in2, ARRAY_SIZE(in2), offs, true); + sh_chk(in2, ARRAY_SIZE(in2), offs, false); + } return 0; } diff --git a/tests/bits/bitrev_test.ok b/tests/bits/bitrev_test.ok index 90cb295..9fbb4d9 100644 --- a/tests/bits/bitrev_test.ok +++ b/tests/bits/bitrev_test.ok @@ -53,3 +53,108 @@ 24 LE OK 16 BE OK, storage OK 16 LE OK +running nibble tests... +[8] R IN: f00dcafedeadbeef, nibble 0: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 0: + OUT: +[6] R IN: b00bbabeface, nibble 0: + OUT: +[6] L IN: b00bbabeface, nibble 0: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 1: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 1: + OUT: +[6] R IN: b00bbabeface, nibble 1: + OUT: +[6] L IN: b00bbabeface, nibble 1: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 2: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 2: + OUT: 00 +[6] R IN: b00bbabeface, nibble 2: + OUT: 0b +[6] L IN: b00bbabeface, nibble 2: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 3: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 3: + OUT: 00 +[6] R IN: b00bbabeface, nibble 3: + OUT: 0b +[6] L IN: b00bbabeface, nibble 3: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 4: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 4: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 4: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 4: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 5: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 5: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 5: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 5: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 6: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 6: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 6: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 6: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 7: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 7: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 7: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 7: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 8: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 8: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 8: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 8: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 9: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 9: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 9: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 9: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 10: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 10: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 10: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 10: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 11: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 11: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 11: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 11: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 12: + OUT: 0f00dcafedea +[8] L IN: f00dcafedeadbeef, nibble 12: + OUT: 00dcafedeadb +[6] R IN: b00bbabeface, nibble 12: + OUT: 0b00bbabefac +[6] L IN: b00bbabeface, nibble 12: + OUT: 00bbabeface0 -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:04:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:04:23 +0000 Subject: [ABANDON] sandbox[master]: t1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8358907899c0fe51e218f08e22d79f66507f22f1 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:04:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:04:28 +0000 Subject: [ABANDON] sandbox[master]: t2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I78421040613b98304d584e753c0174f846269edb Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:04:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:04:30 +0000 Subject: [ABANDON] sandbox[master]: t3 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/352 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I641b6cdaf8139dc41613defef2f58d61e226db71 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:05:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:05:38 +0000 Subject: [PATCH] sandbox[master]: t1 Message-ID: Review at https://gerrit.osmocom.org/353 t1 Change-Id: Ie7ba0e12f811260e07b20e887c47ed4b94c2ba62 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/53/353/1 diff --git a/x b/x index 587be6b..560e017 100644 --- a/x +++ b/x @@ -1 +1,2 @@ x +x -- To view, visit https://gerrit.osmocom.org/353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7ba0e12f811260e07b20e887c47ed4b94c2ba62 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:05:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:05:38 +0000 Subject: [PATCH] sandbox[master]: t2 Message-ID: Review at https://gerrit.osmocom.org/354 t2 Change-Id: Idb86b406853114caff194053404d523f032d5508 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/54/354/1 diff --git a/x b/x index 560e017..f3eae69 100644 --- a/x +++ b/x @@ -1,2 +1,3 @@ x x +x -- To view, visit https://gerrit.osmocom.org/354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb86b406853114caff194053404d523f032d5508 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:05:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:05:38 +0000 Subject: [PATCH] sandbox[master]: t3 Message-ID: Review at https://gerrit.osmocom.org/355 t3 Change-Id: I07c14fa722313478f5c5efb8aaa1248d1caa7e5a --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/55/355/1 diff --git a/x b/x index f3eae69..789582c 100644 --- a/x +++ b/x @@ -1,3 +1,4 @@ x x x +x -- To view, visit https://gerrit.osmocom.org/355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07c14fa722313478f5c5efb8aaa1248d1caa7e5a Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:07:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:07:27 +0000 Subject: [PATCH] sandbox[master]: t2-1 Message-ID: Review at https://gerrit.osmocom.org/356 t2-1 Change-Id: I7e9351f1da4c0590e33e6f02f71f1b810f56dbdb --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/56/356/1 diff --git a/x b/x index 789582c..4e91409 100644 --- a/x +++ b/x @@ -2,3 +2,4 @@ x x x +y -- To view, visit https://gerrit.osmocom.org/356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e9351f1da4c0590e33e6f02f71f1b810f56dbdb Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:07:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:07:27 +0000 Subject: [PATCH] sandbox[master]: t2-2 Message-ID: Review at https://gerrit.osmocom.org/357 t2-2 Change-Id: I8b9b9c093f36133ad768f8d36acc9c44303f0b4f --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/57/357/1 diff --git a/x b/x index 4e91409..dcc4e0c 100644 --- a/x +++ b/x @@ -3,3 +3,4 @@ x x y +y -- To view, visit https://gerrit.osmocom.org/357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b9b9c093f36133ad768f8d36acc9c44303f0b4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:07:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:07:27 +0000 Subject: [PATCH] sandbox[master]: t2-3 Message-ID: Review at https://gerrit.osmocom.org/358 t2-3 Change-Id: Icb57835772bed78cc84bf88184b39a30ec8100c4 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/58/358/1 diff --git a/x b/x index dcc4e0c..e282b9c 100644 --- a/x +++ b/x @@ -4,3 +4,4 @@ x y y +y -- To view, visit https://gerrit.osmocom.org/358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb57835772bed78cc84bf88184b39a30ec8100c4 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:09:08 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:09:08 +0000 Subject: [PATCH] sandbox[master]: a Message-ID: Review at https://gerrit.osmocom.org/359 a Change-Id: I1f954da920bf3352737a2697efb04ef280c5c650 --- A a 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/59/359/1 diff --git a/a b/a new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/a @@ -0,0 +1 @@ +a -- To view, visit https://gerrit.osmocom.org/359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f954da920bf3352737a2697efb04ef280c5c650 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:09:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:09:21 +0000 Subject: sandbox[master]: a In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f954da920bf3352737a2697efb04ef280c5c650 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:09:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:09:23 +0000 Subject: [MERGED] sandbox[master]: a In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: a ...................................................................... a Change-Id: I1f954da920bf3352737a2697efb04ef280c5c650 --- A a 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/a b/a new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/a @@ -0,0 +1 @@ +a -- To view, visit https://gerrit.osmocom.org/359 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f954da920bf3352737a2697efb04ef280c5c650 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:10:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:10:07 +0000 Subject: [ABANDON] sandbox[master]: t3 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I07c14fa722313478f5c5efb8aaa1248d1caa7e5a Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:10:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:10:10 +0000 Subject: [ABANDON] sandbox[master]: t2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/354 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Idb86b406853114caff194053404d523f032d5508 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:10:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:10:12 +0000 Subject: [ABANDON] sandbox[master]: t1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/353 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ie7ba0e12f811260e07b20e887c47ed4b94c2ba62 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:10:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:10:36 +0000 Subject: [PATCH] sandbox[master]: t2-1 Message-ID: Review at https://gerrit.osmocom.org/360 t2-1 Change-Id: I97ebfbffc1271ad3b4e34cfd1c7a328044d2196a --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/60/360/1 diff --git a/x b/x index 789582c..4e91409 100644 --- a/x +++ b/x @@ -2,3 +2,4 @@ x x x +y -- To view, visit https://gerrit.osmocom.org/360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I97ebfbffc1271ad3b4e34cfd1c7a328044d2196a Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:10:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:10:36 +0000 Subject: [PATCH] sandbox[master]: t2-2 Message-ID: Review at https://gerrit.osmocom.org/361 t2-2 Change-Id: I17aa9b01ef216382e928b8617ec2102d3a1e5812 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/61/361/1 diff --git a/x b/x index 4e91409..dcc4e0c 100644 --- a/x +++ b/x @@ -3,3 +3,4 @@ x x y +y -- To view, visit https://gerrit.osmocom.org/361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17aa9b01ef216382e928b8617ec2102d3a1e5812 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:10:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:10:36 +0000 Subject: [PATCH] sandbox[master]: t2-3 Message-ID: Review at https://gerrit.osmocom.org/362 t2-3 Change-Id: Id5e77a2cbf326143ea970feab6e510c3a9aa31b8 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/62/362/1 diff --git a/x b/x index dcc4e0c..e282b9c 100644 --- a/x +++ b/x @@ -4,3 +4,4 @@ x y y +y -- To view, visit https://gerrit.osmocom.org/362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5e77a2cbf326143ea970feab6e510c3a9aa31b8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:11:41 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:11:41 +0000 Subject: sandbox[master]: t2-3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5e77a2cbf326143ea970feab6e510c3a9aa31b8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:11:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:11:46 +0000 Subject: sandbox[master]: t2-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I17aa9b01ef216382e928b8617ec2102d3a1e5812 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:11:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:11:52 +0000 Subject: sandbox[master]: t2-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97ebfbffc1271ad3b4e34cfd1c7a328044d2196a Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:11:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:11:58 +0000 Subject: [MERGED] sandbox[master]: t2-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t2-1 ...................................................................... t2-1 Change-Id: I97ebfbffc1271ad3b4e34cfd1c7a328044d2196a --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 789582c..4e91409 100644 --- a/x +++ b/x @@ -2,3 +2,4 @@ x x x +y -- To view, visit https://gerrit.osmocom.org/360 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97ebfbffc1271ad3b4e34cfd1c7a328044d2196a Gerrit-PatchSet: 2 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:11:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:11:59 +0000 Subject: [MERGED] sandbox[master]: t2-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t2-2 ...................................................................... t2-2 Change-Id: I17aa9b01ef216382e928b8617ec2102d3a1e5812 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 4e91409..dcc4e0c 100644 --- a/x +++ b/x @@ -3,3 +3,4 @@ x x y +y -- To view, visit https://gerrit.osmocom.org/361 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I17aa9b01ef216382e928b8617ec2102d3a1e5812 Gerrit-PatchSet: 2 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:11:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:11:59 +0000 Subject: [MERGED] sandbox[master]: t2-3 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t2-3 ...................................................................... t2-3 Change-Id: Id5e77a2cbf326143ea970feab6e510c3a9aa31b8 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index dcc4e0c..e282b9c 100644 --- a/x +++ b/x @@ -4,3 +4,4 @@ x y y +y -- To view, visit https://gerrit.osmocom.org/362 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5e77a2cbf326143ea970feab6e510c3a9aa31b8 Gerrit-PatchSet: 2 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:12:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:12:12 +0000 Subject: [ABANDON] sandbox[master]: t2-3 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t2-3 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/358 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Icb57835772bed78cc84bf88184b39a30ec8100c4 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:12:15 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:12:15 +0000 Subject: [ABANDON] sandbox[master]: t2-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t2-2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/357 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I8b9b9c093f36133ad768f8d36acc9c44303f0b4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:12:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:12:17 +0000 Subject: [ABANDON] sandbox[master]: t2-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t2-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/356 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I7e9351f1da4c0590e33e6f02f71f1b810f56dbdb Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:13:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:13:24 +0000 Subject: [ABANDON] sandbox[refs/meta/config]: Edit Project Config In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: Edit Project Config ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6435a0d6877091ed178b37e67dba592223118dd3 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: refs/meta/config Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:14:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:14:42 +0000 Subject: [PATCH] sandbox[master]: t3-1 Message-ID: Review at https://gerrit.osmocom.org/363 t3-1 Change-Id: Ib1714c4f37e596b7ab206e005c864053e28f6356 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/63/363/1 diff --git a/x b/x index e282b9c..4e0a073 100644 --- a/x +++ b/x @@ -5,3 +5,4 @@ y y y +z -- To view, visit https://gerrit.osmocom.org/363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1714c4f37e596b7ab206e005c864053e28f6356 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:14:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:14:42 +0000 Subject: [PATCH] sandbox[master]: t3-2 Message-ID: Review at https://gerrit.osmocom.org/364 t3-2 Change-Id: Ied2dbb2ecb26f494c383df4780f7b68e6b533af7 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/64/364/1 diff --git a/x b/x index 4e0a073..30d53f5 100644 --- a/x +++ b/x @@ -6,3 +6,4 @@ y y z +z -- To view, visit https://gerrit.osmocom.org/364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied2dbb2ecb26f494c383df4780f7b68e6b533af7 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:15:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:15:10 +0000 Subject: sandbox[master]: t3-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib1714c4f37e596b7ab206e005c864053e28f6356 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:15:15 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:15:15 +0000 Subject: sandbox[master]: t3-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied2dbb2ecb26f494c383df4780f7b68e6b533af7 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:15:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:15:18 +0000 Subject: [MERGED] sandbox[master]: t3-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t3-2 ...................................................................... t3-2 Change-Id: Ied2dbb2ecb26f494c383df4780f7b68e6b533af7 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 4e0a073..30d53f5 100644 --- a/x +++ b/x @@ -6,3 +6,4 @@ y y z +z -- To view, visit https://gerrit.osmocom.org/364 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied2dbb2ecb26f494c383df4780f7b68e6b533af7 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:15:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:15:18 +0000 Subject: [MERGED] sandbox[master]: t3-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t3-1 ...................................................................... t3-1 Change-Id: Ib1714c4f37e596b7ab206e005c864053e28f6356 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index e282b9c..4e0a073 100644 --- a/x +++ b/x @@ -5,3 +5,4 @@ y y y +z -- To view, visit https://gerrit.osmocom.org/363 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib1714c4f37e596b7ab206e005c864053e28f6356 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:19:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:19:04 +0000 Subject: [PATCH] sandbox[master]: t4-1 Message-ID: Review at https://gerrit.osmocom.org/365 t4-1 Change-Id: Ifaed861637609ad104b56e4d1d0c28ed0d332b59 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/65/365/1 diff --git a/x b/x index 30d53f5..07bc31d 100644 --- a/x +++ b/x @@ -7,3 +7,4 @@ y z z +4 -- To view, visit https://gerrit.osmocom.org/365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifaed861637609ad104b56e4d1d0c28ed0d332b59 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:19:05 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:19:05 +0000 Subject: [PATCH] sandbox[master]: t4-2 Message-ID: Review at https://gerrit.osmocom.org/366 t4-2 Change-Id: Ie6f2308a988c733bd0fe5192ea99a169001e47e8 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/66/366/1 diff --git a/x b/x index 07bc31d..8745c13 100644 --- a/x +++ b/x @@ -8,3 +8,4 @@ z z 4 +4 -- To view, visit https://gerrit.osmocom.org/366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6f2308a988c733bd0fe5192ea99a169001e47e8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:19:19 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:19:19 +0000 Subject: sandbox[master]: t4-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaed861637609ad104b56e4d1d0c28ed0d332b59 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:19:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:19:24 +0000 Subject: sandbox[master]: t4-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6f2308a988c733bd0fe5192ea99a169001e47e8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:19:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:19:27 +0000 Subject: [MERGED] sandbox[master]: t4-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t4-2 ...................................................................... t4-2 Change-Id: Ie6f2308a988c733bd0fe5192ea99a169001e47e8 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 07bc31d..8745c13 100644 --- a/x +++ b/x @@ -8,3 +8,4 @@ z z 4 +4 -- To view, visit https://gerrit.osmocom.org/366 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6f2308a988c733bd0fe5192ea99a169001e47e8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:19:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:19:28 +0000 Subject: [MERGED] sandbox[master]: t4-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t4-1 ...................................................................... t4-1 Change-Id: Ifaed861637609ad104b56e4d1d0c28ed0d332b59 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 30d53f5..07bc31d 100644 --- a/x +++ b/x @@ -7,3 +7,4 @@ y z z +4 -- To view, visit https://gerrit.osmocom.org/365 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifaed861637609ad104b56e4d1d0c28ed0d332b59 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:21:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:21:17 +0000 Subject: [PATCH] sandbox[master]: t5-1 Message-ID: Review at https://gerrit.osmocom.org/367 t5-1 Change-Id: I81e935f76ce8b4246e3c17b44c0f3b4f743845ef --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/67/367/1 diff --git a/x b/x index 8745c13..784762d 100644 --- a/x +++ b/x @@ -9,3 +9,4 @@ z 4 4 +5 -- To view, visit https://gerrit.osmocom.org/367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I81e935f76ce8b4246e3c17b44c0f3b4f743845ef Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:21:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:21:18 +0000 Subject: [PATCH] sandbox[master]: t5-2 Message-ID: Review at https://gerrit.osmocom.org/368 t5-2 Change-Id: Ic62be68abbf1cc74911ab686ae5fdac3b424232b --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/68/368/1 diff --git a/x b/x index 784762d..b11ea2c 100644 --- a/x +++ b/x @@ -10,3 +10,4 @@ 4 4 5 +5 -- To view, visit https://gerrit.osmocom.org/368 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic62be68abbf1cc74911ab686ae5fdac3b424232b Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:21:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:21:36 +0000 Subject: sandbox[master]: t5-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I81e935f76ce8b4246e3c17b44c0f3b4f743845ef Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:21:41 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:21:41 +0000 Subject: sandbox[master]: t5-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/368 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic62be68abbf1cc74911ab686ae5fdac3b424232b Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:23:01 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:23:01 +0000 Subject: [ABANDON] sandbox[master]: t5-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t5-2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/368 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic62be68abbf1cc74911ab686ae5fdac3b424232b Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:23:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:23:04 +0000 Subject: [ABANDON] sandbox[master]: t5-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t5-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I81e935f76ce8b4246e3c17b44c0f3b4f743845ef Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:24:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:24:09 +0000 Subject: [PATCH] sandbox[master]: t6-1 Message-ID: Review at https://gerrit.osmocom.org/369 t6-1 Change-Id: I936d3cbaf2503d00e60db0113e618468e754c75e --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/69/369/1 diff --git a/x b/x index b11ea2c..1e8d6ec 100644 --- a/x +++ b/x @@ -11,3 +11,4 @@ 4 5 5 +6 -- To view, visit https://gerrit.osmocom.org/369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I936d3cbaf2503d00e60db0113e618468e754c75e Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:24:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:24:10 +0000 Subject: [PATCH] sandbox[master]: t6-2 Message-ID: Review at https://gerrit.osmocom.org/370 t6-2 Change-Id: Id39255645ed51e1a11c6d28b3f3552078a140aee --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/70/370/1 diff --git a/x b/x index 1e8d6ec..877c08f 100644 --- a/x +++ b/x @@ -12,3 +12,4 @@ 5 5 6 +6 -- To view, visit https://gerrit.osmocom.org/370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id39255645ed51e1a11c6d28b3f3552078a140aee Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:24:31 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:24:31 +0000 Subject: sandbox[master]: t6-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I936d3cbaf2503d00e60db0113e618468e754c75e Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:24:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:24:38 +0000 Subject: sandbox[master]: t6-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id39255645ed51e1a11c6d28b3f3552078a140aee Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:24:54 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:24:54 +0000 Subject: [MERGED] sandbox[master]: t6-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t6-2 ...................................................................... t6-2 Change-Id: Id39255645ed51e1a11c6d28b3f3552078a140aee --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 1e8d6ec..877c08f 100644 --- a/x +++ b/x @@ -12,3 +12,4 @@ 5 5 6 +6 -- To view, visit https://gerrit.osmocom.org/370 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id39255645ed51e1a11c6d28b3f3552078a140aee Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:24:55 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:24:55 +0000 Subject: [MERGED] sandbox[master]: t6-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t6-1 ...................................................................... t6-1 Change-Id: I936d3cbaf2503d00e60db0113e618468e754c75e --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index b11ea2c..1e8d6ec 100644 --- a/x +++ b/x @@ -11,3 +11,4 @@ 4 5 5 +6 -- To view, visit https://gerrit.osmocom.org/369 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I936d3cbaf2503d00e60db0113e618468e754c75e Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:25:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:25:59 +0000 Subject: [PATCH] sandbox[master]: t7-1 Message-ID: Review at https://gerrit.osmocom.org/371 t7-1 Change-Id: I56cb5810132733a3ddead1ce4c2bc235538d5041 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/71/371/1 diff --git a/x b/x index 877c08f..b5a3d6d 100644 --- a/x +++ b/x @@ -13,3 +13,4 @@ 5 6 6 +7 -- To view, visit https://gerrit.osmocom.org/371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56cb5810132733a3ddead1ce4c2bc235538d5041 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:25:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:25:59 +0000 Subject: [PATCH] sandbox[master]: t7-2 Message-ID: Review at https://gerrit.osmocom.org/372 t7-2 Change-Id: I6ca3d2ce958b16ce9da33c29edee5d9ea4dde685 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/72/372/1 diff --git a/x b/x index b5a3d6d..ad97e49 100644 --- a/x +++ b/x @@ -14,3 +14,4 @@ 6 6 7 +7 -- To view, visit https://gerrit.osmocom.org/372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ca3d2ce958b16ce9da33c29edee5d9ea4dde685 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:26:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:26:18 +0000 Subject: sandbox[master]: t7-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56cb5810132733a3ddead1ce4c2bc235538d5041 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:26:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:26:23 +0000 Subject: sandbox[master]: t7-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ca3d2ce958b16ce9da33c29edee5d9ea4dde685 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:39:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:39:21 +0000 Subject: [PATCH] sandbox[master]: t8 Message-ID: Review at https://gerrit.osmocom.org/373 t8 Change-Id: Id5eff5538da67aaf43b50c47e19c542500694fad --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/73/373/1 diff --git a/x b/x index ad97e49..559e5c9 100644 --- a/x +++ b/x @@ -15,3 +15,4 @@ 6 7 7 +8 -- To view, visit https://gerrit.osmocom.org/373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5eff5538da67aaf43b50c47e19c542500694fad Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:39:22 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:39:22 +0000 Subject: [PATCH] sandbox[master]: t8-2 Message-ID: Review at https://gerrit.osmocom.org/374 t8-2 Change-Id: Idaa332f1f1c411a108b2a5f8ab4f0b4963d01512 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/74/374/1 diff --git a/x b/x index 559e5c9..082f573 100644 --- a/x +++ b/x @@ -16,3 +16,4 @@ 7 7 8 +8 -- To view, visit https://gerrit.osmocom.org/374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaa332f1f1c411a108b2a5f8ab4f0b4963d01512 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:39:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:39:52 +0000 Subject: sandbox[master]: t8 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5eff5538da67aaf43b50c47e19c542500694fad Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:39:57 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:39:57 +0000 Subject: sandbox[master]: t8-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idaa332f1f1c411a108b2a5f8ab4f0b4963d01512 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:40:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:40:38 +0000 Subject: [MERGED] sandbox[master]: t8-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t8-2 ...................................................................... t8-2 Change-Id: Idaa332f1f1c411a108b2a5f8ab4f0b4963d01512 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 559e5c9..082f573 100644 --- a/x +++ b/x @@ -16,3 +16,4 @@ 7 7 8 +8 -- To view, visit https://gerrit.osmocom.org/374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaa332f1f1c411a108b2a5f8ab4f0b4963d01512 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:40:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:40:38 +0000 Subject: [MERGED] sandbox[master]: t8 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t8 ...................................................................... t8 Change-Id: Id5eff5538da67aaf43b50c47e19c542500694fad --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index ad97e49..559e5c9 100644 --- a/x +++ b/x @@ -15,3 +15,4 @@ 6 7 7 +8 -- To view, visit https://gerrit.osmocom.org/373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5eff5538da67aaf43b50c47e19c542500694fad Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:48:15 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:48:15 +0000 Subject: [PATCH] sandbox[master]: t9-1 Message-ID: Review at https://gerrit.osmocom.org/375 t9-1 Change-Id: I2fbdca2418a43879f3e5fb789f1296322c1899e1 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/75/375/1 diff --git a/x b/x index 082f573..609058f 100644 --- a/x +++ b/x @@ -17,3 +17,4 @@ 7 8 8 +9 -- To view, visit https://gerrit.osmocom.org/375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fbdca2418a43879f3e5fb789f1296322c1899e1 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:48:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:48:16 +0000 Subject: [PATCH] sandbox[master]: t9-2 Message-ID: Review at https://gerrit.osmocom.org/376 t9-2 Change-Id: I2f3a0e3230cf63c1e28e0624a1e58e2ffa3b3c08 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/76/376/1 diff --git a/x b/x index 609058f..cf8ff2a 100644 --- a/x +++ b/x @@ -18,3 +18,4 @@ 8 8 9 +9 -- To view, visit https://gerrit.osmocom.org/376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f3a0e3230cf63c1e28e0624a1e58e2ffa3b3c08 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:48:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:48:30 +0000 Subject: sandbox[master]: t9-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fbdca2418a43879f3e5fb789f1296322c1899e1 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:48:34 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:48:34 +0000 Subject: sandbox[master]: t9-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2f3a0e3230cf63c1e28e0624a1e58e2ffa3b3c08 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:48:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:48:49 +0000 Subject: [MERGED] sandbox[master]: t9-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t9-2 ...................................................................... t9-2 Change-Id: I2f3a0e3230cf63c1e28e0624a1e58e2ffa3b3c08 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 609058f..cf8ff2a 100644 --- a/x +++ b/x @@ -18,3 +18,4 @@ 8 8 9 +9 -- To view, visit https://gerrit.osmocom.org/376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f3a0e3230cf63c1e28e0624a1e58e2ffa3b3c08 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:48:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:48:49 +0000 Subject: [MERGED] sandbox[master]: t9-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t9-1 ...................................................................... t9-1 Change-Id: I2fbdca2418a43879f3e5fb789f1296322c1899e1 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 082f573..609058f 100644 --- a/x +++ b/x @@ -17,3 +17,4 @@ 7 8 8 +9 -- To view, visit https://gerrit.osmocom.org/375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fbdca2418a43879f3e5fb789f1296322c1899e1 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:49:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:49:53 +0000 Subject: [PATCH] sandbox[master]: t10-1 Message-ID: Review at https://gerrit.osmocom.org/377 t10-1 Change-Id: Ifab6253a5c306b5418f3341fa563f1981159eaab --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/77/377/1 diff --git a/x b/x index cf8ff2a..fd4a44e 100644 --- a/x +++ b/x @@ -19,3 +19,4 @@ 8 9 9 +10 -- To view, visit https://gerrit.osmocom.org/377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifab6253a5c306b5418f3341fa563f1981159eaab Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:49:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:49:53 +0000 Subject: [PATCH] sandbox[master]: t10-2 Message-ID: Review at https://gerrit.osmocom.org/378 t10-2 Change-Id: Ib586700b769428a7097c682087d2fadef0dd1ae8 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/78/378/1 diff --git a/x b/x index fd4a44e..ef17172 100644 --- a/x +++ b/x @@ -20,3 +20,4 @@ 9 9 10 +10 -- To view, visit https://gerrit.osmocom.org/378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib586700b769428a7097c682087d2fadef0dd1ae8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:50:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:50:13 +0000 Subject: sandbox[master]: t10-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifab6253a5c306b5418f3341fa563f1981159eaab Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 17:50:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 17:50:17 +0000 Subject: sandbox[master]: t10-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib586700b769428a7097c682087d2fadef0dd1ae8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:06:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:06:00 +0000 Subject: [ABANDON] sandbox[master]: t10-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t10-2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ib586700b769428a7097c682087d2fadef0dd1ae8 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:06:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:06:03 +0000 Subject: [ABANDON] sandbox[master]: t10-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t10-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ifab6253a5c306b5418f3341fa563f1981159eaab Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:06:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:06:09 +0000 Subject: [ABANDON] sandbox[master]: t7-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t7-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/371 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I56cb5810132733a3ddead1ce4c2bc235538d5041 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:06:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:06:12 +0000 Subject: [ABANDON] sandbox[master]: t7-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t7-2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/372 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6ca3d2ce958b16ce9da33c29edee5d9ea4dde685 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:06:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:06:52 +0000 Subject: [PATCH] sandbox[master]: t11-1 Message-ID: Review at https://gerrit.osmocom.org/379 t11-1 Change-Id: I78d4df67b49df1f0e8e24ee203890657ed2b8060 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/79/379/1 diff --git a/x b/x index ef17172..e0cca43 100644 --- a/x +++ b/x @@ -21,3 +21,4 @@ 9 10 10 +11 -- To view, visit https://gerrit.osmocom.org/379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78d4df67b49df1f0e8e24ee203890657ed2b8060 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:06:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:06:53 +0000 Subject: [PATCH] sandbox[master]: t11-2 Message-ID: Review at https://gerrit.osmocom.org/380 t11-2 Change-Id: Id9f25cceb21ed965a2d3ca72fa9579f77455fc68 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/80/380/1 diff --git a/x b/x index e0cca43..b8d11c8 100644 --- a/x +++ b/x @@ -22,3 +22,4 @@ 10 10 11 +11 -- To view, visit https://gerrit.osmocom.org/380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9f25cceb21ed965a2d3ca72fa9579f77455fc68 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:21:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:21:49 +0000 Subject: [ABANDON] sandbox[master]: t11-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t11-2 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id9f25cceb21ed965a2d3ca72fa9579f77455fc68 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:21:54 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:21:54 +0000 Subject: [ABANDON] sandbox[master]: t11-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t11-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I78d4df67b49df1f0e8e24ee203890657ed2b8060 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:39:31 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:39:31 +0000 Subject: [PATCH] sandbox[master]: t12-1 Message-ID: Review at https://gerrit.osmocom.org/381 t12-1 Change-Id: Ife61155e010df3261f689e3deae3dec204855cbe --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/81/381/1 diff --git a/x b/x index ef17172..77cb673 100644 --- a/x +++ b/x @@ -21,3 +21,4 @@ 9 10 10 +12 -- To view, visit https://gerrit.osmocom.org/381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife61155e010df3261f689e3deae3dec204855cbe Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:39:31 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:39:31 +0000 Subject: [PATCH] sandbox[master]: t12-1 Message-ID: Review at https://gerrit.osmocom.org/382 t12-1 Change-Id: I6e2cdd8baf94b5f346cfcfcee1a81c816fb3bc4f --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/82/382/1 diff --git a/x b/x index 77cb673..2fa912a 100644 --- a/x +++ b/x @@ -22,3 +22,4 @@ 10 10 12 +12 -- To view, visit https://gerrit.osmocom.org/382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e2cdd8baf94b5f346cfcfcee1a81c816fb3bc4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:39:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:39:48 +0000 Subject: sandbox[master]: t12-1 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e2cdd8baf94b5f346cfcfcee1a81c816fb3bc4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:40:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:40:06 +0000 Subject: [ABANDON] sandbox[master]: t12-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t12-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/382 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6e2cdd8baf94b5f346cfcfcee1a81c816fb3bc4f Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:40:08 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:40:08 +0000 Subject: [ABANDON] sandbox[master]: t12-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t12-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ife61155e010df3261f689e3deae3dec204855cbe Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:40:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:40:36 +0000 Subject: [PATCH] sandbox[master]: t13-1 Message-ID: Review at https://gerrit.osmocom.org/383 t13-1 Change-Id: I5f61ba02446597999152c6c39b7ebd78b9ff3373 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/83/383/1 diff --git a/x b/x index ef17172..7e6c0c1 100644 --- a/x +++ b/x @@ -21,3 +21,4 @@ 9 10 10 +13 -- To view, visit https://gerrit.osmocom.org/383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f61ba02446597999152c6c39b7ebd78b9ff3373 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:40:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:40:36 +0000 Subject: [PATCH] sandbox[master]: t13-2 Message-ID: Review at https://gerrit.osmocom.org/384 t13-2 Change-Id: Idcb202aa96b6454b0dcdb5df990c42326661a71d --- M a 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/84/384/1 diff --git a/a b/a index 7898192..85a636d 100644 --- a/a +++ b/a @@ -1 +1,2 @@ a +13 -- To view, visit https://gerrit.osmocom.org/384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcb202aa96b6454b0dcdb5df990c42326661a71d Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:40:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:40:46 +0000 Subject: sandbox[master]: t13-2 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcb202aa96b6454b0dcdb5df990c42326661a71d Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:41:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:41:07 +0000 Subject: sandbox[master]: t13-2 In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcb202aa96b6454b0dcdb5df990c42326661a71d Gerrit-PatchSet: 2 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:41:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:41:11 +0000 Subject: [MERGED] sandbox[master]: t13-2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: t13-2 ...................................................................... t13-2 Change-Id: Idcb202aa96b6454b0dcdb5df990c42326661a71d --- M a 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/a b/a index 7898192..85a636d 100644 --- a/a +++ b/a @@ -1 +1,2 @@ a +13 -- To view, visit https://gerrit.osmocom.org/384 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idcb202aa96b6454b0dcdb5df990c42326661a71d Gerrit-PatchSet: 2 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:41:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:41:27 +0000 Subject: [ABANDON] sandbox[master]: t13-1 In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: t13-1 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/383 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5f61ba02446597999152c6c39b7ebd78b9ff3373 Gerrit-PatchSet: 1 Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 20 18:53:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 20 Jun 2016 18:53:18 +0000 Subject: openbsc[master]: Remove unused auth code and add comment In-Reply-To: References: Message-ID: Patch Set 1: > > > And gsm48_rx_mm_auth_resp will call the CB GSM_SECURITY_AUTH_FAILED? > > > > This is actually a slightly old commit I still found in my queue. > > It seems I overlooked the gsm48_rx_mm_auth_resp() case, so you're > > completely right and _AUTH_FAILED is indeed invoked. > > > > So we should handle the _AUTH_FAILED properly, and it's not > > exclusive to 3G. > > > > So then this question remains: On auth failure, do we reply with > a > > LU reject, or do we just close down the connection? (The current > > code just terminates the connection without a LU reject.) > > > > (And 3G would then behave the same as 2G) > > Beware that all of this code dealing with authentication and LU > will be replaced with the libvlr anyway, so it might not make sense > to spend time on improvements now; rathe they might introduce mere > conflicts. Yes, I'm aware; the point was that the commit is/was related to IuCS developments ... I found it good to discuss. The IuCS auth will be in presumably heavy conflict with (i.e. be completely replaced by) the VLR changes in auth ... So there will be conflicts either way :) You're right though that it makes sense to adjust IuCS to VLR and not the other way round. -- To view, visit https://gerrit.osmocom.org/331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 20 19:28:27 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 20 Jun 2016 19:28:27 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 4: (2 comments) https://gerrit.osmocom.org/#/c/326/4/src/bits.c File src/bits.c: Line 73: if (!num_whole_bytes) Cool! bugfix or optimization? https://gerrit.osmocom.org/#/c/326/4/tests/bits/bitrev_test.c File tests/bits/bitrev_test.c: Line 208: static void sh_chk(const uint8_t *in, uint8_t len, unsigned int nib, bool r) why move from size_t to uint8_t? -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 21 07:48:59 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 21 Jun 2016 07:48:59 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 4: Bugfix for tests on 64bit platforms - see previous failures from jenkins. As for size_t - got to fix compilation warning: either this or printf specifier and uint8_t is enough for all the tests we use anyway. -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 21 09:40:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 21 Jun 2016 09:40:21 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 4: > On a 2nd thought, if we have not made "authorize regexp" change > part of any release yet, than I can drop regexp keyword, switch it > on by default with regexp '*' for backward compatibility and > simplify this patch quite a bit. What do you think? fine with me -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 21 10:31:50 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 21 Jun 2016 10:31:50 +0000 Subject: osmo-pcu[master]: Add data structure for ARQ-II in EGPRS DL In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/332/1/src/gprs_coding_scheme.cpp File src/gprs_coding_scheme.cpp: Line 26: * In has 3 level indexing. 0th level is ARQ type > It instead of In? I will modify the line. Line 33: /* TODO: Need to support ARQ type 1 */ > There will be more than two dimensions in that array? What is missing? What It is already 3 dimensional array. There is nothing missing. 0th level of indexing already has 2 sub-indexing. 0th sub indexing is required to handle SPB for EGPRS DL and 1st level sub-indexing is required to support ARQ2. For this patch series only 1st sub level indexing is supported and tested. SPB will be released after this patch series gets merged to master. https://gerrit.osmocom.org/#/c/332/1/src/rlc.h File src/rlc.h: Line 130: GprsCodingScheme cs_current_trans; > I would prefer to cs and cs_current_trans being private here. The cs_current_trans is made public to align with existing variables like block[RLC_MAX_LEN], len and others to have consistency. will it make sense to have cs and cs_current_trans as private?. We can rename cs to cs_last as suggested in review of other patch. But it will have modification in other source files related to UL TBF and DL TBF to address compilation errors. In that case the meaning of this patch will be lost and will not be restricted to only EGPRS DL ARQ2 support. Please comment. -- To view, visit https://gerrit.osmocom.org/332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 21 10:33:06 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 21 Jun 2016 10:33:06 +0000 Subject: osmo-pcu[master]: Add Accessor functions for ARQ-II in EGPRS DL In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/333/1/src/gprs_coding_scheme.h File src/gprs_coding_scheme.h: Line 73: bool operator == (Scheme s); > bool operator == (Scheme s) const? I will modify the line. Line 116: const GprsCodingScheme &retx_mcs); > see Jacob's previous commit. mcs and retx_mcs will fill a register and it m I will modify the line. -- To view, visit https://gerrit.osmocom.org/333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iefff956bf2dcfe8fb0b2f5a7a7a2122d5d555f9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 21 10:33:47 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 21 Jun 2016 10:33:47 +0000 Subject: osmo-pcu[master]: Modify DL tbf flow for ARQ-II in EGPRS DL Retx In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/334/1/src/tbf_dl.cpp File src/tbf_dl.cpp: Line 389: /* TODO: Need to remove this check when MCS-8 -> MCS-6 > Maybe a single sentence of what is involved in that case? Since there is an already known issue with 6 octets padding the MCS8->MCS6 transition is prevented. Please see the commit be881c028fc4da00c4046ecd9296727975c206a3 dated 2016-02-07 23:45:40 (UTC) -- To view, visit https://gerrit.osmocom.org/334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a845c98f2018795f0f62240f228411b0bc030c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 21 10:34:06 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 21 Jun 2016 10:34:06 +0000 Subject: osmo-pcu[master]: Add test cases to support ARQ-II for EGPRS DL Retx In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/335/1/tests/tbf/TbfTest.cpp File tests/tbf/TbfTest.cpp: Line 1347: /* TODO: Need to support of MCS8 -> MCS6 transistion */ > Can you add to the comment what would be needed for MCS8->MCS6? I will add more comments. Line 1368: ((GprsCodingScheme::Scheme)(GprsCodingScheme::CS4 + > Which constructor is attempted to be picked here? What is the compile error There is no constructor attempted here. Below is the error we receive without C cast. tbf/TbfTest.cpp: In function ?void establish_and_use_egprs_dl_tbf_for_retx(BTS*, int, int)?: tbf/TbfTest.cpp:1369:18: error: invalid conversion from ?int? to ?GprsCodingScheme::Scheme? [-fpermissive] ../src/gprs_ms.h:89:7: error: initializing argument 1 of ?void GprsMs::set_current_cs_dl(GprsCodingScheme::Scheme)? [-fpermissive] make[1]: *** [TbfTest.o] Error 1 -- To view, visit https://gerrit.osmocom.org/335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia357acfe30f4dea95e00749916c6818354f93285 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jun 21 13:25:48 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 21 Jun 2016 13:25:48 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/201 to look at the new patch set (#5). Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Fixes: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 11 files changed, 137 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/5 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ad..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e7cd520..bdcd0e0 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -20,12 +21,6 @@ struct gsm_subscriber_group; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] - -enum gsm_subscr_creation_mode { - GSM_SUBSCR_DONT_CREATE = 0, - GSM_SUBSCR_CREAT_W_RAND_EXT = 1, - GSM_SUBSCR_CREAT_W_REGEXP = 2, -}; enum gsm_security_event { GSM_SECURITY_NOAVAIL, @@ -289,7 +284,8 @@ struct osmo_bsc_data *bsc_data; /* subscriber related features */ - int subscr_creation_mode; + bool auto_create_subscr; + bool auto_assign_exten; uint64_t ext_min; uint64_t ext_max; struct gsm_subscriber_group *subscr_group; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 3cba5d1..3d7c244 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -5,6 +5,8 @@ #include #include +#include + #define GSM_NAME_LENGTH 160 #define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */ @@ -90,8 +92,7 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax); + const char *imsi); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4636d57..0e99097 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -21,10 +21,13 @@ #include #include +#include + struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code, int (*mncc_recv)(struct gsm_network *, struct msgb *)) { struct gsm_network *net; + const char *default_regexp = "*"; net = talloc_zero(tall_bsc_ctx, struct gsm_network); if (!net) @@ -42,13 +45,18 @@ return NULL; } + if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, + &default_regexp) != 0) + return NULL; + /* Init back pointer */ net->bsc_data->auto_off_timeout = -1; net->bsc_data->network = net; INIT_LLIST_HEAD(&net->bsc_data->mscs); net->subscr_group->net = net; - net->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + net->auto_create_subscr = true; + net->auto_assign_exten = true; net->country_code = country_code; net->network_code = network_code; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index a02db36..79e136d 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -25,6 +25,8 @@ #include #include +#include + static bool alg_supported(const char *alg) { /* @@ -96,9 +98,7 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi, - net->ext_min, - net->ext_max); + subscr = subscr_create_subscriber(net->subscr_group, imsi); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index b367139..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ } struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -551,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr, smin, smax); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -956,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1062,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..1b02efe 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -530,15 +530,13 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { - if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) + if (!net->auto_create_subscr) return NULL; - if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP) - if (!subscr_regexp_check(net, imsi)) - return NULL; + if (!subscr_regexp_check(net, imsi)) + return NULL; - return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + return subscr_create_subscriber(net->subscr_group, imsi); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1dc2cc2..08198c7 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -203,10 +204,12 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax) + const char *imsi) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, + sgrp->net->ext_min, + sgrp->net->ext_max, + sgrp->net->auto_assign_exten); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index a035bf9..b722194 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -242,9 +242,7 @@ if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], - gsmnet->ext_min, - gsmnet->ext_max); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1044,6 +1042,8 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = true; if (mi >= ma) { vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", argv[0], argv[1], VTY_NEWLINE); @@ -1055,15 +1055,13 @@ } DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, - "subscriber-create-on-demand [regexp]", + "subscriber-create-on-demand [no-extension]", "Make a new record when a subscriber is first seen.\n" - "Create subscribers only if IMSI matches the regexp specified in " - "authorized-regexp command\n") + "Do not automatically assign extension to created subscribers\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; - if (argc) - gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = (argc > 1) ? false : true; return CMD_SUCCESS; } @@ -1072,7 +1070,7 @@ NO_STR "Make a new record when a subscriber is first seen.\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_DONT_CREATE; + gsmnet->auto_create_subscr = false; return CMD_SUCCESS; } @@ -1097,12 +1095,15 @@ static int config_write_nitb(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - enum gsm_subscr_creation_mode scm = gsmnet->subscr_creation_mode; - const char *reg = (scm & GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", - *pref = scm ? "" : "no "; + vty_out(vty, "nitb%s", VTY_NEWLINE); - vty_out(vty, " %ssubscriber-create-on-demand%s%s", - pref, reg, VTY_NEWLINE); + if (!gsmnet->auto_create_subscr) + vty_out(vty, " no subscriber-create-on-demand%s", VTY_NEWLINE); + else + vty_out(vty, " subscriber-create-on-demand%s%s", + gsmnet->auto_assign_exten ? "" : " no-extension", + VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index dc81481..755a6e9 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *imsi, char *imei1, char *imei2, bool make_ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + make_ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -177,7 +179,7 @@ COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by IMSI */ - alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice_imsi); + alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by id */ @@ -187,8 +189,14 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + if (!make_ext) + printf("FAIL: bogus extension created for IMSI %s\n", + imsi); + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } else if (make_ext) + printf("FAIL: no subscriber extension for IMSI %s\n", imsi); SUBSCR_PUT(alice); } @@ -217,18 +225,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..b172a60 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -244,7 +244,7 @@ self.vty.command("configure terminal") self.vty.command("nitb") self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) - self.assertTrue(self.vty.verify("subscriber-create-on-demand regexp", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand no-extension", [''])) self.vty.command("end") def testSi2Q(self): @@ -400,6 +400,9 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "204301824913762" + imsi3 = "100500854113763" + imsi4 = "100583744053764" # Initially we don't have this subscriber self.vty.verify('show subscriber imsi '+imsi, ['% No subscriber found for imsi '+imsi]) @@ -407,14 +410,60 @@ # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) # Now we have it res = self.vty.command('show subscriber imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand no-extension", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber delete imsi '+imsi) self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi2) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi3) + self.assert_(res != "") + res = self.vty.command('subscriber delete imsi ' + imsi4) + self.assert_(res != "") # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 21 14:42:49 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 14:42:49 +0000 Subject: [PATCH] osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm Message-ID: Review at https://gerrit.osmocom.org/385 fix lc15 build: put src/common/libbts.a left of -losmogsm When switching to the gsm_chan_t_names string list from libosmogsm, libosmogsm actually became a dependency of the local libbts.a. Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b --- M src/osmo-bts-litecell15/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/85/385/1 diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 768e29d..3026e96 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -27,7 +27,7 @@ misc/lc15bts_mgr_temp.c \ misc/lc15bts_mgr_calib.c -lc15bts_mgr_LDADD = $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(top_builddir)/src/common/libbts.a +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 15:37:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 21 Jun 2016 15:37:53 +0000 Subject: osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm In-Reply-To: References: Message-ID: Patch Set 1: Could you add commit id when the transition which broke the build happened? -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:40:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:40:58 +0000 Subject: [PATCH] openbsc[master]: vty: show lchan summary: also show lchan->state Message-ID: Review at https://gerrit.osmocom.org/386 vty: show lchan summary: also show lchan->state Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/86/386/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 578b005..04f2cc6 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1120,10 +1120,13 @@ lchan->meas_rep_idx, 1); mr = &lchan->meas_rep[idx]; - vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u, Type %s - " + vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s, Lchan %u, Type %s, State %s - " "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - lchan->nr, gsm_lchant_name(lchan->type), mr->ms_l1.pwr, + gsm_pchan_name(lchan->ts->pchan), + lchan->nr, + gsm_lchant_name(lchan->type), gsm_lchans_name(lchan->state), + mr->ms_l1.pwr, rxlev2dbm(mr->dl.full.rx_lev), rxlev2dbm(mr->ul.full.rx_lev), VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:42:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:42:00 +0000 Subject: [PATCH] openbsc[master]: debug log: log all lchan_alloc steps Message-ID: Review at https://gerrit.osmocom.org/387 debug log: log all lchan_alloc steps Change-Id: Ib2d11744d92dc06205fb1573815e11efd84842b0 --- M openbsc/src/libbsc/chan_alloc.c 1 file changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/87/387/1 diff --git a/openbsc/src/libbsc/chan_alloc.c b/openbsc/src/libbsc/chan_alloc.c index f4ed530..8e06c65 100644 --- a/openbsc/src/libbsc/chan_alloc.c +++ b/openbsc/src/libbsc/chan_alloc.c @@ -39,8 +39,11 @@ { /* FIXME: How does this behave for BS-11 ? */ if (is_ipaccess_bts(ts->trx->bts)) { - if (!nm_is_running(&ts->mo.nm_state)) + if (!nm_is_running(&ts->mo.nm_state)) { + DEBUGP(DRLL, "BTS %u TRX %u TS %u: not usable\n", + ts->trx->bts->nr, ts->trx->nr, ts->nr); return 0; + } } /* If a dyn PDCH channel is busy changing, it is already taken or not @@ -152,6 +155,7 @@ struct gsm_lchan *lchan = NULL; enum gsm_phys_chan_config first, first_cbch, second, second_cbch; + DEBUGP(DRLL, "Looking for lchan %s\n", gsm_lchant_name(type)); switch (type) { case GSM_LCHAN_SDCCH: if (bts->chan_alloc_reverse) { @@ -199,11 +203,15 @@ break; case GSM_LCHAN_TCH_F: lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); + if (!lchan) + DEBUGP(DRLL, "No pure TCH/F available\n"); /* If we don't have TCH/F available, fall-back to TCH/H */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H); if (lchan) type = GSM_LCHAN_TCH_H; + else + DEBUGP(DRLL, "No TCH/H available\n"); } /* If we don't have TCH/H either, try dynamic TCH/F_PDCH */ if (!lchan) { @@ -212,21 +220,29 @@ * set to GSM_LCHAN_TCH_F, but for clarity's sake... */ if (lchan) type = GSM_LCHAN_TCH_F; + else + DEBUGP(DRLL, "No TCH/F_PDCH available\n"); } break; case GSM_LCHAN_TCH_H: lchan =_lc_find_bts(bts, GSM_PCHAN_TCH_H); + if (!lchan) + DEBUGP(DRLL, "No pure TCH/H available\n"); /* If we don't have TCH/H available, fall-back to TCH/F */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F); if (lchan) type = GSM_LCHAN_TCH_F; + else + DEBUGP(DRLL, "No TCH/F available\n"); } /* If we don't have TCH/F either, try dynamic TCH/F_PDCH */ if (!lchan) { lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F_PDCH); if (lchan) type = GSM_LCHAN_TCH_F; + else + DEBUGP(DRLL, "No TCH/F_PDCH available\n"); } break; default: @@ -235,6 +251,11 @@ if (lchan) { lchan->type = type; + DEBUGP(DRLL, "For %s, found BTS %u TRX %u TS %u %s\n", + gsm_lchant_name(type), + lchan->ts->trx->bts->nr, lchan->ts->trx->nr, + lchan->ts->nr, + gsm_pchan_name(lchan->ts->pchan)); /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); @@ -248,6 +269,7 @@ sig.bts = bts; sig.type = type; osmo_signal_dispatch(SS_CHALLOC, S_CHALLOC_ALLOC_FAIL, &sig); + DEBUGP(DRLL, "Not available: %s\n", gsm_lchant_name(type)); } return lchan; -- To view, visit https://gerrit.osmocom.org/387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2d11744d92dc06205fb1573815e11efd84842b0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:42:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:42:00 +0000 Subject: [PATCH] openbsc[master]: debug log: log all lchan state transitions Message-ID: Review at https://gerrit.osmocom.org/388 debug log: log all lchan state transitions Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/88/388/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index fc56862..f600c6c 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -948,6 +948,9 @@ int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) { + DEBUGP(DRSL, "%s state %s -> %s\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), + gsm_lchans_name(state)); lchan->state = state; return 0; } -- To view, visit https://gerrit.osmocom.org/388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:42:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:42:58 +0000 Subject: [PATCH] openbsc[master]: err log: tweak dyn pdch ack error logging Message-ID: Review at https://gerrit.osmocom.org/389 err log: tweak dyn pdch ack error logging Rather use gsm_lchan_name(). Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/89/389/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index fc56862..153da82 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1215,18 +1215,18 @@ OSMO_ASSERT(ts->trx->bts); if (lchan->ts->pchan != GSM_PCHAN_TCH_F_PDCH) { - LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" - " Rx PDCH %s ACK for channel that is no TCH/F_PDCH\n", - ts->trx->bts->nr, ts->trx->nr, ts->nr, + LOGP(DRSL, LOGL_ERROR, "%s pchan=%s Rx PDCH %s ACK" + " for channel that is no TCH/F_PDCH\n", + gsm_lchan_name(lchan), gsm_pchan_name(ts->pchan), pdch_act? "ACT" : "DEACT"); return false; } if (lchan->state != LCHAN_S_NONE) { - LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" - " Rx PDCH %s ACK in unexpected state: %s\n", - ts->trx->bts->nr, ts->trx->nr, ts->nr, + LOGP(DRSL, LOGL_ERROR, "%s pchan=%s Rx PDCH %s ACK" + " in unexpected state: %s\n", + gsm_lchan_name(lchan), gsm_pchan_name(ts->pchan), pdch_act? "ACT" : "DEACT", gsm_lchans_name(lchan->state)); -- To view, visit https://gerrit.osmocom.org/389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:43:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:43:25 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: enable PDCH only after release due to error Message-ID: Review at https://gerrit.osmocom.org/390 dyn PDCH: enable PDCH only after release due to error In rsl_rx_rf_chan_rel_ack(), only activate PDCH when in NONE state. For the case of REL_ERR state, do the PDCH activation in the error timeout callback after T3111 is done. Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/90/390/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index fc56862..db78fe3 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -644,6 +644,10 @@ /* go back to the none state */ LOGP(DRSL, LOGL_INFO, "%s is back in operation.\n", gsm_lchan_name(lchan)); rsl_lchan_set_state(lchan, LCHAN_S_NONE); + + /* Put PDCH channel back into PDCH mode */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + rsl_ipacc_pdch_activate(lchan->ts, 1); } static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan); @@ -761,7 +765,8 @@ do_lchan_free(lchan); /* Put PDCH channel back into PDCH mode first */ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH + && lchan->state == LCHAN_S_NONE) return rsl_ipacc_pdch_activate(lchan->ts, 1); return 0; -- To view, visit https://gerrit.osmocom.org/390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:59:12 +0000 Subject: [PATCH] osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/385 to look at the new patch set (#2). fix lc15 build: put src/common/libbts.a left of -losmogsm When switching to the gsm_chan_t_names string list from libosmogsm, libosmogsm actually became a dependency of the local libbts.a. The breaking change is in openbsc.git 29048b2a80b5865ffc41fa4401113c5826227e23 and came in here because gsm_data_shared.h is included from openbsc. Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b --- M src/osmo-bts-litecell15/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/85/385/2 diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 768e29d..3026e96 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -27,7 +27,7 @@ misc/lc15bts_mgr_temp.c \ misc/lc15bts_mgr_calib.c -lc15bts_mgr_LDADD = $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(top_builddir)/src/common/libbts.a +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:59:12 +0000 Subject: [PATCH] osmo-bts[master]: lc15: add L3 handle to l1prim messages Message-ID: Review at https://gerrit.osmocom.org/392 lc15: add L3 handle to l1prim messages Analogous to 7158c2ed082eaca6063a501e490e8d3c3b181560 in osmo-bts-sysmo. Place a layer 3 handle into GSM L1 messages to better match up confirmations to respective requests. This handle is a uint32_t transparently returned in the confirmation messages, so a match-up is easy to add. So far, a GSM L1 confirmation message received for a preceding L1 Request was matched only by the prim_id. That meant that only one instance of the same primitive could be waiting for a confirmation at any given time, or the responses would get mixed up: the struct wait_l1_conf instances entered into the fl1h->wlc_list queue would be returned to a possibly mismatching confirmation handler. (Seen during testing of dyn pdch switching.) Send the hLayer3 handle out via prim_init(), using new static functions to produce handles on different scopes: * l1p_handle_for_trx() * l1p_handle_for_ts() * l1p_handle_for_lchan() (These could possibly move to a more general .h/.c file later.) Remember the hLayer3 handle in * struct wait_l1_conf. Match the incoming confirmations' and stored hLayer3 handles up in, and remove a now obsolete comment from: * is_prim_compat() Since the hLayer3 members are at different byte offsets in GsmL1_Prim_t.u.*, use large switch statements to set/get the value: * In prim_init(), extend existing switch statement to set in GsmL1_Prim_t. * Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a more general .h/.c file later). Note that some messages are already using the hLayer3 handle, and will overwrite it after calling prim_init(), so those are not affected. Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/oml.c 2 files changed, 127 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/92/392/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 6d4fc55..d823e31 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -73,6 +73,7 @@ struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ unsigned int conf_prim_id; /* primitive we expect in response */ + HANDLE conf_hLayer3; /* layer 3 handle we expect in response */ unsigned int is_sys_prim; /* is this a system (1) or L1 (0) primitive */ l1if_compl_cb *cb; void *cb_data; @@ -95,6 +96,57 @@ LOGP(DL1C, LOGL_FATAL, "Timeout waiting for L1 primitive %s\n", get_value_string(lc15bts_l1prim_names, wlc->conf_prim_id)); exit(23); +} + +static HANDLE l1p_get_hLayer3(GsmL1_Prim_t *prim) +{ + switch (prim->id) { + case GsmL1_PrimId_MphInitReq: + return prim->u.mphInitReq.hLayer3; + case GsmL1_PrimId_MphCloseReq: + return prim->u.mphCloseReq.hLayer3; + case GsmL1_PrimId_MphConnectReq: + return prim->u.mphConnectReq.hLayer3; + case GsmL1_PrimId_MphDisconnectReq: + return prim->u.mphDisconnectReq.hLayer3; + case GsmL1_PrimId_MphActivateReq: + return prim->u.mphActivateReq.hLayer3; + case GsmL1_PrimId_MphDeactivateReq: + return prim->u.mphDeactivateReq.hLayer3; + case GsmL1_PrimId_MphConfigReq: + return prim->u.mphConfigReq.hLayer3; + case GsmL1_PrimId_MphMeasureReq: + return prim->u.mphMeasureReq.hLayer3; + case GsmL1_PrimId_MphInitCnf: + return prim->u.mphInitCnf.hLayer3; + case GsmL1_PrimId_MphCloseCnf: + return prim->u.mphCloseCnf.hLayer3; + case GsmL1_PrimId_MphConnectCnf: + return prim->u.mphConnectCnf.hLayer3; + case GsmL1_PrimId_MphDisconnectCnf: + return prim->u.mphDisconnectCnf.hLayer3; + case GsmL1_PrimId_MphActivateCnf: + return prim->u.mphActivateCnf.hLayer3; + case GsmL1_PrimId_MphDeactivateCnf: + return prim->u.mphDeactivateCnf.hLayer3; + case GsmL1_PrimId_MphConfigCnf: + return prim->u.mphConfigCnf.hLayer3; + case GsmL1_PrimId_MphMeasureCnf: + return prim->u.mphMeasureCnf.hLayer3; + case GsmL1_PrimId_MphTimeInd: + case GsmL1_PrimId_MphSyncInd: + case GsmL1_PrimId_PhEmptyFrameReq: + case GsmL1_PrimId_PhDataReq: + case GsmL1_PrimId_PhConnectInd: + case GsmL1_PrimId_PhReadyToSendInd: + case GsmL1_PrimId_PhDataInd: + case GsmL1_PrimId_PhRaInd: + break; + default: + LOGP(DL1C, LOGL_ERROR, "unknown L1 primitive %u\n", prim->id); + break; + } + return 0; } static int _l1if_req_compl(struct lc15l1_hdl *fl1h, struct msgb *msg, @@ -124,6 +176,7 @@ } wlc->is_sys_prim = 0; wlc->conf_prim_id = lc15bts_get_l1prim_conf(l1p->id); + wlc->conf_hLayer3 = l1p_get_hLayer3(l1p); wqueue = &fl1h->write_q[MQ_L1_WRITE]; timeout_secs = 30; } else { @@ -949,12 +1002,12 @@ static inline int is_prim_compat(GsmL1_Prim_t *l1p, struct wait_l1_conf *wlc) { - /* the limitation here is that we cannot have multiple callers - * sending the same primitive */ if (wlc->is_sys_prim != 0) return 0; if (l1p->id != wlc->conf_prim_id) return 0; + if (l1p_get_hLayer3(l1p) != wlc->conf_hLayer3) + return 0; return 1; } diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index fa9f601..5b5a7a1 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -95,43 +95,71 @@ static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); -static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct lc15l1_hdl *gl1) +static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct lc15l1_hdl *gl1, + uint32_t hLayer3_uint32) { + HANDLE hLayer3; prim->id = id; + + osmo_static_assert(sizeof(HANDLE) >= 4, l1p_handle_is_at_least_32bit); + hLayer3 = (void*)hLayer3_uint32; switch (id) { case GsmL1_PrimId_MphInitReq: //prim->u.mphInitReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphInitReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphCloseReq: prim->u.mphCloseReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphCloseReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConnectReq: prim->u.mphConnectReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphConnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDisconnectReq: prim->u.mphDisconnectReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphDisconnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphActivateReq: prim->u.mphActivateReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphActivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDeactivateReq: prim->u.mphDeactivateReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphDeactivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConfigReq: prim->u.mphConfigReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphConfigReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphMeasureReq: prim->u.mphMeasureReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphMeasureReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphInitCnf: + prim->u.mphInitCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphCloseCnf: + prim->u.mphCloseCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConnectCnf: + prim->u.mphConnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDisconnectCnf: + prim->u.mphDisconnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphActivateCnf: + prim->u.mphActivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDeactivateCnf: + prim->u.mphDeactivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConfigCnf: + prim->u.mphConfigCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphMeasureCnf: + prim->u.mphMeasureCnf.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphTimeInd: break; @@ -156,6 +184,34 @@ break; } return &prim->u; +} + +static uint32_t l1p_handle_for_trx(struct gsm_bts_trx *trx) +{ + struct gsm_bts *bts = trx->bts; + + osmo_static_assert(sizeof(trx->nr) == 1, trx_nr_is_8bit); + osmo_static_assert(sizeof(bts->nr) == 1, bts_nr_is_8bit); + + return bts->nr << 24 + | trx->nr << 16; +} + +static uint32_t l1p_handle_for_ts(struct gsm_bts_trx_ts *ts) +{ + osmo_static_assert(sizeof(ts->nr) == 1, ts_nr_is_8bit); + + return l1p_handle_for_trx(ts->trx) + | ts->nr << 8; +} + + +static uint32_t l1p_handle_for_lchan(struct gsm_lchan *lchan) +{ + osmo_static_assert(sizeof(lchan->nr) == 1, lchan_nr_is_8bit); + + return l1p_handle_for_ts(lchan->ts) + | lchan->nr; } GsmL1_Status_t prim_status(GsmL1_Prim_t *prim) @@ -341,7 +397,8 @@ } msg = l1p_msgb_alloc(); - mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h); + mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h, + l1p_handle_for_trx(trx)); dev_par = &mi_req->deviceParam; dev_par->devType = GsmL1_DevType_TxdRxu; dev_par->freqBand = lc15_band; @@ -380,7 +437,8 @@ struct msgb *msg; msg = l1p_msgb_alloc(); - prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h); + prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h, + l1p_handle_for_trx(trx)); LOGP(DL1C, LOGL_NOTICE, "Close TRX %u\n", trx->nr); return l1if_gsm_req_compl(fl1h, msg, trx_close_compl_cb, NULL); @@ -425,7 +483,8 @@ struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx); GsmL1_MphConnectReq_t *cr; - cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, + l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; cr->logChComb = pchan_to_logChComb[ts->pchan]; @@ -906,7 +965,8 @@ GsmL1_MphActivateReq_t *act_req; GsmL1_LogChParam_t *lch_par; - act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, fl1h); + act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, + fl1h, l1p_handle_for_lchan(lchan)); lch_par = &act_req->logChPrm; act_req->u8Tn = lchan->ts->nr; act_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); @@ -1199,7 +1259,8 @@ /* channel mode, encryption and/or multirate have changed */ /* update multi-rate config */ - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); conf_req->cfgParamId = GsmL1_ConfigParamId_SetLogChParams; conf_req->cfgParams.setLogChParams.sapi = cmd->sapi; conf_req->cfgParams.setLogChParams.u8Tn = lchan->ts->nr; @@ -1252,7 +1313,7 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphConfigReq_t *conf_req; - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, 0); conf_req->cfgParamId = GsmL1_ConfigParamId_SetTxPowerLevel; conf_req->cfgParams.setTxPowerLevel.fTxPowerLevel = tx_power; @@ -1273,7 +1334,8 @@ struct msgb *msg = l1p_msgb_alloc(); struct GsmL1_MphConfigReq_t *cfgr; - cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); cfgr->cfgParamId = GsmL1_ConfigParamId_SetCipheringParams; cfgr->cfgParams.setCipheringParams.u8Tn = lchan->ts->nr; @@ -1420,7 +1482,8 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphDeactivateReq_t *deact_req; - deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, fl1h); + deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, + fl1h, l1p_handle_for_lchan(lchan)); deact_req->u8Tn = lchan->ts->nr; deact_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); deact_req->dir = cmd->dir; -- To view, visit https://gerrit.osmocom.org/392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:59:12 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH accordi... Message-ID: Review at https://gerrit.osmocom.org/393 dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags Analogous to 0d10f0e482cdd50acc916e75a8b3ba1beb94227c on osmo-bts-sysmo. According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/93/393/1 diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d823e31..395ee0d 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -615,11 +615,23 @@ return l1sap_up(trx, &l1sap); } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) + return ts->pchan; + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + switch (sapi) { case GsmL1_Sapi_Bcch: cbits = 0x10; @@ -728,7 +740,7 @@ uint32_t fn; /* check if primitive should be handled by common part */ - chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi, rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn); if (chan_nr) { fn = rts_ind->u32Fn; @@ -847,7 +859,7 @@ int rc = 0; int8_t rssi; - chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " -- To view, visit https://gerrit.osmocom.org/393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:59:12 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() ... Message-ID: Review at https://gerrit.osmocom.org/394 dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts Analogous to 294fbe104b9fb12f06f7cebe68a4b7a6ed28d5ef on osmo-bts-sysmo. For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH. Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave ts_connect() as a thin wrapper to leave init code unchanged. Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5 --- M src/osmo-bts-litecell15/oml.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/94/394/1 diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 5b5a7a1..be634a9 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -477,7 +477,9 @@ } } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan, + l1if_compl_cb *cb, void *data) { struct msgb *msg = l1p_msgb_alloc(); struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx); @@ -486,9 +488,14 @@ cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; - cr->logChComb = pchan_to_logChComb[ts->pchan]; + cr->logChComb = pchan_to_logChComb[pchan]; - return l1if_gsm_req_compl(fl1h, msg, opstart_compl_cb, NULL); + return l1if_gsm_req_compl(fl1h, msg, cb, NULL); +} + +static int ts_connect(struct gsm_bts_trx_ts *ts) +{ + return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL); } GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan) -- To view, visit https://gerrit.osmocom.org/394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:59:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:59:12 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F Message-ID: Review at https://gerrit.osmocom.org/395 dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F Analogous to 57fc1124e1649fa2b08ef143697689aca4677625 on osmo-bts-sysmo. Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba --- M src/osmo-bts-litecell15/oml.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/395/1 diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index be634a9..27df64d 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -89,7 +89,8 @@ [GSM_PCHAN_SDCCH8_SACCH8C] = GsmL1_LogChComb_VII, [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = GsmL1_LogChComb_VII, [GSM_PCHAN_PDCH] = GsmL1_LogChComb_XIII, - //[GSM_PCHAN_TCH_F_PDCH] = FIXME, + [GSM_PCHAN_TCH_F_PDCH] = GsmL1_LogChComb_I, /*< first init + like TCH/F, until PDCH ACT */ [GSM_PCHAN_UNKNOWN] = GsmL1_LogChComb_0, }; -- To view, visit https://gerrit.osmocom.org/395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 19:59:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 19:59:13 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: lc15: complete for litecell15-bts: implement bts_m... Message-ID: Review at https://gerrit.osmocom.org/396 dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*() Analogous to 63b296bdd9a25134ee61ce6f269750e796a8bfca on osmo-bts-sysmo. Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1. Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in common/rsl.c. Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb to invoke dyn_pdch_connected() in common/rsl.c. Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4 --- M src/osmo-bts-litecell15/oml.c 1 file changed, 49 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/396/1 diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 27df64d..8f783f3 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1836,13 +1836,60 @@ return l1if_set_txpower(trx_lc15l1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } +static int ts_disconnect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphDisconnectCnf_t *cnf = &l1p->u.mphDisconnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + LOGP(DL1C, LOGL_DEBUG, "%s Rx mphDisconnectCnf\n", + gsm_lchan_name(ts->lchan)); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_disconnected(ts); + + return 0; +} + int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { - return -ENOTSUP; + struct msgb *msg = l1p_msgb_alloc(); + struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx); + GsmL1_MphDisconnectReq_t *cr; + + DEBUGP(DRSL, "%s TS disconnect\n", gsm_lchan_name(ts->lchan)); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDisconnectReq, fl1h, + l1p_handle_for_ts(ts)); + cr->u8Tn = ts->nr; + + return l1if_gsm_req_compl(fl1h, msg, ts_disconnect_cb, NULL); +} + +static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphConnectCnf_t *cnf = &l1p->u.mphConnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + DEBUGP(DL1C, "%s %s Rx mphConnectCnf flags=%s%s%s\n", + gsm_lchan_name(ts->lchan), + gsm_pchan_name(ts->pchan), + ts->flags & TS_F_PDCH_ACTIVE ? "ACTIVE " : "", + ts->flags & TS_F_PDCH_ACT_PENDING ? "ACT_PENDING " : "", + ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : ""); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_connected(ts); + + return 0; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return -ENOTSUP; + return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 20:03:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 20:03:17 +0000 Subject: [PATCH] osmo-bts[master]: dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_... Message-ID: Review at https://gerrit.osmocom.org/397 dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected() The function would currently only be called in cases where one of the if branches catches on, but for safety's and clarity's sake, don't ts_connect using as_pchan if no reconnect is pending. Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3 --- M src/common/rsl.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/397/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 224a41a..6d1cbc9 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1791,7 +1791,9 @@ gsm_lchan_name(ts->lchan)); ts->lchan[0].type = GSM_LCHAN_PDTCH; as_pchan = GSM_PCHAN_PDCH; - } + } else + /* No reconnect pending. */ + return; rc = bts_model_ts_connect(ts, as_pchan); /* Error? then NACK right now. */ -- To view, visit https://gerrit.osmocom.org/397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 20:04:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 20:04:11 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warnings: include bts_model.h in phy_link.c Message-ID: Review at https://gerrit.osmocom.org/398 fix compiler warnings: include bts_model.h in phy_link.c The file calls bts_model_* API which was yet undeclared. Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 --- M src/common/phy_link.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/98/398/1 diff --git a/src/common/phy_link.c b/src/common/phy_link.c index 43bb31c..25b7e5d 100644 --- a/src/common/phy_link.c +++ b/src/common/phy_link.c @@ -8,6 +8,7 @@ #include #include #include +#include static LLIST_HEAD(g_phy_links); -- To view, visit https://gerrit.osmocom.org/398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 20:04:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 20:04:11 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warning: remove useless 'static' storage class ... Message-ID: Review at https://gerrit.osmocom.org/399 fix compiler warning: remove useless 'static' storage class for struct decl Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/399/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 3bc788c..a9e8629 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -87,7 +87,7 @@ }, }; -static struct calTbl_t +struct calTbl_t { union { -- To view, visit https://gerrit.osmocom.org/399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 20:04:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 20:04:11 +0000 Subject: [PATCH] osmo-bts[master]: fix compiler warning: remove unused variable 'i' in calib_ve... Message-ID: Review at https://gerrit.osmocom.org/400 fix compiler warning: remove unused variable 'i' in calib_verify() Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/400/1 diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index a9e8629..ac39e46 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -307,7 +307,7 @@ static int calib_verify(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc) { - int i, rc, sz; + int rc, sz; struct calib_send_state *st = &fl1h->st; struct phy_link *plink = fl1h->phy_inst->phy_link; char *rbuf; -- To view, visit https://gerrit.osmocom.org/400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 20:05:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 20:05:53 +0000 Subject: [PATCH] osmo-bts[master]: vty: install orphaned trx nominal power command Message-ID: Review at https://gerrit.osmocom.org/401 vty: install orphaned trx nominal power command The cfg_trx_nominal_power_cmd added 12 days ago in 58e4e18206501c3bffa65f0b876bbc5ebe175d6e was floating. Actually add it to the TRX_NODE. Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0 --- M src/osmo-bts-litecell15/lc15bts_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/401/1 diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 8c4364c..c5d404c 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -406,6 +406,8 @@ install_element(BTS_NODE, &cfg_bts_auto_band_cmd); install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd); + install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); + install_element(PHY_INST_NODE, &cfg_phy_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_no_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_cal_path_cmd); -- To view, visit https://gerrit.osmocom.org/401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 21 20:12:05 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 21 Jun 2016 20:12:05 +0000 Subject: osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm In-Reply-To: References: Message-ID: Patch Set 2: > Could you add commit id when the transition which broke the build > happened? The breaking commit is far from obvious, so thanks for catching! ...and done. -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 10:43:20 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 10:43:20 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/201 to look at the new patch set (#6). Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Fixes: OS#1658 --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 12 files changed, 144 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/6 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ad..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e7cd520..bdcd0e0 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -20,12 +21,6 @@ struct gsm_subscriber_group; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] - -enum gsm_subscr_creation_mode { - GSM_SUBSCR_DONT_CREATE = 0, - GSM_SUBSCR_CREAT_W_RAND_EXT = 1, - GSM_SUBSCR_CREAT_W_REGEXP = 2, -}; enum gsm_security_event { GSM_SECURITY_NOAVAIL, @@ -289,7 +284,8 @@ struct osmo_bsc_data *bsc_data; /* subscriber related features */ - int subscr_creation_mode; + bool auto_create_subscr; + bool auto_assign_exten; uint64_t ext_min; uint64_t ext_max; struct gsm_subscriber_group *subscr_group; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 3cba5d1..3d7c244 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -5,6 +5,8 @@ #include #include +#include + #define GSM_NAME_LENGTH 160 #define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */ @@ -90,8 +92,7 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax); + const char *imsi); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index b0f2f62..5c671f8 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -195,6 +195,10 @@ if (net->authorized_reg_str) vty_out(vty, ", authorized regexp: %s", net->authorized_reg_str); vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, " Auto create subscriber: %s%s", + net->auto_create_subscr ? "yes" : "no", VTY_NEWLINE); + vty_out(vty, " Auto assign extension: %s%s", + net->auto_assign_exten ? "yes" : "no", VTY_NEWLINE); vty_out(vty, " Location updating reject cause: %u%s", net->reject_cause, VTY_NEWLINE); vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4636d57..0e99097 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -21,10 +21,13 @@ #include #include +#include + struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code, int (*mncc_recv)(struct gsm_network *, struct msgb *)) { struct gsm_network *net; + const char *default_regexp = "*"; net = talloc_zero(tall_bsc_ctx, struct gsm_network); if (!net) @@ -42,13 +45,18 @@ return NULL; } + if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, + &default_regexp) != 0) + return NULL; + /* Init back pointer */ net->bsc_data->auto_off_timeout = -1; net->bsc_data->network = net; INIT_LLIST_HEAD(&net->bsc_data->mscs); net->subscr_group->net = net; - net->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + net->auto_create_subscr = true; + net->auto_assign_exten = true; net->country_code = country_code; net->network_code = network_code; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index a02db36..79e136d 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -25,6 +25,8 @@ #include #include +#include + static bool alg_supported(const char *alg) { /* @@ -96,9 +98,7 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi, - net->ext_min, - net->ext_max); + subscr = subscr_create_subscriber(net->subscr_group, imsi); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index b367139..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ } struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -551,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr, smin, smax); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -956,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1062,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..1b02efe 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -530,15 +530,13 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { - if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) + if (!net->auto_create_subscr) return NULL; - if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP) - if (!subscr_regexp_check(net, imsi)) - return NULL; + if (!subscr_regexp_check(net, imsi)) + return NULL; - return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + return subscr_create_subscriber(net->subscr_group, imsi); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1dc2cc2..08198c7 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -203,10 +204,12 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax) + const char *imsi) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, + sgrp->net->ext_min, + sgrp->net->ext_max, + sgrp->net->auto_assign_exten); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index a035bf9..74da1d7 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -242,9 +242,7 @@ if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], - gsmnet->ext_min, - gsmnet->ext_max); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1044,6 +1042,8 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = true; if (mi >= ma) { vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", argv[0], argv[1], VTY_NEWLINE); @@ -1055,15 +1055,13 @@ } DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, - "subscriber-create-on-demand [regexp]", + "subscriber-create-on-demand [no-extension]", "Make a new record when a subscriber is first seen.\n" - "Create subscribers only if IMSI matches the regexp specified in " - "authorized-regexp command\n") + "Do not automatically assign extension to created subscribers\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; - if (argc) - gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = argc ? false : true; return CMD_SUCCESS; } @@ -1072,7 +1070,7 @@ NO_STR "Make a new record when a subscriber is first seen.\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_DONT_CREATE; + gsmnet->auto_create_subscr = false; return CMD_SUCCESS; } @@ -1097,12 +1095,15 @@ static int config_write_nitb(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - enum gsm_subscr_creation_mode scm = gsmnet->subscr_creation_mode; - const char *reg = (scm & GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", - *pref = scm ? "" : "no "; + vty_out(vty, "nitb%s", VTY_NEWLINE); - vty_out(vty, " %ssubscriber-create-on-demand%s%s", - pref, reg, VTY_NEWLINE); + if (!gsmnet->auto_create_subscr) + vty_out(vty, " no subscriber-create-on-demand%s", VTY_NEWLINE); + else + vty_out(vty, " subscriber-create-on-demand%s%s", + gsmnet->auto_assign_exten ? "" : " no-extension", + VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index dc81481..755a6e9 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *imsi, char *imei1, char *imei2, bool make_ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + make_ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -177,7 +179,7 @@ COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by IMSI */ - alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice_imsi); + alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by id */ @@ -187,8 +189,14 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + if (!make_ext) + printf("FAIL: bogus extension created for IMSI %s\n", + imsi); + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } else if (make_ext) + printf("FAIL: no subscriber extension for IMSI %s\n", imsi); SUBSCR_PUT(alice); } @@ -217,18 +225,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..9341989 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -244,7 +244,7 @@ self.vty.command("configure terminal") self.vty.command("nitb") self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) - self.assertTrue(self.vty.verify("subscriber-create-on-demand regexp", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand no-extension", [''])) self.vty.command("end") def testSi2Q(self): @@ -388,7 +388,7 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_(res != "") # Now it should not be there anymore @@ -400,6 +400,9 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "222301824913762" + imsi3 = "333500854113763" + imsi4 = "444583744053764" # Initially we don't have this subscriber self.vty.verify('show subscriber imsi '+imsi, ['% No subscriber found for imsi '+imsi]) @@ -407,13 +410,58 @@ # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) # Now we have it res = self.vty.command('show subscriber imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand no-extension", [''])) + self.vty.command("end") + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') + self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi3 + ' delete') + self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi4 + ' delete') self.assert_(res != "") # Now it should not be there anymore @@ -462,9 +510,9 @@ self.assert_(res.find(" Extension: ") > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_(res != "") - res = self.vty.command('subscriber delete imsi ' + imsi2) + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') self.assert_(res != "") def testShowPagingGroup(self): -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 12:04:55 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 12:04:55 +0000 Subject: [PATCH] openbsc[master]: Fix vty tests Message-ID: Review at https://gerrit.osmocom.org/402 Fix vty tests Use correct vty command for subscriber deletion, adjust assertions accordingly. The error was cause by inconsistent vty commands for subscriber creation and deletion. Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b --- M openbsc/tests/vty_test_runner.py 1 file changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/02/402/1 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..bae1866 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -388,12 +388,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberCreateDelete(self): @@ -413,12 +413,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberSettings(self): self.vty.enable() @@ -456,16 +456,18 @@ self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) self.vty.command("end") + # create subscriber with extension in a configured interval res = self.vty.command('subscriber create imsi ' + imsi2) self.assert_(res.find(" IMSI: " + imsi2) > 0) self.assert_(res.find("221") > 0 or res.find("222") > 0) self.assert_(res.find(" Extension: ") > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_(res != "") - res = self.vty.command('subscriber delete imsi ' + imsi2) - self.assert_(res != "") + # imsi2 is inactive so deletion should succeed + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') + self.assert_("" == res) def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 12:08:19 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 12:08:19 +0000 Subject: [PATCH] openbsc[master]: Fix vty tests In-Reply-To: References: Message-ID: Fix vty tests Use correct vty command for subscriber deletion, adjust assertions accordingly. The error was cause by inconsistent syntax of vty commands for subscriber creation and deletion. Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b --- M openbsc/tests/vty_test_runner.py 1 file changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/02/402/2 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..bae1866 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -388,12 +388,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberCreateDelete(self): @@ -413,12 +413,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberSettings(self): self.vty.enable() @@ -456,16 +456,18 @@ self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) self.vty.command("end") + # create subscriber with extension in a configured interval res = self.vty.command('subscriber create imsi ' + imsi2) self.assert_(res.find(" IMSI: " + imsi2) > 0) self.assert_(res.find("221") > 0 or res.find("222") > 0) self.assert_(res.find(" Extension: ") > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_(res != "") - res = self.vty.command('subscriber delete imsi ' + imsi2) - self.assert_(res != "") + # imsi2 is inactive so deletion should succeed + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') + self.assert_("" == res) def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:31:53 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:31:53 +0000 Subject: libosmo-abis[master]: Fix macro definitions In-Reply-To: References: Message-ID: Patch Set 3: test please ignore -- To view, visit https://gerrit.osmocom.org/217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38937469eb7948e2b8e6c1d7fba2c2adeba45b41 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:41:02 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:41:02 +0000 Subject: openbsc[master]: Fix vty tests In-Reply-To: References: Message-ID: Patch Set 2: All but the subject. nitb: Fix vty test for deleting a subscriber? -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:42:00 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:42:00 +0000 Subject: openbsc[master]: vty: show lchan summary: also show lchan->state In-Reply-To: References: Message-ID: Patch Set 1: The method is called "short". So why does this information need to be in the short display? -- To view, visit https://gerrit.osmocom.org/386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:42:29 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:42:29 +0000 Subject: osmo-bts[master]: vty: install orphaned trx nominal power command In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:43:36 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:43:36 +0000 Subject: osmo-bts[master]: fix compiler warning: remove unused variable 'i' in calib_ve... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 It would be nice if subject could indicate where it is coming from E.g. l15: Fix.. as the calib_verify -- To view, visit https://gerrit.osmocom.org/400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:43:59 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:43:59 +0000 Subject: osmo-bts[master]: fix compiler warnings: include bts_model.h in phy_link.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:44:31 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:44:31 +0000 Subject: osmo-bts[master]: fix compiler warnings: include bts_model.h in phy_link.c In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/398/1/src/common/phy_link.c File src/common/phy_link.c: Line 6: #include i would have put it below here.. sorts alphabetically in the "mini-scope" :) -- To view, visit https://gerrit.osmocom.org/398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:44:56 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:44:56 +0000 Subject: osmo-bts[master]: fix compiler warning: remove useless 'static' storage class ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:46:54 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 13:46:54 +0000 Subject: openbsc[master]: debug log: log all lchan_alloc steps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) I would like to see a bit more next in the commit message. How does this extra log verbosity makes your life better to justify the many else branches (each else doubles the complexity of the code) https://gerrit.osmocom.org/#/c/387/1/openbsc/src/libbsc/chan_alloc.c File openbsc/src/libbsc/chan_alloc.c: Line 158: DEBUGP(DRLL, "Looking for lchan %s\n", gsm_lchant_name(type)); mention the BTS number? -- To view, visit https://gerrit.osmocom.org/387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2d11744d92dc06205fb1573815e11efd84842b0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:57:48 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 13:57:48 +0000 Subject: [PATCH] osmo-bts[master]: Use libosmocodec functions for AMR Message-ID: Review at https://gerrit.osmocom.org/403 Use libosmocodec functions for AMR Switch to using libosmocodec functions as a preparation step for DTX support as they expose necessary bits. Change-Id: Ie7423032fd06779d78876182ee63538d98906328 Related: OS#1750 --- M src/osmo-bts-trx/Makefile.am D src/osmo-bts-trx/amr.c D src/osmo-bts-trx/amr.h M src/osmo-bts-trx/scheduler_trx.c 4 files changed, 21 insertions(+), 107 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/03/403/1 diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index e31b57f..96b080e 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -2,10 +2,10 @@ AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -EXTRA_DIST = trx_if.h l1_if.h gsm0503_parity.h gsm0503_conv.h gsm0503_interleaving.h gsm0503_mapping.h gsm0503_coding.h gsm0503_tables.h loops.h amr.h +EXTRA_DIST = trx_if.h l1_if.h gsm0503_parity.h gsm0503_conv.h gsm0503_interleaving.h gsm0503_mapping.h gsm0503_coding.h gsm0503_tables.h loops.h bin_PROGRAMS = osmo-bts-trx -osmo_bts_trx_SOURCES = main.c trx_if.c l1_if.c scheduler_trx.c trx_vty.c gsm0503_parity.c gsm0503_conv.c gsm0503_interleaving.c gsm0503_mapping.c gsm0503_coding.c gsm0503_tables.c loops.c amr.c +osmo_bts_trx_SOURCES = main.c trx_if.c l1_if.c scheduler_trx.c trx_vty.c gsm0503_parity.c gsm0503_conv.c gsm0503_interleaving.c gsm0503_mapping.c gsm0503_coding.c gsm0503_tables.c loops.c osmo_bts_trx_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(LDADD) diff --git a/src/osmo-bts-trx/amr.c b/src/osmo-bts-trx/amr.c deleted file mode 100644 index 70d94ca..0000000 --- a/src/osmo-bts-trx/amr.c +++ /dev/null @@ -1,81 +0,0 @@ -/* AMR support for OsmoBTS-TRX */ - -/* (C) 2013 by Andreas Eversberg - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include - -static int amr_len_by_ft[16] = { - 12, 13, 15, 17, 19, 20, 26, 31, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -int amr_decompose_payload(uint8_t *payload, int payload_len, uint8_t *_cmr, - uint8_t *_ft, uint8_t *_bfi) -{ - uint8_t cmr, f, ft, q; - - if (payload_len < 2) - return -EINVAL; - - cmr = payload[0] >> 4; - if (_cmr) - *_cmr = cmr; - - f = payload[1] >> 7; - - ft = (payload[1] >> 3) & 0xf; - if (_ft) - *_ft = ft; - - q = (payload[1] >> 2) & 0x1; - if (_bfi) - *_bfi = !q; - - if (f) { - fprintf(stderr, "%s: multiple payloads not supported\n", - __func__); - return -ENOTSUP; - } - - if (payload_len - 2 < amr_len_by_ft[ft]) - return -EINVAL; - - return 2 + amr_len_by_ft[ft]; -} - -int amr_compose_payload(uint8_t *payload, uint8_t cmr, uint8_t ft, uint8_t bfi) -{ - if (cmr >= 16) - return -EINVAL; - - if (ft >= 16) - return -EINVAL; - - payload[0] = cmr << 4; - - payload[1] = (ft << 3) | ((!bfi) << 2); /* F = 0 */ - - return 2 + amr_len_by_ft[ft]; -} - diff --git a/src/osmo-bts-trx/amr.h b/src/osmo-bts-trx/amr.h deleted file mode 100644 index 17eb5f0..0000000 --- a/src/osmo-bts-trx/amr.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _TRX_AMR_H -#define _TRX_AMR_H - -int amr_decompose_payload(uint8_t *payload, int payload_len, uint8_t *_cmr, - uint8_t *_ft, uint8_t *_bfi); -int amr_compose_payload(uint8_t *payload, uint8_t cmr, uint8_t ft, uint8_t bfi); - -#endif /* _TRX_AMR_H */ diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index d92d8db..96ea828 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -45,7 +46,6 @@ #include "gsm0503_coding.h" #include "trx_if.h" #include "loops.h" -#include "amr.h" extern void *tall_bts_ctx; @@ -335,9 +335,9 @@ len = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - len = amr_compose_payload(tch_data, + len = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->dl_cmr], - chan_state->codec[chan_state->dl_ft], 1); + chan_state->codec[chan_state->dl_ft], AMR_BAD); if (len < 2) break; memset(tch_data + 2, 0, len - 2); @@ -401,8 +401,11 @@ /* check validity of message, get AMR ft and cmr */ if (!msg_facch && msg_tch) { int len; - uint8_t bfi, cmr_codec, ft_codec; + uint8_t cmr_codec; int cmr, ft, i; + enum osmo_amr_type ft_codec; + enum osmo_amr_quality bfi; + int8_t sti, cmi; if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { LOGP(DL1C, LOGL_NOTICE, "%s Dropping speech frame, " @@ -452,9 +455,9 @@ } break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - len = amr_decompose_payload(msg_tch->l2h, - msgb_l2len(msg_tch), &cmr_codec, &ft_codec, - &bfi); + len = osmo_amr_rtp_dec(msg_tch->l2h, msgb_l2len(msg_tch), + &cmr_codec, &cmi, &ft_codec, + &bfi, &sti); cmr = -1; ft = -1; for (i = 0; i < chan_state->codecs; i++) { @@ -488,7 +491,7 @@ goto free_bad_msg; } chan_state->dl_ft = ft; - if (bfi) { + if (bfi == AMR_BAD) { LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " "AMR frame' trx=%u ts=%u at fn=%u.\n", trx_chan_desc[chan].name, @@ -1004,9 +1007,9 @@ amr = 2; /* we store tch_data + 2 header bytes */ /* only good speech frames get rtp header */ if (rc != GSM_MACBLOCK_LEN && rc >= 4) { - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->ul_cmr], - chan_state->codec[chan_state->ul_ft], 0); + chan_state->codec[chan_state->ul_ft], AMR_GOOD); } break; default: @@ -1050,10 +1053,10 @@ rc = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->dl_cmr], chan_state->codec[chan_state->dl_ft], - 1); + AMR_BAD); if (rc < 2) break; memset(tch_data + 2, 0, rc - 2); @@ -1167,9 +1170,9 @@ amr = 2; /* we store tch_data + 2 two */ /* only good speech frames get rtp header */ if (rc != GSM_MACBLOCK_LEN && rc >= 4) { - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->ul_cmr], - chan_state->codec[chan_state->ul_ft], 0); + chan_state->codec[chan_state->ul_ft], AMR_GOOD); } break; default: @@ -1213,10 +1216,10 @@ rc = 15; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->dl_cmr], chan_state->codec[chan_state->dl_ft], - 1); + AMR_BAD); if (rc < 2) break; memset(tch_data + 2, 0, rc - 2); -- To view, visit https://gerrit.osmocom.org/403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7423032fd06779d78876182ee63538d98906328 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 13:57:49 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 13:57:49 +0000 Subject: [PATCH] osmo-bts[master]: Use error values instead of number for RSL error Message-ID: Review at https://gerrit.osmocom.org/404 Use error values instead of number for RSL error Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149 --- M src/common/rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/04/404/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 224a41a..cf6cef8 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1252,8 +1252,8 @@ { struct msgb *nmsg; - LOGP(DRSL, LOGL_NOTICE, "%s Sending RTP delete indication: cause=%d\n", - gsm_lchan_name(lchan), cause); + LOGP(DRSL, LOGL_NOTICE, "%s Sending RTP delete indication: cause = %s\n", + gsm_lchan_name(lchan), rsl_err_name(cause)); nmsg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); if (!nmsg) -- To view, visit https://gerrit.osmocom.org/404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 14:00:20 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 14:00:20 +0000 Subject: osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 14:31:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 14:31:24 +0000 Subject: [PATCH] osmo-bts[master]: Clarify logging message Message-ID: Review at https://gerrit.osmocom.org/405 Clarify logging message Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Related: OS#1648 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/05/405/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 04d8fea..b2766d0 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -380,7 +380,7 @@ phy_instance_name(pinst), buf); rsp_error: if (tcm->critical) { - bts_shutdown(pinst->trx->bts, "SIGINT"); + bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); /* keep tcm list, so process is stopped */ return -EIO; } -- To view, visit https://gerrit.osmocom.org/405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 15:15:36 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 15:15:36 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/326/4//COMMIT_MSG Commit Message: Line 12: generally useful. but do you use it outside of osmo-bts yet? -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 22 15:16:37 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 22 Jun 2016 15:16:37 +0000 Subject: osmo-bts[master]: Use error values instead of number for RSL error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Has this already been useful for debugging? How did it help? -- To view, visit https://gerrit.osmocom.org/404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 15:16:49 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 15:16:49 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 4: No. -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 15:33:14 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 22 Jun 2016 15:33:14 +0000 Subject: osmo-bts[master]: Use error values instead of number for RSL error In-Reply-To: References: Message-ID: Patch Set 1: Not so much - rsl_tx_ipac_dlcx_ind() currently called in one place with fixed error cause. -- To view, visit https://gerrit.osmocom.org/404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:24:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:24:15 +0000 Subject: osmo-bts[master]: Use libosmocodec functions for AMR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7423032fd06779d78876182ee63538d98906328 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:24:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:24:17 +0000 Subject: [MERGED] osmo-bts[master]: Use libosmocodec functions for AMR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use libosmocodec functions for AMR ...................................................................... Use libosmocodec functions for AMR Switch to using libosmocodec functions as a preparation step for DTX support as they expose necessary bits. Change-Id: Ie7423032fd06779d78876182ee63538d98906328 Related: OS#1750 --- M src/osmo-bts-trx/Makefile.am D src/osmo-bts-trx/amr.c D src/osmo-bts-trx/amr.h M src/osmo-bts-trx/scheduler_trx.c 4 files changed, 21 insertions(+), 107 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index e31b57f..96b080e 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -2,10 +2,10 @@ AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -EXTRA_DIST = trx_if.h l1_if.h gsm0503_parity.h gsm0503_conv.h gsm0503_interleaving.h gsm0503_mapping.h gsm0503_coding.h gsm0503_tables.h loops.h amr.h +EXTRA_DIST = trx_if.h l1_if.h gsm0503_parity.h gsm0503_conv.h gsm0503_interleaving.h gsm0503_mapping.h gsm0503_coding.h gsm0503_tables.h loops.h bin_PROGRAMS = osmo-bts-trx -osmo_bts_trx_SOURCES = main.c trx_if.c l1_if.c scheduler_trx.c trx_vty.c gsm0503_parity.c gsm0503_conv.c gsm0503_interleaving.c gsm0503_mapping.c gsm0503_coding.c gsm0503_tables.c loops.c amr.c +osmo_bts_trx_SOURCES = main.c trx_if.c l1_if.c scheduler_trx.c trx_vty.c gsm0503_parity.c gsm0503_conv.c gsm0503_interleaving.c gsm0503_mapping.c gsm0503_coding.c gsm0503_tables.c loops.c osmo_bts_trx_LDADD = $(top_builddir)/src/common/libbts.a $(top_builddir)/src/common/libl1sched.a $(LDADD) diff --git a/src/osmo-bts-trx/amr.c b/src/osmo-bts-trx/amr.c deleted file mode 100644 index 70d94ca..0000000 --- a/src/osmo-bts-trx/amr.c +++ /dev/null @@ -1,81 +0,0 @@ -/* AMR support for OsmoBTS-TRX */ - -/* (C) 2013 by Andreas Eversberg - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include - -static int amr_len_by_ft[16] = { - 12, 13, 15, 17, 19, 20, 26, 31, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -int amr_decompose_payload(uint8_t *payload, int payload_len, uint8_t *_cmr, - uint8_t *_ft, uint8_t *_bfi) -{ - uint8_t cmr, f, ft, q; - - if (payload_len < 2) - return -EINVAL; - - cmr = payload[0] >> 4; - if (_cmr) - *_cmr = cmr; - - f = payload[1] >> 7; - - ft = (payload[1] >> 3) & 0xf; - if (_ft) - *_ft = ft; - - q = (payload[1] >> 2) & 0x1; - if (_bfi) - *_bfi = !q; - - if (f) { - fprintf(stderr, "%s: multiple payloads not supported\n", - __func__); - return -ENOTSUP; - } - - if (payload_len - 2 < amr_len_by_ft[ft]) - return -EINVAL; - - return 2 + amr_len_by_ft[ft]; -} - -int amr_compose_payload(uint8_t *payload, uint8_t cmr, uint8_t ft, uint8_t bfi) -{ - if (cmr >= 16) - return -EINVAL; - - if (ft >= 16) - return -EINVAL; - - payload[0] = cmr << 4; - - payload[1] = (ft << 3) | ((!bfi) << 2); /* F = 0 */ - - return 2 + amr_len_by_ft[ft]; -} - diff --git a/src/osmo-bts-trx/amr.h b/src/osmo-bts-trx/amr.h deleted file mode 100644 index 17eb5f0..0000000 --- a/src/osmo-bts-trx/amr.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _TRX_AMR_H -#define _TRX_AMR_H - -int amr_decompose_payload(uint8_t *payload, int payload_len, uint8_t *_cmr, - uint8_t *_ft, uint8_t *_bfi); -int amr_compose_payload(uint8_t *payload, uint8_t cmr, uint8_t ft, uint8_t bfi); - -#endif /* _TRX_AMR_H */ diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index d92d8db..96ea828 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -45,7 +46,6 @@ #include "gsm0503_coding.h" #include "trx_if.h" #include "loops.h" -#include "amr.h" extern void *tall_bts_ctx; @@ -335,9 +335,9 @@ len = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - len = amr_compose_payload(tch_data, + len = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->dl_cmr], - chan_state->codec[chan_state->dl_ft], 1); + chan_state->codec[chan_state->dl_ft], AMR_BAD); if (len < 2) break; memset(tch_data + 2, 0, len - 2); @@ -401,8 +401,11 @@ /* check validity of message, get AMR ft and cmr */ if (!msg_facch && msg_tch) { int len; - uint8_t bfi, cmr_codec, ft_codec; + uint8_t cmr_codec; int cmr, ft, i; + enum osmo_amr_type ft_codec; + enum osmo_amr_quality bfi; + int8_t sti, cmi; if (rsl_cmode != RSL_CMOD_SPD_SPEECH) { LOGP(DL1C, LOGL_NOTICE, "%s Dropping speech frame, " @@ -452,9 +455,9 @@ } break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - len = amr_decompose_payload(msg_tch->l2h, - msgb_l2len(msg_tch), &cmr_codec, &ft_codec, - &bfi); + len = osmo_amr_rtp_dec(msg_tch->l2h, msgb_l2len(msg_tch), + &cmr_codec, &cmi, &ft_codec, + &bfi, &sti); cmr = -1; ft = -1; for (i = 0; i < chan_state->codecs; i++) { @@ -488,7 +491,7 @@ goto free_bad_msg; } chan_state->dl_ft = ft; - if (bfi) { + if (bfi == AMR_BAD) { LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " "AMR frame' trx=%u ts=%u at fn=%u.\n", trx_chan_desc[chan].name, @@ -1004,9 +1007,9 @@ amr = 2; /* we store tch_data + 2 header bytes */ /* only good speech frames get rtp header */ if (rc != GSM_MACBLOCK_LEN && rc >= 4) { - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->ul_cmr], - chan_state->codec[chan_state->ul_ft], 0); + chan_state->codec[chan_state->ul_ft], AMR_GOOD); } break; default: @@ -1050,10 +1053,10 @@ rc = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->dl_cmr], chan_state->codec[chan_state->dl_ft], - 1); + AMR_BAD); if (rc < 2) break; memset(tch_data + 2, 0, rc - 2); @@ -1167,9 +1170,9 @@ amr = 2; /* we store tch_data + 2 two */ /* only good speech frames get rtp header */ if (rc != GSM_MACBLOCK_LEN && rc >= 4) { - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->ul_cmr], - chan_state->codec[chan_state->ul_ft], 0); + chan_state->codec[chan_state->ul_ft], AMR_GOOD); } break; default: @@ -1213,10 +1216,10 @@ rc = 15; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ - rc = amr_compose_payload(tch_data, + rc = osmo_amr_rtp_enc(tch_data, chan_state->codec[chan_state->dl_cmr], chan_state->codec[chan_state->dl_ft], - 1); + AMR_BAD); if (rc < 2) break; memset(tch_data + 2, 0, rc - 2); -- To view, visit https://gerrit.osmocom.org/403 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7423032fd06779d78876182ee63538d98906328 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:24:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:24:21 +0000 Subject: [MERGED] osmo-bts[master]: Use error values instead of number for RSL error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use error values instead of number for RSL error ...................................................................... Use error values instead of number for RSL error Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149 --- M src/common/rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/common/rsl.c b/src/common/rsl.c index 224a41a..cf6cef8 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1252,8 +1252,8 @@ { struct msgb *nmsg; - LOGP(DRSL, LOGL_NOTICE, "%s Sending RTP delete indication: cause=%d\n", - gsm_lchan_name(lchan), cause); + LOGP(DRSL, LOGL_NOTICE, "%s Sending RTP delete indication: cause = %s\n", + gsm_lchan_name(lchan), rsl_err_name(cause)); nmsg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr)); if (!nmsg) -- To view, visit https://gerrit.osmocom.org/404 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:24:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:24:41 +0000 Subject: osmo-bts[master]: Clarify logging message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:24:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:24:43 +0000 Subject: [MERGED] osmo-bts[master]: Clarify logging message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Clarify logging message ...................................................................... Clarify logging message Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Related: OS#1648 --- M src/osmo-bts-trx/trx_if.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 04d8fea..b2766d0 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -380,7 +380,7 @@ phy_instance_name(pinst), buf); rsp_error: if (tcm->critical) { - bts_shutdown(pinst->trx->bts, "SIGINT"); + bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); /* keep tcm list, so process is stopped */ return -EIO; } -- To view, visit https://gerrit.osmocom.org/405 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:25:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:25:24 +0000 Subject: osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:25:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:25:27 +0000 Subject: [MERGED] osmo-bts[master]: fix lc15 build: put src/common/libbts.a left of -losmogsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix lc15 build: put src/common/libbts.a left of -losmogsm ...................................................................... fix lc15 build: put src/common/libbts.a left of -losmogsm When switching to the gsm_chan_t_names string list from libosmogsm, libosmogsm actually became a dependency of the local libbts.a. The breaking change is in openbsc.git 29048b2a80b5865ffc41fa4401113c5826227e23 and came in here because gsm_data_shared.h is included from openbsc. Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b --- M src/osmo-bts-litecell15/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index 768e29d..3026e96 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -27,7 +27,7 @@ misc/lc15bts_mgr_temp.c \ misc/lc15bts_mgr_calib.c -lc15bts_mgr_LDADD = $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) $(top_builddir)/src/common/libbts.a +lc15bts_mgr_LDADD = $(top_builddir)/src/common/libbts.a $(LIBGPS_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCTRL_LIBS) lc15bts_util_SOURCES = misc/lc15bts_util.c misc/lc15bts_par.c lc15bts_util_LDADD = $(LIBOSMOCORE_LIBS) -- To view, visit https://gerrit.osmocom.org/385 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:25:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:25:41 +0000 Subject: osmo-bts[master]: lc15: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:25:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:25:43 +0000 Subject: [MERGED] osmo-bts[master]: lc15: add L3 handle to l1prim messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lc15: add L3 handle to l1prim messages ...................................................................... lc15: add L3 handle to l1prim messages Analogous to 7158c2ed082eaca6063a501e490e8d3c3b181560 in osmo-bts-sysmo. Place a layer 3 handle into GSM L1 messages to better match up confirmations to respective requests. This handle is a uint32_t transparently returned in the confirmation messages, so a match-up is easy to add. So far, a GSM L1 confirmation message received for a preceding L1 Request was matched only by the prim_id. That meant that only one instance of the same primitive could be waiting for a confirmation at any given time, or the responses would get mixed up: the struct wait_l1_conf instances entered into the fl1h->wlc_list queue would be returned to a possibly mismatching confirmation handler. (Seen during testing of dyn pdch switching.) Send the hLayer3 handle out via prim_init(), using new static functions to produce handles on different scopes: * l1p_handle_for_trx() * l1p_handle_for_ts() * l1p_handle_for_lchan() (These could possibly move to a more general .h/.c file later.) Remember the hLayer3 handle in * struct wait_l1_conf. Match the incoming confirmations' and stored hLayer3 handles up in, and remove a now obsolete comment from: * is_prim_compat() Since the hLayer3 members are at different byte offsets in GsmL1_Prim_t.u.*, use large switch statements to set/get the value: * In prim_init(), extend existing switch statement to set in GsmL1_Prim_t. * Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a more general .h/.c file later). Note that some messages are already using the hLayer3 handle, and will overwrite it after calling prim_init(), so those are not affected. Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0 --- M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/oml.c 2 files changed, 127 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 6d4fc55..d823e31 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -73,6 +73,7 @@ struct llist_head list; /* internal linked list */ struct osmo_timer_list timer; /* timer for L1 timeout */ unsigned int conf_prim_id; /* primitive we expect in response */ + HANDLE conf_hLayer3; /* layer 3 handle we expect in response */ unsigned int is_sys_prim; /* is this a system (1) or L1 (0) primitive */ l1if_compl_cb *cb; void *cb_data; @@ -95,6 +96,57 @@ LOGP(DL1C, LOGL_FATAL, "Timeout waiting for L1 primitive %s\n", get_value_string(lc15bts_l1prim_names, wlc->conf_prim_id)); exit(23); +} + +static HANDLE l1p_get_hLayer3(GsmL1_Prim_t *prim) +{ + switch (prim->id) { + case GsmL1_PrimId_MphInitReq: + return prim->u.mphInitReq.hLayer3; + case GsmL1_PrimId_MphCloseReq: + return prim->u.mphCloseReq.hLayer3; + case GsmL1_PrimId_MphConnectReq: + return prim->u.mphConnectReq.hLayer3; + case GsmL1_PrimId_MphDisconnectReq: + return prim->u.mphDisconnectReq.hLayer3; + case GsmL1_PrimId_MphActivateReq: + return prim->u.mphActivateReq.hLayer3; + case GsmL1_PrimId_MphDeactivateReq: + return prim->u.mphDeactivateReq.hLayer3; + case GsmL1_PrimId_MphConfigReq: + return prim->u.mphConfigReq.hLayer3; + case GsmL1_PrimId_MphMeasureReq: + return prim->u.mphMeasureReq.hLayer3; + case GsmL1_PrimId_MphInitCnf: + return prim->u.mphInitCnf.hLayer3; + case GsmL1_PrimId_MphCloseCnf: + return prim->u.mphCloseCnf.hLayer3; + case GsmL1_PrimId_MphConnectCnf: + return prim->u.mphConnectCnf.hLayer3; + case GsmL1_PrimId_MphDisconnectCnf: + return prim->u.mphDisconnectCnf.hLayer3; + case GsmL1_PrimId_MphActivateCnf: + return prim->u.mphActivateCnf.hLayer3; + case GsmL1_PrimId_MphDeactivateCnf: + return prim->u.mphDeactivateCnf.hLayer3; + case GsmL1_PrimId_MphConfigCnf: + return prim->u.mphConfigCnf.hLayer3; + case GsmL1_PrimId_MphMeasureCnf: + return prim->u.mphMeasureCnf.hLayer3; + case GsmL1_PrimId_MphTimeInd: + case GsmL1_PrimId_MphSyncInd: + case GsmL1_PrimId_PhEmptyFrameReq: + case GsmL1_PrimId_PhDataReq: + case GsmL1_PrimId_PhConnectInd: + case GsmL1_PrimId_PhReadyToSendInd: + case GsmL1_PrimId_PhDataInd: + case GsmL1_PrimId_PhRaInd: + break; + default: + LOGP(DL1C, LOGL_ERROR, "unknown L1 primitive %u\n", prim->id); + break; + } + return 0; } static int _l1if_req_compl(struct lc15l1_hdl *fl1h, struct msgb *msg, @@ -124,6 +176,7 @@ } wlc->is_sys_prim = 0; wlc->conf_prim_id = lc15bts_get_l1prim_conf(l1p->id); + wlc->conf_hLayer3 = l1p_get_hLayer3(l1p); wqueue = &fl1h->write_q[MQ_L1_WRITE]; timeout_secs = 30; } else { @@ -949,12 +1002,12 @@ static inline int is_prim_compat(GsmL1_Prim_t *l1p, struct wait_l1_conf *wlc) { - /* the limitation here is that we cannot have multiple callers - * sending the same primitive */ if (wlc->is_sys_prim != 0) return 0; if (l1p->id != wlc->conf_prim_id) return 0; + if (l1p_get_hLayer3(l1p) != wlc->conf_hLayer3) + return 0; return 1; } diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index fa9f601..5b5a7a1 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -95,43 +95,71 @@ static int trx_rf_lock(struct gsm_bts_trx *trx, int locked, l1if_compl_cb *cb); -static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct lc15l1_hdl *gl1) +static void *prim_init(GsmL1_Prim_t *prim, GsmL1_PrimId_t id, struct lc15l1_hdl *gl1, + uint32_t hLayer3_uint32) { + HANDLE hLayer3; prim->id = id; + + osmo_static_assert(sizeof(HANDLE) >= 4, l1p_handle_is_at_least_32bit); + hLayer3 = (void*)hLayer3_uint32; switch (id) { case GsmL1_PrimId_MphInitReq: //prim->u.mphInitReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphInitReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphCloseReq: prim->u.mphCloseReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphCloseReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConnectReq: prim->u.mphConnectReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphConnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDisconnectReq: prim->u.mphDisconnectReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphDisconnectReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphActivateReq: prim->u.mphActivateReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphActivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphDeactivateReq: prim->u.mphDeactivateReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphDeactivateReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphConfigReq: prim->u.mphConfigReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphConfigReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphMeasureReq: prim->u.mphMeasureReq.hLayer1 = (HANDLE)gl1->hLayer1; + prim->u.mphMeasureReq.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphInitCnf: + prim->u.mphInitCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphCloseCnf: + prim->u.mphCloseCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConnectCnf: + prim->u.mphConnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDisconnectCnf: + prim->u.mphDisconnectCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphActivateCnf: + prim->u.mphActivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphDeactivateCnf: + prim->u.mphDeactivateCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphConfigCnf: + prim->u.mphConfigCnf.hLayer3 = hLayer3; + break; case GsmL1_PrimId_MphMeasureCnf: + prim->u.mphMeasureCnf.hLayer3 = hLayer3; break; case GsmL1_PrimId_MphTimeInd: break; @@ -156,6 +184,34 @@ break; } return &prim->u; +} + +static uint32_t l1p_handle_for_trx(struct gsm_bts_trx *trx) +{ + struct gsm_bts *bts = trx->bts; + + osmo_static_assert(sizeof(trx->nr) == 1, trx_nr_is_8bit); + osmo_static_assert(sizeof(bts->nr) == 1, bts_nr_is_8bit); + + return bts->nr << 24 + | trx->nr << 16; +} + +static uint32_t l1p_handle_for_ts(struct gsm_bts_trx_ts *ts) +{ + osmo_static_assert(sizeof(ts->nr) == 1, ts_nr_is_8bit); + + return l1p_handle_for_trx(ts->trx) + | ts->nr << 8; +} + + +static uint32_t l1p_handle_for_lchan(struct gsm_lchan *lchan) +{ + osmo_static_assert(sizeof(lchan->nr) == 1, lchan_nr_is_8bit); + + return l1p_handle_for_ts(lchan->ts) + | lchan->nr; } GsmL1_Status_t prim_status(GsmL1_Prim_t *prim) @@ -341,7 +397,8 @@ } msg = l1p_msgb_alloc(); - mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h); + mi_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphInitReq, fl1h, + l1p_handle_for_trx(trx)); dev_par = &mi_req->deviceParam; dev_par->devType = GsmL1_DevType_TxdRxu; dev_par->freqBand = lc15_band; @@ -380,7 +437,8 @@ struct msgb *msg; msg = l1p_msgb_alloc(); - prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h); + prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphCloseReq, fl1h, + l1p_handle_for_trx(trx)); LOGP(DL1C, LOGL_NOTICE, "Close TRX %u\n", trx->nr); return l1if_gsm_req_compl(fl1h, msg, trx_close_compl_cb, NULL); @@ -425,7 +483,8 @@ struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx); GsmL1_MphConnectReq_t *cr; - cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, + l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; cr->logChComb = pchan_to_logChComb[ts->pchan]; @@ -906,7 +965,8 @@ GsmL1_MphActivateReq_t *act_req; GsmL1_LogChParam_t *lch_par; - act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, fl1h); + act_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphActivateReq, + fl1h, l1p_handle_for_lchan(lchan)); lch_par = &act_req->logChPrm; act_req->u8Tn = lchan->ts->nr; act_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); @@ -1199,7 +1259,8 @@ /* channel mode, encryption and/or multirate have changed */ /* update multi-rate config */ - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); conf_req->cfgParamId = GsmL1_ConfigParamId_SetLogChParams; conf_req->cfgParams.setLogChParams.sapi = cmd->sapi; conf_req->cfgParams.setLogChParams.u8Tn = lchan->ts->nr; @@ -1252,7 +1313,7 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphConfigReq_t *conf_req; - conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + conf_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, 0); conf_req->cfgParamId = GsmL1_ConfigParamId_SetTxPowerLevel; conf_req->cfgParams.setTxPowerLevel.fTxPowerLevel = tx_power; @@ -1273,7 +1334,8 @@ struct msgb *msg = l1p_msgb_alloc(); struct GsmL1_MphConfigReq_t *cfgr; - cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h); + cfgr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConfigReq, fl1h, + l1p_handle_for_lchan(lchan)); cfgr->cfgParamId = GsmL1_ConfigParamId_SetCipheringParams; cfgr->cfgParams.setCipheringParams.u8Tn = lchan->ts->nr; @@ -1420,7 +1482,8 @@ struct msgb *msg = l1p_msgb_alloc(); GsmL1_MphDeactivateReq_t *deact_req; - deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, fl1h); + deact_req = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDeactivateReq, + fl1h, l1p_handle_for_lchan(lchan)); deact_req->u8Tn = lchan->ts->nr; deact_req->subCh = lchan_to_GsmL1_SubCh_t(lchan); deact_req->dir = cmd->dir; -- To view, visit https://gerrit.osmocom.org/392 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:25:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:25:52 +0000 Subject: osmo-bts[master]: dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH accordi... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:25:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:25:54 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH accordi... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags ...................................................................... dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags Analogous to 0d10f0e482cdd50acc916e75a8b3ba1beb94227c on osmo-bts-sysmo. According to the PDCH Active flag, handle a TS as TCH/F or PDCH. Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba --- M src/osmo-bts-litecell15/l1_if.c 1 file changed, 15 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index d823e31..395ee0d 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -615,11 +615,23 @@ return l1sap_up(trx, &l1sap); } -static uint8_t chan_nr_by_sapi(enum gsm_phys_chan_config pchan, +static enum gsm_phys_chan_config pick_pchan(struct gsm_bts_trx_ts *ts) +{ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) + return ts->pchan; + if (ts->flags & TS_F_PDCH_ACTIVE) + return GSM_PCHAN_PDCH; + return GSM_PCHAN_TCH_F; +} + +static uint8_t chan_nr_by_sapi(struct gsm_bts_trx_ts *ts, GsmL1_Sapi_t sapi, GsmL1_SubCh_t subCh, uint8_t u8Tn, uint32_t u32Fn) { uint8_t cbits = 0; + enum gsm_phys_chan_config pchan = pick_pchan(ts); + OSMO_ASSERT(pchan != GSM_PCHAN_TCH_F_PDCH); + switch (sapi) { case GsmL1_Sapi_Bcch: cbits = 0x10; @@ -728,7 +740,7 @@ uint32_t fn; /* check if primitive should be handled by common part */ - chan_nr = chan_nr_by_sapi(trx->ts[rts_ind->u8Tn].pchan, rts_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[rts_ind->u8Tn], rts_ind->sapi, rts_ind->subCh, rts_ind->u8Tn, rts_ind->u32Fn); if (chan_nr) { fn = rts_ind->u32Fn; @@ -847,7 +859,7 @@ int rc = 0; int8_t rssi; - chan_nr = chan_nr_by_sapi(trx->ts[data_ind->u8Tn].pchan, data_ind->sapi, + chan_nr = chan_nr_by_sapi(&trx->ts[data_ind->u8Tn], data_ind->sapi, data_ind->subCh, data_ind->u8Tn, data_ind->u32Fn); if (!chan_nr) { LOGP(DL1C, LOGL_ERROR, "PH-DATA-INDICATION for unknown sapi " -- To view, visit https://gerrit.osmocom.org/393 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:26:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:26:00 +0000 Subject: osmo-bts[master]: dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:26:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:26:01 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts ...................................................................... dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts Analogous to 294fbe104b9fb12f06f7cebe68a4b7a6ed28d5ef on osmo-bts-sysmo. For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH. Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave ts_connect() as a thin wrapper to leave init code unchanged. Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5 --- M src/osmo-bts-litecell15/oml.c 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 5b5a7a1..be634a9 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -477,7 +477,9 @@ } } -static int ts_connect(struct gsm_bts_trx_ts *ts) +static int ts_connect_as(struct gsm_bts_trx_ts *ts, + enum gsm_phys_chan_config pchan, + l1if_compl_cb *cb, void *data) { struct msgb *msg = l1p_msgb_alloc(); struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx); @@ -486,9 +488,14 @@ cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphConnectReq, fl1h, l1p_handle_for_ts(ts)); cr->u8Tn = ts->nr; - cr->logChComb = pchan_to_logChComb[ts->pchan]; + cr->logChComb = pchan_to_logChComb[pchan]; - return l1if_gsm_req_compl(fl1h, msg, opstart_compl_cb, NULL); + return l1if_gsm_req_compl(fl1h, msg, cb, NULL); +} + +static int ts_connect(struct gsm_bts_trx_ts *ts) +{ + return ts_connect_as(ts, ts->pchan, opstart_compl_cb, NULL); } GsmL1_Sapi_t lchan_to_GsmL1_Sapi_t(const struct gsm_lchan *lchan) -- To view, visit https://gerrit.osmocom.org/394 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:26:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:26:05 +0000 Subject: osmo-bts[master]: dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:26:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:26:07 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F ...................................................................... dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F Analogous to 57fc1124e1649fa2b08ef143697689aca4677625 on osmo-bts-sysmo. Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba --- M src/osmo-bts-litecell15/oml.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index be634a9..27df64d 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -89,7 +89,8 @@ [GSM_PCHAN_SDCCH8_SACCH8C] = GsmL1_LogChComb_VII, [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = GsmL1_LogChComb_VII, [GSM_PCHAN_PDCH] = GsmL1_LogChComb_XIII, - //[GSM_PCHAN_TCH_F_PDCH] = FIXME, + [GSM_PCHAN_TCH_F_PDCH] = GsmL1_LogChComb_I, /*< first init + like TCH/F, until PDCH ACT */ [GSM_PCHAN_UNKNOWN] = GsmL1_LogChComb_0, }; -- To view, visit https://gerrit.osmocom.org/395 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:26:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:26:13 +0000 Subject: osmo-bts[master]: dyn PDCH: lc15: complete for litecell15-bts: implement bts_m... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:26:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:26:15 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: lc15: complete for litecell15-bts: implement bts_m... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*() ...................................................................... dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*() Analogous to 63b296bdd9a25134ee61ce6f269750e796a8bfca on osmo-bts-sysmo. Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1. Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in common/rsl.c. Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb to invoke dyn_pdch_connected() in common/rsl.c. Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4 --- M src/osmo-bts-litecell15/oml.c 1 file changed, 49 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 27df64d..8f783f3 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1836,13 +1836,60 @@ return l1if_set_txpower(trx_lc15l1_hdl(trx), ((float) p_trxout_mdBm)/1000.0); } +static int ts_disconnect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphDisconnectCnf_t *cnf = &l1p->u.mphDisconnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + LOGP(DL1C, LOGL_DEBUG, "%s Rx mphDisconnectCnf\n", + gsm_lchan_name(ts->lchan)); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_disconnected(ts); + + return 0; +} + int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { - return -ENOTSUP; + struct msgb *msg = l1p_msgb_alloc(); + struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(ts->trx); + GsmL1_MphDisconnectReq_t *cr; + + DEBUGP(DRSL, "%s TS disconnect\n", gsm_lchan_name(ts->lchan)); + cr = prim_init(msgb_l1prim(msg), GsmL1_PrimId_MphDisconnectReq, fl1h, + l1p_handle_for_ts(ts)); + cr->u8Tn = ts->nr; + + return l1if_gsm_req_compl(fl1h, msg, ts_disconnect_cb, NULL); +} + +static int ts_connect_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, + void *data) +{ + GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); + GsmL1_MphConnectCnf_t *cnf = &l1p->u.mphConnectCnf; + struct gsm_bts_trx_ts *ts = &trx->ts[cnf->u8Tn]; + OSMO_ASSERT(cnf->u8Tn < TRX_NR_TS); + + DEBUGP(DL1C, "%s %s Rx mphConnectCnf flags=%s%s%s\n", + gsm_lchan_name(ts->lchan), + gsm_pchan_name(ts->pchan), + ts->flags & TS_F_PDCH_ACTIVE ? "ACTIVE " : "", + ts->flags & TS_F_PDCH_ACT_PENDING ? "ACT_PENDING " : "", + ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : ""); + + if (ts->flags & TS_F_PDCH_PENDING_MASK) + dyn_pdch_ts_connected(ts); + + return 0; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { - return -ENOTSUP; + return ts_connect_as(ts, as_pchan, ts_connect_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/396 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:27:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:27:13 +0000 Subject: libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:28:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:28:29 +0000 Subject: openbsc[master]: debug log: log all lchan_alloc steps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/387/1/openbsc/src/libbsc/chan_alloc.c File openbsc/src/libbsc/chan_alloc.c: Line 158: DEBUGP(DRLL, "Looking for lchan %s\n", gsm_lchant_name(type)); > mention the BTS number? yes, this should be done for all log statements that were introducedin lchan_alloc... -- To view, visit https://gerrit.osmocom.org/387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2d11744d92dc06205fb1573815e11efd84842b0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:28:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:28:50 +0000 Subject: openbsc[master]: debug log: log all lchan state transitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:31:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:31:05 +0000 Subject: osmo-bts[master]: dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:31:06 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:31:06 +0000 Subject: [MERGED] osmo-bts[master]: dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected() ...................................................................... dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected() The function would currently only be called in cases where one of the if branches catches on, but for safety's and clarity's sake, don't ts_connect using as_pchan if no reconnect is pending. Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3 --- M src/common/rsl.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/rsl.c b/src/common/rsl.c index cf6cef8..674ce87 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1791,7 +1791,9 @@ gsm_lchan_name(ts->lchan)); ts->lchan[0].type = GSM_LCHAN_PDTCH; as_pchan = GSM_PCHAN_PDCH; - } + } else + /* No reconnect pending. */ + return; rc = bts_model_ts_connect(ts, as_pchan); /* Error? then NACK right now. */ -- To view, visit https://gerrit.osmocom.org/397 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:32:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:32:56 +0000 Subject: openbsc[master]: err log: tweak dyn pdch ack error logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 in general it would be useful to include some statement as to which part of the code has been modified. "err log" ca be anywhere. "libbsc: " might be a more useful prefix. -- To view, visit https://gerrit.osmocom.org/389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:33:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:33:36 +0000 Subject: [MERGED] osmo-bts[master]: vty: install orphaned trx nominal power command In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: install orphaned trx nominal power command ...................................................................... vty: install orphaned trx nominal power command The cfg_trx_nominal_power_cmd added 12 days ago in 58e4e18206501c3bffa65f0b876bbc5ebe175d6e was floating. Actually add it to the TRX_NODE. Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0 --- M src/osmo-bts-litecell15/lc15bts_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index 8c4364c..c5d404c 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -406,6 +406,8 @@ install_element(BTS_NODE, &cfg_bts_auto_band_cmd); install_element(BTS_NODE, &cfg_bts_no_auto_band_cmd); + install_element(TRX_NODE, &cfg_trx_nominal_power_cmd); + install_element(PHY_INST_NODE, &cfg_phy_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_no_dsp_trace_f_cmd); install_element(PHY_INST_NODE, &cfg_phy_cal_path_cmd); -- To view, visit https://gerrit.osmocom.org/401 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 22 23:35:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 22 Jun 2016 23:35:05 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 I'm ready to merge this as nobody seems inclined at reviwing a real fix. -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 08:55:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 23 Jun 2016 08:55:52 +0000 Subject: [PATCH] openbsc[master]: Fix vty tests with subscriber deletion In-Reply-To: References: Message-ID: Fix vty tests with subscriber deletion Use correct vty command for subscriber deletion, adjust assertions accordingly. The error was cause by inconsistent syntax of vty commands for subscriber creation and deletion. Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b --- M openbsc/tests/vty_test_runner.py 1 file changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/02/402/3 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..bae1866 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -388,12 +388,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberCreateDelete(self): @@ -413,12 +413,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberSettings(self): self.vty.enable() @@ -456,16 +456,18 @@ self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) self.vty.command("end") + # create subscriber with extension in a configured interval res = self.vty.command('subscriber create imsi ' + imsi2) self.assert_(res.find(" IMSI: " + imsi2) > 0) self.assert_(res.find("221") > 0 or res.find("222") > 0) self.assert_(res.find(" Extension: ") > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_(res != "") - res = self.vty.command('subscriber delete imsi ' + imsi2) - self.assert_(res != "") + # imsi2 is inactive so deletion should succeed + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') + self.assert_("" == res) def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther From gerrit-no-reply at lists.osmocom.org Thu Jun 23 10:21:49 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 23 Jun 2016 10:21:49 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 2: Please wait. People needing to build right now can use that patch or force two way. I thought the reported already pin-pointed a place where only "flow" is checked and not wait assign? Did anyone try that simple || state_is(..WAIT_ASSIGN)? -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 14:02:44 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 23 Jun 2016 14:02:44 +0000 Subject: [PATCH] osmo-bts[master]: Make get_lchan_by_chan_nr globally available Message-ID: Review at https://gerrit.osmocom.org/406 Make get_lchan_by_chan_nr globally available * Remove static qualifier * Remove duplicated code - use generic function instead Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-trx/l1_if.c 6 files changed, 21 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/06/406/1 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index dd25161..2735574 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -40,6 +40,8 @@ return 0; } +struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, + unsigned int chan_nr); /* allocate a msgb containing a osmo_phsap_prim + optional l2 data */ struct msgb *l1sap_msgb_alloc(unsigned int l2_len); diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 0a6bc49..5ea2a2c 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -47,8 +47,8 @@ #include #include -static struct gsm_lchan * -get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) +struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, + unsigned int chan_nr) { return &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; } diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 395ee0d..2af2481 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -439,7 +439,7 @@ struct lc15l1_hdl *fl1 = trx_lc15l1_hdl(trx); struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi, ss; + uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi; uint8_t chan_nr; GsmL1_Prim_t *l1p; struct msgb *nmsg = NULL; @@ -449,15 +449,14 @@ u8Tn = L1SAP_CHAN2TS(chan_nr); u8BlockNbr = (u32Fn % 13) >> 2; if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = GsmL1_Sapi_TchH; } else { subCh = 0x1f; - ss = 0; sapi = GsmL1_Sapi_TchF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message and fill data */ if (msg) { @@ -509,7 +508,6 @@ struct osmo_phsap_prim *l1sap) { struct lc15l1_hdl *fl1 = trx_lc15l1_hdl(trx); - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -517,9 +515,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(fl1, lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -536,9 +532,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); else if (l1sap->u.info.type == PRIM_INFO_MODIFY) { diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index c8ed216..760c988 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -546,7 +546,7 @@ struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, sapi, ss; + uint8_t u8Tn, subCh, sapi; uint8_t chan_nr; struct msgb *nmsg = NULL; @@ -554,15 +554,14 @@ u32Fn = l1sap->u.tch.fn; u8Tn = L1SAP_CHAN2TS(chan_nr); if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = cOCTVC1_GSM_SAPI_ENUM_TCHH; } else { subCh = 0xf1; - ss = 0; sapi = cOCTVC1_GSM_SAPI_ENUM_TCHF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message */ nmsg = l1p_msgb_alloc(); @@ -623,7 +622,6 @@ static int mph_info_req(struct gsm_bts_trx *trx, struct msgb *msg, struct osmo_phsap_prim *l1sap) { - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -631,9 +629,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -650,9 +646,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 0330308..355507d 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -432,7 +432,7 @@ struct femtol1_hdl *fl1 = trx_femtol1_hdl(trx); struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi, ss; + uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi; uint8_t chan_nr; GsmL1_Prim_t *l1p; struct msgb *nmsg = NULL; @@ -442,15 +442,14 @@ u8Tn = L1SAP_CHAN2TS(chan_nr); u8BlockNbr = (u32Fn % 13) >> 2; if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = GsmL1_Sapi_TchH; } else { subCh = 0x1f; - ss = 0; sapi = GsmL1_Sapi_TchF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message and fill data */ if (msg) { @@ -501,7 +500,6 @@ struct osmo_phsap_prim *l1sap) { struct femtol1_hdl *fl1 = trx_femtol1_hdl(trx); - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -509,9 +507,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(fl1, lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -528,9 +524,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); else if (l1sap->u.info.type == PRIM_INFO_MODIFY) { diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 59442d9..0a3e48d 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -527,7 +527,6 @@ struct trx_l1h *l1h = pinst->u.osmotrx.hdl; struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr; - uint8_t tn, ss; int rc = 0; struct gsm_lchan *lchan; @@ -546,9 +545,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) l1if_set_ciphering(l1h, lchan, chan_nr, 0); if (l1sap->u.info.u.ciph_req.downlink) @@ -558,9 +555,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { if ((chan_nr & 0x80)) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" -- To view, visit https://gerrit.osmocom.org/406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 23 15:10:09 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 23 Jun 2016 15:10:09 +0000 Subject: [PATCH] libosmocore[master]: Fix potential segfault in msg_dequeue Message-ID: Review at https://gerrit.osmocom.org/407 Fix potential segfault in msg_dequeue Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce --- M src/msgb.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/407/1 diff --git a/src/msgb.c b/src/msgb.c index f09da90..ea8dc82 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -101,9 +101,12 @@ return NULL; lh = queue->next; - llist_del(lh); - - return llist_entry(lh, struct msgb, list); + + if (lh) { + llist_del(lh); + return llist_entry(lh, struct msgb, list); + } else + return NULL; } /*! \brief Re-set all message buffer pointers -- To view, visit https://gerrit.osmocom.org/407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 23 16:03:00 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 23 Jun 2016 16:03:00 +0000 Subject: [PATCH] osmo-bts[master]: DTXu: move copy-pasted code to common part Message-ID: Review at https://gerrit.osmocom.org/408 DTXu: move copy-pasted code to common part Abstract code for checking/setting lchan's UL SID flag and RTP Marker into generic function and use it for LC15 and sysmoBTS. Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Related: OS#1750 --- M include/osmo-bts/msg_utils.h M src/common/msg_utils.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 4 files changed, 20 insertions(+), 36 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/408/1 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 73f8c96..591d194 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -20,6 +20,7 @@ OML_MSG_TYPE_OSMO, }; +void lchan_set_marker(bool t, struct gsm_lchan *lchan); void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, uint32_t fn, bool update); bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 6f42f73..4c0a2cc 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -86,6 +86,17 @@ return type; } +/* update lchan SID status */ +void lchan_set_marker(bool t, struct gsm_lchan *lchan) +{ + if (t) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } +} + /* store the last SID frame in lchan context */ void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, uint32_t fn, bool update) diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index ec43c10..b061fe9 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -108,12 +108,7 @@ cur = msgb_put(msg, GSM_FR_BYTES); memcpy(cur, l1_payload, GSM_FR_BYTES); - if (osmo_fr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan); return msg; } @@ -151,12 +146,8 @@ uint8_t cmr; int8_t sti, cmi; osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); - if (ft == AMR_GSM_EFR_SID) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan); + return msg; } @@ -187,12 +178,7 @@ cur = msgb_put(msg, GSM_HR_BYTES); memcpy(cur, l1_payload, GSM_HR_BYTES); - if (osmo_hr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_hr_check_sid(l1_payload, payload_len), lchan); return msg; } diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 17469f0..527f9e1 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -118,12 +118,7 @@ cur[0] |= 0xD0; #endif /* USE_L1_RTP_MODE */ - if (osmo_fr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan); return msg; } @@ -182,12 +177,8 @@ uint8_t cmr; int8_t sti, cmi; osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); - if (ft == AMR_GSM_EFR_SID) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan); + return msg; } @@ -230,12 +221,7 @@ osmo_revbytebits_buf(cur, GSM_HR_BYTES); #endif /* USE_L1_RTP_MODE */ - if (osmo_hr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_hr_check_sid(l1_payload, payload_len), lchan); return msg; } -- To view, visit https://gerrit.osmocom.org/408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:30:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 23 Jun 2016 19:30:42 +0000 Subject: openbsc[master]: debug log: log all lchan_alloc steps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 ok, I agree. This helped to figure out which TS was chosen or not chosen for TCH/F and PDCH, which is interesting for dynamic channels. Possibly we don't really really need this, will drop or improve... -- To view, visit https://gerrit.osmocom.org/387 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2d11744d92dc06205fb1573815e11efd84842b0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:55:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:55:59 +0000 Subject: osmo-bts[master]: DTXu: move copy-pasted code to common part In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:56:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:56:30 +0000 Subject: osmo-bts[master]: Make get_lchan_by_chan_nr globally available In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 24 08:49:27 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 24 Jun 2016 08:49:27 +0000 Subject: [PATCH] osmo-bts[master]: Remove duplicated nibble shift code Message-ID: Review at https://gerrit.osmocom.org/410 Remove duplicated nibble shift code Those functions are now part of libosmocore. Change-Id: Iab3206e3b41caff23f656a727605032df9798953 --- M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/tch.c 3 files changed, 0 insertions(+), 117 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/10/410/1 diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index b061fe9..187f688 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -55,45 +55,6 @@ #include "lc15bts.h" #include "l1_if.h" -/* input octet-aligned, output not octet-aligned */ -void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - /* first byte: upper nibble empty, lower nibble from src */ - out[0] = (in[0] >> 4); - - /* bytes 1.. */ - for (i = 1; i < num_whole_bytes; i++) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - else - out[i] = (in[i-1] & 0xF) << 4; -} - - -/* input unaligned, output octet-aligned */ -void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - for (i = 0; i < num_whole_bytes; i++) - out[i] = ((in[i] & 0xF) << 4) | (in[i+1] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = (in[i] & 0xF) << 4; -} - static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, struct gsm_lchan *lchan) { diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index af78980..d12a1cb 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -38,44 +38,6 @@ #include "l1_if.h" -/* input octet-aligned, output not octet-aligned */ -void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - /* first byte: upper nibble empty, lower nibble from src */ - out[0] = (in[0] >> 4); - - /* bytes 1.. */ - for (i = 1; i < num_whole_bytes; i++) - out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); - else - out[i] = (in[i - 1] & 0xF) << 4; -} - -/* input unaligned, output octet-aligned */ -void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - for (i = 0; i < num_whole_bytes; i++) - out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = (in[i] & 0xF) << 4; -} - struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) { struct msgb *msg; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 527f9e1..39feae1 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -52,46 +52,6 @@ #include "femtobts.h" #include "l1_if.h" -/* input octet-aligned, output not octet-aligned */ -void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - /* first byte: upper nibble empty, lower nibble from src */ - out[0] = (in[0] >> 4); - - /* bytes 1.. */ - for (i = 1; i < num_whole_bytes; i++) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - else - out[i] = (in[i-1] & 0xF) << 4; -} - - -/* input unaligned, output octet-aligned */ -void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - for (i = 0; i < num_whole_bytes; i++) - out[i] = ((in[i] & 0xF) << 4) | (in[i+1] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = (in[i] & 0xF) << 4; -} - - static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, struct gsm_lchan *lchan) { -- To view, visit https://gerrit.osmocom.org/410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iab3206e3b41caff23f656a727605032df9798953 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 24 09:30:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 24 Jun 2016 09:30:37 +0000 Subject: osmo-bts[master]: Remove duplicated nibble shift code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab3206e3b41caff23f656a727605032df9798953 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 24 09:30:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 24 Jun 2016 09:30:55 +0000 Subject: [MERGED] openbsc[master]: debug log: log all lchan state transitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debug log: log all lchan state transitions ...................................................................... debug log: log all lchan state transitions Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index db78fe3..032ff92 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -953,6 +953,9 @@ int rsl_lchan_set_state(struct gsm_lchan *lchan, int state) { + DEBUGP(DRSL, "%s state %s -> %s\n", + gsm_lchan_name(lchan), gsm_lchans_name(lchan->state), + gsm_lchans_name(state)); lchan->state = state; return 0; } -- To view, visit https://gerrit.osmocom.org/388 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 24 09:31:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 24 Jun 2016 09:31:13 +0000 Subject: openbsc[master]: dyn PDCH: cosmetic: clarify lchan rel with assertion and com... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3cc40022e8283daa991fffe4b6baa734303d8a5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 24 09:31:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 24 Jun 2016 09:31:17 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: cosmetic: clarify lchan rel with assertion and com... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: cosmetic: clarify lchan rel with assertion and comment ...................................................................... dyn PDCH: cosmetic: clarify lchan rel with assertion and comment Change-Id: If3cc40022e8283daa991fffe4b6baa734303d8a5 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 032ff92..a141a4b 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -764,7 +764,17 @@ do_lchan_free(lchan); - /* Put PDCH channel back into PDCH mode first */ + /* + * Put a dynamic TCH/F_PDCH channel back to PDCH mode iff it was + * released successfully. If in error, the PDCH ACT will follow after + * T3111 in error_timeout_cb(). + * + * Any state other than LCHAN_S_REL_ERR became LCHAN_S_NONE after above + * do_lchan_free(). Assert this, because that's what ensures a PDCH ACT + * on a dynamic channel in all cases. + */ + OSMO_ASSERT(lchan->state == LCHAN_S_NONE + || lchan->state == LCHAN_S_REL_ERR); if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH && lchan->state == LCHAN_S_NONE) return rsl_ipacc_pdch_activate(lchan->ts, 1); -- To view, visit https://gerrit.osmocom.org/409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3cc40022e8283daa991fffe4b6baa734303d8a5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 24 09:31:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 24 Jun 2016 09:31:26 +0000 Subject: [MERGED] osmo-bts[master]: Remove duplicated nibble shift code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove duplicated nibble shift code ...................................................................... Remove duplicated nibble shift code Those functions are now part of libosmocore. Change-Id: Iab3206e3b41caff23f656a727605032df9798953 --- M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/l1_tch.c M src/osmo-bts-sysmo/tch.c 3 files changed, 0 insertions(+), 117 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index b061fe9..187f688 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -55,45 +55,6 @@ #include "lc15bts.h" #include "l1_if.h" -/* input octet-aligned, output not octet-aligned */ -void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - /* first byte: upper nibble empty, lower nibble from src */ - out[0] = (in[0] >> 4); - - /* bytes 1.. */ - for (i = 1; i < num_whole_bytes; i++) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - else - out[i] = (in[i-1] & 0xF) << 4; -} - - -/* input unaligned, output octet-aligned */ -void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - for (i = 0; i < num_whole_bytes; i++) - out[i] = ((in[i] & 0xF) << 4) | (in[i+1] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = (in[i] & 0xF) << 4; -} - static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, struct gsm_lchan *lchan) { diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index af78980..d12a1cb 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -38,44 +38,6 @@ #include "l1_if.h" -/* input octet-aligned, output not octet-aligned */ -void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - /* first byte: upper nibble empty, lower nibble from src */ - out[0] = (in[0] >> 4); - - /* bytes 1.. */ - for (i = 1; i < num_whole_bytes; i++) - out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); - else - out[i] = (in[i - 1] & 0xF) << 4; -} - -/* input unaligned, output octet-aligned */ -void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - for (i = 0; i < num_whole_bytes; i++) - out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = (in[i] & 0xF) << 4; -} - struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len) { struct msgb *msg; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 527f9e1..39feae1 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -52,46 +52,6 @@ #include "femtobts.h" #include "l1_if.h" -/* input octet-aligned, output not octet-aligned */ -void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - /* first byte: upper nibble empty, lower nibble from src */ - out[0] = (in[0] >> 4); - - /* bytes 1.. */ - for (i = 1; i < num_whole_bytes; i++) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = ((in[i-1] & 0xF) << 4) | (in[i] >> 4); - else - out[i] = (in[i-1] & 0xF) << 4; -} - - -/* input unaligned, output octet-aligned */ -void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, - unsigned int num_nibbles) -{ - unsigned int i; - unsigned int num_whole_bytes = num_nibbles / 2; - - for (i = 0; i < num_whole_bytes; i++) - out[i] = ((in[i] & 0xF) << 4) | (in[i+1] >> 4); - - /* shift the last nibble, in case there's an odd count */ - i = num_whole_bytes; - if (num_nibbles & 1) - out[i] = (in[i] & 0xF) << 4; -} - - static struct msgb *l1_to_rtppayload_fr(uint8_t *l1_payload, uint8_t payload_len, struct gsm_lchan *lchan) { -- To view, visit https://gerrit.osmocom.org/410 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iab3206e3b41caff23f656a727605032df9798953 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 24 09:31:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 24 Jun 2016 09:31:54 +0000 Subject: [MERGED] openbsc[master]: err log: tweak dyn pdch ack error logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: err log: tweak dyn pdch ack error logging ...................................................................... err log: tweak dyn pdch ack error logging Rather use gsm_lchan_name(). Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index a141a4b..9f76280 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1233,18 +1233,18 @@ OSMO_ASSERT(ts->trx->bts); if (lchan->ts->pchan != GSM_PCHAN_TCH_F_PDCH) { - LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" - " Rx PDCH %s ACK for channel that is no TCH/F_PDCH\n", - ts->trx->bts->nr, ts->trx->nr, ts->nr, + LOGP(DRSL, LOGL_ERROR, "%s pchan=%s Rx PDCH %s ACK" + " for channel that is no TCH/F_PDCH\n", + gsm_lchan_name(lchan), gsm_pchan_name(ts->pchan), pdch_act? "ACT" : "DEACT"); return false; } if (lchan->state != LCHAN_S_NONE) { - LOGP(DRSL, LOGL_ERROR, "(bts %u, trx %u, ts %u, pchan %s)" - " Rx PDCH %s ACK in unexpected state: %s\n", - ts->trx->bts->nr, ts->trx->nr, ts->nr, + LOGP(DRSL, LOGL_ERROR, "%s pchan=%s Rx PDCH %s ACK" + " in unexpected state: %s\n", + gsm_lchan_name(lchan), gsm_pchan_name(ts->pchan), pdch_act? "ACT" : "DEACT", gsm_lchans_name(lchan->state)); -- To view, visit https://gerrit.osmocom.org/389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jun 24 10:24:32 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 24 Jun 2016 10:24:32 +0000 Subject: [PATCH] osmo-bts[master]: TRX: add Uplink DTX support for FR/HR Message-ID: Review at https://gerrit.osmocom.org/411 TRX: add Uplink DTX support for FR/HR * detect SID and set RTP Marker accordingly (emulate ONSET events) * set proper FN in TCH_IND * detect speech pause and do not send dummy 'bad' frames during that time Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc Related: OS#1750 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 13 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/411/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 96ea828..9a6a59c 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -341,7 +341,7 @@ if (len < 2) break; memset(tch_data + 2, 0, len - 2); - _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + _sched_compose_tch_ind(l1t, tn, fn, chan, tch_data, len); break; default: inval_mode1: @@ -350,7 +350,7 @@ len = 0; } if (len) - _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + _sched_compose_tch_ind(l1t, tn, fn, chan, tch_data, len); } /* get frame and unlink from queue */ @@ -939,6 +939,8 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + struct gsm_lchan *lchan = + get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); /* handle rach, if handover rach detection is turned on */ if (chan_state->ho_rach_detect == 1) @@ -987,6 +989,7 @@ : tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ rc = tch_fr_decode(tch_data, *bursts_p, 1, 0, &n_errors, &n_bits_total); + lchan_set_marker(osmo_fr_check_sid(tch_data, rc), lchan); /* DTXu */ break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ rc = tch_fr_decode(tch_data, *bursts_p, 1, 1, &n_errors, &n_bits_total); @@ -1045,6 +1048,8 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ + if (lchan->tch.ul_sid) + return 0; /* DTXu: pause in progress */ memset(tch_data, 0, GSM_FR_BYTES); rc = GSM_FR_BYTES; break; @@ -1090,6 +1095,8 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + struct gsm_lchan *lchan = + get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); /* handle rach, if handover rach detection is turned on */ if (chan_state->ho_rach_detect == 1) @@ -1152,6 +1159,7 @@ rc = tch_hr_decode(tch_data, *bursts_p, (((fn + 26 - 10) % 26) >> 2) & 1, &n_errors, &n_bits_total); + lchan_set_marker(osmo_hr_check_sid(tch_data, rc), lchan); /* DTXu */ break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ /* the first FN 0,8,17 or 1,9,18 defines that CMI is included @@ -1211,6 +1219,8 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* HR */ + if (lchan->tch.ul_sid) + return 0; /* DTXu: pause in progress */ tch_data[0] = 0x70; /* F = 0, FT = 111 */ memset(tch_data + 1, 0, 14); rc = 15; -- To view, visit https://gerrit.osmocom.org/411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jun 24 12:02:41 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 24 Jun 2016 12:02:41 +0000 Subject: osmo-pcu[master]: Revert "tbf: Add state WAIT_ASSIGN" In-Reply-To: References: Message-ID: Patch Set 2: > Did anyone try that simple || state_is(..WAIT_ASSIGN)? http://osmocom.org/issues/1756#note-9 -- To view, visit https://gerrit.osmocom.org/218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:57:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:57:10 +0000 Subject: libosmocore[master]: Fix potential segfault in msg_dequeue In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:57:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:57:39 +0000 Subject: openbsc[master]: vty: show lchan summary: also show lchan->state In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:57:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:57:59 +0000 Subject: openbsc[master]: Fix vty tests with subscriber deletion In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:58:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:58:34 +0000 Subject: openbsc[master]: dyn PDCH: enable PDCH only after release due to error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:58:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:58:47 +0000 Subject: [MERGED] osmo-bts[master]: fix compiler warning: remove useless 'static' storage class ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix compiler warning: remove useless 'static' storage class for struct decl ...................................................................... fix compiler warning: remove useless 'static' storage class for struct decl Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index 3bc788c..a9e8629 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -87,7 +87,7 @@ }, }; -static struct calTbl_t +struct calTbl_t { union { -- To view, visit https://gerrit.osmocom.org/399 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:58:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:58:47 +0000 Subject: [MERGED] osmo-bts[master]: fix compiler warnings: include bts_model.h in phy_link.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix compiler warnings: include bts_model.h in phy_link.c ...................................................................... fix compiler warnings: include bts_model.h in phy_link.c The file calls bts_model_* API which was yet undeclared. Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 --- M src/common/phy_link.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/common/phy_link.c b/src/common/phy_link.c index 43bb31c..25b7e5d 100644 --- a/src/common/phy_link.c +++ b/src/common/phy_link.c @@ -8,6 +8,7 @@ #include #include #include +#include static LLIST_HEAD(g_phy_links); -- To view, visit https://gerrit.osmocom.org/398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:58:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:58:47 +0000 Subject: [MERGED] osmo-bts[master]: fix compiler warning: remove unused variable 'i' in calib_ve... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix compiler warning: remove unused variable 'i' in calib_verify() ...................................................................... fix compiler warning: remove unused variable 'i' in calib_verify() Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb --- M src/osmo-bts-litecell15/calib_file.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/osmo-bts-litecell15/calib_file.c b/src/osmo-bts-litecell15/calib_file.c index a9e8629..ac39e46 100644 --- a/src/osmo-bts-litecell15/calib_file.c +++ b/src/osmo-bts-litecell15/calib_file.c @@ -307,7 +307,7 @@ static int calib_verify(struct lc15l1_hdl *fl1h, const struct calib_file_desc *desc) { - int i, rc, sz; + int rc, sz; struct calib_send_state *st = &fl1h->st; struct phy_link *plink = fl1h->phy_inst->phy_link; char *rbuf; -- To view, visit https://gerrit.osmocom.org/400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 19:59:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 19:59:05 +0000 Subject: [MERGED] libosmocore[master]: Add octet-aligned/unaligned shift functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add octet-aligned/unaligned shift functions ...................................................................... Add octet-aligned/unaligned shift functions The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests, doxygen annotation and extra memory safety check. Those functions are used in several BTS implementations but seems generic enough to be generally useful. Change-Id: I2b1901c4161e8035f059585901dca593b661556d --- M include/osmocom/core/bits.h M src/bits.c M tests/bits/bitrev_test.c M tests/bits/bitrev_test.ok 4 files changed, 183 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/bits.h b/include/osmocom/core/bits.h index 3218330..5535920 100644 --- a/include/osmocom/core/bits.h +++ b/include/osmocom/core/bits.h @@ -41,6 +41,11 @@ int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits); +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles); + void osmo_ubit2sbit(sbit_t *out, const ubit_t *in, unsigned int num_bits); void osmo_sbit2ubit(ubit_t *out, const sbit_t *in, unsigned int num_bits); diff --git a/src/bits.c b/src/bits.c index 569a10f..0c77b27 100644 --- a/src/bits.c +++ b/src/bits.c @@ -61,6 +61,54 @@ return outptr - out; } +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, unaligned + * \param[in] in input buffer, octet-aligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_right(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + if (!num_whole_bytes) + return; + + /* first byte: upper nibble empty, lower nibble from src */ + out[0] = (in[0] >> 4); + + /* bytes 1.. */ + for (i = 1; i < num_whole_bytes; i++) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = ((in[i - 1] & 0xF) << 4) | (in[i] >> 4); + else + out[i] = (in[i - 1] & 0xF) << 4; +} + +/*! \brief Shift unaligned input to octet-aligned output + * \param[out] out output buffer, octet-aligned + * \param[in] in input buffer, unaligned + * \param[in] num_nibbles number of nibbles + */ +void osmo_nibble_shift_left_unal(uint8_t *out, const uint8_t *in, + unsigned int num_nibbles) +{ + unsigned int i, num_whole_bytes = num_nibbles / 2; + if (!num_whole_bytes) + return; + + for (i = 0; i < num_whole_bytes; i++) + out[i] = ((in[i] & 0xF) << 4) | (in[i + 1] >> 4); + + /* shift the last nibble, in case there's an odd count */ + i = num_whole_bytes; + if (num_nibbles & 1) + out[i] = (in[i] & 0xF) << 4; +} + /*! \brief convert unpacked bits to soft bits * \param[out] out output buffer of soft bits * \param[in] in input buffer of unpacked bits diff --git a/tests/bits/bitrev_test.c b/tests/bits/bitrev_test.c index 987f4d5..08f0827 100644 --- a/tests/bits/bitrev_test.c +++ b/tests/bits/bitrev_test.c @@ -205,6 +205,20 @@ printcheck16(e, test, test, (BE == e) ? s : NULL, print); } +static void sh_chk(const uint8_t *in, uint8_t len, unsigned int nib, bool r) +{ + uint8_t x[len]; + if (r) + osmo_nibble_shift_right(x, in, nib); + else + osmo_nibble_shift_left_unal(x, in, nib); + + printf("[%u] %s IN: %s, nibble %u:", len, r ? "R" : "L", + osmo_hexdump_nospc(in, len), nib); + /* do NOT combine those printfs: osmo_hexdump* use static buffer which + WILL screw things up in that case */ + printf("\n OUT: %s\n", osmo_hexdump_nospc(x, nib/2)); +} int main(int argc, char **argv) { @@ -274,5 +288,16 @@ check16(0, BE); check16(0, LE); + printf("running nibble tests...\n"); + + const uint8_t in1[] = { 0xF0, 0x0D, 0xCA, 0xFE, 0xDE, 0xAD, 0xBE, 0xEF }, + in2[] = { 0xB0, 0x0B, 0xBA, 0xBE, 0xFA, 0xCE }; + + for (offs = 0; offs < 13; offs++) { + sh_chk(in1, ARRAY_SIZE(in1), offs, true); + sh_chk(in1, ARRAY_SIZE(in1), offs, false); + sh_chk(in2, ARRAY_SIZE(in2), offs, true); + sh_chk(in2, ARRAY_SIZE(in2), offs, false); + } return 0; } diff --git a/tests/bits/bitrev_test.ok b/tests/bits/bitrev_test.ok index 90cb295..9fbb4d9 100644 --- a/tests/bits/bitrev_test.ok +++ b/tests/bits/bitrev_test.ok @@ -53,3 +53,108 @@ 24 LE OK 16 BE OK, storage OK 16 LE OK +running nibble tests... +[8] R IN: f00dcafedeadbeef, nibble 0: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 0: + OUT: +[6] R IN: b00bbabeface, nibble 0: + OUT: +[6] L IN: b00bbabeface, nibble 0: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 1: + OUT: +[8] L IN: f00dcafedeadbeef, nibble 1: + OUT: +[6] R IN: b00bbabeface, nibble 1: + OUT: +[6] L IN: b00bbabeface, nibble 1: + OUT: +[8] R IN: f00dcafedeadbeef, nibble 2: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 2: + OUT: 00 +[6] R IN: b00bbabeface, nibble 2: + OUT: 0b +[6] L IN: b00bbabeface, nibble 2: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 3: + OUT: 0f +[8] L IN: f00dcafedeadbeef, nibble 3: + OUT: 00 +[6] R IN: b00bbabeface, nibble 3: + OUT: 0b +[6] L IN: b00bbabeface, nibble 3: + OUT: 00 +[8] R IN: f00dcafedeadbeef, nibble 4: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 4: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 4: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 4: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 5: + OUT: 0f00 +[8] L IN: f00dcafedeadbeef, nibble 5: + OUT: 00dc +[6] R IN: b00bbabeface, nibble 5: + OUT: 0b00 +[6] L IN: b00bbabeface, nibble 5: + OUT: 00bb +[8] R IN: f00dcafedeadbeef, nibble 6: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 6: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 6: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 6: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 7: + OUT: 0f00dc +[8] L IN: f00dcafedeadbeef, nibble 7: + OUT: 00dcaf +[6] R IN: b00bbabeface, nibble 7: + OUT: 0b00bb +[6] L IN: b00bbabeface, nibble 7: + OUT: 00bbab +[8] R IN: f00dcafedeadbeef, nibble 8: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 8: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 8: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 8: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 9: + OUT: 0f00dcaf +[8] L IN: f00dcafedeadbeef, nibble 9: + OUT: 00dcafed +[6] R IN: b00bbabeface, nibble 9: + OUT: 0b00bbab +[6] L IN: b00bbabeface, nibble 9: + OUT: 00bbabef +[8] R IN: f00dcafedeadbeef, nibble 10: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 10: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 10: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 10: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 11: + OUT: 0f00dcafed +[8] L IN: f00dcafedeadbeef, nibble 11: + OUT: 00dcafedea +[6] R IN: b00bbabeface, nibble 11: + OUT: 0b00bbabef +[6] L IN: b00bbabeface, nibble 11: + OUT: 00bbabefac +[8] R IN: f00dcafedeadbeef, nibble 12: + OUT: 0f00dcafedea +[8] L IN: f00dcafedeadbeef, nibble 12: + OUT: 00dcafedeadb +[6] R IN: b00bbabeface, nibble 12: + OUT: 0b00bbabefac +[6] L IN: b00bbabeface, nibble 12: + OUT: 00bbabeface0 -- To view, visit https://gerrit.osmocom.org/326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b1901c4161e8035f059585901dca593b661556d Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 23 20:00:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 20:00:33 +0000 Subject: [MERGED] libosmocore[master]: Fix potential segfault in msg_dequeue In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix potential segfault in msg_dequeue ...................................................................... Fix potential segfault in msg_dequeue Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce --- M src/msgb.c 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/msgb.c b/src/msgb.c index f09da90..ea8dc82 100644 --- a/src/msgb.c +++ b/src/msgb.c @@ -101,9 +101,12 @@ return NULL; lh = queue->next; - llist_del(lh); - - return llist_entry(lh, struct msgb, list); + + if (lh) { + llist_del(lh); + return llist_entry(lh, struct msgb, list); + } else + return NULL; } /*! \brief Re-set all message buffer pointers -- To view, visit https://gerrit.osmocom.org/407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 20:00:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 20:00:44 +0000 Subject: [MERGED] osmo-bts[master]: Make get_lchan_by_chan_nr globally available In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make get_lchan_by_chan_nr globally available ...................................................................... Make get_lchan_by_chan_nr globally available * Remove static qualifier * Remove duplicated code - use generic function instead Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d --- M include/osmo-bts/l1sap.h M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-trx/l1_if.c 6 files changed, 21 insertions(+), 42 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index dd25161..2735574 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -40,6 +40,8 @@ return 0; } +struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, + unsigned int chan_nr); /* allocate a msgb containing a osmo_phsap_prim + optional l2 data */ struct msgb *l1sap_msgb_alloc(unsigned int l2_len); diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 0a6bc49..5ea2a2c 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -47,8 +47,8 @@ #include #include -static struct gsm_lchan * -get_lchan_by_chan_nr(struct gsm_bts_trx *trx, unsigned int chan_nr) +struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx, + unsigned int chan_nr) { return &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; } diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 395ee0d..2af2481 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -439,7 +439,7 @@ struct lc15l1_hdl *fl1 = trx_lc15l1_hdl(trx); struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi, ss; + uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi; uint8_t chan_nr; GsmL1_Prim_t *l1p; struct msgb *nmsg = NULL; @@ -449,15 +449,14 @@ u8Tn = L1SAP_CHAN2TS(chan_nr); u8BlockNbr = (u32Fn % 13) >> 2; if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = GsmL1_Sapi_TchH; } else { subCh = 0x1f; - ss = 0; sapi = GsmL1_Sapi_TchF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message and fill data */ if (msg) { @@ -509,7 +508,6 @@ struct osmo_phsap_prim *l1sap) { struct lc15l1_hdl *fl1 = trx_lc15l1_hdl(trx); - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -517,9 +515,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(fl1, lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -536,9 +532,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); else if (l1sap->u.info.type == PRIM_INFO_MODIFY) { diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index c8ed216..760c988 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -546,7 +546,7 @@ struct octphy_hdl *fl1h = pinst->phy_link->u.octphy.hdl; struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, sapi, ss; + uint8_t u8Tn, subCh, sapi; uint8_t chan_nr; struct msgb *nmsg = NULL; @@ -554,15 +554,14 @@ u32Fn = l1sap->u.tch.fn; u8Tn = L1SAP_CHAN2TS(chan_nr); if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = cOCTVC1_GSM_SAPI_ENUM_TCHH; } else { subCh = 0xf1; - ss = 0; sapi = cOCTVC1_GSM_SAPI_ENUM_TCHF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message */ nmsg = l1p_msgb_alloc(); @@ -623,7 +622,6 @@ static int mph_info_req(struct gsm_bts_trx *trx, struct msgb *msg, struct osmo_phsap_prim *l1sap) { - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -631,9 +629,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -650,9 +646,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 0330308..355507d 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -432,7 +432,7 @@ struct femtol1_hdl *fl1 = trx_femtol1_hdl(trx); struct gsm_lchan *lchan; uint32_t u32Fn; - uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi, ss; + uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi; uint8_t chan_nr; GsmL1_Prim_t *l1p; struct msgb *nmsg = NULL; @@ -442,15 +442,14 @@ u8Tn = L1SAP_CHAN2TS(chan_nr); u8BlockNbr = (u32Fn % 13) >> 2; if (L1SAP_IS_CHAN_TCHH(chan_nr)) { - ss = subCh = L1SAP_CHAN2SS_TCHH(chan_nr); + subCh = L1SAP_CHAN2SS_TCHH(chan_nr); sapi = GsmL1_Sapi_TchH; } else { subCh = 0x1f; - ss = 0; sapi = GsmL1_Sapi_TchF; } - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); /* create new message and fill data */ if (msg) { @@ -501,7 +500,6 @@ struct osmo_phsap_prim *l1sap) { struct femtol1_hdl *fl1 = trx_femtol1_hdl(trx); - uint8_t u8Tn, ss; uint8_t chan_nr; struct gsm_lchan *lchan; int rc = 0; @@ -509,9 +507,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) { l1if_set_ciphering(fl1, lchan, 0); lchan->ciph_state = LCHAN_CIPH_RX_REQ; @@ -528,9 +524,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - u8Tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[u8Tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) l1if_rsl_chan_act(lchan); else if (l1sap->u.info.type == PRIM_INFO_MODIFY) { diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 59442d9..0a3e48d 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -527,7 +527,6 @@ struct trx_l1h *l1h = pinst->u.osmotrx.hdl; struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr; - uint8_t tn, ss; int rc = 0; struct gsm_lchan *lchan; @@ -546,9 +545,7 @@ switch (l1sap->u.info.type) { case PRIM_INFO_ACT_CIPH: chan_nr = l1sap->u.info.u.ciph_req.chan_nr; - tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.u.ciph_req.uplink) l1if_set_ciphering(l1h, lchan, chan_nr, 0); if (l1sap->u.info.u.ciph_req.downlink) @@ -558,9 +555,7 @@ case PRIM_INFO_DEACTIVATE: case PRIM_INFO_MODIFY: chan_nr = l1sap->u.info.u.act_req.chan_nr; - tn = L1SAP_CHAN2TS(chan_nr); - ss = l1sap_chan2ss(chan_nr); - lchan = &trx->ts[tn].lchan[ss]; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (l1sap->u.info.type == PRIM_INFO_ACTIVATE) { if ((chan_nr & 0x80)) { LOGP(DL1C, LOGL_ERROR, "Cannot activate" -- To view, visit https://gerrit.osmocom.org/406 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 20:01:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 20:01:02 +0000 Subject: [MERGED] osmo-bts[master]: DTXu: move copy-pasted code to common part In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTXu: move copy-pasted code to common part ...................................................................... DTXu: move copy-pasted code to common part Abstract code for checking/setting lchan's UL SID flag and RTP Marker into generic function and use it for LC15 and sysmoBTS. Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Related: OS#1750 --- M include/osmo-bts/msg_utils.h M src/common/msg_utils.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/tch.c 4 files changed, 20 insertions(+), 36 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 73f8c96..591d194 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -20,6 +20,7 @@ OML_MSG_TYPE_OSMO, }; +void lchan_set_marker(bool t, struct gsm_lchan *lchan); void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, uint32_t fn, bool update); bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 6f42f73..4c0a2cc 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -86,6 +86,17 @@ return type; } +/* update lchan SID status */ +void lchan_set_marker(bool t, struct gsm_lchan *lchan) +{ + if (t) + lchan->tch.ul_sid = true; + else if (lchan->tch.ul_sid) { + lchan->tch.ul_sid = false; + lchan->rtp_tx_marker = true; + } +} + /* store the last SID frame in lchan context */ void save_last_sid(struct gsm_lchan *lchan, uint8_t *l1_payload, size_t length, uint32_t fn, bool update) diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index ec43c10..b061fe9 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -108,12 +108,7 @@ cur = msgb_put(msg, GSM_FR_BYTES); memcpy(cur, l1_payload, GSM_FR_BYTES); - if (osmo_fr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan); return msg; } @@ -151,12 +146,8 @@ uint8_t cmr; int8_t sti, cmi; osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); - if (ft == AMR_GSM_EFR_SID) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan); + return msg; } @@ -187,12 +178,7 @@ cur = msgb_put(msg, GSM_HR_BYTES); memcpy(cur, l1_payload, GSM_HR_BYTES); - if (osmo_hr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_hr_check_sid(l1_payload, payload_len), lchan); return msg; } diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 17469f0..527f9e1 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -118,12 +118,7 @@ cur[0] |= 0xD0; #endif /* USE_L1_RTP_MODE */ - if (osmo_fr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_fr_check_sid(l1_payload, payload_len), lchan); return msg; } @@ -182,12 +177,8 @@ uint8_t cmr; int8_t sti, cmi; osmo_amr_rtp_dec(l1_payload, payload_len, &cmr, &cmi, &ft, &bfi, &sti); - if (ft == AMR_GSM_EFR_SID) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(ft == AMR_GSM_EFR_SID, lchan); + return msg; } @@ -230,12 +221,7 @@ osmo_revbytebits_buf(cur, GSM_HR_BYTES); #endif /* USE_L1_RTP_MODE */ - if (osmo_hr_check_sid(l1_payload, payload_len)) - lchan->tch.ul_sid = true; - else if (lchan->tch.ul_sid) { - lchan->tch.ul_sid = false; - lchan->rtp_tx_marker = true; - } + lchan_set_marker(osmo_hr_check_sid(l1_payload, payload_len), lchan); return msg; } -- To view, visit https://gerrit.osmocom.org/408 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ica5392e92bab29164711163e7b01adb174272883 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 20:01:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 20:01:10 +0000 Subject: [MERGED] openbsc[master]: dyn PDCH: enable PDCH only after release due to error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dyn PDCH: enable PDCH only after release due to error ...................................................................... dyn PDCH: enable PDCH only after release due to error In rsl_rx_rf_chan_rel_ack(), only activate PDCH when in NONE state. For the case of REL_ERR state, do the PDCH activation in the error timeout callback after T3111 is done. Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index fc56862..db78fe3 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -644,6 +644,10 @@ /* go back to the none state */ LOGP(DRSL, LOGL_INFO, "%s is back in operation.\n", gsm_lchan_name(lchan)); rsl_lchan_set_state(lchan, LCHAN_S_NONE); + + /* Put PDCH channel back into PDCH mode */ + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + rsl_ipacc_pdch_activate(lchan->ts, 1); } static int rsl_rx_rf_chan_rel_ack(struct gsm_lchan *lchan); @@ -761,7 +765,8 @@ do_lchan_free(lchan); /* Put PDCH channel back into PDCH mode first */ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH) + if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH + && lchan->state == LCHAN_S_NONE) return rsl_ipacc_pdch_activate(lchan->ts, 1); return 0; -- To view, visit https://gerrit.osmocom.org/390 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 20:01:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 23 Jun 2016 20:01:25 +0000 Subject: [MERGED] openbsc[master]: vty: show lchan summary: also show lchan->state In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: show lchan summary: also show lchan->state ...................................................................... vty: show lchan summary: also show lchan->state Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 578b005..04f2cc6 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1120,10 +1120,13 @@ lchan->meas_rep_idx, 1); mr = &lchan->meas_rep[idx]; - vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u, Type %s - " + vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s, Lchan %u, Type %s, State %s - " "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - lchan->nr, gsm_lchant_name(lchan->type), mr->ms_l1.pwr, + gsm_pchan_name(lchan->ts->pchan), + lchan->nr, + gsm_lchant_name(lchan->type), gsm_lchans_name(lchan->state), + mr->ms_l1.pwr, rxlev2dbm(mr->dl.full.rx_lev), rxlev2dbm(mr->ul.full.rx_lev), VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 23 20:48:19 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 23 Jun 2016 20:48:19 +0000 Subject: [PATCH] openbsc[master]: dyn PDCH: cosmetic: clarify lchan rel with assertion and com... Message-ID: Review at https://gerrit.osmocom.org/409 dyn PDCH: cosmetic: clarify lchan rel with assertion and comment Change-Id: If3cc40022e8283daa991fffe4b6baa734303d8a5 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/09/409/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index db78fe3..adfd415 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -764,7 +764,17 @@ do_lchan_free(lchan); - /* Put PDCH channel back into PDCH mode first */ + /* + * Put a dynamic TCH/F_PDCH channel back to PDCH mode iff it was + * released successfully. If in error, the PDCH ACT will follow after + * T3111 in error_timeout_cb(). + * + * Any state other than LCHAN_S_REL_ERR became LCHAN_S_NONE after above + * do_lchan_free(). Assert this, because that's what ensures a PDCH ACT + * on a dynamic channel in all cases. + */ + OSMO_ASSERT(lchan->state == LCHAN_S_NONE + || lchan->state == LCHAN_S_REL_ERR); if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH && lchan->state == LCHAN_S_NONE) return rsl_ipacc_pdch_activate(lchan->ts, 1); -- To view, visit https://gerrit.osmocom.org/409 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3cc40022e8283daa991fffe4b6baa734303d8a5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jun 24 12:15:57 2016 From: gerrit-no-reply at lists.osmocom.org (prasadkg) Date: Fri, 24 Jun 2016 12:15:57 +0000 Subject: [PATCH] osmo-pcu[master]: Fix issues in URBB generation in EGPRS PUAN Message-ID: Review at https://gerrit.osmocom.org/412 Fix issues in URBB generation in EGPRS PUAN Below issue in number of bits of uncompresed bitmap 1. Corrected the calculation of number of bits that is included in URBB 2. If length is not present, 0s are coded as remaining bits Along with this, code is restructured to enable addition of compression support Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 --- M src/encoding.cpp 1 file changed, 46 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/412/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index e174c80..ff91309 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -25,6 +25,11 @@ #include #include +extern "C" { +#include +#include +} + #include #include @@ -537,7 +542,6 @@ gprs_rlc_ul_window *window, bool is_final) { int urbb_len = 0; - int crbb_len = 0; int len; bool bow = true; bool eow = true; @@ -545,6 +549,9 @@ int num_blocks = window->mod_sns(window->v_r() - window->v_q()); int esn_crbb = window->mod_sns(ssn - 1); int rest_bits = dest->data_len * 8 - wp; + int is_compressed = 0; + bool len_coded = true; + uint8_t i; if (num_blocks > 0) /* V(Q) is NACK and omitted -> SSN = V(Q) + 1 */ @@ -553,31 +560,30 @@ if (num_blocks > window->ws()) num_blocks = window->ws(); - if (num_blocks > rest_bits) { - eow = false; - urbb_len = rest_bits; - /* TODO: use compression, start encoding bits and stop when the - * space is exhausted. Use the first combination that encodes - * all bits. If there is none, use the combination that encodes - * the largest number of bits (e.g. by setting num_blocks to the - * max and repeating the construction). - */ - } else if (num_blocks > rest_bits - 9) { - /* union bit and length field take 9 bits */ - eow = false; - urbb_len = rest_bits - 9; - /* TODO: use compression (see above) */ + if (is_compressed == 0) { + /* Union bit takes 1 bit */ + /* Other fields in descr for uncompresed bitmap takes 23 bits*/ + + if (num_blocks > rest_bits - 15 - 1) { + eow = false; + urbb_len = rest_bits - 15 - 1; + len_coded = false; + } else if (num_blocks == rest_bits - 15 - 1) { + urbb_len = rest_bits - 15 - 1; + len_coded = false; + /* Union bit takes 1 bit length field takes 8 bits*/ + } else if (num_blocks > rest_bits - 15 - 9) { + eow = false; + urbb_len = rest_bits - 15 - 9; + } else + urbb_len = num_blocks; + len = urbb_len + 15; + } else { + /* TODO Compressed bitmap */ } - if (urbb_len + crbb_len == rest_bits) - len = -1; - else if (crbb_len == 0) - len = urbb_len + 15; - else - len = urbb_len + crbb_len + 23; - /* EGPRS Ack/Nack Description IE */ - if (len < 0) { + if (len_coded == false) { bitvec_write_field(dest, wp, 0, 1); // 0: don't have length } else { bitvec_write_field(dest, wp, 1, 1); // 1: have length @@ -588,21 +594,30 @@ bitvec_write_field(dest, wp, bow, 1); // BEGINNING_OF_WINDOW bitvec_write_field(dest, wp, eow, 1); // END_OF_WINDOW bitvec_write_field(dest, wp, ssn, 11); // STARTING_SEQUENCE_NUMBER - bitvec_write_field(dest, wp, 0, 1); // 0: don't have CRBB - - /* TODO: Add CRBB support */ - + if (is_compressed) { + /* TODO Add CRBB support */ + } + else { + bitvec_write_field(dest, wp, 0, 1); // CRBB_Exist + } LOGP(DRLCMACUL, LOGL_DEBUG, - " - EGPRS URBB, len = %d, SSN = %d, ESN_CRBB = %d, " + "EGPRS URBB, urbb len = %d, SSN = %d, ESN_CRBB = %d, " + "len present = %s,desc len = %d, " "SNS = %d, WS = %d, V(Q) = %d, V(R) = %d%s%s\n", - urbb_len, ssn, esn_crbb, + urbb_len, ssn, esn_crbb, len_coded ? "yes" : "No" ,len, window->sns(), window->ws(), window->v_q(), window->v_r(), bow ? ", BOW" : "", eow ? ", EOW" : ""); - for (int i = urbb_len; i > 0; i--) { - /* Set bit at the appropriate position (see 3GPP TS 04.60 12.3.1) */ + + for (i = urbb_len; i > 0; i--) { + /* Set bit at the appropriate position (see 3GPP TS 04.60 12.3.1) */ bool is_ack = window->m_v_n.is_received(esn_crbb + i); bitvec_write_field(dest, wp, is_ack, 1); } + /* If len is not coded, set remaining bits as 0 */ + if (len_coded == false) { + for (i = wp; i < dest->data_len*8; i++) + bitvec_write_field(dest, wp, 0, 1); + } } static void write_packet_uplink_ack_egprs( -- To view, visit https://gerrit.osmocom.org/412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg From gerrit-no-reply at lists.osmocom.org Fri Jun 24 12:15:57 2016 From: gerrit-no-reply at lists.osmocom.org (prasadkg) Date: Fri, 24 Jun 2016 12:15:57 +0000 Subject: [PATCH] osmo-pcu[master]: Add compression support in EGPRS PUAN Message-ID: Review at https://gerrit.osmocom.org/413 Add compression support in EGPRS PUAN This adds compression of bitmap in PUAN. The compressed bitmap is used only if the number of bits in the bitmap does not fit in the message and there is a gain after compression. The algorithm is part of libosmocore and so there is dependency on the libosmocore for compilation. The algorithm is tested on integration setup by forcing compression. Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa --- M src/encoding.cpp M src/rlc.cpp M src/rlc.h 3 files changed, 98 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/413/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index ff91309..6720975 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -542,15 +542,23 @@ gprs_rlc_ul_window *window, bool is_final) { int urbb_len = 0; - int len; + uint8_t crbb_len = 0; + uint8_t len; bool bow = true; bool eow = true; int ssn = window->mod_sns(window->v_q() + 1); int num_blocks = window->mod_sns(window->v_r() - window->v_q()); int esn_crbb = window->mod_sns(ssn - 1); int rest_bits = dest->data_len * 8 - wp; + uint8_t rbb[128] = {'\0'}; + uint8_t iter = 0; int is_compressed = 0; + uint16_t ucmp_bmplen; + uint8_t crbb_bitmap[127] = {'\0'}; + bitvec out; + uint16_t uclen_crbb = 0; bool len_coded = true; + uint8_t crbb_start_clr_code; uint8_t i; if (num_blocks > 0) @@ -559,6 +567,33 @@ if (num_blocks > window->ws()) num_blocks = window->ws(); + + if (num_blocks > rest_bits - 23 - 9) { + /* Try Compression as number of blocks does not fit */ + is_compressed = 1; + } + if (is_compressed == 1) { + ucmp_bmplen = window->update_egprs_rbb(rbb); + out.data = rbb; + out.cur_bit = 0; + out.data_len = ucmp_bmplen; + LOGP(DRLCMACUL, LOGL_DEBUG, + "rest_bits=%d uncompressed len %d and uncompressed bitmap = %s\n", + rest_bits, ucmp_bmplen, + osmo_hexdump(out.data, (out.data_len+7)/8)); + + is_compressed = osmo_bitmap_compress(&out, /* Uncompressed bitmap*/ + &ucmp_bmplen, /*Uncompressed bitmap len*/ + &crbb_len, /*Compressed bitmap len */ + crbb_bitmap, + &uclen_crbb, + (rest_bits - 23 - 9));/* 9 bits for union + length */ + LOGP(DRLCMACUL, LOGL_DEBUG, + "the ucmp len=%d uclen_crbb=%d num_blocks=%d crbb length %d, " + "and the CRBB bitmap = %s\n", + ucmp_bmplen, uclen_crbb, num_blocks, crbb_len, + osmo_hexdump(crbb_bitmap, (crbb_len+7)/8)); + } if (is_compressed == 0) { /* Union bit takes 1 bit */ @@ -579,7 +614,22 @@ urbb_len = num_blocks; len = urbb_len + 15; } else { - /* TODO Compressed bitmap */ + if (num_blocks > uclen_crbb) { + eow = false; + urbb_len = num_blocks - uclen_crbb; + } + /* Union bit takes 1 bit */ + /* Other fields in descr of compresed bitmap takes 23 bits*/ + if (urbb_len > (rest_bits - crbb_len - 23 - 1)) { + eow = false; + len_coded = false; + urbb_len = rest_bits - crbb_len - 23 - 1; + } else if (urbb_len > (rest_bits - crbb_len - 23 - 9)) { + eow = false; + len_coded = false; + urbb_len = rest_bits - crbb_len - 23 - 9; + } + len = urbb_len + crbb_len + 23; } /* EGPRS Ack/Nack Description IE */ @@ -595,9 +645,25 @@ bitvec_write_field(dest, wp, eow, 1); // END_OF_WINDOW bitvec_write_field(dest, wp, ssn, 11); // STARTING_SEQUENCE_NUMBER if (is_compressed) { - /* TODO Add CRBB support */ - } - else { + bitvec_write_field(dest, wp, 1, 1); // CRBB_Exist + bitvec_write_field(dest, wp, crbb_len, 7); // CRBB_LENGTH + crbb_start_clr_code = (0x80 & crbb_bitmap[0])>>7; + bitvec_write_field(dest, wp, crbb_start_clr_code, 1); // CRBB_clr_code + LOGP(DRLCMACUL, LOGL_DEBUG, + "EGPRS CRBB, crbb_len = %d, crbb_start_clr_code = %d\n", + crbb_len, crbb_start_clr_code); + while (crbb_len != 0) { + if (crbb_len > 8) { + bitvec_write_field(dest, wp, crbb_bitmap[iter], 8); + crbb_len = crbb_len - 8; + iter++; + } else { + bitvec_write_field(dest, wp, crbb_bitmap[iter], crbb_len); + crbb_len = 0; + } + } + esn_crbb = window->mod_sns(esn_crbb + uclen_crbb); + } else { bitvec_write_field(dest, wp, 0, 1); // CRBB_Exist } LOGP(DRLCMACUL, LOGL_DEBUG, diff --git a/src/rlc.cpp b/src/rlc.cpp index 6770043..1b178a1 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -83,6 +83,32 @@ return resend; } +/* Update the receive block bitmap */ +uint16_t gprs_rlc_ul_window::update_egprs_rbb(uint8_t *rbb) +{ + int i; + uint16_t bsn; + uint16_t bitmask = 0x80; + int8_t pos = 0; + int8_t bit_pos = 0; + for (i = 0, bsn = (v_q()+1); ((bsn < (v_r())) && (i < ws())); i++, + bsn = this->mod_sns(bsn + 1)) { + if (m_v_n.is_received(bsn)) { + rbb[pos] = rbb[pos] | bitmask; + } else { + rbb[pos] = rbb[pos] & (~bitmask); + } + bitmask = bitmask >> 1; + bit_pos++; + bit_pos = bit_pos % 8; + if(bit_pos == 0) { + pos++; + bitmask = 0x80; + } + } + return i; +} + int gprs_rlc_dl_window::count_unacked() { uint16_t unacked = 0; diff --git a/src/rlc.h b/src/rlc.h index ad10b3a..086f66e 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -259,6 +259,7 @@ bool is_received(uint16_t bsn) const; void update_rbb(char *rbb); + uint16_t update_egprs_rbb(uint8_t *rbb); void raise_v_r_to(int moves); void raise_v_r(const uint16_t bsn); uint16_t raise_v_q(); -- To view, visit https://gerrit.osmocom.org/413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg From gerrit-no-reply at lists.osmocom.org Fri Jun 24 12:15:58 2016 From: gerrit-no-reply at lists.osmocom.org (prasadkg) Date: Fri, 24 Jun 2016 12:15:58 +0000 Subject: [PATCH] osmo-pcu[master]: Add test case for testing PUAN Message-ID: Review at https://gerrit.osmocom.org/414 Add test case for testing PUAN This test is particularly to validate compressed and uncompressed bitmaps in PUAN. The compressed bitmap is tested by forcing the generation of CRBB in the source code. Corresponding log files .err and .ok are modified Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9 --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 3 files changed, 451 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/414/1 diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index e1be844..90f61a7 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -35,6 +35,7 @@ #include #include #include +#include } #include @@ -617,6 +618,140 @@ &ulreq, tbf->poll_fn); } +static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase_puan(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class, uint8_t egprs_ms_class) +{ + GprsMs *ms; + uint32_t rach_fn = *fn - 51; + uint32_t sba_fn = *fn + 52; + uint8_t trx_no = 0; + int tfi = 0; + gprs_rlcmac_ul_tbf *ul_tbf; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + struct pcu_l1_meas meas; + + meas.set_rssi(31); + bts = the_bts->bts_data(); + + /* needed to set last_rts_fn in the PDCH object */ + request_dl_rlc_block(bts, trx_no, ts_no, 0, fn); + + /* simulate RACH, this sends an Immediate Assignment + Uplink on the AGCH */ + the_bts->rcv_rach(0x73, rach_fn, qta); + + /* get next free TFI */ + tfi = the_bts->tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); + + /* fake a resource request */ + ulreq.u.MESSAGE_TYPE = MT_PACKET_RESOURCE_REQUEST; + ulreq.u.Packet_Resource_Request.PayloadType = GPRS_RLCMAC_CONTROL_BLOCK; + ulreq.u.Packet_Resource_Request.ID.UnionType = 1; /* != 0 */ + ulreq.u.Packet_Resource_Request.ID.u.TLLI = tlli; + ulreq.u.Packet_Resource_Request.Exist_MS_Radio_Access_capability = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + Count_MS_RA_capability_value = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Exist_Multislot_capability = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Multislot_capability. + Exist_GPRS_multislot_class = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Multislot_capability. + GPRS_multislot_class = ms_class; + if (egprs_ms_class) { + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Multislot_capability. + Exist_EGPRS_multislot_class = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Multislot_capability. + EGPRS_multislot_class = ms_class; + } + + send_ul_mac_block(the_bts, trx_no, ts_no, &ulreq, sba_fn); + + /* check the TBF */ + ul_tbf = the_bts->ul_tbf_by_tfi(tfi, trx_no, ts_no); + OSMO_ASSERT(ul_tbf != NULL); + OSMO_ASSERT(ul_tbf->ta() == qta / 4); + + /* send packet uplink assignment */ + *fn = sba_fn; + request_dl_rlc_block(ul_tbf, fn); + + /* send real acknowledgement */ + send_control_ack(ul_tbf); + + check_tbf(ul_tbf); + + /* send fake data with cv=0*/ + struct gprs_rlc_ul_header_egprs_3 *hdr3 = NULL; + uint8_t data[49] = {0}; + + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + + /*header_construction */ + memset(data, 0x2b, sizeof(data)); + + for (int i = 0 ; i < 20; i++) { + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 10; + hdr3->tfi_a = (tfi >> 3) & 0x3; + hdr3->tfi_b = tfi & 0x7; + hdr3->bsn1_a = ((i*2)&0x1f); + hdr3->bsn1_b = ((i*2)/32); + hdr3->cps_a = 0; + hdr3->cps_b = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x0; + data[6] = 0x2b; + data[7] = 0x2b; + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + } + memset(data, 0x2b, sizeof(data)); + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 0; + hdr3->tfi_a = (tfi >> 3) & 0x3; + hdr3->tfi_b = tfi & 0x7; + hdr3->bsn1_a = 0; + hdr3->bsn1_b = 2; + hdr3->cps_a = 0; + hdr3->cps_b = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x2b; + data[6] = 0x2b; + data[7] = 0x2b; + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + + request_dl_rlc_block(ul_tbf, fn); + + ms = the_bts->ms_by_tlli(tlli); + OSMO_ASSERT(ms != NULL); + OSMO_ASSERT(ms->ta() == qta/4); + OSMO_ASSERT(ms->ul_tbf() == ul_tbf); + + return ul_tbf; +} + + static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase(BTS *the_bts, uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, uint8_t ms_class, uint8_t egprs_ms_class) @@ -770,6 +905,41 @@ fprintf(stderr, "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, (const uint8_t *)"TEST", 4); + + printf("=== end %s ===\n", __func__); +} + +static void test_tbf_egprs_two_phase_puan() +{ + BTS the_bts; + int ts_no = 7; + uint32_t fn = 2654218; + uint16_t qta = 31; + uint32_t tlli = 0xf1223344; + const char *imsi = "0011223344"; + uint8_t ms_class = 1; + uint8_t egprs_ms_class = 1; + gprs_rlcmac_ul_tbf *ul_tbf; + GprsMs *ms; + uint8_t test_data[256]; + + printf("=== start %s ===\n", __func__); + + memset(test_data, 1, sizeof(test_data)); + + setup_bts(&the_bts, ts_no, 4); + the_bts.bts_data()->initial_mcs_dl = 9; + the_bts.bts_data()->initial_mcs_ul = 9; + the_bts.bts_data()->egprs_enabled = 1; + + ul_tbf = establish_ul_tbf_two_phase_puan(&the_bts, ts_no, tlli, &fn, qta, + ms_class, egprs_ms_class); + + ms = ul_tbf->ms(); + fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta()); + fprintf(stderr, "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); + + send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); printf("=== end %s ===\n", __func__); } @@ -1355,6 +1525,7 @@ test_tbf_gprs_egprs(); test_tbf_ws(); test_tbf_egprs_two_phase(); + test_tbf_egprs_two_phase_puan(); test_tbf_egprs_dl(); if (getenv("TALLOC_REPORT_FULL")) diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 4e83ce2..60e9c46 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3398,6 +3398,284 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +MS requests single block allocation +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +TX: Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +MS requests UL TBF in packet resource request of single block, so we provide one: +MS supports EGPRS multislot class 1. +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=1/1 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 1 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. +Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed +Modifying MS object, TLLI = 0xf1223344, TA 0 -> 7 +Change control TS to 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) ++++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ +------------------------- TX : Packet Uplink Assignment ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to WAIT ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 80 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=WAIT ASSIGN EGPRS) changes state from WAIT ASSIGN to FLOW +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=0, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 0 storing in window (0..63) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 1 +- Taking block 0 out, raising V(Q) to 1 +- Assembling frames: (len=44) +-- Frame 1 starts at offset 0, length=44, is_complete=0 +- No gaps in received block, last block: BSN=0 CV=10 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=1) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=2, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 2 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 3 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=3) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=4, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 4 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 5 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=5) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=6, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 6 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 7 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=8, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 8 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 9 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=9) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=10, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 10 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 11 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=11) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=12, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 12 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 13 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=13) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=14, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 14 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 15 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=15) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=16, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 16 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 17 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=17) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=18, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 18 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 19 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=19) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=20, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 20 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 21 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=21) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=22, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 22 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 23 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=23) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=24, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 24 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 25 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=25) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=26, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 26 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 27 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=27) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=28, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 28 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 29 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=29) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=30, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 30 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 31 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=31) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=32, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 32 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 33 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=33) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=34, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 34 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 35 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=35) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=36, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 36 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 37 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=37) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=38, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 38 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 39 +- Scheduling Ack/Nack, because 20 frames received. +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 00 00 02 80 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=39) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=0, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 64 storing in window (1..64) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 65 +Received RTS for PDCH: TRX=0 TS=7 FN=2654275 block_nr=9 scheduling USF=0 for required uplink resource of UL TFI=0 +Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) +EGPRS URBB, urbb len = 63, SSN = 2, ESN_CRBB = 1, len present = yes,desc len = 78, SNS = 2048, WS = 64, V(Q) = 1, V(R) = 65, BOW, EOW +Uplink Ack/Nack bit count 161, max 184, message = 40 24 01 21 3e 24 46 68 90 a7 30 04 80 00 00 2a aa aa aa aa 2b 2b 2b +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=40 24 01 21 3e 24 46 68 90 a7 30 04 80 00 00 2a aa aa aa aa 2b 2b 2b +Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 +Got MS: TLLI = 0xf1223344, TA = 7 +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=1/1 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign downlink TS=7 TFI=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +Modifying MS object, TLLI: 0xf1223344 confirmed +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START +Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0. +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append Searching for first unallocated TFI: TRX=0 Found TFI=0. ********** TBF starts here ********** diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 441b444..8a62e03 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -32,6 +32,8 @@ === end test_tbf_ws === === start test_tbf_egprs_two_phase === === end test_tbf_egprs_two_phase === +=== start test_tbf_egprs_two_phase_puan === +=== end test_tbf_egprs_two_phase_puan === === start test_tbf_egprs_dl === Testing MCS-1 Testing MCS-2 -- To view, visit https://gerrit.osmocom.org/414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg From gerrit-no-reply at lists.osmocom.org Fri Jun 24 12:39:42 2016 From: gerrit-no-reply at lists.osmocom.org (prasadkg) Date: Fri, 24 Jun 2016 12:39:42 +0000 Subject: [PATCH] libosmocore[master]: Add T.4 compression routines Message-ID: Review at https://gerrit.osmocom.org/415 Add T.4 compression routines Functions for bitmap compression for PUAN is added The compression algorithm is as described in 44.060 Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitcomp.h M include/osmocom/core/bitvec.h M src/bitcomp.c M src/bitvec.c 4 files changed, 190 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/1 diff --git a/include/osmocom/core/bitcomp.h b/include/osmocom/core/bitcomp.h index 89eccbc..13a6d08 100644 --- a/include/osmocom/core/bitcomp.h +++ b/include/osmocom/core/bitcomp.h @@ -39,4 +39,13 @@ int osmo_t4_encode(struct bitvec *bv); int osmo_t4_decode(const struct bitvec *in, bool cc, struct bitvec *out); +#define MOD64(X) ((X + 64) & 0x3F) +int osmo_bitmap_compress( + struct bitvec *rbb_vec,/*!< input bitvector to compress */ + uint16_t *ucmp_bmplen, /*!< Uncompressed bitmap len */ + uint8_t *cmp_bmplen, /*!< Compressed bitmap len */ + uint8_t *crbb_bitmap, /*!< Compressed bitmap */ + uint16_t *uclen_crbb, /*!< Uncompressed bitmap len in CRBB */ + uint16_t max_bits /*!< Maximum remaining bits */ + ); /*! @} */ diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index c3c1153..29e2f10 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitcomp.c b/src/bitcomp.c index 8b3090e..d3b40d6 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -479,4 +479,141 @@ return -1; } +void compress_bitmap( + uint16_t *run_len_cnt, /* cnt: run length count */ + uint16_t *codewrd_bitmap, /* code word */ + int16_t *codewrd_len, /* number of bits in the code word */ + uint8_t *cbmbuf, /* bitmap buffer to put code word in */ + uint16_t *cstrtbits, /* start bits to put codeword. start from + * 0, the first bit in the first octets + * and increment without octets + * consideration. i.e. can be more than 7. + */ + uint8_t *cstrtocts, /* start octets to put codeword. start from 0*/ + uint8_t clr_code) +{ + int i = 0; + uint16_t bitsleft = 0; + uint16_t temp = 0; + *codewrd_bitmap = 0; + *codewrd_len = 0; + if ((*run_len_cnt) >= 64) { + for (i = 0; i < 15; i++) { + if (t4_make_up_ind[i] == *run_len_cnt) { + *codewrd_bitmap = t4_make_up[clr_code][i]; + *codewrd_len = t4_make_up_length[clr_code][i]; + } + } + } else { + *codewrd_bitmap = t4_term[clr_code][*run_len_cnt]; + *codewrd_len = t4_term_length[clr_code][*run_len_cnt]; + } + bitsleft = *codewrd_len; + /* Move the codeword_bitmap to left in two bytes*/ + (*codewrd_bitmap) = (*codewrd_bitmap)<<(16-(*codewrd_len)); + while (bitsleft != 0) { + /* Bring left most bits to right and start shifting by cstrtbits, + * we get each bit to update in compressed buffer + */ + temp = (((*codewrd_bitmap) & 0x8000)>>15)<<(7-(*cstrtbits)); + cbmbuf[*cstrtocts] = cbmbuf[*cstrtocts]|temp; + + (*codewrd_bitmap) = (*codewrd_bitmap)<<1; + (*cstrtbits)++; + bitsleft--; + if ((*cstrtbits) >= 8) { + (*cstrtbits) = (*cstrtbits)-8; + (*cstrtocts)++; + /* init buf */ + cbmbuf[*cstrtocts] = 0x00; + } + } +} + +/*! \brief compression algorithm using T4 encoding + * the compressed bitmap's are copied in crbb_bitmap + * \param[in] rbb_vec bit vector to be encoded + * \return 1 if compression is success or 0 for failure + */ +int osmo_bitmap_compress( + struct bitvec *rbb_vec, + uint16_t *ucmp_bmplen, /* Uncompressed bitmap len */ + uint8_t *cmp_bmplen, /* Compressed bitmap len */ + uint8_t *crbb_bitmap, /* Compressed bitmap */ + uint16_t *uclen_crbb, /* Uncompressed bitmap len in CRBB */ + uint16_t max_bits) /* max remaining bits */ +{ + bool run_len_bit; + int buflen = *ucmp_bmplen; + int total_bits = *ucmp_bmplen; + uint16_t rlen; + uint16_t temprl = 0; + uint16_t cbmap = 0; /* Compressed code word */ + int16_t nbits; /* Length of code word */ + uint16_t cstrtbits = 0; + uint8_t cstrtocts = 0; + uint16_t uclen = 0; + int16_t clen = 0; + uint8_t clr_code = 0; + + run_len_bit = (rbb_vec->data[0] & 0x80)>>7; + while (buflen > 0) { + temprl = 0; + /* Find Run length */ + if (run_len_bit == 1) + rlen = bitvec_rl_curbit(rbb_vec, true, total_bits); + else + rlen = bitvec_rl_curbit(rbb_vec, false, total_bits); + buflen = buflen - rlen; + /* if rlen> 64 need 2 code words */ + /*Compress the bits */ + if (run_len_bit == 0) { + clr_code = 0; + if (rlen >= 64) { + temprl = (rlen/64)*64; + compress_bitmap(&temprl, &cbmap, &nbits, + crbb_bitmap, &cstrtbits, + &cstrtocts, clr_code); + } + temprl = MOD64(rlen); + compress_bitmap(&temprl, + &cbmap, &nbits, crbb_bitmap, + &cstrtbits, &cstrtocts, clr_code); + /* next time the run length will be Ones */ + run_len_bit = 1; + } else { + clr_code = 1; + if (rlen >= 64) { + temprl = (rlen/64)*64; + compress_bitmap(&temprl, &cbmap, + &nbits, crbb_bitmap, + &cstrtbits, &cstrtocts, + clr_code); + } + temprl = MOD64(rlen); + compress_bitmap(&temprl, &cbmap, + &nbits, crbb_bitmap, + &cstrtbits, &cstrtocts, clr_code); + + /* next time the run length will be Zeros */ + run_len_bit = 0; + } + uclen = uclen + (rlen); + clen = clen + nbits; + /*compressed bitmap exceeds the buffer space */ + if (clen > max_bits) { + uclen = uclen - rlen; + clen = clen - nbits; + break; + } + } + *cmp_bmplen = clen; + *uclen_crbb = uclen; + if (clen >= uclen) + /* No Gain is observed, So no need to compress */ + return 0; + else + /* Add compressed bitmap to final buffer */ + return 1; +} diff --git a/src/bitvec.c b/src/bitvec.c index 88343c4..4c413ae 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,49 @@ return bv->cur_bit; } +/*! \brief Return number (bits) of uninterrupted bit run in vector starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \returns Number of consecutive bits of \p b in \p bv + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + int temp_res = 0; + int count = 0; + + if (bv->cur_bit % 8 == 0) { + for (i = (bv->cur_bit/8); i < (max_bits % 8 ? max_bits/8 + 1 : max_bits/8); i++, count++) { + if ((b ? 0xFF : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + leading_bits(bv->data[i], b)); + return count * 8 + leading_bits(bv->data[i], b); + } + } + bv->cur_bit = (count * 8); + return (count * 8); + } else { + unsigned readIndex = bv->cur_bit; + int pos = bv->cur_bit/8; + while (bitvec_read_field(bv, &readIndex, 1) == b) { + if( bv->cur_bit % 8 > 0) + temp_res++; + else { + pos++; + for (i = pos; i < (max_bits % 8 ? max_bits/8 + 1 : max_bits/8); i++, count++) { + if ((b ? 0xFF : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + leading_bits(bv->data[i], b) + temp_res) - 1; + return count * 8 + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8))-1; + return temp_res + (count * 8); + } + } + bv->cur_bit--; + return temp_res; + } +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg From gerrit-no-reply at lists.osmocom.org Fri Jun 24 13:12:10 2016 From: gerrit-no-reply at lists.osmocom.org (prasadkg) Date: Fri, 24 Jun 2016 13:12:10 +0000 Subject: osmo-pcu[master]: Add compression support in EGPRS PUAN In-Reply-To: References: Message-ID: Patch Set 1: There is a dependency for this patch with libosmocore Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26. Due to this there is jenkins build failure for this patch. -- To view, visit https://gerrit.osmocom.org/413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: prasadkg Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jun 24 14:27:51 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Fri, 24 Jun 2016 14:27:51 +0000 Subject: [PATCH] osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... Message-ID: Review at https://gerrit.osmocom.org/416 Add decoding of compressed bitmap in EPDAN by tree based Algorithm Implemented tree based algorithm to decode compressed bitmap in EPDAN. This algorithm intends to improve the performance over existing method. Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce --- M src/Makefile.am M src/decoding.cpp M src/decoding.h A src/egprs_rlc_compression.cpp A src/egprs_rlc_compression.h M src/pcu_main.cpp 6 files changed, 393 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/16/416/1 diff --git a/src/Makefile.am b/src/Makefile.am index 9bdec2f..9b047e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,7 +62,8 @@ rlc.cpp \ osmobts_sock.cpp \ gprs_codel.c \ - gprs_coding_scheme.cpp + gprs_coding_scheme.cpp \ + egprs_rlc_compression.cpp bin_PROGRAMS = \ osmo-pcu @@ -94,7 +95,8 @@ pcu_utils.h \ cxx_linuxlist.h \ gprs_codel.h \ - gprs_coding_scheme.h + gprs_coding_scheme.h \ + egprs_rlc_compression.h osmo_pcu_SOURCES = pcu_main.cpp diff --git a/src/decoding.cpp b/src/decoding.cpp index 7865be0..5b5160b 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -30,7 +30,7 @@ #include #include - +#include #define LENGTH_TO_END 255 /*! * \returns num extensions fields (num frames == offset) on success, @@ -654,7 +654,6 @@ bool have_bitmap; int implicitly_acked_blocks; int ssn = desc->STARTING_SEQUENCE_NUMBER; - int rc; if (desc->FINAL_ACK_INDICATION) return handle_final_ack(bits, bsn_begin, bsn_end, window); @@ -694,27 +693,11 @@ if (crbb_len > 0) { int old_len = bits->cur_bit; - struct bitvec crbb; - crbb.data = (uint8_t *)desc->CRBB; - crbb.data_len = sizeof(desc->CRBB); - crbb.cur_bit = desc->CRBB_LENGTH; - - rc = osmo_t4_decode(&crbb, desc->CRBB_STARTING_COLOR_CODE, - bits); - - if (rc < 0) { - LOGP(DRLCMACUL, LOGL_NOTICE, - "Failed to decode CRBB: " - "length %d, data '%s'\n", - desc->CRBB_LENGTH, - osmo_hexdump(crbb.data, crbb.data_len)); - /* We don't know the SSN offset for the URBB, - * return what we have so far and assume the - * bitmap has stopped here */ - goto aborted; - } - + LOGP(DRLCMACDL, LOGL_DEBUG, "Compress bitmap exist," + "CRBB LEN =%d and Starting color code =%d", + desc->CRBB_LENGTH, desc->CRBB_STARTING_COLOR_CODE); + decompress_crbb(desc->CRBB_LENGTH, desc->CRBB_STARTING_COLOR_CODE, desc->CRBB, bits); LOGP(DRLCMACDL, LOGL_DEBUG, "CRBB len: %d, decoded len: %d, cc: %d, crbb: '%s'\n", desc->CRBB_LENGTH, bits->cur_bit - old_len, diff --git a/src/decoding.h b/src/decoding.h index d1371d5..7df0a93 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -76,6 +76,12 @@ struct gprs_rlc_dl_window *window); static int decode_gprs_acknack_bits( const Ack_Nack_Description_t *desc, - bitvec *bits, int *bsn_begin, int *bsn_end, - gprs_rlc_dl_window *window); + bitvec * bits, int *bsn_begin, int *bsn_end, + gprs_rlc_dl_window * window); + static void decompress_crbb( + int8_t compress_bmap_len, + uint8_t clr_code_bit, + const uint8_t *orig_buf, + bitvec * dest + ); }; diff --git a/src/egprs_rlc_compression.cpp b/src/egprs_rlc_compression.cpp new file mode 100644 index 0000000..7bb7042 --- /dev/null +++ b/src/egprs_rlc_compression.cpp @@ -0,0 +1,313 @@ +/* egprs_rlc_compression.h +* Routines for EGPRS RLC bitmap compression handling +*/ +#include +#include +#include + +egprs_compress *egprs_compress::s_instance = 0; +Node *egprs_compress::ones_list = NULL; +Node *egprs_compress::zeros_list = NULL; + +void egprs_compress::build_codeword(Node *root, const char *cdwd[]) +{ + Node *iter; /* iterate the node on the tree */ + int len; /* length of the code word */ + int i; /* iterater */ + uint16_t idx; /* interate index of the code word table */ + + root->left = NULL; + root->right = NULL; + root->run_length = NULL; + + for (idx = 0; idx < MAX_CDWDTBL_LEN; idx++) { + len = strlen((const char *)cdwd[idx]); + iter = root; + for (i = 0; i < len; i++) { + if (cdwd[idx][i] == '0') { + if (iter->left == NULL) { + iter->left = (Node *)malloc(sizeof(Node)); + /* create a clean node */ + iter->left->left = NULL; + iter->left->right = NULL; + iter->left->run_length = NULL; + } + iter = iter->left; + } else if (cdwd[idx][i] == '1') { + if (iter->right == NULL) { + iter->right = (Node *)malloc(sizeof(Node)); + /* create a clean node */ + iter->right->left = NULL; + iter->right->right = NULL; + iter->right->run_length = NULL; + } + iter = iter->right; + } + } + if (iter != NULL) { + iter->run_length = (uint16_t *)malloc(sizeof(uint16_t)); + *(iter->run_length) = (uint16_t)NULL; + if (idx < 64) + *(iter->run_length) = idx; + else + *(iter->run_length) = (idx - 63) * 64; + } + } +} + +const char *one_run_len_code_list[MAX_CDWDTBL_LEN] = { + "00110101", + "000111", + "0111", + "1000", + "1011", + "1100", + "1110", + "1111", + "10011", + "10100", + "00111", + "01000", + "001000", + "000011", + "110100", + "110101", + "101010", + "101011", + "0100111", + "0001100", + "0001000", + "0010111", + "0000011", + "0000100", + "0101000", + "0101011", + "0010011", + "0100100", + "0011000", + "00000010", + "00000011", + "00011010", + "00011011", + "00010010", + "00010011", + "00010100", + "00010101", + "00010110", + "00010111", + "00101000", + "00101001", + "00101010", + "00101011", + "00101100", + "00101101", + "00000100", + "00000101", + "00001010", + "00001011", + "01010010", + "01010011", + "01010100", + "01010101", + "00100100", + "00100101", + "01011000", + "01011001", + "01011010", + "01011011", + "01001010", + "01001011", + "00110010", + "00110011", + "00110100", + "11011", + "10010", + "010111", + "0110111", + "00110110", + "00110111", + "01100100", + "01100101", + "01101000", + "01100111", + "011001100", + "011001101", + "011010010", + "011010011", + "011010100" +}; + +const char *zero_run_len_code_list[MAX_CDWDTBL_LEN] = { + "0000110111", + "10", + "11", + "010", + "011", + "0011", + "0010", + "00011", + "000101", + "000100", + "0000100", + "0000101", + "0000111", + "00000100", + "00000111", + "000011000", + "0000010111", + "0000011000", + "0000001000", + "00001100111", + "00001101000", + "00001101100", + "00000110111", + "00000101000", + "00000010111", + "00000011000", + "000011001010", + "000011001011", + "000011001100", + "000011001101", + "000001101000", + "000001101001", + "000001101010", + "000001101011", + "000011010010", + "000011010011", + "000011010100", + "000011010101", + "000011010110", + "000011010111", + "000001101100", + "000001101101", + "000011011010", + "000011011011", + "000001010100", + "000001010101", + "000001010110", + "000001010111", + "000001100100", + "000001100101", + "000001010010", + "000001010011", + "000000100100", + "000000110111", + "000000111000", + "000000100111", + "000000101000", + "000001011000", + "000001011001", + "000000101011", + "000000101100", + "000001011010", + "000001100110", + "000001100111", + "0000001111", + "000011001000", + "000011001001", + "000001011011", + "000000110011", + "000000110100", + "000000110101", + "0000001101100", + "0000001101101", + "0000001001010", + "0000001001011", + "0000001001100", + "0000001001101", + "0000001110010", + "0000001110011" +}; + +int search_runlen( + Node *root, /* root of Ones or Zeros tree */ + const uint8_t *bmbuf, /* Received compressed bitmap buf */ + uint8_t bit_pos, /* the start bit pos to read codeword */ + uint8_t *len_codewd, /* length of code word */ + uint16_t *rlen) +{ + Node *iter; + uint8_t dir; + + iter = root; + *len_codewd = 0; + + while (iter->run_length == 0) { + if ((iter->left == NULL) && (iter->right == NULL)) + return -1; + + /* get the bit value at the bitpos and put it in right most of dir */ + dir = ((bmbuf[BITS_TO_BYTES(bit_pos)-1] + >>(7-(MOD8(bit_pos)))) & 0x01); + (bit_pos)++; + (*len_codewd)++; + + if (((dir&0x01) == 0) && (iter->left != NULL)) + iter = iter->left; + + else if (((dir&0x01) == 1) && (iter->right != NULL)) + iter = iter->right; + else + return -1; + } + (*rlen) = *(iter->run_length); + + return 1; +} /* search_runlen */ + +void Decoding::decompress_crbb( + int8_t compress_bmap_len, /* compressed bitmap length */ + uint8_t clr_code_bit, /* run length of Ones or Zeros */ + const uint8_t *orig_crbb_buf, /* received block crbb bitmap */ + bitvec * dest) +{ + + uint8_t bit_pos = 0; + uint8_t nbits = 0; /* number of bits of codeword */ + uint16_t run_length = 0; + uint16_t cbmaplen = 0; /* compressed bitmap part after decompression */ + unsigned wp = dest->cur_bit; + egprs_compress *compress = egprs_compress::instance(); + + while (compress_bmap_len > 0) { + if (clr_code_bit == 1) { + search_runlen(compress->ones_list, orig_crbb_buf, + bit_pos, &nbits, &run_length); + /*If run length > 64, need makeup and terminating code*/ + if (run_length < 64) + clr_code_bit = 0; + cbmaplen = cbmaplen + run_length; + /* put run length of Ones in uncompressed bitmap */ + while (run_length != 0) { + if (run_length > 8) { + bitvec_write_field(dest, wp, 0xff, 8); + run_length = run_length - 8; + } else { + bitvec_write_field(dest, wp, 0xff, + run_length); + run_length = 0; + } + } + } else { + search_runlen(compress->zeros_list, orig_crbb_buf, + bit_pos, &nbits, &run_length); + /*If run length > 64, need makeup and terminating code*/ + if (run_length < 64) + clr_code_bit = 1; + cbmaplen = cbmaplen + run_length; + /* put run length of Zeros in uncompressed bitmap */ + while (run_length != 0) { + if (run_length > 8) { + bitvec_write_field(dest, wp, 0x00, 8); + run_length = run_length - 8; + } else { + bitvec_write_field(dest, wp, 0x00, + run_length); + run_length = 0; + } + } + } + bit_pos = bit_pos + nbits; + compress_bmap_len = compress_bmap_len - nbits; + } +} /* Decompress_CRBB */ diff --git a/src/egprs_rlc_compression.h b/src/egprs_rlc_compression.h new file mode 100644 index 0000000..b81e740 --- /dev/null +++ b/src/egprs_rlc_compression.h @@ -0,0 +1,60 @@ +/* egprs_rlc_compression.h + * Routines for EGPRS RLC bitmap compression handling + */ +#include +#include + +extern "C" { +#include +#include +#include +} + +#include +#include +#include + +#define MAX_CDWDTBL_LEN 79 /* total number of codewords */ +#define BITS_TO_BYTES(X) ((X ? (X/8):0)+1) +#define MOD8(X) (((X)+8) & (0x07)) + +typedef struct node { + struct node *left; + struct node *right; + uint16_t *run_length; +} Node; + +extern const char *one_run_len_code_list[MAX_CDWDTBL_LEN]; +extern const char *zero_run_len_code_list[MAX_CDWDTBL_LEN]; + +/* Creating singleton class + */ +class egprs_compress +{ + static egprs_compress *s_instance; + + egprs_compress() + { + ones_list = (Node *)malloc(sizeof(Node)); + zeros_list = (Node *)malloc(sizeof(Node)); + } + void build_codeword(Node *root, const char *cdwd[]); +public: + static Node *ones_list; + static Node *zeros_list; + + void decode_tree_init(void) + { + instance()->build_codeword( + ones_list, one_run_len_code_list); + instance()->build_codeword( + zeros_list, zero_run_len_code_list); + } + static egprs_compress *instance() + { + if (!s_instance) + s_instance = new egprs_compress; + + return s_instance; + } +}; diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 2d86cda..ae0703c 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -28,6 +28,7 @@ #include #include #include +#include extern "C" { #include "pcu_vty.h" #include @@ -253,6 +254,8 @@ if (!bts->alloc_algorithm) bts->alloc_algorithm = alloc_algorithm_dynamic; +egprs_compress::instance()->decode_tree_init(); + rc = pcu_l1if_open(); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin From gerrit-no-reply at lists.osmocom.org Fri Jun 24 14:27:51 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Fri, 24 Jun 2016 14:27:51 +0000 Subject: [PATCH] osmo-pcu[master]: Add test case for decompression of compressed bitmap Message-ID: Review at https://gerrit.osmocom.org/417 Add test case for decompression of compressed bitmap Test case is added to validate decompressed result of the bitmap present in EPDAN. Test is done for multiple bitmaps of varying length. Change-Id: I0f26ec3d9eeace4ea8396ad5786a988fb58cf445 --- M tests/tbf/TbfTest.cpp 1 file changed, 109 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/17/417/1 diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index e1be844..5f293d1 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -26,10 +26,11 @@ #include "pcu_utils.h" #include "gprs_bssgp_pcu.h" #include "pcu_l1_if.h" - +#include "egprs_rlc_compression.h" +#include "decoding.h" extern "C" { #include "pcu_vty.h" - +#include #include #include #include @@ -38,9 +39,30 @@ } #include - +#define NUMBER_OF_TEST_CASE 4 +#define NEW 1 +#define DELTA 1000 void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; +struct test_data { + int8_t crbb_len; + uint8_t cc ; + uint8_t data[23]; + uint8_t exp_data[40]; + int exp_len; +}test[4] = { { (int8_t)67, (uint8_t)1,{0x02, 0x0c, 0xa0, 0x30, 0xcb, 0x1a, 0x0c, 0xe3, 0x6c}, + {0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xf8, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, + 0xdb}, (int)194}, + {(int8_t)40, (uint8_t)1, {0x53,0x06,0xc5,0x40,0x6d}, {0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, + 0x00, 0x00, 0x00, 0x03}, (int)182}, + { (int8_t)8, (uint8_t)1, {0x02}, {0xff, 0xff, 0xff, 0xf8}, (int)29}, + { (int8_t)103,(uint8_t)1, {0x02, 0x0c, 0xe0, 0x41, 0xa0, 0x0c, 0x36, 0x0d, 0x03, + 0x71, 0xb0, 0x6e, 0x24}, {0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xf8, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, + 0xe0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x80, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff} , + (int)288} }; static void check_tbf(gprs_rlcmac_tbf *tbf) { @@ -51,19 +73,90 @@ OSMO_ASSERT(tbf->T != 0); } -/* -static unsigned inc_fn(fn) +/* To verify the result with expected result */ +int check_result(bitvec bits, uint8_t *exp_data, int exp_len) { - unsigned next_fn; + if (bits.cur_bit != exp_len) + return 0; + size_t n = (exp_len / 8); + int rem = (exp_len % 8); + if (memcmp (exp_data, bits.data, n) == 0) { + if (rem == 0) + return 1; + int i = 0, bytes = 7; - next_fn = fn + 4; - if ((block_nr % 3) == 2) - next_fn ++; - next_fn = next_fn % 2715648; - - return next_fn; + for (i ; i < rem ; i++) { + if (((((bits.data[n]))>>(bytes-i)) & 1) == ((((*(exp_data + n))>>(bytes-i)) & 1))) + ; + else + break; + } + if (i == rem) { + return 1; + } else { + return 0; + } + } else { + return 0; + } } -*/ +/* To check time taken to decode crbb by Tree based method + * and to verify the result with expected result */ +void test_EPDAN_time_tree(int test_run, int verify) +{ + int itr = 0; + long long int min_tree = 0, max_tree = 0, sum = 0, avg = 0; + float avg_tree = 0; + bitvec bits; + struct bitvec data1; + for (itr ; itr < NUMBER_OF_TEST_CASE ; itr++) { + int loop = 0, init_flag = 1, first = 0, last = 0, count = 0; + avg_tree = 0 , min_tree = 0 , max_tree = 0; + while (loop++ < test_run) { + data1.data_len = ((test[itr].crbb_len + 7)/8); + data1.cur_bit = test[itr].crbb_len; + struct timeval t0, t1; + data1.data = test[itr].data; + uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + gettimeofday(&t0, 0); + Decoding::decompress_crbb(test[itr].crbb_len, test[itr].cc, test[itr].data, &bits); + gettimeofday(&t1, 0); + long long elapsed = (t1.tv_sec-t0.tv_sec)*1000000LL + t1.tv_usec-t0.tv_usec; + if (init_flag) + init_flag = 0; + if (verify) { + if (check_result(bits, test[itr].exp_data, test[itr].exp_len) == 0) { + LOGP (DRLCMACDL, LOGL_DEBUG, "Tree based decoding :Error\n"); + OSMO_ASSERT(0) ; + } + } + if (loop == 1) { + first = elapsed; + min_tree = elapsed; + max_tree = elapsed; + sum = elapsed; + avg = elapsed; + avg_tree = elapsed; + } else { + if (loop == test_run-1) + last = elapsed; + if (elapsed > (avg+DELTA)) + count++; + sum = sum + elapsed; + avg = sum / loop; + if (min_tree > elapsed) + min_tree = elapsed; + if (max_tree < elapsed) + max_tree = elapsed; + avg_tree = avg_tree + elapsed; + } + } + avg_tree = (avg_tree / test_run); + } +} static void test_tbf_base() { @@ -1337,7 +1430,8 @@ vty_init(&pcu_vty_info); pcu_vty_init(&debug_log_info); - + /*initialization_of_tree*/ + egprs_compress::instance()->decode_tree_init(); test_tbf_base(); test_tbf_tlli_update(); test_tbf_final_ack(TEST_MODE_STANDARD); @@ -1356,7 +1450,7 @@ test_tbf_ws(); test_tbf_egprs_two_phase(); test_tbf_egprs_dl(); - + test_EPDAN_time_tree(10000, 1); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); return EXIT_SUCCESS; -- To view, visit https://gerrit.osmocom.org/417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0f26ec3d9eeace4ea8396ad5786a988fb58cf445 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin From gerrit-no-reply at lists.osmocom.org Sat Jun 25 07:38:11 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 25 Jun 2016 07:38:11 +0000 Subject: libosmocore[master]: Fix potential segfault in msg_dequeue In-Reply-To: References: Message-ID: Patch Set 2: I am not convinced (and maybe revert). * lh->next and lh->prev should be LLIST_POISONX or point to itself * If INIT_LLIST_HEAD was forgotten we have other issues. Right now I don't see how ->next can be NULL here. -- To view, visit https://gerrit.osmocom.org/407 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 08:25:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 08:25:24 +0000 Subject: libosmocore[master]: Add T.4 compression routines In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I think instead of adding another function which is doing pretty much the same as existing one we should just replace existing implementation while keeping the interface the same. This would allow the code which relies on old functions to immediately benefit from new implementations without the need for patching. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 08:28:03 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 08:28:03 +0000 Subject: osmo-pcu[master]: Add test case for decompression of compressed bitmap In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 If the test does not contain anything specific to osmo-pcu and just checking functions in libosmocore than it should added to libosmocore/tests -- To view, visit https://gerrit.osmocom.org/417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f26ec3d9eeace4ea8396ad5786a988fb58cf445 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 08:30:37 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 08:30:37 +0000 Subject: osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... In-Reply-To: References: Message-ID: Patch Set 1: How does this relates to gerrit #415? -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 09:37:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 09:37:09 +0000 Subject: osmo-bts[master]: TRX: add Uplink DTX support for FR/HR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 09:37:11 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 09:37:11 +0000 Subject: [MERGED] osmo-bts[master]: TRX: add Uplink DTX support for FR/HR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TRX: add Uplink DTX support for FR/HR ...................................................................... TRX: add Uplink DTX support for FR/HR * detect SID and set RTP Marker accordingly (emulate ONSET events) * set proper FN in TCH_IND * detect speech pause and do not send dummy 'bad' frames during that time Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc Related: OS#1750 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 13 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 96ea828..9a6a59c 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include @@ -341,7 +341,7 @@ if (len < 2) break; memset(tch_data + 2, 0, len - 2); - _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + _sched_compose_tch_ind(l1t, tn, fn, chan, tch_data, len); break; default: inval_mode1: @@ -350,7 +350,7 @@ len = 0; } if (len) - _sched_compose_tch_ind(l1t, tn, 0, chan, tch_data, len); + _sched_compose_tch_ind(l1t, tn, fn, chan, tch_data, len); } /* get frame and unlink from queue */ @@ -939,6 +939,8 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + struct gsm_lchan *lchan = + get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); /* handle rach, if handover rach detection is turned on */ if (chan_state->ho_rach_detect == 1) @@ -987,6 +989,7 @@ : tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ rc = tch_fr_decode(tch_data, *bursts_p, 1, 0, &n_errors, &n_bits_total); + lchan_set_marker(osmo_fr_check_sid(tch_data, rc), lchan); /* DTXu */ break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ rc = tch_fr_decode(tch_data, *bursts_p, 1, 1, &n_errors, &n_bits_total); @@ -1045,6 +1048,8 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ + if (lchan->tch.ul_sid) + return 0; /* DTXu: pause in progress */ memset(tch_data, 0, GSM_FR_BYTES); rc = GSM_FR_BYTES; break; @@ -1090,6 +1095,8 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + struct gsm_lchan *lchan = + get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); /* handle rach, if handover rach detection is turned on */ if (chan_state->ho_rach_detect == 1) @@ -1152,6 +1159,7 @@ rc = tch_hr_decode(tch_data, *bursts_p, (((fn + 26 - 10) % 26) >> 2) & 1, &n_errors, &n_bits_total); + lchan_set_marker(osmo_hr_check_sid(tch_data, rc), lchan); /* DTXu */ break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ /* the first FN 0,8,17 or 1,9,18 defines that CMI is included @@ -1211,6 +1219,8 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* HR */ + if (lchan->tch.ul_sid) + return 0; /* DTXu: pause in progress */ tch_data[0] = 0x70; /* F = 0, FT = 111 */ memset(tch_data + 1, 0, 14); rc = 15; -- To view, visit https://gerrit.osmocom.org/411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 27 09:59:46 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 27 Jun 2016 09:59:46 +0000 Subject: osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... In-Reply-To: References: Message-ID: Patch Set 1: > How does this relates to gerrit #415? #415 is for implementation of compression algorithm for PUAN whereas #416 is for implementation of decoding of compressed bitmap for EPDAN. -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 09:59:50 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 27 Jun 2016 09:59:50 +0000 Subject: osmo-pcu[master]: Add test case for decompression of compressed bitmap In-Reply-To: References: Message-ID: Patch Set 1: > If the test does not contain anything specific to osmo-pcu and just > checking functions in libosmocore than it should added to > libosmocore/tests The function decompress_crbb is part of osmo-pcu and is present in egprs_rlc_compression.cpp hence, the test case is added in osmo-pcu. -- To view, visit https://gerrit.osmocom.org/417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f26ec3d9eeace4ea8396ad5786a988fb58cf445 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 10:03:42 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 10:03:42 +0000 Subject: osmo-pcu[master]: Add test case for decompression of compressed bitmap In-Reply-To: References: Message-ID: Patch Set 1: -Code-Review -- To view, visit https://gerrit.osmocom.org/417 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f26ec3d9eeace4ea8396ad5786a988fb58cf445 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 10:04:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 10:04:52 +0000 Subject: osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... In-Reply-To: References: Message-ID: Patch Set 1: Could you add reference to the spec to commit message to make it easier to follow? -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 10:44:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 27 Jun 2016 10:44:07 +0000 Subject: osmo-bts[master]: fix compiler warnings: include bts_model.h in phy_link.c In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/398/1/src/common/phy_link.c File src/common/phy_link.c: Line 6: #include > i would have put it below here.. sorts alphabetically in the "mini-scope" : I agree, but I was too slow, it's already merged. -- To view, visit https://gerrit.osmocom.org/398 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jun 27 10:47:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 27 Jun 2016 10:47:53 +0000 Subject: osmo-bts[master]: fix compiler warning: remove unused variable 'i' in calib_ve... In-Reply-To: References: Message-ID: Patch Set 2: > It would be nice if subject could indicate where it is coming from > > E.g. l15: Fix.. as the calib_verify All I saw was a compiler warning for an unused 'i', didn't actually check where that came from. -- To view, visit https://gerrit.osmocom.org/400 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 10:55:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 27 Jun 2016 10:55:27 +0000 Subject: openbsc[master]: vty: show lchan summary: also show lchan->state In-Reply-To: References: Message-ID: Patch Set 2: > The method is called "short". So why does this information need to > be in the short display? The "full" display is multi-line. The state should be in the single-line output because of dynamic PDCH: When the channel changes from PDCH to TCH/F and back, it is interesting to see wheter a channel is in de/activation or in error states. BTW, this commit also adds the pchan type to the output, which I should have mentioned in the commit log as well. Sorry about that. This is again useful to see whether a channel is TCH/F_PDCH. -- To view, visit https://gerrit.osmocom.org/386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 10:58:01 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 27 Jun 2016 10:58:01 +0000 Subject: openbsc[master]: err log: tweak dyn pdch ack error logging In-Reply-To: References: Message-ID: Patch Set 2: > in general it would be useful to include some statement as to which > part of the code has been modified. "err log" ca be anywhere. > "libbsc: " might be a more useful prefix. acknowledged -- next time. -- To view, visit https://gerrit.osmocom.org/389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 11:50:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 11:50:47 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instea... Message-ID: Review at https://gerrit.osmocom.org/418 sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts Back in January in commit 634c3e46484a0932f8a04b894be215b9288eecff we changed the executable name from 'sysmobts' to 'osmo-bts-sysmo', which is a change that has not been propagated to the contributed screenrc and systemd init files. Change-Id: I875a0ce4f470226e1b06ed1b7c74ca9471ebb574 --- M contrib/screenrc-sysmobts M contrib/sysmobts.service 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/418/1 diff --git a/contrib/screenrc-sysmobts b/contrib/screenrc-sysmobts index 80e78cc..9c810d9 100644 --- a/contrib/screenrc-sysmobts +++ b/contrib/screenrc-sysmobts @@ -1,5 +1,5 @@ chdir /tmp -screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/sysmobts -c /etc/osmocom/osmo-bts.cfg -r 1 -M +screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/osmo-bts-sysmo -c /etc/osmocom/osmo-bts.cfg -r 1 -M screen -t PCU 1 /etc/osmocom/respawn-only.sh /usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -e screen -t MGR 2 /etc/osmocom/respawn-only.sh /usr/bin/sysmobts-mgr -n -c /etc/osmocom/sysmobts-mgr.cfg detach diff --git a/contrib/sysmobts.service b/contrib/sysmobts.service index c4f8c38..e07a3db 100644 --- a/contrib/sysmobts.service +++ b/contrib/sysmobts.service @@ -4,7 +4,7 @@ [Service] Type=simple ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' -ExecStart=/usr/bin/sysmobts -s -c /etc/osmocom/osmo-bts.cfg -M +ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s' Restart=always -- To view, visit https://gerrit.osmocom.org/418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I875a0ce4f470226e1b06ed1b7c74ca9471ebb574 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 27 11:54:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 11:54:24 +0000 Subject: osmo-bts[master]: sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instea... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I875a0ce4f470226e1b06ed1b7c74ca9471ebb574 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 11:58:54 2016 From: gerrit-no-reply at lists.osmocom.org (prasadkg) Date: Mon, 27 Jun 2016 11:58:54 +0000 Subject: libosmocore[master]: Add T.4 compression routines In-Reply-To: References: Message-ID: Patch Set 1: > I think instead of adding another function which is doing pretty > much the same as existing one we should just replace existing > implementation while keeping the interface the same. This would > allow the code which relies on old functions to immediately benefit > from new implementations without the need for patching. The additional parameters are required, though I agree that some of them can be optimized. For example last two parameters are required for getting the number of bits processed by the algorithm and maximum bits available in the buffer. So it may not be possible to keep the interface same. Yes the existing function can be replaced if all agree. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 12:51:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 12:51:54 +0000 Subject: [MERGED] osmo-bts[master]: sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instea... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts ...................................................................... sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts Back in January in commit 634c3e46484a0932f8a04b894be215b9288eecff we changed the executable name from 'sysmobts' to 'osmo-bts-sysmo', which is a change that has not been propagated to the contributed screenrc and systemd init files. Change-Id: I875a0ce4f470226e1b06ed1b7c74ca9471ebb574 --- M contrib/screenrc-sysmobts M contrib/sysmobts.service 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/screenrc-sysmobts b/contrib/screenrc-sysmobts index 80e78cc..9c810d9 100644 --- a/contrib/screenrc-sysmobts +++ b/contrib/screenrc-sysmobts @@ -1,5 +1,5 @@ chdir /tmp -screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/sysmobts -c /etc/osmocom/osmo-bts.cfg -r 1 -M +screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/osmo-bts-sysmo -c /etc/osmocom/osmo-bts.cfg -r 1 -M screen -t PCU 1 /etc/osmocom/respawn-only.sh /usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -e screen -t MGR 2 /etc/osmocom/respawn-only.sh /usr/bin/sysmobts-mgr -n -c /etc/osmocom/sysmobts-mgr.cfg detach diff --git a/contrib/sysmobts.service b/contrib/sysmobts.service index c4f8c38..e07a3db 100644 --- a/contrib/sysmobts.service +++ b/contrib/sysmobts.service @@ -4,7 +4,7 @@ [Service] Type=simple ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' -ExecStart=/usr/bin/sysmobts -s -c /etc/osmocom/osmo-bts.cfg -M +ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s' Restart=always -- To view, visit https://gerrit.osmocom.org/418 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I875a0ce4f470226e1b06ed1b7c74ca9471ebb574 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 27 13:03:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 27 Jun 2016 13:03:07 +0000 Subject: [ABANDON] openbsc[master]: sgsn: fix use of libosmocore GPRS encryption plugins from LL... In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: sgsn: fix use of libosmocore GPRS encryption plugins from LLC layer ...................................................................... Abandoned by request from msuraev -- To view, visit https://gerrit.osmocom.org/128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I1f1b7454a0de5b7f4734aca4d03dbe67db5de189 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jun 27 13:20:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 13:20:40 +0000 Subject: [PATCH] libosmocore[master]: fsm: Introduce default time-out handling Message-ID: Review at https://gerrit.osmocom.org/419 fsm: Introduce default time-out handling If a FSM doesn't specify any timer_cb, simply terminate the FSM by default on time-out. This is a reasonable default for most cases, and avoids copy+pasting a one-line timer_cb function in every FSM. Also, even if there is a timer_cb, let it have a return value to decide if the core should terminate after return from timer_cb or not. Change-Id: I0461a9593bfb729c82b7d1d1cf9f30b1079d0212 --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 16 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/19/419/1 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 401ee04..ce0db15 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -26,6 +26,8 @@ OSMO_FSM_TERM_REGULAR, /*! \brief erroneous termination of process */ OSMO_FSM_TERM_ERROR, + /*! \brief termination due to time-out */ + OSMO_FSM_TERM_TIMEOUT, }; /*! \brief description of a rule in the FSM */ @@ -63,7 +65,7 @@ /*! \breif clean-up function, called during termination */ void (*cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause); /*! \brief timer call-back for states with time-out */ - void (*timer_cb)(struct osmo_fsm_inst *fi); + int (*timer_cb)(struct osmo_fsm_inst *fi); /*! \brief logging sub-system for this FSM */ int log_subsys; /*! \brief human-readable names of events */ diff --git a/src/fsm.c b/src/fsm.c index ede769d..8fedae2 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -136,10 +136,20 @@ { struct osmo_fsm_inst *fi = data; struct osmo_fsm *fsm = fi->fsm; + uint32_t T = fi->T; LOGPFSM(fi, "Timeout of T%u\n", fi->T); - fsm->timer_cb(fi); + if (fsm->timer_cb) { + int rc = fsm->timer_cb(fi); + if (rc != 1) + return; + LOGPFSM(fi, "timer_cb requested termination\n"); + } else + LOGPFSM(fi, "No timer_cb, automatic termination\n"); + + /* if timer_cb returns 1 or there is no timer_cb */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_TIMEOUT, &T); } /*! \brief allocate a new instance of a specified FSM @@ -317,13 +327,8 @@ st->onenter(fi, old_state); if (timeout_secs) { - if (!fsm->timer_cb) - LOGP(fsm->log_subsys, LOGL_ERROR, "cannot start " - "timer for FSM without timer call-back\n"); - else { - fi->T = T; - osmo_timer_schedule(&fi->timer, timeout_secs, 0); - } + fi->T = T; + osmo_timer_schedule(&fi->timer, timeout_secs, 0); } return 0; -- To view, visit https://gerrit.osmocom.org/419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0461a9593bfb729c82b7d1d1cf9f30b1079d0212 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 27 13:20:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 13:20:40 +0000 Subject: [PATCH] libosmocore[master]: Mark input parameter to bitvec_set_bits() as 'const' Message-ID: Review at https://gerrit.osmocom.org/420 Mark input parameter to bitvec_set_bits() as 'const' The input data is accessed in a read-only manner, so it should be marked with the const qualifier. Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/420/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index c3c1153..19e2af8 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -70,7 +70,7 @@ enum bit_value bit); int bitvec_set_bit(struct bitvec *bv, enum bit_value bit); int bitvec_get_bit_high(struct bitvec *bv); -int bitvec_set_bits(struct bitvec *bv, enum bit_value *bits, unsigned int count); +int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); int bitvec_set_uint(struct bitvec *bv, uint32_t in, unsigned int count); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); diff --git a/src/bitvec.c b/src/bitvec.c index 88343c4..ef8fd0e 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -198,7 +198,7 @@ * \param[in] bits array of \ref bit_value * \param[in] count number of bits to set * \return 0 on success; negative in case of error */ -int bitvec_set_bits(struct bitvec *bv, enum bit_value *bits, unsigned int count) +int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count) { int i, rc; -- To view, visit https://gerrit.osmocom.org/420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jun 27 13:21:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 13:21:20 +0000 Subject: libosmocore[master]: fsm: Introduce default time-out handling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0461a9593bfb729c82b7d1d1cf9f30b1079d0212 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 13:21:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 13:21:31 +0000 Subject: libosmocore[master]: Mark input parameter to bitvec_set_bits() as 'const' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 13:56:58 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 13:56:58 +0000 Subject: libosmocore[master]: Mark input parameter to bitvec_set_bits() as 'const' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 14:01:01 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 14:01:01 +0000 Subject: [PATCH] libosmocore[master]: tests: test actual support status for auth. algo Message-ID: Review at https://gerrit.osmocom.org/421 tests: test actual support status for auth. algo Check if library actually support Milenage, COMP128 v2 and v3 algorithms instead of just printing enum values or nothing. Change-Id: I2b98481f56a8381058d4b29db5e8a36eb193eee9 --- M tests/auth/milenage_test.c M tests/auth/milenage_test.ok M tests/comp128/comp128_test.c M tests/comp128/comp128_test.ok 4 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/421/1 diff --git a/tests/auth/milenage_test.c b/tests/auth/milenage_test.c index 0223764..473be92 100644 --- a/tests/auth/milenage_test.c +++ b/tests/auth/milenage_test.c @@ -50,6 +50,9 @@ const uint8_t op[16] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 }; #endif + printf("MILENAGE supported: %d\n", + osmo_auth_supported(osmo_auth_alg_parse("MILENAGE"))); + rc = milenage_opc_gen(opc, aud->u.umts.k, op); printf("OP:\t%s\n", osmo_hexdump(op, sizeof(op))); diff --git a/tests/auth/milenage_test.ok b/tests/auth/milenage_test.ok index 00ffc22..49146a5 100644 --- a/tests/auth/milenage_test.ok +++ b/tests/auth/milenage_test.ok @@ -6,5 +6,6 @@ SRES: 21 5f db 4d Kc: 6d e8 16 a7 59 a4 29 12 AUTS success: SEQ.MS = 33 +MILENAGE supported: 1 OP: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 OPC: c6 a1 3b 37 87 8f 5b 82 6f 4f 81 62 a1 c8 d8 79 diff --git a/tests/comp128/comp128_test.c b/tests/comp128/comp128_test.c index eb6fb12..07c98fa 100644 --- a/tests/comp128/comp128_test.c +++ b/tests/comp128/comp128_test.c @@ -66,8 +66,10 @@ int main(int argc, char **argv) { - printf("COMP128v2 support: %d\n", osmo_auth_alg_parse("COMP128v2")); - printf("COMP128v3 support: %d\n", osmo_auth_alg_parse("COMP128v3")); + printf("COMP128v2 support: %d\n", + osmo_auth_supported(osmo_auth_alg_parse("COMP128v2"))); + printf("COMP128v3 support: %d\n", + osmo_auth_supported(osmo_auth_alg_parse("COMP128v3"))); test_comp128v2("00000000000000000000000000000000", "34B4225BF16B96E118A85800"); test_comp128v2("00102030405060708090A0B0C0D0E0F0", "A892A8EFD6D33E3650372C00"); diff --git a/tests/comp128/comp128_test.ok b/tests/comp128/comp128_test.ok index f9ba7ce..cdac5f2 100644 --- a/tests/comp128/comp128_test.ok +++ b/tests/comp128/comp128_test.ok @@ -1,5 +1,5 @@ -COMP128v2 support: 2 -COMP128v3 support: 3 +COMP128v2 support: 1 +COMP128v3 support: 1 0 OK 0 OK 0 OK -- To view, visit https://gerrit.osmocom.org/421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b98481f56a8381058d4b29db5e8a36eb193eee9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 27 14:01:02 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 14:01:02 +0000 Subject: [PATCH] libosmocore[master]: Add function to check MS GEA capabilities Message-ID: Review at https://gerrit.osmocom.org/422 Add function to check MS GEA capabilities Add function which parses MS network capability IE value for bits indicating support for particular version of GEA. Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Relates: OS#1582 --- M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M src/gsm/gsm_04_08_gprs.c 2 files changed, 35 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/422/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index e0e887f..ed9a596 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -2,7 +2,9 @@ #define _GSM48_GPRS_H #include +#include #include +#include /* Table 10.4 / 10.4a, GPRS Mobility Management (GMM) */ #define GSM48_MT_GMM_ATTACH_REQ 0x01 @@ -362,6 +364,9 @@ GSM48_QOS_SERR_1e_1 = 0x07, }; +bool gprs_ms_net_cap_gea_supported(const uint8_t *ms_net_cap, uint8_t cap_len, + enum gprs_ciph_algo gea); + /* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */ struct gsm48_qos { /* octet 3 */ diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 5c00ea0..a8323e6 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -21,8 +21,10 @@ #include - +#include #include + +#include /* Protocol related stuff, should go into libosmocore */ @@ -108,6 +110,33 @@ const struct value_string *gsm48_gsm_cause_names = gsm48_gsm_cause_names_; +/*! \brief Check if MS supports particular version of GEA by inspecting + * MS network capability IE specified in 3GPP TS 24.008 + * \param[in] ms_net_cap Buffer with raw MS network capability IE value, + * 3 - 10 bytes + * \param[in] cap_len Length of ms_net_cap, in bytes + * \param[in] gea Version of GEA to check + * \returns true if given version is supported by MS, false otherwise + */ +bool gprs_ms_net_cap_gea_supported(const uint8_t *ms_net_cap, uint8_t cap_len, + enum gprs_ciph_algo gea) +{ + switch (gea) { + case GPRS_ALGO_GEA0: + return true; + case GPRS_ALGO_GEA1: /* first bit is GEA1: */ + return 0x80 & ms_net_cap[0]; + case GPRS_ALGO_GEA2: /* extended GEA bits strt from 2nd bit, next byte */ + return 0x40 & ms_net_cap[1]; + case GPRS_ALGO_GEA3: + return 0x20 & ms_net_cap[1]; + case GPRS_ALGO_GEA4: + return 0x10 & ms_net_cap[1]; + default: + return false; + } +} + /* 10.5.5.2 */ const struct value_string gprs_att_t_strs_[] = { { GPRS_ATT_T_ATTACH, "GPRS attach" }, -- To view, visit https://gerrit.osmocom.org/422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 27 14:03:43 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 14:03:43 +0000 Subject: osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... In-Reply-To: References: Message-ID: Patch Set 1: Also, are there some commonalities between that and #415, code which can be shared? -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 14:21:03 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 14:21:03 +0000 Subject: [PATCH] libosmocore[master]: Clarify GPRS ciphering direction Message-ID: Review at https://gerrit.osmocom.org/423 Clarify GPRS ciphering direction Add spec reference and set explicit values for enum representing direction parameter for GPRS encryption. Change-Id: Iaf1b13da2e889d55cc9dd7516710104dba48c992 Related: OS#1582 --- M include/osmocom/crypt/gprs_cipher.h 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/423/1 diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index d6edefa..3e9a17e 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -13,9 +13,10 @@ _GPRS_ALGO_NUM }; +/* 3GPP TS 04.64 Table A.1: */ enum gprs_cipher_direction { - GPRS_CIPH_MS2SGSN, - GPRS_CIPH_SGSN2MS, + GPRS_CIPH_MS2SGSN = 0, + GPRS_CIPH_SGSN2MS = 1, }; /* An implementation of a GPRS cipher */ -- To view, visit https://gerrit.osmocom.org/423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf1b13da2e889d55cc9dd7516710104dba48c992 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 27 15:12:41 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 27 Jun 2016 15:12:41 +0000 Subject: openbsc[master]: vty: show lchan summary: also show lchan->state In-Reply-To: References: Message-ID: Patch Set 2: Well, as long as the output fits in a 80 chars width we can add fields. The short summary has been added for a customer and his DAS field-testing. -- To view, visit https://gerrit.osmocom.org/386 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 15:38:18 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 15:38:18 +0000 Subject: [PATCH] libosmocore[master]: Add function to check MS GEA capabilities In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/422 to look at the new patch set (#2). Add function to check MS GEA capabilities Add function which parses MS network capability IE value for bits indicating support for particular version of GEA. Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Relates: OS#1582 --- M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M src/gsm/gsm_04_08_gprs.c M src/gsm/libosmogsm.map 3 files changed, 36 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/22/422/2 diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index e0e887f..ed9a596 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -2,7 +2,9 @@ #define _GSM48_GPRS_H #include +#include #include +#include /* Table 10.4 / 10.4a, GPRS Mobility Management (GMM) */ #define GSM48_MT_GMM_ATTACH_REQ 0x01 @@ -362,6 +364,9 @@ GSM48_QOS_SERR_1e_1 = 0x07, }; +bool gprs_ms_net_cap_gea_supported(const uint8_t *ms_net_cap, uint8_t cap_len, + enum gprs_ciph_algo gea); + /* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */ struct gsm48_qos { /* octet 3 */ diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 5c00ea0..7018777 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -21,8 +21,10 @@ #include - +#include #include + +#include /* Protocol related stuff, should go into libosmocore */ @@ -108,6 +110,33 @@ const struct value_string *gsm48_gsm_cause_names = gsm48_gsm_cause_names_; +/*! \brief Check if MS supports particular version of GEA by inspecting + * MS network capability IE specified in 3GPP TS 24.008 + * \param[in] ms_net_cap Buffer with raw MS network capability IE value, + * 3 - 10 bytes + * \param[in] cap_len Length of ms_net_cap, in bytes + * \param[in] gea Version of GEA to check + * \returns true if given version is supported by MS, false otherwise + */ +bool gprs_ms_net_cap_gea_supported(const uint8_t *ms_net_cap, uint8_t cap_len, + enum gprs_ciph_algo gea) +{ + switch (gea) { + case GPRS_ALGO_GEA0: + return true; + case GPRS_ALGO_GEA1: /* 1st bit is GEA1: */ + return 0x80 & ms_net_cap[0]; + case GPRS_ALGO_GEA2: /* extended GEA bits start from 2nd bit */ + return 0x40 & ms_net_cap[1]; /* of the next byte */ + case GPRS_ALGO_GEA3: + return 0x20 & ms_net_cap[1]; + case GPRS_ALGO_GEA4: + return 0x10 & ms_net_cap[1]; + default: + return false; + } +} + /* 10.5.5.2 */ const struct value_string gprs_att_t_strs_[] = { { GPRS_ATT_T_ATTACH, "GPRS attach" }, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ea2101c..801c6ce 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -43,6 +43,7 @@ gprs_cipher_key_length; gprs_tlli_type; gprs_tmsi2tlli; +gprs_ms_net_cap_gea_supported; gsm48_gmm_cause_names; gsm48_gsm_cause_names; -- To view, visit https://gerrit.osmocom.org/422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 27 16:10:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 16:10:04 +0000 Subject: [MERGED] libosmocore[master]: fsm: Introduce default time-out handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fsm: Introduce default time-out handling ...................................................................... fsm: Introduce default time-out handling If a FSM doesn't specify any timer_cb, simply terminate the FSM by default on time-out. This is a reasonable default for most cases, and avoids copy+pasting a one-line timer_cb function in every FSM. Also, even if there is a timer_cb, let it have a return value to decide if the core should terminate after return from timer_cb or not. Change-Id: I0461a9593bfb729c82b7d1d1cf9f30b1079d0212 --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 16 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 401ee04..ce0db15 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -26,6 +26,8 @@ OSMO_FSM_TERM_REGULAR, /*! \brief erroneous termination of process */ OSMO_FSM_TERM_ERROR, + /*! \brief termination due to time-out */ + OSMO_FSM_TERM_TIMEOUT, }; /*! \brief description of a rule in the FSM */ @@ -63,7 +65,7 @@ /*! \breif clean-up function, called during termination */ void (*cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause); /*! \brief timer call-back for states with time-out */ - void (*timer_cb)(struct osmo_fsm_inst *fi); + int (*timer_cb)(struct osmo_fsm_inst *fi); /*! \brief logging sub-system for this FSM */ int log_subsys; /*! \brief human-readable names of events */ diff --git a/src/fsm.c b/src/fsm.c index ede769d..8fedae2 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -136,10 +136,20 @@ { struct osmo_fsm_inst *fi = data; struct osmo_fsm *fsm = fi->fsm; + uint32_t T = fi->T; LOGPFSM(fi, "Timeout of T%u\n", fi->T); - fsm->timer_cb(fi); + if (fsm->timer_cb) { + int rc = fsm->timer_cb(fi); + if (rc != 1) + return; + LOGPFSM(fi, "timer_cb requested termination\n"); + } else + LOGPFSM(fi, "No timer_cb, automatic termination\n"); + + /* if timer_cb returns 1 or there is no timer_cb */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_TIMEOUT, &T); } /*! \brief allocate a new instance of a specified FSM @@ -317,13 +327,8 @@ st->onenter(fi, old_state); if (timeout_secs) { - if (!fsm->timer_cb) - LOGP(fsm->log_subsys, LOGL_ERROR, "cannot start " - "timer for FSM without timer call-back\n"); - else { - fi->T = T; - osmo_timer_schedule(&fi->timer, timeout_secs, 0); - } + fi->T = T; + osmo_timer_schedule(&fi->timer, timeout_secs, 0); } return 0; -- To view, visit https://gerrit.osmocom.org/419 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0461a9593bfb729c82b7d1d1cf9f30b1079d0212 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jun 27 16:10:11 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 16:10:11 +0000 Subject: [MERGED] libosmocore[master]: Mark input parameter to bitvec_set_bits() as 'const' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Mark input parameter to bitvec_set_bits() as 'const' ...................................................................... Mark input parameter to bitvec_set_bits() as 'const' The input data is accessed in a read-only manner, so it should be marked with the const qualifier. Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index c3c1153..19e2af8 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -70,7 +70,7 @@ enum bit_value bit); int bitvec_set_bit(struct bitvec *bv, enum bit_value bit); int bitvec_get_bit_high(struct bitvec *bv); -int bitvec_set_bits(struct bitvec *bv, enum bit_value *bits, unsigned int count); +int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); int bitvec_set_uint(struct bitvec *bv, uint32_t in, unsigned int count); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); diff --git a/src/bitvec.c b/src/bitvec.c index 88343c4..ef8fd0e 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -198,7 +198,7 @@ * \param[in] bits array of \ref bit_value * \param[in] count number of bits to set * \return 0 on success; negative in case of error */ -int bitvec_set_bits(struct bitvec *bv, enum bit_value *bits, unsigned int count) +int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count) { int i, rc; -- To view, visit https://gerrit.osmocom.org/420 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 27 16:10:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 16:10:31 +0000 Subject: libosmocore[master]: Clarify GPRS ciphering direction In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf1b13da2e889d55cc9dd7516710104dba48c992 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 16:11:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 16:11:01 +0000 Subject: libosmocore[master]: tests: test actual support status for auth. algo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b98481f56a8381058d4b29db5e8a36eb193eee9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 16:11:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 16:11:41 +0000 Subject: libosmocore[master]: Add function to check MS GEA capabilities In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jun 27 16:15:45 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 27 Jun 2016 16:15:45 +0000 Subject: [PATCH] libosmocore[master]: Make C4 function globally available Message-ID: Review at https://gerrit.osmocom.org/424 Make C4 function globally available This function perform 64 -> 128 bit key expansion which useful for converting between UMTS CK and GSM Kc, A5/3 and A5/4, GEA3 and GEA4 keys. Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904 Related: OS#1582 --- M include/osmocom/crypt/auth.h M src/gsm/a5.c M src/gsm/auth_core.c 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/424/1 diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index bed48e7..37b8a8a 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -91,7 +91,7 @@ int osmo_auth_load(const char *path); int osmo_auth_supported(enum osmo_auth_algo algo); - +void osmo_c4(uint8_t *ck, const uint8_t *kc); const char *osmo_auth_alg_name(enum osmo_auth_algo alg); enum osmo_auth_algo osmo_auth_alg_parse(const char *name); diff --git a/src/gsm/a5.c b/src/gsm/a5.c index f1fd697..dbba0f2 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -40,6 +40,7 @@ #include #include +#include /* Somme OS (like Nuttx) don't have ENOTSUP */ #ifndef ENOTSUP @@ -95,8 +96,7 @@ _a5_3(const uint8_t *key, uint32_t fn, ubit_t *dl, ubit_t *ul, bool fn_correct) { uint8_t ck[16]; - memcpy(ck, key, 8); - memcpy(ck + 8, key, 8); + osmo_c4(ck, key); /* internal function require 128 bit key so we expand by concatenating supplied 64 bit key */ _a5_4(ck, fn, dl, ul, fn_correct); } diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index f1ec2ed..3aac069 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -106,7 +106,7 @@ } /* C4 function to derive UMTS CK from GSM Kc */ -static inline void c4_function(uint8_t *ck, const uint8_t *kc) +void osmo_c4(uint8_t *ck, const uint8_t *kc) { memcpy(ck, kc, 8); memcpy(ck+8, kc, 8); @@ -125,7 +125,7 @@ if ((vec->auth_types & OSMO_AUTH_TYPE_GSM) && !(vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { c5_function(vec->ik, vec->kc); - c4_function(vec->ck, vec->kc); + osmo_c4(vec->ck, vec->kc); /* We cannot actually set OSMO_AUTH_TYPE_UMTS as we have no * AUTN and no RES, and thus can only perform GSM * authentication with this tuple. -- To view, visit https://gerrit.osmocom.org/424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jun 27 17:06:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 27 Jun 2016 17:06:28 +0000 Subject: libosmocore[master]: Make C4 function globally available In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 28 04:46:42 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Tue, 28 Jun 2016 04:46:42 +0000 Subject: osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... In-Reply-To: References: Message-ID: Patch Set 1: > Could you add reference to the spec to commit message to make it > easier to follow? Ok i will add. -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 28 04:48:10 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Tue, 28 Jun 2016 04:48:10 +0000 Subject: osmo-pcu[master]: Add decoding of compressed bitmap in EPDAN by tree based Alg... In-Reply-To: References: Message-ID: Patch Set 1: > Also, are there some commonalities between that and #415, code > which can be shared? There is no commonality between #415 and #416. -- To view, visit https://gerrit.osmocom.org/416 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 28 12:03:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 28 Jun 2016 12:03:53 +0000 Subject: [PATCH] libosmocore[master]: Add strings for GPRS ciphers Message-ID: Review at https://gerrit.osmocom.org/425 Add strings for GPRS ciphers Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Related: OS#1582 --- M include/osmocom/crypt/gprs_cipher.h M src/gsm/gprs_cipher_core.c M src/gsm/libosmogsm.map 3 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/425/1 diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index d6edefa..9d98f88 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -1,6 +1,7 @@ #pragma once #include +#include #define GSM0464_CIPH_MAX_BLOCK 1523 @@ -18,6 +19,8 @@ GPRS_CIPH_SGSN2MS, }; +extern const struct value_string gprs_cipher_names[]; + /* An implementation of a GPRS cipher */ struct gprs_cipher_impl { struct llist_head list; diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index e4fac04..8f020b3 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -33,6 +33,15 @@ static struct gprs_cipher_impl *selected_ciphers[_GPRS_ALGO_NUM]; +const struct value_string gprs_cipher_names[] = { + { GPRS_ALGO_GEA0, "GEA0" }, + { GPRS_ALGO_GEA1, "GEA1" }, + { GPRS_ALGO_GEA2, "GEA2" }, + { GPRS_ALGO_GEA3, "GEA3" }, + { GPRS_ALGO_GEA4, "GEA4" }, + { 0, NULL }, +}; + /* register a cipher with the core */ int gprs_cipher_register(struct gprs_cipher_impl *ciph) { diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ea2101c..ebeabcd 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ gprs_cipher_load; gprs_cipher_register; gprs_cipher_run; +gprs_cipher_names; gprs_cipher_supported; gprs_cipher_key_length; gprs_tlli_type; -- To view, visit https://gerrit.osmocom.org/425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 28 12:14:29 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 28 Jun 2016 12:14:29 +0000 Subject: [PATCH] openbsc[master]: SGSN: add vty config for choosing GPRS encryption Message-ID: Review at https://gerrit.osmocom.org/426 SGSN: add vty config for choosing GPRS encryption Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79 Related: OS#1582 --- M openbsc/include/openbsc/sgsn.h M openbsc/src/gprs/sgsn_vty.c 2 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/426/1 diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h index 2b1b97c..fe16593 100644 --- a/openbsc/include/openbsc/sgsn.h +++ b/openbsc/include/openbsc/sgsn.h @@ -3,7 +3,7 @@ #include - +#include #include #include #include @@ -35,6 +35,7 @@ struct gprs_ns_inst *nsi; enum sgsn_auth_policy auth_policy; + enum gprs_ciph_algo cipher; struct llist_head imsi_acl; struct sockaddr_in gsup_server_addr; diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 02c0f31..1d447b1 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -39,7 +39,7 @@ #include #include #include - +#include #include #include @@ -213,6 +213,10 @@ vty_out(vty, " auth-policy %s%s", get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy), VTY_NEWLINE); + if (g_cfg->cipher != GPRS_ALGO_GEA0) + vty_out(vty, " encryption %s%s", + get_value_string(gprs_cipher_names, g_cfg->cipher), + VTY_NEWLINE); if (g_cfg->gsup_server_addr.sin_addr.s_addr) vty_out(vty, " gsup remote-ip %s%s", inet_ntoa(g_cfg->gsup_server_addr.sin_addr), VTY_NEWLINE); @@ -549,6 +553,17 @@ return CMD_WARNING; } + + return CMD_SUCCESS; +} + +DEFUN(cfg_encrypt, cfg_encrypt_cmd, + "encryption (GEA0|GEA1|GEA2|GEA3|GEA4)", + "Set encryption algorithm for SGSN\n" + "Use GEA0 (no encryption)\n" + "Use GEA1\nUse GEA2\nUse GEA3\nUse GEA4\n") +{ + g_cfg->cipher = get_string_value(gprs_cipher_names, argv[0]); return CMD_SUCCESS; } @@ -1060,6 +1075,7 @@ install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd); install_element(SGSN_NODE, &cfg_imsi_acl_cmd); install_element(SGSN_NODE, &cfg_auth_policy_cmd); + install_element(SGSN_NODE, &cfg_encrypt_cmd); install_element(SGSN_NODE, &cfg_gsup_remote_ip_cmd); install_element(SGSN_NODE, &cfg_gsup_remote_port_cmd); install_element(SGSN_NODE, &cfg_gsup_oap_id_cmd); -- To view, visit https://gerrit.osmocom.org/426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 28 12:23:33 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 28 Jun 2016 12:23:33 +0000 Subject: openbsc[master]: SGSN: add vty config for choosing GPRS encryption In-Reply-To: References: Message-ID: Patch Set 1: > Build Failed > > http://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/266/ : > ABORTED I'm testing things with the OpenBSC-gerrit job that got in the way here. Won't happen again because now OpenBSC-gerrit blocks while I run the copied OpenBSC-gerrit-test job. I've already retriggered, will launch in a few minutes. -- To view, visit https://gerrit.osmocom.org/426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jun 28 13:10:51 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 28 Jun 2016 13:10:51 +0000 Subject: [PATCH] libosmocore[master]: Update structure in libosmocore for 11 bit RACH Message-ID: Review at https://gerrit.osmocom.org/427 Update structure in libosmocore for 11 bit RACH Parameters are added to the structure ph_rach_ind_param to differentiate the type of RACH received from Layer 1. This is to further support the 11 bit RACH. Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477 --- M include/osmocom/gsm/l1sap.h 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/427/1 diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index ad942ea..341b4a4 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -46,12 +46,21 @@ uint16_t offset; /*!< \brief Timing Offset */ }; +/*! \brief for PH_RA_IND burstType inforamtion */ +enum ph_burst_type { + GSM_L1_BURST_TYPE_ACCESS_0 = 4, + GSM_L1_BURST_TYPE_ACCESS_1, + GSM_L1_BURST_TYPE_ACCESS_2 +}; + /*! \brief for PH-RANDOM_ACCESS.ind */ struct ph_rach_ind_param { uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ - uint8_t ra; /*!< \brief Random Access */ + uint16_t ra; /*!< \brief Random Access */ uint8_t acc_delay; /*!< \brief Delay in bit periods */ uint32_t fn; /*!< \brief GSM Frame Number at time of RA */ + uint8_t is_11bit; /*!< \brief no.of bits in RACH*/ + enum ph_burst_type burst; /*!< \brief type of burst*/ }; /*! \brief for PH-[UNIT]DATA.{req,ind} | PH-RTS.ind */ -- To view, visit https://gerrit.osmocom.org/427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Jun 28 14:17:56 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 28 Jun 2016 14:17:56 +0000 Subject: [PATCH] libosmocore[master]: gitignore: *-libtool for differing platforms Message-ID: Review at https://gerrit.osmocom.org/428 gitignore: *-libtool for differing platforms Change-Id: Ia8c011b53d4256305e70f78372a4aa0019b1131b --- M .gitignore 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/428/1 diff --git a/.gitignore b/.gitignore index 3a64e7e..39edc1d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ libtool libosmocore-*.tar.* +# libtool for different platforms like arm-poky-linux-gnueabi-libtool +*-libtool + Doxyfile.core Doxyfile.gsm Doxyfile.vty -- To view, visit https://gerrit.osmocom.org/428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8c011b53d4256305e70f78372a4aa0019b1131b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jun 28 14:27:22 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 28 Jun 2016 14:27:22 +0000 Subject: [PATCH] osmo-pcu[master]: Change interface in osmo-pcu for 11 bit RACH Message-ID: Review at https://gerrit.osmocom.org/429 Change interface in osmo-pcu for 11 bit RACH Interface structure between osmo-bts and osmo-pcu is updated with the parameters to differentiate the type of RACH and further support 11 bit RACH. The function prototype and definitions are changed accordingly. Interface version number is increased. Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4 --- M src/bts.cpp M src/bts.h M src/pcu_l1_if.cpp M src/pcuif_proto.h M tests/tbf/TbfTest.cpp 5 files changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/429/1 diff --git a/src/bts.cpp b/src/bts.cpp index c53c92c..d284c1f 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -467,7 +467,8 @@ return 0; } -int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta) +int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, + enum ph_burst_type burst) { struct gprs_rlcmac_ul_tbf *tbf = NULL; uint8_t trx_no, ts_no = 0; diff --git a/src/bts.h b/src/bts.h index 807ce08..0a99b21 100644 --- a/src/bts.h +++ b/src/bts.h @@ -28,6 +28,7 @@ #include #include #include +#include } #include "poll_controller.h" @@ -285,7 +286,8 @@ int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); - int rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta); + int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, + enum ph_burst_type burst); void trigger_dl_ass(gprs_rlcmac_dl_tbf *tbf, gprs_rlcmac_tbf *old_tbf); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 790789c..d586e89 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -314,7 +314,8 @@ case PCU_IF_SAPI_RACH: rc = BTS::main_bts()->rcv_rach( rach_ind->ra, rach_ind->fn, - rach_ind->qta); + rach_ind->qta, rach_ind->is_11bit, + rach_ind->burst); break; default: LOGP(DL1IF, LOGL_ERROR, "Received PCU rach request with " diff --git a/src/pcuif_proto.h b/src/pcuif_proto.h index 9d740ac..eb11770 100644 --- a/src/pcuif_proto.h +++ b/src/pcuif_proto.h @@ -1,7 +1,9 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H -#define PCU_IF_VERSION 0x05 +#include + +#define PCU_IF_VERSION 0x06 /* msg_type */ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ @@ -64,10 +66,12 @@ struct gsm_pcu_if_rach_ind { uint8_t sapi; - uint8_t ra; + uint16_t ra; int16_t qta; uint32_t fn; uint16_t arfcn; + uint8_t is_11bit; + enum ph_burst_type burst; } __attribute__ ((packed)); struct gsm_pcu_if_info_trx { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index e1be844..324430d 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -35,6 +35,7 @@ #include #include #include +#include } #include @@ -552,7 +553,7 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); - the_bts->rcv_rach(0x03, *fn, qta); + the_bts->rcv_rach(0x03, *fn, qta, 0, GSM_L1_BURST_TYPE_ACCESS_0); ul_tbf = the_bts->ul_tbf_by_tfi(tfi, trx_no, ts_no); OSMO_ASSERT(ul_tbf != NULL); @@ -638,8 +639,8 @@ /* needed to set last_rts_fn in the PDCH object */ request_dl_rlc_block(bts, trx_no, ts_no, 0, fn); - /* simulate RACH, this sends an Immediate Assignment Uplink on the AGCH */ - the_bts->rcv_rach(0x73, rach_fn, qta); + /* simulate RACH, sends an Immediate Assignment Uplink on the AGCH */ + the_bts->rcv_rach(0x73, rach_fn, qta, 0, GSM_L1_BURST_TYPE_ACCESS_0); /* get next free TFI */ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); -- To view, visit https://gerrit.osmocom.org/429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Jun 28 14:27:22 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 28 Jun 2016 14:27:22 +0000 Subject: [PATCH] osmo-pcu[master]: Handle EGPRS 11 bit RACH in osmo-pcu Message-ID: Review at https://gerrit.osmocom.org/430 Handle EGPRS 11 bit RACH in osmo-pcu A function is_single_block is added to get request type of RACH. EGPRS 11 bit RACH is handled. Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7 --- M src/bts.cpp M src/bts.h 2 files changed, 63 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/30/430/1 diff --git a/src/bts.cpp b/src/bts.cpp index d284c1f..08381b2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -479,20 +479,14 @@ uint8_t usf = 7; uint8_t tsc; uint16_t ta; + uint16_t ms_class, priority; rach_frame(); - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); - if ((ra & 0xf8) == 0x70) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " - "allocation\n"); - sb = 1; - } else if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single phase access, " - "but we force two phase access\n"); - sb = 1; - } + + sb = is_single_block(ra, burst, is_11bit, &ms_class, &priority); + if (qta < 0) qta = 0; if (qta > 252) @@ -515,13 +509,22 @@ } else { // Create new TBF #warning "Copy and paste with other routines.." - /* set class to 0, since we don't know the multislot class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + + if (is_11bit == 1) { + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, + ms_class, 1); + } else { + /* set class to 0,as we don't know the multislot */ + /* class yet */ + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); + } + if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ return -EBUSY; } + tbf->set_ta(ta); tbf->set_state(GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); @@ -564,6 +567,52 @@ return 0; } +uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst, + uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority) +{ + uint8_t sb = 0; + uint8_t val = 0; + + if ((is_11bit == 0) && (burst == GSM_L1_BURST_TYPE_ACCESS_0)) { + + if ((ra & 0xf8) == 0x70) { + LOGP(DRLCMAC, LOGL_INFO, "MS requests single block " + "allocation\n"); + sb = 1; + } else if (m_bts.force_two_phase) { + LOGP(DRLCMAC, LOGL_INFO, "MS requests single " + "phase access,but we force two phase access\n"); + sb = 1; + } + + } else if ((is_11bit == 1) && ((burst == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst == GSM_L1_BURST_TYPE_ACCESS_2))) { + + val = !!(ra & (1 << 10)); + + if (val == 0) { + sb = 0; + *ms_class = (ra & 0x3e0) >> 5; + *priority = ((ra & 0x18) >> 3); + } else if (m_bts.force_two_phase) { + LOGP(DRLCMAC, LOGL_INFO, "EGPRS 11 bit RACH received." + "MS requests single phase access but we force " + "two phase access\n"); + sb = 1; + } else { + LOGP(DRLCMAC, LOGL_INFO, "EGPRS 11 bit RACH received." + "MS requests single block allocation\n"); + sb = 1; + } + + } else if ((is_11bit == 1) && (burst == GSM_L1_BURST_TYPE_ACCESS_0)) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Error: GPRS 11 bit RACH not supported\n"); + } + + return sb; +} + /* depending on the current TBF, we assign on PACCH or AGCH */ void BTS::trigger_dl_ass( struct gprs_rlcmac_dl_tbf *dl_tbf, diff --git a/src/bts.h b/src/bts.h index 0a99b21..26cd371 100644 --- a/src/bts.h +++ b/src/bts.h @@ -286,6 +286,8 @@ int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); + uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst, + uint8_t is_11bit, uint16_t*, uint16_t*); int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, enum ph_burst_type burst); -- To view, visit https://gerrit.osmocom.org/430 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Jun 28 14:27:22 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 28 Jun 2016 14:27:22 +0000 Subject: [PATCH] osmo-pcu[master]: Update the function immediate assignment for EGPRS Message-ID: Review at https://gerrit.osmocom.org/431 Update the function immediate assignment for EGPRS Encode the EGPRS fields of immediate assignment message in uplink when EGPRS PACKET CHANNEL REQUEST (11 bit RACH) is received. The series of patches for 11 bit RACH are dependent on libosmocore and osmo-bts patches for 11 bit RACH. Change-Id: Ie5e309156e5dbbb6add74a1b4d257c4ee2332e52 --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M tests/edge/EdgeTest.cpp 4 files changed, 84 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/31/431/1 diff --git a/src/bts.cpp b/src/bts.cpp index 08381b2..a4d9cc4 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -554,7 +554,7 @@ plen = Encoding::write_immediate_assignment( tbf, immediate_assignment, 0, ra, Fn, ta, m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, - m_bts.alpha, m_bts.gamma, -1); + m_bts.alpha, m_bts.gamma, -1, burst, sb); if (plen >= 0) { pcu_l1if_tx_agch(immediate_assignment, plen); diff --git a/src/encoding.cpp b/src/encoding.cpp index e174c80..ab00df4 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -19,9 +19,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include #include -#include #include #include @@ -140,11 +140,71 @@ gprs_rlcmac_ul_tbf *tbf, bitvec * dest, unsigned& wp, uint8_t usf, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx) + uint8_t alpha, uint8_t gamma, int8_t ta_idx, + enum ph_burst_type burst, uint16_t ra) { - LOGP(DRLCMACUL, LOGL_ERROR, - "EGPRS Packet Uplink Assignment is not yet implemented\n"); - return -EINVAL; + unsigned int ws_enc = 0; + uint8_t extended_ra = 0; + + extended_ra = (ra & 0x1F); + + bitvec_write_field(dest, wp, 1, 2); /* LH */ + bitvec_write_field(dest, wp, 0, 2); /* 0 EGPRS Uplink Assignment */ + bitvec_write_field(dest, wp, extended_ra, 5); /* Extended RA */ + bitvec_write_field(dest, wp, 0, 1); /* Access technology Request */ + + if (tbf == NULL) { + + bitvec_write_field(dest, wp, 0, 1); /* multiblock allocation */ + + if (alpha) { + bitvec_write_field(dest, wp, 0x1, 1); /* ALPHA =yes */ + bitvec_write_field(dest, wp, alpha, 4); /* ALPHA */ + } else { + bitvec_write_field(dest, wp, 0x0, 1); /* ALPHA = no */ + } + + bitvec_write_field(dest, wp, gamma, 5); /* GAMMA power contrl */ + bitvec_write_field(dest, wp, (fn / (26 * 51)) % 32, 5);/* T1' */ + bitvec_write_field(dest, wp, fn % 51, 6); /* T3 */ + bitvec_write_field(dest, wp, fn % 26, 5); /* T2 */ + bitvec_write_field(dest, wp, 0, 2); /* Radio block allocation */ + + bitvec_write_field(dest, wp, 0, 1); + + } else { + + ws_enc = (tbf->m_window.ws() - 64) / 32; + + bitvec_write_field(dest, wp, 1, 1); /* single block alloc */ + bitvec_write_field(dest, wp, tbf->tfi(), 5);/* TFI assignment */ + bitvec_write_field(dest, wp, 0, 1); /* polling bit */ + bitvec_write_field(dest, wp, 0, 1); /* constant */ + bitvec_write_field(dest, wp, usf, 3); /* USF bit */ + bitvec_write_field(dest, wp, 0, 1); /* USF granularity */ + bitvec_write_field(dest, wp, 0, 1); /* P0 */ + /* MCS */ + bitvec_write_field(dest, wp, tbf->current_cs().to_num()-1, 4); + /* tlli channel block */ + bitvec_write_field(dest, wp, tbf->tlli(), 1); + bitvec_write_field(dest, wp, 0, 1); /* BEP period present */ + bitvec_write_field(dest, wp, 0, 1); /* resegmentation */ + bitvec_write_field(dest, wp, ws_enc, 5);/* egprs window_size */ + + if (alpha) { + bitvec_write_field(dest, wp, 0x1, 1); /* ALPHA =yes */ + bitvec_write_field(dest, wp, alpha, 4); /* ALPHA */ + } else { + bitvec_write_field(dest, wp, 0x0, 1); /* ALPHA = no */ + } + + bitvec_write_field(dest, wp, gamma, 5); /* GAMMA power contrl */ + bitvec_write_field(dest, wp, 0, 1); /* TIMING_ADVANCE_INDEX */ + bitvec_write_field(dest, wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ + bitvec_write_field(dest, wp, 0, 1); /* NULL */ + } + + return 0; } /* @@ -153,10 +213,10 @@ */ int Encoding::write_immediate_assignment( struct gprs_rlcmac_tbf *tbf, - bitvec * dest, uint8_t downlink, uint8_t ra, + bitvec * dest, uint8_t downlink, uint16_t ra, uint32_t ref_fn, uint8_t ta, uint16_t arfcn, uint8_t ts, uint8_t tsc, uint8_t usf, uint8_t polling, uint32_t fn, uint8_t alpha, - uint8_t gamma, int8_t ta_idx) + uint8_t gamma, int8_t ta_idx, enum ph_burst_type burst, uint8_t sb) { unsigned wp = 0; int plen; @@ -182,7 +242,13 @@ bitvec_write_field(dest, wp,arfcn,10); // ARFCN //10.5.2.30 Request Reference - bitvec_write_field(dest, wp,ra,8); // RA + if (((burst == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst == GSM_L1_BURST_TYPE_ACCESS_2))) { + bitvec_write_field(dest, wp, 0x7f, 8); /* RACH value */ + } else { + bitvec_write_field(dest, wp, ra, 8); /* RACH value */ + } + bitvec_write_field(dest, wp,(ref_fn / (26 * 51)) % 32,5); // T1' bitvec_write_field(dest, wp,ref_fn % 51,6); // T3 bitvec_write_field(dest, wp,ref_fn % 26,5); // T2 @@ -206,10 +272,11 @@ rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, wp, polling, fn, alpha, gamma, ta_idx); - else if (as_ul_tbf(tbf) && as_ul_tbf(tbf)->is_egprs_enabled()) + else if (((burst == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst == GSM_L1_BURST_TYPE_ACCESS_2))) rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, wp, usf, fn, - alpha, gamma, ta_idx); + alpha, gamma, ta_idx, burst, ra); else rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, wp, usf, fn, diff --git a/src/encoding.h b/src/encoding.h index 710de78..1dfc3bc 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -40,11 +40,13 @@ public: static int write_immediate_assignment( struct gprs_rlcmac_tbf *tbf, - bitvec * dest, uint8_t downlink, uint8_t ra, + bitvec * dest, uint8_t downlink, uint16_t ra, uint32_t ref_fn, uint8_t ta, uint16_t arfcn, uint8_t ts, uint8_t tsc, uint8_t usf, uint8_t polling, uint32_t fn, uint8_t alpha, uint8_t gamma, - int8_t ta_idx); + int8_t ta_idx, + enum ph_burst_type burst = GSM_L1_BURST_TYPE_ACCESS_0, + uint8_t sb = 1); static void write_packet_uplink_assignment( struct gprs_rlcmac_bts *bts, diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 8b5746a..48b2449 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -23,7 +23,6 @@ #include "gprs_debug.h" #include "gprs_coding_scheme.h" #include "decoding.h" -#include "encoding.h" #include "rlc.h" #include "llc.h" #include "bts.h" @@ -35,10 +34,12 @@ #include #include #include +#include } #include #include +#include "encoding.h" void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; -- To view, visit https://gerrit.osmocom.org/431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie5e309156e5dbbb6add74a1b4d257c4ee2332e52 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Jun 28 15:07:25 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 28 Jun 2016 15:07:25 +0000 Subject: [PATCH] libosmocore[master]: Clarify GPRS algorithm Message-ID: Review at https://gerrit.osmocom.org/432 Clarify GPRS algorithm Add spec reference and set explicit values for enum representing ciphering algorithm for GPRS encryption. Change-Id: Ia9ee429b73a37d52599fce70778cfe87b767411c Related: OS#1582 --- M include/osmocom/crypt/gprs_cipher.h 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/432/1 diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index d6edefa..c4ba980 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -4,12 +4,13 @@ #define GSM0464_CIPH_MAX_BLOCK 1523 +/* 3GPP TS 24.008 ? 10.5.5.3 */ enum gprs_ciph_algo { - GPRS_ALGO_GEA0, - GPRS_ALGO_GEA1, - GPRS_ALGO_GEA2, - GPRS_ALGO_GEA3, - GPRS_ALGO_GEA4, + GPRS_ALGO_GEA0 = 0, + GPRS_ALGO_GEA1 = 1, + GPRS_ALGO_GEA2 = 2, + GPRS_ALGO_GEA3 = 3, + GPRS_ALGO_GEA4 = 4, _GPRS_ALGO_NUM }; -- To view, visit https://gerrit.osmocom.org/432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9ee429b73a37d52599fce70778cfe87b767411c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jun 28 15:15:06 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 28 Jun 2016 15:15:06 +0000 Subject: [PATCH] osmo-bts[master]: Change interface in osmo-bts for 11 bit RACH Message-ID: Review at https://gerrit.osmocom.org/433 Change interface in osmo-bts for 11 bit RACH Interface structure between osmo-bts and osmo-pcu is updated with the parameters to differentiate the type of RACH and further support 11 bit RACH. The function prototype and definitions are changed accordingly. Interface version number is increased. Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d --- M include/osmo-bts/pcu_if.h M include/osmo-bts/pcuif_proto.h M src/common/l1sap.c M src/common/pcu_sock.c M src/osmo-bts-sysmo/l1_if.c 5 files changed, 21 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/433/1 diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index 3ce4d0b..15ecc6c 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -11,7 +11,8 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, int8_t rssi); -int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn); +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst); int pcu_tx_time_ind(uint32_t fn); int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed); int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len); diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index 9d740ac..b965d7c 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -1,7 +1,7 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H -#define PCU_IF_VERSION 0x05 +#define PCU_IF_VERSION 0x06 /* msg_type */ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ @@ -64,10 +64,12 @@ struct gsm_pcu_if_rach_ind { uint8_t sapi; - uint8_t ra; + uint16_t ra; int16_t qta; uint32_t fn; uint16_t arfcn; + uint8_t is_11bit; + enum ph_burst_type burst; } __attribute__ ((packed)); struct gsm_pcu_if_info_trx { diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 5ea2a2c..2fc0ecb 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -948,10 +948,13 @@ return l1sap_handover_rach(trx, l1sap, rach_ind); /* check for packet access */ - if (trx == bts->c0 && L1SAP_IS_PACKET_RACH(rach_ind->ra)) { + if ((trx == bts->c0 && L1SAP_IS_PACKET_RACH(rach_ind->ra)) || + (trx == bts->c0 && rach_ind->is_11bit)) { + LOGP(DL1P, LOGL_INFO, "RACH for packet access\n"); pcu_tx_rach_ind(bts, rach_ind->acc_delay << 2, - rach_ind->ra, rach_ind->fn); + rach_ind->ra, rach_ind->fn, + rach_ind->is_11bit, rach_ind->burst); return 0; } diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index d52cdb1..8a5c508 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -361,7 +361,8 @@ return pcu_sock_send(&bts_gsmnet, msg); } -int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn) +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst) { struct msgb *msg; struct gsm_pcu_if *pcu_prim; @@ -380,6 +381,8 @@ rach_ind->ra = ra; rach_ind->qta = qta; rach_ind->fn = fn; + rach_ind->is_11bit = is_11bit; + rach_ind->burst = burst; return pcu_sock_send(&bts_gsmnet, msg); } diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 355507d..168e004 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -960,6 +960,12 @@ l1sap->u.rach_ind.ra = ra; l1sap->u.rach_ind.acc_delay = acc_delay; l1sap->u.rach_ind.fn = fn; + + /* Initialising the parameters needs to be handled when 11 bit RACH */ + + l1sap->u.rach_ind.is_11bit = 0; + l1sap->u.rach_ind.burst = GSM_L1_BURST_TYPE_ACCESS_0; + if (!lchan || lchan->ts->pchan == GSM_PCHAN_CCCH || lchan->ts->pchan == GSM_PCHAN_CCCH_SDCCH4) l1sap->u.rach_ind.chan_nr = 0x88; -- To view, visit https://gerrit.osmocom.org/433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Jun 28 15:15:06 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 28 Jun 2016 15:15:06 +0000 Subject: [PATCH] osmo-bts[master]: Update parameters in osmo-bts for 11 bit RACH Message-ID: Review at https://gerrit.osmocom.org/434 Update parameters in osmo-bts for 11 bit RACH Based on the indication from L1, number of bits in RACH and burst type is determined. Appropriate parameters are filled in osmo-bts. These parameters are sent to osmo-pcu for processing of the RACH. Change-Id: I93831ddfb3f31b637e6a576f23a9bb4557758582 --- M src/osmo-bts-sysmo/l1_if.c 1 file changed, 25 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/34/434/1 diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 168e004..64bf65e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -919,7 +919,7 @@ struct gsm_lchan *lchan; struct osmo_phsap_prim *l1sap; uint32_t fn; - uint8_t ra, acc_delay = 0; + uint16_t ra = 0, acc_delay = 0, is_11bit = 0, burst_type = 0, temp = 0; int rc; /* increment number of busy RACH slots, if required */ @@ -941,16 +941,36 @@ btsb->load.rach.access++; dump_meas_res(LOGL_DEBUG, &ra_ind->measParam); + burst_type = ra_ind->burstType; - if (ra_ind->msgUnitParam.u8Size != 1) { + if ((ra_ind->msgUnitParam.u8Size != 1) && + (ra_ind->msgUnitParam.u8Size != 2)) { LOGP(DL1C, LOGL_ERROR, "PH-RACH-INDICATION has %d bits\n", ra_ind->sapi); msgb_free(l1p_msg); return 0; } + if (ra_ind->msgUnitParam.u8Size == 2) { + is_11bit = 1; + ra = ra_ind->msgUnitParam.u8Buffer[0]; + ra = ra << 3; + temp = (ra_ind->msgUnitParam.u8Buffer[1] & 0x7); + ra = ra | temp; + + LOGP(DL1P, LOGL_DEBUG, "11 bit RACH :%d and burst type :%d ", + ra, burst_type); + LOGP(DL1P, LOGL_DEBUG, " 0th byte :%d \n and 1st byte: %d \n", + ra_ind->msgUnitParam.u8Buffer[0], + ra_ind->msgUnitParam.u8Buffer[1]); + } else { + is_11bit = 0; + ra = ra_ind->msgUnitParam.u8Buffer[0]; + LOGP(DL1P, LOGL_DEBUG, "8 bit RACH ra:%d and burst type %d\n", + ra, burst_type); + } + fn = ra_ind->u32Fn; - ra = ra_ind->msgUnitParam.u8Buffer[0]; rc = msgb_trim(l1p_msg, sizeof(*l1sap)); if (rc < 0) MSGB_ABORT(l1p_msg, "No room for primitive data\n"); @@ -960,11 +980,8 @@ l1sap->u.rach_ind.ra = ra; l1sap->u.rach_ind.acc_delay = acc_delay; l1sap->u.rach_ind.fn = fn; - - /* Initialising the parameters needs to be handled when 11 bit RACH */ - - l1sap->u.rach_ind.is_11bit = 0; - l1sap->u.rach_ind.burst = GSM_L1_BURST_TYPE_ACCESS_0; + l1sap->u.rach_ind.is_11bit = is_11bit; /* no of bits in 11 bit RACH */ + l1sap->u.rach_ind.burst = burst_type; /* type of burst */ if (!lchan || lchan->ts->pchan == GSM_PCHAN_CCCH || lchan->ts->pchan == GSM_PCHAN_CCCH_SDCCH4) -- To view, visit https://gerrit.osmocom.org/434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93831ddfb3f31b637e6a576f23a9bb4557758582 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Jun 28 15:55:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 28 Jun 2016 15:55:23 +0000 Subject: [PATCH] openbsc[master]: SGSN: move TLLI unassignment into separate function Message-ID: Review at https://gerrit.osmocom.org/435 SGSN: move TLLI unassignment into separate function Change-Id: Ia4df145ab03ebcaad70a13601cff60c488a5de54 Related: OS#1582 --- M openbsc/include/openbsc/gprs_llc.h M openbsc/src/gprs/gprs_gmm.c M openbsc/src/gprs/gprs_llc.c M openbsc/src/gprs/gprs_sgsn.c M openbsc/tests/sgsn/sgsn_test.c 5 files changed, 18 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/35/435/1 diff --git a/openbsc/include/openbsc/gprs_llc.h b/openbsc/include/openbsc/gprs_llc.h index d54b72e..8cd0c26 100644 --- a/openbsc/include/openbsc/gprs_llc.h +++ b/openbsc/include/openbsc/gprs_llc.h @@ -218,6 +218,7 @@ int gprs_llgmm_assign(struct gprs_llc_llme *llme, uint32_t old_tlli, uint32_t new_tlli, enum gprs_ciph_algo alg, const uint8_t *kc); +int gprs_llgmm_unassign(struct gprs_llc_llme *llme); int gprs_llc_init(const char *cipher_plugin_path); int gprs_llc_vty_init(void); diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 5848a63..5db69dd 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -982,8 +982,7 @@ if (ctx) mm_ctx_cleanup_free(ctx, "GPRS ATTACH REJ"); else - /* TLLI unassignment */ - gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + gprs_llgmm_unassign(llme); return rc; @@ -1286,11 +1285,8 @@ if (mmctx) mm_ctx_cleanup_free(mmctx, "GPRS RA UPDATE REJ"); else { - if (llme) { - /* TLLI unassignment */ - gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, - GPRS_ALGO_GEA0, NULL); - } + if (llme) + gprs_llgmm_unassign(llme); } return rc; @@ -1323,17 +1319,13 @@ /* 4.7.10 */ if (gh->msg_type == GSM48_MT_GMM_STATUS) { /* TLLI unassignment */ - gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, - GPRS_ALGO_GEA0, NULL); + gprs_llgmm_unassign(llme); return 0; } /* Don't reply or establish a LLME on DETACH_ACK */ - if (gh->msg_type == GSM48_MT_GMM_DETACH_ACK) { - /* TLLI unassignment */ - return gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, - GPRS_ALGO_GEA0, NULL); - } + if (gh->msg_type == GSM48_MT_GMM_DETACH_ACK) + return gprs_llgmm_unassign(llme); gprs_llgmm_reset(llme); @@ -1343,8 +1335,7 @@ rc = gsm48_rx_gmm_det_req(NULL, msg); /* TLLI unassignment */ - gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, - GPRS_ALGO_GEA0, NULL); + gprs_llgmm_unassign(llme); return rc; } @@ -1352,8 +1343,7 @@ rc = sgsn_force_reattach_oldmsg(msg); /* TLLI unassignment */ - gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, - GPRS_ALGO_GEA0, NULL); + gprs_llgmm_unassign(llme); return rc; } diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c index 71178c9..64d22b3 100644 --- a/openbsc/src/gprs/gprs_llc.c +++ b/openbsc/src/gprs/gprs_llc.c @@ -745,6 +745,13 @@ return 0; } +/* TLLI unassignment */ +int gprs_llgmm_unassign(struct gprs_llc_llme *llme) +{ + return gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, GPRS_ALGO_GEA0, + NULL); +} + /* Chapter 7.2.1.2 LLGMM-RESET.req */ int gprs_llgmm_reset(struct gprs_llc_llme *llme) { diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index 8f9f453..98439de 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -770,7 +770,7 @@ /* No MM context found */ LOGP(DGPRS, LOGL_INFO, "Deleting orphaned LLME, TLLI 0x%08x\n", llme->tlli); - gprs_llgmm_assign(llme, llme->tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + gprs_llgmm_unassign(llme); } static void sgsn_llme_check_cb(void *data_) diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index f425c33..d568807 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -222,7 +222,7 @@ OSMO_ASSERT(count(gprs_llme_list()) == 1); /* unassign which should delete it*/ - gprs_llgmm_assign(lle->llme, lle->llme->tlli, 0xffffffff, GPRS_ALGO_GEA0, NULL); + gprs_llgmm_unassign(lle->llme); /* Check that everything was cleaned up */ OSMO_ASSERT(count(gprs_llme_list()) == 0); -- To view, visit https://gerrit.osmocom.org/435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4df145ab03ebcaad70a13601cff60c488a5de54 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jun 29 10:06:00 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 29 Jun 2016 10:06:00 +0000 Subject: [PATCH] openbsc[master]: SGSN: add vty config for choosing GPRS encryption In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/426 to look at the new patch set (#2). SGSN: add vty config for choosing GPRS encryption Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79 Related: OS#1582 --- M openbsc/include/openbsc/sgsn.h M openbsc/src/gprs/sgsn_vty.c 2 files changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/426/2 diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h index 2b1b97c..fe16593 100644 --- a/openbsc/include/openbsc/sgsn.h +++ b/openbsc/include/openbsc/sgsn.h @@ -3,7 +3,7 @@ #include - +#include #include #include #include @@ -35,6 +35,7 @@ struct gprs_ns_inst *nsi; enum sgsn_auth_policy auth_policy; + enum gprs_ciph_algo cipher; struct llist_head imsi_acl; struct sockaddr_in gsup_server_addr; diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 02c0f31..419842c 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -39,7 +39,7 @@ #include #include #include - +#include #include #include @@ -213,6 +213,10 @@ vty_out(vty, " auth-policy %s%s", get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy), VTY_NEWLINE); + if (g_cfg->cipher != GPRS_ALGO_GEA0) + vty_out(vty, " encryption %s%s", + get_value_string(gprs_cipher_names, g_cfg->cipher), + VTY_NEWLINE); if (g_cfg->gsup_server_addr.sin_addr.s_addr) vty_out(vty, " gsup remote-ip %s%s", inet_ntoa(g_cfg->gsup_server_addr.sin_addr), VTY_NEWLINE); @@ -549,6 +553,22 @@ return CMD_WARNING; } + + return CMD_SUCCESS; +} + +DEFUN(cfg_encrypt, cfg_encrypt_cmd, + "encryption (GEA0|GEA1|GEA2|GEA3|GEA4)", + "Set encryption algorithm for SGSN\n" + "Use GEA0 (no encryption)\n" + "Use GEA1\nUse GEA2\nUse GEA3\nUse GEA4\n") +{ + if (!g_cfg->require_authentication) { + vty_out(vty, "%% unable to use encryption without " + "authentication: adjust auth-policy%s", op, VTY_NEWLINE); + return CMD_WARNING; + } + g_cfg->cipher = get_string_value(gprs_cipher_names, argv[0]); return CMD_SUCCESS; } @@ -1060,6 +1080,7 @@ install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd); install_element(SGSN_NODE, &cfg_imsi_acl_cmd); install_element(SGSN_NODE, &cfg_auth_policy_cmd); + install_element(SGSN_NODE, &cfg_encrypt_cmd); install_element(SGSN_NODE, &cfg_gsup_remote_ip_cmd); install_element(SGSN_NODE, &cfg_gsup_remote_port_cmd); install_element(SGSN_NODE, &cfg_gsup_oap_id_cmd); -- To view, visit https://gerrit.osmocom.org/426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 29 12:24:36 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Wed, 29 Jun 2016 12:24:36 +0000 Subject: [PATCH] openbsc[master]: Modify SI 13 field to support 11 bit RACH Message-ID: Review at https://gerrit.osmocom.org/436 Modify SI 13 field to support 11 bit RACH System Information 13 field EGPRS PACKET CHANNEL REQUEST is modified to support 11 bit RACH. Further VTY configuration is added to enable/disable 11 bit RACH support in EGPRS. By default 11 bit RACH support is disabled. Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297 --- M openbsc/include/openbsc/gsm_data_shared.h M openbsc/include/openbsc/rest_octets.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/rest_octets.c M openbsc/src/libbsc/system_information.c 5 files changed, 57 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/36/436/1 diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index d3a61af..9ee16ee 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -690,6 +690,7 @@ /* Not entirely sure how ip.access specific this is */ struct { + uint8_t is_11bit_rach; enum bts_gprs_mode mode; struct { struct gsm_abis_mo mo; diff --git a/openbsc/include/openbsc/rest_octets.h b/openbsc/include/openbsc/rest_octets.h index 91413b5..31b2f06 100644 --- a/openbsc/include/openbsc/rest_octets.h +++ b/openbsc/include/openbsc/rest_octets.h @@ -88,6 +88,7 @@ uint32_t t3192; /* in milliseconds */ uint32_t drx_timer_max;/* in seconds */ uint32_t bs_cv_max; + uint8_t is_11bit_rach; uint8_t ext_info_present; struct { diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 04f2cc6..037c69a 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -444,6 +444,15 @@ if (bts->gprs.mode == BTS_GPRS_NONE) return; + if (bts->gprs.is_11bit_rach) { + vty_out(vty, " eleven_bit_rach_support%s", + VTY_NEWLINE); + } else { + vty_out(vty, " no eleven_bit_rach_support%s", + VTY_NEWLINE); + + } + vty_out(vty, " gprs routing area %u%s", bts->gprs.rac, VTY_NEWLINE); vty_out(vty, " gprs network-control-order nc%u%s", @@ -2720,6 +2729,40 @@ return CMD_SUCCESS; } +#define eleven_bit_RACH_STR "11 bit RACH configuration\n" + +DEFUN(cfg_bts_eleven_bit_rach, cfg_bts_eleven_bit_rach_cmd, + "eleven_bit_rach_support", + eleven_bit_RACH_STR "Enable 11 bit RACH for EGPRS\n") +{ + struct gsm_bts *bts = vty->index; + + bts->gprs.is_11bit_rach = 1; + + if (bts->gprs.is_11bit_rach > 1) { + vty_out(vty, "Error in RACH type%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_bts_no_eleven_bit_rach, cfg_bts_no_eleven_bit_rach_cmd, + "no eleven_bit_rach_support", + NO_STR eleven_bit_RACH_STR) +{ + struct gsm_bts *bts = vty->index; + + bts->gprs.is_11bit_rach = 0; + + if (bts->gprs.is_11bit_rach > 1) { + vty_out(vty, "Error in RACH type%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + #define SI_TEXT "System Information Messages\n" #define SI_TYPE_TEXT "(1|2|3|4|5|6|7|8|9|10|13|16|17|18|19|20|2bis|2ter|2quater|5bis|5ter)" #define SI_TYPE_HELP "System Information Type 1\n" \ @@ -4081,6 +4124,8 @@ install_element(BTS_NODE, &cfg_bts_penalty_time_rsvd_cmd); install_element(BTS_NODE, &cfg_bts_radio_link_timeout_cmd); install_element(BTS_NODE, &cfg_bts_gprs_mode_cmd); + install_element(BTS_NODE, &cfg_bts_eleven_bit_rach_cmd); + install_element(BTS_NODE, &cfg_bts_no_eleven_bit_rach_cmd); install_element(BTS_NODE, &cfg_bts_gprs_ns_timer_cmd); install_element(BTS_NODE, &cfg_bts_gprs_rac_cmd); install_element(BTS_NODE, &cfg_bts_gprs_net_ctrl_ord_cmd); diff --git a/openbsc/src/libbsc/rest_octets.c b/openbsc/src/libbsc/rest_octets.c index 065fb7b..06ac532 100644 --- a/openbsc/src/libbsc/rest_octets.c +++ b/openbsc/src/libbsc/rest_octets.c @@ -649,8 +649,15 @@ bitvec_set_uint(bv, (1 + 5 + 3)-1, 6); /* EGPRS supported in the cell */ bitvec_set_bit(bv, 1); + /* 1bit EGPRS PACKET CHANNEL REQUEST */ - bitvec_set_bit(bv, gco->ext_info.use_egprs_p_ch_req); + if (gco->is_11bit_rach == 0) { + bitvec_set_bit(bv, + gco->ext_info.use_egprs_p_ch_req); + } else { + bitvec_set_bit(bv, 0); + } + /* 4bit BEP PERIOD */ bitvec_set_uint(bv, gco->ext_info.bep_period, 4); } diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index fd228e3..2eea851 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -957,6 +957,7 @@ .drx_timer_max = 3, .bs_cv_max = 15, .ext_info_present = 0, + .is_11bit_rach = 0, .ext_info = { /* The values below are just guesses ! */ .egprs_supported = 0, @@ -1004,6 +1005,7 @@ /* Information about the other SIs */ si13_default.bcch_change_mark = bts->bcch_change_mark; + si13_default.cell_opts.is_11bit_rach = bts->gprs.is_11bit_rach; ret = rest_octets_si13(si13->rest_octets, &si13_default); if (ret < 0) -- To view, visit https://gerrit.osmocom.org/436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Wed Jun 29 12:49:59 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Wed, 29 Jun 2016 12:49:59 +0000 Subject: osmo-pcu[master]: Change interface in osmo-pcu for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: There is dependency for this patch on libosmocore Gerrit-Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477 for compilation and hence there is a build failure in jenkins. For functionality there is a dependency on osmo-bts Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d and openbsc Gerrit-Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297 -- To view, visit https://gerrit.osmocom.org/429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 12:57:13 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Wed, 29 Jun 2016 12:57:13 +0000 Subject: osmo-bts[master]: Change interface in osmo-bts for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: This patch has the dependency on libosmocore Gerrit-Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477 hence the jenkins build has failed. For the functionality osmo-pcu Gerrit-Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4 and openbsc Gerrit-Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297 -- To view, visit https://gerrit.osmocom.org/433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:19:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:19:15 +0000 Subject: libosmocore[master]: Update structure in libosmocore for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:20:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:20:34 +0000 Subject: osmo-bts[master]: Change interface in osmo-bts for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/433/1/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 968: what about the other bts models? will the break if you don't initialize the rach_ind similarly? -- To view, visit https://gerrit.osmocom.org/433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:21:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:21:24 +0000 Subject: osmo-pcu[master]: Change interface in osmo-pcu for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/429 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:24:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:24:08 +0000 Subject: openbsc[master]: Modify SI 13 field to support 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/436/1/openbsc/include/openbsc/gsm_data_shared.h File openbsc/include/openbsc/gsm_data_shared.h: Line 693: uint8_t is_11bit_rach; naming: I think has_11bit_rach or supports_11bit_rach is better than "is". Neither the BTS nor the SI "is" a RACH. https://gerrit.osmocom.org/#/c/436/1/openbsc/src/libbsc/bsc_vty.c File openbsc/src/libbsc/bsc_vty.c: Line 448: vty_out(vty, " eleven_bit_rach_support%s", so you write some parameter when saving the file, butI don't see you add any VTY code to parse the file. did you try saving the config file and re-starting the BSC with the file you just saved? I think it will refuse to start due to syntax errors. -- To view, visit https://gerrit.osmocom.org/436 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51357bec936c28a26ab9ff5d59e0e30ca3363297 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:26:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:26:55 +0000 Subject: openbsc[master]: SGSN: add vty config for choosing GPRS encryption In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/426/2/openbsc/src/gprs/sgsn_vty.c File openbsc/src/gprs/sgsn_vty.c: Line 216: if (g_cfg->cipher != GPRS_ALGO_GEA0) what happens Line 571: g_cfg->cipher = get_string_value(gprs_cipher_names, argv[0]); so what about the user configuring an algorithm that's not available? Shouldn't we call the gprs_cipher_supported() and refuse any non-supported algorithms? -- To view, visit https://gerrit.osmocom.org/426 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:27:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:27:34 +0000 Subject: openbsc[master]: SGSN: move TLLI unassignment into separate function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/435 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4df145ab03ebcaad70a13601cff60c488a5de54 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:27:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:27:53 +0000 Subject: libosmocore[master]: Clarify GPRS algorithm In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia9ee429b73a37d52599fce70778cfe87b767411c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:30:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:30:20 +0000 Subject: osmo-bts[master]: Update parameters in osmo-bts for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/434/1/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 963: LOGP(DL1P, LOGL_DEBUG, " 0th byte :%d \n and 1st byte: %d \n", please remove those debug messages. I think they're quite a bit too low level and are probably not needed after your initial testing/development. L1P debugging already will print us the hexdump of the primitive, and GSMTAP will probbly also generate a wireshark-parseable prtoocol trace. There can be many rach requests processed, so better not spend too much time in printf() for each of them. Also, the old code didn't do any logging either... -- To view, visit https://gerrit.osmocom.org/434 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93831ddfb3f31b637e6a576f23a9bb4557758582 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:31:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:31:48 +0000 Subject: osmo-pcu[master]: Update the function immediate assignment for EGPRS In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/431/1/src/encoding.h File src/encoding.h: Line 48: enum ph_burst_type burst = GSM_L1_BURST_TYPE_ACCESS_0, I'd really appreciate if the variable (and L1 primitive structure member) was called burst_type or btype or something like that. It's not like it stores the actual burst. -- To view, visit https://gerrit.osmocom.org/431 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie5e309156e5dbbb6add74a1b4d257c4ee2332e52 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:32:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:32:00 +0000 Subject: libosmocore[master]: gitignore: *-libtool for differing platforms In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8c011b53d4256305e70f78372a4aa0019b1131b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:32:01 +0000 Subject: [MERGED] libosmocore[master]: gitignore: *-libtool for differing platforms In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gitignore: *-libtool for differing platforms ...................................................................... gitignore: *-libtool for differing platforms Change-Id: Ia8c011b53d4256305e70f78372a4aa0019b1131b --- M .gitignore 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 3a64e7e..39edc1d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ libtool libosmocore-*.tar.* +# libtool for different platforms like arm-poky-linux-gnueabi-libtool +*-libtool + Doxyfile.core Doxyfile.gsm Doxyfile.vty -- To view, visit https://gerrit.osmocom.org/428 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8c011b53d4256305e70f78372a4aa0019b1131b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:32:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:32:25 +0000 Subject: libosmocore[master]: Add strings for GPRS ciphers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:32:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:32:27 +0000 Subject: [MERGED] libosmocore[master]: Add strings for GPRS ciphers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add strings for GPRS ciphers ...................................................................... Add strings for GPRS ciphers Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Related: OS#1582 --- M include/osmocom/crypt/gprs_cipher.h M src/gsm/gprs_cipher_core.c M src/gsm/libosmogsm.map 3 files changed, 13 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index d6edefa..9d98f88 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -1,6 +1,7 @@ #pragma once #include +#include #define GSM0464_CIPH_MAX_BLOCK 1523 @@ -18,6 +19,8 @@ GPRS_CIPH_SGSN2MS, }; +extern const struct value_string gprs_cipher_names[]; + /* An implementation of a GPRS cipher */ struct gprs_cipher_impl { struct llist_head list; diff --git a/src/gsm/gprs_cipher_core.c b/src/gsm/gprs_cipher_core.c index e4fac04..8f020b3 100644 --- a/src/gsm/gprs_cipher_core.c +++ b/src/gsm/gprs_cipher_core.c @@ -33,6 +33,15 @@ static struct gprs_cipher_impl *selected_ciphers[_GPRS_ALGO_NUM]; +const struct value_string gprs_cipher_names[] = { + { GPRS_ALGO_GEA0, "GEA0" }, + { GPRS_ALGO_GEA1, "GEA1" }, + { GPRS_ALGO_GEA2, "GEA2" }, + { GPRS_ALGO_GEA3, "GEA3" }, + { GPRS_ALGO_GEA4, "GEA4" }, + { 0, NULL }, +}; + /* register a cipher with the core */ int gprs_cipher_register(struct gprs_cipher_impl *ciph) { diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ea2101c..ebeabcd 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -39,6 +39,7 @@ gprs_cipher_load; gprs_cipher_register; gprs_cipher_run; +gprs_cipher_names; gprs_cipher_supported; gprs_cipher_key_length; gprs_tlli_type; -- To view, visit https://gerrit.osmocom.org/425 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:32:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:32:55 +0000 Subject: [MERGED] libosmocore[master]: Make C4 function globally available In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make C4 function globally available ...................................................................... Make C4 function globally available This function perform 64 -> 128 bit key expansion which useful for converting between UMTS CK and GSM Kc, A5/3 and A5/4, GEA3 and GEA4 keys. Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904 Related: OS#1582 --- M include/osmocom/crypt/auth.h M src/gsm/a5.c M src/gsm/auth_core.c 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index bed48e7..37b8a8a 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -91,7 +91,7 @@ int osmo_auth_load(const char *path); int osmo_auth_supported(enum osmo_auth_algo algo); - +void osmo_c4(uint8_t *ck, const uint8_t *kc); const char *osmo_auth_alg_name(enum osmo_auth_algo alg); enum osmo_auth_algo osmo_auth_alg_parse(const char *name); diff --git a/src/gsm/a5.c b/src/gsm/a5.c index f1fd697..dbba0f2 100644 --- a/src/gsm/a5.c +++ b/src/gsm/a5.c @@ -40,6 +40,7 @@ #include #include +#include /* Somme OS (like Nuttx) don't have ENOTSUP */ #ifndef ENOTSUP @@ -95,8 +96,7 @@ _a5_3(const uint8_t *key, uint32_t fn, ubit_t *dl, ubit_t *ul, bool fn_correct) { uint8_t ck[16]; - memcpy(ck, key, 8); - memcpy(ck + 8, key, 8); + osmo_c4(ck, key); /* internal function require 128 bit key so we expand by concatenating supplied 64 bit key */ _a5_4(ck, fn, dl, ul, fn_correct); } diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index f1ec2ed..3aac069 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -106,7 +106,7 @@ } /* C4 function to derive UMTS CK from GSM Kc */ -static inline void c4_function(uint8_t *ck, const uint8_t *kc) +void osmo_c4(uint8_t *ck, const uint8_t *kc) { memcpy(ck, kc, 8); memcpy(ck+8, kc, 8); @@ -125,7 +125,7 @@ if ((vec->auth_types & OSMO_AUTH_TYPE_GSM) && !(vec->auth_types & OSMO_AUTH_TYPE_UMTS)) { c5_function(vec->ik, vec->kc); - c4_function(vec->ck, vec->kc); + osmo_c4(vec->ck, vec->kc); /* We cannot actually set OSMO_AUTH_TYPE_UMTS as we have no * AUTN and no RES, and thus can only perform GSM * authentication with this tuple. -- To view, visit https://gerrit.osmocom.org/424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:33:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:33:25 +0000 Subject: [MERGED] libosmocore[master]: Add function to check MS GEA capabilities In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add function to check MS GEA capabilities ...................................................................... Add function to check MS GEA capabilities Add function which parses MS network capability IE value for bits indicating support for particular version of GEA. Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Relates: OS#1582 --- M include/osmocom/gsm/protocol/gsm_04_08_gprs.h M src/gsm/gsm_04_08_gprs.c M src/gsm/libosmogsm.map 3 files changed, 36 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h index e0e887f..ed9a596 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08_gprs.h +++ b/include/osmocom/gsm/protocol/gsm_04_08_gprs.h @@ -2,7 +2,9 @@ #define _GSM48_GPRS_H #include +#include #include +#include /* Table 10.4 / 10.4a, GPRS Mobility Management (GMM) */ #define GSM48_MT_GMM_ATTACH_REQ 0x01 @@ -362,6 +364,9 @@ GSM48_QOS_SERR_1e_1 = 0x07, }; +bool gprs_ms_net_cap_gea_supported(const uint8_t *ms_net_cap, uint8_t cap_len, + enum gprs_ciph_algo gea); + /* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */ struct gsm48_qos { /* octet 3 */ diff --git a/src/gsm/gsm_04_08_gprs.c b/src/gsm/gsm_04_08_gprs.c index 5c00ea0..7018777 100644 --- a/src/gsm/gsm_04_08_gprs.c +++ b/src/gsm/gsm_04_08_gprs.c @@ -21,8 +21,10 @@ #include - +#include #include + +#include /* Protocol related stuff, should go into libosmocore */ @@ -108,6 +110,33 @@ const struct value_string *gsm48_gsm_cause_names = gsm48_gsm_cause_names_; +/*! \brief Check if MS supports particular version of GEA by inspecting + * MS network capability IE specified in 3GPP TS 24.008 + * \param[in] ms_net_cap Buffer with raw MS network capability IE value, + * 3 - 10 bytes + * \param[in] cap_len Length of ms_net_cap, in bytes + * \param[in] gea Version of GEA to check + * \returns true if given version is supported by MS, false otherwise + */ +bool gprs_ms_net_cap_gea_supported(const uint8_t *ms_net_cap, uint8_t cap_len, + enum gprs_ciph_algo gea) +{ + switch (gea) { + case GPRS_ALGO_GEA0: + return true; + case GPRS_ALGO_GEA1: /* 1st bit is GEA1: */ + return 0x80 & ms_net_cap[0]; + case GPRS_ALGO_GEA2: /* extended GEA bits start from 2nd bit */ + return 0x40 & ms_net_cap[1]; /* of the next byte */ + case GPRS_ALGO_GEA3: + return 0x20 & ms_net_cap[1]; + case GPRS_ALGO_GEA4: + return 0x10 & ms_net_cap[1]; + default: + return false; + } +} + /* 10.5.5.2 */ const struct value_string gprs_att_t_strs_[] = { { GPRS_ATT_T_ATTACH, "GPRS attach" }, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index ebeabcd..96f615e 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -44,6 +44,7 @@ gprs_cipher_key_length; gprs_tlli_type; gprs_tmsi2tlli; +gprs_ms_net_cap_gea_supported; gsm48_gmm_cause_names; gsm48_gsm_cause_names; -- To view, visit https://gerrit.osmocom.org/422 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:33:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:33:40 +0000 Subject: [MERGED] libosmocore[master]: tests: test actual support status for auth. algo In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: test actual support status for auth. algo ...................................................................... tests: test actual support status for auth. algo Check if library actually support Milenage, COMP128 v2 and v3 algorithms instead of just printing enum values or nothing. Change-Id: I2b98481f56a8381058d4b29db5e8a36eb193eee9 --- M tests/auth/milenage_test.c M tests/auth/milenage_test.ok M tests/comp128/comp128_test.c M tests/comp128/comp128_test.ok 4 files changed, 10 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/auth/milenage_test.c b/tests/auth/milenage_test.c index 0223764..473be92 100644 --- a/tests/auth/milenage_test.c +++ b/tests/auth/milenage_test.c @@ -50,6 +50,9 @@ const uint8_t op[16] = { 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 }; #endif + printf("MILENAGE supported: %d\n", + osmo_auth_supported(osmo_auth_alg_parse("MILENAGE"))); + rc = milenage_opc_gen(opc, aud->u.umts.k, op); printf("OP:\t%s\n", osmo_hexdump(op, sizeof(op))); diff --git a/tests/auth/milenage_test.ok b/tests/auth/milenage_test.ok index 00ffc22..49146a5 100644 --- a/tests/auth/milenage_test.ok +++ b/tests/auth/milenage_test.ok @@ -6,5 +6,6 @@ SRES: 21 5f db 4d Kc: 6d e8 16 a7 59 a4 29 12 AUTS success: SEQ.MS = 33 +MILENAGE supported: 1 OP: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 OPC: c6 a1 3b 37 87 8f 5b 82 6f 4f 81 62 a1 c8 d8 79 diff --git a/tests/comp128/comp128_test.c b/tests/comp128/comp128_test.c index eb6fb12..07c98fa 100644 --- a/tests/comp128/comp128_test.c +++ b/tests/comp128/comp128_test.c @@ -66,8 +66,10 @@ int main(int argc, char **argv) { - printf("COMP128v2 support: %d\n", osmo_auth_alg_parse("COMP128v2")); - printf("COMP128v3 support: %d\n", osmo_auth_alg_parse("COMP128v3")); + printf("COMP128v2 support: %d\n", + osmo_auth_supported(osmo_auth_alg_parse("COMP128v2"))); + printf("COMP128v3 support: %d\n", + osmo_auth_supported(osmo_auth_alg_parse("COMP128v3"))); test_comp128v2("00000000000000000000000000000000", "34B4225BF16B96E118A85800"); test_comp128v2("00102030405060708090A0B0C0D0E0F0", "A892A8EFD6D33E3650372C00"); diff --git a/tests/comp128/comp128_test.ok b/tests/comp128/comp128_test.ok index f9ba7ce..cdac5f2 100644 --- a/tests/comp128/comp128_test.ok +++ b/tests/comp128/comp128_test.ok @@ -1,5 +1,5 @@ -COMP128v2 support: 2 -COMP128v3 support: 3 +COMP128v2 support: 1 +COMP128v3 support: 1 0 OK 0 OK 0 OK -- To view, visit https://gerrit.osmocom.org/421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b98481f56a8381058d4b29db5e8a36eb193eee9 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:33:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:33:57 +0000 Subject: [MERGED] libosmocore[master]: Clarify GPRS ciphering direction In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Clarify GPRS ciphering direction ...................................................................... Clarify GPRS ciphering direction Add spec reference and set explicit values for enum representing direction parameter for GPRS encryption. Change-Id: Iaf1b13da2e889d55cc9dd7516710104dba48c992 Related: OS#1582 --- M include/osmocom/crypt/gprs_cipher.h 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index 9d98f88..2639293 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -14,9 +14,10 @@ _GPRS_ALGO_NUM }; +/* 3GPP TS 04.64 Table A.1: */ enum gprs_cipher_direction { - GPRS_CIPH_MS2SGSN, - GPRS_CIPH_SGSN2MS, + GPRS_CIPH_MS2SGSN = 0, + GPRS_CIPH_SGSN2MS = 1, }; extern const struct value_string gprs_cipher_names[]; -- To view, visit https://gerrit.osmocom.org/423 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf1b13da2e889d55cc9dd7516710104dba48c992 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:34:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:34:14 +0000 Subject: [MERGED] libosmocore[master]: Clarify GPRS algorithm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Clarify GPRS algorithm ...................................................................... Clarify GPRS algorithm Add spec reference and set explicit values for enum representing ciphering algorithm for GPRS encryption. Change-Id: Ia9ee429b73a37d52599fce70778cfe87b767411c Related: OS#1582 --- M include/osmocom/crypt/gprs_cipher.h 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/crypt/gprs_cipher.h b/include/osmocom/crypt/gprs_cipher.h index 2639293..d242595 100644 --- a/include/osmocom/crypt/gprs_cipher.h +++ b/include/osmocom/crypt/gprs_cipher.h @@ -5,12 +5,13 @@ #define GSM0464_CIPH_MAX_BLOCK 1523 +/* 3GPP TS 24.008 ? 10.5.5.3 */ enum gprs_ciph_algo { - GPRS_ALGO_GEA0, - GPRS_ALGO_GEA1, - GPRS_ALGO_GEA2, - GPRS_ALGO_GEA3, - GPRS_ALGO_GEA4, + GPRS_ALGO_GEA0 = 0, + GPRS_ALGO_GEA1 = 1, + GPRS_ALGO_GEA2 = 2, + GPRS_ALGO_GEA3 = 3, + GPRS_ALGO_GEA4 = 4, _GPRS_ALGO_NUM }; -- To view, visit https://gerrit.osmocom.org/432 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia9ee429b73a37d52599fce70778cfe87b767411c Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:35:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:35:17 +0000 Subject: [ABANDON] openbsc[master]: Remove unused auth code and add comment In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Remove unused auth code and add comment ...................................................................... Abandoned we expect the VLR code to change this code path soon anyway. -- To view, visit https://gerrit.osmocom.org/331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I44aac24811785c4b6f95f830b8b35d5fbe644e0f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:45:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:45:12 +0000 Subject: openbsc[master]: Fix vty tests with subscriber deletion In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jun 29 16:45:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 29 Jun 2016 16:45:14 +0000 Subject: [MERGED] openbsc[master]: Fix vty tests with subscriber deletion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix vty tests with subscriber deletion ...................................................................... Fix vty tests with subscriber deletion Use correct vty command for subscriber deletion, adjust assertions accordingly. The error was cause by inconsistent syntax of vty commands for subscriber creation and deletion. Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b --- M openbsc/tests/vty_test_runner.py 1 file changed, 11 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 9ea988d..bae1866 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -388,12 +388,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberCreateDelete(self): @@ -413,12 +413,12 @@ self.assert_(res.find(" IMSI: "+imsi) > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) - self.assert_(res != "") + res = self.vty.command('subscriber imsi ' + imsi + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) - self.assert_(res != '% No subscriber found for imsi '+imsi) + self.assert_(('% No subscriber found for imsi ' + imsi) == res) def testSubscriberSettings(self): self.vty.enable() @@ -456,16 +456,18 @@ self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) self.vty.command("end") + # create subscriber with extension in a configured interval res = self.vty.command('subscriber create imsi ' + imsi2) self.assert_(res.find(" IMSI: " + imsi2) > 0) self.assert_(res.find("221") > 0 or res.find("222") > 0) self.assert_(res.find(" Extension: ") > 0) # Delete it - res = self.vty.command('subscriber delete imsi '+imsi) + res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_(res != "") - res = self.vty.command('subscriber delete imsi ' + imsi2) - self.assert_(res != "") + # imsi2 is inactive so deletion should succeed + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') + self.assert_("" == res) def testShowPagingGroup(self): res = self.vty.command("show paging-group 255 1234567") -- To view, visit https://gerrit.osmocom.org/402 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 30 08:30:03 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 30 Jun 2016 08:30:03 +0000 Subject: [PATCH] openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/201 to look at the new patch set (#7). Make random MSISDN assignment optional Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Fixes: OS#1658 Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb --- M openbsc/include/openbsc/db.h M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_subscriber.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libbsc/net_init.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/db.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/libmsc/gsm_subscriber.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/db/db_test.c M openbsc/tests/vty_test_runner.py 12 files changed, 140 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/01/201/7 diff --git a/openbsc/include/openbsc/db.h b/openbsc/include/openbsc/db.h index 6ffe1ad..bb90705 100644 --- a/openbsc/include/openbsc/db.h +++ b/openbsc/include/openbsc/db.h @@ -20,6 +20,8 @@ #ifndef _DB_H #define _DB_H +#include + #include "gsm_subscriber.h" struct gsm_equipment; @@ -36,7 +38,7 @@ /* subscriber management */ struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax); + uint64_t smax, bool alloc_exten); struct gsm_subscriber *db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); int db_sync_subscriber(struct gsm_subscriber *subscriber); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index e7cd520..bdcd0e0 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -20,12 +21,6 @@ struct gsm_subscriber_group; #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3] - -enum gsm_subscr_creation_mode { - GSM_SUBSCR_DONT_CREATE = 0, - GSM_SUBSCR_CREAT_W_RAND_EXT = 1, - GSM_SUBSCR_CREAT_W_REGEXP = 2, -}; enum gsm_security_event { GSM_SECURITY_NOAVAIL, @@ -289,7 +284,8 @@ struct osmo_bsc_data *bsc_data; /* subscriber related features */ - int subscr_creation_mode; + bool auto_create_subscr; + bool auto_assign_exten; uint64_t ext_min; uint64_t ext_max; struct gsm_subscriber_group *subscr_group; diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 3cba5d1..3d7c244 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -5,6 +5,8 @@ #include #include +#include + #define GSM_NAME_LENGTH 160 #define GSM_EXTENSION_LENGTH 15 /* MSISDN can only be 15 digits length */ @@ -90,8 +92,7 @@ struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr); struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax); + const char *imsi); struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_subscriber_group *sgrp, uint32_t tmsi); struct gsm_subscriber *subscr_get_by_imsi(struct gsm_subscriber_group *sgrp, diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 04f2cc6..b0e8764 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -195,6 +195,10 @@ if (net->authorized_reg_str) vty_out(vty, ", authorized regexp: %s", net->authorized_reg_str); vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, " Auto create subscriber: %s%s", + net->auto_create_subscr ? "yes" : "no", VTY_NEWLINE); + vty_out(vty, " Auto assign extension: %s%s", + net->auto_assign_exten ? "yes" : "no", VTY_NEWLINE); vty_out(vty, " Location updating reject cause: %u%s", net->reject_cause, VTY_NEWLINE); vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption, diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 4636d57..0e99097 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -21,10 +21,13 @@ #include #include +#include + struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code, int (*mncc_recv)(struct gsm_network *, struct msgb *)) { struct gsm_network *net; + const char *default_regexp = "*"; net = talloc_zero(tall_bsc_ctx, struct gsm_network); if (!net) @@ -42,13 +45,18 @@ return NULL; } + if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, + &default_regexp) != 0) + return NULL; + /* Init back pointer */ net->bsc_data->auto_off_timeout = -1; net->bsc_data->network = net; INIT_LLIST_HEAD(&net->bsc_data->mscs); net->subscr_group->net = net; - net->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; + net->auto_create_subscr = true; + net->auto_assign_exten = true; net->country_code = country_code; net->network_code = network_code; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index a02db36..79e136d 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -25,6 +25,8 @@ #include #include +#include + static bool alg_supported(const char *alg) { /* @@ -96,9 +98,7 @@ subscr = subscr_get_by_imsi(net->subscr_group, imsi); if (!subscr) - subscr = subscr_create_subscriber(net->subscr_group, imsi, - net->ext_min, - net->ext_max); + subscr = subscr_create_subscriber(net->subscr_group, imsi); if (!subscr) goto fail; diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index b367139..68eba3e 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -519,7 +520,7 @@ } struct gsm_subscriber *db_create_subscriber(const char *imsi, uint64_t smin, - uint64_t smax) + uint64_t smax, bool alloc_exten) { dbi_result result; struct gsm_subscriber *subscr; @@ -551,7 +552,8 @@ strncpy(subscr->imsi, imsi, sizeof(subscr->imsi)-1); dbi_result_free(result); LOGP(DDB, LOGL_INFO, "New Subscriber: ID %llu, IMSI %s\n", subscr->id, subscr->imsi); - db_subscriber_alloc_exten(subscr, smin, smax); + if (alloc_exten) + db_subscriber_alloc_exten(subscr, smin, smax); return subscr; } @@ -956,8 +958,11 @@ dbi_conn_quote_string_copy(conn, subscriber->name, &q_name); - dbi_conn_quote_string_copy(conn, - subscriber->extension, &q_extension); + if (subscriber->extension[0] != '\0') + dbi_conn_quote_string_copy(conn, + subscriber->extension, &q_extension); + else + q_extension = strdup("NULL"); if (subscriber->tmsi != GSM_RESERVED_TMSI) { sprintf(tmsi, "%u", subscriber->tmsi); @@ -1062,15 +1067,17 @@ } dbi_result_free(result); - result = dbi_conn_queryf(conn, - "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", - subscr->extension, subscr->extension); - if (!result) { - LOGP(DDB, LOGL_ERROR, - "Failed to delete SMS for %llu\n", subscr->id); - return -1; + if (subscr->extension[0] != '\0') { + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE src_addr=%s OR dest_addr=%s", + subscr->extension, subscr->extension); + if (!result) { + LOGP(DDB, LOGL_ERROR, + "Failed to delete SMS for %llu\n", subscr->id); + return -1; + } + dbi_result_free(result); } - dbi_result_free(result); result = dbi_conn_queryf(conn, "DELETE FROM VLR WHERE subscriber_id=%llu", diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 6704497..1b02efe 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -530,15 +530,13 @@ static struct gsm_subscriber *subscr_create(const struct gsm_network *net, const char *imsi) { - if (net->subscr_creation_mode == GSM_SUBSCR_DONT_CREATE) + if (!net->auto_create_subscr) return NULL; - if (net->subscr_creation_mode & GSM_SUBSCR_CREAT_W_REGEXP) - if (!subscr_regexp_check(net, imsi)) - return NULL; + if (!subscr_regexp_check(net, imsi)) + return NULL; - return subscr_create_subscriber(net->subscr_group, imsi, net->ext_min, - net->ext_max); + return subscr_create_subscriber(net->subscr_group, imsi); } /* Parse Chapter 9.2.11 Identity Response */ diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1dc2cc2..08198c7 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -203,10 +204,12 @@ } struct gsm_subscriber *subscr_create_subscriber(struct gsm_subscriber_group *sgrp, - const char *imsi, uint64_t smin, - uint64_t smax) + const char *imsi) { - struct gsm_subscriber *subscr = db_create_subscriber(imsi, smin, smax); + struct gsm_subscriber *subscr = db_create_subscriber(imsi, + sgrp->net->ext_min, + sgrp->net->ext_max, + sgrp->net->auto_assign_exten); if (subscr) subscr->group = sgrp; return subscr; diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index a035bf9..74da1d7 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -242,9 +242,7 @@ if (subscr) db_sync_subscriber(subscr); else { - subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0], - gsmnet->ext_min, - gsmnet->ext_max); + subscr = subscr_create_subscriber(gsmnet->subscr_group, argv[0]); if (!subscr) { vty_out(vty, "%% No subscriber created for IMSI %s%s", @@ -1044,6 +1042,8 @@ { struct gsm_network *gsmnet = gsmnet_from_vty(vty); uint64_t mi = atoi(argv[0]), ma = atoi(argv[1]); + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = true; if (mi >= ma) { vty_out(vty, "Incorrect range: %s >= %s, expected MIN < MAX%s", argv[0], argv[1], VTY_NEWLINE); @@ -1055,15 +1055,13 @@ } DEFUN(cfg_nitb_subscr_create, cfg_nitb_subscr_create_cmd, - "subscriber-create-on-demand [regexp]", + "subscriber-create-on-demand [no-extension]", "Make a new record when a subscriber is first seen.\n" - "Create subscribers only if IMSI matches the regexp specified in " - "authorized-regexp command\n") + "Do not automatically assign extension to created subscribers\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_CREAT_W_RAND_EXT; - if (argc) - gsmnet->subscr_creation_mode |= GSM_SUBSCR_CREAT_W_REGEXP; + gsmnet->auto_create_subscr = true; + gsmnet->auto_assign_exten = argc ? false : true; return CMD_SUCCESS; } @@ -1072,7 +1070,7 @@ NO_STR "Make a new record when a subscriber is first seen.\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_creation_mode = GSM_SUBSCR_DONT_CREATE; + gsmnet->auto_create_subscr = false; return CMD_SUCCESS; } @@ -1097,12 +1095,15 @@ static int config_write_nitb(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); - enum gsm_subscr_creation_mode scm = gsmnet->subscr_creation_mode; - const char *reg = (scm & GSM_SUBSCR_CREAT_W_REGEXP) ? " regexp" : "", - *pref = scm ? "" : "no "; + vty_out(vty, "nitb%s", VTY_NEWLINE); - vty_out(vty, " %ssubscriber-create-on-demand%s%s", - pref, reg, VTY_NEWLINE); + if (!gsmnet->auto_create_subscr) + vty_out(vty, " no subscriber-create-on-demand%s", VTY_NEWLINE); + else + vty_out(vty, " subscriber-create-on-demand%s%s", + gsmnet->auto_assign_exten ? "" : " no-extension", + VTY_NEWLINE); + if (gsmnet->ext_min != GSM_MIN_EXTEN || gsmnet->ext_max != GSM_MAX_EXTEN) vty_out(vty, " subscriber-create-on-demand random %"PRIu64" %" PRIu64"%s", gsmnet->ext_min, gsmnet->ext_max, diff --git a/openbsc/tests/db/db_test.c b/openbsc/tests/db/db_test.c index dc81481..755a6e9 100644 --- a/openbsc/tests/db/db_test.c +++ b/openbsc/tests/db/db_test.c @@ -28,6 +28,7 @@ #include #include #include +#include #include static struct gsm_network dummy_net; @@ -159,12 +160,13 @@ subscr_put(rcv_subscr); } -static void test_subs(const char *alice_imsi, char *imei1, char *imei2) +static void test_subs(const char *imsi, char *imei1, char *imei2, bool make_ext) { struct gsm_subscriber *alice = NULL, *alice_db; char scratch_str[256]; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + make_ext); db_subscriber_assoc_imei(alice, imei1); if (imei2) db_subscriber_assoc_imei(alice, imei2); @@ -177,7 +179,7 @@ COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by IMSI */ - alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice_imsi); + alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); /* Get by id */ @@ -187,8 +189,14 @@ SUBSCR_PUT(alice_db); /* Get by extension */ alice_db = db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, alice->extension); - COMPARE(alice, alice_db); - SUBSCR_PUT(alice_db); + if (alice_db) { + if (!make_ext) + printf("FAIL: bogus extension created for IMSI %s\n", + imsi); + COMPARE(alice, alice_db); + SUBSCR_PUT(alice_db); + } else if (make_ext) + printf("FAIL: no subscriber extension for IMSI %s\n", imsi); SUBSCR_PUT(alice); } @@ -217,18 +225,22 @@ struct gsm_subscriber *alice_db; char *alice_imsi = "3243245432345"; - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); db_sync_subscriber(alice); alice_db = db_get_subscriber(GSM_SUBSCRIBER_IMSI, alice->imsi); COMPARE(alice, alice_db); SUBSCR_PUT(alice_db); SUBSCR_PUT(alice); - test_subs("3693245423445", "1234567890", NULL); - test_subs("9993245423445", "1234567890", "6543560920"); + test_subs("3693245423445", "1234567890", NULL, true); + test_subs("9993245423445", "1234567890", "6543560920", true); + test_subs("3123122223445", "1234567890", NULL, false); + test_subs("9123121223445", "1234567890", "6543560920", false); /* create it again and see it fails */ - alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN); + alice = db_create_subscriber(alice_imsi, GSM_MIN_EXTEN, GSM_MAX_EXTEN, + true); OSMO_ASSERT(!alice); test_sms(); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index bae1866..074e0ba 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -244,7 +244,7 @@ self.vty.command("configure terminal") self.vty.command("nitb") self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) - self.assertTrue(self.vty.verify("subscriber-create-on-demand regexp", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand no-extension", [''])) self.vty.command("end") def testSi2Q(self): @@ -400,6 +400,9 @@ self.vty.enable() imsi = "204300854013739" + imsi2 = "222301824913762" + imsi3 = "333500854113763" + imsi4 = "444583744053764" # Initially we don't have this subscriber self.vty.verify('show subscriber imsi '+imsi, ['% No subscriber found for imsi '+imsi]) @@ -407,14 +410,59 @@ # Lets create one res = self.vty.command('subscriber create imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + self.assert_(res.find("Extension") > 0) # Now we have it res = self.vty.command('show subscriber imsi '+imsi) self.assert_(res.find(" IMSI: "+imsi) > 0) + # With narrow random interval + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + # wrong interval + res = self.vty.command("subscriber-create-on-demand random 221 122") + self.assert_(res.find("122") > 0) + self.assert_(res.find("221") > 0) + # correct interval + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi2) + self.assert_(res.find(" IMSI: " + imsi2) > 0) + self.assert_(res.find("221") > 0 or res.find("222") > 0) + self.assert_(res.find(" Extension: ") > 0) + + # Without extension + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("subscriber-create-on-demand no-extension", [''])) + self.vty.command("end") + res = self.vty.command('subscriber create imsi ' + imsi3) + self.assert_(res.find(" IMSI: " + imsi3) > 0) + self.assertEquals(res.find("Extension"), -1) + + # With extension again + self.vty.command("configure terminal") + self.vty.command("nitb") + self.assertTrue(self.vty.verify("no subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand", [''])) + self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 666", [''])) + self.vty.command("end") + + res = self.vty.command('subscriber create imsi ' + imsi4) + self.assert_(res.find(" IMSI: " + imsi4) > 0) + self.assert_(res.find(" Extension: ") > 0) + # Delete it res = self.vty.command('subscriber imsi ' + imsi + ' delete') self.assert_("" == res) + res = self.vty.command('subscriber imsi ' + imsi2 + ' delete') + self.assert_("" == res) + res = self.vty.command('subscriber imsi ' + imsi3 + ' delete') + self.assert_("" == res) + res = self.vty.command('subscriber imsi ' + imsi4 + ' delete') + self.assert_("" == res) # Now it should not be there anymore res = self.vty.command('show subscriber imsi '+imsi) -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 30 08:37:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 30 Jun 2016 08:37:44 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 holger has done all the previous comments, so I'll leave it up to him... -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 30 13:52:09 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Thu, 30 Jun 2016 13:52:09 +0000 Subject: osmo-bts[master]: Change interface in osmo-bts for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/433/1/src/osmo-bts-sysmo/l1_if.c File src/osmo-bts-sysmo/l1_if.c: Line 968: > what about the other bts models? will the break if you don't initialize the Structure l1sap is initialized to zero in all bts models during memory allocation, hence it will not break other bts models. However for other bts models new fields will be zero, hence at osmo-pcu, it will always select one phase access request and this needs to be fixed. We will add handling of this case at osmo-pcu. Note also that for other bts models, eleven bit rach should not be enabled at osmo-nitb configuration. -- To view, visit https://gerrit.osmocom.org/433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 30 14:54:34 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 30 Jun 2016 14:54:34 +0000 Subject: [PATCH] openbsc[master]: SGSN: prevent starting with inconsistent config Message-ID: Review at https://gerrit.osmocom.org/437 SGSN: prevent starting with inconsistent config Previously it was possible to start osmo-sgsn with "auth-policy remote" but without "gsup remote-*" which resulted in broken setup: no MS could perform GPRS ATTACH. Add consistency check to vty code to fix this. Change-Id: Ie4296e7d99d7833f7d828b0196435ea81097cf6e Related: OS#1582 --- M openbsc/src/gprs/sgsn_vty.c 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/437/1 diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 02c0f31..18be7de 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -210,15 +210,15 @@ for (server = sgsn->ares_servers; server; server = server->next) vty_out(vty, " grx-dns-add %s%s", inet_ntoa(server->addr.addr4), VTY_NEWLINE); - vty_out(vty, " auth-policy %s%s", - get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy), - VTY_NEWLINE); if (g_cfg->gsup_server_addr.sin_addr.s_addr) vty_out(vty, " gsup remote-ip %s%s", inet_ntoa(g_cfg->gsup_server_addr.sin_addr), VTY_NEWLINE); if (g_cfg->gsup_server_port) vty_out(vty, " gsup remote-port %d%s", g_cfg->gsup_server_port, VTY_NEWLINE); + vty_out(vty, " auth-policy %s%s", + get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy), + VTY_NEWLINE); vty_out(vty, " gsup oap-id %d%s", (int)g_cfg->oap.client_id, VTY_NEWLINE); @@ -563,6 +563,17 @@ { int val = get_string_value(sgsn_auth_pol_strs, argv[0]); OSMO_ASSERT(val >= SGSN_AUTH_POLICY_OPEN && val <= SGSN_AUTH_POLICY_REMOTE); + if (val == SGSN_AUTH_POLICY_REMOTE) { + const char *err = "%% auth-policy remote requires"; + if (!g_cfg->gsup_server_addr.sin_addr.s_addr) { + vty_out(vty, "%s 'gsup remote-ip'%s", err, VTY_NEWLINE); + return CMD_WARNING; + } + if (!g_cfg->gsup_server_port) { + vty_out(vty, "%s 'gsup remote-port'%s", err, VTY_NEWLINE); + return CMD_WARNING; + } + } g_cfg->auth_policy = val; g_cfg->require_authentication = (val == SGSN_AUTH_POLICY_REMOTE); g_cfg->require_update_location = (val == SGSN_AUTH_POLICY_REMOTE); -- To view, visit https://gerrit.osmocom.org/437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4296e7d99d7833f7d828b0196435ea81097cf6e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jun 30 15:22:14 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 30 Jun 2016 15:22:14 +0000 Subject: [PATCH] openbsc[master]: SGSN: prevent starting with inconsistent config In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/437 to look at the new patch set (#2). SGSN: prevent starting with inconsistent config Previously it was possible to start osmo-sgsn with "auth-policy remote" but without "gsup remote-*" which resulted in broken setup: no MS could perform GPRS ATTACH. Add consistency check to vty code to fix this. Change-Id: Ie4296e7d99d7833f7d828b0196435ea81097cf6e Related: OS#1582 --- M openbsc/src/gprs/sgsn_vty.c M openbsc/tests/vty_test_runner.py 2 files changed, 16 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/437/2 diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 02c0f31..18be7de 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -210,15 +210,15 @@ for (server = sgsn->ares_servers; server; server = server->next) vty_out(vty, " grx-dns-add %s%s", inet_ntoa(server->addr.addr4), VTY_NEWLINE); - vty_out(vty, " auth-policy %s%s", - get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy), - VTY_NEWLINE); if (g_cfg->gsup_server_addr.sin_addr.s_addr) vty_out(vty, " gsup remote-ip %s%s", inet_ntoa(g_cfg->gsup_server_addr.sin_addr), VTY_NEWLINE); if (g_cfg->gsup_server_port) vty_out(vty, " gsup remote-port %d%s", g_cfg->gsup_server_port, VTY_NEWLINE); + vty_out(vty, " auth-policy %s%s", + get_value_string(sgsn_auth_pol_strs, g_cfg->auth_policy), + VTY_NEWLINE); vty_out(vty, " gsup oap-id %d%s", (int)g_cfg->oap.client_id, VTY_NEWLINE); @@ -563,6 +563,17 @@ { int val = get_string_value(sgsn_auth_pol_strs, argv[0]); OSMO_ASSERT(val >= SGSN_AUTH_POLICY_OPEN && val <= SGSN_AUTH_POLICY_REMOTE); + if (val == SGSN_AUTH_POLICY_REMOTE) { + const char *err = "%% auth-policy remote requires"; + if (!g_cfg->gsup_server_addr.sin_addr.s_addr) { + vty_out(vty, "%s 'gsup remote-ip'%s", err, VTY_NEWLINE); + return CMD_WARNING; + } + if (!g_cfg->gsup_server_port) { + vty_out(vty, "%s 'gsup remote-port'%s", err, VTY_NEWLINE); + return CMD_WARNING; + } + } g_cfg->auth_policy = val; g_cfg->require_authentication = (val == SGSN_AUTH_POLICY_REMOTE); g_cfg->require_update_location = (val == SGSN_AUTH_POLICY_REMOTE); diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index bae1866..8fe2b41 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -1037,6 +1037,8 @@ self.assertTrue(self.vty.verify('auth-policy closed', [''])) res = self.vty.command("show running-config") self.assert_(res.find('auth-policy closed') > 0) + self.assertTrue(self.vty.verify('gsup remote-ip 127.0.0.4', [''])) + self.assertTrue(self.vty.verify('gsup remote-port 2222', [''])) self.assertTrue(self.vty.verify('auth-policy remote', [''])) res = self.vty.command("show running-config") self.assert_(res.find('auth-policy remote') > 0) -- To view, visit https://gerrit.osmocom.org/437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie4296e7d99d7833f7d828b0196435ea81097cf6e Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 30 16:53:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 30 Jun 2016 16:53:26 +0000 Subject: openbsc[master]: SGSN: prevent starting with inconsistent config In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4296e7d99d7833f7d828b0196435ea81097cf6e Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 30 17:14:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 30 Jun 2016 17:14:58 +0000 Subject: [PATCH] osmo-pcu[master]: systemd service file: Stop using deprecated '-e' option Message-ID: Review at https://gerrit.osmocom.org/438 systemd service file: Stop using deprecated '-e' option In commit 6d8884de490d09902e9e31a90bab9ef490ef5d82 in 2014, we made the '-e' command line option deprecated. Stop using it from the systemd srevice file. Change-Id: I322cadbee8980b78fff2984765c4b0216c50412e Related: SYS#2749 --- M contrib/sysmopcu.service 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/38/438/1 diff --git a/contrib/sysmopcu.service b/contrib/sysmopcu.service index d4585cc..3e3ff07 100644 --- a/contrib/sysmopcu.service +++ b/contrib/sysmopcu.service @@ -3,7 +3,7 @@ [Service] Type=simple -ExecStart=/usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -e +ExecStart=/usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg Restart=always RestartSec=2 RestartPreventExitStatus=1 -- To view, visit https://gerrit.osmocom.org/438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I322cadbee8980b78fff2984765c4b0216c50412e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jun 30 17:16:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 30 Jun 2016 17:16:34 +0000 Subject: osmo-pcu[master]: systemd service file: Stop using deprecated '-e' option In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I322cadbee8980b78fff2984765c4b0216c50412e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 30 18:46:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 30 Jun 2016 18:46:24 +0000 Subject: [MERGED] osmo-pcu[master]: systemd service file: Stop using deprecated '-e' option In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: systemd service file: Stop using deprecated '-e' option ...................................................................... systemd service file: Stop using deprecated '-e' option In commit 6d8884de490d09902e9e31a90bab9ef490ef5d82 in 2014, we made the '-e' command line option deprecated. Stop using it from the systemd srevice file. Change-Id: I322cadbee8980b78fff2984765c4b0216c50412e Related: SYS#2749 --- M contrib/sysmopcu.service 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/sysmopcu.service b/contrib/sysmopcu.service index d4585cc..3e3ff07 100644 --- a/contrib/sysmopcu.service +++ b/contrib/sysmopcu.service @@ -3,7 +3,7 @@ [Service] Type=simple -ExecStart=/usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -e +ExecStart=/usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg Restart=always RestartSec=2 RestartPreventExitStatus=1 -- To view, visit https://gerrit.osmocom.org/438 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I322cadbee8980b78fff2984765c4b0216c50412e Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jun 30 18:51:34 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 30 Jun 2016 18:51:34 +0000 Subject: openbsc[master]: SGSN: prevent starting with inconsistent config In-Reply-To: References: Message-ID: Patch Set 2: FYI: this breaks existing configs. Could you put that into the debian/changelog (or if we make proper releases into the release notes?) -- To view, visit https://gerrit.osmocom.org/437 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie4296e7d99d7833f7d828b0196435ea81097cf6e Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 30 18:55:29 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 30 Jun 2016 18:55:29 +0000 Subject: osmo-bts[master]: Change interface in osmo-bts for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/433/1/include/osmo-bts/pcuif_proto.h File include/osmo-bts/pcuif_proto.h: Line 72: enum ph_burst_type burst; I think Haralds preference is not to use enum in protocols. @Harald: Can you comment about it? -- To view, visit https://gerrit.osmocom.org/433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 30 19:01:18 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 30 Jun 2016 19:01:18 +0000 Subject: openbsc[master]: Make random MSISDN assignment optional In-Reply-To: References: Message-ID: Patch Set 7: (2 comments) Code looks good. One question about the test and what is being tested. https://gerrit.osmocom.org/#/c/201/7/openbsc/tests/vty_test_runner.py File openbsc/tests/vty_test_runner.py: Line 424: res = self.vty.command("subscriber-create-on-demand random 221 122") so this tests a wrong interval can be set? Line 428: self.assertTrue(self.vty.verify("subscriber-create-on-demand random 221 222", [''])) nothing tested here? -- To view, visit https://gerrit.osmocom.org/201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 30 19:04:47 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 30 Jun 2016 19:04:47 +0000 Subject: libosmocore[master]: Add T.4 compression routines In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I agree with max. No need to have two routines. You can add an "overload" (different name) and implement the old interface by calling the new method? Test cases are necessary and should be easy here. If the scenario of the bitmap not fitting in the space reserved for the compressed data then this should be tested as well. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jun 30 19:08:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 30 Jun 2016 19:08:55 +0000 Subject: osmo-bts[master]: Change interface in osmo-bts for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/433/1/include/osmo-bts/pcuif_proto.h File include/osmo-bts/pcuif_proto.h: Line 72: enum ph_burst_type burst; > I think Haralds preference is not to use enum in protocols. It is correct that i dislike the use of enums in protocols. However, the protocol we speak about is only used on a local unix domain socket between two processes, so we can ignore that concern. The two programs will have to be compiled with the same compiler and the same compilation flags, but that should be standard anyway. So the only reason to avoid the enum is to stay in the same style. I'd like that, but I wouldn't mandate that. -- To view, visit https://gerrit.osmocom.org/433 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: bhargava_abhyankar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jun 30 19:09:48 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 30 Jun 2016 19:09:48 +0000 Subject: libosmocore[master]: Update structure in libosmocore for 11 bit RACH In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/427/1/include/osmocom/gsm/l1sap.h File include/osmocom/gsm/l1sap.h: Line 51: GSM_L1_BURST_TYPE_ACCESS_0 = 4, What is the reason to start with 0x4 right now? Other code also depends on the fact that the struct is zero initialized? Which spec do you want to have the 0x4 map to? If 0x0 is not a valid value, and we use it right now, could you add a _INVALID (or _NONE) burst type? -- To view, visit https://gerrit.osmocom.org/427 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes