aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_rlcmac.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-19 18:15:44 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:10 +0100
commit24e98d039d6f2d60a8db36a8cf034a299e2372f9 (patch)
tree8a824df654f4871d502636a235493a6860af66f2 /src/gprs_rlcmac.cpp
parent17b0d83a1f1a153b21b198f101294c8ed9e172ac (diff)
pdch: Move paging dequeue into the PDCH object
Rely on packet_paging_request returning NULL in case the queue is empty. We should move the write_packet_paging_request into a separate file/object as well.
Diffstat (limited to 'src/gprs_rlcmac.cpp')
-rw-r--r--src/gprs_rlcmac.cpp94
1 files changed, 0 insertions, 94 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp
index e83de21f..cb545066 100644
--- a/src/gprs_rlcmac.cpp
+++ b/src/gprs_rlcmac.cpp
@@ -358,100 +358,6 @@ int gprs_rlcmac_add_paging(struct gprs_rlcmac_bts *bts,
return 0;
}
-struct gprs_rlcmac_paging *gprs_rlcmac_dequeue_paging(
- struct gprs_rlcmac_pdch *pdch)
-{
- struct gprs_rlcmac_paging *pag;
-
- if (llist_empty(&pdch->paging_list))
- return NULL;
- pag = llist_entry(pdch->paging_list.next,
- struct gprs_rlcmac_paging, list);
- llist_del(&pag->list);
-
- return pag;
-}
-
-struct msgb *gprs_rlcmac_send_packet_paging_request(
- struct gprs_rlcmac_pdch *pdch)
-{
- struct gprs_rlcmac_paging *pag;
- struct msgb *msg;
- unsigned wp = 0, len;
-
- /* no paging, no message */
- pag = gprs_rlcmac_dequeue_paging(pdch);
- if (!pag)
- return NULL;
-
- LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n");
-
- /* alloc message */
- msg = msgb_alloc(23, "pag ctrl block");
- if (!msg) {
- talloc_free(pag);
- return NULL;
- }
- bitvec *pag_vec = bitvec_alloc(23);
- if (!pag_vec) {
- msgb_free(msg);
- talloc_free(pag);
- return NULL;
- }
- wp = write_packet_paging_request(pag_vec);
-
- /* loop until message is full */
- while (pag) {
- /* try to add paging */
- if ((pag->identity_lv[1] & 0x07) == 4) {
- /* TMSI */
- LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n",
- ntohl(*((uint32_t *)(pag->identity_lv + 1))));
- len = 1 + 1 + 1 + 32 + 2 + 1;
- if (pag->identity_lv[0] != 5) {
- LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with "
- "MI != 5 octets!\n");
- goto continue_next;
- }
- } else {
- /* MI */
- LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n",
- osmo_hexdump(pag->identity_lv + 1,
- pag->identity_lv[0]));
- len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1;
- if (pag->identity_lv[0] > 8) {
- LOGP(DRLCMAC, LOGL_ERROR, "Paging with "
- "MI > 8 octets!\n");
- goto continue_next;
- }
- }
- if (wp + len > 184) {
- LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule "
- "next time\n");
- /* put back paging record, because does not fit */
- llist_add_tail(&pag->list, &pdch->paging_list);
- break;
- }
- write_repeated_page_info(pag_vec, wp, pag->identity_lv[0],
- pag->identity_lv + 1, pag->chan_needed);
-
-continue_next:
- talloc_free(pag);
- pag = gprs_rlcmac_dequeue_paging(pdch);
- }
-
- bitvec_pack(pag_vec, msgb_put(msg, 23));
- RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t);
- LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n");
- decode_gsm_rlcmac_downlink(pag_vec, mac_control_block);
- LOGPC(DCSN1, LOGL_NOTICE, "\n");
- LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n");
- bitvec_free(pag_vec);
- talloc_free(mac_control_block);
-
- return msg;
-}
-
// GSM 04.08 9.1.18 Immediate assignment
int write_immediate_assignment(
struct gprs_rlcmac_bts *bts,