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

October 2022

  • 2 participants
  • 2331 discussions
Change in osmo-ttcn3-hacks[master]: mgw: Introduce test to validate Osmux<->RTP-AMR-BWE
by pespin 25 Oct '22

25 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29871 ) Change subject: mgw: Introduce test to validate Osmux<->RTP-AMR-BWE ...................................................................... mgw: Introduce test to validate Osmux<->RTP-AMR-BWE Related: SYS#6161 Change-Id: I974e265938da15639acae7e2c9c589d5784ae5c5 --- M library/AMR_Types.ttcn M mgw/MGCP_Test.ttcn 2 files changed, 60 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/29871/1 diff --git a/library/AMR_Types.ttcn b/library/AMR_Types.ttcn index 5586a20..f453234 100644 --- a/library/AMR_Types.ttcn +++ b/library/AMR_Types.ttcn @@ -67,4 +67,25 @@ external function dec_RTP_AMR_Hdr(in octetstring stream) return RTP_AMR_Hdr with { extension "prototype(convert) decode(RAW)" }; + +type record RTP_AMR_BWE_Hdr { + uint4_t cmr, + BIT1 f, + uint4_t ft, + BIT1 q +} with { variant "FIELDORDER(msb)" }; +template (value) RTP_AMR_BWE_Hdr ts_RTP_AMR_BWE_Hdr(template (value) uint4_t cmr, + template (value) uint4_t ft, + template (value) BIT1 q := '1'B, + template (value) BIT1 f := '0'B) := { + cmr := cmr, + f := f, + ft := ft, + q := q +} +external function enc_RTP_AMR_BWE_Hdr(in RTP_AMR_BWE_Hdr amr_hdr) return octetstring + with { extension "prototype(convert) encode(RAW)" }; +external function dec_RTP_AMR_BWE_Hdr(in octetstring stream) return RTP_AMR_BWE_Hdr + with { extension "prototype(convert) decode(RAW)" }; + } with { encode "RAW"} diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 5ff5247..3b49afc 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -1339,7 +1339,7 @@ return true; } - function f_TC_two_crcx_and_rtp_osmux(boolean bidir, + function f_TC_two_crcx_and_rtp_osmux(boolean bidir, boolean rtp_amr_oa, charstring local_ip_rtp, charstring remote_ip_rtp, charstring local_ip_osmux, charstring remote_ip_osmux) runs on dummy_CT { var RtpFlowData flow[2]; @@ -1350,15 +1350,35 @@ var MgcpCallId call_id := '1226'H; var integer tolerance := 0; + var octetstring amr_payload; + var charstring fmtp; + f_init(ep, true); + var AMRFT cmr := AMR_FT_0; + var AMRFT ft := AMR_FT_2; + if (rtp_amr_oa) { + fmtp := "octet-align=1"; + var RTP_AMR_Hdr amr_oa_hdr := valueof(ts_RTP_AMR_Hdr(enum2int(cmr), enum2int(ft))); + amr_payload := enc_RTP_AMR_Hdr(amr_oa_hdr) & + f_osmux_gen_expected_rx_rtp_payload(enum2int(ft), c_OsmuxemDefaultCfg.tx_fixed_payload); + } else { + fmtp := "octet-align=0"; + /* Convert OA to BWE: */ + var RTP_AMR_BWE_Hdr amr_bwe_hdr := valueof(ts_RTP_AMR_BWE_Hdr(enum2int(cmr), enum2int(ft))); + var bitstring amr_bwe_hdr_bits := substr(oct2bit(enc_RTP_AMR_BWE_Hdr(amr_bwe_hdr)), 0 , 10); + var bitstring amr_data_bits := oct2bit(f_osmux_gen_expected_rx_rtp_payload(enum2int(ft), c_OsmuxemDefaultCfg.tx_fixed_payload)); + var bitstring amr_payload_bits := amr_bwe_hdr_bits & substr(amr_data_bits, 0, f_amrft_payload_bits_len(enum2int(ft))); + amr_payload := bit2oct(f_pad_bit(amr_payload_bits, (lengthof(amr_payload_bits)+7)/8*8, '0'B)); + }; + /* from us to MGW */ flow[0] := valueof(t_RtpFlow(local_ip_rtp, remote_ip_rtp, 112, "AMR/8000")); flow[0].rtp_cfg := c_RtpemDefaultCfg flow[0].rtp_cfg.tx_payload_type := flow[0].pt; - /* 0014 is the ToC (CMR=AMR4.75) in front of AMR Payload in RTP Payload */ - flow[0].rtp_cfg.rx_fixed_payload := '0014'O & f_osmux_gen_expected_rx_rtp_payload(2 /* AMR_FT_2, 5.90 */, c_OsmuxemDefaultCfg.tx_fixed_payload); - flow[0].rtp_cfg.tx_fixed_payload := flow[0].rtp_cfg.rx_fixed_payload; + flow[0].rtp_cfg.rx_fixed_payload := amr_payload; + flow[0].rtp_cfg.tx_fixed_payload := amr_payload; + flow[0].fmtp := fmtp; /* bind local RTP emulation sockets */ flow[0].em.portnr := 10000; f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]); @@ -1409,30 +1429,39 @@ /* create one RTP and one OSmux emulations; create two connections on MGW EP, exchange some data */ testcase TC_two_crcx_and_rtp_osmux() runs on dummy_CT { - f_TC_two_crcx_and_rtp_osmux(false, mp_local_ipv4, mp_remote_ipv4, + f_TC_two_crcx_and_rtp_osmux(false, true, mp_local_ipv4, mp_remote_ipv4, mp_local_ipv4, mp_remote_ipv4); } /* create one RTP and one OSmux emulations; create two connections on MGW EP, * exchange some data in both directions */ testcase TC_two_crcx_and_rtp_osmux_bidir() runs on dummy_CT { - f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv4, mp_remote_ipv4, + f_TC_two_crcx_and_rtp_osmux(true, true, mp_local_ipv4, mp_remote_ipv4, mp_local_ipv4, mp_remote_ipv4); } + /* create one RTP and one OSmux emulations; create two connections on MGW EP, + * exchange some data in both directions. RTP side is configured to + * rx/rx AMR in bandwidth-efficient mode. */ + testcase TC_two_crcx_and_rtp_osmux_bidir_amr_bwe() runs on dummy_CT { + f_TC_two_crcx_and_rtp_osmux(true, false, mp_local_ipv4, mp_remote_ipv4, + mp_local_ipv4, mp_remote_ipv4); + } + + /* Same as TC_two_crcx_and_rtp_osmux_bidir, but using IPv6 */ testcase TC_two_crcx_and_rtp_osmux_bidir_ipv6() runs on dummy_CT { - f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv6, mp_remote_ipv6, + f_TC_two_crcx_and_rtp_osmux(true, true, mp_local_ipv6, mp_remote_ipv6, mp_local_ipv6, mp_remote_ipv6); } /* Same as TC_two_crcx_and_rtp_osmux_bidir, but using IPv4 (RTP) and IPv6 (Osmux) */ testcase TC_two_crcx_and_rtp_osmux_bidir_ipv4_ipv6() runs on dummy_CT { - f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv4, mp_remote_ipv4, + f_TC_two_crcx_and_rtp_osmux(true, true, mp_local_ipv4, mp_remote_ipv4, mp_local_ipv6, mp_remote_ipv6); } /* Same as TC_two_crcx_and_rtp_osmux_bidir, but using IPv6 (RTP) and IPv4 (Osmux) */ testcase TC_two_crcx_and_rtp_osmux_bidir_ipv6_ipv4() runs on dummy_CT { - f_TC_two_crcx_and_rtp_osmux(true, mp_local_ipv6, mp_remote_ipv6, + f_TC_two_crcx_and_rtp_osmux(true, true, mp_local_ipv6, mp_remote_ipv6, mp_local_ipv4, mp_remote_ipv4); } @@ -2915,6 +2944,7 @@ execute(TC_one_crcx_loopback_osmux()); execute(TC_two_crcx_and_rtp_osmux()); execute(TC_two_crcx_and_rtp_osmux_bidir()); + execute(TC_two_crcx_and_rtp_osmux_bidir_amr_bwe()); execute(TC_two_crcx_mdcx_and_rtp_osmux_wildcard()); execute(TC_two_crcx_mdcx_and_rtp_osmux_fixed()); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29871 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I974e265938da15639acae7e2c9c589d5784ae5c5 Gerrit-Change-Number: 29871 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: osmux: Generate AMR OA payload paddings bits as 0
by pespin 25 Oct '22

25 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29870 ) Change subject: osmux: Generate AMR OA payload paddings bits as 0 ...................................................................... osmux: Generate AMR OA payload paddings bits as 0 Some AMR format's payload size doesn't necessarily fit octet boundaries. When AMR octet-aligned is used, padding bits are appended at the end to fill the octet. Until this patch, the padding bits where set with whatever payload fill pattern was provided. Instead of doing so, better set the padding bits to 0 to avoid conflicts when checking the received paytload later on, since those bits are potentially be going to be set to 0 (eg when converting to bandwidth-efficient). Related: SYS#6161 Change-Id: I5bc68eb05c2f5500a259f4c73d14b51794f7f078 --- M library/AMR_Types.ttcn M library/OSMUX_Emulation.ttcn 2 files changed, 17 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/70/29870/1 diff --git a/library/AMR_Types.ttcn b/library/AMR_Types.ttcn index b4f044d..5586a20 100644 --- a/library/AMR_Types.ttcn +++ b/library/AMR_Types.ttcn @@ -33,7 +33,13 @@ const integer c_AMRFT_len[9] := {12, 13, 15, 17, 19, 20, 26, 31, 5}; function f_amrft_payload_len(INT4b amr_ft) return integer { - return c_AMRFT_len[amr_ft]; + return c_AMRFT_len[amr_ft]; +} + +const integer c_AMRFT_bits_len[9] := {95, 103, 118, 134, 148, 159, 204, 244, 39}; + +function f_amrft_payload_bits_len(INT4b amr_ft) return integer { + return c_AMRFT_bits_len[amr_ft]; } type record RTP_AMR_Hdr { diff --git a/library/OSMUX_Emulation.ttcn b/library/OSMUX_Emulation.ttcn index c6999de..25a7745 100644 --- a/library/OSMUX_Emulation.ttcn +++ b/library/OSMUX_Emulation.ttcn @@ -374,12 +374,20 @@ log2str("No Space in TxHandleList for ", hdl.cid)); } +/* Generatea correctly-sized AMR payload based on amr_ft, using tx_fixed_payload as a fill pattern. */ function f_osmux_gen_expected_rx_rtp_payload(INT4b amr_ft, octetstring tx_fixed_payload) return octetstring { + var integer payload_len_bits; var integer payload_len; + var bitstring payload_truncated_bits; var octetstring payload_truncated; - var integer i; + + /* Generate the AMR payload as a bitstring, since some formats dont'e dn up in octet boundary: */ + payload_len_bits := f_amrft_payload_bits_len(amr_ft); + payload_truncated_bits := substr(oct2bit(tx_fixed_payload), 0, payload_len_bits); + + /* Now convert it as an octet string filling final padding with zeroes: */ payload_len := f_amrft_payload_len(amr_ft); - payload_truncated := substr(tx_fixed_payload, 0, payload_len); + payload_truncated := bit2oct(f_pad_bit(payload_truncated_bits, payload_len*8, '0'B)); return payload_truncated; } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29870 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I5bc68eb05c2f5500a259f4c73d14b51794f7f078 Gerrit-Change-Number: 29870 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: jobs: add osmocom-obs-check-builders
by pespin 25 Oct '22

25 Oct '22
Attention is currently required from: osmith, laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29869 ) Change subject: jobs: add osmocom-obs-check-builders ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I6e7c1f206551722d6bfe1631b9c1da8d34d85ba8 Gerrit-Change-Number: 29869 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 25 Oct 2022 10:53:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ci[master]: jobs: add osmocom-obs-check-builders
by osmith 25 Oct '22

25 Oct '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29869 ) Change subject: jobs: add osmocom-obs-check-builders ...................................................................... jobs: add osmocom-obs-check-builders Add a job that checks if the amount of connected builders to the OBS server matches what we expect. This should prevent what we had today, that it only was noticed by chance several days after all builders failed to connect and the packages were outdated since then. I'm not sure if there is a proper api to do this check, but I don't expect the string we check for to change often so this should work fine. Change-Id: I6e7c1f206551722d6bfe1631b9c1da8d34d85ba8 --- A jobs/osmocom-obs-check-builders.yml A scripts/obs/check_builders.sh 2 files changed, 39 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/29869/1 diff --git a/jobs/osmocom-obs-check-builders.yml b/jobs/osmocom-obs-check-builders.yml new file mode 100644 index 0000000..f378ec1 --- /dev/null +++ b/jobs/osmocom-obs-check-builders.yml @@ -0,0 +1,28 @@ +--- +- project: + name: Osmocom_OBS_check_builders + jobs: + - Osmocom_OBS_check_builders + +- job-template: + name: 'Osmocom_OBS_check_builders' + project-type: freestyle + defaults: global + description: | + Verify that the expected amount of builders are connected to + obs.osmocom.org. + builders: + - shell: | + scripts/obs/check_builders.sh + scm: + - git: + branches: + - 'origin/master' + url: https://gerrit.osmocom.org/osmo-ci + triggers: + - timed: "@hourly" + node: obs + publishers: + - email: + notify-every-unstable-build: true + recipients: 'jenkins-notifications(a)lists.osmocom.org' diff --git a/scripts/obs/check_builders.sh b/scripts/obs/check_builders.sh new file mode 100755 index 0000000..609c467 --- /dev/null +++ b/scripts/obs/check_builders.sh @@ -0,0 +1,11 @@ +#!/bin/sh -ex +count=14 +wget -q https://obs.osmocom.org -O index.html + +if ! grep -q " of $count build hosts" index.html; then + grep "build hosts" index.html + set +x + echo + echo "ERROR: expected $count builders to be connected to OBS!" + echo +fi -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I6e7c1f206551722d6bfe1631b9c1da8d34d85ba8 Gerrit-Change-Number: 29869 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmocore[master]: Diversify osmo_sockaddr_str_*() error codes
by laforge 25 Oct '22

25 Oct '22
laforge has abandoned this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28996 ) Change subject: Diversify osmo_sockaddr_str_*() error codes ...................................................................... Abandoned Overwhelming negative votes, let's abandon this. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Ic1be25a076776de5b417cb5ac66f954ac5680e10 Gerrit-Change-Number: 28996 Gerrit-PatchSet: 6 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: abandon
1 0
0 0
Change in osmocom-bb[master]: trxcon: implement an abstract PHYIF API
by fixeria 25 Oct '22

25 Oct '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/29868 ) Change subject: trxcon: implement an abstract PHYIF API ...................................................................... trxcon: implement an abstract PHYIF API Change-Id: I3d7c717cfc3616809d22efb1903abbf843594258 --- M src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am A src/host/trxcon/include/osmocom/bb/trxcon/phyif.h M src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h M src/host/trxcon/src/trx_if.c M src/host/trxcon/src/trxcon.c M src/host/trxcon/src/trxcon_fsm.c 6 files changed, 298 insertions(+), 113 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/68/29868/1 diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am b/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am index 8636c93..c80721c 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am +++ b/src/host/trxcon/include/osmocom/bb/trxcon/Makefile.am @@ -3,6 +3,7 @@ l1ctl_server.h \ l1ctl.h \ sched_utils.h \ + phyif.h \ trx_if.h \ logging.h \ trxcon.h \ diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h b/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h new file mode 100644 index 0000000..8a8d859 --- /dev/null +++ b/src/host/trxcon/include/osmocom/bb/trxcon/phyif.h @@ -0,0 +1,83 @@ +#pragma once + +#include <stdint.h> + +#include <osmocom/core/bits.h> + +/* PHYIF command type */ +enum phyif_cmd_type { + PHYIF_CMDT_RESET, + PHYIF_CMDT_POWERON, + PHYIF_CMDT_POWEROFF, + PHYIF_CMDT_MEASURE, + PHYIF_CMDT_SETFREQ_H0, + PHYIF_CMDT_SETFREQ_H1, + PHYIF_CMDT_SETSLOT, + PHYIF_CMDT_SETTA, +}; + +/* param of PHYIF_CMDT_SETFREQ_H0 */ +struct phyif_cmdp_setfreq_h0 { + uint16_t band_arfcn; +}; + +/* param of PHYIF_CMDT_SETFREQ_H1 */ +struct phyif_cmdp_setfreq_h1 { + uint8_t hsn; + uint8_t maio; + const uint16_t *ma; + unsigned int ma_len; +}; + +/* param of PHYIF_CMDT_SETSLOT */ +struct phyif_cmdp_setslot { + uint8_t tn; + uint8_t pchan; /* enum gsm_phys_chan_config */ +}; + +/* param of PHYIF_CMDT_SETTA */ +struct phyif_cmdp_setta { + int8_t ta; /* intentionally signed */ +}; + +/* param of PHYIF_CMDT_MEASURE */ +struct phyif_cmdp_measure { + uint16_t band_arfcn_start; + uint16_t band_arfcn_stop; +}; + +struct phyif_cmd { + enum phyif_cmd_type type; + union { + struct phyif_cmdp_setfreq_h0 setfreq_h0; + struct phyif_cmdp_setfreq_h1 setfreq_h1; + struct phyif_cmdp_setslot setslot; + struct phyif_cmdp_setta setta; + struct phyif_cmdp_measure measure; + } param; +}; + +/* BURST.req - a burst to be transmitted */ +struct phyif_burst_req { + uint32_t fn; + uint8_t tn; + uint8_t pwr; + const ubit_t *burst; + unsigned int burst_len; +}; + +/* BURST.ind - a received burst */ +struct phyif_burst_ind { + uint32_t fn; + uint8_t tn; + int16_t toa256; + int8_t rssi; + sbit_t burst[148]; + unsigned int burst_len; +}; + + +int phyif_handle_burst_ind(void *phyif, const struct phyif_burst_ind *bi); +int phyif_handle_burst_req(void *phyif, const struct phyif_burst_req *br); +int phyif_handle_cmd(void *phyif, const struct phyif_cmd *cmd); +void phyif_close(void *phyif); diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h index 1faa610..9628f72 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/trx_if.h @@ -5,13 +5,12 @@ #include <osmocom/core/timer.h> #include <osmocom/core/fsm.h> -#include <osmocom/gsm/gsm_utils.h> +#include <osmocom/bb/trxcon/phyif.h> #define TRXC_BUF_SIZE 1024 #define TRXD_BUF_SIZE 512 /* Forward declaration to avoid mutual include */ -struct l1sched_burst_req; struct trxcon_inst; enum trx_fsm_states { @@ -51,25 +50,7 @@ struct trx_instance *trx_if_open(struct trxcon_inst *trxcon, const char *local_host, const char *remote_host, uint16_t port); -void trx_if_flush_ctrl(struct trx_instance *trx); void trx_if_close(struct trx_instance *trx); -int trx_if_cmd_poweron(struct trx_instance *trx); -int trx_if_cmd_poweroff(struct trx_instance *trx); -int trx_if_cmd_echo(struct trx_instance *trx); - -int trx_if_cmd_setta(struct trx_instance *trx, int8_t ta); - -int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t band_arfcn); -int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t band_arfcn); - -int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, - enum gsm_phys_chan_config pchan); -int trx_if_cmd_setfh(struct trx_instance *trx, uint8_t hsn, uint8_t maio, - const uint16_t *ma, size_t ma_len); - -int trx_if_cmd_measure(struct trx_instance *trx, - uint16_t band_arfcn_start, uint16_t band_arfcn_stop); - -int trx_if_tx_burst(struct trx_instance *trx, - const struct l1sched_burst_req *br); +int trx_if_handle_phyif_burst_req(struct trx_instance *trx, const struct phyif_burst_req *br); +int trx_if_handle_phyif_cmd(struct trx_instance *trx, const struct phyif_cmd *cmd); diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c index 6f225ee..b746161 100644 --- a/src/host/trxcon/src/trx_if.c +++ b/src/host/trxcon/src/trx_if.c @@ -4,6 +4,7 @@ * * Copyright (C) 2013 by Andreas Eversberg <jolly(a)eversberg.eu> * Copyright (C) 2016-2017 by Vadim Yanitskiy <axilirator(a)gmail.com> + * Copyright (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> * * All Rights Reserved * @@ -39,7 +40,6 @@ #include <osmocom/gsm/gsm_utils.h> -#include <osmocom/bb/l1sched/l1sched.h> #include <osmocom/bb/trxcon/trxcon.h> #include <osmocom/bb/trxcon/trx_if.h> #include <osmocom/bb/trxcon/logging.h> @@ -247,17 +247,17 @@ * RSP POWERON <status> */ -int trx_if_cmd_echo(struct trx_instance *trx) +static int trx_if_cmd_echo(struct trx_instance *trx) { return trx_ctrl_cmd(trx, 1, "ECHO", ""); } -int trx_if_cmd_poweroff(struct trx_instance *trx) +static int trx_if_cmd_poweroff(struct trx_instance *trx) { return trx_ctrl_cmd(trx, 1, "POWEROFF", ""); } -int trx_if_cmd_poweron(struct trx_instance *trx) +static int trx_if_cmd_poweron(struct trx_instance *trx) { if (trx->powered_up) { /* FIXME: this should be handled by the FSM, not here! */ @@ -278,8 +278,8 @@ * RSP SETSLOT <status> <timeslot> <chantype> */ -int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, - enum gsm_phys_chan_config pchan) +static int trx_if_cmd_setslot(struct trx_instance *trx, + const struct phyif_cmdp_setslot *cmdp) { /* Values correspond to 'enum ChannelCombination' in osmo-trx.git */ static const uint8_t chan_types[_GSM_PCHAN_MAX] = { @@ -295,7 +295,8 @@ [GSM_PCHAN_PDCH] = 13, }; - return trx_ctrl_cmd(trx, 1, "SETSLOT", "%u %u", tn, chan_types[pchan]); + return trx_ctrl_cmd(trx, 1, "SETSLOT", "%u %u", + cmdp->tn, chan_types[cmdp->pchan]); } /* @@ -310,28 +311,30 @@ * RSP (RX/TX)TUNE <status> <kHz> */ -int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t band_arfcn) +static int trx_if_cmd_rxtune(struct trx_instance *trx, + const struct phyif_cmdp_setfreq_h0 *cmdp) { uint16_t freq10; /* RX is downlink on MS side */ - freq10 = gsm_arfcn2freq10(band_arfcn, 0); + freq10 = gsm_arfcn2freq10(cmdp->band_arfcn, 0); if (freq10 == 0xffff) { - LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn); + LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", cmdp->band_arfcn); return -ENOTSUP; } return trx_ctrl_cmd(trx, 1, "RXTUNE", "%u", freq10 * 100); } -int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t band_arfcn) +static int trx_if_cmd_txtune(struct trx_instance *trx, + const struct phyif_cmdp_setfreq_h0 *cmdp) { uint16_t freq10; /* TX is uplink on MS side */ - freq10 = gsm_arfcn2freq10(band_arfcn, 1); + freq10 = gsm_arfcn2freq10(cmdp->band_arfcn, 1); if (freq10 == 0xffff) { - LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn); + LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", cmdp->band_arfcn); return -ENOTSUP; } @@ -350,19 +353,20 @@ * RSP MEASURE <status> <kHz> <dB> */ -int trx_if_cmd_measure(struct trx_instance *trx, - uint16_t band_arfcn_start, uint16_t band_arfcn_stop) +static int trx_if_cmd_measure(struct trx_instance *trx, + const struct phyif_cmdp_measure *cmdp) { uint16_t freq10; /* Update ARFCN range for measurement */ - trx->pm_band_arfcn_start = band_arfcn_start; - trx->pm_band_arfcn_stop = band_arfcn_stop; + trx->pm_band_arfcn_start = cmdp->band_arfcn_start; + trx->pm_band_arfcn_stop = cmdp->band_arfcn_stop; /* Calculate a frequency for current ARFCN (DL) */ - freq10 = gsm_arfcn2freq10(band_arfcn_start, 0); + freq10 = gsm_arfcn2freq10(cmdp->band_arfcn_start, 0); if (freq10 == 0xffff) { - LOGPFSML(trx->fi, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn_start); + LOGPFSML(trx->fi, LOGL_ERROR, + "ARFCN %d not defined\n", cmdp->band_arfcn_start); return -ENOTSUP; } @@ -399,8 +403,14 @@ osmo_fsm_inst_dispatch(trxcon->fi, TRXCON_EV_FULL_POWER_SCAN_RES, &res); /* Schedule a next measurement */ - if (band_arfcn != trx->pm_band_arfcn_stop) - trx_if_cmd_measure(trx, ++band_arfcn, trx->pm_band_arfcn_stop); + if (band_arfcn != trx->pm_band_arfcn_stop) { + const struct phyif_cmdp_measure cmdp = { + .band_arfcn_start = ++band_arfcn, + .band_arfcn_stop = trx->pm_band_arfcn_stop, + }; + + trx_if_cmd_measure(trx, &cmdp); + } } /* @@ -416,9 +426,10 @@ * RSP SETTA <status> <TA> */ -int trx_if_cmd_setta(struct trx_instance *trx, int8_t ta) +static int trx_if_cmd_setta(struct trx_instance *trx, + const struct phyif_cmdp_setta *cmdp) { - return trx_ctrl_cmd(trx, 0, "SETTA", "%d", ta); + return trx_ctrl_cmd(trx, 0, "SETTA", "%d", cmdp->ta); } /* @@ -434,8 +445,8 @@ * channel list is expected to be sorted in ascending order. */ -int trx_if_cmd_setfh(struct trx_instance *trx, uint8_t hsn, uint8_t maio, - const uint16_t *ma, size_t ma_len) +static int trx_if_cmd_setfh(struct trx_instance *trx, + const struct phyif_cmdp_setfreq_h1 *cmdp) { /* Reserve some room for CMD SETFH <HSN> <MAIO> */ char ma_buf[TRXC_BUF_SIZE - 24]; @@ -445,20 +456,20 @@ int i, rc; /* Make sure that Mobile Allocation has at least one ARFCN */ - if (!ma_len || ma == NULL) { + if (!cmdp->ma_len || cmdp->ma == NULL) { LOGPFSML(trx->fi, LOGL_ERROR, "Mobile Allocation is empty?!?\n"); return -EINVAL; } /* Compose a sequence of Rx/Tx frequencies (mobile allocation) */ - for (i = 0, ptr = ma_buf; i < ma_len; i++) { + for (i = 0, ptr = ma_buf; i < cmdp->ma_len; i++) { /* Convert ARFCN to a pair of Rx/Tx frequencies (Hz * 10) */ - rx_freq = gsm_arfcn2freq10(ma[i], 0); /* Rx: Downlink */ - tx_freq = gsm_arfcn2freq10(ma[i], 1); /* Tx: Uplink */ + rx_freq = gsm_arfcn2freq10(cmdp->ma[i], 0); /* Rx: Downlink */ + tx_freq = gsm_arfcn2freq10(cmdp->ma[i], 1); /* Tx: Uplink */ if (rx_freq == 0xffff || tx_freq == 0xffff) { LOGPFSML(trx->fi, LOGL_ERROR, "Failed to convert ARFCN %u " "to a pair of Rx/Tx frequencies\n", - ma[i] & ~ARFCN_FLAG_MASK); + cmdp->ma[i] & ~ARFCN_FLAG_MASK); return -EINVAL; } @@ -466,7 +477,7 @@ rc = snprintf(ptr, ma_buf_len, "%u %u ", rx_freq * 100, tx_freq * 100); if (rc < 0 || rc > ma_buf_len) { /* Prevent buffer overflow */ LOGPFSML(trx->fi, LOGL_ERROR, "Not enough room to encode " - "Mobile Allocation (N=%zu)\n", ma_len); + "Mobile Allocation (N=%zu)\n", cmdp->ma_len); return -ENOSPC; } @@ -478,7 +489,7 @@ /* Overwrite the last space */ *(ptr - 1) = '\0'; - return trx_ctrl_cmd(trx, 1, "SETFH", "%u %u %s", hsn, maio, ma_buf); + return trx_ctrl_cmd(trx, 1, "SETFH", "%u %u %s", cmdp->hsn, cmdp->maio, ma_buf); } /* Get response from CTRL socket */ @@ -569,6 +580,49 @@ return -EIO; } +int trx_if_handle_phyif_cmd(struct trx_instance *trx, const struct phyif_cmd *cmd) +{ + int rc; + + switch (cmd->type) { + case PHYIF_CMDT_RESET: + if ((rc = trx_if_cmd_poweroff(trx)) != 0) + return rc; + rc = trx_if_cmd_echo(trx); + break; + case PHYIF_CMDT_POWERON: + rc = trx_if_cmd_poweron(trx); + break; + case PHYIF_CMDT_POWEROFF: + rc = trx_if_cmd_poweroff(trx); + break; + case PHYIF_CMDT_MEASURE: + rc = trx_if_cmd_measure(trx, &cmd->param.measure); + break; + case PHYIF_CMDT_SETFREQ_H0: + if ((rc = trx_if_cmd_rxtune(trx, &cmd->param.setfreq_h0)) != 0) + return rc; + if ((rc = trx_if_cmd_txtune(trx, &cmd->param.setfreq_h0)) != 0) + return rc; + break; + case PHYIF_CMDT_SETFREQ_H1: + rc = trx_if_cmd_setfh(trx, &cmd->param.setfreq_h1); + break; + case PHYIF_CMDT_SETSLOT: + rc = trx_if_cmd_setslot(trx, &cmd->param.setslot); + break; + case PHYIF_CMDT_SETTA: + rc = trx_if_cmd_setta(trx, &cmd->param.setta); + break; + default: + LOGPFSML(trx->fi, LOGL_ERROR, + "Unhandled PHYIF command type=0x%02x\n", cmd->type); + rc = -ENODEV; + } + + return rc; +} + /* ------------------------------------------------------------------------ */ /* Data interface handlers */ /* ------------------------------------------------------------------------ */ @@ -594,13 +648,8 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what) { struct trx_instance *trx = ofd->data; - struct trxcon_inst *trxcon = trx->trxcon; - struct l1sched_meas_set meas; + struct phyif_burst_ind bi; uint8_t buf[TRXD_BUF_SIZE]; - sbit_t bits[148]; - int8_t rssi, tn; - int16_t toa256; - uint32_t fn; ssize_t read_len; read_len = read(ofd->fd, buf, sizeof(buf)); @@ -615,52 +664,41 @@ return -EINVAL; } - tn = buf[0]; - fn = osmo_load32be(buf + 1); - rssi = -(int8_t) buf[5]; - toa256 = ((int16_t) (buf[6] << 8) | buf[7]); + bi = (struct phyif_burst_ind) { + .tn = buf[0], + .fn = osmo_load32be(buf + 1), + .rssi = -(int8_t) buf[5], + .toa256 = (int16_t) (buf[6] << 8) | buf[7], + .burst_len = 148, + }; /* Copy and convert bits {254..0} to sbits {-127..127} */ for (unsigned int i = 0; i < 148; i++) { if (buf[8 + i] == 255) - bits[i] = -127; + bi.burst[i] = -127; else - bits[i] = 127 - buf[8 + i]; + bi.burst[i] = 127 - buf[8 + i]; } - if (tn >= 8) { - LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal TS %d\n", tn); + if (bi.tn >= 8) { + LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal TS %d\n", bi.tn); return -EINVAL; } - if (fn >= 2715648) { - LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal FN %u\n", fn); + if (bi.fn >= 2715648) { + LOGPFSMSL(trx->fi, DTRXD, LOGL_ERROR, "Illegal FN %u\n", bi.fn); return -EINVAL; } LOGPFSMSL(trx->fi, DTRXD, LOGL_DEBUG, "RX burst tn=%u fn=%u rssi=%d toa=%d\n", - tn, fn, rssi, toa256); + bi.tn, bi.fn, bi.rssi, bi.toa256); - /* Group the measurements together */ - meas = (struct l1sched_meas_set) { - .toa256 = toa256, - .rssi = rssi, - .fn = fn, - }; - - /* Poke scheduler */ - l1sched_handle_rx_burst(trxcon->sched, tn, fn, bits, 148, &meas); - - /* Correct local clock counter */ - if (fn % 51 == 0) - l1sched_clck_handle(trxcon->sched, fn); - - return 0; + return phyif_handle_burst_ind(trx, &bi); } -int trx_if_tx_burst(struct trx_instance *trx, - const struct l1sched_burst_req *br) +int trx_if_handle_phyif_burst_req(struct trx_instance *trx, + const struct phyif_burst_req *br) { uint8_t buf[TRXD_BUF_SIZE]; size_t length; @@ -760,7 +798,7 @@ } /* Flush pending control messages */ -void trx_if_flush_ctrl(struct trx_instance *trx) +static void trx_if_flush_ctrl(struct trx_instance *trx) { struct trx_ctrl_msg *tcm; diff --git a/src/host/trxcon/src/trxcon.c b/src/host/trxcon/src/trxcon.c index d46cd8e..0329d0b 100644 --- a/src/host/trxcon/src/trxcon.c +++ b/src/host/trxcon/src/trxcon.c @@ -42,6 +42,7 @@ #include <osmocom/gsm/gsm_utils.h> #include <osmocom/bb/trxcon/trxcon.h> +#include <osmocom/bb/trxcon/phyif.h> #include <osmocom/bb/trxcon/trx_if.h> #include <osmocom/bb/trxcon/logging.h> #include <osmocom/bb/trxcon/l1ctl.h> @@ -134,8 +135,52 @@ const struct l1sched_burst_req *br) { struct trxcon_inst *trxcon = sched->priv; + const struct phyif_burst_req phybr = { + .fn = br->fn, + .tn = br->tn, + .pwr = br->pwr, + .burst = &br->burst[0], + .burst_len = br->burst_len, + }; - return trx_if_tx_burst(trxcon->phyif, br); + return phyif_handle_burst_req(trxcon->phyif, &phybr); +} + +/* External L1 API for the PHYIF */ +int phyif_handle_burst_ind(void *phyif, const struct phyif_burst_ind *bi) +{ + struct trx_instance *trx = phyif; + struct trxcon_inst *trxcon = trx->trxcon; + const struct l1sched_meas_set meas = { + .fn = bi->fn, + .toa256 = bi->toa256, + .rssi = bi->rssi, + }; + + /* Poke scheduler */ + l1sched_handle_rx_burst(trxcon->sched, bi->tn, bi->fn, + &bi->burst[0], bi->burst_len, &meas); + + /* Correct local clock counter */ + if (bi->fn % 51 == 0) + l1sched_clck_handle(trxcon->sched, bi->fn); + + return 0; +} + +int phyif_handle_burst_req(void *phyif, const struct phyif_burst_req *br) +{ + return trx_if_handle_phyif_burst_req(phyif, br); +} + +int phyif_handle_cmd(void *phyif, const struct phyif_cmd *cmd) +{ + return trx_if_handle_phyif_cmd(phyif, cmd); +} + +void phyif_close(void *phyif) +{ + trx_if_close(phyif); } /* External L2 API for the scheduler */ diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c index 0d03740..38343b5 100644 --- a/src/host/trxcon/src/trxcon_fsm.c +++ b/src/host/trxcon/src/trxcon_fsm.c @@ -30,7 +30,7 @@ #include <osmocom/core/talloc.h> #include <osmocom/bb/trxcon/trxcon.h> -#include <osmocom/bb/trxcon/trx_if.h> +#include <osmocom/bb/trxcon/phyif.h> #include <osmocom/bb/trxcon/logging.h> #include <osmocom/bb/trxcon/l1ctl.h> #include <osmocom/bb/trxcon/l1ctl_server.h> @@ -44,6 +44,7 @@ uint32_t event, void *data) { struct trxcon_inst *trxcon = fi->priv; + struct phyif_cmd phycmd = { }; switch (event) { case TRXCON_EV_PHYIF_FAILURE: @@ -58,8 +59,9 @@ if (fi->state != TRXCON_ST_RESET) osmo_fsm_inst_state_chg(fi, TRXCON_ST_RESET, 0, 0); l1sched_reset(trxcon->sched, true); - trx_if_cmd_poweroff(trxcon->phyif); - trx_if_cmd_echo(trxcon->phyif); + + phycmd.type = PHYIF_CMDT_RESET; + phyif_handle_cmd(trxcon->phyif, &phycmd); break; case TRXCON_EV_RESET_SCHED_REQ: l1sched_reset(trxcon->sched, false); @@ -70,13 +72,17 @@ switch (req->type) { case TRXCON_PHY_CFGT_PCHAN_COMB: - trx_if_cmd_setslot(trxcon->phyif, - req->pchan_comb.tn, - req->pchan_comb.pchan); + phycmd.type = PHYIF_CMDT_SETSLOT; + phycmd.param.setslot.tn = req->pchan_comb.tn; + phycmd.param.setslot.pchan = req->pchan_comb.pchan; + phyif_handle_cmd(trxcon->phyif, &phycmd); break; case TRXCON_PHY_CFGT_TX_PARAMS: - if (trxcon->l1p.ta != req->tx_params.timing_advance) - trx_if_cmd_setta(trxcon->phyif, req->tx_params.timing_advance); + if (trxcon->l1p.ta != req->tx_params.timing_advance) { + phycmd.type = PHYIF_CMDT_SETTA; + phycmd.param.setta.ta = req->tx_params.timing_advance; + phyif_handle_cmd(trxcon->phyif, &phycmd); + } trxcon->l1p.tx_power = req->tx_params.tx_power; trxcon->l1p.ta = req->tx_params.timing_advance; break; @@ -127,7 +133,6 @@ case TRXCON_EV_FBSB_SEARCH_REQ: { const struct trxcon_param_fbsb_search_req *req = data; - const struct trx_instance *trx = trxcon->phyif; osmo_fsm_inst_state_chg_ms(fi, TRXCON_ST_FBSB_SEARCH, req->timeout_ms, 0); @@ -135,26 +140,39 @@ /* Only if current ARFCN differs */ if (trxcon->l1p.band_arfcn != req->band_arfcn) { + const struct phyif_cmd phycmd = { + .type = PHYIF_CMDT_SETFREQ_H0, + .param.setfreq_h0 = { + .band_arfcn = req->band_arfcn, + }, + }; + /* Update current ARFCN */ trxcon->l1p.band_arfcn = req->band_arfcn; /* Tune transceiver to required ARFCN */ - trx_if_cmd_rxtune(trxcon->phyif, req->band_arfcn); - trx_if_cmd_txtune(trxcon->phyif, req->band_arfcn); + phyif_handle_cmd(trxcon->phyif, &phycmd); } /* Transceiver might have been powered on before, e.g. * in case of sending L1CTL_FBSB_REQ due to signal loss. */ - if (!trx->powered_up) - trx_if_cmd_poweron(trxcon->phyif); + const struct phyif_cmd phycmd = { .type = PHYIF_CMDT_POWERON }; + phyif_handle_cmd(trxcon->phyif, &phycmd); break; } case TRXCON_EV_FULL_POWER_SCAN_REQ: { const struct trxcon_param_full_power_scan_req *req = data; + const struct phyif_cmd phycmd = { + .type = PHYIF_CMDT_MEASURE, + .param.measure = { + .band_arfcn_start = req->band_arfcn_start, + .band_arfcn_stop = req->band_arfcn_stop, + }, + }; osmo_fsm_inst_state_chg(fi, TRXCON_ST_FULL_POWER_SCAN, 0, 0); /* TODO: timeout */ - trx_if_cmd_measure(trxcon->phyif, req->band_arfcn_start, req->band_arfcn_stop); + phyif_handle_cmd(trxcon->phyif, &phycmd); break; } default: @@ -178,8 +196,15 @@ case TRXCON_EV_FULL_POWER_SCAN_REQ: { const struct trxcon_param_full_power_scan_req *req = data; + const struct phyif_cmd phycmd = { + .type = PHYIF_CMDT_MEASURE, + .param.measure = { + .band_arfcn_start = req->band_arfcn_start, + .band_arfcn_stop = req->band_arfcn_stop, + }, + }; - trx_if_cmd_measure(trxcon->phyif, req->band_arfcn_start, req->band_arfcn_stop); + phyif_handle_cmd(trxcon->phyif, &phycmd); break; } default: @@ -266,20 +291,32 @@ } if (req->hopping) { + const struct phyif_cmd phycmd = { + .type = PHYIF_CMDT_SETFREQ_H1, + .param.setfreq_h1 = { + .hsn = req->h1.hsn, + .maio = req->h1.maio, + .ma = &req->h1.ma[0], + .ma_len = req->h1.n, + }, + }; + /* Apply the freq. hopping parameters */ - rc = trx_if_cmd_setfh(trxcon->phyif, - req->h1.hsn, req->h1.maio, - &req->h1.ma[0], req->h1.n); - if (rc) + if (phyif_handle_cmd(trxcon->phyif, &phycmd) != 0) return; /* Set current ARFCN to an invalid value */ trxcon->l1p.band_arfcn = 0xffff; } else { + const struct phyif_cmd phycmd = { + .type = PHYIF_CMDT_SETFREQ_H0, + .param.setfreq_h0 = { + .band_arfcn = req->h0.band_arfcn, + }, + }; + /* Tune transceiver to required ARFCN */ - if (trx_if_cmd_rxtune(trxcon->phyif, req->h0.band_arfcn)) - return; - if (trx_if_cmd_txtune(trxcon->phyif, req->h0.band_arfcn)) + if (phyif_handle_cmd(trxcon->phyif, &phycmd) != 0) return; /* Update current ARFCN */ @@ -495,7 +532,7 @@ l1ctl_client_conn_close(trxcon->l2if); } if (trxcon->phyif != NULL) - trx_if_close(trxcon->phyif); + phyif_close(trxcon->phyif); talloc_free(trxcon); fi->priv = NULL; -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I3d7c717cfc3616809d22efb1903abbf843594258 Gerrit-Change-Number: 29868 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmocom-bb[master]: trxcon: add new trxcon_fsm state - TRXCON_ST_PACKET_DATA
by fixeria 25 Oct '22

25 Oct '22
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/29848 ) Change subject: trxcon: add new trxcon_fsm state - TRXCON_ST_PACKET_DATA ...................................................................... trxcon: add new trxcon_fsm state - TRXCON_ST_PACKET_DATA Change-Id: I7706d677c8966a6a7c6d452ae97eda84d4282ef5 --- M src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h M src/host/trxcon/src/trxcon_fsm.c 2 files changed, 42 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved msuraev: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve diff --git a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h index 910d37f..9aa5e55 100644 --- a/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h +++ b/src/host/trxcon/include/osmocom/bb/trxcon/trxcon.h @@ -10,6 +10,7 @@ TRXCON_ST_FBSB_SEARCH, TRXCON_ST_BCCH_CCCH, TRXCON_ST_DEDICATED, + TRXCON_ST_PACKET_DATA, }; enum trxcon_fsm_events { diff --git a/src/host/trxcon/src/trxcon_fsm.c b/src/host/trxcon/src/trxcon_fsm.c index 59a29d9..0d03740 100644 --- a/src/host/trxcon/src/trxcon_fsm.c +++ b/src/host/trxcon/src/trxcon_fsm.c @@ -301,7 +301,10 @@ return; } - osmo_fsm_inst_state_chg(fi, TRXCON_ST_DEDICATED, 0, 0); + if (config == GSM_PCHAN_PDCH) + osmo_fsm_inst_state_chg(fi, TRXCON_ST_PACKET_DATA, 0, 0); + else + osmo_fsm_inst_state_chg(fi, TRXCON_ST_DEDICATED, 0, 0); break; } case TRXCON_EV_RX_DATA_IND: @@ -448,6 +451,30 @@ } } +static void trxcon_st_packet_data_action(struct osmo_fsm_inst *fi, + uint32_t event, void *data) +{ + struct trxcon_inst *trxcon = fi->priv; + + switch (event) { + case TRXCON_EV_TX_ACCESS_BURST_REQ: + handle_tx_access_burst_req(fi, data); + break; + case TRXCON_EV_RX_TRAFFIC_IND: + LOGPFSML(fi, LOGL_NOTICE, "Rx PDTCH/D message\n"); + break; + case TRXCON_EV_RX_DATA_IND: + LOGPFSML(fi, LOGL_NOTICE, "Rx PTCCH/D message\n"); + break; + case TRXCON_EV_DEDICATED_RELEASE_REQ: + l1sched_reset(trxcon->sched, false); + osmo_fsm_inst_state_chg(fi, TRXCON_ST_RESET, 0, 0); + break; + default: + OSMO_ASSERT(0); + } +} + static void trxcon_fsm_pre_term_cb(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) { @@ -501,7 +528,8 @@ .name = "BCCH_CCCH", .out_state_mask = S(TRXCON_ST_RESET) | S(TRXCON_ST_FBSB_SEARCH) - | S(TRXCON_ST_DEDICATED), + | S(TRXCON_ST_DEDICATED) + | S(TRXCON_ST_PACKET_DATA), .in_event_mask = S(TRXCON_EV_RX_DATA_IND) | S(TRXCON_EV_SET_CCCH_MODE_REQ) | S(TRXCON_EV_TX_ACCESS_BURST_REQ) @@ -523,6 +551,17 @@ | S(TRXCON_EV_CRYPTO_REQ), .action = &trxcon_st_dedicated_action, }, + [TRXCON_ST_PACKET_DATA] = { + .name = "PACKET_DATA", + .out_state_mask = S(TRXCON_ST_RESET) + | S(TRXCON_ST_FBSB_SEARCH) + | S(TRXCON_ST_BCCH_CCCH), + .in_event_mask = S(TRXCON_EV_DEDICATED_RELEASE_REQ) + | S(TRXCON_EV_TX_ACCESS_BURST_REQ) + | S(TRXCON_EV_RX_TRAFFIC_IND) + | S(TRXCON_EV_RX_DATA_IND), + .action = &trxcon_st_packet_data_action, + }, }; static const struct value_string trxcon_fsm_event_names[] = { -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29848 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I7706d677c8966a6a7c6d452ae97eda84d4282ef5 Gerrit-Change-Number: 29848 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmocom-bb[master]: trxcon: add new trxcon_fsm state - TRXCON_ST_PACKET_DATA
by fixeria 25 Oct '22

25 Oct '22
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/29848 ) Change subject: trxcon: add new trxcon_fsm state - TRXCON_ST_PACKET_DATA ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/29848 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I7706d677c8966a6a7c6d452ae97eda84d4282ef5 Gerrit-Change-Number: 29848 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 25 Oct 2022 07:50:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Build failure of network:osmocom:nightly/osmo-bsc-nat in Raspbian_11/armv7l
by OBS Notification 25 Oct '22

25 Oct '22
Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/o… Package network:osmocom:nightly/osmo-bsc-nat failed to build in Raspbian_11/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc-nat Last lines of build log: [ 434s] update-alternatives: using /usr/share/docutils/scripts/python3/rst2xml to provide /usr/bin/rst2xml (rst2xml) in auto mode [ 434s] update-alternatives: using /usr/share/docutils/scripts/python3/rstpep2html to provide /usr/bin/rstpep2html (rstpep2html) in auto mode [ 435s] [450/483] installing python3-reportlab-3.5.59-2 [ 438s] [451/483] installing g++-4:10.2.1-1+rpi1 [ 438s] update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode [ 438s] [452/483] installing libosmo-netif-dev-1.2.0.61.a07c.202210250053 [ 439s] [453/483] installing mount-2.36.1-8+deb11u1 [ 439s] [454/483] installing texlive-latex-extra-2020.20210202-3 [ 447s] [455/483] installing debhelper-13.3.4 [ 448s] [456/483] installing bash-5.1-2+deb11u1 [ 452s] update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode [ 452s] [457/483] installing libosmo-sigtran-dev-1.6.0.14.71fc.202210250053 [ 453s] [458/483] installing build-essential-12.9 [ 453s] [459/483] installing python3-blockdiag-2.0.1+dfsg-1 [ 454s] [460/483] installing texlive-xetex-2020.20210202-3 [ 455s] dpkg-deb (subprocess): decompressing archive '.init_b_cache/texlive-xetex.deb' (size=12542520) member 'data.tar': lzma error: compressed data is corrupt [ 455s] dpkg-deb: error: <decompress> subprocess returned error exit status 2 [ 455s] dpkg: error processing archive .init_b_cache/texlive-xetex.deb (--install): [ 455s] cannot copy extracted data for './usr/share/doc/texlive-doc/xelatex/businesscard-qrcode/screenshots/peter-muster-example-company-zuerich.jpg' to '/usr/share/doc/texlive-doc/xelatex/businesscard-qrcode/screenshots/peter-muster-example-company-zuerich.jpg.dpkg-new': unexpected end of file or stream [ 455s] Errors were encountered while processing: [ 455s] .init_b_cache/texlive-xetex.deb [ 455s] exit ... [ 455s] ### VM INTERACTION START ### [ 457s] [ 299.747483] sysrq: SysRq : Power Off [ 457s] [ 299.749125] reboot: Power down [ 458s] ### VM INTERACTION END ### [ 458s] [ 458s] armbuild02 failed "build osmo-bsc-nat_0.1.0.202210250053.dsc" at Tue Oct 25 05:05:05 UTC 2022. [ 458s] -- Configure notifications at https://build.opensuse.org/my/subscriptions openSUSE Build Service (https://build.opensuse.org/)
1 0
0 0
Build failure of network:osmocom:nightly/osmo-msc in Raspbian_10/armv7l
by OBS Notification 25 Oct '22

25 Oct '22
Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/o… Package network:osmocom:nightly/osmo-msc failed to build in Raspbian_10/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 346s] update-alternatives: using /usr/share/docutils/scripts/python3/rst2pseudoxml to provide /usr/bin/rst2pseudoxml (rst2pseudoxml) in auto mode [ 346s] update-alternatives: using /usr/share/docutils/scripts/python3/rst2s5 to provide /usr/bin/rst2s5 (rst2s5) in auto mode [ 346s] update-alternatives: using /usr/share/docutils/scripts/python3/rst2xetex to provide /usr/bin/rst2xetex (rst2xetex) in auto mode [ 346s] update-alternatives: using /usr/share/docutils/scripts/python3/rst2xml to provide /usr/bin/rst2xml (rst2xml) in auto mode [ 346s] update-alternatives: using /usr/share/docutils/scripts/python3/rstpep2html to provide /usr/bin/rstpep2html (rstpep2html) in auto mode [ 347s] [441/485] installing python3-reportlab-3.5.13-1+deb10u1 [ 350s] [442/485] installing sysvinit-utils-2.93-8 [ 350s] [443/485] installing libosmo-netif-dev-1.2.0.61.a07c.202210250053 [ 351s] [444/485] installing mount-2.33.1-0.1 [ 351s] [445/485] installing gpg-wks-client-2.2.12-1+rpi1+deb10u1 [ 351s] [446/485] installing libpangocairo-1.0-0-1.42.4-8~deb10u1 [ 352s] [447/485] installing texlive-binaries-2018.20181218.49446-1 [ 360s] update-alternatives: using /usr/bin/xdvi-xaw to provide /usr/bin/xdvi.bin (xdvi.bin) in auto mode [ 360s] update-alternatives: using /usr/bin/bibtex.original to provide /usr/bin/bibtex (bibtex) in auto mode [ 361s] [448/485] installing bash-5.0-4 [ 361s] dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt [ 361s] dpkg-deb: error: <decompress> subprocess returned error exit status 2 [ 361s] dpkg: error processing archive .init_b_cache/bash.deb (--install): [ 361s] cannot copy extracted data for './bin/bash' to '/bin/bash.dpkg-new': unexpected end of file or stream [ 361s] Errors were encountered while processing: [ 361s] .init_b_cache/bash.deb [ 361s] exit ... [ 361s] ### VM INTERACTION START ### [ 362s] [ 286.655056] sysrq: SysRq : Power Off [ 362s] [ 286.656904] reboot: Power down [ 362s] ### VM INTERACTION END ### [ 362s] [ 363s] armbuild02 failed "build osmo-msc_1.9.0.34.bb624.202210250053.dsc" at Tue Oct 25 04:54:28 UTC 2022. [ 363s] -- Configure notifications at https://build.opensuse.org/my/subscriptions openSUSE Build Service (https://build.opensuse.org/)
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • ...
  • 234
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.