Commit Graph

40 Commits

Author SHA1 Message Date
Harald Welte 821bf067e4 RSL: Add CCCH LOAD INDICATION for RACH
We now count the total number of RACH slots, the number with rx level
above the busy threshold, and the number of valid access bursts.

This data is used to generate RSL CCCH LOAD INDICATION for the RACH.
2012-06-15 11:07:03 +08:00
Harald Welte 36179bbcdf RSL / SI: Make sure to have correct LAPDm header in SI5/SI6 on SACCH
SI5/SI6 and other messages on SACCH need the C/R and the EA bit set in
the LAPDm header.  Most devices accept a broken header, but especially
the Wavecom Q2686 responds with tons of RR STATUS messages if there is
any invalid bit.
2012-04-27 15:12:46 +02:00
Holger Hans Peter Freyther b0150b7ad4 lchan: Refuse to activate a non-idle lchan. 2012-04-19 09:39:54 +02:00
Holger Hans Peter Freyther d7718280c9 lchan: Send the ACT ACK/NACK after the Layer1 has handled act/deact
Send the RSL ACT ACK/NACK after the Layer1 firmware has acked the
activation/deactivation. In case the channel can not be activated
we will send a NACK. In case the channel can not be deactivated we
will send an ACK and the next time the channel is activated we will
send a NACK. The release ack will be sent once the TxDownlink of the
TCH/SDCCH is closed.

Change the rsl_tx_chan_nack method to create a new msgb to be used
by the hardware layer, change the return value to ask the caller to
delete the msgb.
2012-04-19 09:39:54 +02:00
Holger Hans Peter Freyther af02387183 lchan: rsl_tx_chan_nack will re-use the msgb, do not msgb_free
Do not msgb_free the msg as it will be re-used inside the nack
method and return 1 so the caller does not free the msgb. This
ownership model needs some consideration but the usage of ref
counts will not yield good results.
2012-04-19 09:39:52 +02:00
Holger Hans Peter Freyther f78f35880f lchan: Fix crashes when the specified lchan can not be found
gsm_lchan_name will crash if the lchan is NULL. Introduce an error_report
method that will do the right thing in the future and report the error.
2012-04-19 09:39:51 +02:00
Harald Welte b03f8ae4f0 ciphering: Better state tracking and HACK around L1 race condition
We now check if the received message is an LAPDm I frame in order to
determine if we have received the first valid encrypted message on the
radio link.  This relates to the fact that we often see 'old' UI frames
coming up from L1, even after it has confirmed decryption has been
enabled.
2012-04-19 09:35:03 +02:00
Holger Hans Peter Freyther 6dd7c4fb57 misc: Check return value of msgb _alloc functions
Attempt to catch all functions that allocate a msgb and didn't
check the return value of the allocation.
2012-01-23 10:22:09 +01:00
Holger Hans Peter Freyther bb9647f651 ipa: Send the DLCX Indication with the right message discriminator
The IPA messages for RTP should use the IPA vendor as message
discriminator.
2012-01-15 18:09:40 +01:00
Harald Welte 6e121417a5 RSL: fix typo in comment 2012-01-14 12:35:40 +01:00
Harald Welte fe4893e625 RSL: Actually check if BSC-requested cipher is supported 2011-11-24 17:46:22 +01:00
Harald Welte c373448e03 fix various compiler warnings across the code
this deals with unused cocde, unused variables and undeclared symbols in
various places.
2011-09-19 20:46:51 +02:00
Harald Welte 9508fb80a4 Introduce new amr.[ch] for AMR related functions 2011-09-09 22:32:45 +02:00
Harald Welte 16c0ab92c1 add commands to configure RTP jitter buffer
there's one global setting for the BTS default value, plus an
interactive command to change the buffer of an active lchan on the fly
2011-09-08 15:21:39 +02:00
Harald Welte 5355ead9d9 use osmo_ortp in POLLING mode instead of select loop integration
This solves a lot of the problems we've been seeing in the context
of large jitter (uRTP) or classic RTP with SID frames
2011-09-07 11:55:08 +02:00
Harald Welte 5fa9d9c18f RSL: get rid of some compiler warnings 2011-09-06 22:20:51 +02:00
Harald Welte 24713348c4 More comprehensive AMR handling
* parse AMR multirate config form 04.08 IE into easier format
* CMR, CMC and CMI on the L1 side are an _index_ into the current
  mode array
* Fix conversion of AMR SID frames from RTP -> L1
2011-09-06 22:19:40 +02:00
Harald Welte 6d7b78bde1 add minimal configuration file support
this config file allows configuration of unit id, oml ip,
and local rtp bind IP.
2011-09-04 22:47:25 +02:00
Harald Welte f41f2a7f92 AMR: double-check CMI/CMR/CMC values
We have to make sure that a phone cannot request codec modes which are
not part of the active set...
2011-09-04 17:21:39 +02:00
Harald Welte 526b0c62cf Add new ORTP based libosmo-trau based voice support
Using osmo-bts-sysmo and this code, it is now possible to do FR and AMR
based voice calls on TCH/F.

A lot of CPU is wasted in the conversion between the RTP formats and the
L1 specific formats for the codec frames.  All data needs to be shifted
by four bits, and the order of bits needs to be reversed in every byte.
2011-09-03 15:41:12 +02:00
Harald Welte 97d4c44db2 RSL: send CRCX/MDCX related messages as msg discriminator ip.access 2011-07-24 00:01:46 +02:00
Harald Welte 9d4736a5be Use libosmotrau for RTP support
This only implements creating, binding, connecting and free'ing RTP
sockets, not yet anything regarding receiving or transmitting codec
frames on them.

You will need the rtp branch of libosmocore for libosmotrau
2011-07-21 20:36:24 +02:00
Harald Welte 6b62748da6 RSL: fix transmission of RR ciphering mode command via LAPDm
We didn't correctly format the RSLms message that went into LAPDm,
causing LAPDm to drop the message.

Also, disable the fake CIPH MODE COMPLETE generation hack for now
2011-07-13 00:52:41 +02:00
Harald Welte 168238f9de update the HACK to delay the fake CIPHERING MODE COMPLETE
When seinding the fake CIPH MOD COMPL, we should wait a bit, as otherwise it
will reach the MSC _before_ we ever get the (still unencrypted) CLASSMARK
update from the MS.
2011-07-12 00:23:32 +02:00
Harald Welte 0285067b63 RSL: include fake IMEISV if we send fake CIPH MODE COMPL
If the MSC requests us to include the IMEISV in the ciph mode complete, we
respond with a fake IMEISV
2011-07-07 23:44:41 +02:00
Harald Welte e4035a86cf RSL: ciphering IE length can be '1' in case of 'no ciphering' 2011-07-07 21:35:46 +02:00
Harald Welte be598e3afd RSL: Send fake CIPHERING MODE COMPLETE
we do this as a hack as long as the MSC assumes the BTS supports
A5, but the L1 really doesn't support it yet.
2011-07-07 18:16:35 +02:00
Harald Welte 540410c123 RSL: implement RSL ENCR CMD, feed L3_INFO to LAPDm
This is not full encrpytion support, the bts-model part still
needs to detect the ENCR CMD when de-queueing from LAPDm and enable
the de-ciphering, detect the arrival of the first encrypted frame,
etc, enable en-ciphering, ...
2011-07-07 11:50:45 +02:00
Harald Welte f15cef94f7 fix various compiler warnings 2011-07-01 18:22:01 +02:00
Harald Welte 2bc0e10fa1 RSL/LAPDM: make sure we do lapdm_channel_reset()
this will free / flush any of the queued messages and give us a
clean start for the next user of the same lapdm channel.
2011-06-29 19:14:58 +02:00
Harald Welte 3b7480d5c3 RSL: clarify msgb free scheme in rsl 2011-06-29 19:14:44 +02:00
Harald Welte 45b767c7be RSL: Log all RLL messages from A-bis to LAPDm 2011-06-29 17:49:52 +02:00
Harald Welte 9852328aae don't print ((....)) in RSL debug output 2011-06-29 15:05:49 +02:00
Harald Welte ee3d0fcb77 make sure we forward EXTENDED MEAS REP to the BSC 2011-06-29 14:09:15 +02:00
Harald Welte 5830bfe411 rsl / meas rep: properly check if UNIT DATA IND is really a 04.08 meas rep 2011-06-29 12:43:09 +02:00
Harald Welte 6818881d72 implement baseic uplink measurement processing + reporting
* gather measurements from each PH-DATA.ind
* check every TDMA frame about meas period expiration
* compute averages after period expired
* put MS DL MEAS REP into RSL MEAS RES messages, include UL meas

bugs:
* L3 INFO content seems to have some offset
* is_sub is not set anywhere
* measurement periods might have up/downlink offset
2011-06-29 10:36:07 +02:00
Harald Welte c5e01c8bd4 implement RSL DEACTIVATE SACCH 2011-06-28 12:11:51 +02:00
Harald Welte c6b4c87e5d re-work original osmo-bts with support for sysmocom femtobts
This code re-works osmo-bts to add support for the upcoming sysmocom BTS.

It also tries to add some level of abstraction between the generic
part of a BTS (A-bis, RSL, OML, data structures, paging scheduling,
BCCH/AGCH scheduling, etc.) and the actual hardware-specific bits.

The hardware-specific bits are currently only implemented for the sysmocom
femtobts, but should be (re-)added for osmocom-bb, as well as a virtual
BTS for simulation purpose later.

The sysmocom bts specific parts require hardware-specific header files
which are (at least currently) not publicly distributed.
2011-06-27 11:25:35 +02:00
Harald Welte 33e2041b28 Fix include paths and start to make code compile
(still lots of missing references into osmocom-bb code)
2011-03-04 14:18:23 +01:00
Harald Welte 4b45ae1636 Import all C and Header files from jolly/bts branch of osmocom-bb.git
The BTS code shall reside in a separate git repository, thus I'm
importing the C and H files here.
2011-03-04 14:05:20 +01:00