mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-pcu.git
synced 2025-11-04 14:13:44 +00:00
tbf: Remove the trx_no field from the tbf, go through the trx object
This commit is contained in:
14
src/bts.cpp
14
src/bts.cpp
@@ -159,7 +159,7 @@ int BTS::add_paging(uint8_t chan_needed, uint8_t *identity_lv)
|
||||
if (first_ts < 0)
|
||||
first_ts = ts;
|
||||
/* break, if we already marked a slot */
|
||||
if ((slot_mask[tbf->trx_no] & (1 << ts)))
|
||||
if ((slot_mask[tbf->trx->trx_no] & (1 << ts)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -169,14 +169,14 @@ int BTS::add_paging(uint8_t chan_needed, uint8_t *identity_lv)
|
||||
"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);
|
||||
tbf->tfi, tbf->trx->trx_no, first_ts);
|
||||
slot_mask[tbf->trx->trx_no] |= (1 << first_ts);
|
||||
} else
|
||||
LOGP(DRLCMAC, LOGL_DEBUG, "- %s TFI=%d uses "
|
||||
"already marked TRX=%d TS=%d\n",
|
||||
(tbf->direction == GPRS_RLCMAC_UL_TBF)
|
||||
? "UL" : "DL",
|
||||
tbf->tfi, tbf->trx_no, ts);
|
||||
tbf->tfi, tbf->trx->trx_no, ts);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,14 +240,14 @@ gprs_rlcmac_tbf *BTS::tbf_by_poll_fn(uint32_t fn, uint8_t trx, uint8_t ts)
|
||||
llist_for_each_entry(tbf, &m_bts.ul_tbfs, list) {
|
||||
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
|
||||
&& tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
||||
&& tbf->poll_fn == fn && tbf->trx_no == trx
|
||||
&& tbf->poll_fn == fn && tbf->trx->trx_no == trx
|
||||
&& tbf->control_ts == ts)
|
||||
return tbf;
|
||||
}
|
||||
llist_for_each_entry(tbf, &m_bts.dl_tbfs, list) {
|
||||
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
|
||||
&& tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
||||
&& tbf->poll_fn == fn && tbf->trx_no == trx
|
||||
&& tbf->poll_fn == fn && tbf->trx->trx_no == trx
|
||||
&& tbf->control_ts == ts)
|
||||
return tbf;
|
||||
}
|
||||
@@ -1005,7 +1005,7 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
|
||||
if (ack_nack->Exist_Channel_Request_Description) {
|
||||
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack "
|
||||
"message, so we provide one:\n");
|
||||
tbf_alloc_ul(bts_data(), tbf->trx_no, tbf->ms_class, tbf->tlli, tbf->ta, tbf);
|
||||
tbf_alloc_ul(bts_data(), tbf->trx->trx_no, tbf->ms_class, tbf->tlli, tbf->ta, tbf);
|
||||
/* schedule uplink assignment */
|
||||
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ static uint32_t sched_poll(struct gprs_rlcmac_bts *bts,
|
||||
poll_fn = poll_fn % 2715648;
|
||||
llist_for_each_entry(tbf, &bts->ul_tbfs, list) {
|
||||
/* this trx, this ts */
|
||||
if (tbf->trx_no != trx || tbf->control_ts != ts)
|
||||
if (tbf->trx->trx_no != trx || tbf->control_ts != ts)
|
||||
continue;
|
||||
/* polling for next uplink block */
|
||||
if (tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
||||
@@ -56,7 +56,7 @@ static uint32_t sched_poll(struct gprs_rlcmac_bts *bts,
|
||||
}
|
||||
llist_for_each_entry(tbf, &bts->dl_tbfs, list) {
|
||||
/* this trx, this ts */
|
||||
if (tbf->trx_no != trx || tbf->control_ts != ts)
|
||||
if (tbf->trx->trx_no != trx || tbf->control_ts != ts)
|
||||
continue;
|
||||
/* polling for next uplink block */
|
||||
if (tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
||||
|
||||
@@ -280,7 +280,7 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
|
||||
"because it has different TSC than lower TS "
|
||||
"of TRX. In order to allow multislot, all "
|
||||
"slots must be configured with the same "
|
||||
"TSC!\n", ts, tbf->trx_no);
|
||||
"TSC!\n", ts, tbf->trx->trx_no);
|
||||
/* increase window for Type 1 */
|
||||
if (Type == 1 && rx_window)
|
||||
i++;
|
||||
@@ -434,7 +434,7 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
|
||||
"than lower TS of TRX. In order to "
|
||||
"allow multislot, all slots must be "
|
||||
"configured with the same TSC!\n",
|
||||
ts, tbf->trx_no);
|
||||
ts, tbf->trx->trx_no);
|
||||
/* increase window for Type 1 */
|
||||
if (Type == 1)
|
||||
i++;
|
||||
|
||||
11
src/tbf.cpp
11
src/tbf.cpp
@@ -156,7 +156,7 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
|
||||
tbf = bts->bts->tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF);
|
||||
if (tbf && tbf->dir.ul.contention_resolution_done
|
||||
&& !tbf->dir.ul.final_ack_sent) {
|
||||
use_trx = tbf->trx_no;
|
||||
use_trx = tbf->trx->trx_no;
|
||||
ta = tbf->ta;
|
||||
ss = 0;
|
||||
old_tbf = tbf;
|
||||
@@ -581,7 +581,6 @@ next_diagram:
|
||||
#endif
|
||||
tbf->direction = dir;
|
||||
tbf->tfi = tfi;
|
||||
tbf->trx_no = trx;
|
||||
tbf->trx = &bts->trx[trx];
|
||||
tbf->ms_class = ms_class;
|
||||
tbf->ws = 64;
|
||||
@@ -1184,7 +1183,7 @@ tx_block:
|
||||
LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
|
||||
"sheduled in this TS %d, waiting for "
|
||||
"TS %d\n", ts, control_ts);
|
||||
else if (bts->sba()->find(trx_no, ts, (fn + 13) % 2715648))
|
||||
else if (bts->sba()->find(trx->trx_no, ts, (fn + 13) % 2715648))
|
||||
LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
|
||||
"sheduled, because single block alllocation "
|
||||
"already exists\n");
|
||||
@@ -1250,7 +1249,7 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn)
|
||||
"assignment...\n", tfi);
|
||||
return NULL;
|
||||
}
|
||||
if (bts->sba()->find(trx_no, control_ts, (fn + 13) % 2715648)) {
|
||||
if (bts->sba()->find(trx->trx_no, control_ts, (fn + 13) % 2715648)) {
|
||||
LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
|
||||
"scheduled for single block allocation...\n");
|
||||
return NULL;
|
||||
@@ -1331,7 +1330,7 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn)
|
||||
"assignment...\n", tfi);
|
||||
return NULL;
|
||||
}
|
||||
if (bts->sba()->find(trx_no, control_ts, (fn + 13) % 2715648)) {
|
||||
if (bts->sba()->find(trx->trx_no, control_ts, (fn + 13) % 2715648)) {
|
||||
LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already scheduled for "
|
||||
"single block allocation...\n");
|
||||
return NULL;
|
||||
@@ -1403,7 +1402,7 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ack(uint32_t fn)
|
||||
"final uplink ack...\n", tfi);
|
||||
return NULL;
|
||||
}
|
||||
if (bts->sba()->find(trx_no, control_ts, (fn + 13) % 2715648)) {
|
||||
if (bts->sba()->find(trx->trx_no, control_ts, (fn + 13) % 2715648)) {
|
||||
LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
|
||||
"scheduled for single block allocation...\n");
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user