Commit Graph

420 Commits

Author SHA1 Message Date
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 6d1f116338 misc: u_intX -> uintX in the host directory
Use C99 stdint.h for the inttypes.
2011-11-06 21:55:40 +01: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
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 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
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