summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-08-05trx_toolkit: Fixes in TRXD documentationPau Espin Pedrol1-5/+5
Change-Id: I126a8aed6b2bac7a620e95f06ecb98642a63b5f0
2019-08-05Remove undefined param passed to logging_vty_add_cmdsPau Espin Pedrol1-1/+1
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However, definition in C file doesn't contain "(void)", which means number of parameters is undefined and thus compiler doesn't complain. Let's remove parameters from all callers before enforcing "(void)" on it. Change-Id: I25baaa30b097dad2fae507c5321778f43e863611 Related: OS#4138
2019-07-24trx_toolkit/trx_sniff.py: support additional capture filterVadim Yanitskiy1-0/+8
Change-Id: I761debb2e1c411f2c6d489eac0adf32060966a4c
2019-07-24trx_toolkit/trx_sniff.py: support sniffing on multiple portsVadim Yanitskiy1-6/+7
Change-Id: I76b818c673b98c427b5621ddb852f947c74557d6
2019-07-24trx_toolkit/trx_sniff.py: add support for reading from PCAP fileVadim Yanitskiy1-7/+23
Change-Id: I8a3481fbea5f6c917ae5684d0b5b806f4a76ff78
2019-07-24trx_toolkit/burst_gen.py: basic TRXD header version 1 supportVadim Yanitskiy1-4/+27
Change-Id: Icd4505d211816dc80e91d65094be92f2aed856bd
2019-07-24trx_toolkit: fix compatibility with Python 3: 'is' vs '=='Vadim Yanitskiy5-5/+6
Change-Id: I8ba05c04f206578cf61df58573c24cba1d6fba52
2019-07-24trx_toolkit/rand_burst_gen.py: fix compatibility with Python 3Vadim Yanitskiy1-0/+1
Change-Id: I362881af83664f94be09d40f43dfb23d18a35136
2019-07-24trx_toolkit/trx_sniff.py: fix compatibility with Python 3Vadim Yanitskiy1-1/+1
Change-Id: I9cd9b7baae31045c6495b90df2517d32772098ed
2019-07-21gsm411_sms.c: Handle negative return of gsm340_gen_oa()Harald Welte1-0/+3
Change-Id: I36f56e1fbd72d9b31350dc2f8a53e763f79f4c08 Closes: CID#198533
2019-07-21virt_phy: Fix hexdump of L1CTL SIM REQ in l1ctl_rx_sim_req()Harald Welte1-1/+1
Change-Id: I74e07e2c97bfe5d6e9c6e848ebce58ced1b197aa Closes: CID#198538
2019-07-21mobile/gsm480_ss.c: gsm480_tx_release_compl(): fix cause IE encodingVadim Yanitskiy1-2/+7
According to GSM TS 04.08, section 10.5.4.11, location and coding standard are encoded before the cause value, not vice-versa! Also, coding standards other than "1 1 - Standard defined for the GSM PLMNs" shall not be used if the cause can be represented with the GSM standardized coding. Change-Id: Ic6abcfb9a9589f5b0c9c40def863f15ae04d0bdd
2019-07-21virtphy: Handle strtok() returning NULL on first callHarald Welte1-0/+2
Change-Id: I37bfb91cf75982bfa2f75bd62d0c13859268cd93 Closes: CID#198565
2019-07-21osmocon: Check write() return codeHarald Welte1-0/+2
Change-Id: I61d8f104a4d2558fd5b6fb34c7f2fd6c13354c12 Closes: CID#198567
2019-07-21osmocon: Add missing check for fstat() return valueHarald Welte1-0/+5
Change-Id: Ibef6ee00eb41e16d2ef52931f8c22562090cd1ee Closes: CID#198570
2019-07-21mobile: Fix encoding of cause in gsm480_tx_release_compl()Harald Welte1-4/+4
Change-Id: Iba2ace7d82be5677d28b25f60ab0312fed76f5e5 Closes: CID#198577, CID#198576, CID#198575
2019-07-21osmocon: Fix file descriptor + mem leak in error pathHarald Welte1-0/+3
Change-Id: I42ceed662889084783dc89f4ca39c3852428d108 Closes: CID#198539
2019-07-21gsm322: Fix resource leak in gsm322_init() while reading BAHarald Welte1-1/+3
Change-Id: Id42102ab8581e247f495fb7e05dc62a6743d28c5 Closes: CID#198546
2019-07-21osmocon: Fix fd leak in error path of read_file()Harald Welte1-0/+1
Change-Id: Iaae407658df184277f6e6e07d6a48d8b5c75587b Closes: CID#198552
2019-07-21osmocon: Fix out-of-bounds for partial reads in un_tool_read()Harald Welte1-2/+2
"uint8_t buf[4096]; ... &buf + 1" renders an offset of 4096, and not 1! Change-Id: Ie1407371fe949c3d5746b9fdc32ececc9443692b Closes: CID#198580
2019-07-21virtphy: Fix array out of bounds access in getL1ctlPrimName()Harald Welte1-1/+1
Closes: CID#198573 Change-Id: I6504a7ffcf961d3162e6ab2ec8f5f2016ef12cde
2019-07-16target/*.py: shebang: use /usr/bin/env pythonAlexander Couzens20-20/+20
Use the system default python instead of a hardcoded python2 Allow to use python2 and python3. Change-Id: Iab185759b574eff1ca1b189dcbb4e1a3eec52132
2019-07-16trx_toolkit/fake_trx.py: introduce a TRXC command for C/I simulationVadim Yanitskiy1-2/+29
C/I (Carrier-to-Interference ratio) is a value in cB (centiBels), computed from the training sequence of each received burst, by comparing the "ideal" training sequence with the received one. This change introduces a new command similar to FAKE_TOA and FAKE_RSSI, so it can be used by TTCN-3 test case 'TC_pcu_data_ind_lqual_cb' to verify that the link quality measurements are delivered to the PCU. Change-Id: I7080effbbc1022d1884c6d6f0cb580eba8e514ff Related: OS#1855
2019-07-16trx_toolkit/ctrl_if_trx.py: implement TRXD header version negotiationVadim Yanitskiy2-1/+75
Messages on DATA interface may have different header formats, defined by a version number, which can be negotiated on the control interface. By default, the Transceiver will use the legacy header version (0). The header format negotiation can be initiated by the L1 using the 'SETFORMAT' command. If the requested version is not supported by the transceiver, status code of the response message should indicate a preferred (basically, the latest) version. The format of this message is the following: L1 -> TRX: CMD SETFORMAT VER_REQ L1 <- TRX: RSP SETFORMAT VER_RSP VER_REQ where: - VER_REQ is the requested version (suggested by the L1), - VER_RSP is either the applied version if matches VER_REQ, or a preferred version if VER_REQ is not supported. If the transceiver indicates VER_RSP different than VER_REQ, the L1 is supposed to reinitiate the version negotiation using the suggested VER_RSP. For example: L1 -> TRX: CMD SETFORMAT 2 L1 <- TRX: RSP SETFORMAT 1 2 L1 -> TRX: CMD SETFORMAT 1 L1 <- TRX: RSP SETFORMAT 1 1 If no suitable VER_RSP is found, or the VER_REQ is incorrect, the status code in the response shall be -1. As soon as VER_RSP matches VER_REQ in the response, the process of negotiation is complete. Changing the header version is supposed to be done before POWERON, but can be also done after. Change-Id: I8d441b2559863d2dbd680db371062e4f3a2f9ff9 Related: OS#4006
2019-07-16trx_toolkit/fake_trx.py: basic TRXD version 0x01 supportVadim Yanitskiy3-5/+78
Since the new TRXD header format has been introduced, FakeTRX needs to be able to fill it correctly. In particular, the following: - Modulation, which can be determined from the burst length; - Training Sequence Code (and set), which needs to be detected by comparing the burst bits of L12TRX message against known training sequences (only GMSK and the default TS set for now); - C/I (Carrier-to-Interference ratio), which can be simulated later on, as instructed on the TRXC interface ('FAKE_CI'). The actual TRXD header version is stored in the instance of class DATAInterface. By default (at startup), legacy version 0 is used. The version negotiation is supposed to be performed on the TRXC interface, and to be implemented in a follow-up change. Different Transceivers may use different header versions, thus in FakeTRX.send_data_msg() we need to override the original version of the L12TRX message, and generate the corresponding PDU. Limitations: - NOPE / IDLE indications are not (yet) supported; - TSC detection: GMSK modulation only. Change-Id: I164f5ae4ce7694d6e324aab927a04e96d489ebd8 Related: OS#4006
2019-07-16trx_toolkit/rand_burst_gen.py: use TrainingSeqGMSK and BurstType enumsVadim Yanitskiy1-56/+16
Change-Id: I8a3faceae4a8d9b57d86d42600db839da073dad6
2019-07-16trx_toolkit/gsm_shared.py: introduce a new enum TrainingSeqGMSKVadim Yanitskiy1-1/+78
Training Sequences are defined in 3GPP TS 45.002, and used by the transceiver for detecting bursts. This change introduces an enum with training sequences for GMSK for Access and Normal bursts. This enumeration is needed for the follow-up changes that implement TRXD header version 1 support, and can now be used by RandBurstGen. Change-Id: If3bf102019ef53d6ee9ad230ef98bb45845b5af5
2019-07-11target_dsp/bin2cfile.py: make it compatible with python3Alexander Couzens1-2/+2
Change-Id: I2659c2e4633bd120cc6cd76942eff5b66d2057bb
2019-07-11firmware/solve_envs.py: make it compatible with python3Alexander Couzens1-1/+1
Change-Id: I711df515012f5542de5e5008c8fe4e601609759e
2019-07-02trx_toolkit/data_msg.py: legacy flag is only for version 0x00Vadim Yanitskiy1-1/+1
Since version 0x01, the burst bits are encoded as L16V, so appending two dummy octets doesn't make sense. Change-Id: I4d6c0bf54649d636ea6cb3fa2f37486b6619d5b3
2019-07-02trx_toolkit/data_msg.py: introduce header coding version 0x01Vadim Yanitskiy1-33/+362
The new version adds the following fields to the TRX2L1 message, keeping the L12TRX message unchanged: +------+-----+-----+-----+--------------------+ | RSSI | ToA | MTS | C/I | soft-bits (254..0) | +------+-----+-----+-----+--------------------+ - MTS (1 octet) - Modulation and Training Sequence info, and - C/I (2 octets) - Carrier-to-Interference ratio (big endian). == Coding of MTS: Modulation and Training Sequence info 3GPP TS 45.002 version 15.1.0 defines several modulation types, and a few sets of training sequences for each type. The most common are GMSK and 8-PSK (which is used in EDGE). +-----------------+---------------------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers (value range) | +-----------------+---------------------------------------+ | . . . . . X X X | Training Sequence Code (0..7) | +-----------------+---------------------------------------+ | . X X X X . . . | Modulation, TS set number (see below) | +-----------------+---------------------------------------+ | X . . . . . . . | IDLE / nope frame indication (0 or 1) | +-----------------+---------------------------------------+ The bit number 7 (MSB) is set to high when either nothing has been detected, or during IDLE frames, so we can deliver noise levels, and avoid clock gaps on the L1 side. Other bits are ignored, and should be set to low (0) in this case. == Coding of modulation and TS set number GMSK has 4 sets of training sequences (see tables 5.2.3a-d), while 8-PSK (see tables 5.2.3f-g) and the others have 2 sets. Access and Synchronization bursts also have several synch. sequences. +-----------------+---------------------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers (value range) | +-----------------+---------------------------------------+ | . 0 0 X X . . . | GMSK, 4 TS sets (0..3) | +-----------------+---------------------------------------+ | . 0 1 0 X . . . | 8-PSK, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 0 1 1 X . . . | AQPSK, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 1 0 0 X . . . | 16QAM, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 1 0 1 X . . . | 32QAM, 2 TS sets (0..1) | +-----------------+---------------------------------------+ | . 1 1 1 X . . . | RESERVED (0) | +-----------------+---------------------------------------+ == C/I: Carrier-to-Interference ratio The C/I value is computed from the training sequence of each burst, where we can compare the "ideal" training sequence with the actual training sequence, and then express that difference in centiBels. Change-Id: Ie810c5a482d1c908994e8cdd32a2ea641ae7cedd Related: OS#4006, OS#1855
2019-07-01trx_toolkit/data_msg.py: implement header version codingVadim Yanitskiy1-15/+115
It may be necessary to extend the message specific header with more information. Since this is not a TLV-based protocol, we need to include the header format version. +-----------------+------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers | +-----------------+------------------------+ | X X X X . . . . | header version (0..15) | +-----------------+------------------------+ | . . . . . X X X | TDMA TN (0..7) | +-----------------+------------------------+ | . . . . X . . . | RESERVED (0) | +-----------------+------------------------+ Instead of prepending an additional byte, it was decided to use 4 MSB bits of the first octet, which used to be zero-initialized due to the value range of TDMA TN. Therefore, the current header format has implicit version 0x00. Otherwise Wireshark (or trx_sniff.py) would need to guess the header version, or alternatively follow the control channel looking for the version setting command. The reserved bit number 3 can be used in the future to extend the TDMA TN range to (0..15), in case anybody would need to transfer UMTS bursts. Change-Id: Idb0377d66290eb9c15d6998a5806a84fa2e5dd02 Related: OS#4006
2019-07-01trx_toolkit/data_msg.py: add burst randomization helpersVadim Yanitskiy1-18/+30
Change-Id: Idf1393d3d1f04e6c60b356b797a18e6f77b23554
2019-07-01trx_toolkit/data_msg.py: mark bit conversion methods as @staticmethodVadim Yanitskiy1-10/+14
Change-Id: I2f9fdd514908f186b1c6c043ee9b31c27a396900
2019-06-30trxcon/scheduer: fix: properly check rc of gsm0503_pdtch_encode()Vadim Yanitskiy1-1/+1
The gsm0503_pdtch_encode() returns negative number on error, and the amount of encoded bits in case of success. Change-Id: I7d75141142922909330c5e86be8734bb06cd57a4
2019-06-30trxcon/scheduler: enrich GSM 05.03 encoding error messagesVadim Yanitskiy5-6/+16
Change-Id: I35a7c5df4fc0ed2195ba721f92812874011459d9
2019-06-24trx_toolkit/data_msg.py: add basic class documentationVadim Yanitskiy1-0/+79
Change-Id: I538bc96e5e24d3b7e344e4dbe2877bf60c13c720 Related# OS#4006
2019-06-24trx_toolkit/data_msg.py: inline both gen_fn() and parse_fn()Vadim Yanitskiy1-14/+3
Both functions are never used outside of both gen_msg() and parse_msg(). AFAIR, they were more complicated until we started to use struct, but now they can be easily inlined. Change-Id: Ie64b271cf502f3df23b32f4b14a1e2b551a0f794
2019-06-24trx_toolkit/data_msg.py: drop double field initializationVadim Yanitskiy1-5/+0
Those fields are being initialized by __init__(). Change-Id: Ibf71be552a7eb5dab1d096421a8557514294683e
2019-06-24trx_toolkit/data_msg.py: tests: use random reference dataVadim Yanitskiy1-27/+14
Having fn = 1024 and tn = 0 in all tests decreases the chances to spot encoding / decoding bugs of higher or lower values. Let's randomize the reference data before all the tests. Change-Id: Id3c5be9faaf0bef727b975c7182098af0cec6e71
2019-06-24trxcon/scheduler: fix bit shift in BSIC / TDMA FN calculationEric Wild1-1/+1
Ubsan is unhappy about shifts into the sign bit of our implicitly promoted value. Change-Id: I4e72db1143a68064ba83668414dc3d60c0e1ad78
2019-06-02trxcon/l1ctl.c: properly handle handover RACH requestVadim Yanitskiy3-15/+20
During the handover the MS needs to release the existing dedicated channel(s), establish the new one(s) as indicated by the network, and then, depending on the synchronisation state, send one or more HANDOVER ACCESS messages carried by Access Bursts. In order to implement this, trxcon needs to be able to transmit Access Bursts on any TDMA timeslot regardless of the logical channel type and the associated handler, i.e. != TRXC_RACH. The controlling side on L1CTL (layer23 or TTCN-3) needs to send one or more L1CTL_RACH_REQ message(s) with properly populated UL info header. Otherwise a regular RACH on TS0 is assumed. Change-Id: Ia967820a536c99966ba2c60b63d2ea9edb093f46
2019-06-02trxcon/scheduler: fix: do not ignore SACCH prims with odd lengthVadim Yanitskiy1-4/+4
Before this patch, prim_dequeue_sacch() used to ignore SACCH primitives with odd length (e.g. 21, when sender forgot to push 2 octets of L1 SACCH header), so neither they were transmitted, nor rejected. As a result, they would stay in the Tx queue until a dedicated connection is released. The only way to notice such problem was looking at the constantly growing talloc's report. Instead of ignoring the primitives with odd length and keeping them in the queue, let's pass them to a logical channel handler, so they would be dequeued and rejected with a proper logging event. Also, to simplify further debugging, let's print the final decision of SACCH prioritization: whether it's a Measurement Report or not. Change-Id: I3149fa518439470b397953306209eb859c83450a
2019-06-01trx_toolkit/data_msg.py: fix: extend RSSI value range to [-47..-120]Vadim Yanitskiy1-1/+3
Change-Id: I9fce3462db14bd273a1498762cc9293fc888b45a
2019-05-31trxcon/sched_mframe.c: mark all stolen CBCH UL slots as TRXC_IDLEVadim Yanitskiy1-4/+4
According to 3GPP TS 05.02, section 6.4.1, CBCH replaces SDCCH number 2 in both V (BCCH+CCCH+SDCCH/4+SACCH/4) and VII (SDCCH/8+SACCH/8) logical channel combinations. Unfortunately it is not clear whether we can use stolen UL slots for RACH or not. For now, we should mark all of them as IDLE. Somehow TRXC_SDCCH4_2 slots were left in the definition of combination V (combined CCCH+BCCH). This is not critical, but may be looking confusing. Let's fix this. Change-Id: Id30f2fac3274de3edff4ae59f77d9c9cf8059155
2019-05-31trxcon/trx_if.c: Dropping UL bursts is a noticeable eventHarald Welte1-2/+3
Therefore we should use LOGL_ERROR instead of LOGL_DEBUG. Change-Id: If5084feb9e847d212530b1a5985390405d91008b
2019-05-31trxcon: Suppress POWERON to TRX if we're already powered on.Harald Welte3-3/+18
The existing logic unconditionally wants to send a POWERON command on TRXC whenever L1CTL_FBSB_REQ is received. That may cause some problems when sending subsequent L1CTL_FBSB_REQ, e.g. due to signal loss. Sending POWEROFF when transceiver is not powered on is normal though. This can happen if trxcon is restarted while fake_trx was running. The existing FSM state could unfortunately not been used, as it's a mixture between the TRX connection state and the command/response state. The current solution is just a work around. We definitely need to introduce separate state machines for transceiver and its TRXC interface. Change-Id: I834e8897b95a2490811319697fc7cab6076db480
2019-05-30trxcon/scheduler: move PRIM_IS[_EXT]_RACH macros to sched_trx.hVadim Yanitskiy2-9/+13
Both PRIM_IS_RACH() and PRIM_IS_EXT_RACH() macros to be used for handover RACH detection in the follow up changes, thus we need have them widely available. Let's also give them better names: PRIM_IS_EXT_RACH -> PRIM_IS_RACH11 PRIM_IS_RACH -> PRIM_IS_RACH8 and introduce a new generic one for checking whether a given primitive is RACH in general (either 8-bit or 11-bit) or not. Change-Id: Ibc39c57fda000647be1829786f6423dcf3f435cd
2019-05-29trxcon/l1ctl.c: on L1CTL_DM_EST_REQ, determine pchan_config firstVadim Yanitskiy1-8/+8
It makes sense to do this first, before tuning to a different ARFCN and changing the training sequence. Otherwise, if no multi-frame configuration is found, trxcon would switch to a different channel and then remain inactive there. Change-Id: I274588ce3a9c49372b5da0629930afece46f799c
2019-05-28trxcon/l1ctl.c: use #define for RSL_CHAN_RACHVadim Yanitskiy1-1/+2
Change-Id: Ifdb1703217c7540344cf6772efe812c8a786a0c2