Commit Graph

60 Commits

Author SHA1 Message Date
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
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
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 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
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
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 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
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
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 794c85387c [layer23] Fixed T3 value in RACH confirm message 2010-10-30 08:53:22 +00: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 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 c0500693a6 [layer23] Added debugging for GPS at logging.c 2010-10-24 12:23:05 +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 6a1ab2dab5 [layer23] Reconnect of layer 2 link must be performed in idle mode also 2010-10-12 11:19:06 +00:00
Andreas.Eversberg 2a5e0f3cb7 [layer23] Fixed resume of datalink (after assignment or handover)
In order to resume correctly, the first message (ASSIGNMENT COMPLETE or
HANDOVER COMPLETE) must be sent after the link is resumed. Therefore it
must be given with the resume command. Unacknowledged messages are
transmitted afterwards, if any.
2010-10-12 09:03:34 +00:00
Andreas.Eversberg 4e9656c819 [layer23] Adding some debugging output 2010-10-12 08:44:18 +00:00
Andreas.Eversberg 6d4915b91b [layer23] Implementation of signal loss criteria as defined in TS 05.08
There are two criterions for lossing a signal, idle mode and dedicated mode.
A counter counts down when a frame is dropped, and counts up when a valid
frame is received on  certain channel. The loss criterion is reached, if the
counter reaches 0. The values added to / removed from the counter and the
limits depend on the process.
2010-10-12 08:26:48 +00:00
Andreas.Eversberg 86f4d80b7f [layer23] Increase sync tollerance by increasing freq_err_thresh1
This is a quick workarround to make synchronizing to a cell more reliable.
Without it, just a few cells will sync. When network search is restarted, no
more sync happens.  By increasing the freq_err_thresh1 to 10000, many cells
sync, even after the first network search.
2010-10-05 15:42:29 +00:00
Holger Hans Peter Freyther 813c098ebd misc: Fix the name of the header file for the hexdump... 2010-10-03 03:22:55 +08:00
Holger Hans Peter Freyther 50d47aeb72 msic: Include osmocom/util.h for the hexdump definition 2010-10-03 02:39:29 +08:00
Holger Hans Peter Freyther 87ef8ec74e sim.c: Fix NULL pointer dereference found by clang. 2010-10-03 02:39:06 +08:00
Sylvain Munaut 9257fe53bf l1ctl: Add initial tch_mode value in DM_EST_REQ
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-28 08:04:18 +02:00
Andreas.Eversberg 942bfeab18 [layer23] Cleanup of various 'printf' debugging 2010-09-26 22:02:32 +00:00
Andreas.Eversberg ed342e1673 [layer23] Use correct IE for timing advance
This patch has no effect, only the definition for timing advance IE is
changed to RSL_IE_TIMING_ADVACE.
2010-09-26 20:14:58 +00:00
Sylvain Munaut 1e75e61001 layer23/lapdm: Fix typos SAMB -> SABM
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-26 20:05:22 +02:00
Andreas.Eversberg 602dcf4d0d [layer23] Added support for changing TCH mode via L1CTL messages 2010-09-26 17:06:06 +00:00
Andreas.Eversberg 88a578f6c9 [layer23] Minor fixes in lapdm.c
For single burst messages, the length is set from layer2 header.
2010-09-26 17:02:36 +00:00
Andreas.Eversberg 4ed601ae4e [layer23] Adding application generated measurement report
The cell provides SYSTEM INFORMATION 5* and 6. These are used to create a
list of neighbor cells to monitor. Because there is no neighbor cell
monitoring supported by layer1, the list has no valid results yet.

Currently the average RX level of received frames are used to generate a new
report every second. The report is transmitted to layer1 and used there
whenever a measurement report has to be transmitted.

The timing advance and the current transmit power (as requested by network),
is included with every report.
2010-09-26 10:35:46 +00:00
Andreas.Eversberg 4c11da7790 [layer23] LAPDm handles UNIT DATA requests correctly
Optionally RSL_IE_ACCESS_DELAY and RSL_IE_MS_POWER can be given with a
message. They will be used to fill the first two bytes of the SACCH uplink
frame. The format equals to the UNIT DATA indication.
2010-09-26 10:28:03 +00:00
Andreas.Eversberg fae41cac5c [layer23] Disabled flow control between LAPDm and layer1. 2010-09-19 20:48:04 +00:00
Andreas.Eversberg 36bb74596b [layer23] Added Hungary to network list 2010-09-19 13:50:44 +00:00
Andreas.Eversberg 940a139db3 [layer23] Fixed "empty UA bug" in LAPDm and cleanups
The tx queue was not flused in case the SABM timer fired, so there were old
frames (SABM) still in the queue after next establish request.

Because the problem was solved, debugging code ist removed.
2010-09-19 11:59:48 +00:00
Andreas.Eversberg 5e1cf12d67 [layer23] Fixed and completed SIM's PIN handling
Use VTY to handle PIN:

enable
sim pin 1 xxxx
sim change-pin 1 xxxx yyyy
sim disable-pin 1 xxxx
sim enable-pin 1 xxxx
sim unlock-pin 1 uuuuuuuu yyyy

1 = mobile station "1"
xxxx = current PIN
yyyy = new PIN
uuuuuuuu = unlock key (PuK)
2010-09-19 10:52:42 +00:00
Andreas.Eversberg 0856c8a6a5 [layer23] SIM client completion
The SIM client is now complete. Because it usefull for multiple
applications, i moved it to the layer23/src/common directory.

The SIM reader works together with mobile process. Fixes were made.
Thanx to all for testing, finding bugs, and making it work as it is
supposed to do.

The current version uses special L1CTL messages to send and receive APDUs.
This will change in the future, when BTSAP interface is completed.

Please note that this client will not work until the layer1 SIM reader
fixes and extensions are committed.
2010-09-18 19:15:15 +00:00
Andreas.Eversberg df05c6ca94 [layer23] Added BTSAP socket interface to layer23 2010-09-18 14:02:07 +00:00
Andreas.Eversberg 4b2db86031 [layer23] Added missing pointer reset during establishment of LAPDm connection
Dieter pointed out that the SABM message was resent incorrectly, because the
V(S) pointer was not reset to the location of the SAMB frame.
2010-09-16 08:39:43 +00:00
Andreas.Eversberg d33ffcc3f1 [layer23] Fix in LAPDm: reset send_buffer offset at resume
Without it, the offset of the last message in progess is used.
This caused undefined behaviour and crash.
This bug was found by Dieter.
2010-09-15 10:25:42 +00:00
Sylvain Munaut e746ca06ca layer23/l1ctl: Add the RX power to the DATA_IND debug print
Useful to know if bad data is due to ciphering/bad sync or to
no/marginal signal.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-14 21:21:42 +02:00
Sylvain Munaut 54ff7c5f60 layer23/l1ctl: Remove useless printf debug
There is a proper LOGP statement, no need for a printf

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-14 21:21:42 +02:00