aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/chan_alloc.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-12chan: After sending the GSM04.08 RR Release, reset the subscriber and waitHolger Hans Peter Freyther1-0/+5
After we send the SACH DEACTIVATE the BTS will get back to us with a Release Indication which will trigger the RF Channel Release handling. This is why we can return here, but we need to put the subscriber reference to make sure to not end in a infinite loop. This and the previous change fix the USSD issue for me.
2010-04-19Merge remote branch 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-0/+1
Conflicts: openbsc/include/openbsc/abis_rsl.h openbsc/include/openbsc/mgcp.h openbsc/src/abis_rsl.c openbsc/src/chan_alloc.c openbsc/src/handover_logic.c openbsc/src/mgcp/mgcp_network.c openbsc/src/vty/command.c openbsc/src/vty_interface.c
2010-04-19[alloc] Assign a TCH for LU when all SDCCHs are occupied.Holger Hans Peter Freyther1-1/+15
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-04-15[bsc_init] When the RSL/OML connection drops, free all lchansHolger Hans Peter Freyther1-0/+14
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.
2010-04-11[bsc_init] When the RSL/OML connection drops, free all lchanHolger Hans Peter Freyther1-0/+15
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).
2010-04-10[rsl] Set the release state from within the lchan classHolger Hans Peter Freyther1-0/+1
Currently our GSM04.11 code is closing the link for SAPI=3 and this would mean that the whole channel would be scheduled for close... where we only want to close everything when freeing the lchan or handling an error.
2010-04-09[rsl] Rework the lchan channel release procedureHolger Hans Peter Freyther1-5/+55
1.) free every SAPI from 1-7 and wait for the confirmation and then continue until all of them are freed. If the SAPI is not torn down we will receive a timeout and then we force the RF Channel Release... 2.) once SAPI is down we send the RR Release, SACCH Deact 3.) the abis_rsl will see that all SAPIs are down and then will release channel...
2010-04-09[rsl] Set the release state from within the lchan classHolger Hans Peter Freyther1-0/+1
Currently our GSM04.11 code is closing the link for SAPI=3 and this would mean that the whole channel would be scheduled for close... where we only want to close everything when freeing the lchan or handling an error.
2010-04-06Merge remote branch 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-16/+39
* Move to the new log code and update binaries * Catch up with lchan changes from master Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/src/Makefile.am openbsc/src/bsc_rll.c openbsc/src/chan_alloc.c openbsc/src/debug.c openbsc/src/gsm_04_08.c openbsc/src/gsm_04_11.c openbsc/src/gsm_subscriber_base.c openbsc/src/handover_logic.c openbsc/src/silent_call.c openbsc/src/transaction.c openbsc/src/vty_interface.c openbsc/src/vty_interface_cmds.c
2010-03-29[misc] Remove whitespace from the end of the line.Holger Hans Peter Freyther1-1/+1
2010-03-28chan_alloc: Support allocating TCH/F of a dynamic TCH/F + PDCHHarald Welte1-1/+21
This code simply enables the channel allocator to understand the dynamic TCH/F / PDCH channel type as used by ip.access nanoBTS. It does not actually try to switch the dynamic mode, but instead sends signals to a (not yet present) dynamic switching algorithm.
2010-03-25Store the GSM BTS in the gsm subscriber connectionHolger Hans Peter Freyther1-0/+1
Remove further usage of lchan from the gsm 04.11 bits
2010-03-25lchan: Create a structure for MSC data of the lchanHolger Hans Peter Freyther1-17/+21
Prepare to split the BSC and the MSC part by putting the MSC data for a connection into a "gsm_subscriber_connection" struct and renaming the macros.
2010-03-24Specify a release reason for the lchanHolger Hans Peter Freyther1-2/+2
In case the put_lchan is making the refcount drop to zero use the release reason specified in the put_lchan call. This is used by the BSC MSC IP implementation for the assignment handling where the old channel is getting closed with a local end release (1).
2010-03-24Merge remote branch 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-2/+89
* Move to libosmocore * Move to new debugging architecture * Register the BTS types * Has only been compile tested Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/include/openbsc/ipaccess.h openbsc/include/openbsc/mgcp.h openbsc/include/openbsc/msgb.h openbsc/include/openbsc/tlv.h openbsc/src/Makefile.am openbsc/src/abis_rsl.c openbsc/src/bsc_init.c openbsc/src/bsc_mgcp.c openbsc/src/chan_alloc.c openbsc/src/debug.c openbsc/src/gsm_subscriber_base.c openbsc/src/msgb.c openbsc/src/rest_octets.c openbsc/src/sccp/sccp.c openbsc/src/vty/command.c openbsc/src/vty_interface.c openbsc/tests/Makefile.am
2010-01-03print full lchan name when recycling itHarald Welte (local)1-1/+1
2010-01-03abis_nm: Introduce & use a nm_is_running function to test gsm_nm_stateSylvain Munaut1-9/+6
This returns true if the gsm_nm_state can be considered 'running'. Note that we also accept availability==0xff (which is a code for no value) because according to 12.21 it is perfectly valid. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-01-01keep 'silent call' state in struct lchanHarald Welte1-0/+2
This enables us to reliably detect if a lchan is part of a silent call or not.
2009-12-29export the 'trx_is_usable() function and use it from pagingHarald Welte (local)1-1/+1
this ensures we don't send paging requests to currently inactive transceivers.
2009-12-28Introduce new ACT_REQ state to prevent race condition during channel allocationHarald Welte (local)1-1/+2
When we allocate a channel, we send the RSL CHAN ACT REQ and wait until we get a CHAN ACT ACK. Only the ACK will change the state, so there is a race where we allocate that same channel to a different channel request before we get the ACT ACK. Introducing a new ACT_REQ state resolves this issue.
2009-12-24channel allocator: don't allocate channels of unavalable TRXsHarald Welte1-0/+38
In case we have multiple TRX configured, but not all of them are actually active/operational, we should not try to allocate channels from such transceivers.
2009-12-22Display current channel usage load in 'show bts' and 'show network'Harald Welte1-0/+49
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-12-22Merge commit 'origin/master' into on-waves/bsc-masterHolger Hans Peter Freyther1-5/+22
Conflicts: openbsc/include/openbsc/Makefile.am openbsc/include/openbsc/gsm_data.h openbsc/src/Makefile.am openbsc/src/abis_rsl.c openbsc/src/chan_alloc.c openbsc/src/gsm_04_08.c openbsc/src/gsm_data.c openbsc/src/vty_interface.c The biggest problem is the moving of the RTP code into the RSL layer. This may break quite some things...
2009-12-21[handover] Real handover algorithmHarald Welte1-0/+2
This implements the handover algorithm (and associated parameters) as described in Chapter 8 of the book "Performance Enhancements in a Frequency |Hopping GSM Network" by Thomas Toftegard Nielsen and Jeroen Wigard. The parameters such as averaging windows are configured in struct gsm_network. We keep some state to trakc up to 10 neighbors as they are being reported from the MS. This has so far only been tested in a network with two BTS that have each other as neighbor. Networks with morge neighbors might encounter bugs.
2009-12-21chan_alloc: Delete T3101 on lchan_free as wellSylvain Munaut1-0/+1
If a RF channel is assigned but no response is ever heard from the phone, we will receive a CONNECTION FAIL from the BTS, triggering a RF release freeing the channel. Then sometime later, T3101 will expire as well and free the channel again ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-17logging: introduce log levels at caller siteHarald Welte1-4/+4
This introduces a new LOGP() macro together with LOGL_* definition to support multiple log levels (severities) throughout the codebase. Please note that the actual logging system does not use them yet, in this patch we simply introduce the new macros at the caller site.
2009-12-15introduce cache of 6 last recently received measurement reports for each lchanHarald Welte1-0/+9
2009-12-12make speech calls with NECI=1 workHarald Welte1-1/+3
Fix minor bug with speech calls in case of NECI=1
2009-12-12If we're trying to allocate TCH/H but don't have it, fallback to TCH/FHarald Welte1-0/+3
The rationale is as following: If we have NECI=1, then the phone will request a channel with CHREQ "0100xxxx Originating speech call from dual-rate mobile station when TCH/H is sufficient and supported by the MS for speech calls", then we will try to allocate a TCH/H [as it is sufficient]. However, if there are no free TCH/H slots on the BTS, we abandon and can't handle the MO call at all :(
2009-11-20[lchan] Release the channel ones its' usecount drops to zeroHolger Hans Peter Freyther1-21/+6
Remove the timer handling from the LCHAN and release the channel ones the use count is dropping to zero. Change code that was sending/using the lchan after the release and change the send data method to warn in case the lchan is used after it has been freed.
2009-11-20[bsc_msc_ip] This is a BSC that connects to real MSC via IPHolger Hans Peter Freyther1-0/+3
This is a BSC to be used by on-waves.com to connect to a real MSC using SCCP over IP. The following messages and features are currently implemented: - IPA identity ack's - COMPLETE LAYER3 INFORMATION - DTAP - PAGING COMMAND - CLEAR COMPLETE/CLEAR REQUEST - CIPHER MODE COMMAND/ REJECT /COMPLETE It comes with a tool to create the enum's from the spec and a very simple test server to do the handshaking.
2009-11-19[lchan] RSL and RR need the multirate config, place it in the lchanHolger Hans Peter Freyther1-0/+3
Both GSM 04.08 RR and GSM 08.58 RSL need the multirate config in the channel modify. Place the config in the lchan, change the gsm48 methods to not take the argument, change the RSL implementation to make use of it with the right IE. The other code should use the t(l)v_put routines as well but were left untouched for now.
2009-11-19[lchan] Fix the SAPI reset in the chan allocation...Holger Hans Peter Freyther1-1/+1
Reset the whole array instead of just the first element.
2009-10-29[lchan] Keep track which SAPIs has been established with the BTSHolger Hans Peter Freyther1-0/+3
Keep track of which SAPIs have been established either by the BTS (from the MS) or by us. This can be used by the on-waves BSC code to figure out if a new request should be made.
2009-10-27misc: Use NULL instead of integer value for a NULL pointerHolger Hans Peter Freyther1-2/+2
2009-08-10when channel allocator operates in reverse order, prefer SDCCH/8 over SDCCH/4Harald Welte1-2/+11
2009-08-10introduce bts->chan_alloc_reverse flagHarald Welte1-17/+38
The channel allocator can be set in ascending or descending order. Ascnending means we first try to allocate channels on TRX0, then TRX1, etc. Descending means we first try to allocate cahnnels on TRXn, then n-1 down to 0.
2009-08-10use list iteration macros to iterate over list of TRXHarald Welte1-6/+7
2009-08-10move chcomb4pchan to public abis_nm_chcomb4pchan() functionHarald Welte1-10/+1
2009-08-09chane TRX0/TS0 channel combination to not include a CBCHHarald Welte1-5/+5
We don't support CBCH anyway, and using CBCH will reduce the number of uesable SDCCH/4 channels to 3 on TS0
2009-08-09move search for existing lchan for subscriber to new functionHarald Welte1-0/+15
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-08-08start using the RLL RELEASE proceduresHarald Welte1-1/+1
So far, we immediately disable the RF channel without following a proper RLL RELEASE procedure. This patch changes this. If we locally terminate the connection, the channel allocator now triggers a RLL RELEASE REQuest, which is responsed by the MS with a RLL RELEASE CONFirm, based on which we send the RF CHANnel RELease to the BTS. If the MS terminates the connection, we receive a RLL RELEASE INDication, based on which we trigger RF CHANnel RELease to the BTS.
2009-07-29make channel allocator policy multi-TRX awareHarald Welte1-14/+28
For now, we assume that TRX1 (and higher) all have a TCH/F configuration on all of their timeslots
2009-06-26Merge branch 'master' into tallocHarald Welte1-1/+1
2009-06-26fix typosHarald Welte1-1/+1
2009-06-21switch to dynamically allocated BTS and TRX data structuresHarald Welte1-6/+7
This makes it much easier to do run-time configuration using the vty interface.
2009-06-10reworked MNCC codebaseHarald Welte1-2/+2
This is Harald's reworked MNCC base, slowly heading towards integration into master. The key changes are: * provide much more structure to the data in gsm_mncc * encode_* and decode_* functions now take a structure rather than tons of individual arguments (whose order nobody can remember) * make sure we don't have copies of the same code everywhere by introducing mncc_set_cause() and mncc_release_ind() * save horizontal screen space if possible * make sure we break lines > 80 characters
2009-06-10move openbsc into its own subdirectoryHarald Welte1-0/+256