Commit Graph

3619 Commits

Author SHA1 Message Date
Vadim Yanitskiy 0ee32177a2 trxcon/l1sched: rework burst buffer shifting for TCH/[FH]
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-30 19:35:29 +00:00
Pau Espin d400126d0f layer23: modem: Forward Paging Request Type 1/2 to rlcmac layer
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-30 16:31:09 +00:00
Vadim Yanitskiy af81e3ae59 trxcon/l1sched: do not align Tx burst transmission
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-30 17:18:13 +07:00
Vadim Yanitskiy 6f26f00603 trxcon/l1sched: cosmetic: use variable names like in osmo-bts-trx
This way it's easier to keep trxcon in sync with osmo-bts-trx.

Change-Id: I8138a45cca4e9063bf7d36ebc920b20b755138dd
Related: OS#4396
2023-05-30 17:18:13 +07:00
Vadim Yanitskiy f97238f766 trxcon/l1sched: fix UL FACCH regression in tx_tchh_fn()
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-30 17:14:30 +07:00
Vadim Yanitskiy 519f2d9c5b trxcon/l1sched: use sched_tchh_dl_facch_map[] in rx_tchh_fn()
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-29 18:51:04 +07:00
Vadim Yanitskiy f81a1711f2 trxcon/l1sched: cosmetic: get rid of amr_is_cmr/fn_is_cmi
Change-Id: Ic8df73326befa387daead0a0dcbb8c9a1461021e
Related: OS#4396
2023-05-29 18:51:04 +07:00
Vadim Yanitskiy 66c7ec1bf3 trxcon/l1sched: drop Tx prims for not supported TCH modes
Otherwise we'll be attempting to transmit the same prim again and again.

Change-Id: I2f137a0b931e8e7d05a5d903023c50065f57bfa6
Related: OS#4396
2023-05-29 18:51:04 +07:00
Vadim Yanitskiy ad8f7794c9 trxcon/l1sched: remove redundant TCH/[FH] prim length checks
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-29 18:51:04 +07:00
Pau Espin 74a02a5cac subscriber: Fix condition to print PTMSI signature
Related: Coverity CID#316085
Change-Id: Ie9259141290200544981e815f4a1486584373014
2023-05-26 13:12:08 +02:00
Pau Espin 2dfa84e73d layer23: modem: pass SIM-stored PTMSI (signature) & RAI to GMM
Depends: libosmo-gprs.git  Change-Id Ia69b6f885d612c42ab015822031e4c7262f4714e
Change-Id: If0eef0a60b310539f2e668238314481ad5b7a5fa
2023-05-22 16:12:09 +02:00
Pau Espin 8bd2e644b5 layer23: subscriber: Implement LOCIGPRS read/write for testcard backend
Change-Id: Ibcaaf430587a3a270398e9a9eeab6ee98514c3c8
2023-05-22 16:12:09 +02:00
Pau Espin 9be9a2ef7f layer23: subscriber: Implement LOCIGPRS read/write for simcard backend
Change-Id: Ida5bcfc896c75c238e2eb2d0aee742ae36fb5e16
2023-05-22 16:12:09 +02:00
Pau Espin ac8460c77b layer23: Define sim_pin_required field as bool
Change-Id: I7c5105da08176f4743f1f3e56ddad9ac170717c7
2023-05-22 16:12:09 +02:00
Pau Espin fd461b0218 layer23: Define barr field as bool
Change-Id: I02b95fa5437be1325cfa80fc40350280540fe802
2023-05-22 16:12:09 +02:00
Pau Espin 741ef88d42 layer23: Define (r)plmn_valid field as bool
Change-Id: Ia2316bae5e4f5035f31b4da3937e025537aaf224
2023-05-22 16:12:09 +02:00
Pau Espin 4c8017f011 layer23: Define always_search_hplmn field as bool
Change-Id: I0efc16a2362fbfec64cf6ca85bb32db8beb241a3
2023-05-22 16:12:09 +02:00
Pau Espin c2402244c1 layer23: Define imsi_attached field as bool
Change-Id: I47e234dcef4c5af09023318dda45d40c8c92b312
2023-05-22 16:12:09 +02:00
Pau Espin e1bef2d89c layer23: vty: Rename testsim node functions
Change-Id: If84297f026e6804436a0bf16c5c992161cd71ee4
2023-05-22 16:12:09 +02:00
Pau Espin 3348f49179 Migrate network identifier fields to modern osmocom structures
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-22 16:12:04 +02:00
Pau Espin 554e7cfb56 common: Mark gsm_networks static
Change-Id: I662adb99080a8689dd7c97b1380cc4ec50958215
2023-05-19 13:56:58 +02:00
Pau Espin 2ee1e23d93 layer23: subscriber: Move generic APIs to the top section
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-19 13:56:58 +02:00
Pau Espin 09382eca8b layer23: split subscr_write_plmn_na() internally per-backend
Change-Id: I5e3a4996bbb5cbfbe81342eadb46aa10a2033fd9
2023-05-19 13:56:58 +02:00
Pau Espin 1f525ea71f layer23: subscriber: Split gsm_subscr_sim_pin() internally per-backend
Change-Id: I10968c5a43632e0e3054c2d6934cae0052c2daae
2023-05-19 13:56:58 +02:00
Pau Espin 99d82d17a1 layer23: subscriber: Split gsm_subscr_write_loci() internally per-backend
Change-Id: I5f024972016afe0e161b745236c84b00ee44ad5e
2023-05-19 13:56:58 +02:00
Pau Espin 48382f3797 layer23: subscriber: Split gsm_subscr_generate_kc() internally per-backend
Change-Id: I88365d23773a4bdc50a51807c775b3caff0bd425
2023-05-19 13:56:58 +02:00
Pau Espin 7b53ad536c layer23: Generalize subscriber SIM insert API
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-19 13:56:58 +02:00
Pau Espin 8be5119702 layer23: Move SAP init/close to be done during MS allocation/destruction
Change-Id: Ic20760228668db4cb2fc6cdea4fd0470c211ce0a
2023-05-19 13:56:58 +02:00
Pau Espin 5906bee946 layer23: subscriber: Move generic code to the top out of sim backend
Change-Id: Ie96621f49122da54c68e40611c1f6553aa37ef11
2023-05-19 13:56:58 +02:00
Pau Espin fd1552c225 layer23: subscriber: Move sap specific code inside subscriber.c
Step forward towards a generic subscriber interface.

Change-Id: I780f06203cd6971866d81060a5ecee8bc00782f4
2023-05-19 13:56:58 +02:00
Pau Espin 1ad195e28f layer23: rework store & pass of test_sim param to gsm_subscr_testcard() API
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-19 13:56:58 +02:00
Pau Espin f05ac96fd6 layer23: Migrate sim_ustate to enum + value_string
Change-Id: I83607caa0b76b6b30db59c53438a55726483b85d
2023-05-19 08:53:50 +00:00
Pau Espin 4ea84d3ae5 layer23: Move all test_sim settings to its own substruct
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-19 08:53:50 +00:00
Vadim Yanitskiy 7a6e1874cb copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
Change-Id: I408cde7f2b4642500e5362052365c92856c02bef
2023-05-18 18:51:15 +07:00
Vadim Yanitskiy a449a39ce1 contrib/jenkins.sh: uncomment verify_value_string_arrays_are_terminated.py
Change-Id: Iad9a6546fa7e2a654ed3217c2a875357ef5cc804
2023-05-17 10:55:55 +00:00
Vadim Yanitskiy fd060aecf5 layer23: make verify_value_string_arrays_are_terminated.py happy
Change-Id: I664d9b8f77522126406db5e3a301f1f132748e0b
2023-05-17 10:55:55 +00:00
Pau Espin 1a720cd176 Use OSMO_STRLCPY_ARRAY instead of strcpy
Change-Id: I6b9bfffd715c4238289b693740585ec08f8d8d16
2023-05-17 11:34:22 +02:00
Pau Espin 1897218be4 sim: Introduce EF.LOCIGPRS file structure
Change-Id: Idf93b4ece0a966754f8caacc665038c321b752bb
2023-05-17 10:54:13 +02:00
Pau Espin e5ba8e1603 layer23: Define EF.LOCI Location Update Status values with an enum
Change-Id: Ia54026fa8e4fca05da71e1e6a2dbdb8d900f0dd0
2023-05-17 10:53:41 +02:00
Pau Espin 0cbf3afc15 layer23: modem: pass pco & qos from apn
Change-Id: I4088e3e96a58bd667627023f144a05137415dd32
2023-05-15 12:05:58 +02:00
Pau Espin 39b04cf6ef layer23: modem: Use in SN SAP the TLLI retrieved from GMM and SM
Depends: libosmo-gprs.git Change-Id I7b1b8ac414474652b438f15b7f07961032a0f56d
Change-Id: Icac16626a6b89489b7f1ee2ab8ffbaca04e8bacc
2023-05-15 12:05:51 +02:00
Vadim Yanitskiy 80de799514 virt_phy: fix TDMA Fn math in l1ctl_rx_rach_req()
Change-Id: I7922dd2d3257257b3bf8711ec859dd99463adc39
Related: OS#5500
2023-05-10 02:44:02 +07:00
Vadim Yanitskiy 8e78ff491b virt_phy: l1ctl_rx_rach_req(): remove TDMA Fn hack
This looks like a debugging leftover.

Change-Id: Id794c76aea48a171f0c5f4604892a82c1a2d3ed4
2023-05-10 02:40:45 +07:00
Vadim Yanitskiy 0684e2313e virt_phy: l1ctl_rx_rach_req(): use the indicated chan_nr/link_id
Change-Id: I820f32851f1c7a39695270cc246964a3e212118f
2023-05-10 02:37:47 +07:00
Vadim Yanitskiy 68556f3566 virt_phy: fix l1ctl_rx_rach_req(): send RACH on TS0, not TS1
Change-Id: I096e377de9e74893e9eb1927707d5e1a44b15ad9
2023-05-10 02:37:47 +07:00
Vadim Yanitskiy 7ce8cdd325 trxcon/l1sched: allocate primitives of fixed size (64 + 64)
When running trxcon with GSMTAP Um logging enabled (-g cmd line arg),
in handle_prim_rach_cnf() we msgb_put() one or two bytes to the given
msgb.  This causes a segfault, because the L1SCHED_PRIM_T_RACH prims
have 0 tailroom bytes available.

While we could allocate L1SCHED_PRIM_T_RACH with a few extra bytes,
a more fundamental approach is to allocate all l1sched primitives with
a fixed tailroom.

Change-Id: Ica87b147e11744a69dcd7c056376dcf6b98f9ca6
Fixes: ff9db9de "trxcon/l1sched: rework the primitive API"
Related: OS#5500
2023-05-08 06:16:59 +00:00
Pau Espin 00fd8d237b layer23: Store and use SAPI & NSAPI in apn->pdp
Change-Id: If82c94ca9c84a94e63a9a5d642a27a7b4e3ff089
2023-05-04 12:03:52 +02:00
Pau Espin bbfb569b8e layer23: Introduce apn_fsm
This allows further control on the state of the APNs, as well as
a step further towards administering them through VTY.

Change-Id: I2cc732dfb020d31ab89025e7e22276b819dcb24a
2023-05-04 12:03:52 +02:00
Pau Espin bb5e13ca23 layer23: modem: gmm: Activate PDP Context of APN after GPRS attach
Change-Id: Icb667a6a3359267d2eb20e11a40eb27a8c3f7e2d
2023-05-04 12:03:52 +02:00
Pau Espin c16126317d layer23: modem: grr: Log ignored CCCH ImmAss
There seems to be some bug when using virtphy where sometimes the
received T2 and/or T3 in the ImmASs is not matching what we sent.
This helps in showing the problem and not failing silently.

Change-Id: Iaecd2616733d84f35a825916fe888142800b426b
2023-05-04 12:03:49 +02:00