Fixed Paging RR on PACCH

Addition to 2b91464862
This commit is contained in:
Andreas Eversberg 2012-07-20 11:19:59 +02:00
parent 2b91464862
commit 3b7461c1b3
3 changed files with 34 additions and 20 deletions

View File

@ -965,7 +965,8 @@ int gprs_rlcmac_add_paging(uint8_t chan_needed, uint8_t *identity_lv)
uint8_t slot_mask[8]; uint8_t slot_mask[8];
int8_t first_ts; /* must be signed */ int8_t first_ts; /* must be signed */
LOGP(DRLCMAC, LOGL_INFO, "Add CS paging\n"); 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 /* collect slots to page
* Mark slots for every TBF, but only mark one of it. * Mark slots for every TBF, but only mark one of it.
@ -991,7 +992,7 @@ int gprs_rlcmac_add_paging(uint8_t chan_needed, uint8_t *identity_lv)
"TRX=%d TS=%d, so we mark\n", "TRX=%d TS=%d, so we mark\n",
(tbf->direction == GPRS_RLCMAC_UL_TBF) (tbf->direction == GPRS_RLCMAC_UL_TBF)
? "UL" : "DL", ? "UL" : "DL",
tbf->tfi, tbf->trx, ts); tbf->tfi, tbf->trx, first_ts);
slot_mask[tbf->trx] |= (1 << first_ts); slot_mask[tbf->trx] |= (1 << first_ts);
} else } else
LOGP(DRLCMAC, LOGL_DEBUG, "- %s TBF=%d uses " LOGP(DRLCMAC, LOGL_DEBUG, "- %s TBF=%d uses "
@ -1022,15 +1023,14 @@ int gprs_rlcmac_add_paging(uint8_t chan_needed, uint8_t *identity_lv)
identity_lv[0] + 1); identity_lv[0] + 1);
llist_add(&pag->list, llist_add(&pag->list,
&bts->trx[trx].pdch[ts].paging_list); &bts->trx[trx].pdch[ts].paging_list);
LOGP(DRLCMAC, LOGL_INFO, "Paging on TRX=%d" LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of "
"TS=%d\n", trx, ts); "TRX=%d TS=%d\n", trx, ts);
} }
} }
} }
if (!any_tbf) { if (!any_tbf)
LOGP(DRLCMAC, LOGL_INFO, "No paging, because no TBF\n"); LOGP(DRLCMAC, LOGL_INFO, "No paging, because no TBF\n");
}
return 0; return 0;
} }
@ -1040,6 +1040,8 @@ struct gprs_rlcmac_paging *gprs_rlcmac_dequeue_paging(
{ {
struct gprs_rlcmac_paging *pag; struct gprs_rlcmac_paging *pag;
if (llist_empty(&pdch->paging_list))
return NULL;
pag = llist_entry(pdch->paging_list.next, pag = llist_entry(pdch->paging_list.next,
struct gprs_rlcmac_paging, list); struct gprs_rlcmac_paging, list);
llist_del(&pag->list); llist_del(&pag->list);
@ -1079,7 +1081,7 @@ struct msgb *gprs_rlcmac_send_packet_paging_request(
/* TMSI */ /* TMSI */
LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n",
ntohl(*((uint32_t *)(pag->identity_lv + 1)))); ntohl(*((uint32_t *)(pag->identity_lv + 1))));
len = 1 + 1 + 32 + 2 + 1; len = 1 + 1 + 1 + 32 + 2 + 1;
if (pag->identity_lv[0] != 5) { if (pag->identity_lv[0] != 5) {
LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with "
"MI != 5 octets!\n"); "MI != 5 octets!\n");
@ -1090,7 +1092,7 @@ struct msgb *gprs_rlcmac_send_packet_paging_request(
LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n",
osmo_hexdump(pag->identity_lv + 1, osmo_hexdump(pag->identity_lv + 1,
pag->identity_lv[0])); pag->identity_lv[0]));
len = 1 + 1 + 4 + (pag->identity_lv[0] << 3) + 2 + 1; len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1;
if (pag->identity_lv[0] > 8) { if (pag->identity_lv[0] > 8) {
LOGP(DRLCMAC, LOGL_ERROR, "Paging with " LOGP(DRLCMAC, LOGL_ERROR, "Paging with "
"MI > 8 octets!\n"); "MI > 8 octets!\n");
@ -1428,6 +1430,8 @@ unsigned write_packet_paging_request(bitvec * dest)
bitvec_write_field(dest, wp,0x0,3); // Uplink state flag bitvec_write_field(dest, wp,0x0,3); // Uplink state flag
bitvec_write_field(dest, wp,0x22,6); // MESSAGE TYPE bitvec_write_field(dest, wp,0x22,6); // MESSAGE TYPE
bitvec_write_field(dest, wp,0x0,2); // Page Mode
bitvec_write_field(dest, wp,0x0,1); // No PERSISTENCE_LEVEL bitvec_write_field(dest, wp,0x0,1); // No PERSISTENCE_LEVEL
bitvec_write_field(dest, wp,0x0,1); // No NLN bitvec_write_field(dest, wp,0x0,1); // No NLN
@ -1437,6 +1441,8 @@ unsigned write_packet_paging_request(bitvec * dest)
unsigned write_repeated_page_info(bitvec * dest, unsigned& wp, uint8_t len, unsigned write_repeated_page_info(bitvec * dest, unsigned& wp, uint8_t len,
uint8_t *identity, uint8_t chan_needed) uint8_t *identity, uint8_t chan_needed)
{ {
bitvec_write_field(dest, wp,0x1,1); // Repeated Page info exists
bitvec_write_field(dest, wp,0x1,1); // RR connection paging bitvec_write_field(dest, wp,0x1,1); // RR connection paging
if ((identity[0] & 0x07) == 4) { if ((identity[0] & 0x07) == 4) {

View File

@ -143,16 +143,20 @@ int gprs_rlcmac_rcv_rts_block(uint8_t trx, uint8_t ts, uint16_t arfcn,
tbf = ul_ack_tbf; tbf = ul_ack_tbf;
msg = gprs_rlcmac_send_uplink_ack(tbf, fn); msg = gprs_rlcmac_send_uplink_ack(tbf, fn);
} }
/* schedule PACKET PAGING REQUEST */
if (!msg && !llist_empty(&pdch->paging_list)) {
msg = gprs_rlcmac_send_packet_paging_request(pdch);
}
if (msg) { if (msg) {
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling control " LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling control "
"message at RTS for %s TBF=%d (TRX=%d, TS=%d)\n", "message at RTS for %s TBF=%d (TRX=%d, TS=%d)\n",
(tbf->direction == GPRS_RLCMAC_UL_TBF) (tbf->direction == GPRS_RLCMAC_UL_TBF)
? "UL" : "DL", tbf->tfi, trx, ts); ? "UL" : "DL", tbf->tfi, trx, ts);
} }
/* schedule PACKET PAGING REQUEST */
if (!msg && !llist_empty(&pdch->paging_list)) {
msg = gprs_rlcmac_send_packet_paging_request(pdch);
if (msg)
LOGP(DRLCMACSCHED, LOGL_DEBUG, "Scheduling paging "
"request message at RTS for (TRX=%d, TS=%d)\n",
trx, ts);
}
/* Prio 2: select data message for downlink */ /* Prio 2: select data message for downlink */
if (!msg) { if (!msg) {

View File

@ -292,8 +292,10 @@ bssgp_failed:
/* free all TBF */ /* free all TBF */
for (trx = 0; trx < 8; trx++) { for (trx = 0; trx < 8; trx++) {
bts->trx[trx].arfcn = info_ind->trx[trx].arfcn; bts->trx[trx].arfcn = info_ind->trx[trx].arfcn;
for (ts = 0; ts < 8; ts++) for (ts = 0; ts < 8; ts++) {
flush_pdch(&bts->trx[trx].pdch[ts]); if (bts->trx[trx].pdch[ts].enable)
flush_pdch(&bts->trx[trx].pdch[ts]);
}
} }
gprs_bssgp_destroy(); gprs_bssgp_destroy();
return 0; return 0;
@ -383,18 +385,20 @@ bssgp_failed:
pdch = &bts->trx[trx].pdch[ts]; pdch = &bts->trx[trx].pdch[ts];
if ((info_ind->trx[trx].pdch_mask & (1 << ts))) { if ((info_ind->trx[trx].pdch_mask & (1 << ts))) {
/* FIXME: activate dynamically at RLCMAC */ /* FIXME: activate dynamically at RLCMAC */
if (!pdch->enable) if (!pdch->enable) {
pcu_tx_act_req(trx, ts, 1); pcu_tx_act_req(trx, ts, 1);
pdch->enable = 1; INIT_LLIST_HEAD(&pdch->paging_list);
pdch->enable = 1;
}
pdch->tsc = info_ind->trx[trx].tsc[ts]; pdch->tsc = info_ind->trx[trx].tsc[ts];
INIT_LLIST_HEAD(&pdch->paging_list);
LOGP(DL1IF, LOGL_INFO, "PDCH: trx=%d ts=%d\n", LOGP(DL1IF, LOGL_INFO, "PDCH: trx=%d ts=%d\n",
trx, ts); trx, ts);
} else { } else {
if (pdch->enable) if (pdch->enable) {
pcu_tx_act_req(trx, ts, 0); pcu_tx_act_req(trx, ts, 0);
pdch->enable = 0; pdch->enable = 0;
flush_pdch(pdch); flush_pdch(pdch);
}
} }
} }
} }