summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-07-10[HACK] trxcon: permit event RX_DATA_IND in state FBSB_SEARCHfixeria/grgsm_hackVadim Yanitskiy1-1/+3
This is a work-around for grgsm_trx not sending us SCH bursts. Change-Id: Ic096d6c3b85b6a438848b0c5fbabe8f9ffee7569
2023-07-04modem: properly handle Dedicated mode or TBF IEVadim Yanitskiy1-12/+34
We need to distinguish between Uplink and Downlink TBF assignment in grr_rx_imm_ass(), because matching the Request Reference IE makes sense only for the Uplink TBF assignment. Uplink TBFs are requested by the UEs by sending RACH, while Downlink TBFs are assigned by the network itself. The Request Reference IE is only valid for Uplink assignments and shall be ignored in messages assigning Downlink TBFs. Change-Id: Idb9b3203147be3b42256c0bcab3ecdabcf2d2fa9 Related: OS#5500
2023-06-23layer23: use gsm0502_fn2ccch_block() from libosmogsmVadim Yanitskiy1-26/+2
Change-Id: I652a2ab9ddb3cb5082cce911a5cdb4cf8abcf552 Depends: libosmocore.git I8cbd31226754e95887358ed83a928e2f567f4cf3
2023-06-22layer23: cosmetic: move <lapdm.h> to other libosmo* importsVadim Yanitskiy1-1/+1
Change-Id: Id4d8df3f230729dc2c65e1bedea705e28feaa029
2023-06-17modem: cosmetic: fix formatting in modem_gmm_prim_up_cb()Vadim Yanitskiy1-2/+2
Change-Id: I1498b92f2dc3d056ca69072dfb077cba65b86b6e
2023-06-16layer23: fix handling of logging category mask (-d option)Vadim Yanitskiy2-2/+10
In change 67943df4 I broke handling of the logging category mask in the mobile app. Adding this option results in a segfault: ERROR: osmo_log_info == NULL! You must call log_init() before using logging in log_parse_category_mask()! Assert failed osmo_log_info src/libosmocore/src/core/logging.c:329 As can be seen, the problem is that we are calling log_parse_category_mask() before initializing the logging. As possible solution, I could rearrange the code to parse command line options after calling osmo_init_logging2(). This would fix the segfault, but would not fully solve the problem. If we call log_parse_category_mask() before parsing the config file, then logging configuration in the config file overwrites the logging configuration specified via the command line. But we want the opposite: the command line setting should overwrite the config file parameters. This is handy because there is no need to edit the config file if you quickly need to test something. So let's call log_parse_category_mask() after parsing the config file. Change-Id: I1b2b7804bf99b71f96e9197f7824cfd20431e8a1 Fixes: 67943df4 "layer23: fix parsing of command line options"
2023-06-15layer23: Update to libosmocore osmo_auth_gen_vec2Harald Welte1-2/+2
libosmogsm has recently deprecated the use of osmo_auth_gen_vec and the osmo_sub_auth_data structure in favor of newer versions of this API. Let's migrate to it Change-Id: I1d9751c5f74a59e7310d07d54a3fdbac213324bd Depends: libosmocore.git Ie775fedba4a3fa12314c0f7c8a369662ef6a40df
2023-06-14mobile: fix -Wlogical-not-parentheses in gsm48_cc_init()Vadim Yanitskiy1-1/+1
Found by clang: gsm48_cc.c:54:6: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] if (!cc->mncc_upqueue.next == 0) ^ ~~ Change-Id: Ic7ffd3aa25339e24a31bae1b7428f1f93e261858
2023-06-11trxcon: do not advance Uplink TDMA Fn by defaultVadim Yanitskiy1-2/+2
The idea behind advancing Uplink TDMA Fn is to give the transceiver, which is usually a separate process, some additional time to receive and prepare Uplink bursts for transmission. This comes at a price of having an additional delay between Uplink and Downlink. Given that trxcon, as a standalone application, is primarily used in conjunction with fake_trx.py for running ttcn3-bts-test against osmo-bts-trx, there is no reason to advance the Uplink TDMA Fn. Change-Id: I838b1ebc54e4c5d116f8af2155d97215a6133ba4 Related: OS#5500
2023-06-11trxcon: get rid of the timer driven clock moduleVadim Yanitskiy11-263/+16
trxcon was heavily inspired by osmo-bts-trx, and among with many other scheduling related parts also inherited the timer driven clock module. This clock module is driving the Uplink burst scheduling, just like it does drive the Downlink burst scheduling in osmo-bts-trx. Just like in osmo-bts-trx, the clock module relies on periodic CLCK indications from the PHY, which are needed to compensate for the clock drifting. The key difference is that trxcon is using Downlink bursts as the CLCK indications, see 'bi.fn % 51' in trx_data_rx_cb(). This is possible because the MS is a clock slave of the BTS: the MS PHY needs to sync its freq. and clock first, and only after that it can Rx and Tx. So far we've had no problems with the clock module in trxcon until we started adding GPRS support and integrated the l1gprs. While the CS domain is quite flexible in terms of timings and delays, the PS domain is a lot more sensetive to the timing issues. Sometimes it happens that the trxcon's clock module is ticking quicker than it should, resulting in Uplink PDCH blocks being scheduled earlier than the respective Downlink PDCH blocks are received: 20230502021957724 l1sched_pull_burst(): PDTCH/U Tx time (fn=56103) 20230502021957744 (PDCH-7) Rx DL BLOCK.ind (fn=56103, len=23): ... 20230502021957747 l1sched_pull_burst(): PDTCH/U Tx time (fn=56108) 20230502021957765 l1sched_pull_burst(): PDTCH/U Tx time (fn=56112) 20230502021957767 (PDCH-7) Rx DL BLOCK.ind (fn=56108, len=23): ... 20230502021957768 (PDCH-7) Rx UL BLOCK.req (fn=56112, len=54): ... 20230502021957784 l1sched_pull_burst(): PDTCH/U Tx time (fn=56116) 20230502021957784 TS7-PDTCH dropping Tx primitive (current Fn=56116, prim Fn=56112) This is impossible in reality, because Uplink is intentionally lagging behind Downlink by 3 TDMA timeslot periods. In a virtual setup this causes sporadic dropping of Uplink PDCH blocks, as can be seen from the logging snippet above, and significantly degrades the RLC/MAC performance for GPRS. Let's remove the internal clock module and trigger the Uplink burst transmission each time we receive a Downlink burst. This helps to overcome the GPRS scheduling issues and replicates the approach of osmo-trx-ms more closely. Change-Id: Ic8a5b6277c6b16392026e0557376257d71c9d230 Related: OS#5500
2023-06-11fake_trx.py: remove SETSLOT based burst filteringVadim Yanitskiy3-48/+0
For the sake of simplicity and due to some performance limitations, fake_trx.py does not generate TRXD NOPE indications for osmo-bts-trx on its own. It's actually trxcon sending NOPE.req (empty Tx PDUs) when it has nothing to send, and fake_trx.py simply converting them. In a follow-up change [1] we remove trxcon's internal clock module, making the Uplink burst scheduling being driven by Downlink bursts with the respective TDMA Fn/Tn values. Given that fake_trx.py is currently dropping bursts received for inactive timeslots, we would get NOPE.req only for a single timeslot, the one being currently active. This would break several testcases in ttcn3-bts-test. Remove SETSLOT based burst filtering, so that trxcon would still be able to generate NOPE.req for all, active and inactive timeslots. Downlink bursts for inactive timeslots are discarded anyway. Change-Id: Ia42550d5c2d8b49efbdf8ef0ce46b26afd1c464e Related: [1] Ic8a5b6277c6b16392026e0557376257d71c9d230 Related: OS#5500
2023-06-07modem: do not send RTS.ind if we got PTCCH/DVadim Yanitskiy1-0/+4
Change-Id: Idcdf56de7fc6279d8b942f3670ecdc6f88c3dfd1 Related: OS#5500
2023-06-07trxcon/l1sched: do not check TDMA Fn of PTCCH/U primsVadim Yanitskiy1-1/+0
The PTCCH/U primitives are basically Access Bursts. The TDMA Fn in such primitives is always 0, because there's currently no way to indicate TDMA Fn in L1CTL_RACH_REQ (only the offset). Change-Id: I54ba9b5d9c3eba4aeabf9ed6fcf1e8d09f21cce1 Fixes: BTS_Tests.TC_pcu_ptcch (UL part) Related: OS#5500, OS#5955
2023-06-07l1gprs: properly handle (forward) PTCCH/D blocksVadim Yanitskiy1-1/+10
Unconditionally forward PTCCH/D blocks towards the upper layers. Calling l1gprs_pdch_filter_dl_block() on them makes no sense. Change-Id: Ifcc53d442426c8bfdacd3d179e20bb45c43f4644 Fixes: BTS_Tests.TC_pcu_ptcch (DL part) Related: OS#5500, OS#5955
2023-06-06layer23: modem: Add helper function to get FN from gsm48_req_refPau Espin Pedrol1-4/+16
Change-Id: I1265a580f55473f52e77af6c5f53c1573f8f3e70
2023-06-06layer23: modem: Forward LLC-TRANSMITTED.ind RLCMAC->GMMPau Espin Pedrol1-2/+14
Change-Id: Ife91ad87fed78daf86e9f28ceed981d61799758e
2023-05-30trxcon/l1sched: rework burst buffer shifting for TCH/[FH]Vadim Yanitskiy2-40/+31
This is how the buffer shifting is implemented in osmo-bts-trx. Keep trxcon's l1sched implementation as close to osmo-bts-trx as possible in order to simplify the integration of CSD support. Change-Id: Idb6e415f37f41b8ab92a3864962dac0a40c2fbaa Related: OS#4396
2023-05-30layer23: modem: Forward Paging Request Type 1/2 to rlcmac layerPau Espin Pedrol1-6/+44
The RLCMAC layer in libosmo-gprs-rlcmac will decode the messages and if matching the MS, forward it to GMM, who will see if it requires initiating a packet access procedure. Change-Id: Iee4b5ee5e1e5874b550dd8536b095bf0b5eeb8f4
2023-05-30trxcon/l1sched: do not align Tx burst transmissionVadim Yanitskiy4-25/+6
This is no longer needed thanks to recent patch b0be904b. Change-Id: Ia397cbe16f719729a814b7ef0b7035c7fe8ba165 Related: b0be904b "trxcon: do not call l1sched_prim_dequeue() at ul_bid != 0"
2023-05-30trxcon/l1sched: cosmetic: use variable names like in osmo-bts-trxVadim Yanitskiy4-79/+81
This way it's easier to keep trxcon in sync with osmo-bts-trx. Change-Id: I8138a45cca4e9063bf7d36ebc920b20b755138dd Related: OS#4396
2023-05-30trxcon/l1sched: fix UL FACCH regression in tx_tchh_fn()Vadim Yanitskiy1-0/+3
In ad8f7794 I introduced a regression by removing the line setting lchan->ul_facch_blocks, breaking transmission of Uplink FACCH/H. Change-Id: I4f2bbbd30c7d5dbb979b54455561df3c0cc12aac Fixes: ad8f7794 "trxcon/l1sched: remove redundant TCH/[FH] prim length checks"
2023-05-29trxcon/l1sched: use sched_tchh_dl_facch_map[] in rx_tchh_fn()Vadim Yanitskiy1-2/+2
This is a more effecient way to check if FACCH/H is allowed. The mapping was added in a53e93fe9 and is already used for AMR. Change-Id: Ib4b409956326480679a436d28224b539d00779e2 Related: a53e93fe9 "trxcon: Initial support for forwarding AMR" Related: OS#4396
2023-05-29trxcon/l1sched: cosmetic: get rid of amr_is_cmr/fn_is_cmiVadim Yanitskiy2-18/+15
Change-Id: Ic8df73326befa387daead0a0dcbb8c9a1461021e Related: OS#4396
2023-05-29trxcon/l1sched: drop Tx prims for not supported TCH modesVadim Yanitskiy2-4/+8
Otherwise we'll be attempting to transmit the same prim again and again. Change-Id: I2f137a0b931e8e7d05a5d903023c50065f57bfa6 Related: OS#4396
2023-05-29trxcon/l1sched: remove redundant TCH/[FH] prim length checksVadim Yanitskiy2-57/+29
Both gsm0503_tch_[fh]r_encode() do check the given payload length in order to determine the payload and/or codec type. The same applies to gsm0503_tch_a[fh]s_encode(). There is no real need to implement additional length checks on top of that - drop them. Change-Id: Ib1adf4945fb762bc2a51a1008f6bef6784fb7833 Related: OS#4396
2023-05-26subscriber: Fix condition to print PTMSI signaturePau Espin Pedrol1-1/+1
Related: Coverity CID#316085 Change-Id: Ie9259141290200544981e815f4a1486584373014
2023-05-22layer23: modem: pass SIM-stored PTMSI (signature) & RAI to GMMPau Espin Pedrol2-0/+4
Depends: libosmo-gprs.git Change-Id Ia69b6f885d612c42ab015822031e4c7262f4714e Change-Id: If0eef0a60b310539f2e668238314481ad5b7a5fa
2023-05-22layer23: subscriber: Implement LOCIGPRS read/write for testcard backendPau Espin Pedrol5-5/+207
Change-Id: Ibcaaf430587a3a270398e9a9eeab6ee98514c3c8
2023-05-22layer23: subscriber: Implement LOCIGPRS read/write for simcard backendPau Espin Pedrol4-12/+173
Change-Id: Ida5bcfc896c75c238e2eb2d0aee742ae36fb5e16
2023-05-22layer23: Define sim_pin_required field as boolPau Espin Pedrol2-5/+5
Change-Id: I7c5105da08176f4743f1f3e56ddad9ac170717c7
2023-05-22layer23: Define barr field as boolPau Espin Pedrol3-4/+4
Change-Id: I02b95fa5437be1325cfa80fc40350280540fe802
2023-05-22layer23: Define (r)plmn_valid field as boolPau Espin Pedrol5-8/+8
Change-Id: Ia2316bae5e4f5035f31b4da3937e025537aaf224
2023-05-22layer23: Define always_search_hplmn field as boolPau Espin Pedrol4-7/+7
Change-Id: I0efc16a2362fbfec64cf6ca85bb32db8beb241a3
2023-05-22layer23: Define imsi_attached field as boolPau Espin Pedrol4-12/+8
Change-Id: I47e234dcef4c5af09023318dda45d40c8c92b312
2023-05-22layer23: vty: Rename testsim node functionsPau Espin Pedrol1-28/+28
Change-Id: If84297f026e6804436a0bf16c5c992161cd71ee4
2023-05-22Migrate network identifier fields to modern osmocom structuresPau Espin Pedrol19-766/+600
This allows using well tested standarized API to print, compare, etc. usual identifiers like PLMN, LAI, etc. It also simplifies code by avoiding passing lots of parameters and making it easier to identify which fields go packed together. This is specially important since in the future more of those identifiers will be added for GPRS. Change-Id: I07a9289825c09ed748e53d36a746ea164c8a5d7f
2023-05-19common: Mark gsm_networks staticPau Espin Pedrol1-1/+1
Change-Id: I662adb99080a8689dd7c97b1380cc4ec50958215
2023-05-19layer23: subscriber: Move generic APIs to the top sectionPau Espin Pedrol1-191/+192
This way we end up with the generic section on top, followed by each backend section clearly delimited. As a result, it is now much clearer the separation between the generic code and each backend specific implementation. Change-Id: Ice8ada52f227ee4da90ba37ec6b3eb8070621f85
2023-05-19layer23: split subscr_write_plmn_na() internally per-backendPau Espin Pedrol1-5/+26
Change-Id: I5e3a4996bbb5cbfbe81342eadb46aa10a2033fd9
2023-05-19layer23: subscriber: Split gsm_subscr_sim_pin() internally per-backendPau Espin Pedrol2-10/+32
Change-Id: I10968c5a43632e0e3054c2d6934cae0052c2daae
2023-05-19layer23: subscriber: Split gsm_subscr_write_loci() internally per-backendPau Espin Pedrol1-7/+26
Change-Id: I5f024972016afe0e161b745236c84b00ee44ad5e
2023-05-19layer23: subscriber: Split gsm_subscr_generate_kc() internally per-backendPau Espin Pedrol2-45/+76
Change-Id: I88365d23773a4bdc50a51807c775b3caff0bd425
2023-05-19layer23: Generalize subscriber SIM insert APIPau Espin Pedrol6-77/+73
With this patch, during VTY config the SIM type is selected, and the app calls a generic gsm_subscriber_insert() API which will take of internally initializing and starting whatever specific-backend setup is needed. Change-Id: I5aa34ae297ec0114e1d2355d59fdd77b43b35464
2023-05-19layer23: Move SAP init/close to be done during MS allocation/destructionPau Espin Pedrol2-12/+10
Change-Id: Ic20760228668db4cb2fc6cdea4fd0470c211ce0a
2023-05-19layer23: subscriber: Move generic code to the top out of sim backendPau Espin Pedrol1-45/+37
Change-Id: Ie96621f49122da54c68e40611c1f6553aa37ef11
2023-05-19layer23: subscriber: Move sap specific code inside subscriber.cPau Espin Pedrol3-5/+6
Step forward towards a generic subscriber interface. Change-Id: I780f06203cd6971866d81060a5ecee8bc00782f4
2023-05-19layer23: rework store & pass of test_sim param to gsm_subscr_testcard() APIPau Espin Pedrol5-43/+34
This way the gsm_subscr_testcard() API looks similar to that of other backends (sim, sap). Furthermore, the callers of the API don't need to pass tons of params. This is important since in the future there will be more params (eg. gprs related ones), so it makes no sense to keep increasing the param list in there. Change-Id: I07fc5a6ed59e65d6b96c0a2f87b1f496d39ad76d
2023-05-19layer23: Migrate sim_ustate to enum + value_stringPau Espin Pedrol2-13/+23
Change-Id: I83607caa0b76b6b30db59c53438a55726483b85d
2023-05-19layer23: Move all test_sim settings to its own substructPau Espin Pedrol6-70/+74
This way it becomes clear those fields are related only to test_sim module, and not some general "test" feature. Change-Id: I56830c6b905bcbce7e19adbfe5427fd826d15e8c
2023-05-18copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbHVadim Yanitskiy13-14/+14
Change-Id: I408cde7f2b4642500e5362052365c92856c02bef