aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/abis_rsl.c
AgeCommit message (Collapse)AuthorFilesLines
2015-01-05RSL: Change "... is back in operation" to an INFO level messageHarald Welte1-1/+1
2015-01-05Don't return an error to caller if we are out of lchan on CHAN RQDHarald Welte1-1/+1
This is a normal situation under high load: The BTS is out of resources and the BSC cannot allocate any dedicated channel. We may send an IMM ASS REJECT back to the MS. All well within normal parameters, not an error that needs to be reported back to the caller, who propagates it all the way up to libosmo-abis.
2015-01-02lchan: Remember why a channel is broken using static stringsHolger Hans Peter Freyther1-7/+15
Remember why a channel is being marked as broken. So we can maybe understand what happend.
2014-12-30Add basic support for CBCH / SMS-CB (Cell Brroadcast)Harald Welte1-8/+13
We can now configure the pyisical channel types for CBCH either in the CCCH+SDCCH4 or in the SDCCH8 chanel combination. Depending on whether a CBCH exists on the BTS, we also generate the SI4 with matching CBCH channel description to notify the phones of the existance of the CBCH. There is now a VTY command how a SMS-CB message can be sent to a given BTS. We do not yet have any logic at all for actual scheduling of multiple CBCH RSL messages towards one or multiple BTSs yet, though.
2014-08-04dyn PDCH: Cleanup of rsl_chan_activate_lchan() and usersAndreas Eversberg1-5/+9
Timing advance is stored inside lchan structure, so it is removed from arguments. This is useful, if other actions are required prior calling rsl_chan_activate_lchan. (like deactivating PDCH first) The "shifted TA value" that is required by BS11 is now calculated inside rsl_chan_activate_lchan and not by each user. [Rebased by Holger. So some hunks were skipped as the patch depended on Jolly's HO code]
2014-07-07libbsc, osmo-bsc{, _nat}: Prevent unaligned access when casting TLVP_VALDaniel Willmann1-5/+5
foo = *((uintXX_t *) TLVP_VAL(...) can lead to unaligned access. To prevent that use tlvp_valXX_unal() to get the values.
2014-06-03rsl: Check if the channel is active and then start the channel releaseHolger Hans Peter Freyther1-16/+12
In case we receive ERROR INDICATION and CONNECTION FAILURE we only want to RF Channel Release the lchan once. This code is more simple and should work as reliable as the previous commit.
2014-06-03rsl: Avoid double channel release procedure in error conditionsHolger Hans Peter Freyther1-5/+20
When we receive an ERROR INDICATION and CONNECTION FAILURE we might call rsl_rf_chan_release multiple times. The channel release handling is still a bit messy and there too many paths that lead to the call. 1.) In case we receive an ERROR INDICATION for SAPI=3. A RLL error signal will be emitted that leads to the release of the channel through the SMS code in case of the NITB. The call to rsl_rf_chan_release might be a double release. 2.) In case a CONNECTION FAILURE is received when the release process has already been started we would unconditionally call rsl_rf_chan_release as well. Because the lchan state is changed by the callers of the rsl_rf_chan_release we can not move the state checking into this code but need to do it in the caller. The issue was seen in a trace from Rhizomatica and I created the DoubleRelease.st to re-produce the issue and verified that we have no duplicate RF Channel Releses. The other option would be to introduce a new state to track the release process and see if we have already released SAPIs deactivated the SACCH or such. We can not simply look at these as for a channel that fails to activate they will be null already.
2014-06-03lchan: Speculative "fix" for error and late replyHolger Hans Peter Freyther1-8/+9
Looking at the code it seemed possible that a channel would transition from BROKEN to NONE. Or worse from NONE to BROKEN. Start the timer _after_ the channel has been released.
2014-05-26rsl: Remove obsolete FIXME comment.Holger Hans Peter Freyther1-1/+0
The lchan state is set to none either on RF Channel Release ACK or in case of an error after the error timer has expired.
2014-04-04rsl: Add missing breaks in the codeHolger Hans Peter Freyther1-0/+6
Given that the method is only called for a traffic channels the missing breaks didn't hurt. Fixes: Coverity CID 1040731, CID 1040732, CID 1040733, CID 1040734
2014-01-09Add VTY option for Nokia BTS that does not send RELease CONFirm messageAndreas Eversberg1-1/+30
This option is a workarround for a bug found in Nokia InSite BTS firmware version 3.0.0. There is no RELease CONFirm message for local end release. Nokia MetroSite with firmware version 4.178.16 is not affected. TS 04.06 Chapter 5.4.4.4 "Local end release procedure" states that a confirm must be sent by layer 2 when receiving a local end release request. In order to correctly switch a channel (handover or assignment), local end release is required.
2013-07-03hsl: Remove the support for the HSL bts from OpenBSCHolger Hans Peter Freyther1-6/+0
The support has been implemented for an old model, we were told that newer versions would be made incompatible with OpenBSC. Ther are various warnings in the code and coverity has found some new ones. Just remove the code as we don't know of anyone using this code.
2013-05-02channels: Mark channels as broken that time out on activation/releaseHolger Hans Peter Freyther1-4/+27
A channel that fails to send an ACK/NACK/REL within the four second timeout is now marked as broken. In case the release comes in late it will be ignored. The lchan should already been freed and for now we don't want to trust the channel. In the future we might want to send a "release" for a channel that got activated ack late and just set the state to none on a channel that is released acked late. The late ACK and REL has been tested with two manual tests using the fakebts. The channels remained blocked even after having received the ACK message here. The NACK case has not been manually tested.
2013-03-09rsl: Properly initialize the cm structure with memsetHolger Hans Peter Freyther1-1/+1
abis_rsl.c:332:23: warning: 'memset' call operates on objects of type 'struct rsl_ie_chan_mode' while the size is based on a different type 'struct rsl_ie_chan_mode *' [-Wsizeof-pointer-memaccess] memset(cm, 0, sizeof(cm)); ~~ ^~ abis_rsl.c:332:23: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(cm, 0, sizeof(cm)); ^~ 1 warning generated.
2013-02-08Fix of IMMIDIATE ASSIGNMENT REJECT messageAndreas Eversberg1-2/+5
The message was corrupt at several points. They are fixed now and successfully tested. A default T3122 timer value of 10 is defined by default now. If set to 0, the reject message will not be sent. Note that when using existing configs with T3122 value set to 0.
2013-02-07add some more docbook snippetsHarald Welte1-0/+9
2013-01-16rsl: Properly parse the RLM cause from the error indicationHolger Hans Peter Freyther1-3/+13
The code predates the TLV parser and we were parsing the RLM from the wrong offset. In general we were using the length of the TLV which happened to be equal to the T200 indication. After consulting the RLM cuases not every of them should generate a BSC_RLLR_IND_ERR_IND as these are forwarded to the MSC as a SAPI reject right now. TLV parsing now generates this due a bug in the osmo-bts code: abis_rsl.c:1605 (bts=0,trx=0,ts=2,ss=0) SAPI=0 <0000> abis_rsl.c:1547 (bts=0,trx=0,ts=2,ss=0) ERROR INDICATION cause=Fraeme not implemented
2012-12-26gsm: Do not attempt to release SAPI=0 if it was never allocatedHolger Hans Peter Freyther1-0/+22
In case of handover (but probably on RACH) we would send a RLL for SAPI=0 even if this SAPI was never established. After we have released all SAPI>0 locally check that SAPI=0 is established and if not release the rf channel directly.
2012-12-23lchan: Introduce T3109 handling for the release procedureHolger Hans Peter Freyther1-9/+43
T3109 is started when the SACCH is deactivated. It is stopped when the phones sends the DISC/UA/UM on LAPDm for the main signalling link. In case of timeout the abnormal release procedure will be initiated. Make sure to not issue the SACCH Deactivate twice to avoid confusing the equipment. This is still not fully spec compliant. In case of a timeout the abnormal release handling will be started which involves starting T3111+2. The error handling should be split out of the rf channel release method, e.g. lchan_release should be called and check if the channel release was already initiated.
2012-12-23lchan: Introduce a BROKEN state for the lchanHolger Hans Peter Freyther1-4/+3
If the CHAN ACTIV is NACKED we set the state backto NONE. This is problematic as our channel allocator will allocate from the front or from the back and if the channel is early in the list it might cause permanent failures. Introduce a BROKEN state and use it when the channel activation is failing for an unknown reason. Copy the cause so it can be inspected later.
2012-12-23lchan: Document the behavior/quirks for abnormal channel releaseHolger Hans Peter Freyther1-5/+29
Deactivate the SACCH and release all SAPIs locally as of GSM 04.08. Add documentation to the code and explain what will happen as part of the release process.
2012-12-23lchan: Release the lchan more quickly, align with GSM 04.08Holger Hans Peter Freyther1-2/+28
* Release all channels with SAPI > 0 with the "local end release" (as of NOTE 1 of GSM 04.08). * No need to wait for all SAPIs to be torn down and the normal REL_IND/REL_CONF will call rsl_handle_release and the channel should be released. * Update the documentation
2012-12-23rsl: Cosmetic changes to the release codeHolger Hans Peter Freyther1-8/+12
Put the idiom that sets the lchan state to none and respecting the error state into a shared method. This way the special handling for the abnormal case is just in one place.
2012-12-23rsl: Rename the reason to release_mode and use the enum valueHolger Hans Peter Freyther1-3/+4
The API with 0 and 1 as legal values is hard to understand. Use the recently introduced enum values instead.
2012-12-23rsl: Use LOGL_ERROR instead of LOGL_NOTICE act/deact timeoutsHolger Hans Peter Freyther1-2/+2
It is a grave error when the BTS does not respond to the ACT/DEACT requests, use LOGL_ERROR for such conditions.
2012-08-29RSL: Add basic support for CSD transparent modeHarald Welte1-6/+45
We now have a lchan->csd_mode member that determines if RSL should activate the channel in CSD transparent services or not. The previous code always assumed CSD is non-transparent. (This requires libosmocore >= eed26116c96f03c6128fac3dead9054714af6cab)
2012-07-02pre-fix measurement reports with subscriber identityHarald Welte1-3/+7
... otherwise it's impossible to distinguish them from each other.
2012-05-31abis_rsl_rcvmsg(): Fix msgb memory leak in error pathHarald Welte1-1/+2
Thanks to Andreas Eversberg for spotting this one.
2012-04-26RSL add debug statements when sending RSL EST REQ and RSL REL REQ.Harald Welte1-0/+6
2012-02-03abis_rsl.c: Remove unused variable net.Holger Hans Peter Freyther1-2/+0
The old BSC code had code to override the payload type, this has been removed, remove the variable accessing it. GCC warning: abis_rsl.c: In function ‘ipa_rtp_pt_for_lchan’: abis_rsl.c:1590:22: warning: unused variable ‘net’ [-Wunused-variable]
2012-02-03abis_rsl: The rach information was not used, introduce a signalHolger Hans Peter Freyther1-12/+16
Introduce a SS_CCCH for the paging and the rach load. The paging code could now start using the signal. GCC warning: abis_rsl.c: In function ‘rsl_rx_ccch_load’: abis_rsl.c:1371:11: warning: variable ‘rach_access_count’ set but not used [-Wunused-but-set-variable] abis_rsl.c:1370:11: warning: variable ‘rach_busy_count’ set but not used [-Wunused-but-set-variable] abis_rsl.c:1369:11: warning: variable ‘rach_slot_count’ set but not used [-Wunused-but-set-variable]
2012-02-03abis_rsl.c: Remove unused variable ts_numberHolger Hans Peter Freyther1-2/+1
GCC warning: abis_rsl.c: In function ‘rsl_rx_chan_rqd’: abis_rsl.c:1245:10: warning: variable ‘ts_number’ set but not used [-Wunused-but-set-variable]
2012-01-15channel: Review lchan_free calls and the state the channel is inHolger Hans Peter Freyther1-1/+1
In case of a memory allocation failure in rsl_rx_chan_rqd we would have left the channel in the LCHAN_S_ACT_REQ state. Move the state change below the allocation.
2012-01-15channel: The error timer and the lchan_deact_tmr are both runningHolger Hans Peter Freyther1-1/+2
In case a BTS does not send the RF Channel Release ACK and we are closing the channel because of an error two timers are running to set the state back to none. Make lchan_deact_tmr_cb and rsl_rx_rf_chan_rel_ack behave the same in regard to changing the state of the lchan. For the other direction we are save, the error path will set the state to NONE and the timeout will call lchan_free to set the channel type back to NONE, only then the lchan may be allocated again. The channel release procedure requires some more tweaking, some part was started in the zecke/28c3 branch and needs to be tested/integrated with the goal of having one common release path.
2011-12-24RSL: Nokia BTS reports TA in quarter-bits, not full bits.Andreas Eversberg1-2/+3
We need to compensate accordingly...
2011-12-16RSL: BS-11 reports TA in quarter-bits, not full bits.Andreas Eversberg1-4/+11
We need to compensate accordingly...
2011-08-22audio: From RTP point of view we can use one payload for HR/FR AMRHolger Hans Peter Freyther1-2/+1
Remove the separation of half-rate and full-rate AMR. The used rate can be found inside the AMR payload. The signalling of what kind of traffic channel is used can be done with the GSM 08.08 Chosen Channel IE in the Assignment Complete message. This way I can use a fixed payload type in the MGCP GateWay but have a mixed TCH/F and TCH/H config. E.g. use TCH/F FR3 for some subscribers when connected to MSC A but use AMR5.9 on a TCH/F for MSC B when all TCH/Hs are gone.
2011-08-22audio: Remove the hardcoding of the RTP PayloadHolger Hans Peter Freyther1-4/+0
The MGCP config must be correct and use 99 for RTP AMR.
2011-08-19src: port openBSC over libosmo-abis0.9.15Pablo Neira Ayuso1-1/+1
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-19src: use new msg->dst pointer instead of deprecated msg->trxPablo Neira Ayuso1-38/+50
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-11libbsc: Cosmetic fix for the channel activate NACK log messageDaniel Willmann1-1/+1
2011-08-11libbsc: Release the RF channel if BTS thinks it's still in useDaniel Willmann1-0/+3
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-11libbsc: Call lchan_free in the timeout callbacksDaniel Willmann1-2/+4
This makes sure that the lchans can be used again. (state and type are set to NONE)
2011-08-11RSL: add timer for lchan activation/deactivation without BTS responseHarald Welte1-1/+37
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-10Initial version of Support for Nokia *Site BTSDieter Spaar1-0/+53
This includes the MetroSite, but also other Nokia BTS models.
2011-07-27RSL: Fix erroneous GSM48_IE_CHANDESC_2 in rsl_chan_activate_lchan()Dieter Spaar1-1/+1
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-06-26move gsm 05.02 related calculations into libosmocoreHarald Welte1-23/+0
2011-06-26use new gsm48_number_of_paging_subchannels from libosmocoreHarald Welte1-14/+0
2011-06-25move {ts,lchan}2chan_nr() functions to gsm_data_shared.cHarald Welte1-54/+15
... this way osmo-bts can use them