aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc/chan_alloc.c
AgeCommit message (Collapse)AuthorFilesLines
2016-06-16dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACTNeels Hofmeyr1-0/+7
Do the PDCH DE/ACT before we set the lchan->state to De-/Activation Requested. It makes more sense semantically to change PDCH mode while the lchan is still in NONE status. Thus slightly move some invocations: PDCH ACT: Free the lchan before PDCH activation. Hence remove the lchan_free() call from the rsl_rx_pdch_act_ack() code path; it used to do the PDCH activation first and call lchan_free() in the callback. PDCH DEACT: Set the (TCH) Activation Requested state only within rsl_chan_activate_lchan(), after the PDCH deact is complete. Channel allocator: don't pick channels that have a PDCH PENDING flag set, to avoid using channels that are still in PDCH switchover (despite their state being NONE). The lchan_may_change_pdch() sanity checks are becoming a lot simpler. Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066
2016-06-12dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slotsNeels Hofmeyr1-9/+29
Remove check for dyn PDCH in _lc_find_trx(), instead call _lc_find_trx() via _lc_find_bts() several times, so that pure TCH/F is preferred to TCH/F_PDCH. Add this logic next to the other channel match decisions in chan_alloc(). BTW, the removed check in _lc_find_trx() whether PDCH is active is not necessary, as described in the added comment for lchan_alloc(). Original patch idea by jolly, but split in two and implemented differently by nhofmeyr. Change-Id: I0c728b922656be03588b775638b610a93f8187d5
2016-06-12dyn PDCH: Fix free slot search for chan_alloc_reverse == trueAndreas Eversberg1-2/+14
For chan_alloc_reverse, _lc_find_trx() should return the last free slot instead of the first. Original patch by jolly, but split in two by nhofmeyr. Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd
2016-06-07lchan_alloc(): on alloc failure, report original typeNeels Hofmeyr1-4/+8
In lchan_alloc(), there are several decisions to fall back to another type of channel, followed by setting the channel type to the fall back type. So far, this was set regardless of allocation success or failure. If such fall back type is not available, do not modify the local type variable and thus report an S_CHALLOC_ALLOC_FAIL on the type originally requested (report is at the end of lchan_alloc()). Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a
2015-09-22Add full AMR multirate IE support with VTY config for MS and BTS sideAndreas Eversberg1-2/+2
2015-01-02lchan: Remember why a channel is broken using static stringsHolger Hans Peter Freyther1-0/+2
Remember why a channel is being marked as broken. So we can maybe understand what happend.
2015-01-01chan_alloc: remove ts_alloc() and ts_free()Harald Welte1-106/+1
The idea of ts_alloc()/ts_free() dates back to the very early days of OpenBSC, where we didn't yet have a fixed PCHAN type assigned for every lchan in a BTS. However, ever since, PCHAN types (channel combinations) are configured by OML in a certain way, and we only allocate LCHANs inside PCHANs of a matching type. There should be no PCHANs with type GSM_PCHAN_NONE, unless those that you don't want to use for administraive reasons or the like.
2015-01-01chan_alloc: Fix missing break statementHarald Welte1-0/+1
Fixes: Coverity CID 1261354
2015-01-01chan_alloc.c: Don't remove SDCCH/8 without CBCHHarald Welte1-0/+1
In commit 30f1f376383df3ae8d85e96542bf14d174c25d89 we wanted to add support for SDCCH/8+CBCH, not replace the existing SDCCH/8 with the new CBCH-enabled configuration.
2014-12-30Add basic support for CBCH / SMS-CB (Cell Brroadcast)Harald Welte1-4/+19
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-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-1/+1
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-05-19chan_alloc: Fall-back to TCH/H, if we cannot find a TCH/FHarald Welte1-0/+5
I'm not entirely sure if this is the best approach. However, there are phones that send a RACH request for TCH/F on MO calls, even though they actually do support TCH/H channels.
2012-12-29libbsc: With the new SAPI states we don't need sacch_deact anymoreDaniel Willmann1-1/+0
2012-12-26gsm: Do not attempt to release SAPI=0 if it was never allocatedHolger Hans Peter Freyther1-0/+2
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-3/+9
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: Release the lchan more quickly, align with GSM 04.08Holger Hans Peter Freyther1-47/+14
* 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-23lchan: Release all higher sapis on the local end.Holger Hans Peter Freyther1-1/+1
According to GSM 04.08 3.4.13.1.1 RR connection release in NOTE 1 one should release all non main signaling links using the local end link release.
2012-12-23rsl: Rename the reason to release_mode and use the enum valueHolger Hans Peter Freyther1-2/+2
The API with 0 and 1 as legal values is hard to understand. Use the recently introduced enum values instead.
2012-04-18lchan: Fix the name of the SACCH in the variable namesHolger Hans Peter Freyther1-4/+4
Call the channel by the right name.
2012-01-17lchan: Close a possible still open RTP SocketHolger Hans Peter Freyther1-0/+12
In case of a reset (loss of the BTS) close down all remaining RTP Proxy sockets. In case of a lchan_free shout if the rtp proxy is still open. I would prefer if the proxy code sits inside the gsm subscriber connection.
2012-01-15lchan: Rename release_reason to release_modeHolger Hans Peter Freyther1-5/+5
Use the name of GSM 08.58 for the release mode.
2012-01-15Revert "libbsc: Log if a channel is freed with lchan->state != LCHAN_S_NONE"Holger Hans Peter Freyther1-4/+0
In case of a failed channel we still want the channel to not be re-allocated right away but keep it closed/unused for (T3109 + T311). rsl_rx_rf_chan_rel_ack has a check to not set the channel to S_NONE in case the channel is in the error state. Add the camp Harald added a timer to set the channel back to the none state in case the RF Channel Release is not acked. This reverts commit fc462dd59ee4772f06c9f2477b36b3f166a8e74b.
2011-08-11libbsc: Log if a channel is freed with lchan->state != LCHAN_S_NONEDaniel Willmann1-0/+4
I'm not sure if that is an abnormal condition or not, but it seems that lchan state and type have to be none for the lchan to be considered idle.
2011-06-03gsm_data_shared: introduce 'struct gsm_abis_mo'Harald Welte1-6/+6
... as a common wrapper around nm_attr and nm_state
2011-05-06src: use namespace prefix osmo_signal*Pablo Neira Ayuso1-3/+3
Summary of changes: s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g
2011-05-06src: use namespace prefix osmo_timer* for timer functionsPablo Neira Ayuso1-4/+4
Summary of changes: s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther1-3/+3
This was done with sed on the files.
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-1/+1
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-0/+507
... and make sure tests work again after restructuring