lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

December 2022

  • 1 participants
  • 1979 discussions
Change in libosmo-netif[master]: stream: Avoid useless polling if tx_queue becomes empty
by osmith 21 Dec '22

21 Dec '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30721 ) Change subject: stream: Avoid useless polling if tx_queue becomes empty ...................................................................... Patch Set 2: Code-Review+1 (1 comment) Commit Message: https://gerrit.osmocom.org/c/libosmo-netif/+/30721/comment/80c487e9_2dc0ad33 PS2, Line 11: spate spade? save? -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30721 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I1dd2145249a7322ad95e49be588fd472f00734e1 Gerrit-Change-Number: 30721 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Dec 2022 09:10:47 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: stream: Log error on short send
by osmith 21 Dec '22

21 Dec '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30720 ) Change subject: stream: Log error on short send ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30720 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I9bd257b80a378b779df84e204673f8e394eca5b6 Gerrit-Change-Number: 30720 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Dec 2022 09:07:48 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: stream: osmo_stream_*_write: Unifiy way to get data and length
by osmith 21 Dec '22

21 Dec '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30719 ) Change subject: stream: osmo_stream_*_write: Unifiy way to get data and length ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30719 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I5b5d6f7a5a1722bd01c13d32557c21d8a0889966 Gerrit-Change-Number: 30719 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Dec 2022 09:06:22 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: stream: Log read/write flags
by osmith 21 Dec '22

21 Dec '22
Attention is currently required from: pespin, daniel. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30718 ) Change subject: stream: Log read/write flags ...................................................................... Patch Set 1: Code-Review+1 (1 comment) Patchset: PS1: would be nice to have a more descriptive variable name, like "flags" -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30718 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I57b064fa0498be76579ae9597ab9217d659aae41 Gerrit-Change-Number: 30718 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Wed, 21 Dec 2022 09:05:18 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmocom-bb[master]: trxcon: add initial GPRS L1 implementation - libl1gprs.la
by fixeria 20 Dec '22

20 Dec '22
Attention is currently required from: fixeria. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmocom-bb/+/30743 to look at the new patch set (#2). Change subject: trxcon: add initial GPRS L1 implementation - libl1gprs.la ...................................................................... trxcon: add initial GPRS L1 implementation - libl1gprs.la Change-Id: I9567d64f9d00262e36147e8d7e541e5e246bda5f Related: OS#5500 --- M contrib/jenkins.sh M src/host/trxcon/configure.ac M src/host/trxcon/include/osmocom/bb/Makefile.am A src/host/trxcon/include/osmocom/bb/l1gprs/Makefile.am A src/host/trxcon/include/osmocom/bb/l1gprs/l1gprs.h A src/host/trxcon/include/osmocom/bb/l1gprs/logging.h M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h M src/host/trxcon/include/osmocom/bb/trxcon/logging.h M src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h M src/host/trxcon/src/Makefile.am A src/host/trxcon/src/gprs.c M src/host/trxcon/src/logging.c M src/host/trxcon/src/trxcon_fsm.c M src/host/trxcon/src/trxcon_inst.c 14 files changed, 295 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/30743/2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I9567d64f9d00262e36147e8d7e541e5e246bda5f Gerrit-Change-Number: 30743 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmocom-bb[master]: trxcon: call trxcon_set_log_cfg() from trxcon_main.c
by fixeria 20 Dec '22

20 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30744 ) Change subject: trxcon: call trxcon_set_log_cfg() from trxcon_main.c ...................................................................... trxcon: call trxcon_set_log_cfg() from trxcon_main.c Change-Id: I5692dbd65c62ff235f687ea0b72c42867f50141e Related: OS#5500 --- M src/host/trxcon/src/logging.c M src/host/trxcon/src/trxcon_main.c 2 files changed, 10 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/44/30744/1 diff --git a/src/host/trxcon/src/logging.c b/src/host/trxcon/src/logging.c index 763a78d..e98d79a 100644 --- a/src/host/trxcon/src/logging.c +++ b/src/host/trxcon/src/logging.c @@ -21,7 +21,6 @@ #include <osmocom/core/logging.h> #include <osmocom/core/utils.h> -#include <osmocom/bb/trxcon/trxcon.h> #include <osmocom/bb/trxcon/logging.h> static struct log_info_cat trxcon_log_info_cat[] = { @@ -80,15 +79,6 @@ .num_cat = ARRAY_SIZE(trxcon_log_info_cat), }; -static const int trxcon_log_cfg[] = { - [TRXCON_LOGC_FSM] = DAPP, - [TRXCON_LOGC_L1C] = DL1C, - [TRXCON_LOGC_L1D] = DL1D, - [TRXCON_LOGC_SCHC] = DSCH, - [TRXCON_LOGC_SCHD] = DSCHD, - [TRXCON_LOGC_GRR] = DGRR, -}; - int trxcon_logging_init(void *tall_ctx, const char *category_mask) { osmo_init_logging2(tall_ctx, &trxcon_log_info); @@ -96,7 +86,5 @@ if (category_mask) log_parse_category_mask(osmo_stderr_target, category_mask); - trxcon_set_log_cfg(&trxcon_log_cfg[0], ARRAY_SIZE(trxcon_log_cfg)); - return 0; } diff --git a/src/host/trxcon/src/trxcon_main.c b/src/host/trxcon/src/trxcon_main.c index 95e5549..08973f9 100644 --- a/src/host/trxcon/src/trxcon_main.c +++ b/src/host/trxcon/src/trxcon_main.c @@ -279,6 +279,15 @@ } } +static const int trxcon_log_cfg[] = { + [TRXCON_LOGC_FSM] = DAPP, + [TRXCON_LOGC_L1C] = DL1C, + [TRXCON_LOGC_L1D] = DL1D, + [TRXCON_LOGC_SCHC] = DSCH, + [TRXCON_LOGC_SCHD] = DSCHD, + [TRXCON_LOGC_GRR] = DGRR, +}; + int main(int argc, char **argv) { struct l1ctl_server_cfg server_cfg; @@ -305,6 +314,7 @@ /* Init logging system */ trxcon_logging_init(tall_trxcon_ctx, app_data.debug_mask); + trxcon_set_log_cfg(&trxcon_log_cfg[0], ARRAY_SIZE(trxcon_log_cfg)); /* Configure pretty logging */ log_set_print_extended_timestamp(osmo_stderr_target, 1); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30744 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I5692dbd65c62ff235f687ea0b72c42867f50141e Gerrit-Change-Number: 30744 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: add initial GPRS L1 implementation - libl1gprs.la
by fixeria 20 Dec '22

20 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30743 ) Change subject: trxcon: add initial GPRS L1 implementation - libl1gprs.la ...................................................................... trxcon: add initial GPRS L1 implementation - libl1gprs.la Change-Id: I9567d64f9d00262e36147e8d7e541e5e246bda5f Related: OS#5500 --- M src/host/trxcon/configure.ac M src/host/trxcon/include/osmocom/bb/Makefile.am A src/host/trxcon/include/osmocom/bb/l1gprs/Makefile.am A src/host/trxcon/include/osmocom/bb/l1gprs/l1gprs.h A src/host/trxcon/include/osmocom/bb/l1gprs/logging.h M src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h M src/host/trxcon/include/osmocom/bb/trxcon/logging.h M src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h M src/host/trxcon/src/Makefile.am A src/host/trxcon/src/gprs.c M src/host/trxcon/src/logging.c M src/host/trxcon/src/trxcon_fsm.c M src/host/trxcon/src/trxcon_inst.c 13 files changed, 294 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/30743/1 diff --git a/src/host/trxcon/configure.ac b/src/host/trxcon/configure.ac index 6508689..b22d1c8 100644 --- a/src/host/trxcon/configure.ac +++ b/src/host/trxcon/configure.ac @@ -16,6 +16,7 @@ PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore) PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm) +PKG_CHECK_MODULES(LIBOSMOGPRSRLCMAC, libosmo-gprs-rlcmac) dnl checks for header files AC_HEADER_STDC @@ -63,6 +64,7 @@ include/osmocom/Makefile include/osmocom/bb/Makefile include/osmocom/bb/l1sched/Makefile + include/osmocom/bb/l1gprs/Makefile include/osmocom/bb/trxcon/Makefile src/Makefile Makefile]) diff --git a/src/host/trxcon/include/osmocom/bb/Makefile.am b/src/host/trxcon/include/osmocom/bb/Makefile.am index c26db00..183f6a5 100644 --- a/src/host/trxcon/include/osmocom/bb/Makefile.am +++ b/src/host/trxcon/include/osmocom/bb/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS = \ l1sched \ + l1gprs \ trxcon \ $(NULL) diff --git a/src/host/trxcon/include/osmocom/bb/l1gprs/Makefile.am b/src/host/trxcon/include/osmocom/bb/l1gprs/Makefile.am new file mode 100644 index 0000000..e14a44e --- /dev/null +++ b/src/host/trxcon/include/osmocom/bb/l1gprs/Makefile.am @@ -0,0 +1,4 @@ +noinst_HEADERS = \ + l1gprs.h \ + logging.h \ + $(NULL) diff --git a/src/host/trxcon/include/osmocom/bb/l1gprs/l1gprs.h b/src/host/trxcon/include/osmocom/bb/l1gprs/l1gprs.h new file mode 100644 index 0000000..07e17d4 --- /dev/null +++ b/src/host/trxcon/include/osmocom/bb/l1gprs/l1gprs.h @@ -0,0 +1,40 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> + +struct l1gprs_prim_data_ind { + uint32_t frame_nr; + size_t data_len; + const uint8_t *data; +}; + +struct l1gprs_grr_inst; + +struct l1gprs_pdch { + bool enabled; + uint8_t tn; /*!< Timeslot number */ + + /*! Backpointer to l1gprs_state we belong to */ + struct l1gprs_grr_inst *grr; +}; + +struct l1gprs_grr_inst { + /*! PDCH state for each timeslot */ + struct l1gprs_pdch pdch[8]; + /*! Logging context (used as prefix for messages) */ + const char *log_prefix; + /*! Some private data for API user */ + void *priv; +}; + +struct l1gprs_grr_inst *l1gprs_grr_inst_alloc(void *ctx, const char *log_prefix, void *priv); +void l1gprs_grr_inst_free(struct l1gprs_grr_inst *grr); + +int l1gprs_pdch_enable(struct l1gprs_pdch *pdch); +int l1gprs_pdch_disable(struct l1gprs_pdch *pdch); + +int l1gprs_handle_pdtch_ind(struct l1gprs_pdch *pdch, + const struct l1gprs_prim_data_ind *ind); +int l1gprs_handle_ptcch_ind(struct l1gprs_pdch *pdch, + const struct l1gprs_prim_data_ind *ind); diff --git a/src/host/trxcon/include/osmocom/bb/l1gprs/logging.h b/src/host/trxcon/include/osmocom/bb/l1gprs/logging.h new file mode 100644 index 0000000..422cc03 --- /dev/null +++ b/src/host/trxcon/include/osmocom/bb/l1gprs/logging.h @@ -0,0 +1,13 @@ +#pragma once + +extern int l1gprs_log_cat_grr; + +void l1gprs_logging_init(int logc); + +#define LOGP_GRR(grr, level, fmt, args...) \ + LOGP(l1gprs_log_cat_grr, level, "%s" fmt, \ + (grr)->log_prefix, ## args) + +#define LOGP_PDCH(pdch, level, fmt, args...) \ + LOGP_GRR((pdch->grr), level, "(PDCH-%u) " fmt, \ + (pdch->tn), ## args) diff --git a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h index 4b743ca..1efa00b 100644 --- a/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h +++ b/src/host/trxcon/include/osmocom/bb/l1sched/l1sched.h @@ -350,6 +350,8 @@ struct llist_head tx_prims; /*! Backpointer to the scheduler */ struct l1sched_state *sched; + /*! Some private data for API user */ + void *priv; }; /* Represents one TX primitive in the queue of l1sched_ts */ diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/logging.h b/src/host/trxcon/include/osmocom/bb/trxcon/logging.h index f8521a0..925f602 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/logging.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/logging.h @@ -10,6 +10,7 @@ DTRXD, DSCH, DSCHD, + DGRR, }; int trxcon_logging_init(void *tall_ctx, const char *category_mask); diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h index 9148771..5af6cf9 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h @@ -4,6 +4,7 @@ struct osmo_fsm_inst; struct l1sched_state; +struct l1gprs_grr_inst; struct msgb; struct trxcon_inst { @@ -18,6 +19,9 @@ /* The L1 scheduler */ struct l1sched_state *sched; + /* GPRS RR state (RLC/MAC layer) */ + struct l1gprs_grr_inst *grr; + /* PHY interface (e.g. TRXC/TRXD) */ void *phyif; /* L2 interface (e.g. L1CTL) */ @@ -40,6 +44,7 @@ TRXCON_LOGC_L1D, /* L1CTL data */ TRXCON_LOGC_SCHC, /* l1sched control */ TRXCON_LOGC_SCHD, /* l1sched data */ + TRXCON_LOGC_GRR, /* l1gprs logging */ }; void trxcon_set_log_cfg(const int *logc, unsigned int logc_num); diff --git a/src/host/trxcon/src/Makefile.am b/src/host/trxcon/src/Makefile.am index a286f2a..44546d1 100644 --- a/src/host/trxcon/src/Makefile.am +++ b/src/host/trxcon/src/Makefile.am @@ -8,6 +8,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOCODING_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOGPRSRLCMAC_CFLAGS) \ $(NULL) @@ -29,6 +30,19 @@ $(NULL) +noinst_LTLIBRARIES += libl1gprs.la + +libl1gprs_la_SOURCES = \ + gprs.c \ + $(NULL) + +libl1gprs_la_LIBADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOGPRSRLCMAC_LIBS) \ + $(NULL) + + noinst_LTLIBRARIES += libtrxcon.la libtrxcon_la_SOURCES = \ @@ -51,6 +65,7 @@ trxcon_LDADD = \ libtrxcon.la \ libl1sched.la \ + libl1gprs.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOCODING_LIBS) \ $(LIBOSMOGSM_LIBS) \ diff --git a/src/host/trxcon/src/gprs.c b/src/host/trxcon/src/gprs.c new file mode 100644 index 0000000..a550946 --- /dev/null +++ b/src/host/trxcon/src/gprs.c @@ -0,0 +1,177 @@ +/* + * OsmocomBB <-> SDR connection bridge + * + * (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> + * + * All Rights Reserved + * + * 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. + * + */ + +#include <errno.h> +#include <stdint.h> + +#include <osmocom/core/logging.h> +#include <osmocom/core/talloc.h> +#include <osmocom/core/bitvec.h> +#include <osmocom/core/utils.h> + +#include <osmocom/gsm/protocol/gsm_04_08.h> +#include <osmocom/gprs/rlcmac/gprs_rlcmac.h> +#include <osmocom/gprs/gprs_rlc.h> + +#include <osmocom/bb/l1gprs/l1gprs.h> +#include <osmocom/bb/l1gprs/logging.h> + +int l1gprs_log_cat_grr = DLGLOBAL; + +/* TODO: move to libosmo-gprs-rlcmac */ +enum gprs_rlcmac_block_type { + GPRS_RLCMAC_DATA_BLOCK = 0x00, + GPRS_RLCMAC_CONTROL_BLOCK = 0x01, + GPRS_RLCMAC_CONTROL_BLOCK_OPT = 0x02, + GPRS_RLCMAC_RESERVED = 0x03, +}; + +void l1gprs_logging_init(int logc) +{ + l1gprs_log_cat_grr = logc; +} + +struct l1gprs_grr_inst *l1gprs_grr_inst_alloc(void *ctx, const char *log_prefix, void *priv) +{ + struct l1gprs_grr_inst *grr; + + grr = talloc_zero(ctx, struct l1gprs_grr_inst); + if (grr == NULL) + return NULL; + + for (unsigned int tn = 0; tn < ARRAY_SIZE(grr->pdch); tn++) { + struct l1gprs_pdch *pdch = &grr->pdch[tn]; + + pdch->tn = tn; + pdch->grr = grr; + } + + if (log_prefix == NULL) + grr->log_prefix = talloc_asprintf(grr, "l1gprs[0x%p]: ", grr); + else + grr->log_prefix = talloc_strdup(grr, log_prefix); + grr->priv = priv; + + return grr; +} + +void l1gprs_grr_inst_free(struct l1gprs_grr_inst *grr) +{ + if (grr == NULL) + return; + + for (unsigned int tn = 0; tn < ARRAY_SIZE(grr->pdch); tn++) + l1gprs_pdch_disable(&grr->pdch[tn]); + talloc_free(grr); +} + +int l1gprs_pdch_enable(struct l1gprs_pdch *pdch) +{ + if (pdch->enabled) + return -EALREADY; + + pdch->enabled = true; + return 0; +} + +int l1gprs_pdch_disable(struct l1gprs_pdch *pdch) +{ + if (!pdch->enabled) + return -EALREADY; + + pdch->enabled = false; + return 0; +} + +static void handle_pdtch_gprs_block(struct l1gprs_pdch *pdch, + const enum osmo_gprs_cs cs, + const uint8_t *data, size_t data_len) +{ + const uint8_t pt = data[0] >> 6; + RlcMacDownlink_t *ctrl_block; + struct bitvec *bv; + + ctrl_block = talloc_zero(pdch->grr, RlcMacDownlink_t); + OSMO_ASSERT(ctrl_block != NULL); + + bv = bitvec_alloc(data_len, pdch->grr); + OSMO_ASSERT(bv != NULL); + bitvec_unpack(bv, data); + + switch (pt) { + case GPRS_RLCMAC_CONTROL_BLOCK: + osmo_gprs_rlcmac_decode_downlink(bv, ctrl_block); + break; + case GPRS_RLCMAC_DATA_BLOCK: /* TODO */ + default: + break; + } + + talloc_free(ctrl_block); + talloc_free(bv); +} + +int l1gprs_handle_pdtch_ind(struct l1gprs_pdch *pdch, + const struct l1gprs_prim_data_ind *ind) +{ + const enum osmo_gprs_cs cs = osmo_gprs_dl_cs_by_block_bytes(ind->data_len); + + if (!pdch->enabled) { + LOGP_PDCH(pdch, LOGL_ERROR, "Rx PDTCH/D block for disabled PDCH\n"); + return -ENODEV; + } + + switch (cs) { + case OSMO_GPRS_CS1: + case OSMO_GPRS_CS2: + case OSMO_GPRS_CS3: + case OSMO_GPRS_CS4: + handle_pdtch_gprs_block(pdch, cs, &ind->data[0], ind->data_len); + return 0; + case OSMO_GPRS_CS_NONE: + LOGP_PDCH(pdch, LOGL_ERROR, + "Failed to determine Coding Scheme (len=%zu)\n", ind->data_len); + return -EINVAL; + default: + LOGP_PDCH(pdch, LOGL_NOTICE, "Coding Scheme %d is not supported\n", cs); + return -ENOTSUP; + } +} + +int l1gprs_handle_ptcch_ind(struct l1gprs_pdch *pdch, + const struct l1gprs_prim_data_ind *ind) +{ + if (!pdch->enabled) { + LOGP_PDCH(pdch, LOGL_ERROR, "Rx PTCCH/D block for disabled PDCH\n"); + return -ENODEV; + } + + if (ind->data_len != GSM_MACBLOCK_LEN) { + LOGP_PDCH(pdch, LOGL_ERROR, + "Rx PTCCH/D block with unexpected length=%zu (expected %u)\n", + ind->data_len, GSM_MACBLOCK_LEN); + return -EINVAL; + } + + LOGP_PDCH(pdch, LOGL_INFO, "Rx PTCCH/D block: %s\n", + osmo_hexdump(ind->data, ind->data_len)); + + return 0; +} diff --git a/src/host/trxcon/src/logging.c b/src/host/trxcon/src/logging.c index 2222577..763a78d 100644 --- a/src/host/trxcon/src/logging.c +++ b/src/host/trxcon/src/logging.c @@ -67,6 +67,12 @@ .color = "\033[1;36m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DGRR] = { + .name = "DGRR", + .description = "GPRS RR", + .color = "\033[1;36m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; static const struct log_info trxcon_log_info = { @@ -80,6 +86,7 @@ [TRXCON_LOGC_L1D] = DL1D, [TRXCON_LOGC_SCHC] = DSCH, [TRXCON_LOGC_SCHD] = DSCHD, + [TRXCON_LOGC_GRR] = DGRR, }; int trxcon_logging_init(void *tall_ctx, const char *category_mask) diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c index 10663b1..575d75c 100644 --- a/src/host/trxcon/src/trxcon_fsm.c +++ b/src/host/trxcon/src/trxcon_fsm.c @@ -36,6 +36,7 @@ #include <osmocom/bb/trxcon/l1ctl.h> #include <osmocom/bb/l1sched/l1sched.h> #include <osmocom/bb/l1sched/logging.h> +#include <osmocom/bb/l1gprs/l1gprs.h> #define S(x) (1 << (x)) @@ -537,11 +538,18 @@ case TRXCON_EV_RX_DATA_IND: { const struct trxcon_param_rx_data_ind *ind = data; + const unsigned int tn = ind->chan_nr & 0x07; - if (ind->link_id == 0x00) - LOGPFSML(fi, LOGL_NOTICE, "Rx PDTCH/D message\n"); + const struct l1gprs_prim_data_ind grr_ind = { + .frame_nr = ind->frame_nr, + .data_len = ind->data_len, + .data = ind->data, + }; + + if (ind->link_id == L1SCHED_CH_LID_PTCCH) + l1gprs_handle_ptcch_ind(&trxcon->grr->pdch[tn], &grr_ind); else - LOGPFSML(fi, LOGL_NOTICE, "Rx PTCCH/D message\n"); + l1gprs_handle_pdtch_ind(&trxcon->grr->pdch[tn], &grr_ind); break; } case TRXCON_EV_DCH_EST_REQ: @@ -567,6 +575,10 @@ /* Shutdown the scheduler */ if (trxcon->sched != NULL) l1sched_free(trxcon->sched); + /* Shutdown GPRS RR layer */ + if (trxcon->grr == NULL) + l1gprs_grr_inst_free(trxcon->grr); + /* Close active connections */ if (trxcon->l2if != NULL) trxcon_l1ctl_close(trxcon); diff --git a/src/host/trxcon/src/trxcon_inst.c b/src/host/trxcon/src/trxcon_inst.c index 7d3813e..6db3a1b 100644 --- a/src/host/trxcon/src/trxcon_inst.c +++ b/src/host/trxcon/src/trxcon_inst.c @@ -27,6 +27,8 @@ #include <osmocom/bb/trxcon/trxcon_fsm.h> #include <osmocom/bb/l1sched/l1sched.h> #include <osmocom/bb/l1sched/logging.h> +#include <osmocom/bb/l1gprs/l1gprs.h> +#include <osmocom/bb/l1gprs/logging.h> extern int g_logc_l1c; extern int g_logc_l1d; @@ -53,6 +55,9 @@ case TRXCON_LOGC_SCHD: schd = logc[i]; break; + case TRXCON_LOGC_GRR: + l1gprs_logging_init(logc[i]); + break; } } @@ -91,6 +96,13 @@ return NULL; } + /* Init GPRS RR layer */ + trxcon->grr = l1gprs_grr_inst_alloc(trxcon, trxcon->log_prefix, trxcon); + if (trxcon->grr == NULL) { + trxcon_inst_free(trxcon); + return NULL; + } + return trxcon; } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I9567d64f9d00262e36147e8d7e541e5e246bda5f Gerrit-Change-Number: 30743 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: add (optional) l1gprs_test binary for TTCN-3
by fixeria 20 Dec '22

20 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30745 ) Change subject: trxcon: add (optional) l1gprs_test binary for TTCN-3 ...................................................................... trxcon: add (optional) l1gprs_test binary for TTCN-3 Change-Id: I36ceec4035b2ea593d47998f3f14f1415c606765 Related: OS#5500 --- M src/host/trxcon/.gitignore M src/host/trxcon/configure.ac M src/host/trxcon/src/Makefile.am M src/host/trxcon/src/gprs.c A src/host/trxcon/src/l1gprs_test.c M src/host/trxcon/src/logging.c 6 files changed, 374 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/30745/1 diff --git a/src/host/trxcon/.gitignore b/src/host/trxcon/.gitignore index b5c3a99..da1a961 100644 --- a/src/host/trxcon/.gitignore +++ b/src/host/trxcon/.gitignore @@ -28,6 +28,7 @@ *.la /src/trxcon +/src/l1gprs_test # various .version diff --git a/src/host/trxcon/configure.ac b/src/host/trxcon/configure.ac index b22d1c8..dfaf97d 100644 --- a/src/host/trxcon/configure.ac +++ b/src/host/trxcon/configure.ac @@ -24,6 +24,14 @@ dnl init libtool LT_INIT +AC_ARG_WITH(l1gprs_test, [ + AS_HELP_STRING( + [--with-l1gprs-test], + [Enable building l1gprs_test binary]) + ]) + +AM_CONDITIONAL(ENABLE_L1GPRS_TEST, [test "x$with_l1gprs_test" = "xyes"]) + AC_ARG_ENABLE(sanitize, [AS_HELP_STRING( [--enable-sanitize], diff --git a/src/host/trxcon/src/Makefile.am b/src/host/trxcon/src/Makefile.am index 44546d1..f1db13f 100644 --- a/src/host/trxcon/src/Makefile.am +++ b/src/host/trxcon/src/Makefile.am @@ -53,6 +53,21 @@ $(NULL) +if ENABLE_L1GPRS_TEST +noinst_PROGRAMS = l1gprs_test + +l1gprs_test_SOURCES = \ + l1ctl_server.c \ + l1gprs_test.c \ + logging.c \ + $(NULL) + +l1gprs_test_LDADD = \ + libl1gprs.la \ + $(NULL) +endif + + bin_PROGRAMS = trxcon trxcon_SOURCES = \ diff --git a/src/host/trxcon/src/gprs.c b/src/host/trxcon/src/gprs.c index a550946..a5e4c5d 100644 --- a/src/host/trxcon/src/gprs.c +++ b/src/host/trxcon/src/gprs.c @@ -133,6 +133,9 @@ { const enum osmo_gprs_cs cs = osmo_gprs_dl_cs_by_block_bytes(ind->data_len); + LOGP_PDCH(pdch, LOGL_DEBUG, "Rx PDTCH/D block (fn=%u, len=%zu): %s\n", + ind->frame_nr, ind->data_len, osmo_hexdump(ind->data, ind->data_len)); + if (!pdch->enabled) { LOGP_PDCH(pdch, LOGL_ERROR, "Rx PDTCH/D block for disabled PDCH\n"); return -ENODEV; @@ -158,6 +161,9 @@ int l1gprs_handle_ptcch_ind(struct l1gprs_pdch *pdch, const struct l1gprs_prim_data_ind *ind) { + LOGP_PDCH(pdch, LOGL_DEBUG, "Rx PTCCH/D block (fn=%u, len=%zu): %s\n", + ind->frame_nr, ind->data_len, osmo_hexdump(ind->data, ind->data_len)); + if (!pdch->enabled) { LOGP_PDCH(pdch, LOGL_ERROR, "Rx PTCCH/D block for disabled PDCH\n"); return -ENODEV; @@ -170,8 +176,5 @@ return -EINVAL; } - LOGP_PDCH(pdch, LOGL_INFO, "Rx PTCCH/D block: %s\n", - osmo_hexdump(ind->data, ind->data_len)); - return 0; } diff --git a/src/host/trxcon/src/l1gprs_test.c b/src/host/trxcon/src/l1gprs_test.c new file mode 100644 index 0000000..315e99d --- /dev/null +++ b/src/host/trxcon/src/l1gprs_test.c @@ -0,0 +1,343 @@ +/* + * MS side L1 GPRS implementation (testing gate) + * + * (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> + * + * All Rights Reserved + * + * 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. + * + */ + +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <getopt.h> +#include <unistd.h> +#include <signal.h> +#include <errno.h> +#include <time.h> + +#include <arpa/inet.h> + +#include <osmocom/core/msgb.h> +#include <osmocom/core/talloc.h> +#include <osmocom/core/signal.h> +#include <osmocom/core/select.h> +#include <osmocom/core/application.h> +#include <osmocom/core/gsmtap_util.h> +#include <osmocom/core/gsmtap.h> + +#include <osmocom/bb/trxcon/l1ctl_server.h> +#include <osmocom/bb/trxcon/l1ctl_proto.h> +#include <osmocom/bb/trxcon/logging.h> + +#include <osmocom/bb/l1gprs/l1gprs.h> +#include <osmocom/bb/l1gprs/logging.h> + +#define COPYRIGHT \ + "Copyright (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>\n" \ + "License GPLv2+: GNU GPL version 2 or later " \ + "<http://gnu.org/licenses/gpl.html>\n" \ + "This is free software: you are free to change and redistribute it.\n" \ + "There is NO WARRANTY, to the extent permitted by law.\n\n" + +static struct { + const char *debug_mask; + int daemonize; + int quit; + + /* L1CTL specific */ + unsigned int max_clients; + const char *bind_socket; + + /* GSMTAP specific */ + struct gsmtap_inst *gsmtap; + const char *gsmtap_ip; +} app_data = { + .max_clients = 1, /* only one L1CTL client by default */ + .bind_socket = "/tmp/osmocom_l2", +}; + +static void *tall_ctx = NULL; + +static int l1ctl_rx_cb(struct l1ctl_client *l1c, struct msgb *msg) +{ + struct l1gprs_grr_inst *grr = l1c->priv; + struct l1ctl_hdr *l1h = (struct l1ctl_hdr *)msg->l1h; + + switch (l1h->msg_type) { + case L1CTL_RESET_REQ: + { + LOGP_GRR(grr, LOGL_NOTICE, "Resetting GRR state\n"); + + for (unsigned int tn = 0; tn < ARRAY_SIZE(grr->pdch); tn++) + l1gprs_pdch_disable(&grr->pdch[tn]); + + /* Reuse the original msgb for sending RESET.cnf */ + l1h->msg_type = L1CTL_RESET_CONF; + return l1ctl_client_send(l1c, msg); + } + case L1CTL_DM_EST_REQ: /* PDCH activation */ + case L1CTL_DM_REL_REQ: /* PDCH deactivation */ + { + const struct l1ctl_info_ul *ulh = (void *)l1h->data; + struct l1gprs_pdch *pdch = &grr->pdch[ulh->chan_nr & 0x07]; + + if (l1h->msg_type == L1CTL_DM_EST_REQ) { + if (l1gprs_pdch_enable(pdch) != 0) + LOGP_PDCH(pdch, LOGL_ERROR, "failed to enable\n"); + } else { + if (l1gprs_pdch_disable(pdch) != 0) + LOGP_PDCH(pdch, LOGL_ERROR, "failed to disable\n"); + } + break; + } + case L1CTL_DATA_IND: + { + const struct l1ctl_info_dl *dlh = (void *)l1h->data; + struct l1gprs_pdch *pdch = &grr->pdch[dlh->chan_nr & 0x07]; + const struct l1gprs_prim_data_ind grr_ind = { + .frame_nr = ntohl(dlh->frame_nr), + .data_len = msg->tail - dlh->payload, + .data = &dlh->payload[0], + }; + + if (dlh->link_id == 0x00) + l1gprs_handle_pdtch_ind(pdch, &grr_ind); + else + l1gprs_handle_ptcch_ind(pdch, &grr_ind); + + /* TODO: send over GSMTAP */ + break; + } + default: + LOGP(DAPP, LOGL_ERROR, + "%sL1CTL message 0x%02x is not supported\n", + grr->log_prefix, l1h->msg_type); + break; + } + + msgb_free(msg); + return 0; +} + +static void l1ctl_conn_accept_cb(struct l1ctl_client *l1c) +{ + struct l1gprs_grr_inst *grr; + + grr = l1gprs_grr_inst_alloc(l1c, NULL, l1c); + if (grr == NULL) { + LOGP(DAPP, LOGL_ERROR, "l1gprs_grr_inst_alloc() failed\n"); + l1ctl_client_conn_close(l1c); + return; + } + + l1c->log_prefix = talloc_asprintf(l1c, "l1c[%p]: ", l1c); + l1c->priv = grr; +} + +static void l1ctl_conn_close_cb(struct l1ctl_client *l1c) +{ + struct l1gprs_grr_inst *grr = l1c->priv; + + l1gprs_grr_inst_free(grr); +} + +static void print_usage(const char *app) +{ + printf("Usage: %s\n", app); +} + +static void print_help(void) +{ + printf(" Some help...\n"); + printf(" -h --help this text\n"); + printf(" -d --debug Change debug flags (e.g. DL1C:DSCH)\n"); + printf(" -s --socket Listening socket for layer23 (default /tmp/osmocom_l2)\n"); + printf(" -g --gsmtap-ip The destination IP used for GSMTAP (disabled by default)\n"); + printf(" -D --daemonize Run as daemon\n"); +} + +static void handle_options(int argc, char **argv) +{ + while (1) { + int option_index = 0, c; + static struct option long_options[] = { + {"help", 0, 0, 'h'}, + {"debug", 1, 0, 'd'}, + {"socket", 1, 0, 's'}, + {"gsmtap-ip", 1, 0, 'g'}, + {"daemonize", 0, 0, 'D'}, + {0, 0, 0, 0} + }; + + c = getopt_long(argc, argv, "d:s:g:Dh", + long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'h': + print_usage(argv[0]); + print_help(); + exit(0); + break; + case 'd': + app_data.debug_mask = optarg; + break; + case 's': + app_data.bind_socket = optarg; + break; + case 'g': + app_data.gsmtap_ip = optarg; + break; + case 'D': + app_data.daemonize = 1; + break; + default: + break; + } + } +} + +static void signal_handler(int signum) +{ + fprintf(stderr, "signal %u received\n", signum); + + switch (signum) { + case SIGINT: + case SIGTERM: + app_data.quit++; + break; + case SIGABRT: + /* in case of abort, we want to obtain a talloc report and + * then run default SIGABRT handler, who will generate coredump + * and abort the process. abort() should do this for us after we + * return, but program wouldn't exit if an external SIGABRT is + * received. + */ + talloc_report_full(tall_ctx, stderr); + signal(SIGABRT, SIG_DFL); + raise(SIGABRT); + break; + case SIGUSR1: + case SIGUSR2: + talloc_report_full(tall_ctx, stderr); + break; + default: + break; + } +} + +int main(int argc, char **argv) +{ + struct l1ctl_server_cfg server_cfg; + struct l1ctl_server *server = NULL; + int rc = 0; + + printf("%s", COPYRIGHT); + handle_options(argc, argv); + + /* Track the use of talloc NULL memory contexts */ + talloc_enable_null_tracking(); + + /* Init talloc memory management system */ + tall_ctx = talloc_init("l1gprs_test context"); + msgb_talloc_ctx_init(tall_ctx, 0); + + /* Setup signal handlers */ + signal(SIGINT, &signal_handler); + signal(SIGTERM, &signal_handler); + signal(SIGABRT, &signal_handler); + signal(SIGUSR1, &signal_handler); + signal(SIGUSR2, &signal_handler); + osmo_init_ignore_signals(); + + /* Init logging system */ + trxcon_logging_init(tall_ctx, app_data.debug_mask); + l1gprs_logging_init(DGRR); + + log_set_category_filter(osmo_stderr_target, DLCSN1, 1, LOGL_DEBUG); + + /* Configure pretty logging */ + log_set_print_extended_timestamp(osmo_stderr_target, 1); + log_set_print_category_hex(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + log_set_print_level(osmo_stderr_target, 1); + + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME); + log_set_print_filename_pos(osmo_stderr_target, LOG_FILENAME_POS_LINE_END); + + /* Optional GSMTAP */ + if (app_data.gsmtap_ip != NULL) { + app_data.gsmtap = gsmtap_source_init(app_data.gsmtap_ip, GSMTAP_UDP_PORT, 1); + if (!app_data.gsmtap) { + LOGP(DAPP, LOGL_ERROR, "Failed to init GSMTAP\n"); + goto exit; + } + /* Suppress ICMP "destination unreachable" errors */ + gsmtap_source_add_sink(app_data.gsmtap); + } + + /* Start the L1CTL server */ + server_cfg = (struct l1ctl_server_cfg) { + .sock_path = app_data.bind_socket, + .num_clients_max = app_data.max_clients, + .conn_read_cb = &l1ctl_rx_cb, + .conn_accept_cb = &l1ctl_conn_accept_cb, + .conn_close_cb = &l1ctl_conn_close_cb, + }; + + server = l1ctl_server_alloc(tall_ctx, &server_cfg); + if (server == NULL) { + rc = EXIT_FAILURE; + goto exit; + } + + LOGP(DAPP, LOGL_NOTICE, "Init complete\n"); + + if (app_data.daemonize) { + rc = osmo_daemonize(); + if (rc < 0) { + perror("Error during daemonize"); + goto exit; + } + } + + /* Initialize pseudo-random generator */ + srand(time(NULL)); + + while (!app_data.quit) + osmo_select_main(0); + +exit: + if (server != NULL) + l1ctl_server_free(server); + + /* Deinitialize logging */ + log_fini(); + + /** + * Print report for the root talloc context in order + * to be able to find and fix potential memory leaks. + */ + talloc_report_full(tall_ctx, stderr); + talloc_free(tall_ctx); + + /* Make both Valgrind and ASAN happy */ + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); + + return rc; +} diff --git a/src/host/trxcon/src/logging.c b/src/host/trxcon/src/logging.c index e98d79a..c0803f6 100644 --- a/src/host/trxcon/src/logging.c +++ b/src/host/trxcon/src/logging.c @@ -69,7 +69,7 @@ [DGRR] = { .name = "DGRR", .description = "GPRS RR", - .color = "\033[1;36m", + .color = "\033[0;96m", .enabled = 1, .loglevel = LOGL_DEBUG, }, }; -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30745 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I36ceec4035b2ea593d47998f3f14f1415c606765 Gerrit-Change-Number: 30745 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/L1CTL_PortType: allow sending L1ctlDlMessage via L1CTL_PT
by fixeria 20 Dec '22

20 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30739 ) Change subject: library/L1CTL_PortType: allow sending L1ctlDlMessage via L1CTL_PT ...................................................................... library/L1CTL_PortType: allow sending L1ctlDlMessage via L1CTL_PT We need to be able to send L1ctlDlMessage to the l1gprs_test [1], a special program for testing the MS side GRR implementation. Change-Id: I18e7585a8e93e3fafeda63b7325cfcc73e792abd Related: [1] I36ceec4035b2ea593d47998f3f14f1415c606765 Related: OS#5500 --- M library/L1CTL_PortType.ttcn 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/39/30739/1 diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index e521730..c44b2ae 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -316,6 +316,12 @@ pout.id := 0; } with { extension "prototype(fast)" } + private function L1CTL_to_UD_dl(in L1ctlDlMessage pin, out UD_send_data pout) { + var L1ctlDlMessageLV msg_lv := { msg := pin }; + pout.data := enc_L1ctlDlMessageLV(msg_lv); + pout.id := 0; + } with { extension "prototype(fast)" } + private function UD_to_L1CTL_dl(in UD_send_data pin, out L1ctlDlMessage pout) { var L1ctlDlMessageLV msg_lv := dec_L1ctlDlMessageLV(pin.data); pout:= msg_lv.msg; @@ -323,6 +329,7 @@ type port L1CTL_PT message { out L1ctlUlMessage + out L1ctlDlMessage out L1CTL_connect in L1ctlDlMessage in L1CTL_connect_result @@ -330,6 +337,7 @@ in UD_connected } with { extension "user UD_PT out(L1ctlUlMessage -> UD_send_data: function(L1CTL_to_UD_ul); + L1ctlDlMessage -> UD_send_data: function(L1CTL_to_UD_dl); L1CTL_connect -> UD_connect: function(L1CTL_to_UD_connect)) in(UD_send_data -> L1ctlDlMessage: function(UD_to_L1CTL_dl); UD_connect_result -> L1CTL_connect_result: function(UD_to_L1CTL_connect_result); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30739 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I18e7585a8e93e3fafeda63b7325cfcc73e792abd Gerrit-Change-Number: 30739 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library: move tr_PTCCHDownlinkMsg to the proper module
by fixeria 20 Dec '22

20 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30740 ) Change subject: library: move tr_PTCCHDownlinkMsg to the proper module ...................................................................... library: move tr_PTCCHDownlinkMsg to the proper module Change-Id: I9d5967142f2fbb1125434e99d7dd2557264d71c3 Related: OS#5500 --- M library/RLCMAC_Templates.ttcn M library/RLCMAC_Types.ttcn 2 files changed, 38 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/40/30740/1 diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn index d4204c7..7d7ff28 100644 --- a/library/RLCMAC_Templates.ttcn +++ b/library/RLCMAC_Templates.ttcn @@ -827,4 +827,42 @@ payload := data } + template PTCCHDownlinkMsg + tr_PTCCHDownlinkMsg(template (present) uint7_t tai0_ta := ?, + template (present) uint7_t tai1_ta := ?, + template (present) uint7_t tai2_ta := ?, + template (present) uint7_t tai3_ta := ?, + template (present) uint7_t tai4_ta := ?, + template (present) uint7_t tai5_ta := ?, + template (present) uint7_t tai6_ta := ?, + template (present) uint7_t tai7_ta := ?, + template (present) uint7_t tai8_ta := ?, + template (present) uint7_t tai9_ta := ?, + template (present) uint7_t tai10_ta := ?, + template (present) uint7_t tai11_ta := ?, + template (present) uint7_t tai12_ta := ?, + template (present) uint7_t tai13_ta := ?, + template (present) uint7_t tai14_ta := ?, + template (present) uint7_t tai15_ta := ?) := { + ta_idx := { + { spare := '0'B, ta_val := tai0_ta }, + { spare := '0'B, ta_val := tai1_ta }, + { spare := '0'B, ta_val := tai2_ta }, + { spare := '0'B, ta_val := tai3_ta }, + { spare := '0'B, ta_val := tai4_ta }, + { spare := '0'B, ta_val := tai5_ta }, + { spare := '0'B, ta_val := tai6_ta }, + { spare := '0'B, ta_val := tai7_ta }, + { spare := '0'B, ta_val := tai8_ta }, + { spare := '0'B, ta_val := tai9_ta }, + { spare := '0'B, ta_val := tai10_ta }, + { spare := '0'B, ta_val := tai11_ta }, + { spare := '0'B, ta_val := tai12_ta }, + { spare := '0'B, ta_val := tai13_ta }, + { spare := '0'B, ta_val := tai14_ta }, + { spare := '0'B, ta_val := tai15_ta } + }, + padding := '2B2B2B2B2B2B2B'O + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn index b01a7e2..76aeb22 100644 --- a/library/RLCMAC_Types.ttcn +++ b/library/RLCMAC_Types.ttcn @@ -389,44 +389,4 @@ external function dec_PTCCHDownlinkMsg(in octetstring stream) return PTCCHDownlinkMsg with { extension "prototype(convert) decode(RAW)" }; - template PTCCHDownlinkMsg tr_PTCCHDownlinkMsg( - template (present) uint7_t tai0_ta := ?, - template (present) uint7_t tai1_ta := ?, - template (present) uint7_t tai2_ta := ?, - template (present) uint7_t tai3_ta := ?, - template (present) uint7_t tai4_ta := ?, - template (present) uint7_t tai5_ta := ?, - template (present) uint7_t tai6_ta := ?, - template (present) uint7_t tai7_ta := ?, - template (present) uint7_t tai8_ta := ?, - template (present) uint7_t tai9_ta := ?, - template (present) uint7_t tai10_ta := ?, - template (present) uint7_t tai11_ta := ?, - template (present) uint7_t tai12_ta := ?, - template (present) uint7_t tai13_ta := ?, - template (present) uint7_t tai14_ta := ?, - template (present) uint7_t tai15_ta := ? - ) := { - ta_idx := { - { spare := '0'B, ta_val := tai0_ta }, - { spare := '0'B, ta_val := tai1_ta }, - { spare := '0'B, ta_val := tai2_ta }, - { spare := '0'B, ta_val := tai3_ta }, - { spare := '0'B, ta_val := tai4_ta }, - { spare := '0'B, ta_val := tai5_ta }, - { spare := '0'B, ta_val := tai6_ta }, - { spare := '0'B, ta_val := tai7_ta }, - { spare := '0'B, ta_val := tai8_ta }, - { spare := '0'B, ta_val := tai9_ta }, - { spare := '0'B, ta_val := tai10_ta }, - { spare := '0'B, ta_val := tai11_ta }, - { spare := '0'B, ta_val := tai12_ta }, - { spare := '0'B, ta_val := tai13_ta }, - { spare := '0'B, ta_val := tai14_ta }, - { spare := '0'B, ta_val := tai15_ta } - }, - padding := '2B2B2B2B2B2B2B'O - } - - } with { encode "RAW"; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30740 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I9d5967142f2fbb1125434e99d7dd2557264d71c3 Gerrit-Change-Number: 30740 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • ...
  • 198
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.