mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-pcu.git
synced 2025-11-04 22:24:00 +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)
|
if (first_ts < 0)
|
||||||
first_ts = ts;
|
first_ts = ts;
|
||||||
/* break, if we already marked a slot */
|
/* 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;
|
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",
|
"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_no, first_ts);
|
tbf->tfi, tbf->trx->trx_no, first_ts);
|
||||||
slot_mask[tbf->trx_no] |= (1 << first_ts);
|
slot_mask[tbf->trx->trx_no] |= (1 << first_ts);
|
||||||
} else
|
} else
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG, "- %s TFI=%d uses "
|
LOGP(DRLCMAC, LOGL_DEBUG, "- %s TFI=%d uses "
|
||||||
"already marked TRX=%d TS=%d\n",
|
"already marked TRX=%d TS=%d\n",
|
||||||
(tbf->direction == GPRS_RLCMAC_UL_TBF)
|
(tbf->direction == GPRS_RLCMAC_UL_TBF)
|
||||||
? "UL" : "DL",
|
? "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) {
|
llist_for_each_entry(tbf, &m_bts.ul_tbfs, list) {
|
||||||
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
|
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
|
||||||
&& tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
&& 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)
|
&& tbf->control_ts == ts)
|
||||||
return tbf;
|
return tbf;
|
||||||
}
|
}
|
||||||
llist_for_each_entry(tbf, &m_bts.dl_tbfs, list) {
|
llist_for_each_entry(tbf, &m_bts.dl_tbfs, list) {
|
||||||
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
|
if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)
|
||||||
&& tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
&& 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)
|
&& tbf->control_ts == ts)
|
||||||
return tbf;
|
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) {
|
if (ack_nack->Exist_Channel_Request_Description) {
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack "
|
LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack "
|
||||||
"message, so we provide one:\n");
|
"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 */
|
/* schedule uplink assignment */
|
||||||
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS;
|
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;
|
poll_fn = poll_fn % 2715648;
|
||||||
llist_for_each_entry(tbf, &bts->ul_tbfs, list) {
|
llist_for_each_entry(tbf, &bts->ul_tbfs, list) {
|
||||||
/* this trx, this ts */
|
/* this trx, this ts */
|
||||||
if (tbf->trx_no != trx || tbf->control_ts != ts)
|
if (tbf->trx->trx_no != trx || tbf->control_ts != ts)
|
||||||
continue;
|
continue;
|
||||||
/* polling for next uplink block */
|
/* polling for next uplink block */
|
||||||
if (tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
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) {
|
llist_for_each_entry(tbf, &bts->dl_tbfs, list) {
|
||||||
/* this trx, this ts */
|
/* this trx, this ts */
|
||||||
if (tbf->trx_no != trx || tbf->control_ts != ts)
|
if (tbf->trx->trx_no != trx || tbf->control_ts != ts)
|
||||||
continue;
|
continue;
|
||||||
/* polling for next uplink block */
|
/* polling for next uplink block */
|
||||||
if (tbf->poll_state == GPRS_RLCMAC_POLL_SCHED
|
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 "
|
"because it has different TSC than lower TS "
|
||||||
"of TRX. In order to allow multislot, all "
|
"of TRX. In order to allow multislot, all "
|
||||||
"slots must be configured with the same "
|
"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 */
|
/* increase window for Type 1 */
|
||||||
if (Type == 1 && rx_window)
|
if (Type == 1 && rx_window)
|
||||||
i++;
|
i++;
|
||||||
@@ -434,7 +434,7 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
|
|||||||
"than lower TS of TRX. In order to "
|
"than lower TS of TRX. In order to "
|
||||||
"allow multislot, all slots must be "
|
"allow multislot, all slots must be "
|
||||||
"configured with the same TSC!\n",
|
"configured with the same TSC!\n",
|
||||||
ts, tbf->trx_no);
|
ts, tbf->trx->trx_no);
|
||||||
/* increase window for Type 1 */
|
/* increase window for Type 1 */
|
||||||
if (Type == 1)
|
if (Type == 1)
|
||||||
i++;
|
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);
|
tbf = bts->bts->tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF);
|
||||||
if (tbf && tbf->dir.ul.contention_resolution_done
|
if (tbf && tbf->dir.ul.contention_resolution_done
|
||||||
&& !tbf->dir.ul.final_ack_sent) {
|
&& !tbf->dir.ul.final_ack_sent) {
|
||||||
use_trx = tbf->trx_no;
|
use_trx = tbf->trx->trx_no;
|
||||||
ta = tbf->ta;
|
ta = tbf->ta;
|
||||||
ss = 0;
|
ss = 0;
|
||||||
old_tbf = tbf;
|
old_tbf = tbf;
|
||||||
@@ -581,7 +581,6 @@ next_diagram:
|
|||||||
#endif
|
#endif
|
||||||
tbf->direction = dir;
|
tbf->direction = dir;
|
||||||
tbf->tfi = tfi;
|
tbf->tfi = tfi;
|
||||||
tbf->trx_no = trx;
|
|
||||||
tbf->trx = &bts->trx[trx];
|
tbf->trx = &bts->trx[trx];
|
||||||
tbf->ms_class = ms_class;
|
tbf->ms_class = ms_class;
|
||||||
tbf->ws = 64;
|
tbf->ws = 64;
|
||||||
@@ -1184,7 +1183,7 @@ tx_block:
|
|||||||
LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
|
LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
|
||||||
"sheduled in this TS %d, waiting for "
|
"sheduled in this TS %d, waiting for "
|
||||||
"TS %d\n", ts, control_ts);
|
"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 "
|
LOGP(DRLCMAC, LOGL_DEBUG, "Polling cannot be "
|
||||||
"sheduled, because single block alllocation "
|
"sheduled, because single block alllocation "
|
||||||
"already exists\n");
|
"already exists\n");
|
||||||
@@ -1250,7 +1249,7 @@ struct msgb *gprs_rlcmac_tbf::create_dl_ass(uint32_t fn)
|
|||||||
"assignment...\n", tfi);
|
"assignment...\n", tfi);
|
||||||
return NULL;
|
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 "
|
LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
|
||||||
"scheduled for single block allocation...\n");
|
"scheduled for single block allocation...\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1331,7 +1330,7 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn)
|
|||||||
"assignment...\n", tfi);
|
"assignment...\n", tfi);
|
||||||
return NULL;
|
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 "
|
LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already scheduled for "
|
||||||
"single block allocation...\n");
|
"single block allocation...\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1403,7 +1402,7 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ack(uint32_t fn)
|
|||||||
"final uplink ack...\n", tfi);
|
"final uplink ack...\n", tfi);
|
||||||
return NULL;
|
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 "
|
LOGP(DRLCMACUL, LOGL_DEBUG, "Polling is already "
|
||||||
"scheduled for single block allocation...\n");
|
"scheduled for single block allocation...\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -121,7 +121,6 @@ struct gprs_rlcmac_tbf {
|
|||||||
uint32_t tlli;
|
uint32_t tlli;
|
||||||
uint8_t tlli_valid;
|
uint8_t tlli_valid;
|
||||||
struct gprs_rlcmac_trx *trx;
|
struct gprs_rlcmac_trx *trx;
|
||||||
uint8_t trx_no;
|
|
||||||
uint8_t tsc;
|
uint8_t tsc;
|
||||||
uint8_t first_ts; /* first TS used by TBF */
|
uint8_t first_ts; /* first TS used by TBF */
|
||||||
uint8_t first_common_ts; /* first TS that the phone can send and
|
uint8_t first_common_ts; /* first TS that the phone can send and
|
||||||
|
|||||||
Reference in New Issue
Block a user