Commit Graph

3312 Commits

Author SHA1 Message Date
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 7a50aab31f fixup: gsmmap: move this utility to 'layer23/src/misc/'
Remove non-existing anymore Makefile target 'gsmmap'.

Change-Id: Ia38094cf66ae292b8595b25d87161298fa4312a7
2023-01-04 03:23:29 +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 48c3243dd7 gsmmap: fix -Werror=old-style-definition
Change-Id: I44ad2f34b317152616c77f6c1fdb4f06a7b511c5
2023-01-03 02:34:13 +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 9fdf8c9f9e contrib/jenkins.sh: build some sub-projects with --enable-werror
Change-Id: I8976ba3c52a3b4a47c98b9e6e85c7b9dcef4575a
2023-01-03 00:18:07 +07:00
Vadim Yanitskiy 36c38ce481 contrib/jenkins.sh: make use of $PARALLEL_MAKE
Change-Id: I371a8dca6d992622d005d8c9d84eaaad6f3c7372
2023-01-03 00:18:07 +07:00
Vadim Yanitskiy 34cc5e01f4 contrib/jenkins.sh: also run distcheck for trxcon and virt_phy
Change-Id: I5664806df4051694a5ce705420cd574f7a7da531
2023-01-03 00:18:07 +07:00
Vadim Yanitskiy a445c6db81 virt_phy: fix make distcheck: access l1ctl_proto.h via symlink
Accessing a header file from outside of the sub-project requires
using the relative path ("-I$(top_srcdir)/../layer23/include"),
which does not resolve properly during make distcheck.

The '../layer23/include/l1ctl_proto.h' is actually a symlink too.

Change-Id: Id64ab161a17d53f5e93cdd100e81d4fb8acfb97a
2023-01-03 00:17:03 +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