Commit Graph

130 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
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
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
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 f72baf40d5 [layer23] Adding LAC and TMSI (both optional) to test card (rplmn) 2010-11-20 08:32:32 +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 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 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
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
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 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 e7f6f749c4 [layer23] Fix of GPS states 2010-10-24 12:20:08 +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 adf65e29fd [layer23] DTMF support 2010-10-15 18:54:57 +00:00
Andreas.Eversberg 1dd14c0b26 [layer23] Adding abbreviated dialing to VTY
It is possible to store phone numbers with abbreviations now. Dialing these
abbreviation makes testing of mobile originated calls much easier too.
2010-10-14 07:37:52 +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 f0c807a682 [layer23] Rework of "support"-features, features can be disabled now
Supported features of hardware (support.c) can be disabled by config.
This way the full featured mobile can be downgraded to indicate less
features to the network, like disabling speech support or crypto support.
2010-10-03 10:51:31 +00:00
Andreas.Eversberg 66ff1cb347 [layer23] Minimum RX-level is now a configuratio option
The default (if config not yet created/updated), is still taken from
settings.c.
2010-10-01 19:24:34 +00:00
Andreas.Eversberg f867cd2077 [layer23] Remove obsolete function from header file 2010-10-01 19:22:31 +00: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 e97b7c418c [layer23] Alter simulated-delay via VTY on the fly (active channel) 2010-09-27 18:53:03 +00:00
Andreas.Eversberg b0336cd484 [layer23] Speech codec selection and negotiation with network 2010-09-26 17:08:10 +00:00
Andreas.Eversberg 602dcf4d0d [layer23] Added support for changing TCH mode via L1CTL messages 2010-09-26 17:06:06 +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 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 3816242118 [layer23] Added BTSAP socket interface to layer23 2010-09-18 13:59:52 +00:00
Andreas.Eversberg 7b3e80f64b [layer23] Added XOR and COMP128 encryption to test SIM
To define/change a key for the test SIM, use the following sequence:

conf t
ms 1
test-sim
ki comp128 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
end
write

or use:
ki xor xx xx xx xx xx xx xx xx xx xx xx xx
2010-09-17 15:51:23 +00:00
Andreas.Eversberg b349e38838 [layer23] CM service is now accepted when ciphering has started
Sylvain pointed out that CM SERVICE ACCEPT message is not requred, if
ciphering has been completed. In this case, an RR_SYNC_IND is sent
to mobility management, and treated there as CM SERVICE ACCEPT.
2010-09-17 09:07:29 +00:00
Sylvain Munaut 02c4650af1 layer23: Move app logic in layer3.c with state struct.
It's far from perfect but at least it's not split in two file and
makes it easier to expand the logic.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-09-14 21:21:42 +02:00
Andreas.Eversberg fa686fd4c9 [layer23 / layer1] Added interface for changing crypto mode of DSP
The layer23 will now set crypto mode and key when CIPHERING MODE COMMAND is
received. After crypto mode has been set, CIPHERING MODE COMPLETE is sent.

NOTE: Layer1 implements only the interface, there is no functionality to it
yet.
2010-09-11 12:10:31 +00:00
Andreas.Eversberg 1198f35283 [layer23] SIM client accepts status code 61xx as a positive result 2010-08-30 11:43:16 +00:00
Andreas.Eversberg b0efeb81eb [layer23] "show cell 1 <arfcn>" gives better overview of cell allocation 2010-08-29 21:08:08 +00:00
Andreas.Eversberg 0d9a3b91c1 [layer23] Fixed security issue
Authentication must not be performed using SIM client, if different IMSI is
used, to protect identity of caller.
2010-08-29 11:05:07 +00:00
Andreas.Eversberg f20a1c3de8 [layer23] Layer 3 now uses SIM client to request and update SIM data
The SIM reader can be selected via VTY, but because it is not yet
implemented in layer1, nothing happens when selecting it.
2010-08-28 09:46:36 +00:00
Andreas.Eversberg 4931b324e5 [layer23] Adding SIM client
The SIM client is not the SIM reader. It is used to process higher layer
requests. One request may be: "read the IMSI file" or "unlock SIM card, here
is the key". It then selects the right file of SIM card and processes the
request by exchanging APDUs with the SIM reader.

NOTE: Because the reader inside layer 1 is not yet finished, the SIM client
will not work and cannot be tested yet.
2010-08-28 09:36:07 +00:00
Andreas.Eversberg c6a423392e [layer23] Radio ressource protocol completed except for handover, meas.
Assignment command is now complete as well as frequency redifinition.
The handover process is partly complete. Further functionality depends
on layer1 capabilites. The measurement report is also incomplete.
2010-08-21 15:10:30 +00:00
Andreas.Eversberg da65f02580 [layer23] Header file for last commit 2010-08-21 15:09:48 +00:00
Andreas.Eversberg 4337d3bb2e [layer23] Added (incomplete) ASSIGNMENT COMMAND handling
This commit features handling of ASSIGNMENT COMMAND. Currently only channel
descriptions "after time" are processed, which is mostly the case.
The ASSIGNMENT COMMAND is essential, because public networks assign an
SDCCH4/8 before actually assigning a TCH.
2010-08-14 17:10:26 +00:00
Andreas.Eversberg a5b023cd98 [layer23] Paging response depends on the supported channels: SDCCH, TCH/F, and TCH/H 2010-08-11 16:11:28 +00:00
Andreas.Eversberg cb73be0d0c Added support for NMEA GPS receiver
This early support does not use the received postion, it just dumps it.

Later it can be used to set clock of the phone. Also it can be used
to calculate the location of a BTS.
2010-08-10 19:56:59 +00:00
Andreas.Eversberg 6439e4f279 Added sequence number to L3 messages (see GSM 04.08 Clause 3.1.4.3)
This is required to detect duplicated messages during assignment or
handover. Each PDISC uses its own sequence number, but MM+CC+SS share the
same. The sequence number is only required in uplink direction.

Dieter: Please check, if your tester eats it now. Also try to trace if the
sequence number is set correctly.
2010-08-10 19:31:07 +00:00
Harald Welte 72523a02a6 [layer23] use gsm48_decode_freq_list() which has been moved into libosmocore 2010-08-04 12:53:52 +02:00