Commit Graph

2968 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther dc9148d035 Merge branch 'zecke/calib-pch-agch-follow'
Introduce bcch_ccch to scan the PCH on top of the BCCH. The AGCH is
included in the PCH. CBCH/NCH are not included at this point.
2013-02-13 17:19:19 +01:00
Holger Hans Peter Freyther 1897f03d4c calib: Attempt to follow the PCH as well and print the SAPI..
AGCH is reported as part of the PCH because we are not searching
for the BS-AG-BLKS-RES inside the SI3 and do not use MphConfigReq
to change this setting.
2013-02-13 17:17:59 +01:00
Holger Hans Peter Freyther 6ac2e68467 calib: Print the frame number decoded as t1/t2/t3 2013-02-13 10:34:40 +01:00
Holger Hans Peter Freyther 225cf82290 calib: Provide the fn and block number for each frame 2013-02-13 10:34:40 +01:00
Harald Welte 18708dd3b6 RSL: further rtp local bind related fixes
If the CRCX does not indicate the remote IP address, then we still were
binding to 0.0.0.0 and used that address successively in the CRCX_ACK.

As a workaround, we now use the source IP address of the RTP socket,
assuming that the outbound routes to BSC and the MGW are identical.
This is of course not always true, but I don't think there are any
better alternatives...
2013-02-09 14:17:01 +01:00
Harald Welte 98407bd457 rsl: Fix compiler warning in use of osmo_rtp_get_bound_ip_port()
for whatever reason i decided that a port number in
osmo_rtp_get_bound_ip_port() needs to be a int * and not a uint16_t * at
the time, so we have to deal with this here rather than breaking the
ABI.
2013-02-09 11:44:07 +01:00
Harald Welte 0bb2974b37 Fix determination of locally bound IP for RTP sockets
After we create a socket and bind it to INADDR_ANY, we cannot yet use
getsockname() to resolve the locally bound IP.  This only works after
the socket has been connected to the remote IP.  So we have to move the
osmo_rtp_get_bound_ip_port() to a code section after
osmo_rtp_socket_connect() has already happened.

With the code prior to this commit, unless "rtp bind-ip" was used in the
config file, we reported "0.0.0.0" as the "Source IP AddresS" in the IPA
CRCX ACK to the BSC.   This is of course wrong, as the BSC will then use
this "0.0.0.0" as destination address for the incoming RTP stream :(

Please note that for this fix to work, you also need a libosmoabis.git
with commit d426d458ca96ba29793e35b1b2a73fbcb3b2c888 which actually
causes osmo_rtp_socket_connect() to actually issue connect() on the
socket at all.
2013-02-09 11:38:30 +01:00
Harald Welte 550d22be5b Deprecate the "rtp bind-ip" configuration directive
Instead of explicitly having to specify the local IP address for RTP
sockets in the BTS, we just use "0.0.0.0" instead, which gets
translated to INADDR_ANY.

We still accept the configuration directive in old config files, but
when we write, the line will no longer be re-written to the file.

TODO: IMHO, the IPA RSL CRCX/MDCX actually permit the BSC to specify the
IP address on the BTS side, and we probably simply ignore this at this
point.
2013-02-04 22:16:23 +01:00
Harald Welte 6a2d89f48d Make sure SACCH fill frame is correctly aligned for L1 header
When we send a fill frame on SACCH, we need to have two bytes for the L1
header at the beginning (inserted by the DSP).

Thanks for Andreas Eversberg for pointing it out.
2013-02-04 22:16:23 +01:00
Harald Welte 3ff2fc4378 RSL: don't store MS power in lchan->bs_power but lchan->ms_power
As we currently don't use any BSC-based MS power control in either
OpenBSC nor in OsmoBTS, this bug has never shown up so far.

Thanks to Andreas Eversberg for spotting this.
2013-01-25 16:00:20 +01:00
Daniel Willmann bcd50d3219 oml: Create mph_send_activate_req for sending the activation request
Move the channel activation out of the loop into a dedicated function.
This is done in preparation of separating the decision to activate
something and sending the request.
2013-01-24 12:15:10 +01:00
Holger Hans Peter Freyther f0c5a424af sysmobts: Send GSM requests using the l1if_gsm_req_compl method
Prepare to change the queue and callback handling. For the TX power
VTY command it is still possible that it will conflict with other
callbacks and the easiest way is to beging with sending these requests
through another method that allows us a more strict test.
2013-01-23 18:23:58 +01:00
Holger Hans Peter Freyther 76a1bf6136 sysmobts: Help in calling the right callback for l1if_req_compl
The wait list code has a limitation that for two requests of the
same kind it does not know where the confirmation belongs to. This
limitation is triggered when two lchan's get activated/deactivated
at the same time and is noticed once we start to count the SAPIs.

Set the hLayer3 to the lchan identifier, use the trx as closure for
the callback and resolve the lchan in the callback using these two
bits of information.
2013-01-23 18:23:58 +01:00
Holger Hans Peter Freyther e210f1a864 sysmobts: Rename the hLayer2<->lchan to hLayer<->lchan
We are using this conversion for both hLayer2 and hLayer3. Make the
function name more generic to indicate that this function can be used
with the hLayer3.

The functions that call the methods were updated using spatch and
@rule1@
expression E;
expression F;
@@
- l1if_hLayer2_to_lchan(E, F)
+ l1if_hLayer_to_lchan(E, F)
@rule2@
expression E;
expression F;
@@
- l1if_lchan_to_hLayer2(E)
+ l1if_lchan_to_hLayer(E)
2013-01-23 18:23:58 +01:00
Holger Hans Peter Freyther 61e739912f sysmobts: Ignore too short messages on the FACCH (but also the SDCCH)
During call testing using an E71 and dialing a number of an expired (lac
set to 0) subscribe the CC Release and other messages are sent after or
during the channel modification. This appears to lead to some reception
issues in the DSP code and giving use empty (u8size == 0) FACCH frames.
The real issue might be inside the MNCC code of NITB and the lack of a
size check inside the LAPDm code (our msgb has enough data though).
Passing the empty FACCH frame into the LAPDm code lead to the generation
of RSL ERROR INDICATION with cause FRAME_UNIMPL as some bits were zero.

Add a check for 0 into the FACCH code. As the code path is shared with
SDCCH it is also discarding zero sized SDCCH frames. These have not been
observed during my testing. The lacking size check in LAPDm will be
addressed separately.

During call testing the IPA CRCX was also failing due the BTS trying
to bind to an unassigned IP address.
2013-01-23 18:22:11 +01:00
Holger Hans Peter Freyther 4a303c7c38 oml: Fix memory leak in the callback 2013-01-23 18:22:11 +01:00
Harald Welte 8597a278d6 l1_if: don't print measurements a second time in case of error 2013-01-23 17:42:17 +01:00
Holger Hans Peter Freyther 6ddd632adf sysmobts: Use a newline at the end of the SACCH u8Size < 2 message
The other message in this method is using a \n as well and the line
is generally now followed with a LOGPC.

It looked like this:
<0006> l1_if.c:672 SACCH with size 0<2 !?!<0006> tch.c:540 (bts=0,trx=0,ts=2,ss=0) Rx Payload size 0
2013-01-17 21:14:40 +01:00
Holger Hans Peter Freyther 0903001d9b calibration: The clock error is absolute for anything but the netlisten
We only need to run this once and we know the clock error. In case it
is 0/0 we know that we didn't receive one of the two clocks. This could
be because the GPS doesn't have a fix. I accidently pushed this code into
the master branch and it is too late to rebase.
2013-01-15 22:47:38 +01:00
Harald Welte c2371cc011 fix message: the PCU is not a call control application 2013-01-15 18:57:59 +01:00
Daniel Willmann 91816acfb8 paging: De-duplicate paging lifetime and max queue length variables
These attributes are saved in paging_state, we don't need to save them a
second time in struct gsm_bts_role_bts. Add get and set methods for
these attributes and use them consitently in the VTY code.
2013-01-13 17:24:45 +01:00
Holger Hans Peter Freyther fad5b08625 WIP... use gps for calibration.. 2013-01-12 21:44:48 +01:00
Harald Welte 24b2128e29 add PCU respawning to contrib screenrc and respawn scripts 2013-01-11 17:36:56 +01:00
Holger Hans Peter Freyther 3177f2b42f sysmobts: Fix the comment referring to the value of the timeout
Right now it is 30 seconds and not 10.
2013-01-03 16:39:41 +01:00
Holger Hans Peter Freyther 552989ad57 common: Fix faulty memcpy statement in the paging code
This was experienced by Daniel on his 64bit machine. The paging
expiration time was too high and not set by the code at all. Using
gdb watchpoints he found the place where the memory is written. The
issue is that the size of the pointer (8) and not the size of the
data structure was copied (3).

Fix the issue by assigning the de-referenced value. gcc generates
the same code as if we had written:
 memcpy(&ps->chan_desc, chan_desc, sizeof(*chan_desc));
2013-01-01 21:33:18 +01:00
Holger Hans Peter Freyther 222a6a5e23 l1_if: Fix typo... call it femtobts 2012-12-29 12:23:09 +01:00
Holger Hans Peter Freyther 0670138ffc tch: Do not print that there is no audio data on a TCH/H
When only signalling is used on the TCH/H it is normal that there
is no TCH data. Save CPU time by not printing the message. This
needs to be moved to be edge triggered.
2012-12-26 19:50:10 +01:00
Holger Hans Peter Freyther 19cf0e81b3 ciphering: Handle ciphering support for A5/3 correctly
This was found and debugged by Sylvain. The BTS will always support
A5/0 so we do not keep track of that, the first bit of the flags is
used for A5/1, second for A5/2... but for RSL there is an offset to
go from RSL to A5(x). Add a testcase and change the code.
2012-12-26 18:55:54 +01:00
Daniel Willmann 5f408f934c tests: Don't delete atconfig in clean
This file is created in ./configure so we shouldn't remove it with make.

Otherwise ./configure && make clean && make check fails
with:

make[3]: *** No rule to make target `atconfig', needed by `check-local'.
Stop.
2012-12-26 11:31:30 +01:00
Holger Hans Peter Freyther fc9920830e misc: Package the configuration and contrib directory 2012-12-22 16:05:10 +01:00
Holger Hans Peter Freyther c559dde69d misc: Package our version of the gsm_data.h to make the code compilable
The sharing with OpenBSC is not complete yet. We will need to include
our version of gsm_data.h instead of the normal OpenBSC version.
2012-12-22 16:02:05 +01:00
Holger Hans Peter Freyther 3bcf3a5fd0 sysmobts: Add all header files to the EXTRA_DIST to fix make distcheck 2012-12-22 15:03:19 +01:00
Holger Hans Peter Freyther 359b2cf469 misc: Fix the make distcheck of the osmo-bts code
* Comment out the osmo-bts-bb/Makefile as we have removed it from
  the SUBDIRS and are not packaging the code right now
* Add missing include files for the build
2012-12-22 14:59:12 +01:00
Holger Hans Peter Freyther 20c5702e0f paging: Update the test output to make the test pass 2012-12-22 14:44:00 +01:00
Holger Hans Peter Freyther ce7559fbec misc: Fix compilation on debian stable with GCC 4.4.5
l1_transp_hw.c:89: error: redefinition of typedef 'dummyprim'
l1_transp_hw.c:88: note: previous declaration of 'dummyprim' was here
2012-12-22 14:37:30 +01:00
Holger Hans Peter Freyther 0d30b5d818 Merge branch 'zecke/openbsc-incdir'
Allow to have the OpenBSC directory somewhere else. This is required
to build osmo-bts on the public jenkins installation. The default is
the old behavior to look for OpenBSC next to the osmo-bts code.
2012-12-20 19:23:01 +01:00
Holger Hans Peter Freyther 56698b84e0 openbsc: Check for the presence of the gsm_data_shared.h header file 2012-12-20 19:18:13 +01:00
Holger Hans Peter Freyther db51f0d73e openbsc: Introduce autoconf support to set the OpenBSC include directory
Add autoconf support to set the path to the OpenBSC include directory
so that openbsc/gsm_data_shared.h can be found there.
2012-12-20 19:02:37 +01:00
Holger Hans Peter Freyther bcae2abff8 openbsc: Prepare to allow to have the OpenBSC directory somewhere else
Right now osmo-bts requires access to one OpenBSC header file and
this requires that openbsc and osmo-bts git are in the same directory.
Begin with making the location of the OpenBSC sourcecode configurable.

This approach will allow to build osmo-bts on our Jenkins installation
but now has the risk of more code including the openbsc/*.h header files.
2012-12-20 19:02:37 +01:00
Holger Hans Peter Freyther d1ffab96ca misc: Forward declare calib_load to address a compiler warning 2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 61a1f99680 misc: Forward declare l1if_set_ciphering to avoid a compiler warning 2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 4fd0a84cf8 misc: Change the method to return void instead of int and garbage
The method was not returning anything and the callers did not use
the result. Change it to void for now.
2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 9bd5afa014 misc: Include pcu_if.h for pcu_tx_pag_req in rsl.c and make it const
The rsl.c code was calling the paging request with a const pointer,
change the signature to make the code const.
2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 8d8ff80890 misc: Forward declare the load_timer_start to address compiler warning 2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 6f93861cfc misc: load_ind_period is uint8_t and 60*100 is bigger than that.
Address the compiler warning and truncate the value by hand.
2012-12-20 19:01:27 +01:00
Holger Hans Peter Freyther 6ae49691af sysmobts: Transmit the UI idle frame as a LAPDm Command
When transmitting an idle frame the BTS should transmit it as a
command and not a response. This is unbreaking the mobile application
of osmocomBB.
2012-11-26 01:33:52 +01:00
Harald Welte 2bad1363e9 Add VTY configuration of paging queue size and lifetime of paging records
This may be adding bells and whistles that nobody wants to touch, but at
least for current analysis/optimiziation they are useful to have.  Later
on they should probably be removed again and/or obsoleted by OML
messages for configuration of paging behaviour by the BSC.
2012-11-24 22:28:44 +01:00
Harald Welte 9858a7defe paging: send CCCH load indications even if paging load below threshold
This is mainly as OpenBSC is adjusting the amount of paging commands it
sends based on this magic value 0xffff.
2012-11-24 22:28:44 +01:00
Andreas Eversberg a57fac59c6 Use tlvp_val16_unal() / tlvp_val32_unal() to align 16 and 32 bit values
This is required for CPUs < armv6, to access 16 and 32 values at right
memory locations.
2012-11-20 11:37:10 +01:00
Harald Welte 36e73dd7ed Ensure osmo-bts builds agsainst sysmobts-v1 headers (again) 2012-11-18 10:38:32 +01:00