Commit Graph

387 Commits

Author SHA1 Message Date
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
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 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