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 -----
  • 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

January 2024

  • 1 participants
  • 1559 discussions
[S] Change in libosmocore[master]: Add logging category for libosmo-cc
by pespin 24 Jan '24

24 Jan '24
Attention is currently required from: fixeria, jolly, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email ) Change subject: Add logging category for libosmo-cc ...................................................................... Patch Set 3: (1 comment) File include/osmocom/core/logging.h: https://gerrit.osmocom.org/c/libosmocore/+/35572/comment/53eb6a19_6c10ed3c PS2, Line 158: #defin > > IIRC there's a static array of size OSMO_NUM_DLIB […] I see. However, still the API is being changed due to modification of OSMO_NUM_DLIB. TBH, though there are exceptions, it makes much more sense that each library dynamically defines its own set of log categories which can be configured through API, like we did in libosmo-gprs-*. It looks totally weird that adding a new log category in some random library requires a bump in libosmocore... -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9df433b2cfb51f04dbf16e9f8dee567a59ab5cb7 Gerrit-Change-Number: 35572 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 24 Jan 2024 17:43:22 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Add logging category for libosmo-cc
by fixeria 24 Jan '24

24 Jan '24
Attention is currently required from: jolly, laforge, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email ) Change subject: Add logging category for libosmo-cc ...................................................................... Patch Set 3: (1 comment) File include/osmocom/core/logging.h: https://gerrit.osmocom.org/c/libosmocore/+/35572/comment/95877a5e_ff074dd5 PS2, Line 158: #defin > > IIRC there's a static array of size OSMO_NUM_DLIB […] ... which does merge that `static const` array with the user-supplied array of logging categories in a backwards compatible way. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9df433b2cfb51f04dbf16e9f8dee567a59ab5cb7 Gerrit-Change-Number: 35572 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 24 Jan 2024 17:40:22 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Add logging category for libosmo-cc
by fixeria 24 Jan '24

24 Jan '24
Attention is currently required from: jolly, laforge, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email ) Change subject: Add logging category for libosmo-cc ...................................................................... Patch Set 3: (1 comment) File include/osmocom/core/logging.h: https://gerrit.osmocom.org/c/libosmocore/+/35572/comment/264917a7_cdc40850 PS2, Line 158: #defin > IIRC there's a static array of size OSMO_NUM_DLIB Right, and the only user of this `static const` array is `log_init()` I mentioned above. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9df433b2cfb51f04dbf16e9f8dee567a59ab5cb7 Gerrit-Change-Number: 35572 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 24 Jan 2024 17:38:38 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Add logging category for libosmo-cc
by pespin 24 Jan '24

24 Jan '24
Attention is currently required from: fixeria, jolly, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email ) Change subject: Add logging category for libosmo-cc ...................................................................... Patch Set 3: (1 comment) File include/osmocom/core/logging.h: https://gerrit.osmocom.org/c/libosmocore/+/35572/comment/3b1b8835_1e340bcd PS2, Line 158: #defin > > this breaks ABI […] IIRC there's a static array of size OSMO_NUM_DLIB -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9df433b2cfb51f04dbf16e9f8dee567a59ab5cb7 Gerrit-Change-Number: 35572 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 24 Jan 2024 17:37:09 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: Add logging category for libosmo-cc
by fixeria 24 Jan '24

24 Jan '24
Attention is currently required from: jolly, laforge, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email ) Change subject: Add logging category for libosmo-cc ...................................................................... Patch Set 3: Code-Review+1 (1 comment) File include/osmocom/core/logging.h: https://gerrit.osmocom.org/c/libosmocore/+/35572/comment/438c1216_fe043e10 PS2, Line 158: #defin > this breaks ABI I am wondering about potential consequences. Obviously, adding a new category here enlarges the `internal_cat[]` array. I assumed that this might result in logging categories being shifted and thus messed up in the logging output, but this does not seem to be the case if I understand the logic in `log_init()` correctly. It would first copy the user-supplied logging categories, and only then copy the internal ones from `internal_cat[]`. So even if some application was compiled against an older version of libosmocore predating this commit, I don't see how a more recent libosmocore with DLCC would break logging in that application. Unless I am missing something, I think it should be fine to merge this commit as-is. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35572?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9df433b2cfb51f04dbf16e9f8dee567a59ab5cb7 Gerrit-Change-Number: 35572 Gerrit-PatchSet: 3 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 24 Jan 2024 17:30:33 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: jolly <andreas(a)eversberg.eu> Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmocom-bb[master]: mobile: handle V.24 line status updates from V.110 TA
by fixeria 24 Jan '24

24 Jan '24
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35640?usp=email ) Change subject: mobile: handle V.24 line status updates from V.110 TA ...................................................................... mobile: handle V.24 line status updates from V.110 TA Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336 Related: OS#4396 --- M src/host/layer23/src/mobile/tch_data.c 1 file changed, 36 insertions(+), 2 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/tch_data.c b/src/host/layer23/src/mobile/tch_data.c index 7169efa..451f267 100644 --- a/src/host/layer23/src/mobile/tch_data.c +++ b/src/host/layer23/src/mobile/tch_data.c @@ -187,11 +187,35 @@ osmo_soft_uart_tx_ubits(state->suart, buf, buf_size); } +static const struct { + enum osmo_v110_ta_circuit c; + enum osmo_soft_uart_status s; +} tch_v110_circuit_map[] = { + { OSMO_V110_TA_C_106, OSMO_SUART_STATUS_F_CTS }, + { OSMO_V110_TA_C_107, OSMO_SUART_STATUS_F_DSR }, + { OSMO_V110_TA_C_109, OSMO_SUART_STATUS_F_DCD }, +}; + static void tch_v110_ta_status_update_cb(void *priv, unsigned int status) { - LOGP(DCSD, LOGL_DEBUG, "%s(): [status=0x%08x]\n", __func__, status); + const struct tch_data_state *state = (struct tch_data_state *)priv; - /* TODO: update status lines of the soft-UART (if state.suart != NULL) */ + LOGP(DCSD, LOGL_DEBUG, "V.110 TA status mask=0x%08x\n", status); + + for (unsigned int i = 0; i < ARRAY_SIZE(tch_v110_circuit_map); i++) { + enum osmo_v110_ta_circuit c = tch_v110_circuit_map[i].c; + enum osmo_soft_uart_status s = tch_v110_circuit_map[i].s; + bool is_on = (status & (1 << c)) != 0; + + LOGP(DCSD, LOGL_DEBUG, "V.110 TA circuit %s (%s) is %s\n", + osmo_v110_ta_circuit_name(c), + osmo_v110_ta_circuit_desc(c), + is_on ? "ON" : "OFF"); + + /* update status lines of the soft-UART */ + if (state->suart != NULL) + osmo_soft_uart_set_status_line(state->suart, s, is_on); + } } struct osmo_v110_ta *tch_v110_ta_alloc(struct osmocom_ms *ms, -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35640?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336 Gerrit-Change-Number: 35640 Gerrit-PatchSet: 5 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmocom-bb[master]: mobile: VTY: use 'enum gsm48_bcap_transp' from libosmogsm
by fixeria 24 Jan '24

24 Jan '24
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35661?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: mobile: VTY: use 'enum gsm48_bcap_transp' from libosmogsm ...................................................................... mobile: VTY: use 'enum gsm48_bcap_transp' from libosmogsm Change-Id: Iebc0692f17a5a5d04e57d74a720db52775937bdd Related: OS#4396 --- M src/host/layer23/include/osmocom/bb/common/settings.h M src/host/layer23/src/common/settings.c M src/host/layer23/src/mobile/mnccms.c M src/host/layer23/src/mobile/vty_interface.c 4 files changed, 20 insertions(+), 33 deletions(-) Approvals: fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h b/src/host/layer23/include/osmocom/bb/common/settings.h index 3873611..ecebae8 100644 --- a/src/host/layer23/include/osmocom/bb/common/settings.h +++ b/src/host/layer23/include/osmocom/bb/common/settings.h @@ -6,6 +6,7 @@ #include <osmocom/core/utils.h> #include <osmocom/core/linuxlist.h> #include <osmocom/gsm/protocol/gsm_23_003.h> +#include <osmocom/gsm/protocol/gsm_04_08.h> #include <osmocom/gsm/gsm23003.h> #include <osmocom/gsm/gsm48.h> @@ -130,19 +131,11 @@ DATA_CALL_RATE_V110_14400, }; -/* Connection Element (transparency) */ -enum data_call_ce { - DATA_CALL_CE_TRANSP, - DATA_CALL_CE_TRANSP_PREF, - DATA_CALL_CE_NON_TRANSP, - DATA_CALL_CE_NON_TRANSP_PREF, -}; - /* Data (CSD) call parameters */ struct data_call_params { - enum data_call_type type; - enum data_call_rate rate; - enum data_call_ce ce; + enum data_call_type type; + enum data_call_rate rate; + enum gsm48_bcap_transp transp; }; struct gsm_settings { diff --git a/src/host/layer23/src/common/settings.c b/src/host/layer23/src/common/settings.c index 3fca52d..6ffb095 100644 --- a/src/host/layer23/src/common/settings.c +++ b/src/host/layer23/src/common/settings.c @@ -138,7 +138,7 @@ set->call_params.data = (struct data_call_params) { .type = DATA_CALL_TYPE_ISDN, .rate = DATA_CALL_RATE_V110_9600, - .ce = DATA_CALL_CE_TRANSP, + .transp = GSM48_BCAP_TR_TRANSP, }; return 0; diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c index c03eed5..4bdb845 100644 --- a/src/host/layer23/src/mobile/mnccms.c +++ b/src/host/layer23/src/mobile/mnccms.c @@ -218,7 +218,7 @@ .rate_adaption = GSM48_BCAP_RA_V110_X30, .sig_access = GSM48_BCAP_SA_I440_I450, .async = 1, - /* .transp is set below */ + .transp = cp->transp, .nr_data_bits = 8, .parity = GSM48_BCAP_PAR_NONE, .nr_stop_bits = 1, @@ -284,22 +284,6 @@ break; } - /* Connection element (octet 6c) */ - switch (cp->ce) { - case DATA_CALL_CE_TRANSP: - bcap->data.transp = GSM48_BCAP_TR_TRANSP; - break; - case DATA_CALL_CE_TRANSP_PREF: - bcap->data.transp = GSM48_BCAP_TR_TR_PREF; - break; - case DATA_CALL_CE_NON_TRANSP: - bcap->data.transp = GSM48_BCAP_TR_RLP; - break; - case DATA_CALL_CE_NON_TRANSP_PREF: - bcap->data.transp = GSM48_BCAP_TR_RLP_PREF; - break; - } - /* FAX calls are special (see 3GPP TS 24.008, Annex D.3) */ if (call_type == GSM_CALL_T_DATA_FAX) { bcap->data.rate_adaption = GSM48_BCAP_RA_NONE; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 6293768..05a20e4 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -741,14 +741,14 @@ if (!strcmp(argv[1], "transparent")) { if (argc > 2) - cp->ce = DATA_CALL_CE_TRANSP_PREF; + cp->transp = GSM48_BCAP_TR_TR_PREF; else - cp->ce = DATA_CALL_CE_TRANSP; + cp->transp = GSM48_BCAP_TR_TRANSP; } else if (!strcmp(argv[1], "non-transparent")) { if (argc > 2) - cp->ce = DATA_CALL_CE_NON_TRANSP_PREF; + cp->transp = GSM48_BCAP_TR_RLP_PREF; else - cp->ce = DATA_CALL_CE_NON_TRANSP; + cp->transp = GSM48_BCAP_TR_RLP; } else { /* should not happen */ return CMD_WARNING; } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35661?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Iebc0692f17a5a5d04e57d74a720db52775937bdd Gerrit-Change-Number: 35661 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmocom-bb[master]: mobile: add a separate logging category for CSD
by fixeria 24 Jan '24

24 Jan '24
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35656?usp=email ) Change subject: mobile: add a separate logging category for CSD ...................................................................... mobile: add a separate logging category for CSD Change-Id: If9db0759aeb4324ace9ae258c852787f37897d83 Related: OS#4396 --- M src/host/layer23/include/osmocom/bb/common/logging.h M src/host/layer23/src/common/logging.c M src/host/layer23/src/mobile/tch_data.c M src/host/layer23/src/mobile/tch_data_sock.c 4 files changed, 36 insertions(+), 19 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve jolly: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/host/layer23/include/osmocom/bb/common/logging.h b/src/host/layer23/include/osmocom/bb/common/logging.h index 40a7e81..3920d2e 100644 --- a/src/host/layer23/include/osmocom/bb/common/logging.h +++ b/src/host/layer23/include/osmocom/bb/common/logging.h @@ -28,6 +28,7 @@ DPRIM, DLUA, DGAPK, + DCSD, DTUN, DRLCMAC, DLLC, diff --git a/src/host/layer23/src/common/logging.c b/src/host/layer23/src/common/logging.c index 0401360..283b7f1 100644 --- a/src/host/layer23/src/common/logging.c +++ b/src/host/layer23/src/common/logging.c @@ -159,6 +159,12 @@ .color = "\033[0;36m", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DCSD] = { + .name = "DCSD", + .description = "Circuit Switched Data", + .color = "\033[0;36m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, [DTUN] = { .name = "DTUN", .description = "Tunnel interface", diff --git a/src/host/layer23/src/mobile/tch_data.c b/src/host/layer23/src/mobile/tch_data.c index 6ee89dc..7169efa 100644 --- a/src/host/layer23/src/mobile/tch_data.c +++ b/src/host/layer23/src/mobile/tch_data.c @@ -81,7 +81,7 @@ { struct tch_data_state *state = (struct tch_data_state *)priv; - LOGP(DL1C, LOGL_DEBUG, "%s(): [flags=0x%08x] %s\n", + LOGP(DCSD, LOGL_DEBUG, "%s(): [flags=0x%08x] %s\n", __func__, flags, msgb_hexdump(msg)); if (state->sock != NULL && msgb_length(msg) > 0) @@ -96,7 +96,7 @@ tch_csd_sock_recv(state->sock, msg); - LOGP(DL1C, LOGL_DEBUG, "%s(): [n_bytes=%u/%u] %s\n", + LOGP(DCSD, LOGL_DEBUG, "%s(): [n_bytes=%u/%u] %s\n", __func__, msg->len, msg->data_len, msgb_hexdump(msg)); } @@ -166,7 +166,7 @@ tch_csd_sock_recv(state->sock, msg); if (msgb_length(msg) < buf_size) { - LOGP(DL1C, LOGL_NOTICE, + LOGP(DCSD, LOGL_NOTICE, "%s(): not enough bytes for sync Tx (%u < %zu)\n", __func__, msgb_length(msg), buf_size); } @@ -189,7 +189,7 @@ static void tch_v110_ta_status_update_cb(void *priv, unsigned int status) { - LOGP(DL1C, LOGL_DEBUG, "%s(): [status=0x%08x]\n", __func__, status); + LOGP(DCSD, LOGL_DEBUG, "%s(): [status=0x%08x]\n", __func__, status); /* TODO: update status lines of the soft-UART (if state.suart != NULL) */ } @@ -233,7 +233,7 @@ * signalling rate shall be adapted to a synchronous 600 bit/s stream. */ case BCAP_RATE(GSM48_BCAP_IR_8k, GSM48_BCAP_UR_300): default: - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): IR 0x%02x / UR 0x%02x combination is not supported\n", __func__, bcap->data.interm_rate, bcap->data.user_rate); return NULL; @@ -367,20 +367,20 @@ static int tch_data_check_bcap(const struct gsm_mncc_bearer_cap *bcap) { if (bcap == NULL) { - LOGP(DL1C, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): CC transaction without BCap\n", __func__); return -ENODEV; } if (bcap->mode != GSM48_BCAP_TMOD_CIRCUIT) { - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): Transfer mode 0x%02x is not supported\n", __func__, bcap->mode); return -ENOTSUP; } if (bcap->coding != GSM48_BCAP_CODING_GSM_STD) { - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): Coding standard 0x%02x is not supported\n", __func__, bcap->coding); return -ENOTSUP; @@ -392,26 +392,26 @@ case GSM48_BCAP_ITCAP_FAX_G3: break; default: - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): Information transfer capability 0x%02x is not supported\n", __func__, bcap->transfer); return -ENOTSUP; } if (bcap->data.rate_adaption != GSM48_BCAP_RA_V110_X30) { - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): Rate adaption (octet 5) 0x%02x is not supported\n", __func__, bcap->data.rate_adaption); return -ENOTSUP; } if (bcap->data.sig_access != GSM48_BCAP_SA_I440_I450) { - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): Signalling access protocol (octet 5) 0x%02x is not supported\n", __func__, bcap->data.sig_access); return -ENOTSUP; } if (bcap->data.transp != GSM48_BCAP_TR_TRANSP) { - LOGP(DCC, LOGL_ERROR, + LOGP(DCSD, LOGL_ERROR, "%s(): only transparent calls are supported so far\n", __func__); return -ENOTSUP; @@ -514,7 +514,7 @@ struct tch_data_state *state = NULL; if (ms->tch_state == NULL || ms->tch_state->is_voice) { - LOGP(DCC, LOGL_INFO, "No data call is ongoing, " + LOGP(DCSD, LOGL_INFO, "No data call is ongoing, " "ignoring [dis]connection event for CSD socket\n"); return; } diff --git a/src/host/layer23/src/mobile/tch_data_sock.c b/src/host/layer23/src/mobile/tch_data_sock.c index 7bfebf3..7ce5a4f 100644 --- a/src/host/layer23/src/mobile/tch_data_sock.c +++ b/src/host/layer23/src/mobile/tch_data_sock.c @@ -51,7 +51,7 @@ { struct osmo_fd *bfd = &state->conn_bfd; - LOGP(DMOB, LOGL_NOTICE, "TCH CSD sock has closed connection\n"); + LOGP(DCSD, LOGL_NOTICE, "TCH CSD sock has closed connection\n"); tch_csd_sock_state_cb(state->ms, false); @@ -155,25 +155,25 @@ len = sizeof(un_addr); rc = accept(bfd->fd, (struct sockaddr *)&un_addr, &len); if (rc < 0) { - LOGP(DMOB, LOGL_ERROR, "Failed to accept() a new connection\n"); + LOGP(DCSD, LOGL_ERROR, "Failed to accept() a new connection\n"); return -1; } if (conn_bfd->fd >= 0) { - LOGP(DMOB, LOGL_NOTICE, "TCH CSD sock already has an active connection\n"); + LOGP(DCSD, LOGL_NOTICE, "TCH CSD sock already has an active connection\n"); close(rc); /* reject this connection request */ return 0; } osmo_fd_setup(conn_bfd, rc, OSMO_FD_READ, &tch_csd_sock_cb, state, 0); if (osmo_fd_register(conn_bfd) != 0) { - LOGP(DMOB, LOGL_ERROR, "osmo_fd_register() failed\n"); + LOGP(DCSD, LOGL_ERROR, "osmo_fd_register() failed\n"); close(conn_bfd->fd); conn_bfd->fd = -1; return -1; } - LOGP(DMOB, LOGL_NOTICE, "TCH CSD sock got a connection\n"); + LOGP(DCSD, LOGL_NOTICE, "TCH CSD sock got a connection\n"); tch_csd_sock_state_cb(state->ms, true); @@ -200,7 +200,7 @@ rc = osmo_sock_unix_init_ofd(bfd, SOCK_STREAM, 0, sock_path, OSMO_SOCK_F_BIND); if (rc < 0) { - LOGP(DMOB, LOGL_ERROR, "Could not create unix socket: %s\n", strerror(errno)); + LOGP(DCSD, LOGL_ERROR, "Could not create unix socket: %s\n", strerror(errno)); talloc_free(state); return NULL; } -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35656?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: If9db0759aeb4324ace9ae258c852787f37897d83 Gerrit-Change-Number: 35656 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmocom-bb[master]: mobile: VTY: make soft-UART parameters configurable
by fixeria 24 Jan '24

24 Jan '24
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35662?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: mobile: VTY: make soft-UART parameters configurable ...................................................................... mobile: VTY: make soft-UART parameters configurable Change-Id: I48bb58aaf1101fbc0e58db3fb1100927e506ede2 Related: OS#4396 --- M src/host/layer23/include/osmocom/bb/common/settings.h M src/host/layer23/src/common/settings.c M src/host/layer23/src/mobile/mnccms.c M src/host/layer23/src/mobile/vty_interface.c 4 files changed, 156 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h b/src/host/layer23/include/osmocom/bb/common/settings.h index ecebae8..a1c9b3e 100644 --- a/src/host/layer23/include/osmocom/bb/common/settings.h +++ b/src/host/layer23/include/osmocom/bb/common/settings.h @@ -136,6 +136,12 @@ enum data_call_type type; enum data_call_rate rate; enum gsm48_bcap_transp transp; + + /* async call parameters */ + bool is_async; + unsigned int nr_stop_bits; + unsigned int nr_data_bits; + enum gsm48_bcap_parity parity; }; struct gsm_settings { diff --git a/src/host/layer23/src/common/settings.c b/src/host/layer23/src/common/settings.c index 6ffb095..bc5d115 100644 --- a/src/host/layer23/src/common/settings.c +++ b/src/host/layer23/src/common/settings.c @@ -139,6 +139,12 @@ .type = DATA_CALL_TYPE_ISDN, .rate = DATA_CALL_RATE_V110_9600, .transp = GSM48_BCAP_TR_TRANSP, + + /* async call parameters (8-N-1) */ + .is_async = true, + .nr_stop_bits = 1, + .nr_data_bits = 8, + .parity = GSM48_BCAP_PAR_NONE, }; return 0; diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c index 4bdb845..fa3b284 100644 --- a/src/host/layer23/src/mobile/mnccms.c +++ b/src/host/layer23/src/mobile/mnccms.c @@ -217,11 +217,11 @@ /* TODO: make these fields configurable via *set */ .rate_adaption = GSM48_BCAP_RA_V110_X30, .sig_access = GSM48_BCAP_SA_I440_I450, - .async = 1, + .async = cp->is_async, .transp = cp->transp, - .nr_data_bits = 8, - .parity = GSM48_BCAP_PAR_NONE, - .nr_stop_bits = 1, + .nr_data_bits = cp->nr_data_bits, + .nr_stop_bits = cp->nr_stop_bits, + .parity = cp->parity, /* .user_rate is set below */ /* .interm_rate is set below */ }, diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 05a20e4..4c2263a 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -756,6 +756,119 @@ return CMD_SUCCESS; } +DEFUN(call_params_data_sync_async, + call_params_data_sync_async_cmd, + CALL_PARAMS_DATA_CMD " (sync|async)", + CALL_PARAMS_DATA_CMD_DESC + "Synchronous connection (always used for FAX calls)\n" + "Asynchronous connection (does not apply to FAX calls)\n") +{ + struct osmocom_ms *ms; + struct gsm_settings *set; + struct data_call_params *cp; + + ms = l23_vty_get_ms(argv[0], vty); + if (!ms) + return CMD_WARNING; + set = &ms->settings; + cp = &set->call_params.data; + + cp->is_async = (argv[1][0] == 'a'); + + return CMD_SUCCESS; +} + +#define CALL_PARAMS_DATA_ASYNC_CMD \ + CALL_PARAMS_DATA_CMD " async" +#define CALL_PARAMS_DATA_ASYNC_CMD_DESC \ + CALL_PARAMS_DATA_CMD_DESC \ + "Asynchronous connection params (does not apply to FAX calls)\n" + +DEFUN(call_params_data_async_nr_stop_bits, + call_params_data_async_nr_stop_bits_cmd, + CALL_PARAMS_DATA_ASYNC_CMD " nr-stop-bits <1-2>", + CALL_PARAMS_DATA_ASYNC_CMD_DESC + "Number of stop bits (soft-UART config)\n" + "Number of stop bits (default: 1)\n") +{ + struct osmocom_ms *ms; + struct gsm_settings *set; + struct data_call_params *cp; + + ms = l23_vty_get_ms(argv[0], vty); + if (!ms) + return CMD_WARNING; + set = &ms->settings; + cp = &set->call_params.data; + + cp->nr_stop_bits = atoi(argv[1]); + + return CMD_SUCCESS; +} + +DEFUN(call_params_data_async_nr_data_bits, + call_params_data_async_nr_data_bits_cmd, + CALL_PARAMS_DATA_ASYNC_CMD " nr-data-bits <7-8>", + CALL_PARAMS_DATA_ASYNC_CMD_DESC + "Number of data bits (soft-UART config)\n" + "Number of data bits (default: 8)\n") +{ + struct osmocom_ms *ms; + struct gsm_settings *set; + struct data_call_params *cp; + + ms = l23_vty_get_ms(argv[0], vty); + if (!ms) + return CMD_WARNING; + set = &ms->settings; + cp = &set->call_params.data; + + cp->nr_data_bits = atoi(argv[1]); + + return CMD_SUCCESS; +} + +static const struct value_string async_parity_names[] = { + { GSM48_BCAP_PAR_NONE, "none" }, + { GSM48_BCAP_PAR_EVEN, "even" }, + { GSM48_BCAP_PAR_ODD, "odd" }, + { GSM48_BCAP_PAR_ONE, "mark" }, + { GSM48_BCAP_PAR_ZERO, "space" }, + { 0, NULL } +}; + +static const struct value_string async_parity_descs[] = { + { GSM48_BCAP_PAR_NONE, "No parity bit (default)" }, + { GSM48_BCAP_PAR_EVEN, "Even parity" }, + { GSM48_BCAP_PAR_ODD, "Odd parity" }, + { GSM48_BCAP_PAR_ONE, "Always 1" }, + { GSM48_BCAP_PAR_ZERO, "Always 0" }, + { 0, NULL } +}; + +DEFUN(call_params_data_async_parity, + call_params_data_async_parity_cmd, + CALL_PARAMS_DATA_ASYNC_CMD /* generated */, + CALL_PARAMS_DATA_ASYNC_CMD_DESC /* generated */) +{ + struct osmocom_ms *ms; + struct gsm_settings *set; + struct data_call_params *cp; + int val; + + ms = l23_vty_get_ms(argv[0], vty); + if (!ms) + return CMD_WARNING; + set = &ms->settings; + cp = &set->call_params.data; + + val = get_string_value(async_parity_names, argv[1]); + OSMO_ASSERT(val >= 0); /* should not happen */ + cp->parity = (enum gsm48_bcap_parity)val; + + return CMD_SUCCESS; +} + DEFUN(sms, sms_cmd, "sms MS_NAME NUMBER .LINE", "Send an SMS\nName of MS (see \"show ms\")\nPhone number to send SMS " "(Use digits '0123456789*#abc', and '+' to dial international)\n" @@ -2766,6 +2879,19 @@ { int rc; + call_params_data_async_parity_cmd.string = + vty_cmd_string_from_valstr(NULL, + async_parity_names, + CALL_PARAMS_DATA_ASYNC_CMD + " parity (", "|", ")", 0); + + call_params_data_async_parity_cmd.doc = + vty_cmd_string_from_valstr(NULL, + async_parity_descs, + CALL_PARAMS_DATA_ASYNC_CMD_DESC + "Parity mode (soft-UART config)\n", + "\n", "", 0); + if ((rc = l23_vty_init(config_write, l23_vty_signal_cb)) < 0) return rc; @@ -2792,6 +2918,10 @@ install_element(ENABLE_NODE, &call_params_data_type_cmd); install_element(ENABLE_NODE, &call_params_data_rate_cmd); install_element(ENABLE_NODE, &call_params_data_ce_cmd); + install_element(ENABLE_NODE, &call_params_data_sync_async_cmd); + install_element(ENABLE_NODE, &call_params_data_async_nr_stop_bits_cmd); + install_element(ENABLE_NODE, &call_params_data_async_nr_data_bits_cmd); + install_element(ENABLE_NODE, &call_params_data_async_parity_cmd); install_element(ENABLE_NODE, &sms_cmd); install_element(ENABLE_NODE, &service_cmd); install_element(ENABLE_NODE, &vgcs_enter_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35662?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I48bb58aaf1101fbc0e58db3fb1100927e506ede2 Gerrit-Change-Number: 35662 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in osmocom-bb[master]: mobile: VTY: rework data type/rate configuration commands
by fixeria 24 Jan '24

24 Jan '24
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/35663?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: mobile: VTY: rework data type/rate configuration commands ...................................................................... mobile: VTY: rework data type/rate configuration commands Change-Id: I7393fce82613a57275033f5c47e16bbf708a3bfb Related: OS#4396 --- M src/host/layer23/include/osmocom/bb/common/settings.h M src/host/layer23/src/common/settings.c M src/host/layer23/src/mobile/mnccms.c M src/host/layer23/src/mobile/vty_interface.c 4 files changed, 207 insertions(+), 109 deletions(-) Approvals: fixeria: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h b/src/host/layer23/include/osmocom/bb/common/settings.h index a1c9b3e..1d3e53d 100644 --- a/src/host/layer23/include/osmocom/bb/common/settings.h +++ b/src/host/layer23/include/osmocom/bb/common/settings.h @@ -117,24 +117,58 @@ } locigprs; }; -enum data_call_type { - DATA_CALL_TYPE_ISDN, - DATA_CALL_TYPE_ANALOG, -}; - -enum data_call_rate { - DATA_CALL_RATE_V110_300, - DATA_CALL_RATE_V110_1200, - DATA_CALL_RATE_V110_2400, - DATA_CALL_RATE_V110_4800, - DATA_CALL_RATE_V110_9600, - DATA_CALL_RATE_V110_14400, +/* Data (CSD) call type and rate, values like in the '<speed>' part of 'AT+CBST'. + * See 3GPP TS 27.007, section 6.7 "Select bearer service type +CBST". */ +enum data_call_type_rate { + DATA_CALL_TR_AUTO = 0, + DATA_CALL_TR_V21_300 = 1, + DATA_CALL_TR_V22_1200 = 2, + DATA_CALL_TR_V23_1200_75 = 3, + DATA_CALL_TR_V22bis_2400 = 4, + DATA_CALL_TR_V26ter_2400 = 5, + DATA_CALL_TR_V32_4800 = 6, + DATA_CALL_TR_V32_9600 = 7, + DATA_CALL_TR_V34_9600 = 12, + DATA_CALL_TR_V34_14400 = 14, + DATA_CALL_TR_V34_19200 = 15, + DATA_CALL_TR_V34_28800 = 16, + DATA_CALL_TR_V34_33600 = 17, + DATA_CALL_TR_V120_1200 = 34, + DATA_CALL_TR_V120_2400 = 36, + DATA_CALL_TR_V120_4800 = 38, + DATA_CALL_TR_V120_9600 = 39, + DATA_CALL_TR_V120_14400 = 43, + DATA_CALL_TR_V120_19200 = 47, + DATA_CALL_TR_V120_28800 = 48, + DATA_CALL_TR_V120_38400 = 49, + DATA_CALL_TR_V120_48000 = 50, + DATA_CALL_TR_V120_56000 = 51, + DATA_CALL_TR_V110_300 = 65, + DATA_CALL_TR_V110_1200 = 66, + DATA_CALL_TR_V110_2400 = 68, + DATA_CALL_TR_V110_4800 = 70, + DATA_CALL_TR_V110_9600 = 71, + DATA_CALL_TR_V110_14400 = 75, + DATA_CALL_TR_V110_19200 = 79, + DATA_CALL_TR_V110_28800 = 80, + DATA_CALL_TR_V110_38400 = 81, + DATA_CALL_TR_V110_48000 = 82, + DATA_CALL_TR_V110_56000 = 83, + DATA_CALL_TR_V110_64000 = 84, + DATA_CALL_TR_BTR_56000 = 115, + DATA_CALL_TR_BTR_64000 = 116, + DATA_CALL_TR_PIAFS32k_32000 = 120, + DATA_CALL_TR_PIAFS64k_64000 = 121, + DATA_CALL_TR_MMEDIA_28800 = 130, + DATA_CALL_TR_MMEDIA_32000 = 131, + DATA_CALL_TR_MMEDIA_33600 = 132, + DATA_CALL_TR_MMEDIA_56000 = 133, + DATA_CALL_TR_MMEDIA_64000 = 134, }; /* Data (CSD) call parameters */ struct data_call_params { - enum data_call_type type; - enum data_call_rate rate; + enum data_call_type_rate type_rate; enum gsm48_bcap_transp transp; /* async call parameters */ diff --git a/src/host/layer23/src/common/settings.c b/src/host/layer23/src/common/settings.c index bc5d115..6bc5634 100644 --- a/src/host/layer23/src/common/settings.c +++ b/src/host/layer23/src/common/settings.c @@ -136,8 +136,7 @@ set->uplink_release_local = true; set->call_params.data = (struct data_call_params) { - .type = DATA_CALL_TYPE_ISDN, - .rate = DATA_CALL_RATE_V110_9600, + .type_rate = DATA_CALL_TR_V110_9600, .transp = GSM48_BCAP_TR_TRANSP, /* async call parameters (8-N-1) */ diff --git a/src/host/layer23/src/mobile/mnccms.c b/src/host/layer23/src/mobile/mnccms.c index fa3b284..95d7f0d 100644 --- a/src/host/layer23/src/mobile/mnccms.c +++ b/src/host/layer23/src/mobile/mnccms.c @@ -199,12 +199,95 @@ mncc->bearer_cap.mode = GSM48_BCAP_TMOD_CIRCUIT; } +static const struct bcap_data_set { + enum gsm48_bcap_ra ra; + enum gsm48_bcap_interm_rate ir; + enum gsm48_bcap_user_rate ur; + enum gsm48_bcap_modem_type mt; +} bcap_data_set_map[] = { + [DATA_CALL_TR_V21_300] = { + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_300, + .mt = GSM48_BCAP_MT_V21, + }, + [DATA_CALL_TR_V22_1200] = { + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_1200, + .mt = GSM48_BCAP_MT_V22, + }, + [DATA_CALL_TR_V23_1200_75] = { + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_1200_75, + .mt = GSM48_BCAP_MT_V23, + }, + [DATA_CALL_TR_V22bis_2400] = { + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_2400, + .mt = GSM48_BCAP_MT_V22bis, + }, + [DATA_CALL_TR_V26ter_2400] = { + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_2400, + .mt = GSM48_BCAP_MT_V26ter, + }, + [DATA_CALL_TR_V32_4800] = { + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_4800, + .mt = GSM48_BCAP_MT_V32, + }, + [DATA_CALL_TR_V32_9600] = { + .ir = GSM48_BCAP_IR_16k, + .ur = GSM48_BCAP_UR_9600, + .mt = GSM48_BCAP_MT_V32, + }, +#if 0 + [DATA_CALL_TR_V34_9600] = { + .ir = GSM48_BCAP_IR_16k, + .ur = GSM48_BCAP_UR_9600, + .mt = GSM48_BCAP_MT_V34, /* XXX */ + }, +#endif + [DATA_CALL_TR_V110_300] = { + .ra = GSM48_BCAP_RA_V110_X30, + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_300, + }, + [DATA_CALL_TR_V110_1200] = { + .ra = GSM48_BCAP_RA_V110_X30, + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_1200, + }, + [DATA_CALL_TR_V110_2400] = { + .ra = GSM48_BCAP_RA_V110_X30, + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_2400, + }, + [DATA_CALL_TR_V110_4800] = { + .ra = GSM48_BCAP_RA_V110_X30, + .ir = GSM48_BCAP_IR_8k, + .ur = GSM48_BCAP_UR_4800, + }, + [DATA_CALL_TR_V110_9600] = { + .ra = GSM48_BCAP_RA_V110_X30, + .ir = GSM48_BCAP_IR_16k, + .ur = GSM48_BCAP_UR_9600, + }, +}; + static void mncc_set_bcap_data(struct gsm_mncc *mncc, const struct gsm_settings *set, enum gsm_call_type call_type) { const struct data_call_params *cp = &set->call_params.data; struct gsm_mncc_bearer_cap *bcap = &mncc->bearer_cap; + const struct bcap_data_set *ds; + + OSMO_ASSERT(cp->type_rate < ARRAY_SIZE(bcap_data_set_map)); + ds = &bcap_data_set_map[cp->type_rate]; + if (ds->ir == 0 && ds->ur == 0) { + LOGP(DMNCC, LOGL_ERROR, "AT+CBST=%d is not supported\n", cp->type_rate); + return; + } mncc->fields |= MNCC_F_BEARER_CAP; @@ -214,16 +297,18 @@ .coding = GSM48_BCAP_CODING_GSM_STD, /* .radio is set below */ .data = { - /* TODO: make these fields configurable via *set */ - .rate_adaption = GSM48_BCAP_RA_V110_X30, .sig_access = GSM48_BCAP_SA_I440_I450, - .async = cp->is_async, + .rate_adaption = ds->ra, + .interm_rate = ds->ir, + .user_rate = ds->ur, + .modem_type = ds->mt, .transp = cp->transp, + + /* async call params */ + .async = cp->is_async, .nr_data_bits = cp->nr_data_bits, .nr_stop_bits = cp->nr_stop_bits, .parity = cp->parity, - /* .user_rate is set below */ - /* .interm_rate is set below */ }, }; @@ -242,9 +327,9 @@ /* Information transfer capability (octet 3) */ switch (call_type) { case GSM_CALL_T_DATA: - if (cp->type == DATA_CALL_TYPE_ISDN) + if (ds->mt == GSM48_BCAP_MT_NONE) bcap->transfer = GSM_MNCC_BCAP_UNR_DIG; - else /* == DATA_CALL_TYPE_ANALOG */ + else /* analog modem */ bcap->transfer = GSM_MNCC_BCAP_AUDIO; break; case GSM_CALL_T_DATA_FAX: @@ -255,35 +340,6 @@ OSMO_ASSERT(0); } - /* User rate (octet 6a) */ - switch (cp->rate) { - case DATA_CALL_RATE_V110_300: - bcap->data.user_rate = GSM48_BCAP_UR_300; - bcap->data.interm_rate = GSM48_BCAP_IR_8k; - break; - case DATA_CALL_RATE_V110_1200: - bcap->data.user_rate = GSM48_BCAP_UR_1200; - bcap->data.interm_rate = GSM48_BCAP_IR_8k; - break; - case DATA_CALL_RATE_V110_2400: - bcap->data.user_rate = GSM48_BCAP_UR_2400; - bcap->data.interm_rate = GSM48_BCAP_IR_8k; - break; - case DATA_CALL_RATE_V110_4800: - bcap->data.user_rate = GSM48_BCAP_UR_4800; - bcap->data.interm_rate = GSM48_BCAP_IR_8k; - break; - case DATA_CALL_RATE_V110_9600: - bcap->data.user_rate = GSM48_BCAP_UR_9600; - bcap->data.interm_rate = GSM48_BCAP_IR_16k; - break; - case DATA_CALL_RATE_V110_14400: /* TODO: the bcap encoder does not support 14400 bps */ - LOGP(DMNCC, LOGL_INFO, " support for 14400 bps is incomplete\n"); - bcap->data.user_rate = GSM48_BCAP_UR_9600; - bcap->data.interm_rate = GSM48_BCAP_IR_16k; - break; - } - /* FAX calls are special (see 3GPP TS 24.008, Annex D.3) */ if (call_type == GSM_CALL_T_DATA_FAX) { bcap->data.rate_adaption = GSM48_BCAP_RA_NONE; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 4c2263a..edff584 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -644,49 +644,57 @@ CALL_PARAMS_CMD_DESC \ "Parameters for data calls\n" -DEFUN(call_params_data_type, - call_params_data_type_cmd, - CALL_PARAMS_DATA_CMD " type (isdn|analog-modem)", - CALL_PARAMS_DATA_CMD_DESC - "Data call type (does not apply to FAX calls)\n" - "ISDN (Unrestricted Digital Information)\n" - "Analog modem (3.1 kHz audio, ex PLMN)\n") +/* only supported rate/type ('<speed>' in AT+CBST) values are listed here */ +static const struct value_string data_type_rate_descs[] = { +#if 0 + /* TODO: rates below 2400 bps are not supported */ + { DATA_CALL_TR_V21_300, "300 bps (V.21)" }, + { DATA_CALL_TR_V22_1200, "1200 bps (V.22)" }, + { DATA_CALL_TR_V23_1200_75, "1200/75 bps (V.23)" }, +#endif + { DATA_CALL_TR_V22bis_2400, "2400 bps (V.22bis)" }, + { DATA_CALL_TR_V26ter_2400, "2400 bps (V.26ter)" }, + { DATA_CALL_TR_V32_4800, "4800 bps (V.32)" }, + { DATA_CALL_TR_V32_9600, "9600 bps (V.32)" }, + { DATA_CALL_TR_V34_9600, "9600 bps (V.34)" }, +#if 0 + /* TODO: rates below 2400 bps are not supported */ + { DATA_CALL_TR_V110_300, "300 bps (V.110)" }, + { DATA_CALL_TR_V110_1200, "1200 bps (V.110)" }, +#endif + { DATA_CALL_TR_V110_2400, "2400 bps (V.110 or X.31 flag stuffing)" }, + { DATA_CALL_TR_V110_4800, "4800 bps (V.110 or X.31 flag stuffing)" }, + { DATA_CALL_TR_V110_9600, "9600 bps (V.110 or X.31 flag stuffing)" }, +#if 0 + /* TODO: 14400 bps is not supported */ + { DATA_CALL_TR_V110_14400, "14400 bps (V.110 or X.31 flag stuffing)" }, +#endif + { 0, NULL } +}; + +static char *call_params_data_type_rate_cmd_string(void *ctx) { - struct osmocom_ms *ms; - struct gsm_settings *set; - struct data_call_params *cp; - ms = l23_vty_get_ms(argv[0], vty); - if (!ms) - return CMD_WARNING; - set = &ms->settings; - cp = &set->call_params.data; + const struct value_string *vs; + char *string; - if (!strcmp(argv[1], "isdn")) - cp->type = DATA_CALL_TYPE_ISDN; - else if (!strcmp(argv[1], "analog-modem")) - cp->type = DATA_CALL_TYPE_ANALOG; - else /* should not happen */ - return CMD_WARNING; + string = talloc_asprintf(ctx, CALL_PARAMS_DATA_CMD " type-rate ("); + for (vs = &data_type_rate_descs[0]; vs->value || vs->str; vs++) + string = talloc_asprintf_append(string, "%u|", vs->value); + string[strlen(string) - 1] = ')'; - return CMD_SUCCESS; + return string; } -DEFUN(call_params_data_rate, - call_params_data_rate_cmd, - CALL_PARAMS_DATA_CMD " rate (65|66|68|70|71|75)", - CALL_PARAMS_DATA_CMD_DESC - "Data rate (values like in AT+CBST)\n" - "300 bps (V.110)\n" - "1200 bps (V.110)\n" - "2400 bps (V.110 or X.31 flag stuffing)\n" - "4800 bps (V.110 or X.31 flag stuffing)\n" - "9600 bps (V.110 or X.31 flag stuffing)\n" - "14400 bps (V.110 or X.31 flag stuffing)\n") +DEFUN(call_params_data_type_rate, + call_params_data_type_rate_cmd, + CALL_PARAMS_DATA_CMD /* generated */, + CALL_PARAMS_DATA_CMD_DESC /* generated */) { struct osmocom_ms *ms; struct gsm_settings *set; struct data_call_params *cp; + int val; ms = l23_vty_get_ms(argv[0], vty); if (!ms) @@ -694,28 +702,9 @@ set = &ms->settings; cp = &set->call_params.data; - switch (atoi(argv[1])) { - case 65: - cp->rate = DATA_CALL_RATE_V110_300; - break; - case 66: - cp->rate = DATA_CALL_RATE_V110_1200; - break; - case 68: - cp->rate = DATA_CALL_RATE_V110_2400; - break; - case 70: - cp->rate = DATA_CALL_RATE_V110_4800; - break; - case 71: - cp->rate = DATA_CALL_RATE_V110_9600; - break; - case 75: - cp->rate = DATA_CALL_RATE_V110_14400; - break; - default: /* should not happen */ - return CMD_WARNING; - } + val = atoi(argv[1]); + OSMO_ASSERT(get_value_string_or_null(data_type_rate_descs, val) != NULL); + cp->type_rate = (enum data_call_type_rate)val; return CMD_SUCCESS; } @@ -2879,6 +2868,17 @@ { int rc; + call_params_data_type_rate_cmd.string = + call_params_data_type_rate_cmd_string(NULL); + + call_params_data_type_rate_cmd.doc = + vty_cmd_string_from_valstr(NULL, + data_type_rate_descs, + CALL_PARAMS_DATA_CMD_DESC + "Type and rate (values like in AT+CBST; " + "see 3GPP TS 27.007, section 6.7)\n", + "\n", "", 0); + call_params_data_async_parity_cmd.string = vty_cmd_string_from_valstr(NULL, async_parity_names, @@ -2915,8 +2915,7 @@ install_element(ENABLE_NODE, &call_cmd); install_element(ENABLE_NODE, &call_retr_cmd); install_element(ENABLE_NODE, &call_dtmf_cmd); - install_element(ENABLE_NODE, &call_params_data_type_cmd); - install_element(ENABLE_NODE, &call_params_data_rate_cmd); + install_element(ENABLE_NODE, &call_params_data_type_rate_cmd); install_element(ENABLE_NODE, &call_params_data_ce_cmd); install_element(ENABLE_NODE, &call_params_data_sync_async_cmd); install_element(ENABLE_NODE, &call_params_data_async_nr_stop_bits_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/35663?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I7393fce82613a57275033f5c47e16bbf708a3bfb Gerrit-Change-Number: 35663 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • ...
  • 156
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.