Commit Graph

3541 Commits

Author SHA1 Message Date
Pablo Neira Ayuso ed5cacb240 src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.

The main changes are:

- The directory libabis/ has been removed as it now lives in
  libosmo-abis.

- new configuration file format for nanoBTS and HSL femto, we
  need to define the virtual e1_line and attach it to the OML
  link.

- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
  BS11 and rbs2000) now use the new libosmo-abis framework.

- use r232 input driver available in libosmo-abis for bs11_config.

- use ipa_msg_recv instead of old ipaccess_read_msg function.

- delete definition of gsm_e1_subslot and input_signal_data.
  These structures now lives in libosmo-abis.

Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.

This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:

- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node

This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-19 22:38:35 +02:00
Pablo Neira Ayuso 7abecfcfc9 src: use new msg->dst pointer instead of deprecated msg->trx
This patch modifies openBSC code to use msg->dst which stores the
pointer to the signalling link structure instead of the pointer to
the transceiver structure.

This patch prepares the introduction of libosmo-abis.
2011-08-19 22:38:33 +02:00
Harald Welte c45a8045a6 bssgp: make comments more explicit, include 'Rx' in received messages 2011-08-19 16:45:19 +02:00
Harald Welte 7fad70c198 Merge branch 'master' of git.osmocom.org:openbsc 2011-08-19 16:44:00 +02:00
Holger Hans Peter Freyther 013ae46ef6 bsc: Crash fix for the osmo-nitb/MNCC code
It is possible that MNCC sends a MNCC_LCHAN_MODIFY and
wants a channel mode that is not possible on the current
lchan, in that case a new channel is assigned. We now crash
as the osmo-nitb is not having an assignment complete handler,
add a NULL check.
2011-08-13 22:53:53 +02:00
Daniel Willmann fc462dd59e libbsc: Log if a channel is freed with lchan->state != LCHAN_S_NONE
I'm not sure if that is an abnormal condition or not, but it seems
that lchan state and type have to be none for the lchan to be
considered idle.
2011-08-11 17:21:24 +02:00
Daniel Willmann 6fc6a12c07 libbsc: Cosmetic fix for the channel activate NACK log message 2011-08-11 17:21:24 +02:00
Daniel Willmann 7ddc318687 libbsc: Release the RF channel if BTS thinks it's still in use
The Nokia metrosite BTS seem to keep the channels open indefinitely.
If osmo-nitb is restarted while one of the channel was still active
and tries to activate that channel again the bts would return a
CHANNEL ACTIVATE NACK with "Radio channel already activated". This
accumulated over the restarts so soon enough no more channels were
available.

This patch sends a release request to the bts so the channel
becomes available again.
2011-08-11 17:21:24 +02:00
Daniel Willmann 513da17732 libbsc: Call lchan_free in the timeout callbacks
This makes sure that the lchans can be used again. (state and type
are set to NONE)
2011-08-11 17:21:24 +02:00
Jan Luebbe 563d99d3c3 libbsc: Only skip lchans with state AND type set to NONE in show lchan
The function lchan_alloc only considers lchans to be available if both
the type and state are NONE. So change show lchan to list all lchans
 that are not considered available.
2011-08-11 17:21:24 +02:00
Peter Stuge 46f799b224 MNCC: Never send zero-length msgb packets to the socket
This will cause the remote end to read 0 bytes, which is interpreted as
if we cleanly closed the socket, making the remote end close their side
of the socket, which would lead to us closing our side of the socket,
so we should never send such a packet.
2011-08-11 17:21:24 +02:00
Harald Welte e8bd9e885d RSL: add timer for lchan activation/deactivation without BTS response
The timer callback will simply reset the lchan state to NONE in order
to prevent channels getting stuck in 'activation requested' or
'deactivation requested' states.
2011-08-11 17:21:23 +02:00
Harald Welte 5da9b52d06 DAHDI: Actually increment e1_input related rate counters 2011-08-11 13:00:12 +02:00
Harald Welte c21aa18e35 E1 Input: better names for rate counters 2011-08-11 13:00:07 +02:00
Harald Welte 0000ca5885 E1 Input: Add rate counters for events related to E1 lines 2011-08-11 12:59:57 +02:00
Harald Welte 986926ebde E1 Input: Move 'show e1_*' command to e1_input_vty.c 2011-08-11 12:59:54 +02:00
Harald Welte 4da5592c46 E1 Input: Add VTY command to specify the name of a Line
So far, there was no way to set the line->name field at all.
2011-08-11 12:59:50 +02:00
Daniel Willmann 28d9ccbca0 libbsc: Don't free secondary lchan if it is NULL. 2011-08-10 13:40:39 +02:00
Pablo Neira Ayuso f7dc7614c2 trau: fix wrong message size for GSM_TCHF_FRAME passed to MNCC
During the GSM deployment in the CCC Camp, Daniel Willmann
noticed that the LCR and the MNCC were closing the local
connection over unix sockets communication quite so often.

After some debugging, Peter Stuge noticed that openBSC was
closing the connection since write was returning 0.

Then, I suggested that it could be a malformed message with
zero length. By skipping empty messages, Peter confirmed that
the connection between the LCR and the MNCC was not closing
anymore. However, there was no voice in the calls that went
over MNCC.

After some more debugging I found that we were not building
GSM_TCHF_FRAME over MNCC appropriately in the TRAU multiplexer
code, since we forgot to msgb_put() the message.
2011-08-10 13:40:35 +02:00
Pablo Neira Ayuso 2962c20f73 NOKIA: Resend SABM on unknown TEI from LAPD 2011-08-10 10:51:02 +02:00
Pablo Neira Ayuso cd98656315 LAPD: Propagate lapd_receive() errors to the E1 driver
Scenario: BTS are configured and working, then the BSC stops working
for some reason (crash or administrative stop).

If the BSC comes back to life, LAPD among other things does not know
about the previous existing TEIs. Instead of ignoring these frames,
we notify the driver that we are seeing frames with unknown TEIs, so
it can try to recover, e.g. by resending the SABM message.
2011-08-10 10:51:02 +02:00
Harald Welte 1045697c34 Fix MNCC for the NOKIA BTS type
(thanks to Gus Bourg)
2011-08-10 10:51:02 +02:00
Harald Welte 44d26113bc NOKIA: use 'struct value_string' whenever possible 2011-08-10 10:51:02 +02:00
Harald Welte 3c3003f703 NOKIA: use 'value_string' for severity and bts_type 2011-08-10 10:51:02 +02:00
Harald Welte c8755af8a5 NOKIA: Move more static variables into 'struct gsm_bts' 2011-08-10 10:51:01 +02:00
Harald Welte 9d2f377927 NOKIA: move 'conf' and 'bts_type' into 'struct gsm_bts'
This is one step in the direction of supporting multiple Nokia BTS
2011-08-10 10:51:01 +02:00
Harald Welte cde579473b NOKIA: Some more whitespace changes 2011-08-10 10:51:01 +02:00
Harald Welte bda367c697 Nokia: Coding style
Running the entire bts_nokia_site.c through the 'Lindent' script
to match indent/coding style with remainder of project.

There are still lots of other cleanups pending, but this one is
a purely cosmetic one.
2011-08-10 10:51:01 +02:00
Dieter Spaar 1664602476 Initial version of Support for Nokia *Site BTS
This includes the MetroSite, but also other Nokia BTS models.
2011-08-10 10:51:01 +02:00
Harald Welte e5215b5398 04.08 / MNCC: elevate error messages to LOGL_ERROR
this way you can actually see them...
2011-08-09 22:06:08 +02:00
Harald Welte 6e4c26aa08 LAPD: Use proper log levels and prefix all messages with LAPD 2011-08-09 22:06:01 +02:00
Harald Welte 52a0b12fe1 LAPD: Remove all calls to 'assert' from the code
For a system-level daemon, no protocol parser error should ever call
assert, which would take down the entire process.
2011-08-09 22:05:51 +02:00
Harald Welte 0b69bc34d7 DAHDI: Fix case where we have multiple E1 ports/cards (spans)
DAHDI creates one device node for every E1 timeslot, starting from '1',
and keeps incrementing that number even for additional ports/cards.

Thus, we have to use the e1inp_line number multiplied by 31 as a base.
2011-08-09 22:05:42 +02:00
Harald Welte cdf76cff9f GPRS: Fix the parsing/interpretation of the PDP CTX status IE
The byte ordering is a bit odd:  The least significant byte is ahead of
the most significant byte, different from everything else in GSM that
seems to be big-endian.

Thanks to Seungju Kim <admin@manateeshome.com> for repoerting the bug.
2011-08-05 21:23:46 +02:00
Harald Welte 901d57db07 Merge branch 'master' of git.osmocom.org:openbsc 2011-07-29 11:44:28 +02:00
Dieter Spaar f31dd86059 TRAU: Properly initialize idle frames
This is particularly important in case of the Nokia BTS, as they seem
to drop the RF/signalling channel if they don't get proper TRAU
frames.
2011-07-27 23:52:36 +02:00
Dieter Spaar 402ccedcf4 BSC VTY: Accept MNC of 0-999, as 0 is a valid MNC 2011-07-27 23:43:56 +02:00
Dieter Spaar eabb6e3e4f RSL: Fix erroneous GSM48_IE_CHANDESC_2 in rsl_chan_activate_lchan()
This fixes a bug introduced more than one year ago in commit
e38bd6caa34005816a9336f021fd17d328d5c901:

The RSL_IE_CHAN_IDENT is a TLV, but the GSM48_IE_CHANDESC_2 contained in
it, is a mere TV type IE with fixed length.

The problem specifically has caused problems on Nokia MetroSite BTS,
which apparently read the TSC out of this Layer3 IE.
2011-07-27 23:40:33 +02:00
Dieter Spaar 1f447fbef1 LLC: Fix format string 2011-07-27 23:38:46 +02:00
Harald Welte 4b2ed35b8f GPRS: Fix buffer overflow in case of very long MS RA CAP IE
The MS Radio Access Capability IE can be _very_ long in some recent
high-end mobile phones, way beyond the old 14-byte limit.  We increase
our array to 52 bytes, and make sure not to overflow that buffer.
2011-07-27 23:35:38 +02:00
Holger Hans Peter Freyther 074b2b24e0 smsqueue: There was a race/bug with a booting phone, paging and LU
It was possible to set the LAC=0 on a subscriber that just has
done a LU because it did not respond to a paging request.

E.g. when a phone is rebooting, a SMS being delivered, the phone
is doing the LU, sub_ready_for_sm will try to send a SMS (but the
phone is not ready yet and it will timeout), then the paging code will
send us an expiration note and we might set the LAC=0 for this
subscriber.

Ideally we would be able to stop the paging request once the subscriber
is authenticated and then hand this to the SMS layer, right now the
best thing to do is to detect that we will run into this problem and
not send the SMS, not try to set the LAC=0.
2011-07-25 00:19:36 +02:00
Harald Welte 07b7bd79d6 TRAU mux: add some comment to the source of the gsm_fr_map 2011-07-24 02:18:13 +02:00
Harald Welte b226864db5 fix some header file related issues preventing lcr from compiling 2011-07-23 10:53:30 +02:00
Holger Hans Peter Freyther d455ebe5ff Merge branch 'daniel/controlif' 2011-07-19 20:08:07 +02:00
Daniel Willmann 8d9876e1ba osmo-bsc: Only keep the newest of subsequent invalid positions 2011-07-19 20:07:20 +02:00
Daniel Willmann 3118191f59 osmo_bsc: Track the last three locations. 2011-07-19 20:07:20 +02:00
Daniel Willmann fa2218cbc9 osmo-bsc: Add valid field to location command 2011-07-19 20:07:20 +02:00
Daniel Willmann 6d718c054a osmo-bsc: Improve return handling in verify_net_loc 2011-07-19 20:07:20 +02:00
Daniel Willmann 44fb151c12 osmo-bsc: Compare char * with NULL instead of 0 2011-07-19 20:07:20 +02:00
Daniel Willmann 1c33d4c00d libcommon: Add DCTRL logging destination for libctrl related messages 2011-07-19 20:07:20 +02:00