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

July 2023

  • 1 participants
  • 3051 discussions
[M] Change in libosmocore[master]: gsm: Improve the TCH/H2.4 coding routines
by tnt 07 Jul '23

07 Jul '23
tnt has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33641 ) Change subject: gsm: Improve the TCH/H2.4 coding routines ...................................................................... gsm: Improve the TCH/H2.4 coding routines The spec isn't super clear, but basically the conv coding is done in two blocks of 72 bits. The way it's currently implemented isn't "wrong" in the sense it will produce correct output given no bit errors, but it's better to do the decoding in two blocks because this then it makes use of the fact we know the state of the encoder after the 72 bits, which improves the corrective ability of the code. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Id2551ffe2a0ebfd0a6df0e1d288a6f0af7e1eda7 --- M src/coding/gsm0503_coding.c M src/gsm/libosmogsm.map M tests/conv/conv_gsm0503_test.ok M utils/conv_codes_gsm.py 4 files changed, 58 insertions(+), 14 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve tnt: Looks good to me, approved; Verified diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 286981e..1249ce9 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -3480,15 +3480,10 @@ int gsm0503_tch_hr24_encode(ubit_t *bursts, const ubit_t *data) { ubit_t iB[22 * 114], cB[4 * 114]; - ubit_t conv[2 * 72 + 8]; - /* 3.7.2 Block code: d1(72) + pad(4) + d2(72) + pad(4) */ - memset(&conv[0], 0, sizeof(conv)); - memcpy(&conv[0], &data[0], 72); - memcpy(&conv[76], &data[72], 72); - - /* 3.7.3 Convolutional encoder: as specified for the TCH/F4.8 in subclause 3.4.3 */ - osmo_conv_encode(&gsm0503_tch_f48, &conv[0], &cB[0]); + /* 3.7.{1-3} Block code and Convolutional encoder */ + osmo_conv_encode(&gsm0503_tch_h24, &data[ 0], &cB[ 0]); + osmo_conv_encode(&gsm0503_tch_h24, &data[72], &cB[228]); /* 3.7.4 Interleaving: as specified for the TCH/F9.6 in subclause 3.3.4 */ memset(&iB[0], 0, sizeof(iB)); @@ -3511,8 +3506,8 @@ int gsm0503_tch_hr24_decode(ubit_t *data, const sbit_t *bursts, int *n_errors, int *n_bits_total) { + int n_errors_l[2], n_bits_total_l[2]; sbit_t iB[22 * 114], cB[4 * 114]; - ubit_t conv[120 + 32]; /* 3.7.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ for (unsigned int i = 0; i < 22; i++) { @@ -3523,12 +3518,15 @@ /* 3.7.4 Interleaving: as specified for the TCH/F9.6 in subclause 3.3.4 */ gsm0503_tch_f96_deinterleave(&cB[0], &iB[0]); - /* 3.7.3 Convolutional encoder: as specified for the TCH/F4.8 in subclause 3.4.3 */ - osmo_conv_decode_ber(&gsm0503_tch_f48, &cB[0], &conv[0], n_errors, n_bits_total); + /* 3.7.{1-3} Block code and Convolutional encoder */ + osmo_conv_decode_ber(&gsm0503_tch_h24, &cB[ 0], &data[ 0], &n_errors_l[0], &n_bits_total_l[0]); + osmo_conv_decode_ber(&gsm0503_tch_h24, &cB[228], &data[72], &n_errors_l[1], &n_bits_total_l[1]); - /* 3.7.2 Block code: d1(72) + pad(4) + d2(72) + pad(4) */ - memcpy(&data[0], &conv[0], 72); - memcpy(&data[72], &conv[76], 72); + if (n_errors) + *n_errors = n_errors_l[0] + n_errors_l[1]; + + if (n_bits_total) + *n_bits_total = n_bits_total_l[0] + n_bits_total_l[1]; return 2 * 72; } diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 609ee7e..0dfffd3 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -123,6 +123,7 @@ gsm0503_cs3_np; gsm0503_tch_fr; gsm0503_tch_f24; +gsm0503_tch_h24; gsm0503_tch_f48; gsm0503_tch_f96; gsm0503_tch_f144; diff --git a/tests/conv/conv_gsm0503_test.ok b/tests/conv/conv_gsm0503_test.ok index 6fd3793..dba52bd 100644 --- a/tests/conv/conv_gsm0503_test.ok +++ b/tests/conv/conv_gsm0503_test.ok @@ -14,6 +14,14 @@ [..] Encoding / Decoding cycle : OK [..] Encoding / Decoding cycle : OK +[+] Testing: gsm0503_tch_h24 +[.] Input length : ret = 72 exp = 72 -> OK +[.] Output length : ret = 228 exp = 228 -> OK +[.] Random vector checks: +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK +[..] Encoding / Decoding cycle : OK + [+] Testing: gsm0503_tch_f48 [.] Input length : ret = 148 exp = 148 -> OK [.] Output length : ret = 456 exp = 456 -> OK diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py index 62b5a0b..24a8ee2 100644 --- a/utils/conv_codes_gsm.py +++ b/utils/conv_codes_gsm.py @@ -66,6 +66,24 @@ ] ), + # TCH/H2.4 definition + ConvolutionalCode( + 72, + [ + (G1, 1), + (G2, 1), + (G3, 1), + ], + name = "tch_h24", + description = [ + "TCH/H2.4 convolutional code:", + "72 bits blocks, rate 1/3, k = 5", + "G1 = 1 + D + D3 + D4", + "G2 = 1 + D2 + D4", + "G3 = 1 + D + D2 + D3 + D4", + ] + ), + # TCH/F4.8 definition ConvolutionalCode( 148, -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id2551ffe2a0ebfd0a6df0e1d288a6f0af7e1eda7 Gerrit-Change-Number: 33641 Gerrit-PatchSet: 2 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmocore[master]: gsm: Improve the TCH/H2.4 coding routines
by tnt 07 Jul '23

07 Jul '23
tnt has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33641 ) Change subject: gsm: Improve the TCH/H2.4 coding routines ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id2551ffe2a0ebfd0a6df0e1d288a6f0af7e1eda7 Gerrit-Change-Number: 33641 Gerrit-PatchSet: 2 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: tnt <tnt(a)246tNt.com> Gerrit-Comment-Date: Fri, 07 Jul 2023 18:04:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmocore[master]: gsm: Improve the TCH/H2.4 coding routines
by tnt 07 Jul '23

07 Jul '23
Attention is currently required from: tnt. tnt has removed a vote from this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33641 ) Change subject: gsm: Improve the TCH/H2.4 coding routines ...................................................................... Removed Verified-1 by Jenkins Builder (1000002) -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33641 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Id2551ffe2a0ebfd0a6df0e1d288a6f0af7e1eda7 Gerrit-Change-Number: 33641 Gerrit-PatchSet: 2 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: tnt <tnt(a)246tNt.com> Gerrit-MessageType: deleteVote
1 0
0 0
[S] Change in libosmo-sccp[master]: M3UA/SUA: Don't add empty routing context IE in DUNA/DAVA/DUPU
by laforge 07 Jul '23

07 Jul '23
Attention is currently required from: iedemam, laforge. Hello Jenkins Builder, iedemam, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33642 to look at the new patch set (#2). Change subject: M3UA/SUA: Don't add empty routing context IE in DUNA/DAVA/DUPU ...................................................................... M3UA/SUA: Don't add empty routing context IE in DUNA/DAVA/DUPU Before this patch, the code generating a DUNA or DAVA message would potentially generate a ROUTE_CTX IE with zero-length content, rather than skipping such an IE altogether if no routing context[s] are given. Change-Id: I19d0382cd2d428a91ac716182b9d86dcdc2c2ebd Related: SYS#6511 --- M src/m3ua.c M src/sua.c 2 files changed, 20 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/42/33642/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33642 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I19d0382cd2d428a91ac716182b9d86dcdc2c2ebd Gerrit-Change-Number: 33642 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: iedemam <michael(a)kapsulate.com> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: iedemam <michael(a)kapsulate.com> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in osmo-trx[master]: ms: rearrange code to allow clean exits
by pespin 07 Jul '23

07 Jul '23
Attention is currently required from: Hoernchen. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/32954 ) Change subject: ms: rearrange code to allow clean exits ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/32954 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I0b8deebc63cf4d936666fd68e1666d1917e89a5d Gerrit-Change-Number: 32954 Gerrit-PatchSet: 4 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Jul 2023 17:35:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bts[master]: osmo-bts-trx: implement FACCH/[FH] support for CSD
by pespin 07 Jul '23

07 Jul '23
Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/33586 ) Change subject: osmo-bts-trx: implement FACCH/[FH] support for CSD ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I4c6736e84c271240d457998de688c0baf59fe578 Gerrit-Change-Number: 33586 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Jul 2023 17:31:33 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmo-sccp[master]: ss7: Refactor osmo_ss7_asp_find_or_create()
by pespin 07 Jul '23

07 Jul '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33647 ) Change subject: ss7: Refactor osmo_ss7_asp_find_or_create() ...................................................................... ss7: Refactor osmo_ss7_asp_find_or_create() Move allocation code to its own function. Simplify osmo_ss7_asp_find_or_create() code paths. Change-Id: Ibbf20c63fc1d2b22a7c5d750002f94795ee31f26 --- M src/osmo_ss7.c 1 file changed, 43 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/47/33647/1 diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 3851ab8..839d756 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -1521,6 +1521,31 @@ return asp; } +static struct osmo_ss7_asp * +osmo_ss7_asp_alloc(struct osmo_ss7_instance *inst, const char *name, + uint16_t remote_port, uint16_t local_port, + enum osmo_ss7_asp_protocol proto) +{ + struct osmo_ss7_asp *asp = talloc_zero(inst, struct osmo_ss7_asp); + asp->ctrg = rate_ctr_group_alloc(asp, &ss7_asp_rcgd, g_ss7_asp_rcg_idx++); + if (!asp->ctrg) { + talloc_free(asp); + return NULL; + } + rate_ctr_group_set_name(asp->ctrg, name); + asp->inst = inst; + asp->cfg.remote.port = remote_port; + asp->cfg.local.port = local_port; + asp->cfg.proto = proto; + asp->cfg.name = talloc_strdup(asp, name); + llist_add_tail(&asp->list, &inst->asp_list); + + /* The SUA code internally needs SCCP to work */ + if (proto == OSMO_SS7_ASP_PROT_SUA) + osmo_ss7_ensure_sccp(inst); + return asp; +} + struct osmo_ss7_asp * osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, @@ -1530,34 +1555,15 @@ OSMO_ASSERT(ss7_initialized); asp = osmo_ss7_asp_find_by_name(inst, name); - - if (asp && (asp->cfg.remote.port != remote_port || + if (asp) { + if (asp->cfg.remote.port != remote_port || asp->cfg.local.port != local_port || - asp->cfg.proto != proto)) - return NULL; - - if (!asp) { - /* FIXME: check if local port has SCTP? */ - asp = talloc_zero(inst, struct osmo_ss7_asp); - asp->ctrg = rate_ctr_group_alloc(asp, &ss7_asp_rcgd, g_ss7_asp_rcg_idx++); - if (!asp->ctrg) { - talloc_free(asp); + asp->cfg.proto != proto) return NULL; - } - rate_ctr_group_set_name(asp->ctrg, name); - asp->inst = inst; - asp->cfg.remote.port = remote_port; - asp->cfg.local.port = local_port; - asp->cfg.proto = proto; - asp->cfg.name = talloc_strdup(asp, name); - llist_add_tail(&asp->list, &inst->asp_list); - - /* The SUA code internally needs SCCP to work */ - if (proto == OSMO_SS7_ASP_PROT_SUA) - osmo_ss7_ensure_sccp(inst); - + return asp; } - return asp; + + return osmo_ss7_asp_alloc(inst, name, remote_port, local_port, proto); } void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp) -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33647 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: Ibbf20c63fc1d2b22a7c5d750002f94795ee31f26 Gerrit-Change-Number: 33647 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-sccp[master]: sccp: Use tdef to implement osmo_sccp_timers
by pespin 07 Jul '23

07 Jul '23
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33644 to look at the new patch set (#2). Change subject: sccp: Use tdef to implement osmo_sccp_timers ...................................................................... sccp: Use tdef to implement osmo_sccp_timers Related: OS#4372 Change-Id: I1dbe49a83a1bcddf074d5e638babd065834a0ebd --- M src/sccp_internal.h M src/sccp_scoc.c M src/sccp_user.c M src/sccp_vty.c 4 files changed, 66 insertions(+), 121 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/44/33644/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33644 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I1dbe49a83a1bcddf074d5e638babd065834a0ebd Gerrit-Change-Number: 33644 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[M] Change in libosmo-sccp[master]: asp: Make ASP default LM timers VTY configurable
by pespin 07 Jul '23

07 Jul '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33648 ) Change subject: asp: Make ASP default LM timers VTY configurable ...................................................................... asp: Make ASP default LM timers VTY configurable Related: SYS#6511 Change-Id: Ib62e19f2e528e8b2792cbb51a5900dc3463ebd06 --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/osmo_ss7_vty.c M src/xua_default_lm_fsm.c M src/xua_internal.h 5 files changed, 167 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/48/33648/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 3c72394..ba1e214 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -437,6 +437,9 @@ struct osmo_ss7_asp_peer remote; uint8_t qos_class; uint32_t quirks; + + /* T_defs used by the default_lm: */ + struct osmo_tdef *T_defs_lm; } cfg; }; diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 839d756..7e171fd 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -1538,6 +1538,11 @@ asp->cfg.local.port = local_port; asp->cfg.proto = proto; asp->cfg.name = talloc_strdup(asp, name); + + asp->cfg.T_defs_lm = talloc_size(asp, sizeof(ss7_asp_lm_timer_defaults)); + memcpy(asp->cfg.T_defs_lm, ss7_asp_lm_timer_defaults, sizeof(ss7_asp_lm_timer_defaults)); + osmo_tdefs_reset(asp->cfg.T_defs_lm); + llist_add_tail(&asp->list, &inst->asp_list); /* The SUA code internally needs SCCP to work */ diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 9398bc1..61f14cd 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -790,6 +790,77 @@ return CMD_SUCCESS; } +/* timer lm <name> <1-999999> + * (cmdstr and doc are dynamically generated from ss7_asp_lm_timer_names.) */ +DEFUN_ATTR(asp_timer, asp_timer_cmd, + NULL, NULL, CMD_ATTR_IMMEDIATE) +{ + struct osmo_ss7_asp *asp = vty->index; + enum ss7_asp_lm_timer timer = get_string_value(ss7_asp_lm_timer_names, argv[0]); + + if (timer <= 0 || timer >= SS7_ASP_LM_TIMERS_LEN) { + vty_out(vty, "%% Invalid timer: %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + osmo_tdef_set(asp->cfg.T_defs_lm, timer, atoi(argv[1]), OSMO_TDEF_S); + return CMD_SUCCESS; +} + +static void gen_asp_timer_cmd_strs(struct cmd_element *cmd) +{ + int i; + char *cmd_str = NULL; + char *doc_str = NULL; + + OSMO_ASSERT(cmd->string == NULL); + OSMO_ASSERT(cmd->doc == NULL); + + osmo_talloc_asprintf(tall_vty_ctx, cmd_str, "timer lm ("); + osmo_talloc_asprintf(tall_vty_ctx, doc_str, + "Configure ASP default timer values\n" + "Configure ASP default lm timer values\n"); + + for (i = 0; ss7_asp_lm_timer_names[i].str; i++) { + const struct osmo_tdef *def; + enum ss7_asp_lm_timer timer; + + timer = ss7_asp_lm_timer_names[i].value; + def = osmo_tdef_get_entry((struct osmo_tdef *)&ss7_asp_lm_timer_defaults, timer); + OSMO_ASSERT(def); + + osmo_talloc_asprintf(tall_vty_ctx, cmd_str, "%s%s", + i ? "|" : "", + ss7_asp_lm_timer_names[i].str); + osmo_talloc_asprintf(tall_vty_ctx, doc_str, "%s (default: %lu)\n", + def->desc, + def->default_val); + } + + osmo_talloc_asprintf(tall_vty_ctx, cmd_str, ") <1-999999>"); + osmo_talloc_asprintf(tall_vty_ctx, doc_str, + "Timer value, in seconds\n"); + + cmd->string = cmd_str; + cmd->doc = doc_str; +} + +static void write_asp_timers(struct vty *vty, const char *indent, + struct osmo_ss7_asp *asp) +{ + int i; + + for (i = 0; ss7_asp_lm_timer_names[i].str; i++) { + const struct osmo_tdef *tdef = osmo_tdef_get_entry(asp->cfg.T_defs_lm, ss7_asp_lm_timer_names[i].value); + if (!tdef) + continue; + if (tdef->val == tdef->default_val) + continue; + vty_out(vty, "%stimer lm %s %lu%s", indent, ss7_asp_lm_timer_names[i].str, + tdef->val, VTY_NEWLINE); + } +} + static char *as_list_for_asp(const struct osmo_ss7_asp *asp, char *buf, size_t buf_len) { struct osmo_strbuf sb = { .buf = buf, .len = buf_len }; @@ -882,6 +953,7 @@ continue; vty_out(vty, " quirk %s%s", get_value_string(asp_quirk_names, (1 << i)), VTY_NEWLINE); } + write_asp_timers(vty, " ", asp); } @@ -2127,6 +2199,8 @@ install_lib_element(L_CS7_ASP_NODE, &asp_shutdown_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_quirk_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_no_quirk_cmd); + gen_asp_timer_cmd_strs(&asp_timer_cmd); + install_lib_element(L_CS7_ASP_NODE, &asp_timer_cmd); install_node(&as_node, NULL); install_lib_element_ve(&show_cs7_as_cmd); diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c index 15958f2..fb0465e 100644 --- a/src/xua_default_lm_fsm.c +++ b/src/xua_default_lm_fsm.c @@ -76,17 +76,53 @@ { 0, NULL } }; -enum lm_timer { - T_WAIT_ASP_UP, - T_WAIT_NOTIFY, - T_WAIT_NOTIFY_RKM, - T_WAIT_RK_REG_RESP, +/*********************************************************************** + * Timer Handling + ***********************************************************************/ + +const struct osmo_tdef ss7_asp_lm_timer_defaults[SS7_ASP_LM_TIMERS_LEN] = { + { .T = SS7_ASP_LM_T_WAIT_ASP_UP, .default_val = 20, .unit = OSMO_TDEF_S, + .desc = "Restart ASP after timeout waiting for ASP UP (SG role) / ASP UP ACK (ASP role) (s)" }, + { .T = SS7_ASP_LM_T_WAIT_NOTIFY, .default_val = 2, .unit = OSMO_TDEF_S, + .desc = "Restart ASP after timeout waiting for NOTIFY (s)" }, + { .T = SS7_ASP_LM_T_WAIT_NOTIY_RKM, .default_val = 20, .unit = OSMO_TDEF_S, + .desc = "Restart ASP after timeout waiting for NOTIFY after RKM registration (s)" }, + { .T = SS7_ASP_LM_T_WAIT_RK_REG_RESP, .default_val = 10, .unit = OSMO_TDEF_S, + .desc = "Restart ASP after timeout waiting for RK_REG_RESP (s)" }, + {} +}; + +/* Appendix C.4 of ITU-T Q.714 */ +const struct value_string ss7_asp_lm_timer_names[] = { + { SS7_ASP_LM_T_WAIT_ASP_UP, "wait_asp_up" }, + { SS7_ASP_LM_T_WAIT_NOTIFY, "wait_notify" }, + { SS7_ASP_LM_T_WAIT_NOTIY_RKM, "wait_notify_rkm" }, + { SS7_ASP_LM_T_WAIT_RK_REG_RESP, "wait_rk_reg_resp" }, + {} +}; + +osmo_static_assert(ARRAY_SIZE(ss7_asp_lm_timer_defaults) == (SS7_ASP_LM_TIMERS_LEN) && + ARRAY_SIZE(ss7_asp_lm_timer_names) == (SS7_ASP_LM_TIMERS_LEN), + assert_ss7_asp_lm_timer_count); + +static const struct osmo_tdef_state_timeout lm_fsm_timeouts[32] = { + [S_IDLE] = { }, + [S_WAIT_ASP_UP] = { .T = SS7_ASP_LM_T_WAIT_ASP_UP }, + [S_WAIT_NOTIFY] = { .T = SS7_ASP_LM_T_WAIT_NOTIFY }, /* SS7_ASP_LM_T_WAIT_NOTIY_RKM if coming from S_RKM_REG */ + [S_RKM_REG] = { .T = SS7_ASP_LM_T_WAIT_RK_REG_RESP }, + [S_ACTIVE] = { }, }; struct lm_fsm_priv { struct osmo_ss7_asp *asp; }; +#define lm_fsm_state_chg(fi, NEXT_STATE) \ + osmo_tdef_fsm_inst_state_chg(fi, NEXT_STATE, \ + lm_fsm_timeouts, \ + ((struct lm_fsm_priv *)(fi->priv))->asp->cfg.T_defs_lm, \ + -1) + static struct osmo_ss7_as *find_first_as_in_asp(struct osmo_ss7_asp *asp) { struct osmo_ss7_as *as; @@ -138,8 +174,8 @@ switch (event) { case LM_E_SCTP_EST_IND: - /* Try to transition to ASP-UP, wait for 20s */ - osmo_fsm_inst_state_chg(fi, S_WAIT_ASP_UP, 20, T_WAIT_ASP_UP); + /* Try to transition to ASP-UP, wait to receive message for a few seconds */ + lm_fsm_state_chg(fi, S_WAIT_ASP_UP); osmo_fsm_inst_dispatch(lmp->asp->fi, XUA_ASP_E_M_ASP_UP_REQ, NULL); break; } @@ -151,7 +187,7 @@ case LM_E_ASP_UP_CONF: /* ASP is up, wait for some time if any NOTIFY * indications about AS in this ASP are received */ - osmo_fsm_inst_state_chg(fi, S_WAIT_NOTIFY, 2, T_WAIT_NOTIFY); + lm_fsm_state_chg(fi, S_WAIT_NOTIFY); break; } } @@ -164,13 +200,13 @@ struct osmo_ss7_as *as; switch (fi->T) { - case T_WAIT_ASP_UP: + case SS7_ASP_LM_T_WAIT_ASP_UP: /* we have been waiting for the ASP to come up, but it * failed to do so */ LOGPFSML(fi, LOGL_NOTICE, "Peer didn't send any ASP_UP in time! restarting ASP\n"); restart_asp(fi); break; - case T_WAIT_NOTIFY: + case SS7_ASP_LM_T_WAIT_NOTIFY: if (lmp->asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_NO_NOTIFY) { /* some implementations don't send the NOTIFY which they SHOULD * according to RFC4666 (see OS#5145) */ @@ -181,7 +217,7 @@ /* No AS has reported via NOTIFY that is was * (statically) configured at the SG for this ASP, so * let's dynamically register */ - osmo_fsm_inst_state_chg(fi, S_RKM_REG, 10, T_WAIT_RK_REG_RESP); + lm_fsm_state_chg(fi, S_RKM_REG); prim = xua_xlm_prim_alloc(OSMO_XLM_PRIM_M_RK_REG, PRIM_OP_REQUEST); OSMO_ASSERT(prim); as = find_first_as_in_asp(lmp->asp); @@ -195,12 +231,12 @@ prim->u.rk_reg.traf_mode = as->cfg.mode; osmo_xlm_sap_down(lmp->asp, &prim->oph); break; - case T_WAIT_NOTIFY_RKM: + case SS7_ASP_LM_T_WAIT_NOTIY_RKM: /* No AS has reported via NOTIFY even after dynamic RKM * configuration */ restart_asp(fi); break; - case T_WAIT_RK_REG_RESP: + case SS7_ASP_LM_T_WAIT_RK_REG_RESP: /* timeout of registration of routing key */ restart_asp(fi); break; @@ -220,7 +256,7 @@ if (oxp->u.notify.status_type == M3UA_NOTIFY_T_STATCHG && (oxp->u.notify.status_info == M3UA_NOTIFY_I_AS_INACT || oxp->u.notify.status_info == M3UA_NOTIFY_I_AS_PEND)) { - osmo_fsm_inst_state_chg(fi, S_ACTIVE, 0, 0); + lm_fsm_state_chg(fi, S_ACTIVE); osmo_fsm_inst_dispatch(lmp->asp->fi, XUA_ASP_E_M_ASP_ACTIVE_REQ, NULL); } break; @@ -229,7 +265,7 @@ * the SG, and that this AS is currently inactive */ /* request the ASP to go into active state (which * hopefully will bring the AS to active, too) */ - osmo_fsm_inst_state_chg(fi, S_ACTIVE, 0, 0); + lm_fsm_state_chg(fi, S_ACTIVE); osmo_fsm_inst_dispatch(lmp->asp->fi, XUA_ASP_E_M_ASP_ACTIVE_REQ, NULL); break; } @@ -237,6 +273,7 @@ static void lm_rkm_reg(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct lm_fsm_priv *lmp = fi->priv; struct osmo_xlm_prim *oxp; int rc; @@ -247,14 +284,15 @@ LOGPFSML(fi, LOGL_NOTICE, "Received RKM_REG_RSP with negative result\n"); restart_asp(fi); } else { + unsigned long timeout_sec; rc = handle_reg_conf(fi, oxp->u.rk_reg.key.l_rk_id, oxp->u.rk_reg.key.context); if (rc < 0) restart_asp(fi); - /* RKM registration was successful, we can - * transition to WAIT_NOTIFY state and assume - * that an NOTIFY/AS-INACTIVE arrives within 20 - * seconds */ - osmo_fsm_inst_state_chg(fi, S_WAIT_NOTIFY, 20, T_WAIT_NOTIFY_RKM); + /* RKM registration was successful, we can transition to WAIT_NOTIFY + * state and assume that an NOTIFY/AS-INACTIVE arrives within + * T_WAIT_NOTIFY_RKM seconds */ + timeout_sec = osmo_tdef_get(lmp->asp->cfg.T_defs_lm, SS7_ASP_LM_T_WAIT_NOTIY_RKM, OSMO_TDEF_S, -1); + osmo_fsm_inst_state_chg(fi, S_WAIT_NOTIFY, timeout_sec, SS7_ASP_LM_T_WAIT_NOTIY_RKM); } break; } diff --git a/src/xua_internal.h b/src/xua_internal.h index 5dd7066..26cb3fc 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -1,5 +1,6 @@ #pragma once +#include <osmocom/core/tdef.h> #include <osmocom/sigtran/osmo_ss7.h> #include <osmocom/sigtran/xua_msg.h> @@ -85,6 +86,22 @@ void xua_snm_pc_available(struct osmo_ss7_as *as, const uint32_t *aff_pc, unsigned int num_aff_pc, const char *info_str, bool available); +enum ss7_asp_lm_timer { + /* 0 kept unused on purpose since it's handled specially by osmo_fsm */ + SS7_ASP_LM_T_WAIT_ASP_UP = 1, + SS7_ASP_LM_T_WAIT_NOTIFY, + SS7_ASP_LM_T_WAIT_NOTIY_RKM, + SS7_ASP_LM_T_WAIT_RK_REG_RESP, + /* This must remain the last item: */ + SS7_ASP_LM_TIMERS_LEN +}; + +extern const struct osmo_tdef ss7_asp_lm_timer_defaults[SS7_ASP_LM_TIMERS_LEN]; + +extern const struct value_string ss7_asp_lm_timer_names[]; +static inline const char *ss7_asp_lm_timer_name(enum ss7_asp_lm_timer val) +{ return get_value_string(ss7_asp_lm_timer_names, val); } + extern struct osmo_fsm xua_default_lm_fsm; extern const struct value_string m3ua_rkm_reg_status_vals[]; extern const struct value_string m3ua_rkm_dereg_status_vals[]; -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33648 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: Ib62e19f2e528e8b2792cbb51a5900dc3463ebd06 Gerrit-Change-Number: 33648 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bts[master]: osmo-bts-trx: implement FACCH/[FH] support for CSD
by fixeria 07 Jul '23

07 Jul '23
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bts/+/33586 to look at the new patch set (#4). Change subject: osmo-bts-trx: implement FACCH/[FH] support for CSD ...................................................................... osmo-bts-trx: implement FACCH/[FH] support for CSD The FACCH/[FH] coding rules are specified in 3GPP TS 45.003, sections 4.2 and 4.3. The key difference is that unlike with speech channels, FACCH does not replace data frames completely, but disturb a fixed amount of bits fom them. This is why we need to use separate gsm0503_tch_[fh]r_facch_{en,de}code() API for data channels. Change-Id: I4c6736e84c271240d457998de688c0baf59fe578 Depends: libosmocore.git I0c7a9c180dcafe64e6aebe53518d3d11e1f29886 Related: OS#1572 --- M src/osmo-bts-trx/sched_lchan_tchf.c M src/osmo-bts-trx/sched_lchan_tchh.c 2 files changed, 159 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/86/33586/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/33586 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I4c6736e84c271240d457998de688c0baf59fe578 Gerrit-Change-Number: 33586 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • ...
  • 306
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.