Commit Graph

1032 Commits

Author SHA1 Message Date
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 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
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
Pau Espin fbd2f733a7 layer23: modem: Delay GPRS attach at startup until modem is ready
Wait until SIM is ready, network system information ws obtained and
it announced the MS is able to use GPRS against it.

Change-Id: I5029d9e8a47b8544b3b803c4db6352269bac3c0e
2023-05-03 18:38:34 +02:00
Pau Espin 8d996de55b layer23: modem: sndcp: Properly inform SNDCP layer of ownership transfer
Change-Id: Icc3351f360e41d4a95e056b4fd797c7d133e8a83
2023-05-03 18:37:46 +02:00
Pau Espin 0e836fb0dd layer23: modem: sm: Properly inform SM layer of ownership transfer
Change-Id: I95ed63fe6442369ab3afb75cbd9908b87addbb3e
2023-05-03 16:07:33 +02:00
Pau Espin fa4293d93a layer23: modem: sndcp: Forward LL-XID.req SNDCP->LLC
Change-Id: Icbc033cd0659bba75bb280a3d46e76edd2e20226
2023-05-03 16:07:33 +02:00
Pau Espin 19c87cf7d4 layer23: modem: Resolve auth requests coming from GMM layer
Change-Id: I75dc3fe3e4d9e23443fb778e36ca024f1bc46641
2023-05-02 12:27:03 +02:00
Pau Espin 09b971d8b9 layer23: modem: Store P-TMSI allocated by the network
Change-Id: Ide686230336d68153db59e76dd97b7e7c6f500d8
2023-04-26 14:14:29 +02:00
Pau Espin 9f2561a592 layer23: modem: Store P-TMSI independently in subscriber
Change-Id: I6f6d230d8c3c4fce27ba87cf9f953dc9db83cb72
2023-04-26 14:14:29 +02:00
Pau Espin 993c4b4be6 layer23: vty: Move imei related commands to common/
Change-Id: I3c71586c0eb437ce63beaae5adf8fac6c27e2896
2023-04-26 14:14:29 +02:00
Pau Espin a85b6a7bd5 layer23: modem: Forward GMM primitives up to SM layer
Change-Id: I5c5416775ccce4a1cbc70c8f6ba4fc25ace12d6f
2023-04-26 14:14:29 +02:00
Pau Espin 6be26a97bf layer23: Use subscriber information and events to trigger GMMREG Attach
Change-Id: I1c7cc120ff4098c0b845e13a6e5e5db8b7e18376
2023-04-26 14:14:29 +02:00
Pau Espin c58b5f0dbc layer23: vty: Move sim related commands to common/
Change-Id: I9e95732255c248b000f1045c395a15217d10db78
2023-04-26 14:14:29 +02:00
Pau Espin da13bed837 layer23: Move 'show {subscriber,support}' to common/'
Those modules are aready in common/, so they can be added to the shared
VTY interface to introspect MS objects.

Change-Id: Ie4d85bbb1d0af8894683589d8b936f9884f79be9
2023-04-26 14:14:29 +02:00
Pau Espin ae8725fc85 Initialize/release sim & subscriber ms parts in common/
Change-Id: Ifb88f7e4dcc049a687af213be597d495731b24b9
2023-04-26 14:14:29 +02:00
Pau Espin 95988ff288 layer23: Use GSM23003_IMEI(SV)_NUM_DIGITS from libosmocore
Change-Id: I12a96043947c0f5366f550944a4df5edd2fd2c9d
2023-04-26 14:14:29 +02:00
Pau Espin 7d45f4d4ee layer23: Use OSMO_IMSI_BUF_SIZE from libosmocore
Note: GSM_IMSI_LENGTH was 16 octets, and OSMO_IMSI_BUF_SIZE is 17
octets. Probably a bug in old osmocom-bb code since that code predates
the one in libosmocore.

Change-Id: I295444bb3b75ed236ea4af5563d9a9c9e590cab7
2023-04-26 14:14:29 +02:00
Pau Espin 7626d0816f layer23: Use GSM_RESERVED_TMSI from libosmocore everywhere
Change-Id: Ib9483b8ae4067994aef523291733ae706ffabe7a
2023-04-26 14:14:29 +02:00
Pau Espin 3c348f5893 layer23: Call telnet_exit() during app exit if VTY support is enabled
Change-Id: Ic8540c73b1b13134e11f254beb6a16f7e4452317
2023-04-26 14:14:29 +02:00
Pau Espin 8cc6740448 layer23: mobile: Mark several functions static
Change-Id: Ifdeef9373b903d14fb2f4ec4caa1bf8c42b45aa1
2023-04-26 14:14:29 +02:00
Pau Espin e8fc1e9228 layer23: modem: Unregister registered callbacks upon app exit
It's just a good practice to delete all resources allocated during startup.
The main aim here is to keep resemblance to what the mobile app is doing,
so that they can slowly be merged and some functionalities from the mobile app can be
added to the modem app, like shutting down the MS without killing the process eventually.

Change-Id: I5a641fa3dadb6ea7346b25a20215896ab32eb805
2023-04-26 14:14:08 +02:00
Pau Espin 0683b9033f layer23: modem: Set on tun the IP address received during PDP Ctx Act Accept
Change-Id: I39c27caeff0ccd08d8d8b5fcba5a1d69238d53ca
2023-04-25 22:16:26 +00:00
Pau Espin 651426fee4 layer23: Decouple SIM events from MMR events
let the specific app handle the events generated from the
subscriber/SIM.
All the MMR specific code can for now stay in mobile/ while SIM support
can be in common/ without violating layers (common/ calling functions in
mobile/).

Change-Id: I473887e0fd9338d76a69a9774145a04575f14b64
2023-04-25 18:14:33 +02:00
Pau Espin f99819a4f2 mobile: Fail VTY command if attching test SIM card fails
Change-Id: Ie5a395de6c926f13ce9324b93da0e348da5438d1
2023-04-25 18:14:33 +02:00
Pau Espin 65cde7dd04 layer23: modem: Fix wrong 'radio not started' vty message
Change-Id: I8871c9d0e820beb75d7820b5a2d8d3c77dac379d
2023-04-25 18:14:33 +02:00
Pau Espin 7019f1bf2b layer23: Move testsim node to common/
Change-Id: Ife34403a715809b43e7a4cd5ce4dec8616fc08af
2023-04-25 18:14:25 +02:00
Pau Espin 234c1f14fd layer23: Use libosmocore API to validate IMSI string
Change-Id: I2d4737dabcfb83a7b675c35ad973029a36658d5b
2023-04-24 17:06:10 +02:00
Pau Espin a78c3927a0 layer23: common/vty: Drop includes pointing to mobile app
Change-Id: I025b09500547a739240fc07fa04cb38378ed71db
2023-04-24 16:56:15 +02:00
Pau Espin a7bf51ac0e layer23: Move vty_notify() to common/
Change-Id: Ic0a98e66adffa9fefeee6e69a4b5c691e0e9c789
2023-04-24 16:54:11 +02:00
Max 46f49131da mobile: log unhandled event name
Change-Id: Id8e6e8af5756e3527ca1968b24f25e4238f0aa40
2023-04-23 12:51:18 +00:00
Pau Espin 1cb78f3114 layer23: modem: Forward SNSM primitives SNDCP<->SM layers
Related: OS#5501
Depends: libosmo-gprs.git Change-Id Ic5525bfa92e2591757d999610c0d59849d022d8d
Change-Id: Iad63f41557fbd078588dd890e2f18ed9606a25f7
2023-04-14 19:05:04 +02:00
Pau Espin 4ba8db561e layer23: modem: sndcp: Apply API change in libosmo-gprs-sndcp
Depends: libosmo-gprs.git Change-Id Iebce37a50917b13c23de1528469d66c310ced7f2
Related: OS#5502
Change-Id: I4f559e4a882a85742c45609dec596f0485eafed0
2023-04-14 18:34:18 +02:00
Pau Espin 7035b8095c layer23: modem: llc: Fix typo LLGM -> LLGMM
Depends: libosmo-gprs.git Change-Id I59577d27bedd26903c9b1bfc64792f0891cea728
Change-Id: I786661894fc6772784ba6f0d2fdb45bbdca5254c
2023-03-30 14:17:47 +02:00
Pau Espin a89939a68b modem: initial SM layer support through libosmo-gprs-sm
Depends: libosmo-gprs.git Change-Id I9b4a9a6364f7799540475e7e1d10ab2310768281
Related: OS#5501
Change-Id: I9476d93954c7dc348e6f97ca89eaa651f802f9a0
2023-03-30 13:52:50 +02:00
Pau Espin 79ea13fccc layer23: Support cpu-sched vty node from libosmocore
Change-Id: I1affb401bf355360fe306568c9b5c005dbd0746c
2023-03-29 13:08:17 +02:00
Pau Espin 7b8cc36ad0 layer23: modem: fill imsi & imei in vty 'test gmm attach'
Related: OS#5501
Change-Id: If93f7e2cbb421d0aa2702b8e130c8602fbc18a97
2023-03-28 10:59:23 +02:00
Pau Espin 3e31b3232d layer23: modem: Forward GMMRR primitives between GMM and RLCMAC layers
Related: OS#5501
Change-Id: I7603d8bbda0cdd437eb7557267efb7bbc3552565
2023-03-28 10:59:20 +02:00
Pau Espin 574177d2ce layer23: rlcmac: Support GMM detaching from VTY
Related: OS#5501
Depends: libosmo-gprs.git Change-Id If6cbb1d425b3a9f713348f1dea4747e2b6be0a44
Change-Id: Idca0bff6fc3e6a16b5e8379eae3315e3af012d78
2023-03-27 11:23:40 +02:00
Vadim Yanitskiy d692e6ca9c modem: set logging cat for OSMO_GPRS_RLCMAC_LOGC_TBF{UL,DL}
... otherwise the library will be using default DLGLOBAL.

Change-Id: I98efa4c8137c7ec57da6ef7ea1307b4e46b4fc98
Related: OS#5500
2023-03-25 06:04:19 +07:00
Vadim Yanitskiy 848b859f30 layer23: add missing log_info_cat[] entry for DGMM
Change-Id: Icdc09b6edce7abb3ff88f12650d3b304447d39a6
Fixes: 1612c8f86 "layer23: modem: Depend on libosmo-gprs-gmm"
Related: OS#5501
2023-03-25 06:04:19 +07:00
Pau Espin e8a3ad2216 layer23: modem: Test GMM layer through VTY
Recent work on libosmo-gprs-gmm already allows triggering GPRS Attach
procedure. Let's add some code to use it so we can already test the
entire stack GMM->LLC->RLCMAC (SM layer still missing).

Depends: libosmo-gprs.git Change-Id I212053b3a3f27ef7d63503c3d5ef08453b2d2056
Related: OS#5501
Change-Id: Iba0663075468670a29aceafe5196cae3cab050eb
2023-03-23 15:50:13 +01:00
Vadim Yanitskiy 3b582af2eb modem: route L1CTL prims to/from libosmo-gprs-rlcmac
Change-Id: I38e9a686f8edc3fe55f961d75e68602c33bbbaaf
Related: OS#5500
2023-03-17 12:15:29 +00:00
Vadim Yanitskiy bb6df124d2 layer23: implement Rx/Tx API for GPRS related messages
Change-Id: I87950e893ef96ff8328f43f1548111aa9f66439b
Related: OS#5500
2023-03-17 12:15:29 +00:00
Vadim Yanitskiy e15996378f modem: fix modem_gmm_prim_up_cb(): add missing break
Change-Id: Ibd16232d76d83d90f27d08b47aa38509161270b6
Fixes: CID#311019
2023-03-17 16:21:00 +07:00
Vadim Yanitskiy 4949ab7471 layer23/{mobile,modem}: prefix VTY prompt with project's name
Change-Id: If7ce89362c75e2c15995dfb08cfcfdcad24e2529
2023-03-17 16:11:48 +07:00
Vadim Yanitskiy b2dfbb8859 layer23/{mobile,modem}: fix segfault on VTY connection
It was a mistake to call vty_init(), passing it a pointer to the
vty_app_info structure allocated on the stack, because it gets
overwritten when the calling function _vty_init() returns.

Change-Id: I75843a964254243c70bedcf8ff97d854107ee21a
Fixes: 9feb5057 "layer23: refactor the application API concept"
2023-03-16 23:41:48 +00:00
Vadim Yanitskiy 42ca40dd1e modem: add test VTY command for sending raw LLC PDUs
Change-Id: I14f58e715d77a1b1cb40fdd3ddd09084360f2274
Related: OS#5500
2023-03-16 13:47:06 +00:00
Vadim Yanitskiy b29a26c620 modem: add test VTY command to send CHANNEL REQUEST
Do not call grr_tx_chan_req() unconditionally from grr_rx_bcch().
Add a special (hidden, expert mode) VTY command for that.

Change-Id: I049a8d7f58ae9703d06dff235973ba376702c873
Related: OS#5500
2023-03-16 13:46:53 +00:00
Pau Espin 1612c8f862 layer23: modem: Depend on libosmo-gprs-gmm
Related: OS#5501
Change-Id: I82a2b9c043eae42435ca781689fc3381e7a31bea
2023-03-15 15:38:54 +01:00
Vadim Yanitskiy 7ea900525c modem: clean up #includes (using include-what-you-use)
Change-Id: I728f3eea1590f46bef6e0eb4beb9714f6c9a1614
2023-03-14 15:06:26 +00:00
Vadim Yanitskiy 8240ef74fc modem: move GRR specific code into its own file
Change-Id: I25caa0bd01e3d090803512f5b13cad58439f44f8
Related: OS#5500
2023-03-14 15:06:26 +00:00
Pau Espin b8c3bef737 layer23: Call osmo_fd_unregister() before closing and changing bfd->fd
Change-Id: I886062c1a944acf0982755a7acddf7e2233d13a8
2023-03-14 12:17:36 +00:00
Vadim Yanitskiy 6db5f8b9ce modem: get rid of app_data.chan_req, use ms->rrlayer
Change-Id: I77d0a834a73c511f157c6f1524b9e98df3f4def4
Related: OS#5500
2023-03-14 18:51:09 +07:00
Vadim Yanitskiy 7f9c01f00f modem: get rid of app_data.{ccch_mode,si}, use ms->cellsel
Change-Id: Ib711a3b893c43c0875c431c90cd0a2ebfafe1926
Related: OS#5500
2023-03-14 18:51:09 +07:00
Vadim Yanitskiy 67943df4b7 layer23: fix parsing of command line options
After the recent refactoring, parsing of the command line options is
broken for some arguments.  Specifically, the value of '-a'/'--arfcn'
is ignored and hard-coded ARFCN=871 is used instead.

The problem is that l23_app_init(), which allocates an MS state and
sets the initial ARFCN, is called *before* handle_options().  So the
cfg_test_arfcn is used before it gets overwritten from the argv[].

The usual approach in osmo-* apps is to parse the command line
arguments first, and only then execute code which depends on
configurable parameters.  Let's follow this approach too.

Change-Id: I77ca11c14561fa3fcb9add60ccea5b0b847a20c4
2023-03-13 06:18:02 +07:00
Vadim Yanitskiy 9feb5057da layer23: refactor the application API concept
With this set of changes we have a cleaner l23 app architecture:

* struct vty_app_info: all l23 applications must define this struct;
* struct vty_app_info: *cfg_supported() becomes a mask of L23_OPT_*;
* struct vty_app_info: explicitly set L23_OPT_* in all l23 apps;
* drop l23_app_info(), there can be only one vty_app_info per an app;

It's no more needed to obtain the vty_app_info by calling a function
and checking the returned value against NULL everywhere.  This kind
of information is rather static (not dynamically composed) and needs
not to be encapsulated into functions.

Change-Id: I89004cd5308927305f79b102f7b695709148df6d
2023-03-13 06:16:48 +07:00
Max 22f12ba92e vty: fix local-host docs
Change-Id: I69d0fa32105a3d114cdcae84ef2cc3ada578f13a
2023-03-08 22:05:07 +03:00
Max 736438693e mobile: allow configuring local GSMTAP address
Change-Id: Ia1555db653cf0bb20af74617f33aad31c971bfdb
2023-03-08 17:47:04 +00:00
Max e2930dad35 mobile: log state/event details on error
Change-Id: I24a4635e9a9a0984c0e1036e8b6ea19b08a06223
2023-03-06 17:27:39 +00:00
Max 9a9fca7e1d mobile: deprecate --gsmtap-ip option
Change-Id: I44b355f9a0bafee16a284537de76662a61111b09
2023-03-06 15:19:56 +00:00
Max 69bbbc5249 mobile: log MCC/MNC of the network while registering
Change-Id: I114eade36303f161fea171745a1a9b05e461e349
2023-03-06 15:16:35 +00:00
Max 42beda4557 mobile: drop duplicated #define
Change-Id: If5bda46dcc5b541a9d08cfd880a2a8f181426484
2023-03-04 23:15:18 +03:00
Pau Espin 35f93ac454 modem: Use libosmo-gprs-rlcmac L1CTL primitives
Related: OS#5500
Change-Id: I9d3066f19077796b2ccf70b15cc57b6488f015be
2023-02-27 14:50:56 +00:00
Max 0fb9853582 mobile: add vty statsd support
Change-Id: I7905b44478dcb9bcf0a1a68fde95f470c07edca3
2023-02-21 08:49:13 +00:00
Oliver Smith 65957cf877 Run struct_endianness.py
Ensure there is no diff to prepare to run this in CI.

Related: OS#5884
Change-Id: I617c967c5f34c0be2cf6fd43ceb1af17897f2bf1
2023-02-20 11:18:43 +01:00
Pau Espin f1e99e59e2 layer23: Support configuring GSMTAP through VTY in l23 apps.
This allow all l23 apps supporting L23_OPT_VTY and L23_OPT_TAP to
dynamically configure gsmtap through a "gsmtap" VTY node:

gsmtap
 remote-host 127.0.0.1
 lchan sacch
 lchan lsacch
 lchan sacch/4
 lchan sacch/8
 lchan sacch/f
 lchan sacch/h
 lchan unknown
 lchan bcch
 lchan ccch
 lchan rach
 lchan agch
 lchan pch
 lchan sdcch
 lchan sdcch/4
 lchan sdcch/8
 lchan facch/f
 lchan facch/h
 lchan pacch
 lchan cbch
 lchan pdch
 lchan pttch
 lchan cbch
 lchan tch/f
 lchan tch/h
 category gprs dl-unknown
 category gprs dl-dummy
 category gprs dl-ctrl
 category gprs dl-data-gprs
 category gprs dl-data-egprs
 category gprs ul-unknown
 category gprs ul-dummy
 category gprs ul-ctrl
 category gprs ul-data-gprs
 category gprs ul-data-egprs

VTY cmd "lchan" enables/disables tapping on general channel types,
while "category" allows fine-grained selection of messages being
tapped within the enabled lchan which would tap those messages.

Change-Id: I2582a1633d37d350a7f4c2bb5e03793bdf46e839
2023-02-02 18:18:21 +01:00
Pau Espin 3531b9afb6 layer23: Use updated libosmo-gprs-rlcmac header name
header file name gprs_rlcmac.h was renamed to csn1-defs.h during recent
libosmo-gprs-rlcmac development. Use the new names everywhere.

Depends: libosmo-gprs.git Change-Id I84ea63ed0b804699fd995a2e0c07ced17b3ad4c8

Change-Id: I205536907d9062b78453ce9bc404db1633e9a616
2023-02-01 17:38:52 +01:00
Pau Espin 59f3e4d4fb Get rid of openbsc leftover references
Get rid of the global variable since it's only used once inside a
function anyway.

Change-Id: I0b4f536b16f3693ef16de8505036943c3a30b1df
2023-01-31 12:30:07 +01:00
Pau Espin 738b65d240 layer23: Integreate mobile further into l23_app
Several functions and data structures in mobile app are refactored to
follow more closely the l23_app API and structures. These movements
allow starting to use already some shared infrastructure defined under
layer23/common.
This is not a full migration to l23_app, since mobile still keeps a
separate main() with a few extra code. This commit is rather a step
towards an eventual merge of mobile's main.cpp into
layer23/common/main.c

This is a preparation commit to later one adding gsmtap VTY configuration
to all l23 apps.

Change-Id: I3141b6cb4a0482970f434180ef8dda3af1d4aa0c
2023-01-31 11:59:08 +01:00
Pau Espin 60716bcfe6 modem: Initial integration of libosmo-gprs-rlcmac
This commit places code to forward unitdata LLC<->RLCMAC.

Depends: libosmo-gprs.git Change-Id I1870fa6a264612c5a669bfb832e6e8c0a892cb74
Related: OS#5500
Change-Id: I0e628d9ddaa5ad6a205f07746d4176d1b8df7eb0
2023-01-30 19:57:36 +00:00
Pau Espin 53996bb3d8 modem: Initial integration of libosmo-gprs-{llc,sndcp}
Change-Id: I820328009ccdd1f8112aeb163efa064ec1465d2a
2023-01-30 19:57:36 +00:00
Pau Espin c9cc4c305d Depend on libosmo-gprs-{llc,sndcp}
These will be needed for the MS to speak SNDCP and LLC.

Change-Id: I80811f73b798151257107bc94aedabe71fee0300
2023-01-19 20:02:17 +01:00
Pau Espin 3da09d1f7e layer23: Initial integration of tun device
Use the new tundev API from libosmocore to create tun devices for each
configured (and enbled) APN.
No address nor routes are yet set on the tun devices because we still
lack GMM/SNDCP/LLC/RLCMAC layers to negotiate them.

A follow up patch will add some code to interact with the SNDCP layer.

Depends: libosmocore.git Change-Id I3463271666df1e85746fb7b06ec45a17024b8c53
Change-Id: I86cac406843157aa2e51727cf8ccac9804d7961d
2023-01-19 20:02:07 +01:00
Pau Espin 6327f40be6 layer23: Introduce APN VTY node
This commit adds an initial set of VTY commands to manage APN
configuration and set up, which is used by the modem app.

The sample modem.cfg file is updated to showcase how to configure APNs.
The app doesn't do anything with them yet. A follow up patch will add
code to create tun devices for each configured APN.

Change-Id: I7b4eaa0de428b418bb1d89bd544694e89beb3e6e
2023-01-19 19:12:09 +01:00
Pau Espin c1bddf20b5 layer23: main: Log line about using config file before parsing it
Change-Id: I66b5b18887b8deb37c3784fec90644470498d7b5
2023-01-17 19:49:10 +01:00
Pau Espin 50097dd4c0 layer23: Use shift operand to define bitmask values
Change-Id: I22e2f543c077a4df4623c5e3bd44f8f068596baf
2023-01-17 19:49:10 +01:00
Pau Espin b8cc5b8c9a layer23: generate config.h
Follow-up commits will add some extra checks we want to have in config.h
Include config.h in files using PACKAGE_VERSION.

Change-Id: Ic779a3168012780feef8d173371387d09d383bfd
2023-01-17 18:16:34 +00:00
Pau Espin 0621ff9cbd layer23: ms.h: Use enum type in ms->shutdown
Change-Id: I5456f7a8675e6ab620bc93b56e2c4ad22d3900e8
2023-01-17 18:16:34 +00:00
Pau Espin 3d3505b726 layer23: Let each app allocate its ms obj and start layer2 when needed
This allows apps to allocate the objects as they please: simple apps can
statically allocate it at startup. Others may want to allocate them
through VTY.
Some apps may also want to dynamically start and stop layer2.

Change-Id: I32f99df76a5513eff9df5489d28d60aedf96dec3
2023-01-17 18:16:34 +00:00
Pau Espin 8f59b1a0b9 layer23: Move layer2-socket VTY command to common/
This allows configuring layer2-socket for other apps than mobile, like
the "modem" one.

Change-Id: If7419f8fc54a54eed68a076968d93dba5ac977b7
2023-01-17 18:16:34 +00:00
Pau Espin 3b8d5bb26a layer23: Move '(no) shutdown' VTY code to common/vty.c
Change-Id: Ib5c9b6f3efa255d67980945db9f98dd8a112af0e
2023-01-17 18:16:34 +00:00
Vadim Yanitskiy eb654c07d2 layer23: fix integer overflow in l1ctl_tx_data_req()
Found by clang:

  l1ctl.c:397:52: warning: implicit conversion from 'int' to 'int8_t'
                  (aka 'signed char') changes value from 255 to -1
                  [-Wconstant-conversion]

Change-Id: I23e9ea5ad59099c24db60057c8e7da1e6a0d2293
2023-01-17 18:10:55 +00:00
Pau Espin 0fe3f7d4e5 layer23: Move settings.{c,h} under common/
Some of those can be reused by other apps (like modem).

Change-Id: I0a741b2384195d512fdc49eda6762241f385b1f1
2023-01-16 13:34:31 +01:00
Pau Espin 93aa93b6c4 layer23: Move script_lua_close() call outside of settings.c
The only caller of gsm_settings_exit() is in app_mobile so far, which is
the only app supporting/using lua scripting so far.

Change-Id: I634a4514ead9d064e7509c3fbbb3a2c89c7f3a56
2023-01-16 13:34:31 +01:00
Pau Espin f15eeadb21 layer23: Move subscriber.{c,h} under common/
Some of those can be reused by other apps (like modem).

Change-Id: I3727e40bcc9a4ee93aaf2c4ced070cc789653e80
2023-01-16 13:34:31 +01:00
Pau Espin 2b03270b30 layer23: Move support.{c,h} under common/
Some of those can be reused by other apps (like modem).

Change-Id: I3c5af4db8e603aa004d0b6410b09b5143173b874
2023-01-16 13:34:31 +01:00
Pau Espin adb67e5106 layer23: Initial VTY framework to share VTY code between apps
A small layer23 framework is added which allows apps to easily share/reuse
VTY commands while giving some flexiblity to add new per-app
specific configs/cmds, since not all commands may be relevant for all
apps.

Some of the mobile app code is moved to common, and sample infra is
added to modem app.
Future commits will most probably keep moving more stuff mobile->common
and then reusing those in modem app, as found needed.

Change-Id: Iabfb3129199488d790b89884bc1e424f2aca696f
2023-01-16 13:34:28 +01:00
Pau Espin b54dbfcde9 mobile: settings.h: Add missing type forward declaration
Change-Id: Ibdfa905e2bd24f03d23ce114e969647b07a2009f
2023-01-16 10:31:01 +01:00
Pau Espin fb030a8897 layer23: Initialize osmocom_ms further in common code
Change-Id: Ic629cf229167ddd4c533a2abf1b82ad78d1144a9
2023-01-16 10:30:56 +01:00
Pau Espin 9010a6be52 layer23: mobile: Several fixes and improvements in show_ms_cmd
Fix missing VTY param description.
Fix wrong indentation.
Fix unneeded else after early return.

Change-Id: I4a55328e71ec16355974c20275c0e525077252e1
2023-01-16 10:30:15 +01:00
Pau Espin ea03422cd8 layer23: mobile: Fix typo in vty string
Change-Id: I05238b72735600aae46126c24d5e96444e91ef06
2023-01-16 10:30:15 +01:00
Pau Espin 1953a21515 layer23: Move osmocom_ms to a separate file
This way we can extend its API and contents more easily,
and keep most of it together in one place.

Change-Id: Icb4891cc1e4a0ecb5f09cb8a84b0ebe1b91a46b8
2023-01-16 10:30:12 +01:00
Pau Espin ed9ae46f1d layer23: Add missing header dependencies to several files
Change-Id: I9819b12d1c24f6ee197daa887452b09418d689e8
2023-01-16 10:19:34 +01:00
Pau Espin cf2d8296bb cosmetic: layer23: Fix trailing whitespace
Change-Id: Ibc464923ac8add74b2b6d57d183fb307be650679
2023-01-16 10:19:34 +01:00
Pau Espin 463b3634ed layer23: misc/log.h: Fix missing pragma once
Change-Id: Ie57357224ba5ed2bf691e2912ede7ee19012b6dd
2023-01-16 10:19:34 +01:00
Pau Espin 1eb8614b9d layer23: common/sim.h: Fix missing pragma once
Change-Id: Icebe803c7896347915ed72b80d5504d15d717ef3
2023-01-16 10:19:34 +01:00
Pau Espin aef45d8008 cosmetic layer23/mobile/gsm322: Fix trailing whistespace
Change-Id: I32d28ac219d2a573a77a0041a774ca7427388fb0
2023-01-16 10:19:30 +01:00
Pau Espin 1412c49fed cosmetic: layer23/include/common/Makefile.am: Set one item per line
Change-Id: I2e385d403bd37ad9491fd421509fe7e4104225f9
2023-01-13 12:16:47 +01:00
Pau Espin 73abbc235e layer23: Add initial VTY support for l23_apps
Initial VTY "boilerplate" code for modem app is already added in
this commit as a showcase what's needed by an app to have the VTY
config file read and VTY interface initialized.

Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
2023-01-13 12:16:47 +01:00
Pau Espin 2b9191f08b layer23: Move extern declaration of l23_ctx to l23_app.h
This way all apps can access it.

Change-Id: I570d31cc4014b54b47b11a3a52791f62c999cad8
2023-01-13 12:16:47 +01:00
Pau Espin cd76fcc4ec layer23: Introduce l23_app_start() API step
This commit is a preparation towards having shared VTY infrastructure
for layer23 apps. Having 2 steps (first init(), then start()) allows
the apps easily struct allocation & initialization, and then start doing
work after VTY config has been read.

Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
2023-01-13 12:16:47 +01:00
Vadim Yanitskiy 522b92eae4 modem: fix wrong chan_nr (missing tn) in modem_rx_imm_ass()
Change-Id: Iba68424e6db0ad655c6146d92edd3cc90e2e2566
Fixes: 49d993e4ab
Related: OS#5500
2023-01-12 23:21:46 +06:00
Vadim Yanitskiy fe240d613b modem: fix -Wmaybe-uninitialized in modem_rx_imm_ass()
Change-Id: I773b13e3c7b7546a6cdd7d0b729cca8687b0a131
Fixes: 49d993e4ab
Related: OS#5500
2023-01-12 22:55:42 +06:00
Vadim Yanitskiy 1e8c6defaf modem: fix modem_tx_chan_req(): check if SI13 was received
There was no need for this check because the channel establishment
logic was at the end of handle_si13(), so I overlooked this.

Change-Id: I829948de325461ab5d7e950493497a7537ba06ac
Fixes: 8a506dcd4e
Related: OS#5500
2023-01-12 21:25:25 +06:00
Vadim Yanitskiy c209242d19 modem: send CHANNEL REQUEST from modem_rx_bcch()
Sending CHANNEL REQUEST from handle_si13() was a bad idea because
this function returns early if SI13 was received before SI1.

Change-Id: I21f1d68cb9b1d20b356697ba1efe28c3d87fa004
Fixes: 49d993e4ab
Related: OS#5500
2023-01-12 14:55:01 +00:00
Pau Espin 372f65d172 cosmetic: layer23: Drop unnecessary space before function pointer arguments
As requested by linter.

Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0
2023-01-12 13:18:02 +00:00
Pau Espin 7c3eb69c67 layer23: Fix gcc warning sprintf() writing on too short buf
Triggered with gcc 12.2.0:
/osmocom-bb/src/host/layer23/src/common/sysinfo.c: In function ‘gsm48_sysinfo_dump’:
/osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:42: warning: ‘sprintf’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
  198 |                 sprintf(buffer + 69, " %d", i + 63);
      |                                          ^
/osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:17: note: ‘sprintf’ output between 3 and 13 bytes into a destination of size 12
  198 |                 sprintf(buffer + 69, " %d", i + 63);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
2023-01-12 13:18:02 +00:00
Vadim Yanitskiy 49d993e4ab modem: request an Uplink TBF, match Immediate Assignment
Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Related: SYS#5500
2023-01-12 19:05:42 +06:00
Vadim Yanitskiy e9abf7b61d layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()
Change-Id: Ia9309a037cc09c2a0de2f64521a57e0567fbec11
Fixes: CID#307087, CID#307088
2023-01-12 09:17:27 +06:00
Vadim Yanitskiy befe5d5d33 modem: fix unusual argument order: *ms always first
Change-Id: I9fabe39575f191ce6c893a1fecaa7ac040ef0e3e
Related: SYS#5500
2023-01-07 08:30:02 +07:00
Vadim Yanitskiy bc6cab1947 modem: do not depend on $(top_srcdir)/src/misc/rslms.c
Change-Id: Ic4d7e1956530aa10ff3125d6d857efe47ea37d38
Related: SYS#5500
2023-01-07 08:23:59 +07:00
Vadim Yanitskiy afd13e9adf modem: passive decoding of SI{3,4,13} and IA Rest Octets
Use the existing application skeleton from '$(top_srcdir)/src/common/'.
Use the LAPDm glue from '$(top_srcdir)/src/misc/rslms.c'.
This is what the misc applications like ccch_scan are using.

Change-Id: I8566a3cdc9f818bed7e28ea4b1957dce735c298b
Related: SYS#5500
2023-01-07 01:42:28 +07:00
Vadim Yanitskiy 413bcf8ef4 layer23/sysinfo: implement decoding of SI13 Rest Octets
Change-Id: Ia6ff7d4e37816c6321b54c1f7f8d7110e557f8c5
Related: SYS#5500
2023-01-07 01:42:28 +07:00
Vadim Yanitskiy eee91ab17d host/*/configure.ac: set -std=gnu11
Avoid using different dialects by accident (and resulting compiler
errors if compiler assumes a different dialect), like in [1].

Related: https://lists.osmocom.org/pipermail/openbsc/2019-September/013030.html
Related: https://lists.osmocom.org/pipermail/openbsc/2021-January/013360.html
Related: [1] libosmocore.git I72310886bef4db635078b75715c9d98ee45391cc
Change-Id: I48ec1703de04f40ea530f4b4442084fdc94dc966
2023-01-05 22:24:37 +07:00
Vadim Yanitskiy 5d634b6118 gsmmap: move this utility to 'layer23/src/misc/'
What I find weird is that the gsmmap is using files from layer23,
and vice-versa cell_log from layer23 is using files from this
utility.  And somehow they are separate sub-projects.

I see no reason why gsmmap must be in its own sub-project.

Change-Id: I2bc9c8897f3c7ccf207be0146f7b55fc733a6abb
2023-01-03 02:43:57 +07:00
Vadim Yanitskiy 621214c802 layer23: make all apps depend on libosmo-gprs-rlcmac
This will be needed for the modem application, and is also used
in a follow-up commit adding support for parsing SI13 Rest Octets.

Change-Id: I8e0f826c9b2a886f94624176e34e7d197e93d25f
Related: OS#5500
2023-01-03 00:18:34 +07:00
Vadim Yanitskiy cad5af50cc mobile: gapk_io_init_ms(): fix 'phy_fmt' may be used uninitialized
Change-Id: I193de6e0e831aa4201f5edec80e40abc43f4a861
2023-01-02 20:41:41 +07:00
Vadim Yanitskiy 3432c6cfe0 layer23/sysinfo: update coding style, make pointers const
Change-Id: Ia518251eae1b45ad573d076d97cba83ed25ea9ea
Depends: libosmocore.git Ide9110b984d3302aec6b439c563eb10e2dcdec9e
2023-01-02 20:24:50 +07:00
Vadim Yanitskiy e25fb14f6d layer23/sysinfo: use OSMO_MIN from libosmocore
Change-Id: Ic01cadda13a7d7a3d34ddb94bd3964044f38959c
2022-12-31 02:36:03 +07:00
Vadim Yanitskiy ed29bd3e41 modem: Makefile.am: remove unneeded CFLAGS and LIBS
Change-Id: I2bb04f526c4e3019c548786f2cdfb96b018826ec
2022-12-30 20:27:43 +07:00
Vadim Yanitskiy 9b1df1231f layer23: configure pretty logging for misc apps
Change-Id: I827055bcf04f8003fcb90e6c8c90813ecda2efed
2022-12-30 20:27:43 +07:00
Vadim Yanitskiy 00a67a0e9d layer23: use osmo_stderr_target in misc apps
Change-Id: I56770f04fa3c440e6ccabe6f6fccfe171d41d751
2022-12-30 20:27:43 +07:00
Vadim Yanitskiy 6391546181 mobile: rework writing BA to file, move to a function
Sometimes I am seeing error messages like this:

  DCS ERROR Failed to write BA list

The problem is that there can be several BA entries which need to
be written, and for each of them we're calling fwrite() twice.
This function returns number of items written, so the final sum
of returned values would be: len(BA list) * 2.  Thus expecting
it to be 2 regardless of len(BA list) is wrong.

Fix this by checking the sum in each iteration, not at the end.
Take a chance to refactor the code and move to a function.

Change-Id: Id8bc216c146127d9c9995379c9e56450d328f46d
2022-12-21 15:07:21 +00:00
Vadim Yanitskiy 7c2a471103 layer23: fix rx_l1_sim_conf(): msg->l2h is NULL, use msg->l1h
The mobile app crashes when using a Calypso phone and specifically
when using its built-in SIM reader.  The problem is that msg->l2h
is NULL in rx_l1_sim_conf(), so msg->l1h must be used instead.

  Assert failed msgb->l2h /usr/local/include/osmocom/core/msgb.h:162

Change-Id: I7c68a3ad393be5fd0413e00e119a06db59672357
2022-12-21 15:07:21 +00:00
Vadim Yanitskiy 5e331c196a mobile: gsm48_rr_rx_acch(): clarify logging messages
Change-Id: Ibc2d54c2879fa28225d46222239829f699277f6c
2022-12-10 19:11:20 +07:00
Vadim Yanitskiy 67d45c054a mobile: do not enforce RTP format for Uplink TCH frames
This is a partial revert of 8f04fa9758.

The GAPK based audio I/O implementation of the mobile app is now capable
of handling TI's specific TCH frame format, which can be configured via
the VTY interface ('io-tch-format ti').  TCH frames in this format are
different from the ones in RTP format and may have different length and
different bit ordering.  Remove voice_frame_verify().

Change-Id: I6113ba443e65ddaae091b643af54c873b7da4de8
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy 12dd3af2a0 mobile: support RTP and TI specific TCH frame I/O formats
Change-Id: Ib41f8c39c82c243b62a76433f59a2b98e175f894
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy 97deddcd45 mobile: clean up GAPK I/O state on channel release
Do not assert() in gsm_recv_voice(), because channel release does
not happen immediately and the PHY may be still sending TCH frames.

Change-Id: I8943ee9bd46afc96e6d7cfd52c95c34fd311ce11
Related: OS#3400
2022-12-06 06:28:56 +07:00
Vadim Yanitskiy df7fa3e296 mobile: integrate GAPK based audio (voice) I/O support
This change introduces a new feature to the mobile application -
audio I/O support, which allows the user to speak right from the
host side running mobile through its ordinary mic and speakers.

The audio I/O is based on libosmogapk [1][2], which in its turn
uses the ALSA sound system for the playback and capture.  This
is a new optional dependency of mobile, which is automatically
picked up if available during the build configuration.  Whether
to depend on it or not can be controlled using '--with-gapk-io'.

The API offered by libosmogapk implies to use the processing chains,
which generally consist of a source block, several processing blocks,
and a sink block.  The mobile app implements the following chains:

  - 'pq_audio_source' (voice capture -> frame encoding),
  - 'pq_audio_sink' (frame decoding -> voice playback).

both taking/storing TCH frames from/to the following two buffers:

  - 'tch_fb_ul' - a buffer for to be played DL TCH frames,
  - 'tch_fb_dl' - a buffer for encoded UL TCH frames.

The buffers are served by a new function gapk_io_dequeue().

[1] https://gitea.osmocom.org/osmocom/gapk/
[1] https://osmocom.org/projects/gapk

Change-Id: Ib86b0746606c191573cc773f01172afbb52f33a9
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy b1cfa18d77 mobile: gsm_forward_mncc(): properly mark TCH/H frames
Change-Id: Id3f459bc767ebf31469287fa672893239c5977d9
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy e69d3f4ba1 mobile: gsm_forward_mncc(): call mncc_sock_from_cc() directly
This way we can avoid allocating another msgb and enqueue the given
msgb directly to the write queue of the MNCC socket.

Change-Id: I29305866e61a0bc3bd082108af6a9ba8ff86bcf2
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 100ec4ca6f mobile: rework gsm_recv_voice(), add AUDIO_IOH_MNCC_SOCK
Do not send voice frames to the external MNCC unconditionally.
Add a new I/O handler type for the external MNCC application.

Change-Id: I406b169963e6654110329d741728fa12c8c8eeec
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 37a6a2c5c4 mobile: improve function comments in voice.c
Change-Id: I0285a07841bdc2568374f9e9cd0214eef1415186
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 290ea6b7fa mobile: add missing TCH MNCC messages and handle them
Change-Id: I28a1ae1ed504748c33c64c86ca7d57a94c7c7c6d
Related: OS#5599
2022-12-01 01:05:38 +07:00
Vadim Yanitskiy 7304b1720d mobile: timeout_rr_meas(): use osmo_strbuf API
Change-Id: I0c505b753bcfb06d9f2f085d56d7d56fb1c44d50
2022-11-30 18:35:14 +07:00
Vadim Yanitskiy ff44b9c3ed mobile: timeout_rr_meas(): fix sprintf() formatting
Change-Id: Ia8a101005d027fb5d0ddc2566f92ab2060f21c36
2022-11-30 18:27:58 +07:00
Vadim Yanitskiy e4541c35db mobile: timeout_rr_meas(): fix uninitialized variable
Change-Id: I956a1cafe9fed1a881574f59d0532e5cf931a1f7
Fixes: c9e579cea137fd147173434b7fa128d37685011
Fixes: CID#300084
2022-11-30 17:22:48 +07:00
Vadim Yanitskiy 16ad87bf52 mobile: make LUA support configurable via --with-lua53
Change-Id: If440cee52410421034823a3749709e28c4136b95
2022-11-29 06:05:55 +07:00
Vadim Yanitskiy 993d2ab501 mobile: split gsm_send_voice() -> gsm_send_voice_{msg,frame}()
This is needed to avoid sending voice frames to the L1PHY without
having to use MNCC specific struct gsm_data_frame.

Change-Id: I37241555cd648a8e2b57fa072c708f93cd1ba5a9
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy a3b86ad4dd mobile: voice.h: add missing forward declarations
Change-Id: I854abdcde5bc324f6d0cf309792b36fc64601070
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 7900ba1a13 mobile: voice.h: use '#pragma once' include guard
Change-Id: I024e13c0f66ae1e42b0c8e2ff77874fcb883e85a
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 7fed41388c mobile: gsm48_rr_tx_voice(): also permit TCH/H frames
The idea behind checking the ch_type in gsm48_rr_tx_voice() was likely
to prevent sending of the (LCR originated) Uplink TCH frames before
the actual traffic channel is established/modified.

The problem is that this check allows TCH/F frames, but not TCH/H.
Most likely, TCH/H was forgotten or never tested.  Fix this.

Change-Id: I06e84ad47bafd4676af0e136b825e77471587b23
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy fd0baabed3 mobile: properly handle RR CHANNEL MODE MODIFY message
According to 3GPP TS 04.08, section 3.4.6.1.3 "Abnormal cases"
of "channel mode modify procedure", if the MS doesn't support
the indicated channel mode, it shall retain the old mode and
return the associated channel mode information in the
ACKNOWLEDGE message.

Previously, if an indicated mode is not supported, we used to
indicate the 'CHAN_MODE_UNACCT' RR case without sending the
ACKNOWLEDGE message. Also, the result of gsm48_rr_set_mode()
was ignored. Let's fix this!

Change-Id: I952436ec796273e56341f9d3492b4a3b3a5dc410
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy d2d5fabee5 mobile: gsm48_rr_set_mode(): fix copy-paste in comment
Change-Id: I45212cd02ac50d0d363918709720e997500e45a9
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 73da4bac97 mobile: gsm48_rr_set_mode(): print name of channel mode
Change-Id: I615e89bdd7e1cc01b3258fefa26f7ab5705ae8cc
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy c1d3c01768 mobile: allow enabling/disabling handling of voice in the L1PHY
Some L1PHY targets (e.g. Calypso based Mot C1xx phones) have built in
microphone and speaker.  Some targets do not have them.  Currently we
unconditionally instruct the L1PHY to handle TCH frames internally.
Make this behavior configurable via the VTY interface.

Change-Id: I131f213ef7c2736f7310f0183b83f3bc3064cd98
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy 8d875f3c3d mobile: add MNCC handler selection to settings
Since the mobile application is potentially able to maintain
multiple MS instances, it's better to have a possibility to
choose an MNCC (Call Control) handler per each MS separately.

This change removes the command-line option '-m', which was used
for enabling the external MNCC.  Now it's possible configure the
MNCC handler for each MS via the VTY interface and settings.

The following MNCC-handlers are available:

  - internal - built-in MNCC-handler (default);
  - external - external MNCC-handler via UNIX-socket (e.g. LCR);
  - dummy - dummy handler without CC support.

Change-Id: I2df91c7a79ba5c39bc6ceae900ef649129dd0346
Related: OS#3400
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy c46d0699cd mobile: timeout_rr_meas(): also print sub-slot for TCH/H
Change-Id: I208c159ba610450e1850e601daa2712eef8c23e1
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy fe6345e1c4 layer23: always check return value of rsl_tlv_parse()
Similar to rsl_dec_chan_nr(), this function may also fail, leaving
the given struct tlv_parsed uninitialized.

Change-Id: I13f2a97eeff78ca8ed7d0a2844e4fca430ec7768
Related: OS#5599
2022-11-29 02:21:57 +07:00
Vadim Yanitskiy c9e579cea1 layer23: always check return value of rsl_dec_chan_nr()
The rsl_dec_chan_nr() may fail to decode RSL channel number, so
variables ch_type/chan_ss/chan_ts would remain uninitialized.

Change-Id: I9ab18bdaf41a29fcd32a7060668ef9db07b8cf7e
Related: OS#5599
2022-11-29 02:15:39 +07:00
Vadim Yanitskiy b76743df71 mobile: add MNCC socket path to settings
Previously the MNCC socket path was generated automatically,
using concatenation of the '/tmp/ms_mncc_' prefix and MS name.
Let's allow the user to specify this manually, keeping the same
naming generation method for default value.

Change-Id: I643356ac579bc5e765f668265ec803b22a73739c
Related: OS#3400
2022-11-27 06:12:38 +07:00
Vadim Yanitskiy bdc5acdb13 layer23: l1ctl_tx_traffic_req(): cosmetic: drop dead code
Change-Id: I941899ab27282a495f965ae9a0f41076dceef953
Related: OS#5599
2022-11-27 06:12:38 +07:00
Vadim Yanitskiy 887b141699 layer23: add 'src/modem/modem' to .gitignore
Change-Id: I37e536493ddfd3bff1674d5bc85f40a0bbd0f317
2022-11-25 22:26:20 +07:00
Pau Espin e9f24d734a host/layer23: Add modem app
This app will allow setting up a tun device to transmit/receive data
as a GPRS MS against a GSM network.

This is just the initial skeleton so that people can work on it further
in follow-up commits.

Related: OS#5503
Change-Id: I8a1121b3287da7d7330c30e3118affa8fd1da61b
2022-11-21 19:56:54 +01:00
Pau Espin dd03ea6a82 layer23/mobile: Add missing dependency cflags
The *_LIBS vars were already added, but the *_CFLAGS were missing.

Change-Id: If904589b33357395e10f078857979aaecf5dbf68
2022-11-21 18:16:09 +00:00
Vadim Yanitskiy 136cf481c7 layer23: fix -Werror=old-style-definition problems
Change-Id: I0187acb02de6fd22ccc86c112640caa8aa3fa2bc
2022-11-05 19:18:42 +07:00
Vadim Yanitskiy 6ba147556b layer23: add -Werror={implicit-int,int-conversion,old-style-definition}
Change-Id: Ia6e0c717c782ea000f1d40ad11af2ee725f9c309
2022-11-05 19:10:55 +07:00
Vadim Yanitskiy 671ac36b11 layer23: configure.ac: print CFLAGS/CPPFLAGS using AC_MSG_RESULT()
Change-Id: Ib8d7138f7d5504176156ea5349336f5994c8fa80
2022-11-05 19:10:02 +07:00
Eric Wild 0f64b7c124 Revert "mobile/gsm48_rr.c: fix ACCH System Information parsing"
This reverts commit 1a8a80aeae.

We currently get ALL SI messages wrong - the protocol disseminator is
accidentally being used as SI msg type, and
6=radio resources management - but 6 is also type=si5ter.. so all SI we
receive end up being parsed as SI5, what a coincidence!

Change-Id: I3822f74295920680a935f3031c642ba00162d09d
2022-10-26 15:52:58 +00:00
Vadim Yanitskiy 1b0ff8ea6f mobile: check return value of gsm_arfcn2band_rc()
Change-Id: Ia5bc9f8bf4aa3ea7374c67e329db22612bb350ca
Fixes: CID#282374, CID#282375, CID#282376
2022-10-07 14:56:21 +07:00
Pau Espin a53e93fe9c trxcon: Initial support for forwarding AMR
This allows TTCN3 L1CTL module (used in BTS_Tests) to transmit and
receive AMR payloads towards osmo-bts-trx.

Related: SYS#5987
Change-Id: Ia20bc96e39726a919a556c83c8be48cb31af7331
2022-09-07 00:01:53 +07:00
Vadim Yanitskiy c2d022d348 mobile: lapdm_channel_init() is deprecated, use lapdm_channel_init3()
Change-Id: I320381488046f9b1780a53b8d5d27e470da727c4
2022-08-30 12:00:04 +00:00
Vadim Yanitskiy c67a9a6a01 mobile: mobile_start(): fix grammar in logging messages
Change-Id: Ibe8afb6a79613096c4ace86cc44867d0e9f8de76
2022-08-23 20:32:56 +00:00
Vadim Yanitskiy 8f6338c4f5 mobile: fix description of 'test re-selection' command
Change-Id: I254effd067b64ae0bfe1afe646701c0c6ea942ea
2022-08-23 09:05:04 +00:00
Vadim Yanitskiy 8738627763 layer23: explicitly set chan_nr / link_id in L1CTL_RACH_REQ
The underlying L1 implementation uses both chan_nr and link_id to
determine a logical channel for sending an Access Burst.  If not
set (both 0x00), RSL_CHAN_RACH is assumed.  Indicate it implicitly.

Change-Id: Ia40f67920bd712e572b8ea5219eb83064106bd5d
2022-08-21 20:45:05 +07:00
Vadim Yanitskiy dd4d0d0354 layer23: use $(top_builddir) instead of relative paths
Change-Id: Ib2c9264b2a3cdef9b9852bdead94bae03185fec8
2022-08-21 20:45:05 +07:00
Vadim Yanitskiy 350b605e89 layer23: use $(top_srcdir) instead of relative paths
Change-Id: I320ed2295c0c8e12a46be416e3dbda8865987424
2022-08-21 20:45:05 +07:00