aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-19 19:41:26 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-19 19:41:26 +0800
commit1506f8e46558b1f40aef942f67d2a6cbcda00b7b (patch)
treebd498f0f485b8d4061eb4e55c98ae21c54b2af42 /openbsc
parentf044c585e2b07479de3aed3a448c6402b89db01c (diff)
[paging] When we ran down to 0 available paging slots start a credit timer
It might be that we run down to zero available slots but the BTS might not send us a load indication. This can happen if we think we send paging requests and the BTS disagrees and considers them as errors and does not count the paging message. When we drop to zero we will start a credit timer to give us extra credit after six seconds, if we get a CCCH load indication before we will stop the timer.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_data.h1
-rw-r--r--openbsc/src/paging.c26
2 files changed, 18 insertions, 9 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index b58265fbf..5937cfdd4 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -406,6 +406,7 @@ struct gsm_bts_paging_state {
struct gsm_bts *bts;
struct timer_list work_timer;
+ struct timer_list credit_timer;
/* load */
u_int16_t available_slots;
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index 73fdfbeef..a0cdc55ce 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -96,6 +96,14 @@ static void page_ms(struct gsm_paging_request *request)
request->chan_type);
}
+static void paging_give_credit(void *data)
+{
+ struct gsm_bts_paging_state *paging_bts = data;
+
+ LOGP(DPAG, LOGL_NOTICE, "No slots available on bts nr %d\n", paging_bts->bts->nr);
+ paging_bts->available_slots = 20;
+}
+
/*
* This is kicked by the periodic PAGING LOAD Indicator
* coming from abis_rsl.c
@@ -118,17 +126,16 @@ static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_b
}
/*
- * In case the BTS does not provide us with load indication just fill
- * up our slots for this round. We should be able to page 20 subscribers
- * every two seconds. So we will just give the BTS some extra credit.
- * We will have to see how often we run out of this credit, so we might
- * need a low watermark and then add credit or give 20 every run when
- * the bts sets an option for that.
+ * In case the BTS does not provide us with load indication and we
+ * ran out of slots, call an autofill routine. It might be that the
+ * BTS did not like our paging messages and then we have counted down
+ * to zero and we do not get any messages.
*/
if (paging_bts->available_slots == 0) {
- LOGP(DPAG, LOGL_NOTICE, "No slots available on bts nr %d\n",
- paging_bts->bts->nr);
- paging_bts->available_slots = 20;
+ paging_bts->credit_timer.cb = paging_give_credit;
+ paging_bts->credit_timer.data = paging_bts;
+ bsc_schedule_timer(&paging_bts->credit_timer, 5, 0);
+ return;
}
initial_request = llist_entry(paging_bts->pending_requests.next,
@@ -325,6 +332,7 @@ void paging_request_stop(struct gsm_bts *_bts, struct gsm_subscriber *subscr,
void paging_update_buffer_space(struct gsm_bts *bts, u_int16_t free_slots)
{
+ bsc_del_timer(&bts->paging.credit_timer);
bts->paging.available_slots = free_slots;
}