aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/load_indication.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-06-15 11:07:03 +0800
committerHarald Welte <laforge@gnumonks.org>2012-06-15 11:07:03 +0800
commit821bf067e408f649bed62f10683fd44b43c0d673 (patch)
tree1240ff85da82df229f36fc051af7d06d43b905d7 /src/common/load_indication.c
parentc882b85d8c867264a0fe038dfe34bf204f5e3f32 (diff)
RSL: Add CCCH LOAD INDICATION for RACH
We now count the total number of RACH slots, the number with rx level above the busy threshold, and the number of valid access bursts. This data is used to generate RSL CCCH LOAD INDICATION for the RACH.
Diffstat (limited to 'src/common/load_indication.c')
-rw-r--r--src/common/load_indication.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/load_indication.c b/src/common/load_indication.c
index aa2ec9c1..3e6fa740 100644
--- a/src/common/load_indication.c
+++ b/src/common/load_indication.c
@@ -40,7 +40,7 @@ static void load_timer_cb(void *data)
{
struct gsm_bts *bts = data;
struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
- unsigned int pch_percent;
+ unsigned int pch_percent, rach_percent;
/* compute percentages */
pch_percent = (btsb->load.ccch.pch_used * 100) / btsb->load.ccch.pch_total;
@@ -51,6 +51,14 @@ static void load_timer_cb(void *data)
rsl_tx_ccch_load_ind_pch(bts, buffer_space);
}
+ rach_percent = (btsb->load.rach.busy * 100) / btsb->load.rach.total;
+ if (rach_percent >= btsb->load.ccch.load_ind_thresh) {
+ /* send RSL load indication message to BSC */
+ rsl_tx_ccch_load_ind_rach(bts, btsb->load.rach.total,
+ btsb->load.rach.busy,
+ btsb->load.rach.access);
+ }
+
reset_load_counters(bts);
/* re-schedule the timer */