aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
AgeCommit message (Collapse)AuthorFilesLines
2016-06-17dyn PDCH: rsl rx dchan: also log ip.access message namesNeels Hofmeyr1-2/+2
Before, only standard ABIS RSL message names were logged, add ip.access specific ones. The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan() should be able to log ip.access message types properly. Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f
2016-06-12Add DTXd support for sysmoBTS and LC15Max1-6/+7
* set/clear DTXd activity indicator for measurement reporting * set DTXd status based on information from RSL Related: OS#1563 Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257 Depends-On: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Reviewed-on: https://gerrit.osmocom.org/220 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-31Use libosmocore function for uplink measurementsMax1-4/+9
Related: OS#1563 Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57 Reviewed-on: https://gerrit.osmocom.org/108 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-03-17Add explicit check for SI2quater index and countMax1-2/+21
Right now we do not support multiple SI2quater messages, so return error if either index or count is non-zero.
2016-01-04fix large amount of compiler warnings in common and sysmobts codeHarald Welte1-0/+1
2015-12-03common/rsl.c: The presence of a valied measurement result is DEBUGHarald Welte1-1/+1
we shouldn't consider the presence of a valid measurement result as something NOTICEable
2015-09-22Change to new structure of multirate at gsm_data_shared.hAndreas Eversberg1-6/+6
2015-09-22Add TCH messages to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-2/+1
This part moves TCH handling from osmo-bts-sysmo to common part. The RTP handling is done at the common part, so they can be used by other BTS models.
2015-09-22Move chan act/rel/modify from bts_model to PH-/MPH-/TCH-SAP interfaceAndreas Eversberg1-12/+13
This part replaces channel activation/deactivation/modification routines by MPH_INFO messages.
2015-09-22Relace bts_model_get_time() by get_time() at common partAndreas Eversberg1-1/+2
2015-09-21audio/rsl: Include statistics for one callHolger Hans Peter Freyther1-3/+37
Use the new libosmo-abis API to query the session for the statistics and then send it as a TLV element to the BSC. This can be used to do post processing about the call. E.g to figure out if no audio arrived at all.
2015-09-21audio/rsl: Include the connection identifier in the DLCX indHolger Hans Peter Freyther1-0/+1
I have traces that include the connection identifier in the DLCX indication.
2015-07-14meas: Do not send incomplete measurement reportsHolger Hans Peter Freyther1-8/+11
The RSL_IE_MEAS_RES_NR is mandatory element with a minimum of 5 octets (two for TL and three for the value). When we establish a new channel we might not have had enough time in a TDMA frame to calculate the average. The issue is not easy to reproduce. At the point we receive the measurement report we have two uplink measurements queued. As it is not easy to reproduce and only occurs when a channel is new I have decided to drop the message instead of sending made up uplink measurement reports. As of now lchan_build_rsl_ul_meas will always return 3 and the condition will never be false. Avoids: SYS#1781
2015-02-05power: Make it possible to force a power levelHolger Hans Peter Freyther1-0/+23
Use the standard RSL commands to order a logical channel to use a fixed power level. The code is not fully verified and there was a last minute change to invoke bts_model_adjst_ms_pwr.
2015-02-05power/sysmobts: Add a manual ms power level controlHolger Hans Peter Freyther1-1/+9
Currently the DSP is instructed to achieve a given uplink power target but there are circumstances (e.g. EMV testing) where we need more control over it. The "manual/software/osmo" power control can only be implemented per TRX and not per lchan. Add a very very basic control that checks the MS Power used by the phone, the actual receive level and then adjust the power. The code doesn't take the history into account, if the phone can not reach the requested power level the code will be stuck (e.g. no timeout based on multiframes). It has a mode for a fixed power control but no way to set it yet. The change of the mode requires a restart of the software.
2014-12-30CBCH: Implement CBCH block segmentation and RSL_MT_SMS_BC_CMDHarald Welte1-2/+25
* CBCH load indications are not yet sent * The queue length is not yet limited!
2014-12-30Initial CBCH supportHarald Welte1-2/+4
This should handle OML channel combinations with CBCH and activate the CBCH SAPI towards the DSP correspondingly. What is still missing is sending any actual information over the CBCH in respons to the PH-RTS.ind coming up from L1.
2014-08-27Correctly fill system information messages from BSCAndreas Eversberg1-2/+7
SI 5*/6 require L2 header of 0x03,0x03. All SI might be less than 23 octets, so they need to be filled with 0x2b.
2014-07-25amr: Avoid toggling the CMR from none and a set oneHolger Hans Peter Freyther1-0/+2
For LCR and other systems without out-of-band information we need to indicate the CMR. Not every air message will include the mode and we sent a stream that had the CMR set and not-set. This lead to the AudioCodes MGW only playing every second frame. Remember the last used mode and initialize it to _NONE when we receive the multirate config. In case of a real error we will still use AMR_CMR_NONE. The initial patch is from Harald. I have added the initialization and moving of the defines to amr.h. Manually verified by enabling AMR5.9 and looking at two RTP packages in sequence. In both cases the CMR was 2. I have looked at "amr.nb.cmr != 2" in wireshark and only found the MGCP dummy packet.
2014-03-10handover: Set basic values for handover, remember the activation reasonAndreas Eversberg1-0/+10
Introduce the handover.h/handover.c and initialize handover parameters in OML and remember the activation through RSL.
2014-03-10handover: Implement generating HANDOVER DETECTION in rsl_tx_hando_detAndreas Eversberg1-0/+22
2014-02-22agch/rsl: Fix msgb handling for IMMEDIATE ASSIGNJacob Erlbeck1-1/+3
Currently, the msg->data pointer is just set to the IMMEDIATE ASSIGN message and the len is adjusted accordingly. Unfortunately, this leaves l2h (pointing to the RSL header) and l3h (pointing to the FULL_IMM_ASS_INFO IE) in an undefined state (outside of [data, tail]). The code in bts.c accesses the message via msg->data. This patch sets l3h and l2h correctly. msgb_l3() will point to the start of the IMM ASS message and should be used instead of msg->data. Sponsored-by: On-Waves ehf
2014-02-19rsl: Do not allow IPA CRCX on non traffic channelsHolger Hans Peter Freyther1-0/+5
Use 0x52 as error cause as the nanoBTS is doing the same under the situation. This has been spotted while testing handover using the VTY command for handover.
2014-02-19rsl/si: Fix resetting bits in bts->si_validJacob Erlbeck1-2/+2
Use 'var &= ~(1 << x)' to reset bits instead of 'var &= (1 << x)'. Sponsored-by: On-Waves ehf
2014-01-21common/rsl.c: Allow bts_model_rsl_chan_act() to return negative causeHarald Welte1-1/+6
If the channel couldn't be activated, the function can simply return a negated RSL_ERR_* constant which will then be propagated towards the BSC in an CHAN_ACT_NACK RSL message.
2013-11-27bts: Fix crash of receiving data during the release processHolger Hans Peter Freyther1-2/+13
Release/Free the lapdm resources _after_ the channel has been fully released. Do not forward data unless the lchan is in the active state. Reading this code again, there is probably a memory leak for everytime the PCU will re-connect to the BTS. (gdb) p lchan->state $4 = LCHAN_S_REL_REQ (gdb) bt #0 lapd_dl_flush_hist (dl=0x40454894) at lapd_core.c:164 #1 0x44873b54 in lapd_rx_u (lctx=0xbe9bd5a8, msg=0x92f90) at lapd_core.c:1040 #2 lapd_ph_data_ind (msg=0x92f90, lctx=0xbe9bd5a8) at lapd_core.c:1644 #3 0x44876d50 in l2_ph_data_ind (link_id=<optimized out>, chan_nr=<optimized out>, le=<optimized out>, msg=0x92f90) at lapdm.c:637 #4 lapdm_phsap_up (oph=<optimized out>, le=<optimized out>) at lapdm.c:707 #5 0x0000c504 in handle_ph_data_ind (l1p_msg=0x97358, data_ind=0x97420, fl1=<optimized out>) at l1_if.c:774 #6 l1if_handle_ind (fl1=<optimized out>, msg=0x97358) at l1_if.c:892
2013-11-14rsl: Rename abis_rsl_sendmsg to avoid symbol clash with libosmo-abisHolger Hans Peter Freyther1-19/+19
Nicolas ended up with linker issues due abis_rsl_sendmsg being defined twice. Rename our version of the function and update the code. Patched with: @i@ expression E; @@ - abis_rsl_sendmsg(E) + abis_bts_rsl_sendmsg(E)
2013-10-25rsl/pcu: Do not send a CHAN ACT to the BSC on PCU usageHolger Hans Peter Freyther1-0/+20
The PCU is forcing the activation of a PDCH. Currently the BSC will receive a channel act ack for a channel that was not activated at all. Use the "release_reason" flag of the lchan to see if we have requested a normal activation or a silent one. It feels a bit odd to do it in the TX function but it is the most easy solution right now. I have added logging so it will not be totally silent.
2013-10-06abis: Use OML remote (BSC) address if RSL CONNECT contains no IPHarald Welte1-5/+1
This introduces a new get_signlink_remote_ip() function whcih we also use in the RSL code to determine the RTP remote address if the CRCX/MDCX contains no remote IP address IE.
2013-10-06migrate away from our own abis.c code to libosmoabisHarald Welte1-4/+13
libosmoabis has a BTS-side implementation of the IPA protocol for years, and osmo-bts should have used that all the time. Unfortunately it had its own local hack, this patch is migrating to the libosmocore implementation.
2013-07-09rsl: Fix the audio handling after the 'alignment' handling fixHolger Hans Peter Freyther1-26/+21
The issue got introduced in fcdba6bfaca9e016f35fc9fa826948ec74f66121 when moving from the uint32_t pointer to a plain int. The code was now like this: if (connect_ip > 0) { if (connect_ip == 0) lookup_ip_based_on_rsl ... Coverity detected this as logically dead code and it was breaking audio handling for the osmo-bsc case. Remove the tristate handling, the RSL behavior is that leaving out port/ip is like specifying it as zero. Fixes: Coverity CID 1040769
2013-06-24lapd: Fix a +ptrsize memory leak for each opened lchanHolger Hans Peter Freyther1-1/+1
The lapdm/lapd_core code needs to keep a history of messages sent. This history is not freed when lapdm_channel_reset is called and the init code will just allocate a new array. This means there is a memory leak on every released channel every time it is released.
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.