aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/sysinfo.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-10-12 16:24:32 +0200
committerHarald Welte <laforge@gnumonks.org>2016-12-01 15:25:26 +0000
commit4a8582846281322e8d7dfc577b18767cf35c24d1 (patch)
treeff9cd1499a38e2d87834e65fc505e31aefff9251 /src/common/sysinfo.c
parentb58aa60d785f4400ba6e21752d16ea01ac4c0a1f (diff)
Fix AGCH/PCH proportional allocation
Do not assume that 1 == BS_AG_BLKS_RES but take that information from SI3. Note: due to current implementation quirks we activate channels before SI3 obtained, than we deactivate channels upon receiving SI3 and activate them again. This might not be necessary once we migrate to proper OML state machines. This affects lc15 and sysmo hw. Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Related: OS#1575
Diffstat (limited to 'src/common/sysinfo.c')
-rw-r--r--src/common/sysinfo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index ee42da25..d0a476d3 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -22,6 +22,7 @@
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/sysinfo.h>
+#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
#define BTS_HAS_SI(bts, sinum) ((bts)->si_valid & (1 << sinum))
@@ -132,6 +133,19 @@ uint8_t *bts_sysinfo_get(struct gsm_bts *bts, struct gsm_time *g_time)
return NULL;
}
+uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg)
+{
+ struct gsm_bts *b = trx->bts;
+ struct gsm48_system_information_type_3 *si3;
+ if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) {
+ si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3);
+ return si3->control_channel_desc.bs_ag_blks_res;
+ }
+ LOGP(DL1P, LOGL_ERROR, "%s: Unable to determine actual BS_AG_BLKS_RES "
+ "value as SI3 is not available yet, fallback to 1\n", arg);
+ return 1;
+}
+
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan)
{
uint32_t tmp;