aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-02-21 15:09:15 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-02-22 08:45:56 +0100
commitd290ee029a827c870f97372b98f0dbd7d057402a (patch)
tree98c9e95ef024df0fa842d2325fa53eb559c5680a /src/common
parentd242ec2ed909e58d8f3905b185a1b1e14806f7da (diff)
agch/pch: Put CCCH message generation into common
This patch adds a common function bts_ccch_copy_msg() that provides and schedules AGCH and PCH messages. It is basically a frontend to paging_gen_msg() and bts_agch_dequeue() and contains refactored code from l1_if.c. Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/common')
-rw-r--r--src/common/bts.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 35fc3024..7bbf5870 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -231,6 +231,28 @@ struct msgb *bts_agch_dequeue(struct gsm_bts *bts)
return msg;
}
+int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
+ int is_ag_res)
+{
+ struct msgb *msg;
+ struct gsm_bts_role_bts *btsb = bts->role;
+ int rc;
+
+ if (!is_ag_res)
+ return paging_gen_msg(btsb->paging_state, out_buf, gt);
+
+ /* special queue of messages from IMM ASS CMD */
+ msg = bts_agch_dequeue(bts);
+ if (!msg)
+ return 0;
+
+ memcpy(out_buf, msgb_l3(msg), msgb_l3len(msg));
+ rc = msgb_l3len(msg);
+ msgb_free(msg);
+
+ return rc;
+}
+
int bts_supports_cipher(struct gsm_bts_role_bts *bts, int rsl_cipher)
{
int sup;