aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/chan_alloc.h
AgeCommit message (Collapse)AuthorFilesLines
2016-09-28Revert "bts: extend bts_chan_load to allow counting tch only"Neels Hofmeyr1-1/+1
This reverts commit 308cb0719dca3ba8eed1eff2a2124d44f34d9a28. Problems in this commit: openbsc/src/libbsc/chan_alloc.c:523: case GSM_PCHAN_TCH_F_PDCH: This is actually wrong, GSM_PCHAN_TCH_F_PDCH use ts->flags, not ts->dyn below (due to historical reasons and could be unified). 560: if (only_count_tch && !chan_is_tch(ts)) This has exactly one effect: it excludes GSM_PCHAN_TCH_F_PDCH when in PDCH mode, because for all other PDCH (plain PDCH and TCH/F_TCH/H_PDCH in PDCH mode) below ts_subslots() returns 0 and skips the for() loop. I consider this a bug in TCH/F_PDCH, to be fixed in an upcoming commit. I don't see why we need the only_count_tch argument, because this should normally only count TCH, weren't it for the TCH/F_PDCH bug. If dyn TS should be counted differently, we should do this in a different way. Change-Id: I34dbbaf53a800115e3d03bd44028cad675f3b525
2016-09-23bts: extend bts_chan_load to allow counting tch onlyAlexander Couzens1-1/+1
Change-Id: I86f1d502649747b6b9aefcb39081b14110e8f494
2016-08-27move ts_sublots() to gsm_data_shared.c, it will be used by osmo-btsNeels Hofmeyr1-2/+0
Change-Id: I8ba06d7dd6e0ceab3d8d18bb565354d6ed461f7e
2016-07-28dyn TS: implement pchan switchover logicNeels Hofmeyr1-0/+2
In struct gsm_lchan, add dyn.rqd_ref and dyn.rqd_ta. These save the Channel Requested details across the PDCH deactivation dance. abis_rsl.c: add static functions: * dyn_ts_switchover*() for the various stages of switchover between pchans. * pchan_for_lchant() to derive the desired pchan from the lchan type that was set during lchan_alloc(). * rsl_chan_activate_lchan_as_pdch() to compose the simpler RSL CHAN ACT message without introducing numerous special cases to the normal RSL CHAN ACT code. In rsl_chan_activate_lchan(), detect and initiate required pchan switchovers if requested pchan on a dyn TS differs. In rsl_rx_rf_chan_rel_ack(), initiate or continue pchan switchovers after a channel was released. In rsl_rx_chan_act_ack(), notice that a switchover is complete. In chan_alloc.c, add ts_subslots(): abis_rsl.c will need to know the number of subslots per pchan, to verify that all lchans are free before dyn TS switchover. The subslots_per_pchan[] array is static to lchan_alloc.c, and since we need a non-trivial check for dyn TS anyway, add public ts_subslots() to lchan_alloc.c, which also checks the current dyn pchan type. Change-Id: I5c6bce13092a10204113d84678c587c65e35e4fd
2015-01-01chan_alloc: remove ts_alloc() and ts_free()Harald Welte1-11/+0
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.
2014-12-30libbsc/chan_alloc: Fix size of pchan to hold the +CBCH channels as wellDaniel Willmann1-1/+1
show net with an CCCH+SDCCH/4+CBCH channel active caused bts_chan_load to read from invalid memory. Fix this by making sure the pchan array is large enough. ==30346==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff9bdc5dc8 at pc 0x5aeece bp 0x7fff9bdc5350 sp 0x7fff9bdc5348 READ of size 4 at 0x7fff9bdc5dc8 thread T0 #0 0x5aeecd in bts_chan_load /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/chan_alloc.c:490 #1 0x5af706 in network_chan_load /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/chan_alloc.c:511 #2 0x4b7410 in net_dump_vty /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bsc_vty.c:208 #3 0x4b5f23 in show_net /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bsc_vty.c:227 #4 0x7fdabaa425bd in cmd_execute_command_real /home/alphaone/scm/osmo/libosmocore/src/vty/command.c:2042 #5 0x7fdabaa3f124 in cmd_execute_command /home/alphaone/scm/osmo/libosmocore/src/vty/command.c:2077 #6 0x7fdabaa850e9 in vty_command /home/alphaone/scm/osmo/libosmocore/src/vty/vty.c:402 #7 0x7fdabaa75962 in vty_execute /home/alphaone/scm/osmo/libosmocore/src/vty/vty.c:666 #8 0x7fdabaa6d947 in vty_read /home/alphaone/scm/osmo/libosmocore/src/vty/vty.c:1408 #9 0x7fdabaa9165f in client_data /home/alphaone/scm/osmo/libosmocore/src/vty/telnet_interface.c:119 #10 0x7fdaba7860b6 in osmo_select_main /home/alphaone/scm/osmo/libosmocore/src/select.c:160 #11 0x43c656 in main /home/alphaone/scm/osmo/openbsc/openbsc/src/osmo-nitb/bsc_hack.c:355 #12 0x7fdab92604bc (/lib64/libc.so.6+0x224bc) #13 0x43b6cc (/home/alphaone/local/osmo-asan/bin/osmo-nitb+0x43b6cc) Address 0x7fff9bdc5dc8 is located in stack of thread T0 at offset 232 in frame #0 0x4b5faf in net_dump_vty /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/bsc_vty.c:182 This frame has 3 object(s): [32, 40) '' [96, 104) '' [160, 224) 'pl' HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /home/alphaone/scm/osmo/openbsc/openbsc/src/libbsc/chan_alloc.c:490 bts_chan_load
2012-12-23rsl: Rename the reason to release_mode and use the enum valueHolger Hans Peter Freyther1-1/+1
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-1/+1
Call the channel by the right name.
2012-01-15lchan: Rename release_reason to release_modeHolger Hans Peter Freyther1-1/+1
Use the name of GSM 08.58 for the release mode.
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-6/+5
The reason for this is quite simple: We want to make sure anyone running a customized version of OpenBSC to operate a network will have to release all custom modifiations to the source code.
2010-12-22misc: Remove gsm_subscriber.h include to reduce dependencies.Holger Hans Peter Freyther1-1/+1
2010-09-06[alloc] Assign a TCH for LU when all SDCCHs are occupied.Holger Hans Peter Freyther1-1/+1
When the cell becomes visible we will be bombed with location updating requests and to reduce the load on the network we should assign as many channels for it as possible. During load peek it is even more important than to have a spare voice channel and in general the LU procedure is pretty fast.
2010-06-28bsc_msc: Remove use_count from the subscriber connectionHolger Hans Peter Freyther1-2/+2
A channel will be released in case of * Errors via the clear_request callback... * no more transactions and operations are going on. This means that if we do something without a transaction the channel might be closed down right away. The bug fix will be to create a transaction/operation.
2010-06-16bsc_api: Rename lchan_for_subscr to connection_for_subscr and update codeHolger Hans Peter Freyther1-1/+3
With handover and late/early assignment there might be two channels for one subscriber and only the BSC knows which one to use, so use the gsm_subscriber_connection everywhere...
2010-06-16chan_alloc: Make the lchan_find(bts,subscr) private/internal..Holger Hans Peter Freyther1-3/+0
2010-04-15[bsc_init] When the RSL/OML connection drops, free all lchansHolger Hans Peter Freyther1-0/+1
Free all allocated channels on the TRX that failed, go through lchan_free to signal higher layers and then force a reset of the channel. Make the TRX and TS unusable by setting the operational set to 0 (not really defined) which should be reset once the RSL is coming up again.
2009-12-29export the 'trx_is_usable() function and use it from pagingHarald Welte (local)1-0/+2
this ensures we don't send paging requests to currently inactive transceivers.
2009-12-22Display current channel usage load in 'show bts' and 'show network'Harald Welte1-0/+12
This is just the load at one given instant. We definitely also want to see some averages and record the measurements in a database later.
2009-08-09move search for existing lchan for subscriber to new functionHarald Welte1-0/+3
There's now a new function called 'lchan_for_subscr()' which can be used to determine if there is any existing lchan for this subscriber.
2009-06-10move openbsc into its own subdirectoryHarald Welte1-0/+49