aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-02-14 14:18:51 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-03-10 09:22:24 +0100
commit7503540959f421917a702174616655e9fdd11a24 (patch)
tree5c30c3f0ab2ecb501b0110b5055f8a0feb19745b /src/common
parent2d725e77f7270550d7173a7c86f30aa1c7b01e5e (diff)
agch/pch: Use PCH for AGCH msgs
This patch extends paging_gen_msg() by adding an output parameter is_empty that is true, if only a paging message with dummy entries has been placed into buffer. This feature is then used by bts_ccch_copy_msg() to insert an AGCH message if is_empty is true. Ticket: SYS#224 Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/common')
-rw-r--r--src/common/bts.c15
-rw-r--r--src/common/paging.c5
2 files changed, 16 insertions, 4 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index c587dd53..211bbbfa 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -326,8 +326,13 @@ int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt
struct gsm_bts_role_bts *btsb = bts->role;
int rc;
- if (!is_ag_res)
- return paging_gen_msg(btsb->paging_state, out_buf, gt);
+ if (!is_ag_res) {
+ int is_empty = 1;
+ rc = paging_gen_msg(btsb->paging_state, out_buf, gt, &is_empty);
+
+ if (!is_empty)
+ return rc;
+ }
/* special queue of messages from IMM ASS CMD */
msg = bts_agch_dequeue(bts);
@@ -337,7 +342,11 @@ int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt
memcpy(out_buf, msgb_l3(msg), msgb_l3len(msg));
rc = msgb_l3len(msg);
msgb_free(msg);
- btsb->agch_queue_agch_msgs++;
+
+ if (is_ag_res)
+ btsb->agch_queue_agch_msgs++;
+ else
+ btsb->agch_queue_pch_msgs++;
return rc;
}
diff --git a/src/common/paging.c b/src/common/paging.c
index 7c71c6f8..f75f12dc 100644
--- a/src/common/paging.c
+++ b/src/common/paging.c
@@ -377,12 +377,14 @@ static void sort_pr_tmsi_imsi(struct paging_record *pr[], unsigned int n)
}
/* generate paging message for given gsm time */
-int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *gt)
+int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *gt,
+ int *is_empty)
{
struct llist_head *group_q;
int group;
int len;
+ *is_empty = 0;
ps->btsb->load.ccch.pch_total += 1;
group = get_pag_subch_nr(ps, gt);
@@ -400,6 +402,7 @@ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *g
//DEBUGP(DPAG, "Tx PAGING TYPE 1 (empty)\n");
len = fill_paging_type_1(out_buf, empty_id_lv, 0,
NULL, 0);
+ *is_empty = 1;
} else {
struct paging_record *pr[4];
unsigned int num_pr = 0, imm_ass = 0;