tbf: Make create_new_bsn and create_dl_acked_block a method of DL TBF
These functions are only used for DL TBFs so move them.
sched_select_downlink() in src/gprs_rlcmac_sched.cpp now needs to deal
with DL TBFs instead of the base class.
Ticket: SYS#389
Sponsored-by: On-Waves ehf
diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index dab38d8..6c46a73 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -164,7 +164,7 @@
uint8_t block_nr, struct gprs_rlcmac_pdch *pdch)
{
struct msgb *msg = NULL;
- struct gprs_rlcmac_tbf *tbf = NULL;
+ struct gprs_rlcmac_dl_tbf *tbf = NULL;
uint8_t i, tfi;
/* select downlink resource */
diff --git a/src/tbf.cpp b/src/tbf.cpp
index d9c55f3..2f3cc31 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -889,7 +889,7 @@
* Create DL data block
* The messages are fragmented and forwarded as data blocks.
*/
-struct msgb *gprs_rlcmac_tbf::create_dl_acked_block(uint32_t fn, uint8_t ts)
+struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(uint32_t fn, uint8_t ts)
{
LOGP(DRLCMACDL, LOGL_DEBUG, "%s downlink (V(A)==%d .. "
"V(S)==%d)\n", tbf_name(this),
@@ -954,7 +954,7 @@
return create_new_bsn(fn, ts);
}
-struct msgb *gprs_rlcmac_tbf::create_new_bsn(const uint32_t fn, const uint8_t ts)
+struct msgb *gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, const uint8_t ts)
{
struct rlc_dl_header *rh;
struct rlc_li_field *li;
@@ -1121,7 +1121,7 @@
return create_dl_acked_block(fn, ts, bsn, first_fin_ack);
}
-struct msgb *gprs_rlcmac_tbf::create_dl_acked_block(
+struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
const uint32_t fn, const uint8_t ts,
const int index, const bool first_fin_ack)
{
diff --git a/src/tbf.h b/src/tbf.h
index 04ae191..6681836 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -121,7 +121,6 @@
/* TODO: extract LLC class? */
int assemble_forward_llc(const gprs_rlc_data *data);
- struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts);
struct msgb *create_dl_ass(uint32_t fn);
struct msgb *create_ul_ass(uint32_t fn);
struct msgb *create_ul_ack(uint32_t fn);
@@ -270,9 +269,6 @@
int extract_tlli(const uint8_t *data, const size_t len);
void maybe_schedule_uplink_acknack(const rlc_ul_header *rh);
- struct msgb *create_dl_acked_block(const uint32_t fn, const uint8_t ts,
- const int index, const bool fin_first_ack);
- struct msgb *create_new_bsn(const uint32_t fn, const uint8_t ts);
};
@@ -354,6 +350,12 @@
const uint8_t *data, const uint16_t len);
int rcvd_dl_ack(uint8_t final, uint8_t ssn, uint8_t *rbb);
+ struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts);
+
+protected:
+ struct msgb *create_new_bsn(const uint32_t fn, const uint8_t ts);
+ struct msgb *create_dl_acked_block(const uint32_t fn, const uint8_t ts,
+ const int index, const bool fin_first_ack);
};
struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf {