summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-08-29trx_toolkit/data_msg.py: fix: make sure header version is knownVadim Yanitskiy1-3/+5
Before using DATA_MSG.HDR_LEN, we need to make sure that a parsed header version is known and supported. Otherwise we will get an IndexError exception. Change-Id: Ie1887aa8709da1a2a287aa58a7873e72c0b4ed33
2019-08-29trx_toolkit/data_msg.py: fix message length check in parse_msg()Vadim Yanitskiy1-3/+8
Unlike DATA_MSG.HDR_LEN, the CHDR_LEN is a constant that defines length of the common header, which is mandatory for every version. DATA_MSG.HDR_LEN in its turn defines length of the whole header, including the version specific fields. Thus we need to know the header version before using it. In DATA_MSG.parse_msg() we need to parse the common header first, so then we know the version and length of the whole header. After that we can safely use DATA_MSG.HDR_LEN. Change-Id: I2809f5f96209eed64bdabf7a15575144313f7cc9
2019-08-27trx_toolkit/trx_sniff.py: also print header for incorrect messagesVadim Yanitskiy1-1/+4
Change-Id: I376f1e7af46750e53305109cf4a9f64427b9960c
2019-08-27trx_toolkit/trx_sniff.py: also validate() sniffed messagesVadim Yanitskiy1-0/+1
Change-Id: Ica3e4702fdabfdae0c1025b650ff32c8e85a6edf
2019-08-27trx_toolkit/trx_sniff.py: print exact message parsing errorVadim Yanitskiy1-5/+5
For sure, the following message is much more informative: Ignoring an incorrect message: Unhandled version 12 than: Failed to parse message, dropping... NOTE: since the way of printing exceptions is different in both Python versions, I had to drop Python 2 support. Change-Id: I5fb02ce508c58ff94e47accc0ed655939eb53062
2019-08-27trx_toolkit/data_msg.py: raise exceptions from validate() methodsVadim Yanitskiy3-61/+74
Raising exceptions is a Pythonic way to handle errors, which in this particular case will help us to know *why* exactly a given message is incorrect or incomplete. Change-Id: Ia961f83c717066af61699c80536468392b8ce064
2019-08-11fw: Add support for Huawei GTM900-B modulesSteve Markgraf5-1/+464
Both MG01GSMT and MG01GSMT hardware variants are supported and automatically detected based on the flash manufacturer. Change-Id: I3a770ea93fc72c4e9b63078e253602f204b5be23
2019-08-11fw/flash: Read extended ID, expose APISteve Markgraf2-14/+36
We now unlock the flash before reading the extended ID (required for Spansion and Samsung flash chips). These commands will be ignored by Intel/ST flash chips, and this change has been verified with all flash chips we support. Furthermore, expose the API for reading the flash ID. Change-Id: I3bcd71c84c8931bcd574953063737b51a41738a3
2019-08-11fw/keypad: Poll Iota powerbutton if requiredSteve Markgraf4-8/+27
This commit adds polling of the TWL3025 PWON signal. If the powerbutton is pressed on targets that use it (Pirelli DP-L10, Huawei GTM900-B), a normal keypad scanning cycle is started in order to preserve the timing, required for the 500ms power off press duration for example. Change-Id: I904baf40d621bd680b602b88d12ff462b3c17596
2019-08-11fw/abb/twl3025: Add function to query PWON stateSteve Markgraf2-0/+30
This allows us to detect power button presses on the Pirelli DP-L10 and the Huawei GTM900-B module. Polling will only be activated once the power button has been pressed and we received the interrupt. The goal is to reduce the required amount of TWL3025 register accesses to a minimum. Change-Id: I31be61c8089173aed616abd1ede6c4cf5c9b6770
2019-08-11fw/build: Use arm-none-eabi as default toolchainSteve Markgraf1-1/+1
This is what we describe in our wiki and what ships with recent distros. Change-Id: I70da7eeb33275fa5fff1d8a3581c384e031b12e5
2019-08-09fb_tools/bdf_to_c.py: make it compatible with python3Alexander Couzens1-33/+33
This would break python2 compatibility. Change-Id: Iaa20dd0aafa20e36186cf8dfe4d0ac9ab638f235
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-10contrib/jenkins.sh: run "make maintainer-clean"Oliver Smith1-0/+6
Related: OS#3047 Change-Id: I11c37f72b6e4294d1dc7b6d1751627ccf4f5c87a
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