Commit Graph

946 Commits

Author SHA1 Message Date
Vadim Yanitskiy 8dbacacd37 mobile: get rid of unused variables / functions
Change-Id: Id867ffed9b2b67025320d002e1e009e19c759a23
2017-11-05 23:41:42 +07:00
Vadim Yanitskiy 4fbf93040e mobile/gsm411_sms.c: use secure gsm_7bit_(en|de)code_n
Since some 'gsm_7bit_*' functions were deprecated and replaced by
more secure ones with the '_n_' postfix in names, it's better to
use the updated functions.

Change-Id: I58150e9b74699e5f54b9a83416ad8efcb2eccd8e
2017-11-05 23:41:42 +07:00
Vadim Yanitskiy b353686451 mobile/gsm48_mm.c: use secure gsm_7bit_decode_n
Since some 'gsm_7bit_*' functions were deprecated and replaced by
more secure ones with the '_n_' postfix in names, it's better to
use the updated functions.

Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
2017-11-05 23:41:42 +07:00
Vadim Yanitskiy 37872f1032 mobile/gsm480_ss.c: use secure gsm_7bit_(en|de)code_n_ussd
Since some 'gsm_7bit_*' functions were deprecated and replaced by
more secure ones with the '_n_' suffix in names, it's better to
use the updated functions.

Change-Id: If8a1983592f5800e3981f29962eb333ac9473f40
2017-11-05 23:41:42 +07:00
Vadim Yanitskiy 584cc7a26b mobile/vty_interface.c: fix incompatible pointer type warning
According to the vty_app_info struct definition, the go_parent_cb()
should return an integer, but not enum. So, this change fixes the
following compiler warning:

> warning: initialization from incompatible pointer type
>   .go_parent_cb = ms_vty_go_parent,

Change-Id: Ib55e43eaaebdd9fe0d74a030b1057ae82804a77e
2017-11-05 23:41:42 +07:00
Vadim Yanitskiy b7ff8b5893 mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()
The usage of msgb_set_talloc_ctx() was deprecated many days ago,
so it's time to use the proper replacement.

Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
2017-11-02 14:21:16 +00:00
Vadim Yanitskiy aceb6a80d8 mobile/vty_interface.c: add missing 'vty/misc.h' header
This header contains declaration of the osmo_talloc_vty_add_cmds().

Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
2017-11-02 14:21:16 +00:00
Vadim Yanitskiy 8a617cd160 mobile: register the talloc context introspection command
This change registers the command, which is now implemented in
libosmocore since the 463deef8c209dd7eb023ac70bf41fa9893ad35ed
and allows to introspect mobile application's talloc context
directly from the VTY interface.

Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338
2017-10-29 17:46:10 +00:00
Vadim Yanitskiy 363d4d22da mobile: clean up and share example configs
It is better to have a shared example config files directory,
like other Osmocom projects do.

Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea
2017-10-23 15:11:16 +03:30
Vadim Yanitskiy da9e830af0 mobile/vty_interface.c: do not write 'exit' to config
Since we use indenting as means to implicitly exit child nodes,
no need to write 'exit' at the end of each child node.

Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9
2017-10-23 00:33:58 +03:30
Vadim Yanitskiy c5a08ef4f4 mobile/vty_interface.c: do not install default commands
Since in recent version of libosmocore default commands (such as
'exit' and 'end') are being installed by default, no need to
install them twice. This will crash the program.

Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c
2017-10-23 00:33:29 +03:30
Vadim Yanitskiy ae31c37d2b mobile/main.c: clean up config file selection logic
The 903e2515 introduced the following problems:

  - The home variable is allocated dynamically by talloc,
    but not being freed. There is no need for dynamical
    memory allocation, as the getenv() returns a pointer
    to a value in the environment or NULL.

  - In case of custom configuration file, a pointer to
    a part of stack (not heap) is passed to talloc_free().
    This may cause unexpected behaviour of segfault.

Let's fix both of them.

Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5
2017-09-09 00:40:43 +03:00
Max 903e2515f5 Add arbitrary config file location support
All other Osmocom projects use '-c' command line option to specify the
location of config file. Let's do the same with fallback to existing
implicit config file name logic.

Also print config file path and vty host on startup.

Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311
2017-09-07 18:08:03 +02:00
Harald Welte b2c19fc5d3 VIRT-PHY: Add support for GPRS / TBF mode
we add a new STATE_TBF to vthe MS model and add some L1CTL primitives
to configure that TBF mode as well as to enqueue transmissions for
blocks at a given USF+TS.

Change-Id: Ie6f37090bd45f463aa25d9e00bc06f563be5264a
2017-08-20 22:19:17 +02:00
Harald Welte 35564c691f VIRT-PHY: virt_l1_sched: Pass timeslot number into call-back
When we schedule a given frame for transmission, we save its timeslot
number.  However, the callback doesn't get informed about this so far.

Change-Id: I608a91ae8e2a57a2d6f87f4b873c82edb0215bf6
2017-08-20 22:19:17 +02:00
Harald Welte ae15e7f9de VIRT-PHY: Support forwarding of CBCH similar to BCCH/CCCH
Change-Id: I3e6f936603e43e885b28953be5ac262e3fb7c09a
2017-08-20 22:19:17 +02:00
Harald Welte 3595402641 virtphy: Add SIGINT+SIGTERM handlers
Change-Id: I2fe65e0c1912c4d72c276a2db169f0bdbcbda2b8
2017-08-20 22:19:17 +02:00
Vadim Yanitskiy a52abd5d4f vty_interface.c: use RPLMN from settings if preset
Previously, when testcard was attached via VTY interface, the
initial values were used for MCC / MNC, LAC and TMSI, even if
correct RPLMN settings were set.

Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
2017-07-27 12:25:34 +06:00
Harald Welte 5e0fa863cb VIRT-PHY: enable proper memory leak debugging
We make sure that all allocations are tracked back to one talloc root
context, and install the usual SIGUSR1 handler to dump the talloc
report.  This enables us to do interactive debugging for memory leaks
while virtphy is running.

Change-Id: I73b3cf86eea5f56595c1b045cf0fde8035ff185a
2017-07-19 14:10:04 +02:00
Harald Welte dd3fd10903 VIRT-PHY: We don't do line-breaks inside log statements
Change-Id: I27cba13ee782c53a9b2406319241fc7f4e3db0bd
2017-07-19 14:00:09 +02:00
Harald Welte f122d4cd36 VIRT-PHY: Properly destroy l1_model_ms after disconnect
If a MS disconnects, we need to clean up all related state

Change-Id: Ib7adef61150b5a4338483019e4dd75d7279d1f5d
2017-07-19 13:53:30 +02:00
Harald Welte c0fba7a298 VIRT-PHY: Change default log levels
This will basically only print L1C message for all L1CTL happening
between MS and the BTS, while suppressing the GSMTAP/virtUM and L1P
related messages.

Change-Id: I9513db3cee12644ed9b9858e13b740ffd27aba24
2017-07-19 13:39:54 +02:00
Harald Welte d80c6f4ef8 VIRT-PHY: Clean up logging statements
The generated log lines have been *super* long, let's make them
significantly shorter.  Also, differentiate between DEBUG and INFO
level, so normal operation with LOGL_INFO will not spam the user while
still printing useful information.

Change-Id: If06a8b5f99349796d66a71201524361a6547945a
2017-07-19 13:01:56 +02:00
Harald Welte f7dafcc5d2 VIRT-PHY: Separate logging of L1 Control and L1 Data
L1 Data is quite verbose, while control is typically limited, so let's
make sure we log them as separate sub-systems

Change-Id: Idebc371a63508c593855486ff01b2ba6e8c2cfd1
2017-07-19 12:14:35 +02:00
Harald Welte 198dbda3c8 VIRT-PHY: Log MS context number whenever possible
Now that we can have multiple MS connected to one virtphy instance,
it is important to log some context whenever possible.  To do so, we
introduce a monotonically increasing MS number which gets assigned
whenever we allocate a l1_model_ms and printed when the LOGPMS() or
DEBUGPMS() macros are used.

Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65
2017-07-19 11:53:13 +02:00
Harald Welte f5e0f6424b VIRT-PHY: Major rewrite to deal with muliple L1CTL clients
Change-Id: Ibfb2a93f8b45a95215c01368b1a52d92283474e6
2017-07-19 11:30:26 +02:00
Harald Welte ef9ee6116b VIRT-PHY: Don't redefine GSMTAP port number, use libosmocore
Change-Id: I11d04d76292c52ec5ab70893e8c6a2e55586b2ec
2017-07-19 00:32:36 +02:00
Harald Welte 7b6071208e VIRT-PHY Use libosmocore unix domain socket helper
Change-Id: Ic0fa003bd7c7468d39a0c39fbea89000d576a4f3
2017-07-18 23:36:17 +02:00
Harald Welte c2083feefa VIRT-PHY: reorganize data structures
* l1_model_ms can become a static member of l1_model_ms
* crypto_info_ms can become a static member of l1_state_ms

Change-Id: I94ca4dad1c6c668ce6307d5e5d728b1c1502af12
2017-07-18 22:18:52 +02:00
Harald Welte 3ee8ac1593 VIRT-PHY: some more comments/documentation
Change-Id: I24fc98624178e9441d6cfcd61bc14e17c1391e9e
2017-07-18 21:41:24 +02:00
Harald Welte 70dd7e5b75 VIRT-PHY: Use IPv4 multicast groups for private / local scope
The addresses in the original code make little sense:
* 224.0.0.1 is "All systems on this subnet" and not routed
  outside the local ethernet segment
* 225.0.0.1 is in a RESERVED range that shouldn't be used

Change-Id: I8e3acd745e65a6cfa70b681a440da6a59a1ed0b5
2017-07-13 17:18:00 +02:00
Harald Welte c4324da7c6 VIRT-PHY: Use osmo_fd_close() introduced in libosmocore
libosmocore has recently received a new function osmo_fd_close() which
can be used to replace the private fd_close() function in this code.

This requires Change-Id Icd0933eed6a24edde7cdcb378e138897ecc5332c in
libosmocore.

Change-Id: Id8a518dfb09465c2765681407e5581aee2d62d6d
2017-07-13 16:37:27 +02:00
Harald Welte 4f9913f1fd VIRT-PHY: Use new OSMO_SOCK_F_NO_MCAST_{LOOP,ALL} flags
libosmocore has recently gained support for flags like
OSMO_SOCK_F_NO_MCAST_LOOP and OSMO_SOCK_F_NO_MCAST_ALL that can be
passed to the socket initializer functions, further reducing complexity
of the code in osmo_mcast_sock.c here.

The related change-IDs are I5ab5de45c0b64ceb3636ea98245a23defa24ffd4 and
I24a5b1ebc3f84d2d5d4734e54df50efaea26490b in libosmocore.git.

Change-Id: I961aa07a381fef2cf9a2fb5357937864364ca04b
2017-07-13 16:35:50 +02:00
Harald Welte 48d2a55b40 VIRT-PHY mcast_sock: Use uint16_t for ports, bool and const
Change-Id: I4eab1da8d43fdad05c04f23d89711081c4696fe7
2017-07-13 14:24:57 +02:00
Harald Welte 16da443e73 VIRT-PHY: mcast_sock: properly clean up in error paths (close/unreg socket)
Change-Id: I2c22359735af6b867e25e0f566cadbc88f21ef44
2017-07-13 14:18:09 +02:00
Harald Welte 0d0d2ec724 VIRT-PHY: Further simplify mcast_sock code
By avoiding dynamic allocations and relying on osmo_fd, we can
significantly simplify the code.

Change-Id: Iad653686ac2bda5b3c92c30b4386ee7727d16271
2017-07-13 14:16:31 +02:00
Harald Welte 3017a977f7 VIRT-PHY: mcast_sock: We must close the fd before setting it to -1
Change-Id: Id8e72c8800a8b3021ab350acaebd912f1b387063
2017-07-13 13:59:40 +02:00
Harald Welte 91a0c20bb3 VIRT-PHY: mcast_sock: Don't keep subscribed multicast group around
We can avoid having to keep around the multicast group in a chunk of
dynamically allocated memory and simplify related code.

Change-Id: Ic39ffe73dfd2cb8ffefb9614340e275dac87bd50
2017-07-13 13:58:28 +02:00
Harald Welte dd94566f7b VIRT-PHY: mcast_sock: Avoid dynamic allocation of osmo_fd member
Change-Id: I11e0137849797eb67047b4ddca0e917c599ed909
2017-07-13 13:54:21 +02:00
Harald Welte a2f06f28e2 VIRT-PHY: osmo_mcast_sock: Get rid of server_sock.sock_conf
We don't need to store this data, we cans simply connect the socket to
the destination mcast address instead.

Change-Id: I3c98653c41eff9feb649d9c47cd40b26fd81ed05
2017-07-13 13:49:37 +02:00
Harald Welte 46a4524126 VIRT-PHY: osmo_mcast_sock.c coding style cleanup
Change-Id: Ie45ea5911167600cb9a1a79dfcd9656be1e91dab
2017-07-13 13:48:04 +02:00
Harald Welte 8a2080b96a Port osmo_mcast_sock to libosmocore socket routines
Change-Id: Ia44c086fb8e428edf49bafd1662c31b2dc2bfc43
2017-07-13 13:44:41 +02:00
Harald Welte 271eca57a9 VIRT-PHY: Use gsmtap value_strings in recent libosmocore
In Change-ID Iaf8a99912f42a56ef785a1642e18238c0b67cf68 libosmocore
introduced value_strings fro the GSMTAP_CHANNEL_* and GSMTAP_TYPE_*
constants, so we can remove the private tables.

Change-Id: I771dbe079fc6d1a5e66e958deb832c1168990851
2017-07-13 12:23:05 +02:00
Harald Welte 656cd327f9 VIRT-PHY: common_util: chantype_gsmtap2rsl() now in libosmocore
As of Change-Id Ie1bc00670887064da0fea61c3dab036c23ceea25, this function
is offered by libosmocore.

Change-Id: Ie269afe314967fd2c42b91ee854c217f699252dc
2017-07-13 12:23:00 +02:00
Harald Welte c8d1ad36eb VIRT-PHY: Fix all compiler warnings on gcc-6.3.0
Change-Id: I95b93ec907fbfd180a0f2ac681dd63791ede24db
2017-07-12 23:26:26 +02:00
Harald Welte 5abc25c852 VIRT-PHY: Make sure heaer files are part of 'make dist'
Change-Id: Ib4cd0463da1cf22e04a1debfed55a33f7b6542d4
2017-07-12 23:26:26 +02:00
Harald Welte 7e65a1483f VIRT-PHY: coding style / API usage cleanup
This is the result of my manual clean-up of the many coding style issues
found in the stumpf/virt-phy branch of OsmocomBB.  Some may remain, but
it's much closer to what we're used to in the Osmocom world now.

Change-Id: I3aa95dbef75d7749d490aad0237d074528527e8b
2017-07-12 23:26:26 +02:00
Harald Welte 020186009c VIRT-PHY: Remove non-overridable CFLAGS "-g -O0"
If the user wants debugging / no optimziation, they can always pass the
related CFLAGS at ./configure time, there's no nee to have them
hard-coded in the actual Makefiles.

Change-Id: I6a2b30f946579bbd49bf66c4f59d160a975a1b56
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 203f7e0c7f VIRT-PHY: Configurable signal power reductions for multiple arfcns.
Model was expanded and holds now power management information consisting
of an array of received power levels for all arfcns and one for the
reduction of this signal in dbm. The reduction is configurable by
commandline by --arfcn-sig-lev-red 666,12:888,13. The signal level is
assumed to be max level (-63) if a packet from that arfcn is received
within a timeframe (also configurable via  cmd -- timeout-pm 5:800 ==
<seconds>:<microseconds>). After that timeout it will be reduced to min
level (-110).

Change-Id: I369ca26703f14bba4e9334b8f417deef640462f9
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 59cc3c3ab1 VIRT-PHY: Extracted common virtphy utils.
Change-Id: I759c6e9805ab012f9553bcba9b5d379193462955
2017-07-12 23:26:26 +02:00
Sebastian Stumpf ba1f7c2974 VIRT-PHY: Added option parsing.
Available options:
dl-rx-grp: mcast group messages on downlink are received from
ul-tx-grp: mcast group messages on uplink are sent to
port: port used for mcast sockets
log-mask: logging mask
l1ctl-sock: l1ctl socket path to connect to l23

Change-Id: Id939e5d7b90b592c85ad19f3ad6f459351e2d8f6
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 7ea7b8ac05 VIRT-PHY: Add downlink filter for msg on dedicated channels.
Messages incoming on dedicated channel (SDCCH/8, SDCCH/4) are no longer
forwarded to l23 if their timeslot/subchannel is not fitting the ones
configured by l23 via L1CTL_DM_EST_REQ.

Change-Id: I6112b20e31c25636e53d3a6cda6f7443a94ff9c3
2017-07-12 23:26:26 +02:00
Sebastian Stumpf c1705d53db VIRT-PHY: Fixed power management and PCS sync.
PCS flag was ignored in fbsb. Power management returned a perfect link
for all possible arfcns causing the mobile trying to sync to all these
afterwards. This took too long and PM now only returnes a good link
quality for arfcns configured as available.

Power management was also extracted to an own file.

Change-Id: Ia1b79aa47c9df3b1e316122455ceccb4a66724e0
2017-07-12 23:26:26 +02:00
Sebastian Stumpf e7600a0d57 VIRT-PHY: Fixed FACCH processing on TCH.
As TCH is not supported in GSMTAP yet, all incoming frames on the
virt-phy are forwarded as FACCH to the l23 for now.

Cleanup code in virt_prim_data and virt_prim_traffic.

Change-Id: I6b41f21b6984e62ad98edfe4398bd678d5b2dad5
2017-07-12 23:26:26 +02:00
Sebastian Stumpf a090f635b0 VIRT-PHY: Scheduler - correct handling over hyperframe repeat.
Scheduler will no longer skip tasks that are scheduler for a framenumber
greater than the current fn because of a hyperframe repetition.

Change-Id: I683ba18b5dee308d58f9a95a0ee10e22da207eda
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 30cc674df8 VIRT-PHY: Calculate correct scheduler fn for data- and tch-msgs on ul.
Proper calculation of the scheduled frame number and appending the jobs
with that fn to the scheduler. Thus uplink msgs are scheduled at the
(approx.) correct fn and with this fn set in the gsmtap hdr.

Change-Id: I0f44d0b5b9208755e671c619d1f851a043aefb54
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 241fe9c3e2 VIRT-PHY: Fixed error causing send msgs to be received on same sock.
This could be disabled setting socket option IP_MULTICAST_ALL = 0.

Change-Id: Ia2838c4cd39bfac04c014b4c8512466b301d8875
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 360de6bead VIRT-PHY: Data and traffic req from l23 now use scheduler.
Msgs are not put on virt um directly in the handler like before, but are
scheduled. FN they are scheduled with not yet properly calculated.

Also, code was extracted from lactl_sap.c into own files.

Change-Id: Ibe57abebadf294f1407d82cef3fd0b51e7c1b23e
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 2dfe603117 VIRT-PHY: Using IANA-registered port 4729 for GSMTAP for virt um.
Change-Id: Id8e262c9a9a6260353bfb98e774b9d0b6eecae53
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 63f3ce2482 VIRT-PHY: Uplink scheduler implementation.
Implemented simple scheduler depending on frame number in downlink. It
will be executed each time we receive a msg on downlink and send out all
scheduled uplink msgs with a sched_fn smaller than the one of this
received downlink msg.

Further refactored l1ctl_sap by extracting rach and fbsb logic and
putting it to own files virt_prim_fbsb.c and virt_prim_rach.c

Added simple states to the ms layer 1 model, indicating if the ms is
currently searching for bts, syncing to or camping on a bts. Downlink
will be handled differently dependent of the state.

Change-Id: I8937b1d6568f5d3750bbdc5d77fa283074d5365e
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 0a68f6884c VIRT-PHY: Uplink flag and arfcn check.
Incoming messages with the uplinks flag set in the arfcn or another
arfcn than the cell's we are camping on are ignored.

Change-Id: Ibb78ac68172fceaa04acca81271940632e52d857
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 5385c7d19a VIRT-PHY: Added example config for 2 mobile instances.
Change-Id: Iecfed3933ca88aa7a027e6247a8b71e28ee1883e
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 5490fa9097 VIRT-PHY: Enable multiple phy-instances by configurable l1ctl-sock-path.
Change-Id: Ief22eedacd1929450ff68f553068b95a778df80f
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 2e265c897a VIRT-PHY: Cleanup dirs, makefile, dependencies and formatting code.
Change-Id: Ibd68a03bcc439c262ba513782936c6b62937eaaa
2017-07-12 23:26:26 +02:00
Sebastian Stumpf fa2ce6396f VIRT_PHY: Improved l1ctl-to-l23 interface + gsmtap header parsing.
Fixed mapping from gsmtap msg type to rsl msg type and vice versa.
Proper chan_nr decoding instead of usage of dummy values for timeslot /
link_id / subslot.
Implemented missing l23 rx handler routines.

Change-Id: Ibad741d112643c55091b8ba00164b05d728ae1a1
2017-07-12 23:26:26 +02:00
Sebastian Stumpf 2fe2ba3d46 VIRT-PHY: Implemented RACH on uplink.
RACH will now be transmitted over GSMTAP virtual UM interface if L1CTL
command is received.

Minor further changes:
- Incoming messages are now only then forwarded if ms is synced to a
cell (fbsb cmd from l1ctl received).
- SDCCH/4/8 are forwarded to l23 for now as we don't use
encoding/ciphering (yet) this should not be a problem.

Change-Id: Ic15188c5c0bba96c223d689be733324a9778a2e8
2017-07-12 23:26:26 +02:00
Sebastian Stumpf a4aaa14878 VIRT-PHY: Initial commit of virt-phy to work with osmo-bts virt-phy.
This patch implements a virtual physical layer replacing the air
interface. The purpose is to get rid of the hardware requirements
and be able to start testing and implementing layer 2 communication
functionality on one machine. Multicast sockets are used to enable
bidirectional communication between the BTS and the MS process.
The GSMTAP protocol designed for wireshark capturing is used to
encapsulate the payload on the virtual physical layer.
The virtual physical layer on the osmocom-bb side implements the
L1CTL interface to the layer23 apps like mobile.

* Working mcast socket communication and extraction of its
  functionality.
* Basic handlers for file descriptor callbacks from incoming L1CTL
  messages and extraction of that functionality to a l1ctl socket class.
* Multiplexing to different routines depending on incoming L1CTL
  message type.
* Uses virt_um and osmocom_mcast_sock implementation from osmo-bts
  virt-phy.
* Ecapsulation and parsing methods to and from GSMTAP messages.
* Basic handlers for file descriptor callbacks from incoming mcast
  messages on the virtual um.
* Multiplexing to different channel routines based on GSMTAP header
  channel type.
* Example configuration for l23 app mobile using virtual test sim.

Change-Id: I203c8ec58326e52a09603a37232fce7ae3641415
2017-07-12 23:26:26 +02:00
Vadim Yanitskiy 064ffe6563 host/mobile: use talloc for ms->name allocation
The approach of talloc memory management reduces memory usage,
and prevents some buffer overflows, which were possible before.

Change-Id: Icd6706117fdd7f1b3481b0e3817bbb3b31f12f60
2017-05-25 11:43:49 +00:00
Vadim Yanitskiy 3aaf127cc1 mobile/gsm48_mm.c: strip unused variable
Change-Id: I2708628263bec4bc6bf53a357928e23609b40c64
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy b2a1f72710 mobile/gsm480_ss.c: gsm480_mmss_ind: return rc
Change-Id: Iabaccdbdfc5a5eb6424bd1603f405241650f13d8
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy 81b6e7d9f4 mobile/gsm48_rr.c: fix BA range exceed check
Change-Id: Ic2ebe9faeeda7ce812527962d209e6049f2dfc75
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy e569ac3bc5 mobile/gsm480_ss.c: fix copy-paste error
Change-Id: I23287c0f31bee9c1b710f17f932633d2c621dab0
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy 03485409be mobile/gsm322.c: fix mcc/mnc typo
Change-Id: I4a3aaa0465598b17ccd30ec4cbeb90429216540e
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy 06f44d3772 mobile/gsm322.c: check fwrite() return value
Change-Id: I74ad6e540c98ab4914e7a2ea725dd23f5a2fd034
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy 03aace5818 host/app_mobile.c: do not exit in mobile_new()
Previously, if there was any error during a new osmocom_ms
structure allocation, the mobile_new() used to call exit()
directly. Since we always check return value of this function
it would be more correct to return NULL in any bad case.

Change-Id: I9a594dd1d133f0c0740dc3bff41633f94099b593
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy 0f39694210 sap_interface.c: drop meaningless condition
If sap_state is equal to SAP_NOT_CONNECTED, it cannot
be equal to another value at the same time. So the
second part of condition doesn't make sense.

Change-Id: I3038fc15745dc4be796d894002524e6b2dd5c90e
2017-05-25 02:11:53 +03:00
Vadim Yanitskiy f978a66ca6 osmocon.c: strip unused variable
Change-Id: I295785295c108798e0c235e78bd8fd8f3c585d16
2017-05-24 22:22:33 +00:00
Harald Welte 0cdf4b0a68 Support Early Classmark Sending
If SI3 rest octets indicate early CM Sending is allowed, and the
'support' indicates we support it (which we now do by default), then
send the classmark change message every time a LAPDm link layer is
established.
2017-01-15 20:46:27 +01:00
Harald Welte c9ad46ac75 Fix encoding of padding at end of CLASSMARK 3 IE
Contrary to e.g. SI rest octets, the padding at the end of a CLASSMARK 3
Information Element is padded with zeros, not with L.  There is no 0x2b
padding in this case.
2017-01-15 20:46:26 +01:00
Harald Welte 214236fd5d mobile.c: Don't register 'end' command to CONFIG_NODE
The CONFIG_NODE already has an 'end' command, and recent versions of
libosmocore actualyl check for conflicting/duplicate command
registrations and make the application crash in this case.
2017-01-15 20:46:26 +01:00
Harald Welte f95d518c63 mobile: Finally fix copyright notice
After 7 years it is about time...
2017-01-15 20:46:26 +01:00
Яницкий Ва дим bec943f0b7 host/mobile: Improved SAP interface integration
1) Now the SAP interface is selectable as SIM source using the 'sim sap'
   command in VTY.
2) SAP connection starts only if it is configured as SIM source.
3) Fixed sap_socket_path configuration r/w errors.

Written-by: Яницкий Ва дим <axilirator@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-18 21:08:45 +01:00
Яницкий Ва дим 65f05ce618 mobile: Fix for "Added runtime selection of gps device"
The 'gps host HOST:PORT' line in the config file now is generated correctly.
So that it is parsed correctly when loading the config on next startup.
Also the gpsd port now is parsed as it should without a colon.

Written-by: Яницкий Ва дим <axilirator@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-18 21:08:45 +01:00
Harald Welte ef0d8ec31d modernize AM_INit_AUTOMAKE
according to http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
2015-12-31 14:12:40 +01:00
Harald Welte c400827539 autoconf: Migrate from INCLUDES to AM_CPPFLAGS 2015-12-31 14:12:14 +01:00
Sylvain Munaut fc20a37cb3 host/mobile: Finish working support for the SAP interface
Patch mostly written by Nico Golde
and some cleanup/testing by Domonkos Tomcsanyi

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-04-28 15:57:54 +02:00
Igor Almeida e6372a2c24 layer23: initialize l2h/l3h pointers in rx_l1_rach_conf
Signed-off-by: Igor Almeida <igor.contato@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-06 23:47:15 +02:00
Max d7b69212f8 mobile: Use osmocom auth API instead of direct calls
Submitted-by: Max <max.suraev@fairwaves.co>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-15 19:00:13 +02:00
Andreas Eversberg 2d0a5acaf3 mobile/SS: Fixed bug in parsing of known supplemenary service codes
Use correct variable to check if supplementary service code is known
or not.
2013-12-24 07:33:58 +01:00
Andreas Eversberg 8a8796802b osmocon: Improve performance by handling several serial bytes at a time 2013-06-19 15:16:58 +02:00
Bhaskar f2ab5e1496 host/mobile: Add 'extern' qualifier to config_dir in app_mobile.h
This prevents duplication definition with main.c

From: Bhaskar <niceguy108@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-05-23 08:30:15 +02:00
Bhaskar 761127b6b4 host/mobile: Fixup in error checking path of l23_app_init
From: Bhaskar <niceguy108@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-05-23 08:28:18 +02:00
Bhaskar c6cab89f76 host/osmocon: fix some printf format specifier in handle_write_dnload
From: Bhaskar <niceguy108@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-05-23 08:25:18 +02:00
Sylvain Munaut 2529320420 host/mobile: Fix trans_assign_trans_id() users error checking
The returned value of trans_assign_trans_id() must be stored into a
'int' rather than uint8_t to allow proper testing of negative return
values (errors).

Thanks to Bhaskar <niceguy108@gmail.com> for the original
patches.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-05-23 08:22:48 +02:00
Bhaskar fde82f554b gsm48_mm.h: Added get_mm_name() to header 2013-05-23 07:51:09 +02:00
Bhaskar 2542a55c87 gsm48_mm.c: Bugfix: payload_len should be signed int
As we later check if payload_len < 0, it should be signed, not unsigned.
2013-05-23 07:49:50 +02:00
Bhaskar 78bcbd6cdb osmoload: Fix fall-out from msgb_get() / msgb_pull() transition
Bugfix in Osmoload.c: Assigning correct value to data pointer in
LOADER_MEM_READ. Wrong value was introduced in last update when
msgb_get() was replaced by msgb_pull() which returns end of data instead
of start of data.
2013-05-23 07:44:50 +02:00
Sylvain Munaut 7684cdd20c host/mobile: Remove duplicate A5/1 support indication in vty 'show support'
Patch-by: Martin Hauke <mardnh@gmx.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-04-14 09:00:51 +02:00
Sylvain Munaut d27561b00f host/mobile: Fix comment typo
Patch-by: Martin Hauke <mardnh@gmx.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-04-14 08:59:47 +02:00
Steve Markgraf 1479b6812b osmocon: embed chainloader
This allows to directly load highram-images on
compal phones with the commandline-switch
-c.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-04-07 11:34:48 +02:00
Harald Welte 1a80966cbd support.c: fix typo in comment 2013-03-07 17:33:58 +00:00
Andreas Eversberg 6fead1c78c layer23: Be sure to close mncc socket on exit of mobile instance 2013-01-13 22:35:01 +01:00
Andreas Eversberg fdf7d2f8a5 layer23: Send SIM APDUs via GSMTAP, if enabled 2013-01-12 08:59:05 +01:00
Andreas Eversberg fed1774b65 mobile: Fixed CLIR invokation / suppression
If "clip" is given at vty, CLIR must be suppressed, which results in
presentation of caller ID digits, even if suppressed by network.

If "clir" is given at vty, CLIR must be invoked, which results in
restriction of caller ID digits, even if not suppressed by network.

Note: This only work for outgoing caller ID. Incomming caller ID
restriction cannot be suppressed.
2013-01-10 19:31:12 +01:00
Dario Lombardo dadafc49fb misc: Fix typos 2013-01-08 22:12:25 +01:00
Andreas Eversberg bff6bb7b54 mobile: Fixed ignoring of MDL-ERROR-IND
Some MDL-ERROR causes must not lead to link failure. The missing
"return 0" causes all errors to be ignored which are not listed inside
switch/case statement.
2013-01-08 13:30:35 +01:00
Andreas Eversberg 43b368b66d fix: Use only single CCCH block to determine path loss
The downlink singalling failure counter DSC is decremented by 4
in case of unsuccessfull decoding of CCCH block and incremented
by 1 in case of successfull decoding of CCCH block. The initial
and maximum value of 90 requires to check the signal only once
per 51 multiframe.

If DRX would be supported, only a subset of 51 multiframes are
received, so the initial / maximum value of 90 must be reduced
accordingly.
2013-01-08 09:12:15 +01:00
Andreas Eversberg f6b52d74dd mobile: Allow test card to be maked as already attached
This way it is possible to use test card without making attachment
to the network, if the LAI matches. It can be used to do faster
testing.
2013-01-07 11:22:08 +01:00
Andreas Eversberg 25c5e8221d mobile: Improved exit of mobile process, reset phone
If mobile phone has started, it is reset after shutdown. This
ensures that the phone is not transmitting anymore, especially
while shutting down in dedicated mode.

Using CTRL+c:
The first signal causes initiating of shutdown with detach
procedure. The second signal causes initiating of shutdown
without detach procedure. The third signal will exit process
immidiately. (in case it hangs)

Using CTRL+z:
The first signal causes initiating of shutdown without detach
procedure. A subsequent CTRL+c would exit process immidiately.
2013-01-07 10:39:59 +01:00
Steve Markgraf 9fc6377003 osmocon: make romloader output much less verbose
Most of the output was only for debug purposes anyway.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2013-01-05 18:37:12 +01:00
Sylvain Munaut 4df6653d8d mobile/gsm411: Fix printf format warning
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:10 +01:00
Sylvain Munaut 9c1d7b10b8 mobile/gsm411: Adapt to new libosmocore API for SMC/SMR by adding id
Here we just use the transaction ID

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:44:10 +01:00
Sylvain Munaut 1e2117e70c host/cell_log: Prevent buffer overflow when displaying arfcn range
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:43:49 +01:00
Dario Lombardo 1776eaabe9 host/l23: Added custom frequecy range to cell_log.
Written-by: Dario Lombardo <lomato@libero.it>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-02 20:27:47 +01:00
Alex Badea dccf41703a l23 sysinfo: defer SI4 CBCH mobile allocation until SI1 is received
When parsing SI4, there's a check and a log message saying that CBCH
MA is ignored until SI1 is received.  Then the MA is decoded anyway --
incorrectly -- such that it remains incorrect even after receiving
the next SI1.

Fix that with an "else".

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
Signed-off-by: Andreas Eversberg <jolly@eversberg.eu>
2013-01-02 18:31:30 +01:00
Andreas Eversberg 97eb0c701d Fix: Check if cell is barred, before performing location updating
If not checked, the MM process will crash, due to an endless loop
of trying to do location updating to barred cell.
2012-12-29 15:37:31 +01:00
Andreas Eversberg d72cb4401e Rename various "rxlev" variable to "rxlev_dbm" and correct their signess
All levels in range of 0..63 are now uint8_t and use "rxlev" as
variable name. All levels in range of -110..-47 are now int8_t and use
"rxlev_dbm" as variable name.
2012-11-22 16:00:33 +01:00
Harald Welte 85f4e1b3b8 fix previous commit: use dbm2rxlev()
As andreas points out, there are structure members that are called
'rxlev' but which don't use the scaling (0..63) of the GSM specs, but
which are already a signed type and in dBm.  So they need to be
converted.

TODO: Rename those structure members to rxlev_dbm or something that
explicitly states it is _not_ an 'RXLEV' value in terms of GSM.
2012-11-22 10:15:10 +01:00
Harald Welte 73a809e57b Tell L1CTL_FBSB_REQ the expected received signal level
As Dieter points out, this drastically improves the resiliance to high
receive levels on the C155.  We cannot blindly assume a received signal
level of -85 dBm if the BTS is 2m away and we actually receive -40 dBm.

This patch extends the L1CTL_FBSB_REQ data structure in layer 1 with the
respective field, as well as the l1ctl_tx_fbsb_req() API function called
from the various layer23 apps.

"mobile" and "bcch_scan" already did a PM request and thus know the
expected signal power.  "ccch_scan" and "cbch_sniff" apparently don't
do, so the -85 dBm constant is now hardcoded into the host-side source
code there, and should probably be fixed in a follow-up patch.
2012-11-20 10:13:44 +01:00
Pavel Baturko 2879e77bd3 Fix wrong print of scan freq when using gsm_print_arfcn twice for the same log message 2012-11-16 14:47:54 +01:00
Joshua Lackey 50c3ca922b Fix: Correctly convert ARFCN to index.
If you enable PCS, you'll never make it out of power-measurement without
this patch.
2012-11-15 10:42:18 +01:00
Andreas Eversberg 570c9716c2 Fix: Change T200 of LAPDm if SAPI 0 and SAPI 3 share bandwidth on SDCCH
We use 1 second on FACCH and 2 seconds on SACCH when SMS is transfered
during a call on TCH. There is no impact on bandwidth, because SAPIs use
differen channels.

In order to correctly transfer SMS during SDCCH, the T200 must be raised
from 1 (SAPI 0) to 2 (SAPI 0 and 3), so T200 will not timeout before
receiving acknowledge from BTS. This is because both SAPIs share the same
ressource on SDCCH. After release of SAPI 3, T200 is lowered back to 1.
2012-10-30 16:11:35 +01:00
Andreas Eversberg 07f8345646 Fixed decoding of hexadecimal LAI components
libosmocore has changed its LAI decoding from hex to decimal. This caused
wrong decoding of MCC and MNC. In order to provide required hex
transcoding, special hex encoding and decoding function are added to
mobile/sysinfo.c.
2012-10-30 10:26:20 +01:00
Paul Wise 8eb2f3d7a8 Drop unused imports from the python utilities. 2012-10-01 03:21:53 +02:00
Kevin Redon ca05975c8f Fix linking with GNU ld 2.22 and libgps
Error:
gcc -Wall -I/home/kevredon/osmocom-bb/src/shared/libosmocore/include -I/home/kevredon/osmocom-bb/src/shared/libosmocore/include -g -O2 -D_HAVE_GPSD  -lgps -o cell_log main.o app_cell_log.o cell_log.o geo.o ../common/liblayer23.a /home/kevredon/osmocom-bb/src/shared/libosmocore/build-host/src/.libs/libosmocore.a /home/kevredon/osmocom-bb/src/shared/libosmocore/build-host/src/gsm/.libs/libosmogsm.a /home/kevredon/osmocom-bb/src/shared/libosmocore/build-host/src/codec/.libs/libosmocodec.a -lm
../common/liblayer23.a(gps.o): In function `osmo_gpsd_cb':
/home/kevredon/osmocom-bb/src/host/layer23/src/common/gps.c:79: undefined reference to `gps_waiting'

Fix:
Holger told me to do so (he knows better then me about autoconf)
- set CFLAGS and LIBS for LIBGPS in layer23
- add libgps CFLAGS and LIBS in Makefile.am for common, misc, mobile
I would have done the following (which also works):
-AC_CHECK_LIB(gps, gps_waiting, CFLAGS+=" -D_HAVE_GPSD" LDFLAGS+=" -lgps",,)
+AC_CHECK_LIB(gps, gps_waiting, CFLAGS+=" -D_HAVE_GPSD" LDFLAGS+=" -lgps" LIBS+=" -lgps",,)
2012-09-17 08:40:44 +02:00
Harald Welte 6ce46e7a86 use msgb_pull() to get bytes from start of message, not msgb_get()
msgb_get() is for getting bytes from the end of a message, but it
was broken in libosmocore for a long time (until it was fixed today).
2012-09-08 22:45:30 +02:00
Harald Welte a8ce4ea469 layer23: gsm48_decode_lai() is now in libosmogsm 2012-09-08 22:43:50 +02:00
Andreas Eversberg 24df176826 layer23: Fixed size of power offset (SI 3 rest octets)
This is importaint on certan cells to finish BCCH scanning. If SI2ter
indication is falsely detected, BCCH reading will timeout, because no
expected SI2ter is received.
2012-07-12 15:54:06 +02:00
Sylvain Munaut ce60deff7b host/l1ctl: Make sure to initialize tn in neigh_pm_req
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-29 09:21:57 +02:00
Tim 43c588b6c6 l23: Add option for mobile-app to bind to other interfaces than localhost
Signed-off-by: Tim Ehlers <osmocom@ehlers.info>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-01 22:45:51 +01:00
Tim Ehlers b4a8badc45 mobile: Add vty option to force rekeying for every new channel
Written-by: Tim Ehlers	<osmocom@ehlers.info>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-02-14 23:54:25 +01:00
Steve Markgraf 90ab06ce5c host/osmocon: allow uploading of files > 64kb in romload-mode
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-02-08 21:43:29 +01:00
Christian Vogel 6efc1f395e Framebuffer: Script for font conversion.
bdf_to_c.py is a python script that converts a bdf-file into
the format expected by the osmocom-bb framebuffer (defined
in <fb/font.h>.
2012-02-04 00:12:18 +01:00
Kurtis Heimerl 987787f0cb Just a quick bug fix to gsm322.c.
Basically, there were two commands in an "else" block without brackets,
causing the

"end = 1023+299"

command to execute regardless of the state of index.

Signed-off-by: Andreas Eversberg <jolly@eversberg.eu>
2012-02-02 08:39:56 +01:00
Paul Wise 9dd1f00e83 host: Add support for the new gpsd API
Written-by: Paul Wise <pabs3@bonedaddy.net>
Acked-by: Peter Stuge <peter@stuge.se>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-01-17 08:11:07 +01:00
Andreas Eversberg c2b823faf0 layer23/mobile: Fixed cell re-selection after loosing signal
Test showed that loosing the signal in dedicated mode caused a complete
rescann of all cells. By keeping the cell selected, the process can use
the neighbour cell informations to do a quick search for the best cell
afterwards.
2012-01-02 02:21:19 +01:00
Andreas Eversberg 5e1765c332 layer23/mobile: Minor fix of debugging output 2012-01-02 02:15:26 +01:00
Andreas Eversberg 42004880e6 layer23/mobile: Fixed variable type, so home network is detected correctly 2012-01-02 02:10:54 +01:00
Andreas Eversberg 925322c634 layer23/mobile: Enable SIM reader by default
If there is no SIM card in the reader, the SIM process would
automatically proceed without SIM anyway.
2012-01-02 02:08:08 +01:00
Alexander Huemer 9bfb7d42b3 host/osmocon: correct parsing of -m
Written-by: Alexander Huemer <alexander.huemer@xx.vu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-12-14 20:32:17 +01:00
Holger Hans Peter Freyther 950f7d15e8 layer23: Call talloc_free unconditionally
talloc_free will check for NULL and return -1.

_talloc_free(void *pyr)
{
        if (unlikely(ptr == NULL)) {
                return -1;
        }
...
2011-12-11 15:47:30 +01:00
Andreas Eversberg cb8998e33c Removed obsolete gsm48-andreas directory from "host" tree
It was part of early development of layer 3 protocols, but obsolete since
a long time ago.
2011-11-25 19:25:46 +01:00
Steve Markgraf 937005e247 layer23/ccch_scan: Replace fprintf() with LOGP() and print SI-id
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-22 18:34:58 +01:00
Steve Markgraf 50d58f9dd9 layer23/ccch_scan: Print Paging Requests of type 3
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-22 18:10:23 +01:00
Steve Markgraf 4300e89ba8 layer23/ccch_scan: Print channel type of correct TMSI for Paging Request Type 2
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-22 18:01:06 +01:00
Steve Markgraf ee7201b832 layer23/bcch_scan: bscan_sig_cb() should return something in all cases
Found with clang:
bcch_scan.c:277:5: error: non-void function 'bscan_sig_cb' should return a value

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-11-21 00:42:43 +01:00
Andreas Eversberg 52f2d586ae mobile/MM: Fixed handling of T3230 (MM connection timeout)
If network will not respond to (additional) service request, the timeout
will abort the pending MM connection and return to the state before the
MM connection was requested or wait for network command.
2011-11-17 21:01:38 +01:00
Andreas Eversberg 0730907840 mobile/MM: Fixed handling of T3220 (IMSI detach timeout)
If network will not terminate radio connection, the timeout will abort
the radio connection.
2011-11-17 21:01:26 +01:00
Andreas Eversberg c0c1195a57 host/mobile: Indicate unsupported TS 04.14 test messages in log
There is no support for TS 04.14. A logging message will inidcate this,
if a tester requests test functions. A STATUS message will be sent
as it is for for other usupported protocol types received.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:20 +01:00
Andreas Eversberg 3426063f56 host/mobile: Adding (partly implemented) supplementary service support
Use VTY to request your extension number form OpenBSC:

en
service 1 *100#

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:20 +01:00
Andreas Eversberg fe2e57bc80 host/mobile: Mobile will use SMS Service Center Address from SIM
In case the SMS Service Center Address is not set in the config, the
Address from the SIM card is used. The mobile checks if either one is
defined, otherwise it will refuse sending SMS.

Since records of SIM are read, this patch includes fixes to talk
correctly with the SIM client.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:20 +01:00
Andreas Eversberg fb7be589e6 host/mobile/sms: Adding SMS support for osmocomBB/mobile
Both MO and MT SMS are supported.

Transmission an reception can be controlled via VTY:

en
sms 1 <destination> <text>

All received SMS are stored in "~/.osmocom/bb/sms.txt".

SMS transmission is performed on SAPI 3 datalink, using DCCH or ACCH.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:20 +01:00
Andreas Eversberg cf55219d45 host/mobile/sms: Adding SAPI 3 support to MM and RR layers
RR now handles SAPI 3 datalink.

MM connections now have and individual sapi, so MM can use right SAPI
for communication with other layers, as well as releasing the right
MM connections in case of link release.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:20 +01:00
Andreas Eversberg 928b224539 host/layer23: Flush L1CTL/SAP workqueues when exitting
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:20 +01:00
Andreas Eversberg 4d13b401ae host/layer23: SIM client now supports reading records correctly
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Sylvain Munaut 9311c0025f host/mobile: Whitespace fixes, no functional changes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg 8f77cbecb4 host/layer23: Removed local copy of LAPDm, using libosmocore instad
Since libosmocore already has LAPDm implementation, we don't need the
local copy of LAPDm code anymore.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg e16e02acc0 host/mobile: Bring mncc.h in sync with OpenBSC and LCR
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg 97f688a7af host/mobile: Fixed paging response with correct identity type
In case we got paged with IMSI, but even if we have a valid TMSI, we need to
respond with IMSI, because the network may not know our TMSI anymore.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg 1a2778e7d4 host/mobile: Prevent the MM layer from making calls when not attached
If location updating (attachment) fails, the mobile returnes into idle
state. Because the SIM may be valid in this location area, the mobile must
check if the SIM is already attached. If not it may not change to normal
service.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg 11b4028664 host/mobile: Fix indentation in gsm48_cc, no functional change
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg 0be0680ab5 host/mobile: Adding memory leak debugging
When mobile exits, a list of allocated memory chunks are dumped to
stderr. This helps to find talloc_free / msgb_free leaks.

During process, a SIGUSR1 or SIGUSR2 can be used to dump currently
allocated memory chunks.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Andreas Eversberg 321e3ae2fb host/mobile: Adding telnet_exit to free telnet connection ressources
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 20:25:19 +01:00
Holger Hans Peter Freyther a73c98a3ab osmocom: Address warning about aliasing
We alias the uint8_t buf[..] to a uint16_t* which is violating
the aliases rule of C. Use an explicit memcpy to copy the first
two byte of the buffer. GCC 4.6.2 (debian) is clever enough to
use a normal load does not generate a memcpy call.

osmocon.c: In function ‘un_tool_read’:
osmocon.c:1239:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
2011-11-06 22:10:42 +01:00
Holger Hans Peter Freyther 6d1f116338 misc: u_intX -> uintX in the host directory
Use C99 stdint.h for the inttypes.
2011-11-06 21:55:40 +01:00
Steve Markgraf 7bbd2ac411 host/osmocon: make auto-reload/reboot feature work in chainloading-mode
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-09-05 02:41:41 +02:00
Andreas Eversberg 4d077b0e4c [mobile] Adding option to run as daemon 2011-09-04 19:37:57 +02:00
Andreas Eversberg c9927c72ea [mobile] Using socket application interface with mobile application
Use "-m" with mobile app, to use it in conjunction with LCR or other
applications.
2011-09-04 10:02:43 +02:00
Andreas Eversberg 5c8b76e74e [mobile] Adding socket application interface code from OpenBSC. 2011-09-04 09:57:51 +02:00
Sylvain Munaut 01e64fceb2 host/osmocon: Make use of the libosmcore serial helpers
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 22:36:38 +02:00
Andreas Eversberg d84ba5616f [mobile] Disable SMS by default, because SMS is not supported 2011-08-13 09:40:09 +02:00
Steve Markgraf fda9135874 mobile/vty: Add missing 's' for 'skip-max-per-band' configuration parameter
Thanks to Sylvain for pointing this out.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-08-11 13:45:31 +02:00
Andreas Eversberg 210de12ec4 Fix of wong Classmark 2 when doing CM Service Request.
Same reason as the commit below... (3b2b3b09a)

Thanx again to Dieter for pointing this out.
2011-08-06 17:56:06 +02:00
Andreas Eversberg 3b2b3b09a9 Fix of wong Classmark 1 on Location Updating and IMSI Detach
The reason for the the wrong power capability comes from the fact that
"rr->cd_now" is not yet set and so the ARFCN is 0 which causes the
GSM900 power capability to be used. It is set to "Class 4" in the
configuration file per default, however this value is not defined for
GSM1800/1900.

Thanx to Dieter Spaar for finding this bug!
2011-08-04 19:30:29 +02:00
Andreas Eversberg d8bb915da8 gsmmap: Dump SYSTEM INFORMATION messages while processing 2011-07-31 10:48:46 +02:00
Andreas Eversberg 856d5bde1d Fixed broken gsmmap. 2011-07-31 10:46:36 +02:00
Andreas.Eversberg 1a5461fb2b layer23: Add mobile support for sending / receiving voice frame through MNCC
Support GSM FR codec only so far.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:51 +02:00
Sylvain Munaut 98a1051475 l23/l1ctl: Add default values for audio_mode
Theses value should simulate the old behavior

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Andreas.Eversberg aa4a819d68 layer23: Adapt to new logging API: fix calls to log_init
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Andreas Eversberg 8d24b2f395 [mobile] Added missing curly braces, as proposed by Harald 2011-07-17 12:23:59 +02:00
Andreas Eversberg 051dedd235 [layer23] Added special return value for invalid MCC/MNC input
This way an MNC of 000 can be entered.
2011-07-17 12:15:04 +02:00
Andreas Eversberg 9cfc096477 [layer23] Correctly report to restart mobile instance after band change
Mobile instance must be restarted (shutdown / no shutdown) in order to
apply changes to the available ARFCNs.
2011-07-17 12:13:34 +02:00
Andreas Eversberg ff42943fe7 [layer23] Fixes and improvements of system information decoding 2011-07-17 12:12:18 +02:00
Andreas Eversberg 9548ac0a41 [layer23/mobile] Improvement and fixes of idle mode process
This patch introduces cell re-relection. When camping on a cell, it
scanns neighbour cells. If a 'better' cell is found, the cell is selected.
If the cell is in a different location area, a location upating is
performed under certain conditions.

The 'better' cell depends on various informations that are broadcasted on
the BCCH of a neihbour cell and of course the RX level. Most operators
don't set these informations, so the 'better' cell depend on a better
RX level for the same location area, or a much better RX level (6 dBm)
at a different location area.

There were many issues at the idle mode process that has been fixed.
Expecially when moving, the state machines got stuck, so no more cell search
was possible, or no further calls / location updating was possible.

In order to see the process of cell selection, enter the VTY interface and
enable the network monitor:

enable
monitor network 1  (where '1' is the instance of the MS)

In order to see the current state of the processes, enter:

show ms
2011-07-17 11:12:15 +02:00
Andreas Eversberg c99e2778f0 [mobile] Corrected output value of PCS power class 2011-07-17 10:58:21 +02:00
Andreas Eversberg 072c2d4641 [mobile] Adding option to hide most default values in config
In order to shrink config output, a new config option "[no] hide-default"
is added. The config is now easier to read, but does not show all available
options, if they are set to default. Newcommers may want to see all
available options in config. Therefore all options are show by default.

To hide default options, enter:

configure terminal
hide-default
end
2011-07-17 10:52:05 +02:00
Andreas Eversberg a33bc87fe7 [mobile] Adding PCS band to list of maximum ARFCNs to scan in one band 2011-07-17 10:23:35 +02:00
Andreas Eversberg cc10636f91 [mobile] Adding security warning, if default IMEI is not changed 2011-07-17 10:18:46 +02:00
Andreas Eversberg af06f00219 [layer23] Adding "neighbour cell" logging category: DNB 2011-07-17 10:03:34 +02:00
Andreas Eversberg 599d922134 [layer23] Detach SIM, if reading fails
This way the mobility management and cell selection process continues as
if no SIM has been inserted.
2011-07-17 09:50:36 +02:00
Andreas Eversberg 87c597abf6 [layer23] Adding neighbour cell measurement to L1CTL interface. 2011-07-17 09:36:49 +02:00
Andreas Eversberg e91dfa950e [layer23] Fixed handling of channel 0 in certain loops
The ARFC counts from 1 to 1023, and then to 0. The index of these loops
count from 1 to 1024. The index 1024 stands for ARFCN 0.

This also reverses commit eb77945e16.
2011-07-17 09:09:32 +02:00
Harald Welte 48db968916 settings.h: IMSI is 15 bytes +1 \0 maximum
If we use a larger field to store the IMSI, we can create overflows when
copying the imsi to other structures that are only 16 bytes in size.

Detected by Smatch:
src/host/layer23/src/mobile/subscriber.c +195 gsm_subscr_testcard(39) error: strcpy() 'set->test_imsi' too large for 'subscr->imsi' (20 vs 16)
2011-07-16 17:41:02 +02:00
Harald Welte eb77945e16 sysinfo.h: ARFCN can be 0..1024, so we need an array of 1025 entries
Detected by Smatch:
src/host/layer23/src/mobile/gsm48_rr.c +1658 gsm48_new_sysinfo(23) warn: buffer overflow 's->freq' 1024 <= 1024
2011-07-16 17:38:19 +02:00
Harald Welte cd4da1d350 gsm48_rr: Don't overflow array boundary
Detected by Smatch:
src/host/layer23/src/mobile/gsm48_rr.c +3021 gsm48_rr_render_ma(89) warn: buffer overflow 'cd->freq_seq_lv' 10 <= 10
src/host/layer23/src/mobile/gsm48_rr.c +3023 gsm48_rr_render_ma(91) error: buffer overflow 'cd->freq_seq_lv' 10 <= 10
2011-07-16 17:37:34 +02:00
Harald Welte b631c289c3 osmocon: if we ignore a return value, we don't need to assign it to a variable 2011-07-16 17:34:07 +02:00
Harald Welte 1520fad932 osmocon: get rid of some Smash warnings 2011-07-16 14:52:18 +02:00
Holger Hans Peter Freyther 58a1b81425 misc: Fix crash in cell_log due missing l1_prim_cb
Commit 3538c38835 introduced the
l1_prim_cb but the init of the misc apps were not updated, make
it us the generic callback that should restore the previous behavior
2011-07-16 09:33:35 +02:00
Harald Welte d6663ad996 lapdm: fix use-after-free
We cannot msgb_free() the msgb and then later reference msg->l2h!
2011-06-27 08:41:32 +02:00
Harald Welte 4a8fb6111b lapdm: properly set the msg->l3h to the contents of the RSL L3_INFO IE 2011-06-25 18:32:08 +02:00
Harald Welte 7506e29c61 lapdm: introduce a new lapdm_phsap_dequeue_prim()
This function can be called by a TDMA-driven L1 which will never actually want
to receive unsolicited/asynchronous PH-DATA.req primitives, but who will simply
directly poll the LAPDm transmit queue by calling the abovementioned function
2011-06-24 22:05:46 +02:00
Harald Welte 50c035c309 lapdm: Don't try to send data using a PH-RACH.req, use PH-DATA.req 2011-06-24 15:57:59 +02:00
Harald Welte 619038bc9d lapdm: some more error reporting in case strange primitives arrive from L1 2011-06-24 15:28:02 +02:00
Harald Welte a9da9b730d L1CTL is sending PH-DATA.ind, not PH-DATA.req up to LAPDm 2011-06-24 15:26:59 +02:00
Harald Welte ec71711ebf introduce LAPDM entity flags for PH-EMPTY_FRAME.req and pollling
polling means that we never try to proactively generate a PH-DATA.req
unless there was a PH-RTS.ind first.
2011-06-24 13:56:48 +02:00
Harald Welte 04190eabd3 lapdm: Introduce LAPDM_MODE_{BTS,MS} to run on both sides
We also introduce some related functions like
	lapdm_{entity,channel}_set_mode()
	lapdm_{entity,channel}_reset()

This is all in preparation for the Osmo-BTS Work.
2011-06-24 12:23:17 +02:00
Harald Welte 68d03b86f4 lapdm: implement RSL CHAN RQD generation from PH-RA.ind 2011-06-24 00:42:01 +02:00
Harald Welte bee8a01b8d lapdm: use msgb_tlv_put instead of manual equivalent 2011-06-24 00:13:17 +02:00
Harald Welte 88f5d463d2 fix some spillage from recent conversion 2011-06-24 00:04:50 +02:00
Harald Welte 3008f31074 lapdm: remove dependency to osmocom_data.h 2011-06-24 00:04:37 +02:00
Harald Welte e4ea01041e lapdm: remove get_rsl_name() and use libosmogsm:gsm_rsl_name() instead 2011-06-23 23:57:34 +02:00
Harald Welte 3538c38835 further decouple lapdm code from osmocom_ms and l1ctl
we introduce a new primitive layer betwen PH and DL, enabling the
use of the LAPDm code in applications that are not based on L1CTL
2011-06-23 23:55:20 +02:00
Harald Welte 5d65fcba6c add l1ctl_proto.h #includes to lots of files
this is apparently a result of no longer including it indirectly via lapdm.h
2011-06-22 23:08:55 +02:00
Harald Welte f36e4fe86c remove l1ctl data structure form l2_ph_chan_conf()
This brings us one step closer to de-couple LAPDm from L1CTL
2011-06-22 23:04:20 +02:00
Harald Welte 4d5f74375a remove l1ctl data structure from l2_ph_data_ind() 2011-06-22 23:01:18 +02:00
Harald Welte f47de03fe1 lapdm.c: remove unneeded header file #includes 2011-06-21 19:51:01 +02:00
Harald Welte 7ad100b94e layer23: make LAPDm code mostly independent of 'struct osmocom_ms'
This is one step in the direction of re-using the lapdm code in osmo-bts.
2011-06-21 19:51:01 +02:00
Harald Welte ddb20b8b4e remove osmocom_ms reference from lapdm_init()
... yet another step in making lapdm code independent of osmocom_ms
2011-06-21 19:48:20 +02:00
Harald Welte a2f615e522 remove 'osmocom_ms' from struct lapdm_enetity
and replace it with more general l1_ctx nad l3_ctx.
2011-06-21 19:47:34 +02:00
Andreas.Eversberg 58ac7e0e98 [layer23] Adding Quadband support and GSM 4x0 support
This makes it possible to use GSM 850 and PCS 1900 bands, as used in the
US. The support relies on the phone hardware.

Each band (900, DCS, 850, PCS, 480 and 450) can be enabled and
disabled individually for each setting.
2011-05-29 19:51:54 +02:00
Harald Welte 308f9e506e layer23: update to new GSMTAP API in libosmocore >= 0.3.1 2011-05-22 12:36:55 +02:00
Pablo Neira Ayuso 63cca6660f src: use namespace prefix osmo_* for crc16 functions
Summary of changes:

s/crc16_table/osmo_crc16_table/g
s/crc16/osmo_crc16/g
s/crc16_byte/osmo_crc16_byte/g
2011-05-15 17:33:28 +02:00
Pablo Neira Ayuso a1d1680245 src: use namespace prefix osmo_* for utils
Summary of changes:

s/bcd2char/osmo_bcd2char/g
s/char2bcd/osmo_char2bcd/g
s/hexparse/osmo_hexparse/g
s/hexdump/osmo_hexdump/g
s/hexdump_nospc/osmo_hexdump_nospc/g
s/ubit_dump/osmo_ubit_dump/g
s/static_assert/osmo_static_assert/g
2011-05-15 17:33:26 +02:00
Pablo Neira Ayuso 0e6cea9b51 src: use namespace prefix osmo_wqueue*
Summary of changes:

s/struct write_queue/struct osmo_wqueue/g
s/write_queue_init/osmo_wqueue_init/g
s/write_queue_clear/osmo_wqueue_clear/g
s/write_queue_enqueue/osmo_wqueue_enqueue/g
s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
2011-05-15 17:33:23 +02:00
Pablo Neira Ayuso 404f634406 src: use namespace prefix osmo_signal*
Summary of changes:

s/signal_cbfn/osmo_signal_cbfn/g
s/register_signal_handler/osmo_signal_register_handler/g
s/unregister_signal_handler/osmo_signal_unregister_handler/g
s/dispatch_signal/osmo_signal_dispatch/g
2011-05-15 14:39:39 +02:00
Pablo Neira Ayuso ffcc29b5fb src: use namespace prefix osmo_fd* and osmo_select*
Summary of changes:

s/struct bsc_fd/struct osmo_fd/g
s/bsc_register_fd/osmo_fd_register/g
s/bsc_unregister_fd/osmo_fd_unregister/g
s/bsc_select_main/osmo_select_main/g
2011-05-15 14:39:33 +02:00
Pablo Neira Ayuso d3ba2f6037 src: use namespace prefix osmo_timer*
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-15 14:39:30 +02:00
Nico Golde 9ddeae9d42 [sim] Fixed path handling in sim client and mobile app. 2011-05-02 15:55:36 +02:00
Pablo Neira Ayuso ade79a0083 src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
This patch changes include paths to get osmocom-bb working with
the current libosmocore tree.

Among all these renames, you can notice several tweaks that I
added on purpose, and that require some explanation, they are:

* hexdump() in osmocon.c and osmoload.c has been renamed to avoid
clashing with hexdump() defined in libosmocore.

* gsmmap now depends on libosmogsm. Actually I had to cleanup
Makefile.am because I was experiencing weird linking problems,
probably due to a bug in the autotools. With the change included
in this patch, I got it compiled and linked here correctly.

This patch has been tested with the phone Motorola C123 and the
following images files:

* firmware/board/compal_e88/hello_world.compalram.bin
* firmware/board/compal_e88/layer1.compalram.bin

Using the osmocon, bcch_scan and mobile tools.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-04-26 02:55:30 +02:00
Dario Lombardo aa2f2fdfa1 [PATCH] Added runtime selection of gps device. 2011-03-09 16:27:20 +00:00
Harald Welte cde3f7d2c6 mobile: Store N.ba files in same directory as config file
This should remove the last dependency to hard-coded system-wide /etc/osmocom
2011-03-02 11:00:59 +01:00
Harald Welte 4be57b9afd mobile: Use config file in ~/.osmocom/bb/mobile.cfg
We don't need root permission and a system-wide config file in /etc/osmocom

Based on a patch by Pierre Pronchery <khorben@defora.org>
2011-03-02 10:35:39 +01:00
Dario Lombardo b7a4d8d912 Added gpsd support. 2011-02-16 15:15:12 +01:00
Dario Lombardo 26ff2ee880 Renamed gps_* functions to osmo_gps_* functions to avoid overlap with libgps functions. 2011-02-16 15:15:07 +01:00
Andreas.Eversberg 837710c285 [l1ctl] Adding missing msgb_free()
When a corrupt frame cannot be delivered, it is dropped. Also it must be freed.
2011-01-27 16:33:04 +00:00
Dario Lombardo e112a24223 cell_log: Added command line switches to change default gps device and baud rate. 2011-01-26 14:39:00 +01:00
Holger Hans Peter Freyther 66de91f3a8 ccch: Print paging of tyep2 2011-01-23 14:29:44 +01:00
Holger Hans Peter Freyther d1790b9940 ccch: Decode the paging1 type paging requests
Th size checks are a bit messy and I have not seen an optional
MI yet. So this code path is not tested at all.
2011-01-23 14:29:44 +01:00
Holger Hans Peter Freyther 9d90193dee ccch: Print the decoded immediate assignment again, ignore two messages
Decode the immediate assignment and print the messages as a
notice, ignore the Notification for voice group services and
use a magic number for SI 2quater that I could not find in my
version of the spec.
2011-01-23 14:29:44 +01:00
Holger Hans Peter Freyther f9a699e682 ccch: Stop using fprintf for the SI
Stop using fprintf to print the System Information number of the
data we get. For the check use LOGP with LOGL_ERROR. There is
little use in this information.
2011-01-23 14:29:44 +01:00
Holger Hans Peter Freyther 661d9a33e1 logging: Move DRSL, DLAPDM, DL1C to LOGL_NOTICE as default
All these layers are mostly stable, increase the default log
level to LOGL_NOTICE.
2011-01-23 14:29:44 +01:00
Holger Hans Peter Freyther f2ebf09915 misc: Ignore two misc application binaries 2011-01-23 11:36:30 +01:00
Holger Hans Peter Freyther 5c49b44653 ccch: Stop following assignment requests and sending LUs
Make the ccch_scan only look at the immediate assignment
but do not follow it. The old behavior was dangerous as
it could interfere with the real receiver of the channel.
2011-01-23 11:36:30 +01:00
Holger Hans Peter Freyther 84bde8f7fb ccch: Fix the cast of the frequency list 2011-01-23 11:36:30 +01:00
Holger Hans Peter Freyther a31f742a94 ccch: Remove the app_phone.c, move it to the app_ccch_scan file 2011-01-23 11:36:30 +01:00
Holger Hans Peter Freyther d97f0f2681 ccch: Add a copyright header to that file. 2011-01-23 11:36:30 +01:00
Holger Hans Peter Freyther 88eb926637 layer23: Rename layer23 to ccch_scan as discussed on the ml 2011-01-23 11:36:30 +01:00
Steve Markgraf fa86ada92b update .gitignore
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2011-01-18 13:24:28 +01:00
Andreas.Eversberg 411c8f35dd [layer23] Enable half rate support in support.c 2010-12-28 12:22:39 +00:00
Andreas.Eversberg 93c64102e1 [layer23] Timer 3126 must be stopped even if starting time is given 2010-12-28 12:21:18 +00:00
Holger Hans Peter Freyther 2281ec1a65 layer2: Make it possible to disable or increase the number of RA bursts 2010-12-27 20:04:09 +01:00
Holger Hans Peter Freyther ace267cfc2 layer23: Enable combining the long options
Combine the long options from the base and the application. Provide
the long option for the cell log application.
2010-12-27 19:01:37 +01:00
Holger Hans Peter Freyther 63c0e6d199 layer23: Make the logfile configurable with cell_log
Be able to add extra (short) options from the 'applet' to
the main application. Use this to print the help mentioning
app specific options, pass the getopt string and handle the
command line parsing for it.

Change cell_log to keep the logname in the app_cell_log.c
and then access it from the cell_log.c implementation.
2010-12-27 19:01:37 +01:00
Holger Hans Peter Freyther 738f9d892a layer23: Not every application supports every option add enum
Allow each application to specify the options it is supporting.
2010-12-27 19:01:37 +01:00
Holger Hans Peter Freyther 2934d0a4f4 layer23: Create an l23_app_info for various information and cb's
Make it possible that each l23 app can inject the copyright string,
also prepare to have callbacks for the config handling and other
places. This will be useful to add app specific config options.
2010-12-27 19:01:37 +01:00
Andreas.Eversberg 000066110a [cell_log] Use GPS signal, even if it becomes valid during scanning 2010-12-27 17:11:28 +00:00
Harald Welte deee3d3f69 update list of networks with information from ITU
http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.212B-2010-PDF-E.pdf
2010-12-19 00:25:46 +01:00
Harald Welte b6156d3e3d add perl scripts to compute MTK RF Transceiver PLL settings 2010-12-11 05:23:58 +01:00
David Wilson 80600c5a08 layer23: use correct sizeof(sockaddr) for connecting to L1CTL socket
connect's addrlen should be sizeof(local), not the contained path's length.

With the previous code, on OS X connect() will fail with ENOENT.

This permits layer23 to work on OS X using the pl2303 driver,
/dev/tty.usbserial , MacPorts arm-elf-gcc and RANLIB=arm-elf-ranlib

Signed-off-by: Harald Welte <laforge@gnumonks.org>
2010-12-11 11:31:57 +08:00
Alex Badea 689c0e5f8d host layer23: add a small cbch_sniff application
Tune to the ARFCN specified on the commandline (-a).  Then, if
a CBCH Channel Description IE is found in System Information Type 4,
switch to dedicated mode on that particular channel to receive
the CBCH.
2010-11-21 23:33:27 +01:00
Alex Badea 30f17f5dd7 layer23 sysinfo: fix parsing of CBCH Mobile Allocation
When calling gsm48_decode_mobile_alloc(), read the length
byte from payload data[], rather than from si->data[].
2010-11-21 23:33:27 +01:00
Alex Badea ec7349f28b layer23 sysinfo: store chan_nr when decoding CBCH Channel Description 2010-11-21 23:33:27 +01:00
Harald Welte 2303067ea1 rita_pll: Compute values for T-GSM 810 2010-11-21 18:10:46 +01:00
Andreas.Eversberg 7e29ca7006 [layer23] VTY uses CAPITAL letters for all optional parameter names
This makes it easier to understand the VTY help. Every parameter name
is shown in capital letters, every keyword is shown in lower case.
2010-11-20 08:58:44 +00:00
Andreas.Eversberg 8dbf60f581 [layer23] VTY supports "show this" to show current MS node only 2010-11-20 08:34:31 +00:00
Andreas.Eversberg f72baf40d5 [layer23] Adding LAC and TMSI (both optional) to test card (rplmn) 2010-11-20 08:32:32 +00:00
Andreas.Eversberg 633b611dc1 [layer23] Adding LAI to debug output of LOCATION UPDATING REQEST 2010-11-20 08:30:45 +00:00
Andreas.Eversberg ee4fe18cda [layer23] Bugfix: Exit, if init function fails 2010-11-20 08:19:38 +00:00
Alex Badea a69d67ec73 osmocon: make beacon interval configurable via cmdline
Beacons with the default 50 mS interval are too far apart to
be picked up by the OpenMoko gta0x Calypso chip.  Make them
configurable via a -i commandline argument.

As recommended in the OpenMoko wiki[1], an interval of 13 mS works.

[1] http://wiki.openmoko.org/wiki/GSM/Flashing (-od fluid argument)

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
2010-11-17 23:39:45 +01:00
Andreas.Eversberg 3a8e47430e [layer23/mobile] Better overview of "show ms" VTY command
Combined "sh ms" and "sh states" to a more detailed "sh ms". The
look-and-feel is more router like now.
2010-11-14 15:15:38 +00:00
Andreas.Eversberg f8903f06d1 [layer23] Cleanup of mobile application
All functions for handling mobile instances and mobile relevant parts are
moved to mobile/app_mobile.c, the mobile/main.c and mobile/mncc.c become a
simple out-of-the-box mobile application. (making calls)

The mobile/main.c can be replaced easily by a different application now.
this application may have it's own call control implementation (layer 4).
Full configurations via VTY is still possible and required in this case.
2010-11-14 11:52:57 +00:00
Andreas.Eversberg 2d8b427ef8 [layer23] Prevent layer23 apps from abort, if socket to layer1 fails 2010-11-14 11:50:14 +00:00
Andreas.Eversberg 6f2b172780 [layer23] Added support for multiple MS instances
To create another instance: 'ms <name> create'

To remove an instance: 'no ms <name>'

If no instance exists, 'ms 1' is created automatically on startup.

Each instance can be enabled / disabled by using 'shutdown' or
'no shutdown'. Multiple instances may share the same layer2 socket (same
phone hardware), but in this case only one instance can be enabled at the
same time. This makes it much easier to select different settings without
modifying them.

A 'shutdown' initiates the IMSI detach procedure before shutdown is
completed. A 'shutdown force' will immidiately shutdown.

There is no need to restart the software anymore, if fundamental settings
are changed. In this case, a 'shutdown' followed by a 'no shutdown' will
do the job.

If you already have an old osmocom.cfg, you need to "no shutdown" it.
Everything else behaves as before.
2010-11-13 18:45:09 +00:00
Andreas.Eversberg 4df881932c [layer23] msgb_free() must in l1ctl.c must called after reading its header 2010-11-13 18:23:57 +00:00
Sylvain Munaut da738824a0 layer23/mobile: Enable half_v1 support
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-07 10:34:10 +01:00
Andreas.Eversberg 2ac17ed9fa [layer23] Call application sends CC Capability on incoming call
It is required to make DTMF work on incoming calls also.
2010-11-07 10:48:12 +00:00
Steve Markgraf fea95d89e7 layer23/misc: Update .gitignore for ./cell_log
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-11-06 14:52:12 +01:00
Steve Markgraf bd0266d0d8 layer23/mobile: Fix 'implicit declaration' warning for mncc_answer()
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-11-06 14:45:39 +01:00
Andreas.Eversberg a0246e07ff layer23: Use the new rach_req format in l1ctl and update l23 apps to use it
This removes an old hack

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-30 17:32:09 +02:00
Andreas.Eversberg 33ad399e21 [layer23] cell_log's scanning depth now depends on movement speed 2010-10-30 12:30:00 +00:00
Andreas.Eversberg 794c85387c [layer23] Fixed T3 value in RACH confirm message 2010-10-30 08:53:22 +00:00
Steve Markgraf 8f007baced layer23/mobile: Add configuration option for automatically answering calls
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-10-27 20:30:13 +02:00
Steve Markgraf 4dea28252c layer23: typo/cosmetic fixes in cell_log.c and mnccms.c
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-10-27 20:26:05 +02:00
Sylvain Munaut e6036a111f layer23/vty_interface: Fix typos, AMR is v3 not v1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-25 20:58:31 +02:00
Andreas.Eversberg 42f0e39d4e [layer23] Fix of LAPDm when handling "timer recovery state"
Sylvain found out that the state was not cleared when receiving an RR
response with F-bit == 1. The missing handling is now added and tested.

Furthermore there is a minor fix to prevent underflow when resending last
frame in "timer recovery state".
2010-10-25 20:33:39 +00:00
Andreas.Eversberg a5445fe8a3 [layer23] Reverted commit ece1463...
The timer recovery state is cleared already,if  a supervisory frame
response is received with "F bit set to 1".
2010-10-24 22:31:06 +00:00
Andreas.Eversberg a8ac4bb2df Introducing "gsmmap" to convert SYSTEM INFORMATION log into a KML map 2010-10-24 14:12:58 +00:00
Andreas.Eversberg 462015a91e [layer23] Adding application to scan/receive and log SYSTEM INFORMATIONS 2010-10-24 13:39:37 +00:00
Andreas.Eversberg 4d211a27b8 [layer23] Moving sysinfo.c and gps.c (.h) to liblayer23
This makes sense, since multiple applications use it.
2010-10-24 13:30:17 +00:00
Andreas.Eversberg fbbb3ac953 [layer23] Fixed conditions for complete set of SYSTEM INFORMATION 2010-10-24 12:55:31 +00:00
Andreas.Eversberg 5e819e682f [layer23] Old SYSTEM INFORMATION 5 and 6 must be removed when entering DM 2010-10-24 12:34:53 +00:00
Andreas.Eversberg 1ac1852ffc [layer23] Moving decoding of SYSTEM INFORMATION to sysinfo.c
This way the decoding can be re-used by other applications.
2010-10-24 12:30:37 +00:00
Andreas.Eversberg c0500693a6 [layer23] Added debugging for GPS at logging.c 2010-10-24 12:23:05 +00:00
Andreas.Eversberg e7f6f749c4 [layer23] Fix of GPS states 2010-10-24 12:20:08 +00:00
Sylvain Munaut ece1463f6f layer23/lapdm: Properly handle S frame with F=1 when in timer recovery
This is the signal to exit recovery mode !
See GSM 04.06 Section 5.5.7

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-24 12:14:47 +00:00
Andreas.Eversberg a481e65bf0 Removed solved issues from gsm48-andreas/issues.txt
The remaining issues have only todo with openBSC and should be fixed,
the issues.txt will be obsolete then.
2010-10-24 11:20:51 +00:00
Andreas.Eversberg 18c621e9f7 [layer23] Don't request a channel, if SYSINFO 3 is not available
SI3 is required in order to request a channel the correct way. If not
yet received, the process crashes due to an arithmetic exception.
2010-10-20 18:16:12 +00:00
Andreas.Eversberg 8be9f76bc4 [layer23] Fix of channel request cause "OTHER or SDCCH" 2010-10-20 18:12:44 +00:00
Andreas.Eversberg f181a04121 [layer23] Completed GPS reading process
This includes "double" values of logitude and latitude, as well as time
stamp, and if the values are valid or not (GPS fix).
2010-10-20 18:09:31 +00:00
Andreas.Eversberg 50be02f78e [layer23] Fixed header handling of some radio ressource SAP msgs 2010-10-16 08:18:31 +00:00