Commit Graph

2050 Commits

Author SHA1 Message Date
Neels Hofmeyr 249fb71a2e doxygen: add missing gb API doc generation
Files in include/osmocom/gprs/ and src/gb/ are not included in any doxygen
generated API docs. Add Doxyfile.gb.in and adjust configure.ac and Makefile.am.

Change-Id: Ieb64f497f55368e396872083237c9ff28da2dd93
2017-06-23 00:18:21 +00:00
Neels Hofmeyr 51816479bc doxygen: include all undocumented items in the API doc
Currently, files that omit the \file directive and all functions, enums,
structs lacking a doxygen style comment are completely missing from the doxygen
API docs.

Set EXTRACT_ALL = YES so that all files and code items are at least listed in
the doxygen API.

Change-Id: I39f558ec0a33a61a1fcec0554f53c8e7668733de
2017-06-23 00:18:21 +00:00
Neels Hofmeyr 6a494f1ada doxygen: drop INPUT gsm/protocol, already part of gsm/
include/osmocom/gsm/protocol is also implicitly included in its parent dir
because of the recursive rule. Naming it again makes doxygen use it twice. It
doesn't seem to be harmful, but not needed either.

Change-Id: I5dc22ca65740a88540dacc61c0742fede172de9c
2017-06-23 00:18:21 +00:00
Philipp Maier 452a6bb347 comments: gsm0808_utils: mention various 3GPP specs
Tweaked-by: nhofmeyr
Change-Id: I990dfe9eeaf96f377484b828143935240a937226
2017-06-23 00:37:47 +02:00
Philipp Maier 17778bda23 gsm0808: fix length check of the element decoder functions
The length check of the decoder functions is not entirely
correct. The check also checks for values below zero,
which does not make sense, since the length is encoded
as uint8_t.

For some elements a minimum length is known (in most cases
this is 1), so checking for zero is sufficient but in some
cases (e.g. channel type) the spec mentions a minimum and
maximum length. This is now also reflected in the code.

Tweaked-by: nhofmeyr
Change-Id: I78bc887f68d1963d28c6fcd631ac20ccd893d6d6
2017-06-23 00:30:01 +02:00
Pau Espin 00f4ef7262 pseudotalloc: Add simplistic implementation of talloc_asprintf
fsm.c uses this function. When compiled with --enable-embedded, it
triggers a warning:

fsm.c: In function 'osmo_fsm_inst_alloc':
fsm.c:213:4: warning: implicit declaration of function 'talloc_asprintf' [-Wimplicit-function-declaration]
    fi->name = talloc_asprintf(fi, "%s(%s)", fsm->name, id);

Change-Id: I61cd83d4c8570af1e452c945ac6f194baf7e6ac4
2017-06-22 18:14:18 +00:00
Pau Espin ffa41ca665 osmo-sim-test.c: Remove unused functions
Change-Id: I3060cfee8ece86c4c89a65f93c9f5424df0c410b
2017-06-22 18:14:18 +00:00
Pau Espin 4f8857e50a fsm.c: Fix compilation warning: Use PRIu32 for uint32_t
Change-Id: I4c441b20b250c34656f1e8330d6bb4b1ce2b8423
2017-06-22 18:14:18 +00:00
Pau Espin 648f87883a timer_gettimeofday.c: Fix implicit use of timeradd
timer_gettimeofday.c: In function 'osmo_gettimeofday_override_add':
timer_gettimeofday.c:54:2: error: implicit declaration of function 'timeradd' [-Werror=implicit-function-declaration]
  timeradd(&osmo_gettimeofday_override_time, &val,
  ^

Change-Id: Iced451be255cfde8a6cf38380bef71ef29673994
2017-06-22 18:14:18 +00:00
Pau Espin fc1911c0f4 sercomm_test.c: return correctly in main
Change-Id: I57fd3e1bf74ec24dec692710359a1ce00ecde75a
2017-06-22 18:14:17 +00:00
Philipp Maier 4703fd215f cosmetic: remove API documentation strings in header file
Typically we don't place comments with the function declarations
in .h files. Not sure why this file has comments for each. The
API doc belongs in the .c file as proper doxygen comments,
and shouldn't be duplicated in the .h file.

In this particular case, doxygen comments are added in the
corresponding c file recently.

Change-Id: I5c4cb55be5ec59a6945b1720b875c5987f1cfaad
2017-06-22 17:08:16 +00:00
Philipp Maier 884ba0f2bc gsm0808: add function gsm0808_speech_codec_from_chan_type()
The contents of the speech codec element (struct gsm0808_speech_codec),
that is also used in the speech codec list element (struct
gsm0808_speech_codec_list) can be generated directly from the
permitted speech parameter in the channel type field (struct
gsm0808_channel_type) when full AoIP with compressed speech via
RTP/UDP/IP is assumed and when the codec configuration on the air
interface exactly matches the codec configuration on the IP backhaul.

This patch adds a function that can be used as a helper to fill
out spech codec fields by only giving a permitted speech parameter
as input.

Change-Id: I257c972e9fdf0dfe940a8d483447085bd62e50a2
2017-06-22 17:08:16 +00:00
Philipp Maier 3149b0d076 gsm0808: add function gsm0808_chan_type_to_speech_code()
The permitted speech field used in channel type element (struct
gsm0808_channel_type) uses a different representation as
the type field in the speech codec element (struct
gsm0808_speech_codec)

This patch adds a function to convert from permitted speech to
speech codec type.

Change-Id: Ib26a9c20864459b2baaa04f49b6e7902ba44b7cb
2017-06-22 17:08:15 +00:00
Philipp Maier a9b9276948 gsm0808: add default speech codec configuration
In an AoIP scenario, the speech codec list field specifies the
codecs used in the RTP interface. This patch adds a table
with default codec configurations that match the codec
configurations that are also used on the air interface.

Change-Id: I9dc0165d76a022b2c1b7418bc3133407e61b7261
2017-06-22 17:08:15 +00:00
Philipp Maier bb8396690e gsm0808: fix AoIP speech codec element parser/generator
The implementation of the parser/generator for the speech codec
information element slightly wrong, making it impossible to use
it properly.

(See also: 3GPP TS 48.008, 3.2.2.103)

Change-Id: Idabb0f9620659557672e1c6b90c75481192e5c89
2017-06-22 17:08:14 +00:00
Pau Espin 039171a5f8 abis_test.c: Fix warning appearing on some buggy gcc versions
Change-Id: I31d5ffc0cf461d207d6c3d43aa0a25a5448d7000
2017-06-22 12:22:44 +02:00
Philipp Maier da38203418 gsm0808: add speech codec type constants
The codec type to be set in member type in struct gsm0808_speech_codec
has its own coding scheme to reference the used codec types. This patch
declares an enum with valid speech codec types.

Change-Id: Icaa768071d4364e671bc7e6d48b82d1f07f93f93
2017-06-21 20:20:02 +00:00
Philipp Maier 890f1f5a2c cosmetic: Add info about coresponding codecs to permitted speech consts
The constants in enum gsm0808_permitted_speech are not very expressive.
Add comments indicating each constant's corresponding codec.

Change-Id: I9734f7c261becffe38ffd41c304d006d08530c1a
2017-06-21 20:20:02 +00:00
Philipp Maier 3d9191ef2a gsm0408: update bearer capability speech version
3GPP TS 24.008 specifies two new speech versions for half rate and
two new speech modes for full rate. This patch adds the relevant
constants to enum gsm48_bcap_speech_ver in gsm_04_08.h

Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549
2017-06-21 20:20:02 +00:00
Philipp Maier a9e193b5dc cosmetic: Add codec references to Speech Version Indication
Add the information which GSM Speech codec version coresponds to
which bearer capability speech version.

Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967
2017-06-21 20:20:02 +00:00
Pau Espin 35c6fb3723 lapd_test.c: Convert compilation warning to level message
This way we clean the build of warnings completely and we can enable
-Werror but we still see this FIXME message while compiling.

Change-Id: I24c11226cd5bb5b6032f4ece7d1a0695dc82f0dd
2017-06-21 13:56:37 +00:00
Philipp Maier e05c1f45ed vty: additional nodes for sccp-address configuration
The planned sccp-addressbook implementation in libosmo-sccp
requires two additional VTY nodes.

See also in libosmo-sccp.git:
Change-Id I068ed7f7d113dab88424a9d47bab7fc703bb7942

Change-Id: I42aa29c0cccc97f284b85801c5329b015b189640
2017-06-21 12:56:41 +00:00
Neels Hofmeyr 39273b31c4 src/Makefile.am: fix build: use AM_CFLAGS, not CFLAGS
This allows passing 'make CFLAGS+="..."'
without breaking the build.

Suggested-by: zecke

Change-Id: I0628a9c739cded771605f5c55df7f21cb07beb3b
2017-06-19 21:46:43 +07:00
Vadim Yanitskiy 0876ef899e core/conv/conv_acc.c: use static allocation for trellis
Allocation of a new memory is an expensive operation, which
takes place when it's initially unknown, how much memory will
we need, or in order to decrease total memory usage.

The trellis struct wasn't require dynamic allocation itself,
so let's allocate one statically inside the vdecoder structure.

Change-Id: Ib8e448823ca5548a05a45824b0b1c06743dfe5a4
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 1ac56fb292 core/conv/conv_acc.c: use static allocation for vdecoder
Allocation of a new memory is an expensive operation, which
takes place when it's initially unknown, how much memory will
we need, or in order to decrease total memory usage.

The vdecoder struct wasn't require dynamic allocation itself,
so let's use static allocation in order to increase performance.

Change-Id: Id1b140d3cb61db7352dcfc217a8fc36091e945ab
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 34da6b5f47 core/conv/conv_acc.c: delete reset_decoder()
Currently this implementation exposes nothing than
osmo_conv_decode_acc(), so it wasn't possible to call
reset_decoder() from outside.

The method itself was used to initialize accumulated
path metrics and the starting state of encoder. Now
this code is moved to generate_trellis().

Moreover, setting accumulated path metrics inside
existing loop is a bit faster that calling memset().

Change-Id: I8f17cebf468cf0106927ccee091cfb2896649cb2
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 23d3bc01ea core/conv/conv_acc.c: drop unused structure member
Change-Id: I81f7c35abf424f501ca53d6984c0d56f7936984b
2017-06-19 14:35:22 +00:00
Vadim Yanitskiy 46e533c13a core/conv: update description headers for conv_acc_*
Change-Id: I00154776c8e7d346abcbaf9048ce04d9488bb458
2017-06-19 14:35:21 +00:00
Vadim Yanitskiy e4fe71c04f core/conv: use proper filenames
We already have generic convolutional transcoding implementation
written by Sylvain Munaut and named 'conv.c', so 'viterbi_*' names
looked a bit confusing.

Let's use a single naming scheme for Viterbi related code.

Change-Id: I61062a8d1fbf5f5fc85b4fac58dc4e9fa8b5ef90
2017-06-19 14:35:21 +00:00
Max dd75bacb78 Move NUM_BYTES macro to core library
It's universally useful so it make sense to have it in the shared core:
* move macro from libosmocoding to libosmocore
* add OSMO_ prefix
* add doxygen docs

Change-Id: I5386ba3e1f1cc153ba96c29dc71c9075a052aa02
2017-06-19 11:09:09 +02:00
Pau Espin 21be83794f tlv_test.c: Fix compilation warnings
Several warnings like the one below are fixed:
warning: array subscript is below array bounds [-Warray-bounds]
  uint8_t *unchanged_ptr = buf - 1;

Change-Id: I35d7d926939c14700cbca732bd64e588c75424b4
2017-06-18 10:40:18 +02:00
Pau Espin faa0461314 gprs_ns_test.c: Remove unused byte arrays
Commit 0d4e949e22 changed the code to use
functions with local variables holding the bytes, but forgot to remove
the old global variables.

This test fixes compilation warnings.

Change-Id: I140de30038222b0419423d8c4f9da1946651a4e7
2017-06-18 10:40:18 +02:00
Pau Espin b592134dcf sms_test.c: Remove test of deprecated wrapper function
The deprecated function is just a wrapper, and it triggers a compilation
warning.

Change-Id: Iaac701bdf0c0e66c343f68cc31d82550a024ef57
2017-06-18 10:40:18 +02:00
Pau Espin 92274453e7 card_fs_uicc.c: Fix unused compilation warning
This array of bytes is not yet used but is referring to some specs. They
may be used in the future, so leave it there but mark it explicitly as
unused.

Change-Id: I0a61d17f9989ecddafbc68d4b9446853e4c15159
2017-06-18 10:40:18 +02:00
Pau Espin 69dfe5aeec Fix compilation warning on deprecated macro
A warning was printed even if the deprecation didn't apply to
libosmocore because it is still allowed to use it internally.
This patch fixes this case while still printing a warning if external
projects build using libosmocore headers.

Change-Id: I32212f20756f828af1017482a71e29e4b3adbad4
2017-06-18 10:40:18 +02:00
Vadim Yanitskiy c2afe81d85 ctrl_test.c: fix build with GCC 7.1.1
According to GCC's online docs:

When an inline function is not static, then the compiler must
assume that there may be calls from other source files; since
a global symbol can be defined only once in any program, the
function must not be defined in the other source files, so the
calls therein cannot be integrated. Therefore, a non-static
inline function is always compiled on its own in the usual fashion.

There is no any (performance or size) benefit from 'inline' keyword
in this particular file, so let's replace one by 'static'.

Change-Id: I11e1f1cfea09c6f0cf8225239e782b551d3eb52f
2017-06-13 20:22:19 +07:00
Vadim Yanitskiy 556f03685e gsm/gsm48.c: drop useless assignment
Change-Id: I96c1ba70e332199a4ca95e827a7562f953975af4
2017-06-13 20:22:19 +07:00
Vadim Yanitskiy 49a0dec1fe vty/command.c: drop useless assignment
Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7
2017-06-13 20:22:19 +07:00
Vadim Yanitskiy 6e6978ad12 core/conv/conv.c: drop useless assignment
Change-Id: I8c3aa5ec100abacf93da1493aa134e42bf612206
2017-06-13 20:22:19 +07:00
Vadim Yanitskiy f178695466 gb/gprs_bssgp.c: avoid valueless goto usage
Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
2017-06-13 20:22:19 +07:00
Vadim Yanitskiy d1c7323f3c sim/core.c: drop useless double assignment
Change-Id: I3bfcabd80b57aeb7f110b306350802e6e82c847a
2017-06-13 20:21:58 +07:00
Vadim Yanitskiy cfb1eaacf4 core/conv/viterbi.c: fix possible NULL-pointer reference
Change-Id: I36012d4443d97470050cdf9638a9d4cf67ea3b40
2017-06-13 20:20:40 +07:00
Harald Welte 96e2a00d7a update/extend doxygen documentation
It's a pity that even with this patch we still are fare away from having
the whole API documented.  However, at least we have a more solid
foundation.  Updates not only extend the documentation, but also make
sure it is rendered properly in the doxygen HTML.

Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
2017-06-12 21:55:54 +00:00
Harald Welte 7165880ac2 Update doxygen main page for libosmo{core,gsm,vty}
We should link to project homepage as well as put the library into the
wider Osmocom context.

Change-Id: I07ca57ecef0f36c87c9ebacc1e1507c217bdb25b
2017-06-12 20:07:09 +00:00
Harald Welte 2f984ea194 gsm0503_coding: Mark gsm0503_mcs_{ul,dl}_codes as const
The table describing the various MCS convolutional codes are constant
data and should be marked as such.

Change-Id: I4918521ee4572a67cbee5f9b49257fc5bfcde511
2017-06-12 15:35:27 +02:00
Harald Welte 0eb2c5dab2 gsm0503_interleaving: Mark input arguments as 'const *'
The interleaving/deinterleaving functions were missing 'const'
qualifiers on their input data buffers

Change-Id: I2118c34a6353167787b23f877f1d81d60151aaf9
2017-06-12 15:35:27 +02:00
Harald Welte c663678b26 Add doxygen documentation to libosmocoding
This adds the minimum amount of API documentation that we should have on
all our code, particularly new code merged into a library.

Change-Id: I526804f64313867913574e50e5b9e9205ad3aa74
2017-06-12 15:35:23 +02:00
Harald Welte b9946d372c gsm0503_{coding,mapping}: Mark input arguments as 'const'
It is generally our coding style to mark pointers to constant input data
as 'const *'.  For some reason the gsm0503 coding and mapping was not
adhering to this, so let's bring it into compliance.

Change-Id: Id8731d7ae6171dff94741b6ddbb95ab5f03bfd4e
2017-06-12 12:59:21 +02:00
Harald Welte 2956737681 Add header file with definitions for GSM TS 04.14 / 3GPP TS 44.014
Change-Id: I1f4fc2761b55a4f83544c1c3793ab67fec9fc120
2017-06-12 01:57:41 +02:00
Harald Welte dee7172689 Include codec.h file from codec C files
failure to do so would prevent the compiler from catching
inconsistencies between declaration and definition.

Change-Id: I88617c97adcff328292e501fd5d254eeae96a660
2017-06-09 09:16:57 +00:00