tbf: Kill the tsc member as it duplicates data

We can just use first_ts and the trx/pdch to extract this information.
Avoid duplication of data.
This commit is contained in:
Holger Hans Peter Freyther 2013-12-25 20:22:35 +01:00
parent ba26368040
commit 8f399de135
5 changed files with 12 additions and 8 deletions

View File

@ -450,7 +450,7 @@ int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
m_bts.alpha, m_bts.gamma, -1);
else
plen = Encoding::write_immediate_assignment(&m_bts, immediate_assignment, 0, ra,
Fn, tbf->ta, tbf->trx->arfcn, tbf->first_ts, tbf->tsc,
Fn, tbf->ta, tbf->trx->arfcn, tbf->first_ts, tbf->tsc(),
tbf->tfi(), tbf->dir.ul.usf[tbf->first_ts], 0, 0, 0, 0,
m_bts.alpha, m_bts.gamma, -1);
pcu_l1if_tx_agch(immediate_assignment, plen);
@ -506,7 +506,7 @@ void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi)
* so the assignment will not conflict with possible RACH requests. */
plen = Encoding::write_immediate_assignment(&m_bts, immediate_assignment, 1, 125,
(tbf->pdch[tbf->first_ts]->last_rts_fn + 21216) % 2715648, tbf->ta,
tbf->trx->arfcn, tbf->first_ts, tbf->tsc, tbf->tfi(), 0, tbf->tlli(), poll,
tbf->trx->arfcn, tbf->first_ts, tbf->tsc(), tbf->tfi(), 0, tbf->tlli(), poll,
tbf->poll_fn, 0, m_bts.alpha, m_bts.gamma, -1);
pcu_l1if_tx_pch(immediate_assignment, plen, imsi);
bitvec_free(immediate_assignment);

View File

@ -205,7 +205,7 @@ void Encoding::write_packet_uplink_assignment(
#if 1
bitvec_write_field(dest, wp,0x1,1); // Frequency Parameters information elements = present
bitvec_write_field(dest, wp,tbf->tsc,3); // Training Sequence Code (TSC)
bitvec_write_field(dest, wp,tbf->tsc(),3); // Training Sequence Code (TSC)
bitvec_write_field(dest, wp,0x0,2); // ARFCN = present
bitvec_write_field(dest, wp,tbf->trx->arfcn,10); // ARFCN
#else
@ -287,7 +287,7 @@ void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, uint8_
block->u.Packet_Downlink_Assignment.Exist_P0_and_BTS_PWR_CTRL_MODE = 0x0; // POWER CONTROL = off
block->u.Packet_Downlink_Assignment.Exist_Frequency_Parameters = 0x1; // Frequency Parameters = on
block->u.Packet_Downlink_Assignment.Frequency_Parameters.TSC = tbf->tsc; // Training Sequence Code (TSC)
block->u.Packet_Downlink_Assignment.Frequency_Parameters.TSC = tbf->tsc(); // Training Sequence Code (TSC)
block->u.Packet_Downlink_Assignment.Frequency_Parameters.UnionType = 0x0; // ARFCN = on
block->u.Packet_Downlink_Assignment.Frequency_Parameters.u.ARFCN = tbf->trx->arfcn; // ARFCN

View File

@ -155,7 +155,6 @@ int alloc_algorithm_a(struct gprs_rlcmac_bts *bts,
return -EINVAL;
pdch = &tbf->trx->pdch[ts];
tbf->tsc = pdch->tsc;
if (tbf->direction == GPRS_RLCMAC_UL_TBF) {
int8_t usf; /* must be signed */
@ -274,7 +273,7 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
}
/* check if TSC changes */
if (tsc < 0)
tbf->tsc = tsc = pdch->tsc;
tsc = pdch->tsc;
else if (tsc != pdch->tsc) {
LOGP(DRLCMAC, LOGL_ERROR, "Skipping TS %d of TRX=%d, "
"because it has different TSC than lower TS "
@ -427,7 +426,7 @@ int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
}
/* check if TSC changes */
if (tsc < 0)
tbf->tsc = tsc = pdch->tsc;
tsc = pdch->tsc;
else if (tsc != pdch->tsc) {
LOGP(DRLCMAC, LOGL_ERROR, "Skipping TS %d of "
"TRX=%d, because it has different TSC "

View File

@ -1755,3 +1755,8 @@ void gprs_rlcmac_tbf::rotate_in_list()
else
llist_add(&list, &bts->bts_data()->dl_tbfs);
}
uint8_t gprs_rlcmac_tbf::tsc() const
{
return trx->pdch[first_ts].tsc;
}

View File

@ -112,6 +112,7 @@ struct gprs_rlcmac_tbf {
const uint32_t tlli, const char *imsi, const uint8_t ms_class,
const uint16_t delay_csec, const uint8_t *data, const uint16_t len);
uint8_t tsc() const;
int rlcmac_diag();
@ -142,7 +143,6 @@ struct gprs_rlcmac_tbf {
uint32_t state_flags;
enum gprs_rlcmac_tbf_direction direction;
struct gprs_rlcmac_trx *trx;
uint8_t tsc;
uint8_t first_ts; /* first TS used by TBF */
uint8_t first_common_ts; /* first TS that the phone can send and
reveive simultaniously */