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 osmocom-bb[master]: mobile: support RTP and TI specific TCH frame I/O formats
by fixeria 05 Dec '22

05 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30455 ) Change subject: mobile: support RTP and TI specific TCH frame I/O formats ...................................................................... mobile: support RTP and TI specific TCH frame I/O formats Change-Id: Ib41f8c39c82c243b62a76433f59a2b98e175f894 Related: OS#3400 --- M src/host/layer23/include/osmocom/bb/mobile/settings.h M src/host/layer23/src/mobile/gapk_io.c M src/host/layer23/src/mobile/settings.c M src/host/layer23/src/mobile/vty_interface.c 4 files changed, 71 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/55/30455/1 diff --git a/src/host/layer23/include/osmocom/bb/mobile/settings.h b/src/host/layer23/include/osmocom/bb/mobile/settings.h index 2800fea..a4fd663 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/settings.h +++ b/src/host/layer23/include/osmocom/bb/mobile/settings.h @@ -31,8 +31,19 @@ static inline const char *audio_io_handler_name(enum audio_io_handler val) { return get_value_string(audio_io_handler_names, val); } +/* TCH frame I/O format */ +enum audio_io_format { + AUDIO_IOF_RTP, + AUDIO_IOF_TI, +}; + +extern const struct value_string audio_io_format_names[]; +static inline const char *audio_io_format_name(enum audio_io_format val) +{ return get_value_string(audio_io_format_names, val); } + struct audio_settings { enum audio_io_handler io_handler; + enum audio_io_format io_format; char alsa_output_dev[128]; char alsa_input_dev[128]; }; diff --git a/src/host/layer23/src/mobile/gapk_io.c b/src/host/layer23/src/mobile/gapk_io.c index b2b55d9..4e3cd75 100644 --- a/src/host/layer23/src/mobile/gapk_io.c +++ b/src/host/layer23/src/mobile/gapk_io.c @@ -258,22 +258,18 @@ if (rc) goto error; -#if 0 - /* TODO: PHY specific format -> canonical */ + /* PHY specific format -> canonical */ rc = osmo_gapk_pq_queue_fmt_convert(pq, gapk_io->phy_fmt_desc, 0); if (rc) goto error; -#endif /* Optional ECU (Error Concealment Unit) */ osmo_gapk_pq_queue_ecu(pq, gapk_io->codec_desc); -#if 0 - /* TODO: canonical -> decoder specific format */ + /* Canonical -> decoder specific format */ rc = pq_queue_codec_fmt_conv(pq, gapk_io->codec_desc, false); if (rc) goto error; -#endif /* Frame decoder */ rc = osmo_gapk_pq_queue_codec(pq, gapk_io->codec_desc, 0); @@ -362,6 +358,25 @@ } /** + * Picks the corresponding PHY's frame format for a given codec. + * To be used with PHYs that produce audio in TI Calypso format. + */ +static enum osmo_gapk_format_type phy_fmt_pick_ti(enum osmo_gapk_codec_type codec) +{ + switch (codec) { + case CODEC_HR: + return FMT_TI_HR; + case CODEC_FR: + return FMT_TI_FR; + case CODEC_EFR: + return FMT_TI_EFR; + case CODEC_AMR: /* not supported */ + default: + return FMT_INVALID; + } +} + +/** * Allocates both TCH frame I/O buffers * and prepares both processing queues (chains). * Should be called when a voice call is initiated... @@ -393,12 +408,15 @@ return -ENOTSUP; } - /** - * Pick the corresponding PHY's frame format - * TODO: ask PHY, which format is supported? - * FIXME: RTP (valid for trxcon) is used for now - */ - phy_fmt = phy_fmt_pick_rtp(codec); + switch (set->audio.io_format) { + case AUDIO_IOF_RTP: + phy_fmt = phy_fmt_pick_rtp(codec); + break; + case AUDIO_IOF_TI: + phy_fmt = phy_fmt_pick_ti(codec); + break; + } + phy_fmt_desc = osmo_gapk_fmt_get_from_type(phy_fmt); if (phy_fmt_desc == NULL) { LOGP(DGAPK, LOGL_ERROR, "Failed to pick the PHY specific " diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 02a5ff7..445190e 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -212,3 +212,9 @@ { AUDIO_IOH_LOOPBACK, "loopback" }, { 0x00, NULL} }; + +const struct value_string audio_io_format_names[] = { + { AUDIO_IOF_RTP, "rtp" }, + { AUDIO_IOF_TI, "ti" }, + { 0x00, NULL} +}; diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c index 3bab608..248687f 100644 --- a/src/host/layer23/src/mobile/vty_interface.c +++ b/src/host/layer23/src/mobile/vty_interface.c @@ -1546,6 +1546,8 @@ vty_out(vty, " io-handler %s%s", audio_io_handler_name(set->audio.io_handler), VTY_NEWLINE); if (set->audio.io_handler == AUDIO_IOH_GAPK) { + vty_out(vty, " io-tch-format %s%s", + audio_io_format_name(set->audio.io_format), VTY_NEWLINE); vty_out(vty, " alsa-output-dev %s%s", set->audio.alsa_output_dev, VTY_NEWLINE); vty_out(vty, " alsa-input-dev %s%s", @@ -2872,6 +2874,27 @@ return set_audio_io_handler(vty, AUDIO_IOH_NONE); } +DEFUN(cfg_ms_audio_io_tch_format, cfg_ms_audio_io_tch_format_cmd, + "io-tch-format (rtp|ti)", + "Set TCH I/O frame format used by the L1 PHY (for GAPK only)\n" + "RTP format (RFC3551 for FR/EFR, RFC5993 for HR, RFC4867 for AMR)\n" + "Texas Instrument format, used by Calypso based phones (e.g. Motorola C1xx)\n") +{ + int val = get_string_value(audio_io_format_names, argv[0]); + struct osmocom_ms *ms = (struct osmocom_ms *) vty->index; + struct gsm_settings *set = &ms->settings; + + if (set->audio.io_handler != AUDIO_IOH_GAPK) { + vty_out(vty, "This parameter is only valid for GAPK%s", VTY_NEWLINE); + return CMD_WARNING; + } + + OSMO_ASSERT(val >= 0); + set->audio.io_format = val; + + return CMD_SUCCESS; +} + DEFUN(cfg_ms_audio_alsa_out_dev, cfg_ms_audio_alsa_out_dev_cmd, "alsa-output-dev (default|NAME)", "Set ALSA output (playback) device name (for GAPK only)\n" @@ -3176,6 +3199,7 @@ install_node(&audio_node, config_write_dummy); install_element(AUDIO_NODE, &cfg_ms_audio_io_handler_cmd); install_element(AUDIO_NODE, &cfg_ms_audio_no_io_handler_cmd); + install_element(AUDIO_NODE, &cfg_ms_audio_io_tch_format_cmd); install_element(AUDIO_NODE, &cfg_ms_audio_alsa_out_dev_cmd); install_element(AUDIO_NODE, &cfg_ms_audio_alsa_in_dev_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30455 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ib41f8c39c82c243b62a76433f59a2b98e175f894 Gerrit-Change-Number: 30455 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: print TCH mode using gsm48_chan_mode_name()
by fixeria 05 Dec '22

05 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30453 ) Change subject: trxcon: print TCH mode using gsm48_chan_mode_name() ...................................................................... trxcon: print TCH mode using gsm48_chan_mode_name() Change-Id: I6c54ad857b91ef1a32501912ba4c393e1c04eff0 --- M src/host/trxcon/src/l1ctl.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/53/30453/1 diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 2f4881b..70e8f12 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -730,7 +730,7 @@ LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received L1CTL_TCH_MODE_REQ (tch_mode=%u, audio_mode=%u)\n", - mode_req->tch_mode, mode_req->audio_mode); + gsm48_chan_mode_name(mode_req->tch_mode), mode_req->audio_mode); /* TODO: do we need to care about audio_mode? */ -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30453 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I6c54ad857b91ef1a32501912ba4c393e1c04eff0 Gerrit-Change-Number: 30453 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: add value-string defs for L1CTL Reset / CCCH Mode
by fixeria 05 Dec '22

05 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30452 ) Change subject: trxcon: add value-string defs for L1CTL Reset / CCCH Mode ...................................................................... trxcon: add value-string defs for L1CTL Reset / CCCH Mode Change-Id: I045b2c771b24d301570c9556770e97afedc8274a --- M src/host/trxcon/src/l1ctl.c 1 file changed, 24 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/52/30452/1 diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 8c9372b..2f4881b 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -33,6 +33,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/talloc.h> #include <osmocom/core/logging.h> +#include <osmocom/core/utils.h> #include <osmocom/gsm/gsm0502.h> #include <osmocom/gsm/gsm_utils.h> @@ -50,6 +51,21 @@ int g_logc_l1c = DLGLOBAL; int g_logc_l1d = DLGLOBAL; +static const struct value_string l1ctl_ccch_mode_names[] = { + { CCCH_MODE_NONE, "NONE" }, + { CCCH_MODE_NON_COMBINED, "NON_COMBINED" }, + { CCCH_MODE_COMBINED, "COMBINED" }, + { CCCH_MODE_COMBINED_CBCH, "COMBINED_CBCH" }, + { 0, NULL }, +}; + +static const struct value_string l1ctl_reset_names[] = { + { L1CTL_RES_T_BOOT, "BOOT" }, + { L1CTL_RES_T_FULL, "FULL" }, + { L1CTL_RES_T_SCHED, "SCHED" }, + { 0, NULL }, +}; + static const char *arfcn2band_name(uint16_t arfcn) { enum gsm_band band; @@ -121,7 +137,8 @@ if (!msg) return -ENOMEM; - LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Ind (%u)\n", type); + LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Ind (%s)\n", + get_value_string(l1ctl_reset_names, type)); res = (struct l1ctl_reset *) msgb_put(msg, sizeof(*res)); res->type = type; @@ -139,7 +156,8 @@ if (!msg) return -ENOMEM; - LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Conf (%u)\n", type); + LOGPFSMSL(fi, g_logc_l1c, LOGL_DEBUG, "Send Reset Conf (%s)\n", + get_value_string(l1ctl_reset_names, type)); res = (struct l1ctl_reset *) msgb_put(msg, sizeof(*res)); res->type = type; @@ -417,7 +435,8 @@ } LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, - "Received reset request (%u)\n", res->type); + "Received reset request (%s)\n", + get_value_string(l1ctl_reset_names, res->type)); switch (res->type) { case L1CTL_RES_T_FULL: @@ -471,8 +490,8 @@ goto exit; } - LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received CCCH mode request (%u)\n", - mode_req->ccch_mode); /* TODO: add value-string for ccch_mode */ + LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received CCCH mode request (%s)\n", + get_value_string(l1ctl_ccch_mode_names, mode_req->ccch_mode)); struct trxcon_param_set_ccch_tch_mode_req req = { /* Choose corresponding channel combination */ -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30452 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I045b2c771b24d301570c9556770e97afedc8274a Gerrit-Change-Number: 30452 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: constify pointers in L1CTL decoding functions
by fixeria 05 Dec '22

05 Dec '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30451 ) Change subject: trxcon: constify pointers in L1CTL decoding functions ...................................................................... trxcon: constify pointers in L1CTL decoding functions Change-Id: Ife66b3c14f0ee2f29bf934db1f58512d52669b38 --- M src/host/trxcon/src/l1ctl.c 1 file changed, 30 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/51/30451/1 diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index 989e3c2..8c9372b 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -337,10 +337,10 @@ static int l1ctl_rx_fbsb_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_fbsb_req *fbsb; + const struct l1ctl_fbsb_req *fbsb; int rc = 0; - fbsb = (struct l1ctl_fbsb_req *) msg->l1h; + fbsb = (const struct l1ctl_fbsb_req *)msg->l1h; if (msgb_l1len(msg) < sizeof(*fbsb)) { LOGPFSMSL(fi, g_logc_l1c, LOGL_ERROR, "MSG too short FBSB Req: %u\n", @@ -371,10 +371,10 @@ static int l1ctl_rx_pm_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_pm_req *pmr; + const struct l1ctl_pm_req *pmr; int rc = 0; - pmr = (struct l1ctl_pm_req *) msg->l1h; + pmr = (const struct l1ctl_pm_req *)msg->l1h; if (msgb_l1len(msg) < sizeof(*pmr)) { LOGPFSMSL(fi, g_logc_l1c, LOGL_ERROR, "MSG too short PM Req: %u\n", @@ -404,10 +404,10 @@ static int l1ctl_rx_reset_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_reset *res; + const struct l1ctl_reset *res; int rc = 0; - res = (struct l1ctl_reset *) msg->l1h; + res = (const struct l1ctl_reset *)msg->l1h; if (msgb_l1len(msg) < sizeof(*res)) { LOGPFSMSL(fi, g_logc_l1c, LOGL_ERROR, "MSG too short Reset Req: %u\n", @@ -459,10 +459,10 @@ static int l1ctl_rx_ccch_mode_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_ccch_mode_req *mode_req; + const struct l1ctl_ccch_mode_req *mode_req; int rc; - mode_req = (struct l1ctl_ccch_mode_req *)msg->l1h; + mode_req = (const struct l1ctl_ccch_mode_req *)msg->l1h; if (msgb_l1len(msg) < sizeof(*mode_req)) { LOGPFSMSL(fi, g_logc_l1c, LOGL_ERROR, "MSG too short Reset Req: %u\n", @@ -492,9 +492,9 @@ { struct trxcon_param_tx_access_burst_req req; struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_info_ul *ul; + const struct l1ctl_info_ul *ul; - ul = (struct l1ctl_info_ul *) msg->l1h; + ul = (const struct l1ctl_info_ul *)msg->l1h; if (is_11bit) { const struct l1ctl_ext_rach_req *rr = (void *)ul->payload; @@ -590,12 +590,12 @@ static int l1ctl_rx_dm_est_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_dm_est_req *est_req; - struct l1ctl_info_ul *ul; + const struct l1ctl_dm_est_req *est_req; + const struct l1ctl_info_ul *ul; int rc; - ul = (struct l1ctl_info_ul *) msg->l1h; - est_req = (struct l1ctl_dm_est_req *) ul->payload; + ul = (const struct l1ctl_info_ul *)msg->l1h; + est_req = (const struct l1ctl_dm_est_req *)ul->payload; struct trxcon_param_dch_est_req req = { .chan_nr = ul->chan_nr, @@ -642,11 +642,11 @@ static int l1ctl_rx_dt_req(struct trxcon_inst *trxcon, struct msgb *msg, bool traffic) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_info_ul *ul; + const struct l1ctl_info_ul *ul; /* Extract UL frame header */ - ul = (struct l1ctl_info_ul *) msg->l1h; - msg->l2h = ul->payload; + ul = (const struct l1ctl_info_ul *)msg->l1h; + msg->l2h = (uint8_t *)ul->payload; struct trxcon_param_tx_data_req req = { .traffic = traffic, @@ -677,11 +677,11 @@ static int l1ctl_rx_param_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_par_req *par_req; - struct l1ctl_info_ul *ul; + const struct l1ctl_par_req *par_req; + const struct l1ctl_info_ul *ul; - ul = (struct l1ctl_info_ul *) msg->l1h; - par_req = (struct l1ctl_par_req *) ul->payload; + ul = (const struct l1ctl_info_ul *)msg->l1h; + par_req = (const struct l1ctl_par_req *)ul->payload; LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received L1CTL_PARAM_REQ (ta=%d, tx_power=%u)\n", @@ -704,10 +704,10 @@ static int l1ctl_rx_tch_mode_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_tch_mode_req *mode_req; + const struct l1ctl_tch_mode_req *mode_req; int rc; - mode_req = (struct l1ctl_tch_mode_req *)msg->l1h; + mode_req = (const struct l1ctl_tch_mode_req *)msg->l1h; LOGPFSMSL(fi, g_logc_l1c, LOGL_NOTICE, "Received L1CTL_TCH_MODE_REQ (tch_mode=%u, audio_mode=%u)\n", @@ -739,11 +739,11 @@ static int l1ctl_rx_crypto_req(struct trxcon_inst *trxcon, struct msgb *msg) { struct osmo_fsm_inst *fi = trxcon->fi; - struct l1ctl_crypto_req *cr; - struct l1ctl_info_ul *ul; + const struct l1ctl_crypto_req *cr; + const struct l1ctl_info_ul *ul; - ul = (struct l1ctl_info_ul *) msg->l1h; - cr = (struct l1ctl_crypto_req *) ul->payload; + ul = (const struct l1ctl_info_ul *)msg->l1h; + cr = (const struct l1ctl_crypto_req *)ul->payload; struct trxcon_param_crypto_req req = { .chan_nr = ul->chan_nr, @@ -764,10 +764,10 @@ int trxcon_l1ctl_receive(struct trxcon_inst *trxcon, struct msgb *msg) { - struct l1ctl_hdr *l1h; + const struct l1ctl_hdr *l1h; - l1h = (struct l1ctl_hdr *) msg->l1h; - msg->l1h = l1h->data; + l1h = (const struct l1ctl_hdr *)msg->l1h; + msg->l1h = (uint8_t *)l1h->data; switch (l1h->msg_type) { case L1CTL_FBSB_REQ: -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30451 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ife66b3c14f0ee2f29bf934db1f58512d52669b38 Gerrit-Change-Number: 30451 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: trxcon_fsm: permit loop [P]DCH transitions
by fixeria 05 Dec '22

05 Dec '22
Attention is currently required from: laforge, pespin, msuraev. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/30318 ) Change subject: trxcon: trxcon_fsm: permit loop [P]DCH transitions ...................................................................... Patch Set 6: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30318 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I3b402ec84610a5df744d9b06e5f7dab7a9a3ddad Gerrit-Change-Number: 30318 Gerrit-PatchSet: 6 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Mon, 05 Dec 2022 01:10:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-abis[master]: Initialize devinfo at misdn.c
by Jolly 04 Dec '22

04 Dec '22
Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30449 ) Change subject: Initialize devinfo at misdn.c ...................................................................... Initialize devinfo at misdn.c Valgrind did complain about use of uninitialized data. Change-Id: I3a60eee96366561acac9ccfc92eb0d6ca828b7b9 --- M src/input/misdn.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/49/30449/1 diff --git a/src/input/misdn.c b/src/input/misdn.c index 9018fad..580bee0 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -820,6 +820,7 @@ //LOGPIL(line, DLMI, LOGL_DEBUG, "%d device%s found\n", cnt, (cnt==1)?"":"s"); printf("%d device%s found\n", cnt, (cnt==1)?"":"s"); #if 1 + memset(&devinfo, 0, sizeof(devinfo)); devinfo.id = line->port_nr; ret = ioctl(sk, IMGETDEVINFO, &devinfo); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30449 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I3a60eee96366561acac9ccfc92eb0d6ca828b7b9 Gerrit-Change-Number: 30449 Gerrit-PatchSet: 1 Gerrit-Owner: Jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-abis[master]: Send raw data with mISDN as it arrives from application
by Jolly 04 Dec '22

04 Dec '22
Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30450 ) Change subject: Send raw data with mISDN as it arrives from application ...................................................................... Send raw data with mISDN as it arrives from application The application is responsible to send raw data in sync with the raw data it receives. It also cares about sending data in advance, to prevent underruns, if required Change-Id: Ib311331fbbeff3661f6745e3474918987a8aa460 --- M src/input/misdn.c 1 file changed, 5 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/50/30450/1 diff --git a/src/input/misdn.c b/src/input/misdn.c index 580bee0..00627f3 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -392,7 +392,7 @@ } /* write to a raw channel TS */ -static int handle_ts_raw_write(struct osmo_fd *bfd, unsigned int len) +static int handle_ts_raw_write(struct osmo_fd *bfd) { struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; @@ -403,14 +403,9 @@ /* get the next msg for this timeslot */ msg = e1inp_tx_ts(e1i_ts, NULL); - if (!msg) + if (!msg) { + osmo_fd_write_disable(bfd); return 0; - - if (msg->len != len) { - /* This might lead to a transmit underrun, as we call tx - * from the rx path, as there's no select/poll on dahdi - * */ - LOGPITS(e1i_ts, DLINP, LOGL_NOTICE, "unexpected msg->len = %u, expected %u\n", msg->len, len); } LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "RAW CHAN TX: %s\n", osmo_hexdump(msg->data, msg->len)); @@ -460,8 +455,6 @@ msg->l2h = msg->data; LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "RAW CHAN RX: %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); - /* the number of bytes received indicates that data to send */ - handle_ts_raw_write(bfd, msgb_l2len(msg)); return e1inp_rx_ts(e1i_ts, msg, 0, 0); case PH_ACTIVATE_IND: case PH_DATA_CNF: @@ -586,9 +579,8 @@ case E1INP_TS_TYPE_RAW: if (what & OSMO_FD_READ) rc = handle_ts_raw_read(bfd); - /* We never include the mISDN B-Channel FD into the - * writeset, since it doesn't support poll() based - * write flow control */ + if (what & OSMO_FD_WRITE) + rc = handle_ts_raw_write(bfd); break; case E1INP_TS_TYPE_HDLC: if (what & OSMO_FD_READ) -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30450 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ib311331fbbeff3661f6745e3474918987a8aa460 Gerrit-Change-Number: 30450 Gerrit-PatchSet: 1 Gerrit-Owner: Jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-abis[master]: Fix support for HDLC/RAW type channels at mISDN.c
by Jolly 04 Dec '22

04 Dec '22
Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30446 ) Change subject: Fix support for HDLC/RAW type channels at mISDN.c ...................................................................... Fix support for HDLC/RAW type channels at mISDN.c Change-Id: Ie9a2a3f6ae1ad7da1711b6ff2f0aeda39839a427 --- M include/osmocom/abis/e1_input.h M src/input/misdn.c 2 files changed, 100 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/46/30446/1 diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index 91a71e1..a466ef6 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -116,6 +116,8 @@ void (*recv_cb)(struct e1inp_ts *ts, struct msgb *msg); /* queue of pending to-be-transmitted msgbs */ struct llist_head tx_queue; + /* flag to indicate that packet is not yet confirmed by mISDN */ + int unconfirmed; } hdlc; struct { struct osmo_i460_timeslot i460_ts; diff --git a/src/input/misdn.c b/src/input/misdn.c index 874b627..892ff3f 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -430,7 +430,7 @@ struct e1inp_line *line = bfd->data; unsigned int ts_nr = bfd->priv_nr; struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; - struct msgb *msg = msgb_alloc(TSX_ALLOC_SIZE, "mISDN Tx RAW"); + struct msgb *msg = msgb_alloc(TSX_ALLOC_SIZE, "mISDN TS RAW"); struct mISDNhead *hh; int ret; @@ -471,6 +471,89 @@ return ret; } +/* write to a hdlc channel TS */ +static int handle_ts_hdlc_write(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + unsigned int ts_nr = bfd->priv_nr; + struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; + struct msgb *msg; + struct mISDNhead *hh; + int ret; + + osmo_fd_write_disable(bfd); + + if (e1i_ts->hdlc.unconfirmed) + return 0; + + /* get the next msg for this timeslot */ + msg = e1inp_tx_ts(e1i_ts, NULL); + if (!msg) + return 0; + + LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "HDLC CHAN TX: %s\n", osmo_hexdump(msg->data, msg->len)); + + hh = (struct mISDNhead *) msgb_push(msg, sizeof(*hh)); + hh->prim = PH_DATA_REQ; + hh->id = 0; + + ret = write(bfd->fd, msg->data, msg->len); + if (ret < msg->len) + LOGPITS(e1i_ts, DLINP, LOGL_DEBUG, "send returns %d instead of %d\n", ret, msg->len); + msgb_free(msg); + + e1i_ts->hdlc.unconfirmed = 1; + + return ret; +} + +static int handle_ts_hdlc_read(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + unsigned int ts_nr = bfd->priv_nr; + struct e1inp_ts *e1i_ts = &line->ts[ts_nr-1]; + struct msgb *msg = msgb_alloc(TSX_ALLOC_SIZE, "mISDN TS HDLC"); + struct mISDNhead *hh; + int ret; + + if (!msg) + return -ENOMEM; + + hh = (struct mISDNhead *) msg->data; + + ret = recv(bfd->fd, msg->data, TSX_ALLOC_SIZE, 0); + if (ret < 0) { + fprintf(stderr, "recvfrom error %s\n", strerror(errno)); + return ret; + } + + msgb_put(msg, ret); + + if (hh->prim != PH_CONTROL_IND) + LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "<= HDLC CHAN len = %d, prim(0x%x) id(0x%x): %s\n", + ret, hh->prim, hh->id, get_value_string(prim_names, hh->prim)); + + switch (hh->prim) { + case PH_DATA_IND: + msg->l2h = msg->data + MISDN_HEADER_LEN; + LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "HDLC CHAN RX: %s\n", + osmo_hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN)); + return e1inp_rx_ts(e1i_ts, msg, 0, 0); + case PH_ACTIVATE_IND: + break; + case PH_DATA_CNF: + e1i_ts->hdlc.unconfirmed = 0; + osmo_fd_write_enable(bfd); + break; + default: + break; + } + /* FIXME: why do we free signalling msgs in the caller, and trau not? */ + msgb_free(msg); + + return ret; +} + /* callback from select.c in case one of the fd's can be read/written */ static int misdn_fd_cb(struct osmo_fd *bfd, unsigned int what) { @@ -501,6 +584,12 @@ * writeset, since it doesn't support poll() based * write flow control */ break; + case E1INP_TS_TYPE_HDLC: + if (what & OSMO_FD_READ) + rc = handle_ts_hdlc_read(bfd); + if (what & OSMO_FD_WRITE) + rc = handle_ts_hdlc_write(bfd); + break; default: fprintf(stderr, "unknown E1 TS type %u\n", e1i_ts->type); break; @@ -598,8 +687,9 @@ continue; break; case E1INP_TS_TYPE_HDLC: + /* TS 16 is the D-channel, so we use D-channel proto */ bfd->fd = socket(PF_ISDN, SOCK_DGRAM, - ISDN_P_B_HDLC); + (ts == 16) ? ISDN_P_NT_E1 : ISDN_P_B_HDLC); bfd->when = OSMO_FD_READ; break; case E1INP_TS_TYPE_SIGN: @@ -649,8 +739,10 @@ } break; case E1INP_TS_TYPE_HDLC: + case E1INP_TS_TYPE_RAW: case E1INP_TS_TYPE_TRAU: - addr.channel = ts; + /* TS 16 is D-channel, so we use channel 0 */ + addr.channel = (ts == 16) ? 0 : ts; break; default: LOGPITS(e1i_ts, DLMI, LOGL_ERROR, "unsupported E1 TS type: %u\n", e1i_ts->type); @@ -677,7 +769,9 @@ /* FIXME: only activate B-Channels once we start to * use them to conserve CPU power */ - if (e1i_ts->type == E1INP_TS_TYPE_TRAU) + if (e1i_ts->type == E1INP_TS_TYPE_HDLC + || e1i_ts->type == E1INP_TS_TYPE_RAW + || e1i_ts->type == E1INP_TS_TYPE_TRAU) activate_bchan(line, ts, 1); osmo_fd_setup(bfd, bfd->fd, bfd->when, misdn_fd_cb, line, ts); -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30446 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ie9a2a3f6ae1ad7da1711b6ff2f0aeda39839a427 Gerrit-Change-Number: 30446 Gerrit-PatchSet: 1 Gerrit-Owner: Jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-abis[master]: Add missing functions to send HDLC/RAW data
by Jolly 04 Dec '22

04 Dec '22
Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30447 ) Change subject: Add missing functions to send HDLC/RAW data ...................................................................... Add missing functions to send HDLC/RAW data Change-Id: Iebcb99f491b945d364b1044a59638524637dd8b2 --- M include/osmocom/abis/e1_input.h M src/e1_input.c 2 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/47/30447/1 diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index a466ef6..919c2f5 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -365,4 +365,7 @@ int abis_sendmsg(struct msgb *msg); int abis_rsl_sendmsg(struct msgb *msg); +int e1inp_ts_send_raw(struct e1inp_ts *ts, struct msgb *msg); +int e1inp_ts_send_hdlc(struct e1inp_ts *ts, struct msgb *msg); + #endif /* _E1_INPUT_H */ diff --git a/src/e1_input.c b/src/e1_input.c index ee529cc..6dd9374 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -331,6 +331,36 @@ return abis_sendmsg(msg); } +int e1inp_ts_send_raw(struct e1inp_ts *ts, struct msgb *msg) +{ + struct e1inp_driver *driver; + + OSMO_ASSERT(ts->type == E1INP_TS_TYPE_RAW); + + /* notify the driver we have something to write */ + driver = ts->line->driver; + driver->want_write(ts); + + msgb_enqueue(&ts->raw.tx_queue, msg); + + return 0; +} + +int e1inp_ts_send_hdlc(struct e1inp_ts *ts, struct msgb *msg) +{ + struct e1inp_driver *driver; + + OSMO_ASSERT(ts->type == E1INP_TS_TYPE_HDLC); + + /* notify the driver we have something to write */ + driver = ts->line->driver; + driver->want_write(ts); + + msgb_enqueue(&ts->hdlc.tx_queue, msg); + + return 0; +} + /* Timeslot */ int e1inp_ts_config_trau(struct e1inp_ts *ts, struct e1inp_line *line, int (*trau_rcv_cb)(struct subch_demux *dmx, int ch, -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30447 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Iebcb99f491b945d364b1044a59638524637dd8b2 Gerrit-Change-Number: 30447 Gerrit-PatchSet: 1 Gerrit-Owner: Jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-abis[master]: Remove mISDN header from received channel data
by Jolly 04 Dec '22

04 Dec '22
Jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30448 ) Change subject: Remove mISDN header from received channel data ...................................................................... Remove mISDN header from received channel data Change-Id: I37f12baa1013cd1cfc6f6531b132669071eec926 --- M src/input/misdn.c 1 file changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/48/30448/1 diff --git a/src/input/misdn.c b/src/input/misdn.c index 892ff3f..9018fad 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -371,9 +371,11 @@ switch (hh->prim) { case PH_DATA_IND: - msg->l2h = msg->data + MISDN_HEADER_LEN; + /* remove the Misdn Header */ + msgb_pull(msg, MISDN_HEADER_LEN); + msg->l2h = msg->data; LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "BCHAN RX: %s\n", - osmo_hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN)); + osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); /* the number of bytes received indicates that data to send */ handle_tsX_write(bfd, msgb_l2len(msg)); return e1inp_rx_ts(e1i_ts, msg, 0, 0); @@ -453,9 +455,11 @@ switch (hh->prim) { case PH_DATA_IND: - msg->l2h = msg->data + MISDN_HEADER_LEN; + /* remove the Misdn Header */ + msgb_pull(msg, MISDN_HEADER_LEN); + msg->l2h = msg->data; LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "RAW CHAN RX: %s\n", - osmo_hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN)); + osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); /* the number of bytes received indicates that data to send */ handle_ts_raw_write(bfd, msgb_l2len(msg)); return e1inp_rx_ts(e1i_ts, msg, 0, 0); @@ -535,9 +539,11 @@ switch (hh->prim) { case PH_DATA_IND: - msg->l2h = msg->data + MISDN_HEADER_LEN; + /* remove the Misdn Header */ + msgb_pull(msg, MISDN_HEADER_LEN); + msg->l2h = msg->data; LOGPITS(e1i_ts, DLMIB, LOGL_DEBUG, "HDLC CHAN RX: %s\n", - osmo_hexdump(msgb_l2(msg), ret - MISDN_HEADER_LEN)); + osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); return e1inp_rx_ts(e1i_ts, msg, 0, 0); case PH_ACTIVATE_IND: break; -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/30448 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: I37f12baa1013cd1cfc6f6531b132669071eec926 Gerrit-Change-Number: 30448 Gerrit-PatchSet: 1 Gerrit-Owner: Jolly <andreas(a)eversberg.eu> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • ...
  • 198
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.