Commit Graph

1032 Commits

Author SHA1 Message Date
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
Andreas.Eversberg 85253cf06d [layer23] Correctly release a call, if not yet acknowledged by the network 2010-08-01 10:42:11 +00:00
Sylvain Munaut ef0377b11c layer23: Fix Makefile.am noinst_HEADERS for vty.h
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-30 01:40:03 +02:00
Steve Markgraf 5e81ff0351 [layer23] request a layer1 reset on startup of layer2 applications
This omits the need for starting layer23 applications before
loading layer1 (which still works).

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-07-29 11:12:31 +02:00
Sylvain Munaut 0cbd5d0139 layer23: Unify the prefix of l1ctl TX functions
Some had tx_ph_XX, others l1ctl_tx_XXX and some l1ctl_tx_ph_XXX

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:52 +02:00
Sylvain Munaut c382fbf943 include: Rename l1a_l23_interface.h to l1ctl_proto.h
The interface between l1 and upper layer is called by several
name. IMHO l1ctl is shorted and sounds good so try to unify
using that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:29 +02:00
Sylvain Munaut 50f1eb1114 layer23: Use libosmocore rsl_chan_nr_str instead of local func
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:51:21 +02:00
Sylvain Munaut 9e9f99c0a0 layer23: Split [2/2] -> The header files
This split the headers and adapt the source.

We use osmocom/bb as a prefix because libosomore also
uses osmocom and generic names such as misc & common could
conflict in the future.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:49:27 +02:00
Sylvain Munaut de21ca4aaf layer23: Split [1/2] -> The source code
We split into :
 - common: Everything that can be shared
 - mobile: The real spec compliant mobile phones
 - misc:   Different test stuff

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-27 20:49:04 +02:00
Sylvain Munaut fb48f690d3 layer23: Pre-rework of the Makefile.am
liblayer23 contained a bunch of stuff that are not shared at all ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 10:19:34 +02:00
Sylvain Munaut 603b8f8680 layer23/include: Remove eXecutable permission bit from gsm322.h
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 10:19:34 +02:00
Sylvain Munaut 66c3ca0527 layer23: Switch to using gsmtap_util from libosmocom
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 10:19:34 +02:00
Sylvain Munaut da6bc3b577 layer23: Remove useless file telnet_interface.c
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 10:19:34 +02:00
Sylvain Munaut b4aac95581 layer23: Alloc some headroom in incoming l1ctl packets
The upper layer will modify the headers and add somestuff in front,
so it's needed to avoid corrupting memory.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 10:18:56 +02:00
Andreas.Eversberg 33c2a1c265 [layer23] Fixed interpretation of the power measurement result. 2010-07-22 16:14:40 +00:00
Andreas.Eversberg 82fbc17d4b [layer23] Re-structured the VTY commands for SIM insert/remove
Now the commands are "sim testcard <ms> [<mcc> <mnc>] " or "sim remove <ms>"
2010-07-22 16:11:28 +00:00
Andreas.Eversberg 1f1e867edc [layer23] Several minor changes and minor fixes 2010-07-20 10:43:12 +00:00
Andreas.Eversberg 7ea81070fa [layer23] Fixed "return to IDLE" after cell re-selection.
Also remove forbidden PLMN from list when choosing cell manually.
2010-07-19 09:37:57 +00:00
Andreas.Eversberg 0f184d1dfe [layer23] Option "no location-updating" to disabled location updating
The mobile will not transmit for location updating. All networks will be
marked as "roaming not allowed", so search process continues.
2010-07-17 12:43:53 +00:00
Andreas.Eversberg 161267ab8e [layer23] Fixed cell search process of automatic network selection
If there is no (more) "PLMN in list", a complete search is triggered, so
all available cells are searched. Then the list of available networks is
tried for location updating (if allowed) in a defined order. If the
list is done, the process searches for all available cells again.

Note: The process will cause location updating on all networks until all
networks have rejected the mobile or if one network allowed the location
updating. To prevent this, use manual network selection, and set 'rplmn' of
test-sim, so only location updating is tried on the RPLMN.
2010-07-17 11:44:11 +00:00
Andreas.Eversberg 07b0abd4b3 [layer23] After location updating, the last cell is selected without search 2010-07-17 09:37:58 +00:00
Andreas.Eversberg 35861fec31 [layer23] Fixed establishment of multiple MM connections 2010-07-16 18:42:13 +00:00
Andreas.Eversberg 6aa923f003 [layer23] Added simple network monitor. Use "monitor network 1" to enable. 2010-07-16 10:52:38 +00:00
Andreas.Eversberg a806bb015a [layer23] Changed the rxlev values in gsm322.c to GSM format 2010-07-15 17:11:36 +00:00
Andreas.Eversberg 0ebf1d0352 [layer23] Fixed call reference for incomming calls. (mobile terminated) 2010-07-15 12:22:24 +00:00
Andreas.Eversberg 2c35afe49b [layer23] Added channel mode modify 2010-07-15 12:21:42 +00:00
Andreas.Eversberg 138ef7dae1 [layer23] Stop T3240 after location updating reject. 2010-07-15 10:28:28 +00:00
Andreas.Eversberg 1025b2b5a0 [layer23] Send reset to layer 1 before starting power measurement. 2010-07-15 10:27:51 +00:00
Andreas.Eversberg 4282dd7776 [layer23] Fixed DISC message at LAPDm, added debugging for UA match. 2010-07-14 16:22:53 +00:00
Andreas.Eversberg 66df31a14e [layer23] Display when incomming call is connected. 2010-07-14 16:19:42 +00:00
Andreas.Eversberg 63308637fb [layer23] Fixes of call control: RELEASE and CONNECT ACK 2010-07-14 16:01:26 +00:00
Andreas.Eversberg d6acbbc093 [layer23] Fix: IMSI detach in "IMSI detach initiated" state. 2010-07-14 14:13:56 +00:00
Andreas.Eversberg 17095b0e2c [layer23] Fix: T3240 (wait network command) is stopped after RR release. 2010-07-14 11:17:09 +00:00
Andreas.Eversberg 0a18f742d4 [layer23] WAIT for IDLE and layer 1 reset before power off after IMSI detach 2010-07-14 10:21:35 +00:00
Andreas.Eversberg abdb8ca464 [layer23] Fixed RSL release request
The forward release (DISC request) still seems to be broken at lapdm.c.
2010-07-13 18:12:54 +00:00
Andreas.Eversberg 5383f16675 [layer23] Fixed call answer/reject at mnccms.c 2010-07-13 17:09:30 +00:00
Andreas.Eversberg bd2bcacf81 [layer23] Fixed maleformed PAG.RESP message 2010-07-13 17:09:00 +00:00
Andreas.Eversberg a1465b8f87 [layer23] Fixed MM crash bug 2010-07-13 17:08:29 +00:00
Andreas.Eversberg 3837d899e1 [layer23] Fixed BA list dump 2010-07-13 17:08:00 +00:00
Andreas.Eversberg c36cca355d [layer23] Removed the osmocom/file.h 2010-07-13 14:54:55 +00:00
Andreas.Eversberg 3e1574bc6a [layer23] Added control features to VTY
tx-power: fixed or automatic transmit power selection
(not currently supported by layer 1)

simulated-delay: Make BTS believe that we are closer or at greater distance
than we actually are. This is required to use cells that only allows a limited
range to the mobile. Also it prevents from being tracked by location services.

stick: Make mobile stick to a given ARFCN only. For testing purpose the
cell selection process can be limited to only one frequency. This speeds
up cell selection process.
2010-07-13 14:29:19 +00:00
Andreas.Eversberg 5bbc44e913 [layer23] Fixed ID.REQ for IMEI while no SIM is present. 2010-07-13 14:27:15 +00:00
Andreas.Eversberg 6ba18aeb03 [layer23] Rework of channel request process and control of TA and TX-power
The radio ressource layer uses RSL messages to perform RACH requests now.

TX power and timing advance is controlled before RACH request, after IMM.ASS,
and during dedicated mode. (Note that TX power control is not yet supported
by layer 1.)
2010-07-13 14:21:52 +00:00
Andreas.Eversberg 65df98d930 [layer23] Correcting an attribute name in sysinfo.h. 2010-07-13 14:14:54 +00:00
Andreas.Eversberg f7c137660a [layer23] Updating l1ctl.c to current L1<->L2 API. 2010-07-13 14:12:54 +00:00
Andreas.Eversberg 0681cd21dd [layer23] Fixed demultiplexing of UI frames. Now SI5* and 6 are parsed. 2010-06-28 18:32:50 +00:00
Andreas.Eversberg 44dfa811a1 [lapdm] Fixed layer 2 header for B4 frames. Now SI5/6 are received correctly 2010-06-28 15:15:51 +00:00
Andreas.Eversberg f2b1e55c1e [layer23] Updated layer23 to current L1 support and forthcomming hopping. 2010-06-28 13:33:14 +00:00
Andreas.Eversberg f728fee2a9 [layer23] Minor fix for MCC+MNC print format. 2010-06-27 10:08:44 +00:00
Andreas.Eversberg bf2e70cf6b [layer23] Added option argument to alter default VTY port number. 2010-06-26 22:27:38 +00:00
Andreas.Eversberg 77c53d1e66 [layer23] Committed missing vty.h of last commit. 2010-06-26 16:38:07 +00:00
Andreas.Eversberg d6b1a9b10e [layer23] Removed cloned VTY and replaced it by libosmovty. 2010-06-26 14:00:29 +00:00
Andreas.Eversberg 8c3b88d62f [layer23] Fixed output format of MCC+MNC in subscriber.c 2010-06-26 13:56:01 +00:00
Andreas.Eversberg 7b84cf805b [lapdm] Added flow control between L1 and L2, so DM mode does not crash.
In dedicated mode a frame is sent to layer 1. Subsequent frames are queued
inside lapdm.c until a confirm from layer 1 is received. Since not all
pending frames are sent rapidly at once, the layer 1 does not crash anymore.

Also included in this commit: handling of reset confirm (maybe required
in the future after dedicated mode)
2010-06-26 11:12:25 +00:00
Andreas.Eversberg 4e03d6f822 [layer23] Fixed DM est./release for current supported channel types.
Now layer23 supports selecting TS 0-4 with SDCCH/8 channels.
But some tests showed me that it doesn't work. Please help debugging.

Added DM release function to l1ctl.c and gsm48_rr.c.
2010-06-26 09:35:27 +00:00
Harald Welte a10344b39e [layer23] remove raw printf about RACH CONF 2010-06-25 16:37:29 +02:00
Harald Welte 9c6906b7a9 move to TCP port 4247 to not conflict with openbsc on same host 2010-06-25 16:35:50 +02:00
Harald Welte 44239b448b [layer23] make sure we recognize our own IMM ASS
When trying to re-create the header file I made the 'valid' member
of the channel request history a single-bit field, but we actually
assign values different than 0 and 1 to it.  This has caused layer23
to consider the IMM ASS to our own channel requests as non-matching.
2010-06-25 16:34:17 +02:00
Harald Welte d58af304ee [layer23] reverse-engineer missing header file changes
It seems one of the recent commits introduced build errors due
to missing commits for header file changes.  Based on the code,
I reconstructed what I believe might have been the header files...
2010-06-25 03:13:52 +02:00
Harald Welte bc860c43c2 [layer23] use the TSC that is passed from L1 when going in dedicated mode 2010-06-24 18:57:28 +02:00
Sylvain Munaut 16cd41e809 l1a_l23_interface: Update DM EST REQ format
We include all the parameters we're gonna need to support
TS!=0, hopping, TSC, ...

We also assume the upper layer have decoded the low level
bit fields and gives us neat accessible variables and a
sorted ARFCN array for the Mobile Allocation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-24 18:57:28 +02:00
Andreas.Eversberg d9ac6a51ad layer23: Now receiver of IMM.ASS checks for timeslot when matching request.
This implies that random access confirm now works and is used.
2010-06-24 18:42:33 +00:00
Andreas.Eversberg 4b9ef28ca9 layer23: Corrected PLMN format when selecting RPLMN via VTY. 2010-06-24 18:41:39 +00:00
Sylvain Munaut 880df617a5 host/layer23: Update test application to support combined/non-combined CCCH
We start by listening to BCCH only then once we have a SI3, we inspect
it and enable to good CCCH mode.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:37:09 +02:00
Sylvain Munaut 38c6b4b35a fw/layer1: Add support CCCH combined/non-combined
We introduce the concept of CCCH mode. It can be either
 - NONE: receive BCCCH only
 - COMBINED: CCCH on a BCCH/CCCH+SDDCH/4
 - NON_COMBINED: CCCH on a BCCH/CCCH

There is also a new command to change the mode without having
to do the resync.

Currently, we keep the previous default behavior of requesting
a combined CCCH by default

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:37:09 +02:00
Sylvain Munaut a3e0c559a4 layer23/gsm322: Make a wrapper for fbsb_req to avoid repeating params
The params are virtually always the same, so use a wrapper to
change them easily

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:36:18 +02:00
Sylvain Munaut 1f7c5c1b3e layer23: Add info about SNCB GSM-R network
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-22 06:36:18 +02:00
Harald Welte 45f7b8bddf [layer23] Add debug print of _CONF messages 2010-06-20 19:42:49 +02:00
Harald Welte 281ea80498 [L1CTL] rename primitives to comply with official naming s/_REQ/_CONF/
When L23 issues a REQ, we should respond with CONF, rather than _RESP
2010-06-20 19:10:21 +02:00
Harald Welte cdc91973ee [L1CTL] rename L1CTL_RESET to L1CTL_RESET_IND
and define a new structure that indicates the type of reset
2010-06-20 18:44:27 +02:00
Andreas.Eversberg 562ff2dd89 layer23: Added CLIP and CLIR feature. 2010-06-20 18:18:45 +00:00
Andreas.Eversberg 17e0a2c075 layer23: Added support for waiting calls, hold/retrieve calls. 2010-06-20 17:43:55 +00:00
Andreas.Eversberg 05d6b5d213 layer23 radio ressource: Added signal loss condition in release state. 2010-06-20 16:23:30 +00:00
Andreas.Eversberg 7bde7938ae layer23: Fixed name of "DB Systel GSM-R" for MNC 10 in Germany. 2010-06-20 12:25:53 +00:00
Andreas.Eversberg f84a8c4b7e layer23: Complete rework of MCC and MNC structure.
Instead of handling numerical MCC and MNC, they are now stored and handled
hexadecimal, like they are received by the network. This makes it possible
to correctly handle 2 and 3 digits MNC. Internally 2 digit MNCs are stored
as 0xXXf, and 3 digits MNC are stored as 0xXXX, where X is the digit 0..9.

The length of MNC in the IMSI (2 or 3 digits) depend on the MNC length
trying to match. Anyway that MNC name can be printed even without knowing the
actual length. This is done by matching the IMSI against list of networks.

PLEASE REMOVE "/etc/osmocom/*.ba", because the MCC and MNC stored there is
not valid anymore.
2010-06-20 11:19:06 +00:00
Jan Luebbe b76f3d0686 l1ctl.c: add missing ntohs for band_arfcn
This fixes mangled ARFCN numbers in gsmtap.
2010-06-17 10:02:16 +02:00
Andreas.Eversberg 04acfa2e4b layer23: Corrected MCC in network table. -1 is used to indicate the counter rather than network name. 2010-06-16 22:06:46 +00:00
Andreas.Eversberg 73b57dcd3c layer23: Complete list of GSM operators and countries.
Just check out "On-waves", "GSM-R", or "OpenBSC".
2010-06-16 21:43:00 +00:00
Andreas.Eversberg 4c5eb30929 layer23 manual network search: Fixed searching behavior.
First of all I cleaned up the VTY commands. Instead of something like
"barred-access (yes|no)", I use now "barred-access" and "no barred-access".
Your stored configuration file will not load, because config format has
changed. Just remove the lines that cannot be parsed by VTY from your
config. Then the default values are used on next startup. Modify these as
desired via VTY using the new commands.

Use "rplmn <mcc> <mnc>" or "no rplmn" to set the initial behaviour of
network search. If RPLMN is set, this network is selected. If it is not
found, it will be displayed, then it is time to do a search
"network search 1".

If you have set "no rplmn" the search is started automatically on power on.
After the search you can see available networks and show the cells using
"show cell 1" or the detailed information "show cell 1 <arfcn>".

For testing all that be sure to set the "sim" to "test" and the
"network-search" to "manual". Do "show run" to see all commands to be set.
2010-06-16 18:21:59 +00:00
Andreas.Eversberg 9f77ea40b1 This commit belongs to the last one. 2010-06-16 17:19:40 +00:00
Andreas.Eversberg f195635d31 layer23: Added VTY command to display current states.
Also rejecting ASSIGNMENT COMMAND.
2010-06-16 17:17:29 +00:00
Andreas.Eversberg 4fff9fbd8e layer23 VTY: "end" now ends configuration in all config subnodes. 2010-06-16 17:13:52 +00:00
Andreas.Eversberg 7f79cb8e03 layer23: Added some more detailed debugging parameters. 2010-06-15 20:16:52 +00:00
Andreas.Eversberg 73cef8017e layer23: Fixed release problems of call control.
Now hangup command from mobile station results in a clean release of
CC and MM.
2010-06-15 20:15:03 +00:00
Andreas.Eversberg 55e3d970d9 layer23 call control: Fixed sending of RELEASE COMPLETE.
This had caused a crash due to double free of transaction instance.
2010-06-14 19:45:30 +00:00
Andreas.Eversberg f6299e657c layer23 cell selection: Fix in cell selection after leaving dedicated mode.
Only the known BA (band allocation) is used to check for the cell to camp
on. If there is no BA or if nothing is found, the process triggers normal
cell selection.

After location update (for example), the mobile switches to the strongest
cell in the current band allocation.
2010-06-14 19:38:06 +00:00
Andreas.Eversberg 9a2484b782 layer23: Added more logging to transaction.c 2010-06-13 22:35:45 +00:00
Andreas.Eversberg a9eb601cc8 layer23: Added more logging to call control. 2010-06-13 22:34:36 +00:00
Andreas.Eversberg 1e0eba000f lapdm: Minor fix. 2010-06-13 18:44:50 +00:00
Andreas.Eversberg a6ee911418 layer23: IMSI detach works now.
Pressing CTRL+c causes the detach process to run, then the mobile exits.
This procedure only runs after attachment (location update) and if detach
is required.

The SABM with the detach message is confirmed by a DISC message. the BS11
says that this is caused by sequence error or N200+1 error. Maybe someone
can trace that.
2010-06-13 18:41:07 +00:00
Andreas.Eversberg f479eff3d5 layer23: Added VTY messages to call application.
VTY now shows the process of call establishment, incomming call, and release.
2010-06-13 17:18:15 +00:00
Andreas.Eversberg 22f4e35243 layer23: Added feature to do emergency calls without a SIM card.
While testing, you may find out that making an emergency call is rejected
with cause 5 (illegal ME), because emergency facilities in some countries
like to reject calls without knowing the subscriber.

An emergency IMSI can be defined via VTY, so it is possible to make calls
with that IMSI, even without the SIM, because authentication is not
applicable during emergency call establishment.

All the information above, I received from the freely available 3GPP TS 04.08.
See NOTE at sub clause 4.5.1.5.
2010-06-13 14:41:55 +00:00
Andreas.Eversberg c6e756aab6 layer23: Fixed issues about location update and it's result.
Now location update reject works. The rejected network/cell is stored in
an appropriate list. The lists can be dumped from the VTY.

A fake authentication response is generated until the SIM interface is
available. If the network rejects the test SIM, due to authentication
failure, it is removed and limited service state is entered. This currenlty
works on networks with SDCCH on the TS0 only.
2010-06-13 13:51:30 +00:00
Andreas.Eversberg ec0baea9cf lapdm: Fixed length check for SABM frame. 2010-06-13 13:50:27 +00:00
Andreas.Eversberg 786054d117 cell selection: Added temporary hack to sync multiple times until the sync
failure is accepted.
2010-06-13 12:09:30 +00:00
Andreas.Eversberg fb48144c2b MNCCms: Added missing return value. 2010-06-13 12:08:35 +00:00
Andreas.Eversberg eb16b40ad0 radio ressource: After loosing signal, the process must return to IDLE state and trigger cell re-selection. 2010-06-13 12:07:31 +00:00
Andreas.Eversberg f2dc51dd44 mobility management: Fixes.
In case of registration not possible / requried, the appropriate result
message (REG_FAILED / REG_SUCCESS) must be returned to PLMN process.

Location updating message fix.
2010-06-13 12:03:17 +00:00
Andreas.Eversberg e0bf06d1fd lapdm: Fixed double free issues. (segfaults) 2010-06-13 12:01:37 +00:00
Andreas.Eversberg bba7716fee Added more release cases between RR and MM layer. 2010-06-12 18:44:21 +00:00
Andreas.Eversberg 426c76cee7 Fixed ARFCN output on sysinfo dumping. 2010-06-12 17:45:47 +00:00
Andreas.Eversberg 247ec7acf3 Radio ressources now has functions for release of radio link.
The "BA range" is used for cell re-selection.

Due to layer 1 issues, the process gets stuck very often or looses
synchronization.

After location update, I can now make a call via VTY on SDCCH:
Call control sends SETUP request after requesting an MM connection.
My phone on the network side rang!! Call control fails and requires
further debugging...
2010-06-12 16:16:54 +00:00
Andreas.Eversberg 78f6fb7713 Fixed CM SERVICE REQUEST message. 2010-06-12 16:14:28 +00:00
Andreas.Eversberg cbce277e90 Added missing proto_descr content filling in call control. 2010-06-12 16:13:01 +00:00
Andreas.Eversberg 3c0a6b5b63 Added ARFCN to system information dump. 2010-06-12 16:11:35 +00:00
Andreas.Eversberg 6eaa91786e Updated description of buffers and queues in lapdm.c, changed queue name. 2010-06-12 16:07:49 +00:00
Andreas.Eversberg d8cc251cf1 Fixes and improvements of RR, MM, CC processes. 2010-06-06 18:19:46 +00:00
Andreas.Eversberg ff555175d1 Added call application to mnccms.c and added commands to dial/answer/hangup to VTY. 2010-06-06 18:17:15 +00:00
Andreas.Eversberg 95f7d2c99c Added new logging category for summary of process. 2010-06-06 18:16:01 +00:00
Andreas.Eversberg 341b3cee2c Fixed descriptions of VTY interface commands. 2010-06-06 10:37:55 +00:00
Andreas.Eversberg 72a63e90ff Completed layer 2 process. (LAPDm)
Not actually complete but most of it. Location update works now!
2010-06-05 19:47:25 +00:00
Andreas.Eversberg 4f03a851f0 Fixed of bugs while testing layer 2. 2010-06-05 19:46:10 +00:00
Harald Welte f916fe0031 [mobile] Enable GSM-R / E-GSM900 and DCS1800 bands 2010-05-29 13:06:32 +02:00
Harald Welte fd2a426395 l1ctl: Drop frames where L1 indicates they have bit errors 2010-05-29 13:06:10 +02:00
Andreas.Eversberg 5d10a35819 Fixes on cell selection process. 2010-05-24 23:15:15 +00:00
Andreas.Eversberg 1294f37687 Fixes during testing of location update with.
The location update is now performed after the channel is assigned.
In dedicated mode the network receives the LOCATION UPDATING REQUEST.
The reply (IDENTITY REQUEST and LOCATION UPDATING REJECT) is received.
But subsequent message like the IDENTITY RESPONSE is not transmitted
by lapdm.c.
2010-05-24 14:46:11 +00:00
Andreas.Eversberg ab438fee54 Fixed header offset in lapdm.c. 2010-05-24 14:45:00 +00:00
Andreas.Eversberg 27bcbec8c9 Fixed output format of osmocom.cfg. 2010-05-24 14:43:49 +00:00
root 6404e12a90 Moved some spreaded settings of layer23 into settings.h.
The IMEI can now be set or generated randomly.
2010-05-24 18:15:21 +02:00
root 0f1ef214b6 Fixes on cell selection.
I hope that it fixes the crash issues. If a sysinfo was received when no cell is
selected, it was written to a NULL-pointer.

Also after selecting a cell (dedicated mode), it was not good to "continue"
an already stopped search process, if the sync fails.
2010-05-24 05:38:24 +02:00
Andreas.Eversberg ba59a8cb51 Added more commands to VTY, especially selecting test SIM and configure it.
The test card can now be configured, as if it is already registered to a
network. So it will directly select the strongest cell of last scan.
2010-05-23 20:53:32 +00:00
root bfc0285c7c Fixes of layer23 processes during tests of MNCC interface.
-> Emergency calls will now trigger channel request.
-> Normal calls will be rejected due to limited/no service.
2010-05-24 02:21:24 +02:00
Andreas.Eversberg 9359a91504 Moved layer 1 <-> layer 2 interface from main.c to a seperate file of
liblayer23. Other applications using liblayer23 don't need to re-implement it.

Messages from layer 1 are not freed in layer2_read() anymore. They will be
freed by the upper layers. The layers may also decide to queue or to forward
the messages. In general: A message is always discarded by the message handler
and not after calling the message handler.
2010-05-22 10:46:20 +00:00
Andreas.Eversberg 6ca03ff7e6 Fixing cell selection, so it works with the current layer 1 API. 2010-05-22 09:27:33 +00:00
Andreas.Eversberg 0d53134db5 Fixed list of maximum frequencies to scan for a range. 2010-05-22 08:37:42 +00:00
Andreas.Eversberg c970d4f791 Network selection results can now be shown explicitly by "network show" VTY command. When selecting the network, the selection is checked, if in list. 2010-05-21 15:54:42 +00:00
Andreas.Eversberg 0d1f453943 Summary list of scanned cells now contains LAC and cell ID, rather than (uninteresting) access classes. 2010-05-21 15:52:11 +00:00
Harald Welte 89c6b9510e correct endian conversion of arfcn in tx_ph_dm_ext_req() 2010-05-20 23:48:19 +02:00
Harald Welte cb71b972bd Make new L1CTL_FBSB_REQ work reliably
* port 'mobile' application to new l1ctl_tx_fbsb_req()
* make sure we have a proper downlinke header in front of l1ctl_fbsb_resp
* remove duplicate band_arfcn member of struct l1ctl_fbsb_resp
* reset the AFC to its default value when starting new FBSB task
* remove bogus l1s.sb.{synced.count} variables
* allocate msg and send l1ctl_fbsb_resp() only from process context, not FIQ
* properly report SNR and BSIC in fbsb_resp
* introduce arbitrary SNR thresholds for FB0->FB1 and FB1->SB switching
2010-05-20 23:26:42 +02:00
Harald Welte 8978ec571e layer1/l1ctl: Split L1CTL_NEW_CCCH_REQ in FBSB_REQ nad SYNC_REQ
We really want to have those two as distinct operations - and we
want proper state machines in L1 to quickly return if they've
managed to acquire a FB or SB or not.  Otherwise scanning will
take ages...

This code now introduces a new l1ctl_fbsb_req that is sent via
L1CTL to ask for a bitmask of FB0/FB1/SB operations.  The actual
FB0/FB1 detection now no longer runs for 500 TDMA interrupts
but completes as soon as we either know there is no FCCH,
or that our frequency error is smaller than a caller-specified
threshold.

FB0/FB1 are already working, SB is not yet, sorry.
2010-05-19 21:41:24 +02:00
Andreas.Eversberg 21cc7eecc5 Work on VTY interface:
- Load and save of config now works.
- Network search is displayed on VTY and the result can be selected there.
- Manual/auto mode can be selected via VTY and saved.
2010-05-13 12:51:22 +00:00
Andreas Eversberg 9e7a9bc7fa Bugfix in IMEI type selection. 2010-05-11 11:38:07 +02:00
Andreas.Eversberg 5128052dd1 Fixed broken sysinfo.c 2010-05-10 22:11:48 +00:00
Andreas.Eversberg bb08bbd1d7 Minor fixes and improvements to L3 and VTY. 2010-05-10 22:06:37 +00:00
Steve Markgraf ebe72af12b add MNC of DB Systel to network list
Signed-off-by: Steve Markgraf <steve@steve-m.de>
2010-05-10 14:06:32 +02:00
Andreas.Eversberg b763a07c47 Added "show ba 1" to view BA lists via VTY interface. 2010-05-09 17:31:49 +00:00
Andreas.Eversberg 3928d757f0 Added vty interface (taken from OpenBSC project).
It is now possible to show informations about:
- mobile
- subscriber
- received cell informations

Later it can be used to do configurations (phone's menu)
and trigger events, like dialing a phone number.
2010-05-09 16:01:49 +00:00
Andreas.Eversberg acd570fff8 Added SI3 rest octets to RR layer. Now a cell can be qualified:
- Low prio
- High prio
- Barred
2010-05-09 09:40:41 +00:00
Andreas.Eversberg f76e2064a4 Added BCCH timeout timer for detecting loss of radio link (layer23). 2010-05-08 14:31:27 +00:00
Andreas.Eversberg 729abf56ea Minor condition fix in radio resource. 2010-05-07 23:07:30 +00:00
Andreas.Eversberg 2b5c2337ed Fixes for layer 3 processes:
- CCCH connection state variable
- The complete BAND is now searched prio selecting PLMN
2010-05-07 21:41:54 +00:00
Andreas.Eversberg 2b7d2ed446 - Fixes on MM, RR, cell selection, plmn search processes.
-> Cell selection now requires only one frequency to be scanned, if BA list
   of that PLMN is known.
2010-05-06 08:48:24 +00:00
Andreas.Eversberg 7c5b9ea288 Work on layer 3 processes:
- Fixes on PLMN search and cell selection process.
- Fixes on radio ressource.
- ^C will cause IMSI detach when pressed the first time.
  Pressing ^C again will cause termination of process at any time.
2010-05-05 08:40:10 +00:00
Andreas.Eversberg 7f009e41f9 Work on layer 3 processes:
- Fixed reference to system informations. (did crash when re-selecting).
- Fix in cell selection state machine. (any re-selection).
- MCC, MNC, LAC change of cell now triggers re-selection.
- Fixed some paging issues. Empty pagings are not displayed anymore. Also paging is now possible when 'camping on any cell'.
2010-05-04 09:48:51 +00:00
Andreas.Eversberg fe1dc19c6e More fixes on layer3.
The current code will scan frequencies, select a cell and camps on it.
No SIM is inserted. Paging requests and Immediate assginments can be seen.

When inserting a SIM card (uncomment it in app_mobile.c), location update
is triggered after selecting a cell. The RACH request is sent, an
Immediate assignment is received, the dedicated mode is requested.
Nothing happens then, because no confirm / abort of layer 2 is received.
2010-05-02 17:40:52 +00:00
Andreas.Eversberg 14974d3dba Many fixes in layer 3:
- Sysinfo storage
- Cell/Network selection process
- Channel request / Paging
2010-05-02 17:13:47 +00:00
Andreas.Eversberg 8e5f33b4d3 Fixed many issues in MM IDLE mode process. 2010-05-01 18:21:03 +00:00
Andreas.Eversberg 30b48d6212 Fixes, especially frequency list parsing. 2010-04-30 18:51:41 +00:00
Andreas Eversberg 516917e836 Fixes and improvements of layer23. 2010-04-29 20:46:11 +02:00
Andreas Eversberg 9ef7ac8b11 Added some debugging. / Minor condition fix. 2010-04-26 11:21:18 +02:00
Andreas Eversberg f1278ad9da Added new application "mobile" to layer23.
This is the current status of the layer 3 protocols. Everything compiles,
radio ressource layer is partly complete. Everything is untested, so don't
expect that it runs and does something usefull. The next step for me is
running and debugging it.

Here is the list of files that are added / modified:

	new file:   ../include/osmocom/gsm322.h
	new file:   ../include/osmocom/gsm48_cc.h
	new file:   ../include/osmocom/gsm48_mm.h
	new file:   ../include/osmocom/gsm48_rr.h
	modified:   ../include/osmocom/l23_app.h
	modified:   ../include/osmocom/logging.h
	new file:   ../include/osmocom/mncc.h
	modified:   ../include/osmocom/osmocom_data.h
	new file:   ../include/osmocom/subscriber.h
	new file:   ../include/osmocom/support.h
	new file:   ../include/osmocom/sysinfo.h
	new file:   ../include/osmocom/transaction.h
	modified:   Makefile.am
	new file:   app_mobile.c
	new file:   gsm322.c
	new file:   gsm48_cc.c
	new file:   gsm48_mm.c
	new file:   gsm48_rr.c
	modified:   main.c
	new file:   mnccms.c
	new file:   subscriber.c
	new file:   support.c
	new file:   sysinfo.c
	new file:   transaction.c
2010-04-25 18:28:24 +02:00
Andreas Eversberg 0d93f1c917 Changes to layer23:
Added name to osmocom_ms structure.

l2_ctx is now named l23_ctx, because it is also used there.

A work-handler is usefull for applications that need to check queues.
2010-04-25 18:10:59 +02:00
Andreas Eversberg e91d8a934c l1ctl_tx_ccch_req() now uses arfcn as parameter.
The arfcn variable is renamed to test_arfcn.

I think that arfcn and other frequency parameters should be stored at
the process which sets it and using it when calling l1ctl_tx_ccch_req().
2010-04-25 17:31:35 +02:00
Andreas Eversberg 96e479645f Wrapper for file access.
If file access is used to store network informations and user settings in the
/etc/ directory. Later it can be used to store them in the EEPROM of the
target.
2010-04-25 17:11:47 +02:00
Harald Welte cba99230be layer23: fix building against user-defined LIBOSMOCORE 2010-04-09 08:09:46 +02:00
Harald Welte 58cede7c8a layer23: first version of a 'scan all BCCHs' application
bcch_scan first iterates over all GSM900/EGSM900/GSM1800 channels and
performs a power measurement.  Based on this, it tries to look for
BCCH data on those ARFCNs.  Currently, they are simply written to
the pcap file and not analyzed/processed in layer23 yet.
2010-04-05 22:39:13 +08:00
Harald Welte 13a0a05887 layer23: signal the L1CTL DONE flag at the end of a power measurement 2010-04-05 22:21:36 +08:00
Harald Welte 1fa7930eea layer23: Introduce signals to indicate PM RES and L1 RESET to app 2010-04-05 21:30:00 +08:00
Harald Welte db60b706cc layer23: split into liblayer23 and 'apps'
similar to the concept of having 'apps' in the firmware build process,
I'm now building the common code as liblayer23 and we have three apps
that use this library:
 layer23 - the old layer23 program
 bcch_scan - a passive bcch scanner under development
 echo_test - a test program sending large msgb's containing zero bytes
2010-04-05 21:30:00 +08:00
Harald Welte 1e4d22cb5f Implement L23-triggered L1 power measurement scan
Now layer23 can ask L1 to scan an entire range of ARFCN's and do power
measurements.  This is the first step in the cell (re)selection process.
2010-03-27 18:42:43 +08:00
Harald Welte 937e5f64ab layer23: cosmetic fixes in log output 2010-03-27 12:51:45 +08:00
Harald Welte a98c0e9c44 layer23: convert main.c to use libosmocore/logging.c 2010-03-27 12:51:30 +08:00
Harald Welte 3393285e91 introduce (unused) code to regularly transmit L1CTL ECHO REQ to phone
this helped in debugging the strange NUL byte related data corruption
2010-03-27 12:34:29 +08:00
Harald Welte ace2b08244 add L1CTL ECHO REQUEST code 2010-03-27 12:32:32 +08:00
Harald Welte e8a7bbffd2 layer23: convert to libosmocore logging API 2010-03-27 08:56:05 +08:00
Harald Welte 0841075df2 layer23: remove debug.c and thus last remnants of libosmocom 2010-03-27 00:07:46 +08:00
Harald Welte c1cee898df misc compiler warning fixes
* added missing param in call to gsm48_rx_bcch
* added 'extern' to declarations of rsl_rlm_cause_strs and target_board
* added several 'const' for strings
* removed useless 'bufptr,' from hexdump
(From: itsme <itsme@xs4all.nl>)
2010-03-22 08:26:04 +08:00
Harald Welte bee63154c4 L1A/L23 interface (L1CTL) cleanup
* introduce a new 'l1ctl_hdr' structure common to all messages
  on this interface
* use struct l1ctl_hdr in both the firmware and layer23
* add a new L1CTL_PM_REQ request for performing layer23-initiated
  power measurements (firmware does not implement them yet)
2010-03-21 12:57:28 +08:00
Harald Welte 07446ab098 layer23: fill in signal level and dBm fields of gsmtap 2010-03-09 23:05:58 +01:00
Holger Hans Peter Freyther 5da778184d layer23: Use the write_queue instead of directly writing data to the socket 2010-03-08 12:23:09 +01:00
Holger Hans Peter Freyther 1461eb0e54 layer23: Remove inacucrate comment as this was addresses in osmocom 2010-03-08 12:23:09 +01:00
Harald Welte 97c8b6f33b start to use libosmocore within the firmware
* remove linuxlist.h copy and use osmocore
 * don't put 'struct gsm_time' into l1ctl packets
 * include rx_level and snr for each burst in l1ctl
 * properly build libosmocore.a for target
 * move gsmtime functions into libosmocore
 * move ctype.h to standard location
2010-03-07 20:56:12 +01:00
Harald Welte 6d1b6f7f10 layer23: correct byte ordering of IP address 2010-03-05 11:14:33 +01:00
Harald Welte 582aec803c layer23: GSMTAP update (gsmtap for uplink, DCCH and ACCH)
* use GSMTAP for uplink frames (generated by layer23; sent to L1)
* only use GSMTAP if the user specifies the '-i dstip' arguments
* properly encode the GSMTAP channel type
* requires GSMTAP protocol version 0x02 (see next commit for wireshark patch)
2010-03-04 15:43:45 +01:00
Harald Welte 5a1d72cfc6 layer23: rsl_dec_chan_nr is now in libosmocore 2010-03-04 15:07:10 +01:00
Harald Welte a5cdce1503 update to reflect libosmocore api change 2010-03-04 12:00:29 +01:00
Harald Welte b82aa8957c layer23: add some FIXMEs to remind us about missing code 2010-03-03 14:37:31 +01:00
Harald Welte 2ea6a02bf5 add some notes about layer23 architecture 2010-03-03 14:37:21 +01:00
Harald Welte d4e118a7a0 Rename 'layer2' program to 'layer23' program 2010-03-03 14:25:21 +01:00