aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_rlcmac.cpp
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-19 18:28:59 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:10 +0100
commitf0984897a5fc0a7a75aae48a52c8dc8f59a40867 (patch)
tree56b018a8208cb6d98b75d06793ccf7392bf2fc2f /src/gprs_rlcmac.cpp
parent24e98d039d6f2d60a8db36a8cf034a299e2372f9 (diff)
bts/pdch: Move the adding of paging to the BTS/PDCH objects
Only the gprs_rlcmac_pdch will manipulate the paging list now. There can be various more refactorings of the code but they can be done later. E.g. on memory allocation failure we can continue instead of leaving the code, we should also set any_tbf only after things have been paged.
Diffstat (limited to 'src/gprs_rlcmac.cpp')
-rw-r--r--src/gprs_rlcmac.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp
index cb545066..a3cc6944 100644
--- a/src/gprs_rlcmac.cpp
+++ b/src/gprs_rlcmac.cpp
@@ -37,11 +37,6 @@ struct gprs_rlcmac_cs gprs_rlcmac_cs[] = {
LLIST_HEAD(gprs_rlcmac_ul_tbfs);
LLIST_HEAD(gprs_rlcmac_dl_tbfs);
-llist_head *gprs_rlcmac_tbfs_lists[] = {
- &gprs_rlcmac_ul_tbfs,
- &gprs_rlcmac_dl_tbfs,
- NULL
-};
extern void *tall_pcu_ctx;
#ifdef DEBUG_DIAGRAM
@@ -278,86 +273,6 @@ int gprs_rlcmac_rcv_block(struct gprs_rlcmac_bts *bts,
return rc;
}
-/* add paging to paging queue(s) */
-int gprs_rlcmac_add_paging(struct gprs_rlcmac_bts *bts,
- uint8_t chan_needed, uint8_t *identity_lv)
-{
- uint8_t l, trx, ts, any_tbf = 0;
- struct gprs_rlcmac_tbf *tbf;
- struct gprs_rlcmac_paging *pag;
- uint8_t slot_mask[8];
- int8_t first_ts; /* must be signed */
-
- LOGP(DRLCMAC, LOGL_INFO, "Add RR paging: chan-needed=%d MI=%s\n",
- chan_needed, osmo_hexdump(identity_lv + 1, identity_lv[0]));
-
- /* collect slots to page
- * Mark slots for every TBF, but only mark one of it.
- * Mark only the first slot found.
- * Don't mark, if TBF uses a different slot that is already marked. */
- memset(slot_mask, 0, sizeof(slot_mask));
- for (l = 0; gprs_rlcmac_tbfs_lists[l]; l++) {
- llist_for_each_entry(tbf, gprs_rlcmac_tbfs_lists[l], list) {
- first_ts = -1;
- for (ts = 0; ts < 8; ts++) {
- if (tbf->pdch[ts]) {
- /* remember the first slot found */
- if (first_ts < 0)
- first_ts = ts;
- /* break, if we already marked a slot */
- if ((slot_mask[tbf->trx_no] & (1 << ts)))
- break;
- }
- }
- /* mark first slot found, if none is marked already */
- if (ts == 8 && first_ts >= 0) {
- LOGP(DRLCMAC, LOGL_DEBUG, "- %s TBF=%d uses "
- "TRX=%d TS=%d, so we mark\n",
- (tbf->direction == GPRS_RLCMAC_UL_TBF)
- ? "UL" : "DL",
- tbf->tfi, tbf->trx_no, first_ts);
- slot_mask[tbf->trx_no] |= (1 << first_ts);
- } else
- LOGP(DRLCMAC, LOGL_DEBUG, "- %s TBF=%d uses "
- "already marked TRX=%d TS=%d\n",
- (tbf->direction == GPRS_RLCMAC_UL_TBF)
- ? "UL" : "DL",
- tbf->tfi, tbf->trx_no, ts);
- }
- }
-
- /* Now we have a list of marked slots. Every TBF uses at least one
- * of these slots. */
-
- /* schedule paging to all marked slots */
- for (trx = 0; trx < 8; trx++) {
- if (slot_mask[trx] == 0)
- continue;
- any_tbf = 1;
- for (ts = 0; ts < 8; ts++) {
- if ((slot_mask[trx] & (1 << ts))) {
- /* schedule */
- pag = talloc_zero(tall_pcu_ctx,
- struct gprs_rlcmac_paging);
- if (!pag)
- return -ENOMEM;
- pag->chan_needed = chan_needed;
- memcpy(pag->identity_lv, identity_lv,
- identity_lv[0] + 1);
- llist_add(&pag->list,
- &bts->trx[trx].pdch[ts].paging_list);
- LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of "
- "TRX=%d TS=%d\n", trx, ts);
- }
- }
- }
-
- if (!any_tbf)
- LOGP(DRLCMAC, LOGL_INFO, "No paging, because no TBF\n");
-
- return 0;
-}
-
// GSM 04.08 9.1.18 Immediate assignment
int write_immediate_assignment(
struct gprs_rlcmac_bts *bts,