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

May 2023

  • 1 participants
  • 2583 discussions
[S] Change in libosmo-netif[arehbein/osmo_io_ipa]: stream: Adapt to new changes
by arehbein 21 May '23

21 May '23
arehbein has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/32809 ) Change subject: stream: Adapt to new changes ...................................................................... stream: Adapt to new changes - adapt to def. of struct osmo_io_ops - eliminate compiler warnings due to change in callback signature Requires change I6a0eebb8d4490f09a3cc6eb97d4ff47b4a8fd377 Related: OS#5753 Change-Id: I5f9a5ce85efb4ed512ff6ca1f3e170d2ffb2ba22 --- M src/stream.c 1 file changed, 19 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/09/32809/1 diff --git a/src/stream.c b/src/stream.c index d61a8d6..98a4be9 100644 --- a/src/stream.c +++ b/src/stream.c @@ -88,7 +88,7 @@ //static int (*segmentation_cbs[_NUM_OSMO_STREAM_PROTOS][_NUM_CB_TYPES])(struct msgb *, int) = { // [OSMO_STREAM_IPAC][CB_TYPE_SEGM] = ipa_segmentation_cb, -static int (*segmentation_cbs[_NUM_OSMO_STREAM_PROTOS])(struct msgb *, int) = { +static int (*segmentation_cbs[_NUM_OSMO_STREAM_PROTOS])(struct msgb *) = { [OSMO_STREAM_IPAC] = ipa_segmentation_cb, }; @@ -655,7 +655,7 @@ } } -static void stream_cli_iofd_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +static void stream_cli_iofd_write_cb(struct osmo_io_fd *iofd, int res, const struct msgb *msg) { struct osmo_stream_cli *cli = osmo_iofd_get_data(iofd); @@ -677,10 +677,6 @@ static struct osmo_io_ops osmo_stream_cli_ioops = { .read_cb = stream_cli_iofd_read_cb, .write_cb = stream_cli_iofd_write_cb, - - .sendmsg_cb = NULL, - .recvmsg_cb = NULL, - .segmentation_cb = NULL, }; @@ -1427,7 +1423,7 @@ return; } -static void stream_srv_iofd_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +static void stream_srv_iofd_write_cb(struct osmo_io_fd *iofd, int res, const struct msgb *msg) { struct osmo_stream_srv *conn = osmo_iofd_get_data(iofd); LOGP(DLINP, LOGL_DEBUG, "connected write\n"); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/32809 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I5f9a5ce85efb4ed512ff6ca1f3e170d2ffb2ba22 Gerrit-Change-Number: 32809 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-netif[arehbein/osmo_io_ipa]: stream: Fix endless loop on server on client disconnect
by arehbein 21 May '23

21 May '23
arehbein has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/32810 ) Change subject: stream: Fix endless loop on server on client disconnect ...................................................................... stream: Fix endless loop on server on client disconnect Not sure why, but select() keeps reporting read events it seems, even though the client doesn't send any packets anymore. Without this line, the server gets stuck in an endless read loop with zero bytes read because of that. Change-Id: I012ddf14ae17642a52d34026d85ab6958cf488a1 --- M src/stream.c 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/10/32810/1 diff --git a/src/stream.c b/src/stream.c index 98a4be9..421c951 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1409,6 +1409,7 @@ if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) { LOGP(DLINP, LOGL_DEBUG, "Connection is being flushed and closed; ignoring received message\n"); msgb_free(msg); + osmo_stream_srv_destroy(conn); return; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/32810 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I012ddf14ae17642a52d34026d85ab6958cf488a1 Gerrit-Change-Number: 32810 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: coding: declare gsm0503_tch_f96_[de]interleave()
by falconia 20 May '23

20 May '23
Attention is currently required from: fixeria. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32807 ) Change subject: coding: declare gsm0503_tch_f96_[de]interleave() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32807 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9a631db088a4e279668beb962c98cc1a0929f44d Gerrit-Change-Number: 32807 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: falconia <falcon(a)freecalypso.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 20 May 2023 20:01:10 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: coding: gsm0503_tch_f96_[de]interleave() not applicable to TCH/F2.4
by falconia 20 May '23

20 May '23
Attention is currently required from: fixeria. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32806 ) Change subject: coding: gsm0503_tch_f96_[de]interleave() not applicable to TCH/F2.4 ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I52078263cd593503a9e8f024e51e18d7b0906131 Gerrit-Change-Number: 32806 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: falconia <falcon(a)freecalypso.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 20 May 2023 20:00:25 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: coding: use GSM_MACBLOCK_LEN gsm0503_tch_fr_decode()
by falconia 20 May '23

20 May '23
Attention is currently required from: fixeria. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32805 ) Change subject: coding: use GSM_MACBLOCK_LEN gsm0503_tch_fr_decode() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I488ca3db1ca093d19abcfba78c1516509870715d Gerrit-Change-Number: 32805 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: falconia <falcon(a)freecalypso.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sat, 20 May 2023 19:59:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: coding: declare gsm0503_tch_f96_[de]interleave()
by fixeria 20 May '23

20 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32807 ) Change subject: coding: declare gsm0503_tch_f96_[de]interleave() ...................................................................... coding: declare gsm0503_tch_f96_[de]interleave() Change-Id: I9a631db088a4e279668beb962c98cc1a0929f44d Related: OS#1572 --- M include/osmocom/coding/gsm0503_interleaving.h 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/07/32807/1 diff --git a/include/osmocom/coding/gsm0503_interleaving.h b/include/osmocom/coding/gsm0503_interleaving.h index 05b5e27..fab4d3d 100644 --- a/include/osmocom/coding/gsm0503_interleaving.h +++ b/include/osmocom/coding/gsm0503_interleaving.h @@ -58,4 +58,7 @@ void gsm0503_mcs8_dl_interleave(const ubit_t *hc, const ubit_t *c1, const ubit_t *c2, ubit_t *hi, ubit_t *di); +void gsm0503_tch_f96_deinterleave(sbit_t *cB, const sbit_t *iB); +void gsm0503_tch_f96_interleave(const ubit_t *cB, ubit_t *iB); + /*! @} */ -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32807 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I9a631db088a4e279668beb962c98cc1a0929f44d Gerrit-Change-Number: 32807 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: coding: gsm0503_tch_f96_[de]interleave() not applicable to TCH/F2.4
by fixeria 20 May '23

20 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32806 ) Change subject: coding: gsm0503_tch_f96_[de]interleave() not applicable to TCH/F2.4 ...................................................................... coding: gsm0503_tch_f96_[de]interleave() not applicable to TCH/F2.4 According to 3GPP TS 45.003, section 3.6.4, the interleaving for TCH/F2.4 is done as specified for the TCH/FS in subclause 3.1.3. Change-Id: I52078263cd593503a9e8f024e51e18d7b0906131 Related: OS#1572 --- M src/coding/gsm0503_interleaving.c 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/32806/1 diff --git a/src/coding/gsm0503_interleaving.c b/src/coding/gsm0503_interleaving.c index cd2f235..570d65a 100644 --- a/src/coding/gsm0503_interleaving.c +++ b/src/coding/gsm0503_interleaving.c @@ -700,7 +700,7 @@ * of coded data starts with every fourth burst and is distributed over * 22 bursts. * - * Also used for TCH/F4.8, TCH/H4.8, TCH/F2.4 and TCH/H2.4 and TCH/F14.4 */ + * Also used for TCH/F4.8, TCH/H4.8, and TCH/H2.4 and TCH/F14.4 */ void gsm0503_tch_f96_interleave(const ubit_t *cB, ubit_t *iB) { int j, k, B; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32806 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I52078263cd593503a9e8f024e51e18d7b0906131 Gerrit-Change-Number: 32806 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: coding: use GSM_MACBLOCK_LEN gsm0503_tch_fr_decode()
by fixeria 20 May '23

20 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32805 ) Change subject: coding: use GSM_MACBLOCK_LEN gsm0503_tch_fr_decode() ...................................................................... coding: use GSM_MACBLOCK_LEN gsm0503_tch_fr_decode() Change-Id: I488ca3db1ca093d19abcfba78c1516509870715d Related: OS#1572 --- M src/coding/gsm0503_coding.c 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/32805/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 1ef6393..3fd440f 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -1860,7 +1860,7 @@ return -1; } - return 23; + return GSM_MACBLOCK_LEN; } osmo_conv_decode_ber(&gsm0503_tch_fr, cB, conv, n_errors, n_bits_total); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32805 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I488ca3db1ca093d19abcfba78c1516509870715d Gerrit-Change-Number: 32805 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in libosmocore[master]: coding: implement TCH/F9.6, TCH/[FH]4.8, TCH/F14.4
by fixeria 20 May '23

20 May '23
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/32808 ) Change subject: coding: implement TCH/F9.6, TCH/[FH]4.8, TCH/F14.4 ...................................................................... coding: implement TCH/F9.6, TCH/[FH]4.8, TCH/F14.4 Implement all CSD specific channel modes, except TCH/{FH}2.4. The later is slightly more complicated and can be added later. It's not yet clear to me how to implement FACCH/[FH] for these new CSD specific channel modes. According to 3GPP TS 45.003, sections 4.2.5 and 4.3.5, a FACCH/[FH] does not steal but disturb some part of the CSD data blocks. Leaving this as TODO. Change-Id: Ib482817b5f6a4e3c7299f6e0b3841143b60fc93d Related: OS#1572 --- M include/osmocom/coding/gsm0503_coding.h M src/coding/gsm0503_coding.c M src/coding/libosmocoding.map 3 files changed, 284 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/08/32808/1 diff --git a/include/osmocom/coding/gsm0503_coding.h b/include/osmocom/coding/gsm0503_coding.h index 2afa049..67efcf1 100644 --- a/include/osmocom/coding/gsm0503_coding.h +++ b/include/osmocom/coding/gsm0503_coding.h @@ -86,4 +86,20 @@ int gsm0503_sch_encode(ubit_t *burst, const uint8_t *sb_info); int gsm0503_sch_decode(uint8_t *sb_info, const sbit_t *burst); +int gsm0503_tch_fr96_encode(sbit_t *bursts, const uint8_t *data); +int gsm0503_tch_fr96_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total); + +int gsm0503_tch_fr48_encode(sbit_t *bursts, const uint8_t *data); +int gsm0503_tch_fr48_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total); + +int gsm0503_tch_hr48_encode(sbit_t *bursts, const uint8_t *data); +int gsm0503_tch_hr48_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total); + +int gsm0503_tch_fr144_encode(sbit_t *bursts, const uint8_t *data); +int gsm0503_tch_fr144_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total); + /*! @} */ diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 3fd440f..dab961d 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -3265,4 +3265,245 @@ return 0; } +/* + * GSM CSD transcoding + */ + +/*! Perform channel encoding of a TCH/F9.6 channel as per section 3.3. + * \param[out] bursts Caller-allocated buffer for symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[in] data Data to be encoded (240 / 8 bytes). + * \returns 0 in case of success; negative on error */ +int gsm0503_tch_fr96_encode(sbit_t *bursts, const uint8_t *data) +{ + ubit_t iB[22 * 114], cB[4 * 114]; + ubit_t conv[244]; + + /* 3.3.2 Block code: b1(60) + b2(60) + b3(60) + b4(60) */ + osmo_pbit2ubit_ext(&conv[0], 0, &data[0], 0, 240, 1); + memset(&conv[240], 0, 4); /* + pad(4) */ + + /* 3.3.3 Convolutional encoder */ + osmo_conv_encode(&gsm0503_tch_f96, &conv[0], &cB[0]); + + /* 3.3.4 Interleaving */ + gsm0503_tch_f96_interleave(&cB[0], &iB[0]); + + /* 3.3.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ + for (unsigned int i = 0; i < 22; i++) { + memcpy(&bursts[i * 116], &iB[i * 114], 57); + memcpy(&bursts[i * 116 + 59], &iB[i * 114 + 57], 57); + /* TODO: properly set hl(B) or hu(B) for FACCH */ + } + + return 0; +} + +/*! Perform channel decoding of a TCH/F9.6 channel as per section 3.3. + * \param[out] data Caller-allocated buffer for decoded data. + * \param[in] bursts Buffer containing the symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[out] n_errors Number of detected bit errors. + * \param[out] n_bits_total Total number of bits. + * \returns Length of bytes used in \a data output buffer; negative on error. */ +int gsm0503_tch_fr96_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total) +{ + sbit_t iB[22 * 114], cB[4 * 114]; + ubit_t conv[244]; + + /* 3.3.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ + for (unsigned int i = 0; i < 22; i++) { + memcpy(&iB[i * 114], &bursts[i * 116], 57); + memcpy(&iB[i * 114 + 57], &bursts[i * 116 + 59], 57); + /* TODO: check hl(B) or hu(B) for FACCH */ + } + + /* 3.3.4 Interleaving */ + gsm0503_tch_f96_deinterleave(&cB[0], &iB[0]); + + /* TODO: implement FACCH decoding */ + + /* 3.3.3 Convolutional encoder */ + osmo_conv_decode_ber(&gsm0503_tch_f96, &cB[0], &conv[0], n_errors, n_bits_total); + + /* 3.3.2 Block code: b1(60) + b2(60) + b3(60) + b4(60) */ + osmo_ubit2pbit_ext(&data[0], 0, &conv[0], 0, 240, 1); + + return 240 / 8; +} + +/*! Perform channel encoding of a TCH/F4.8 channel as per section 3.4. + * \param[out] bursts Caller-allocated buffer for symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[in] data Data to be encoded (120 / 8 bytes). + * \returns 0 in case of success; negative on error */ +int gsm0503_tch_fr48_encode(sbit_t *bursts, const uint8_t *data) +{ + ubit_t iB[22 * 114], cB[4 * 114]; + ubit_t conv[120 + 32], d[2 * 60]; + + /* 3.4.2 Block code: + * + * Sixteen bits equal to 0 are added to the 60 information bits, the result + * being a block of 76 bits, {u(0),u(1),...,u(75)}, with: + * + * u(19k+p) = d(15k+p) for k = 0,1,2,3 and p = 0,1,...,14; + * u(19k+p) = 0 for k = 0,1,2,3 and p = 15,16,17,18. + * + * Two such blocks forming a block of 152 bits: u1 + u2. */ + osmo_pbit2ubit_ext(&d[0], 0, &data[0], 0, 2 * 60, 1); + for (unsigned int k = 0; k < 2 * 4; k++) { + memcpy(&conv[19 * k], &d[15 * k], 15); + memset(&conv[19 * k + 15], 0, 4); + } + + /* 3.4.3 Convolutional encoder */ + osmo_conv_encode(&gsm0503_tch_f48, &conv[0], &cB[0]); + + /* 3.4.4 Interleaving: as specified for the TCH/F9.6 in subclause 3.3.4 */ + gsm0503_tch_f96_interleave(&cB[0], &iB[0]); + + /* 3.4.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ + for (unsigned int i = 0; i < 22; i++) { + memcpy(&bursts[i * 116], &iB[i * 114], 57); + memcpy(&bursts[i * 116 + 59], &iB[i * 114 + 57], 57); + /* TODO: properly set hl(B) or hu(B) for FACCH */ + } + + return 0; +} + +/*! Perform channel decoding of a TCH/F4.8 channel as per section 3.4. + * \param[out] data Caller-allocated buffer for decoded data. + * \param[in] bursts Buffer containing the symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[out] n_errors Number of detected bit errors. + * \param[out] n_bits_total Total number of bits. + * \returns Length of bytes used in \a data output buffer; negative on error. */ +int gsm0503_tch_fr48_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total) +{ + sbit_t iB[22 * 114], cB[4 * 114]; + ubit_t conv[120 + 32], d[2 * 60]; + + /* 3.4.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ + for (unsigned int i = 0; i < 22; i++) { + memcpy(&iB[i * 114], &bursts[i * 116], 57); + memcpy(&iB[i * 114 + 57], &bursts[i * 116 + 59], 57); + /* TODO: check hl(B) or hu(B) for FACCH */ + } + + /* 3.4.4 Interleaving: as specified for the TCH/F9.6 in subclause 3.3.4 */ + gsm0503_tch_f96_deinterleave(&cB[0], &iB[0]); + + /* TODO: implement FACCH decoding */ + + /* 3.4.3 Convolutional encoder */ + osmo_conv_decode_ber(&gsm0503_tch_f48, &cB[0], &conv[0], n_errors, n_bits_total); + + /* 3.4.2 Block code: + * + * Sixteen bits equal to 0 are added to the 60 information bits, the result + * being a block of 76 bits, {u(0),u(1),...,u(75)}, with: + * + * u(19k+p) = d(15k+p) for k = 0,1,2,3 and p = 0,1,...,14; + * u(19k+p) = 0 for k = 0,1,2,3 and p = 15,16,17,18. + * + * Two such blocks forming a block of 152 bits: u1 + u2. */ + for (unsigned int k = 0; k < 2 * 4; k++) + memcpy(&d[15 * k], &conv[19 * k], 15); + osmo_ubit2pbit_ext(&data[0], 0, &d[0], 0, 2 * 60, 1); + + return (2 * 60) / 8; +} + +/*! Perform channel encoding of a TCH/H4.8 channel as per section 3.5. + * \param[out] bursts Caller-allocated buffer for symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[in] data Data to be encoded (240 / 8 bytes). + * \returns 0 in case of success; negative on error */ +int gsm0503_tch_hr48_encode(sbit_t *bursts, const uint8_t *data) +{ + return gsm0503_tch_fr96_encode(bursts, data); +} + +/*! Perform channel decoding of a TCH/H4.8 channel as per section 3.5. + * The algorithm is identical to TCH/F9.6, so it's just a wrapper. + * \param[out] data Caller-allocated buffer for decoded data. + * \param[in] bursts Buffer containing the symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[out] n_errors Number of detected bit errors. + * \param[out] n_bits_total Total number of bits. + * \returns Length of bytes used in \a data output buffer; negative on error. */ +int gsm0503_tch_hr48_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total) +{ + return gsm0503_tch_fr96_decode(data, bursts, n_errors, n_bits_total); +} + +/*! Perform channel encoding of a TCH/F14.4 channel as per section 3.8. + * \param[out] bursts Caller-allocated buffer for symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[in] data Data to be encoded (296 / 8 bytes). + * \returns 0 in case of success; negative on error */ +int gsm0503_tch_fr144_encode(sbit_t *bursts, const uint8_t *data) +{ + ubit_t iB[22 * 114], cB[4 * 114]; + ubit_t conv[294]; + + /* 3.8.2 Block code: b(290) + pad(4) */ + osmo_pbit2ubit_ext(&conv[0], 0, &data[0], 0, 290, 1); + memset(&conv[290], 0, 4); /* + pad(4) */ + + /* 3.8.3 Convolutional encoder */ + osmo_conv_encode(&gsm0503_tch_f144, &conv[0], &cB[0]); + + /* 3.8.4 Interleaving */ + gsm0503_tch_f96_interleave(&cB[0], &iB[0]); + + /* 3.8.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ + for (unsigned int i = 0; i < 22; i++) { + memcpy(&bursts[i * 116], &iB[i * 114], 57); + memcpy(&bursts[i * 116 + 59], &iB[i * 114 + 57], 57); + /* TODO: properly set hl(B) or hu(B) for FACCH */ + } + + return 0; +} + +/*! Perform channel decoding of a TCH/14.4 channel as per section 3.8. + * \param[out] data Caller-allocated buffer for decoded data. + * \param[in] bursts Buffer containing the symbols of 22 bursts, + * 22 * 2 * 58 == 2552 bits total. + * \param[out] n_errors Number of detected bit errors. + * \param[out] n_bits_total Total number of bits. + * \returns Length of bytes used in \a data output buffer; negative on error. */ +int gsm0503_tch_fr144_decode(uint8_t *data, const sbit_t *bursts, + int *n_errors, int *n_bits_total) +{ + sbit_t iB[22 * 114], cB[4 * 114]; + ubit_t conv[294]; + + /* 3.8.5 Mapping on a burst: as specified for TCH/FS in subclause 3.1.4 */ + for (unsigned int i = 0; i < 22; i++) { + memcpy(&iB[i * 114], &bursts[i * 116], 57); + memcpy(&iB[i * 114 + 57], &bursts[i * 116 + 59], 57); + /* TODO: check hl(B) or hu(B) for FACCH */ + } + + /* 3.8.4 Interleaving: as specified for the TCH/F9.6 in subclause 3.3.4 */ + gsm0503_tch_f96_deinterleave(&cB[0], &iB[0]); + + /* TODO: implement FACCH decoding */ + + /* 3.8.3 Convolutional encoder */ + osmo_conv_decode_ber(&gsm0503_tch_f144, &cB[0], &conv[0], n_errors, n_bits_total); + + /* 3.8.2 Block code: b(290) + pad(4) */ + osmo_ubit2pbit_ext(&data[0], 0, &conv[0], 0, 290, 1); + + return (290 + 6) / 8; /* 6 unused bits */ +} + /*! @} */ diff --git a/src/coding/libosmocoding.map b/src/coding/libosmocoding.map index ff6ea80..aba7453 100644 --- a/src/coding/libosmocoding.map +++ b/src/coding/libosmocoding.map @@ -128,5 +128,14 @@ gsm0503_detect_afs_dtx_frame2; gsm0503_detect_ahs_dtx_frame2; +gsm0503_tch_fr96_encode; +gsm0503_tch_fr96_decode; +gsm0503_tch_fr48_encode; +gsm0503_tch_fr48_decode; +gsm0503_tch_hr48_encode; +gsm0503_tch_hr48_decode; +gsm0503_tch_fr144_encode; +gsm0503_tch_fr144_decode; + local: *; }; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32808 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ib482817b5f6a4e3c7299f6e0b3841143b60fc93d Gerrit-Change-Number: 32808 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[L] Change in osmo-trx[master]: transceiver: pass cfg struct instead of args
by fixeria 20 May '23

20 May '23
Attention is currently required from: Hoernchen. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/32762 ) Change subject: transceiver: pass cfg struct instead of args ...................................................................... Patch Set 3: (4 comments) File Transceiver52M/device/lms/LMSDevice.h: https://gerrit.osmocom.org/c/osmo-trx/+/32762/comment/5909bfff_7fb9c9fd PS3, Line 110: LMSDevice(InterfaceType iface, const struct trx_cfg *cfg); tabs vs spaces inconsistency File Transceiver52M/device/uhd/UHDDevice.h: https://gerrit.osmocom.org/c/osmo-trx/+/32762/comment/26d4469d_9ed25620 PS3, Line 83: uhd_device(InterfaceType iface, const struct trx_cfg *cfg); tabs vs spaces inconsistency File Transceiver52M/device/usrp1/USRPDevice.h: https://gerrit.osmocom.org/c/osmo-trx/+/32762/comment/20dbbf00_a199214c PS3, Line 107: USRPDevice(InterfaceType iface, const struct trx_cfg *cfg); 2 spaces vs 4 spaces inconsistency? https://gerrit.osmocom.org/c/osmo-trx/+/32762/comment/5289a907_7df81c9f PS3, Line 120: return TX_WINDOW_USRP1; what a mix -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/32762 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I48386900d15ff4d770c70a4efc246d32f921904b Gerrit-Change-Number: 32762 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Comment-Date: Sat, 20 May 2023 08:13:42 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.