aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
AgeCommit message (Collapse)AuthorFilesLines
2013-06-20rsl: fix the unaligned memory access0.3.0sysmocom/0.3.0-stableNicolas J. Bouliane1-14/+18
the armv5 can do 32bit/16bit reads only from the aligned address use tlv.h macro to copy data to local variable Signed-off-by: Nicolas J. Bouliane <nicolas.bouliane@nutaq.com>
2013-04-30rsl: Add the channel name to the act nack and conn fail messageHolger Hans Peter Freyther1-2/+6
2013-03-13RSL: Fix Channel Number IE in Common Channel RSL messagesHarald Welte1-0/+1
As per Chapter 9.3 of TS 08.58, we have to use RSL_IE_CHAN_NR instead of the zero we were implicitly using so far.
2013-03-11Added radio link timeout procedure according to TS 05.08 Chapter 5.2Andreas Eversberg1-0/+20
Chapter 5.2 applies to MS procedure, but 5.3 (BSS procedure) defines no exact criterion, so I decided to use the procedure equivalent to MS. The criterion is based on a counter S, which is initialized to a preset RADIO_LINK_TIMEOUT, which can be configured via VTY. Whenever a received SACCH block is bad, S is counted down by one. If SACCH block is successfully decoded, S is counted up by two, but never above initial RADIO_LINK_TIMEOUT value. If S reaches 0, an RSL Connection Failure Indication with cause RF Radio Link Failure is sent to BSC, which then aborts channel. Use link timeout value from BSC via OML attribute. How to test: - Set "debug" for "meas" logging. - Start silent call to an attached mobile. - Remove battery from mobile or shield mobile. - Watch S count down.
2013-02-09RSL: further rtp local bind related fixesHarald Welte1-11/+49
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-09rsl: Fix compiler warning in use of osmo_rtp_get_bound_ip_port()Harald Welte1-1/+4
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-09Fix determination of locally bound IP for RTP socketsHarald Welte1-8/+9
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-04Deprecate the "rtp bind-ip" configuration directiveHarald Welte1-1/+1
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-01-25RSL: don't store MS power in lchan->bs_power but lchan->ms_powerHarald Welte1-1/+1
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.
2012-12-26ciphering: Handle ciphering support for A5/3 correctlyHolger Hans Peter Freyther1-2/+4
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-20misc: Include pcu_if.h for pcu_tx_pag_req in rsl.c and make it constHolger Hans Peter Freyther1-0/+1
The rsl.c code was calling the paging request with a const pointer, change the signature to make the code const.
2012-07-21Send RR paging requests to PCU, in order to page on PACCHAndreas Eversberg1-0/+2
2012-06-18rsl: use correct headroom size for load indicationsHarald Welte1-2/+2
2012-06-15RSL: Add CCCH LOAD INDICATION for RACHHarald Welte1-22/+23
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-04-27RSL / SI: Make sure to have correct LAPDm header in SI5/SI6 on SACCHHarald Welte1-2/+2
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-19lchan: Refuse to activate a non-idle lchan.Holger Hans Peter Freyther1-0/+7
2012-04-19lchan: Send the ACT ACK/NACK after the Layer1 has handled act/deactHolger Hans Peter Freyther1-10/+9
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-19lchan: rsl_tx_chan_nack will re-use the msgb, do not msgb_freeHolger Hans Peter Freyther1-4/+4
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-19lchan: Fix crashes when the specified lchan can not be foundHolger Hans Peter Freyther1-4/+20
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-19ciphering: Better state tracking and HACK around L1 race conditionHarald Welte1-1/+2
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-01-23misc: Check return value of msgb _alloc functionsHolger Hans Peter Freyther1-10/+51
Attempt to catch all functions that allocate a msgb and didn't check the return value of the allocation.
2012-01-15ipa: Send the DLCX Indication with the right message discriminatorHolger Hans Peter Freyther1-2/+2
The IPA messages for RTP should use the IPA vendor as message discriminator.
2012-01-14RSL: fix typo in commentHarald Welte1-1/+1
2011-11-24RSL: Actually check if BSC-requested cipher is supportedHarald Welte1-2/+6
2011-09-19fix various compiler warnings across the codeHarald Welte1-1/+0
this deals with unused cocde, unused variables and undeclared symbols in various places.
2011-09-09Introduce new amr.[ch] for AMR related functionsHarald Welte1-91/+9
2011-09-08add commands to configure RTP jitter bufferHarald Welte1-0/+3
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-07use osmo_ortp in POLLING mode instead of select loop integrationHarald Welte1-1/+2
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-06RSL: get rid of some compiler warningsHarald Welte1-2/+1
2011-09-06More comprehensive AMR handlingHarald Welte1-1/+91
* 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-04add minimal configuration file supportHarald Welte1-1/+2
this config file allows configuration of unit id, oml ip, and local rtp bind IP.
2011-09-04AMR: double-check CMI/CMR/CMC valuesHarald Welte1-5/+17
We have to make sure that a phone cannot request codec modes which are not part of the active set...
2011-09-03Add new ORTP based libosmo-trau based voice supportHarald Welte1-22/+184
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-07-24RSL: send CRCX/MDCX related messages as msg discriminator ip.accessHarald Welte1-4/+14
2011-07-21Use libosmotrau for RTP supportHarald Welte1-101/+228
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-13RSL: fix transmission of RR ciphering mode command via LAPDmHarald Welte1-11/+19
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-12update the HACK to delay the fake CIPHERING MODE COMPLETEHarald Welte1-10/+39
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-07RSL: include fake IMEISV if we send fake CIPH MODE COMPLHarald Welte1-4/+26
If the MSC requests us to include the IMEISV in the ciph mode complete, we respond with a fake IMEISV
2011-07-07RSL: ciphering IE length can be '1' in case of 'no ciphering'Harald Welte1-1/+2
2011-07-07RSL: Send fake CIPHERING MODE COMPLETEHarald Welte1-1/+33
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-07RSL: implement RSL ENCR CMD, feed L3_INFO to LAPDmHarald Welte1-5/+65
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-01fix various compiler warningsHarald Welte1-5/+10
2011-06-29RSL/LAPDM: make sure we do lapdm_channel_reset()Harald Welte1-4/+5
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-29RSL: clarify msgb free scheme in rslHarald Welte1-4/+15
2011-06-29RSL: Log all RLL messages from A-bis to LAPDmHarald Welte1-1/+7
2011-06-29don't print ((....)) in RSL debug outputHarald Welte1-2/+2
2011-06-29make sure we forward EXTENDED MEAS REP to the BSCHarald Welte1-3/+11
2011-06-29rsl / meas rep: properly check if UNIT DATA IND is really a 04.08 meas repHarald Welte1-8/+5
2011-06-29implement baseic uplink measurement processing + reportingHarald Welte1-8/+93
* 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-28implement RSL DEACTIVATE SACCHHarald Welte1-0/+1