summaryrefslogtreecommitdiffstats
path: root/src/host/layer23
AgeCommit message (Collapse)AuthorFilesLines
2024-06-15mobile: fix -Wmaybe-uninitialized in gsm48_rr_tx_meas_rep()HEADmasterVadim Yanitskiy1-0/+1
This is very unlikely to happen, because we set strongest to 127, but anyway we don't want to see those warnings: gsm48_rr.c: In function ‘gsm48_rr_tx_meas_rep.isra’: gsm48_rr.c:3714:74: warning: ‘strongest_i’ may be used uninitialized [-Wmaybe-uninitialized] 3714 | if (rrmeas->nc_rxlev_dbm[i] == strongest && i <= strongest_i) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ gsm48_rr.c:3696:31: note: ‘strongest_i’ was declared here 3696 | int i, index, strongest_i; | ^~~~~~~~~~~ Change-Id: I111438633ed48e16f7c43fc1b7a23ae6753a404d
2024-06-15mobile: cosmetic: fix -Wswitch in tch_voice_state_init()Vadim Yanitskiy1-1/+1
Not really critical, just make gcc happy: tch_voice.c: In function ‘tch_voice_state_init’: tch_voice.c:117:9: warning: enumeration value ‘TCH_VOICE_IOH_GAPK’ not handled in switch [-Wswitch] 117 | switch (state->handler) { | ^~~~~~ Change-Id: I46afce396f730de26f21e0e4ec71e144aafd6beb
2024-02-06mobile: fix GAPK I/O producing too many UL framesVadim Yanitskiy6-71/+18
GAPK I/O is currently generating too many UL voice frames, causing Tx queue overflow in the L1 PHY. Change the logic to make DL voice frames drive the Uplink processing chain, like we do for CSD. Change-Id: I3a7fa223cb592acd5b850819e0682c9c8f81e9d1
2024-02-06mobile: set TRAFFIC.{ind,req} mode during call establishmentpespin/masterVadim Yanitskiy5-65/+51
Now that we support data (CSD) calls in addition to voice calls, we can no longer initialize the TRAFFIC.{ind,req} routing mode in gsm48_rr_init(). We need to apply the appropriate TCH routing mode *during call establishment* based on its type and the configured I/O handler type. After this patch, one can have the following configuration: tch-voice io-handler l1phy tch-data io-handler unix-sock io-tch-format ti so that the io-handler setting for voice would not affect data calls. Before this patch, the L1 PHY (specifically, Calypso firmware) would not route TRAFFIC.{ind,req} during data calls at all. Thanks to this patch, it's also no longer required to restart the mobile application after changing voice or data I/O handler. Change-Id: Iab68cb47c28380a9c1efc149c6196ea54f75fdb8 Related: OS#4396
2024-02-06mobile: init TCH state earlier (on receipt of CC ALERTING)Vadim Yanitskiy2-11/+29
During a Mobile Originating voice call, we would normally start receiving traffic indications with ringback tone (or even some melody) before the call gets CONNECTed. So in order for the user to be able to hear that, we need to init the voice call handler earlier (on receipt of CC ALERTING message). We should not be transmitting voice/data frames before the call gets CONNECTed, so add 'rx_only' flag to the TCH state. In tch_send_msg() drop msgb if this flag is set. Rx only mode makes no sense for data calls, so in tch_recv_cb() we discard received DL frames and thus do not trigger sending UL frames. Change-Id: Idd32c823639cc1f9999d77fcefe7e260e31a85ec Related: OS#4396
2024-02-06mobile: use tch_send_msg() in tch_csd_tx_to_l1()Vadim Yanitskiy1-1/+1
Do not access the RR API directly, use TCH API for sending UL data. Change-Id: Icd5b5fad835feecd96a83fa5c83ed08037826fa6 Related: OS#4396
2024-02-06mobile: disable TCH/F14.4 (not implemented)Vadim Yanitskiy1-1/+1
Change-Id: Ia8dff81d4b56c9d6599059f3a5a2964d3cd95829 Related: OS#4396, OS#6346
2024-02-06mobile: assert() values returned by get_string_value()Vadim Yanitskiy1-1/+6
Change-Id: I58bc31a4c3d952f71ed2c53b65bb30538172ca4e
2024-02-06mobile: cosmetic: fix '(ptr *) foo' shour be '(ptr *)foo'Vadim Yanitskiy1-4/+4
Change-Id: Id6ed92b27c61ae9dfbb702a3abdc75e5daa8235d
2024-02-05layer23/modem: handle and forward L1CTL UL BLOCK.cnfVadim Yanitskiy5-4/+62
Change-Id: I9255ac17529b5ac260f9a0f141f3af6b3b72a802 Depends: libosmo-gprs.git I145b9586f83ae0235b4648916bd44996e8dc57f0
2024-02-05layer23: cosmetic: clarify GPRS related L1CTL loggingVadim Yanitskiy1-2/+2
Change-Id: Idcde85c132a52b7bc6c3f2f58c2eac0a509b7b43
2024-02-05modem: Improve logging when forwarding data to GRRPau Espin Pedrol1-1/+6
Change-Id: Idf80c0fa1c8293afbe354442a72f5b1c5a84f9e1
2024-02-05apn_fsm: Set default timeout for APN activation to 65sPau Espin Pedrol1-1/+1
The current timeout is too low, taking into account that SM PDP Activation timeout is already 30. When SM fails, it will retry sending PDP Context Activation Req. Hence, give it enough time to at least retry once, plus some extra buffer time (eg to go through GMM attach once). Change-Id: I34f9b0a5ad5767155dc3e4c0ac1c4bf1521be596
2024-02-03mobile: fix -Wmaybe-uninitialized in tch_csd_rx_{to,from}_l1()Vadim Yanitskiy1-0/+8
It's unlikely to happen as long as all TCH_DATA_IOF_* variants are handled in the switch statements, but still gcc does complain. Change-Id: I0a81d5c4f11feb7cf73771c23848dee9ce6ec620
2024-01-26mobile: VTY: store/read data call params to/from config fileVadim Yanitskiy1-105/+212
We already have VTY commands to configure data call parameters at run-time, but so far there was no way to save and restore them. This commit adds the respective commands to TCH_DATA_NODE. Change-Id: I4453f2e7e048b3f3ebb1727f6d26f018c792c92d Related: OS#4396
2024-01-26mobile: fix rate adaption checking for MO/MT CSD callsVadim Yanitskiy2-11/+34
Currently we unconditionally expect the rate adaption (octet 5) in the Bearer Capability IE to be GSM48_BCAP_RA_V110_X30. This is correct for UDI (GSM48_BCAP_ITCAP_UNR_DIG_INF), but not for 3.1 kHz audio (GSM48_BCAP_ITCAP_3k1_AUDIO) and fax (GSM48_BCAP_ITCAP_FAX_G3) calls. For the later two it should be GSM48_BCAP_RA_NONE. Change-Id: I70d36b3540ed2469068e050809a17ed07b434ad7 Related: OS#4396
2024-01-26mobile: properly handle different TRAFFIC.{ind,req} formats for CSDVadim Yanitskiy1-16/+30
So far we supported the Texas Instruments format (TCH_DATA_IOF_TI), which is used by Calypso based phones (e.g. Motorola C1xx), but not the format that trxcon speaks/understands (TCH_DATA_IOF_OSMO). Change-Id: Ib17e800e91ad536db53aa55661076089f0ce34b0 Related: OS#4396
2024-01-26mobile: VTY: disable DATA_CALL_TR_V34_9600 (not supported)Vadim Yanitskiy2-2/+6
We cannot initiate V.34 data calls because gsm48_encode_bearer_cap() does not support octet 6d. This variant should not be selectable. Change-Id: Ibafb9a693654672fb9a6abf665c500a27c87bf22 Related: OS#4396, OS#6344
2024-01-26modem: fix assigning .timer_cb twice (-Winitializer-overrides)Vadim Yanitskiy1-1/+0
Change-Id: Id2d565a5035c47053c0dfa5ad9be3378471b6e14
2024-01-24mobile: VTY: rework data type/rate configuration commandsVadim Yanitskiy4-109/+197
Change-Id: I7393fce82613a57275033f5c47e16bbf708a3bfb Related: OS#4396
2024-01-24mobile: VTY: make soft-UART parameters configurableVadim Yanitskiy4-4/+146
Change-Id: I48bb58aaf1101fbc0e58db3fb1100927e506ede2 Related: OS#4396
2024-01-24mobile: VTY: use 'enum gsm48_bcap_transp' from libosmogsmVadim Yanitskiy4-33/+10
Change-Id: Iebc0692f17a5a5d04e57d74a720db52775937bdd Related: OS#4396
2024-01-24mobile: handle V.24 line status updates from V.110 TAVadim Yanitskiy1-2/+26
Change-Id: I05ba2e10fefe3cae687831b5ced971aa244ad336 Related: OS#4396
2024-01-24mobile: add a separate logging category for CSDVadim Yanitskiy4-19/+26
Change-Id: If9db0759aeb4324ace9ae258c852787f37897d83 Related: OS#4396
2024-01-20mobile: fix unsupported data rate (UR/IR) messagesVadim Yanitskiy2-4/+4
Change-Id: I4f68cc999cb7bf9c5a17c8650de0411248420c1e Related: OS#4396
2024-01-20mobile: implement sending CSD data over UNIX socketVadim Yanitskiy4-11/+309
Change-Id: Id054af7b3d9d0a41715f7981deb420f6e09bf30c Related: OS#4396
2024-01-20mobile: integrate V.110 TA & soft-UART from libosmocoreVadim Yanitskiy5-13/+498
Change-Id: I7ac9c0e5010730fa4d8bc7a7a3c7ff85e11731c0 Depends: libosmocore.git I6d2f8e250df31c233a2741163113dc07515409ae Depends: libosmocore.git I5716bd6fd0201ee7a7a29e72f775972cd374082f Depends: libosmocore.git I2ca95963fd5852ddb89bdd35b86b31489127fe84 Related: OS#4396
2024-01-20mobile: split voice specific TCH handling into its own fileVadim Yanitskiy3-118/+170
Change-Id: Ib917d95fe77da3e60bc932cce56714d81095c7d4 Related: OS#4396
2024-01-18mobile: rename tch_send_voice_{msg,frame}() functionsVadim Yanitskiy4-9/+9
These functions can also be used for sending data frames (CSD). Change-Id: Ib55b4405847f2efb583f3a379ff4b6929d6d6c5b Related: OS#4396
2024-01-18mobile: init/deinit GAPK I/O based on CC transaction eventsVadim Yanitskiy7-122/+255
Change-Id: I28f87f6a6de673611aa02a24e8985aee23d4498b Related: OS#4396
2024-01-17mobile: cosmetic: use consistent naming for gapk_io_stateVadim Yanitskiy1-40/+40
Change-Id: I96a995bdf20c95a15271de68fbf434e101047313 Related: OS#4396
2024-01-17mobile: store MNCC Bearer Capability in CC transactionVadim Yanitskiy2-0/+20
We will need to know the current Bearer Capability of a CC transaction in the upcoming patches adding CSD support. Change-Id: Ifc3ecf832a552c65444f49711ac836b6cd984715 Related: OS#4396
2024-01-17mobile: add generic signals for CC/SS/SM transactionsVadim Yanitskiy4-10/+32
This allows driving logic in other modules based on transaction related events, such as allocation, deallocation, or a state change. These new signals will be used in the upcoming CSD implementation. Change-Id: Idae5da24cb517878a26cc14b2ba6976e60f0b31b Related: OS#4396
2024-01-17fixup: mobile: always check return value of tlv_parse()Vadim Yanitskiy1-1/+1
Fix a regression: check if Location Area Information IE fits. Change-Id: I51e2ae1be1c51a6359f8b0faad56f654251f1413 Fixes: bb0ac02e "mobile: always check return value of tlv_parse()" Fixes: CID#341618
2024-01-17mobile: gsm48_mm_data_ind(): check if struct gsm48_hdr fitsVadim Yanitskiy1-3/+11
A similar check was recently added to gsm48_cc_data_ind(). Change-Id: Ibc5153df41e2c6365a3c65b1906d440a1074514b Related: 273d412a "mobile: gsm48_cc_data_ind(): check if struct gsm48_hdr fits"
2024-01-16mobile: mncc_recvmsg(): fix 'msg_type' param typeVadim Yanitskiy1-1/+1
Change-Id: I5146637f1c45044d0df258aa3d82fa9454898c92 Related: OS#4396
2024-01-16mobile: gsm48_cc_data_ind(): check if struct gsm48_hdr fitsVadim Yanitskiy1-6/+12
Change-Id: I06c1877f603d3de0210dee7033ef163637c22054 Related: OS#4396
2024-01-16mobile: always check return value of tlv_parse()Vadim Yanitskiy4-64/+134
Change-Id: Id02fc0b1af6da939cb72f327c7d2ddca484ca063
2024-01-16layer23: drop unneeded forward declarationVadim Yanitskiy1-1/+0
Change-Id: I75bd08c1a88ad75d93a519422dfb7922c37a27a3
2024-01-16mobile: fix segfault on empty TRAFFIC.indVadim Yanitskiy1-0/+4
The L1 PHY may emit empty TRAFFIC.ind in case of decoding errors. Abort execution of pq_audio_sink early, otherwise we hit an assert. Change-Id: Ice11b72ddfd51fbfb17a4c609c664b86a8f69591
2024-01-08layer23/ccch_scan: use osmo_mobile_identity APIHarald Welte1-48/+34
* Migrate from deprecated gsm48_mi_to_string() API. * Take a chance to unfify printing of mobile identity. * Use osmo_load32be() for printing TMSI - this is what the osmo_mobile_identity API does internally. Change-Id: Ida67adaa61689c55505a89e1a1bebde041c91139 Depends: libosmocore.git If4f7be606e54cfa1c59084cf169785b1cbda5cf5
2024-01-08layer23/mobile: use osmo_mobile_identity APIHarald Welte1-25/+19
Migrate from deprecated gsm48_mi_to_string() API. Change-Id: Ib0d7f76cd635e8d1092ffc1d07ecb29ec0435dda Depends: libosmocore.git If4f7be606e54cfa1c59084cf169785b1cbda5cf5
2023-12-09layer23: fix incorrect check in gsm_arfcn_refer_pcs()Vadim Yanitskiy1-1/+1
Change-Id: I1f4107bdbb0f696ed3bd3cceaa94353ebe69f78f Fixes: 046ee64e3dd7bf285d0e965996bde47acae53099 Fixes: CID#336542
2023-12-04Correctly assemble measurement result into MEASUREMENT REPORTAndreas Eversberg1-3/+10
After adding the strongest cell to the measurement report, the variables 'strongest' and 'strongest_i' are used to prevent that already added cells are added again. Please note that there are no neighbor cell measurements available, because current layer 1 does not report BSIC of neighbor cells. This means that there is no neighbor cell reported. Related: OS#6280 Change-Id: Iaeeaf978da31611c47a20af41790bfa6640dcffd
2023-12-04Correctly initialize neighbor cell measurement list from SI5*Andreas Eversberg1-1/+1
A wrong index was used, causing the first neighbor cell to be uninitialized. This uninitialized neighbor cell was reported by MEASUREMENT REPORT. Related: OS#6280 Change-Id: I192c0777450cbe24abb3c7c8736c678b97725e9f
2023-11-27mobile: Fix PCS ARFCN handling: PCS can only be ARFCN 512..810Andreas Eversberg4-41/+49
While it is correct to use the band indicator from SI1 rest octets, it may only be applied for ARFCN values in the range 512..810. The function gsm_refer_pcs() is used to determine, if the cell (which 'talks' about ARFCNs) refers to them PCS or DCS channels. It returns true, if it refers to PCS, but this only means that ARFCNs in the range 512..810 are PCS channels, not all ARFCNs. The new function gsm_arfcn_refer_pcs() is used to add the PCS flag to an ARFCN, if the given cell refers to PCS and the given ARFCN is in the PCS range 512..810. Change-Id: Id99c8534bf853f4f24f99364790c1ac1df6cc007 Related: OS#6078
2023-11-27LAPDm: Enable flag to prevent sending two subsequent REJ frameAndreas Eversberg1-0/+1
Setting the flag was not required in earlier versions of libosmogsm, because this feature was enabled by default. The roundtrip delay for a LAPD link must be less than T200. Osmocom-bb runs LAPDm on the host machine via serial interface and USB interface that may cause a roundtrip delay that exceeds T200. Also osmo-bts may have that problem, due to latency between physical interface and osmo-bts software. What may happen: An I frame gets lost. The sending side transmits the next I frame. The receiving side detects the send-sequence error and responds with a REJ frame. Due to the round trip delay, the T200 expires on the sending side and causes the I frame to be retransmitted with the P bit set, it enters the timer recovery state. The receiving side detects the send-sequence error and responds with a REJ frame with the F bit set. The sending side will then receive two REJ frames. The first REJ frame will clear the timer recovery state. The second REJ frame (with F bit set) is received when not in timer recovery state, causing an MDL-ERROR-INDICATION. The layer 2 connection is broken. Early tests with osmocom-bb in a real network showed exactly this problem. The solution is to suppress every second REJ frame at the receiving side, until the sequence error condition is cleared. If the first REJ frame gets lost, the sending side would retransmit the I frame again after another expiry of T200. Then the receiving side would respond with a REJ frame again. Relates: OS#5969 Depends: libosmocore.git I93994dbbd1fc2c9edb8f3015c6b18ecd0fce0565 Change-Id: Iaa1645fb1970fe513d71bc1b03f7c5eac62f35d7
2023-11-10ASCI: Notify talker in the VTY that he cannot leave the call while talkingAndreas Eversberg1-0/+2
Related: OS#5364 Change-Id: I497efc5bddc122cd5744de531917aad415ac1654
2023-11-03mobile: rename voice.[ch] to tch.[ch]Vadim Yanitskiy9-31/+31
Also take a chance to change the 'tch_' prefix for all functions. Change-Id: I05e1ae777add73672db61565c77c68d8ab2b08f0 Related: OS#4396
2023-11-03mobile: cosmetic: rename gsm48_rr_tx_{voice->traffic}()Vadim Yanitskiy3-3/+3
Not only this function can be used to transmit a voice frame, but also a data frame during a CSD call. Change-Id: I920300ae477e3c3d7c413cd1a35f2bc385266960 Related: OS#4396