| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The functions osmo_bts_set_feature() and osmo_bts_has_feature() are
currently defined as inline. Since inline is a hinting, the compiler
might choose not to inline the function. This eventually leads to
linker problems because the function is then defined multiple times.
- use "static inline" instead of "inline" only.
This patch is a follow up patch to
Change Id 680acae725b2b8dda2f239ff20073306fdfb3f6e
Change-Id: Iddd97415a17b06b69f69ddca2e2e296eb2f23a89
|
|
|
|
|
|
|
| |
Otherwise, while updating osmo-trx 0.2.0->0.3.0, the version printed in
the changelog by gbp dch is 0.2.1
Change-Id: I744adb23b4602e5e47f80a012286578d1e59de88
|
|
|
|
|
|
|
|
|
|
| |
I found myself often using osmo_mnc_from_str() to also decode an MCC and be
strict about it, but each time I felt the need to comment like "using
osmo_mnc_from_str() also for MCC". Rather formalize this properly.
Use a static inline function, no need to add more symbols to libosmo-gsm.
Change-Id: I020a4f11791c61742a3d795f782805f7b7e8733e
|
|
|
|
|
|
|
|
| |
In osmo_mnc_from_str() do not try to return some values even if the validation
fails; hence don't try to decode a NULL pointer. That whole idea was half-baked
and a can of worms to begin with.
Change-Id: Ibaaa128ac60b941a015a31134eb52aef56bc6e22
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
osmo-bsc and osmo-bts share enums and value strings to describe
feature data that is exchanged via OML (manufacturer id) on startup.
Also the functions to set and get the respecitive bits in the feature
bitvectors are in osmo-bsc and osmo-bts. This is a code duplication
and should be resolved.
- add enum osmo_bts_features (replaces enum gsm_bts_features)
- add osmo_bts_features_descs (replaces gsm_bts_features_descs)
- add osmo_bts_set_feature (replaces gsm_btsmodel_set_feature)
- add osmo_bts_has_feature (replaces gsm_btsmodel_has_feature)
Change-Id: Id0c35aef11aa49aa40abe7deef1f9dbd12210776
|
|
|
|
|
|
|
|
|
|
| |
In certain builds (for me a build with no -O2 flag) the recently added
gsm23003_test test_mnc_from_str() fails, because bcmp() compares all bytes of
sizeof(struct test_mnc_from_str_result), which has valid data for 7 bytes plus
one padding byte that may contain arbitrary values. Instead of bcmp(), rather
compare the actual members one by one.
Change-Id: I28b28457c7b0462c950612fd9b87b5c7181d8bad
|
|
|
|
|
|
|
|
|
|
| |
In some cases, we want to mark an unset MCC-MNC. Define uint16-max for this
purpose.
osmo-bsc code is already doing so with a -1 and using int data types, which
will become inconvenient with the new API that handles MCC and MNC as uint16_t.
Change-Id: Ieee7add0bd6d94cf84743a49794bbcd38561b72f
|
|
|
|
| |
Change-Id: I1f9e13645033c61ffaed97e457deb5e78a6bec58
|
|
|
|
| |
Change-Id: I5bebc6e01fc9d238065bc2517058f0ba85620349
|
|
|
|
|
|
|
|
|
|
|
| |
osmo_mnc_from_str() preserves leading zeros in the string and is useful for
VTY config parsing (osmo-bsc, osmo-msc, osmo-sgsn, osmo-pcu).
osmo_{plmn,mnc}_cmp() takes care of the slight intricacy of ignoring the 3-digit flag
if the MNC is anyway >99. Will be used by osmo-sgsn.git and osmo-bsc.git. (All
current users just care about identical MNC, but a proper cmp doesn't hurt.)
Change-Id: Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6
|
|
|
|
| |
Change-Id: I9b387e09293a6bbef84b9620ccf21ee2f9ec751c
|
|
|
|
| |
Change-Id: I4c8492b8055803d2857f1ef30aede088778b085b
|
|
|
|
|
|
|
| |
Note that on the input side, the 3-digits flag may be left false when the MNC
is >99 anyway. On the decoded side, the flag is set accurately.
Change-Id: I89765613d8c5bd939a6957f7443ac88475f1b93c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable representing three-digit MNC with leading zeros. The MNCs 23 and 023 are
actually different; so far we treated both as 23. Re-encode an incoming BCD or
string of 023 as it were, i.e. not dropping the leading zero as 23.
Break ABI compatibility by changing the size and ordering of structs
gprs_ra_id, osmo_plmn_id, osmo_cell_global_id, ... by adding an mnc_3_digits
flag.
Change ordering in gprs_ra_id because the canonical oder is {Mobile Country
Code, Mobile Network Code}, so have the mcc member first.
ABI compatibility cannot be maintained for struct gprs_ra_id, since it is a
direct member of structs bssgp_bvc_ctx and bssgp_paging_info, and even just
adding a flag to the end would cause ABI changes of those structs. Similarly,
osmo_plmn_id is a direct member of osmo_location_area_id, and so forth.
Add new API to set and read this additional flag to preserve leading zeros:
- osmo_plmn_to_bcd(), osmo_plmn_from_bcd() after
gsm48_mcc_mnc_to_bcd() and gsm48_mcc_mnc_from_bcd().
- gsm48_decode_lai2(), gsm48_generate_lai2() after
gsm48_decode_lai(), gsm48_generate_lai().
- gsm0808_create_layer3_2() after gsm0808_create_layer3() and gsm0808_create_layer3_aoip().
- various osmo_*_name() functions in gsm23003.h (osmo_rai_name() still in
gsm48.h close to struct gprs_ra_id definition). The amount and duplication of
these may seem a bit overboard, but IMO they do make sense in this way.
Though most code will soon see patches unifying the data structures used, in
some cases (vty, ctrl) they are required singled out. Without these
functions, the formatting ("%0*u", mnc_3_digits ? 3 : 2, mnc) would be
duplicated all over our diverse repositories.
In various log output, include the leading MNC zeros.
Mark one TODO in card_fs_sim.c, I am not sure how to communicate a leading zero
to/from a SIM card FS. The focus here is on the core network / BSS.
To indicate ABI incompatibility, bump libosmogsm and libosmogb LIBVERSIONs;
adjust debian files accordingly.
Implementation choices:
- The default behavior upon zero-initialization will be the mnc_3_digits flag
set to false, which yields exactly the previous behavior.
- I decided against packing the mnc with the mnc_3_digits field into a
sub-struct because it would immediately break all builds of dependent
projects: it would require immediate merging of numerous patches in other
repositories, and it would make compiling older code against a newer
libosmocore unneccessarily hard.
Change-Id: Id2240f7f518494c9df6c8bda52c0d5092f90f221
|
|
|
|
|
|
| |
Forthcoming jitter buffer code in libosmo-netif will make use of it.
Change-Id: I2434f9dfa401f736bc62a2ddce920e587cd8c517
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far, we used quarter-bits across the L1SAP between the hardware/PHY
specific part of OsmoBTS and the common part. In order to increase
the resolution, let's add fields/members for 1/256th bit.
In order to keep ABI and API compatibility, we use a union around the
old and new values, so old code will still compile + work withe new
libosmocore.
Change-Id: Ibb58113c2819fe2d6d23ecbcfb8b3fce4055025d
|
|
|
|
|
|
|
|
| |
Let's extend PH-RACH.ind with some useful data across the L1SAP
boundary.
Change-Id: I9439810c3a3ad89ea0302753617b850749af887c
Related: OS#3003
|
|
|
|
|
|
|
|
|
|
|
| |
If a monotonic clock must be used, then the clock_gettime API is used
which uses timespec structures. Linux systems by default don't provide
helpers to calculate time using timespecs, so let's add them here.
Let's also make this header public so these helpers can be used in other
projects using libosmocore (expected user: libosmo-netif).
Change-Id: I45fc993b9bb0a343763238bf463c8640f47b00f1
|
|
|
|
|
|
|
|
| |
If no event names are defined for an FSM, show a placeholder
message which points out the problem instead of segfaulting.
Change-Id: I87457945a7b76aa052305c9c531722be1ea0c1d1
Related: OS#3007
|
|
|
|
|
|
|
|
|
|
|
|
| |
Event names are displayed in VTY commands so all FSM should have them.
Print an error message if an FSM is registered without event names.
We could also return an error code, however at present no caller checks
the return value of osmo_fsm_register() so this would be pointless.
Add event names to the test FSM and update expected output accordingly.
Change-Id: I08b100d62b5c50bf025ef87d31ea39072539cf37
Related: OS#3008
|
|
|
|
|
|
|
|
|
|
|
|
| |
For all other decode operations we report the BER, but not for the
RACH. This results in osmo-bts-trx not being able to report BER
to the higher layers, which is possible on other BTS backends.
Let's close this gap by introducing gsm0503_rach_ext_decode_ber()
and gsm0503_rach_decode_ber() with the usual n_errors / n_bits_total
arguments.
Change-Id: I2b1926a37bde860dcfeb0d613eb55a71271928c5
|
|
|
|
|
|
|
| |
rate_ctr_inc2() is slightly easier to use than the old
rate_ctr_inc() variant.
Change-Id: Ie00706be201c32ec2981ea38b70354ed85e1aefd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a desire to install osmo_fsm vty commands automatically in
a library context, rather than requiring every application which
directly or indirectly uses osmo_fsm to run osmo_fsm_vty_add_cmd().
However, the function install_element_ve() asserts that elements
about to be installed have not already been installed.
This means we cannot shift responsibility into a library context
without first making sure that osmo_fsm commands are only installed
once per combined application+library context, because applications
won't know which commands any of its libraries has already installed.
A simple solution is to use a global flag which is checked by
osmo_fsm_vty_add_cmd() before installing osmo_fsm commands, and
is set once the commands have been installed. This way, no harm
is done if osmo_fsm_vty_add_cmd() is called multiple times.
Change-Id: I10b0b1c1c1bf44c3b8eafc465c1ee06ea2590682
Related: OS#2967
|
|
|
|
|
|
|
|
|
|
|
| |
This breaks all existing / older osmocom-bb builds, and hence
cannot be accpeted. See also https://gerrit.osmocom.org/#/c/6679
Related: OS#2985
This reverts commit 3c38e60cd55814a7b4c34f22e0b2e6e671f883c4.
Change-Id: Icfc52ca4e5cbe3a444d98037d27fa101e3614e06
|
|
|
|
| |
Change-Id: Ib79cdb62d45d8c78445c7b064e58eb7e9faeccf9
|
|
|
|
| |
Change-Id: Idd6cee090464bc92b654332904a9a08edf16e5c9
|
|
|
|
|
|
| |
(Preparation for adding 3-digit MNC)
Change-Id: Ifbc167de0cc039858112677b8d0cd14a2c8af086
|
|
|
|
|
|
| |
(Preparation for adding 3-digit MNC)
Change-Id: I7f8ae05fa3e4a6fc004212757b05ca8a14c9ef45
|
|
|
|
|
|
| |
For consistency in human readability, MCC simply should come first, always.
Change-Id: Idb86a7088fac4d8a8c41190ab46f9801635f4eee
|
|
|
|
|
|
| |
(Preparation for adding 3-digit MNC)
Change-Id: Ic6c645ebf82d5f8d9d51c4c4cc804a0172008156
|
|
|
|
| |
Change-Id: Ic53a675963cae328b296b4abaed9524451153271
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function _osmo_fsm_inst_term() terminates all child FSMs befor
it calls fi->fsm_cleanup(). This prevents the cleanup callback to
perform last actions on the child FSMs (e.g.
osmo_fsm_inst_unlink_parent()).
- Since moving the cleanup callack to the beginning of the function
would alter the termination behavior and possibly cause malfunction
in already existing implementation that use OSMO fsm, a new
optional callback that is called immediately at the beginning of
the terminatopn process is added.
Change-Id: I0fdda9fe994753f975a658c0f3fb3615949cc8bb
Closes: OS#2915
|
|
|
|
|
|
| |
Don't just return, free the allocated msg first.
Change-Id: I51431ae7baca33ce5bab085cc3efe25f1a10b6d1
|
|
|
|
|
|
|
| |
gsmtap_sendmsg() does not free the msgb if it returns a failure rc, so the
callers must check the rc and free the msg.
Change-Id: I7cf64ed9b14247298ed8b4ab8735627f8235a499
|
|
|
|
|
|
|
|
|
|
|
|
| |
If less than the msgb size was written by write(), we want to return -EIO.
Hence do not return zero when write() wrote zero bytes, return -EIO in that
case as well.
Previously, if write() returned zero, gsmtap_sendmsg() would return zero
*without* freeing the msg, hence neither would the (ideal) caller. So this
fixes a corner-case memleak.
Change-Id: I099ae1c663c018da5db884f7e9d52c45af3ed817
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not freeing on error does enable callers to try to re-send as well, so it is a
kind of useful feature, even though I find it likely for callers to either
forget about freeing the msg on error or double-free by accident...
I considered changing gsmtap_sendmsg() to always free, but since it is public
API, I chose to keep and document its current behavior properly instead. We
don't know what callers may exist out there.
Change-Id: Id3266ce36442024f16eaf6afa3f516d201930c41
|
|
|
|
|
|
|
| |
Sometimes we want to create an FSM instance before we know its name. In
that case we should be able to update the id later.
Change-Id: Ic216e5b11d4440f8e106a297714f4f06c1152945
|
|
|
|
|
|
| |
The code is based on Osmocom-BB implementation.
Change-Id: I78f6968edaa3ed535673411fb2a80060a472290f
|
|
|
|
|
|
|
|
| |
Add generic function which allows caller to set Mobile Identity
explicitly. This allows to use IMEI or IMEISV for example. Make
gsm48_generate_mid_from_imsi() into wrapper around new function.
Change-Id: Id79be7abfff75ecd0d248bbeed93e605abeec9b3
|
|
|
|
| |
Change-Id: Ibe5c0831268c788ceecd10fd7b22ece6480da817
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was causing build failures in applications using this library
feature:
Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
<param name='ADDRESS' doc='(null)' />
Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
<param name='REGEXP' doc='(null)' />
Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
<param name='ADDRESS' doc='(null)' />
Documentation error (missing docs):
<command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
<param name='REGEXP' doc='(null)' />
Change-Id: I785c852e3313d20eade79746a7cd485d2d5908ea
|
|
|
|
| |
Change-Id: I824e63087021adfda81bd0f867a3fdb5e9efcf7a
|
|
|
|
| |
Change-Id: I98976c0ff16a69b2508a79259ed1aeaec51e7549
|
|
|
|
|
|
|
|
|
|
| |
Add inline functions to manipulate and query ACC flag bits
in the rach_control.t2 and rach_control.t3 octets.
These function definitions also serve as documentation of
the purpose of rach_control.t2/t3.
Change-Id: I8f0a65c2980f86eb5c43f3bebe727f4d4d973163
Related: OS#2591
|
|
|
|
| |
Change-Id: Idd8d8a7a1c7f0b6cb9318e4f19ebadb415df2ed1
|
|
|
|
| |
Change-Id: I89bff8fcb8e0b7c0a0e415d4eee1636c21b8f8de
|
|
|
|
|
|
|
|
|
|
|
|
| |
This avoids compiler warnings like
/tmp/work/sysmobts_v2-poky-linux-gnueabi/osmo-pcu/0.4+gitAUTOINC+4c112dc5a6-r1.18/recipe-sysroot/usr/include/osmocom/core/msgb.h: In function 'const char* msgb_hexdump_l2(const msgb*)':
error: invalid conversion from 'void*' to 'const unsigned char*' [-fpermissive]
return osmo_hexdump(msgb_l2(msg), msgb_l2len(msg));
which we've been getting in osmo-pcu builds on some platforms.
Change-Id: I0ec652a1a569ec1507d8411cf1ef87afabcca799
|
|
|
|
|
|
|
|
| |
This reverts commit 5ec91980ac2224aa1e9bf070a0e382d0d8c2b729.
More or less like I expected, it creates fall-out. osmo-msc master builds are failing, as are the open build service builds. The patch has therefor *not* been sufficiently tested.
Change-Id: I8d961d7bbd91b6a8d7691f24cb67720c3d001c7e
|
|
|
|
|
|
| |
This reverts commit 76c6c50405c6cbb1d08bdd7b5d27c657fa5d38b6, which broke the obs builds. I'm really starting to get annoyed by ongoing python related breakage without ever fixing any bugs!
Change-Id: I4d76e897d4f746ff9ea4e06f2efc708a12cc2944
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function _osmo_fsm_inst_term() terminates all child FSMs befor
it calls fi->fsm_cleanup(). This prevnts the cleanup callback to
perform last actions on the child FSMs (e.g.
osmo_fsm_inst_unlink_parent()).
move the function call to _osmo_fsm_inst_term_children() below the
call to fi->fsm->cleanup().
Change-Id: Ie89d435417306c6bf897274eabc3ed0a46485c26
|