aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-27 13:44:37 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:13 +0100
commitec80f82824d39f4378670900bcc65cc51a90da4c (patch)
tree51791a6538ac18aadc8035d76bdeb9591d3781a4
parentfc498c9e7bb572ac1255f80fc2ab1794b9bc39ce (diff)
tbf: Remove the trx_no field from the tbf, go through the trx object
-rw-r--r--src/bts.cpp14
-rw-r--r--src/gprs_rlcmac_sched.cpp4
-rw-r--r--src/gprs_rlcmac_ts_alloc.cpp4
-rw-r--r--src/tbf.cpp11
-rw-r--r--src/tbf.h1
5 files changed, 16 insertions, 18 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index c4d565f7..d4c5e27a 100644
--- a/src/bts.cpp
+++ b/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;
}
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 76ddac44..504f6b78 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -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
diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp
index 6909aba6..c92192c6 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -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++;
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 7b6bbfbf..43b13ef6 100644
--- a/src/tbf.cpp
+++ b/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;
diff --git a/src/tbf.h b/src/tbf.h
index 196454a8..e6981bce 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -121,7 +121,6 @@ struct gprs_rlcmac_tbf {
uint32_t tlli;
uint8_t tlli_valid;
struct gprs_rlcmac_trx *trx;
- uint8_t trx_no;
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