aboutsummaryrefslogtreecommitdiffstats
path: root/src/pdch.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-23 21:00:23 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-10-24 22:14:42 +0200
commitb3f239785ccba762d8ebbf704a3da21208bc9dca (patch)
tree1ac413f8fae5d3bdcdd5254dc47034f74cd662d7 /src/pdch.cpp
parent834cbab97d096825d2f46e0cc9841adab3180997 (diff)
tbf: Make window() available to tbf base class
Return an interface to the window base class so that the tbf base class can access the common window methods, such as set_ws(). It will be used in next commit to get rid of duplicated function enable_egprs in both dl_tbf and ul_tbf subclasses. The user of the function can then decide to access more specific functionaltiites of the window class by static casting it to the specific direction (which is known by the caller since it operates on a ul_tbf or a dl_tbf). Change-Id: Ia2e1decf91be1184668e28297c2126affb9c7ae4
Diffstat (limited to 'src/pdch.cpp')
-rw-r--r--src/pdch.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pdch.cpp b/src/pdch.cpp
index 7986373f..26604bcc 100644
--- a/src/pdch.cpp
+++ b/src/pdch.cpp
@@ -436,7 +436,7 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
num_blocks = Decoding::decode_gprs_acknack_bits(
&ack_nack->Ack_Nack_Description, &bits,
- &bsn_begin, &bsn_end, tbf->window());
+ &bsn_begin, &bsn_end, static_cast<gprs_rlc_dl_window *>(tbf->window()));
LOGP(DRLCMAC, LOGL_DEBUG,
"Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), "
@@ -467,6 +467,7 @@ void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nac
{
int8_t tfi = 0; /* must be signed */
struct gprs_rlcmac_dl_tbf *tbf;
+ gprs_rlc_dl_window *window;
int rc;
int num_blocks;
uint8_t bits_data[RLC_EGPRS_MAX_WS/8];
@@ -497,6 +498,7 @@ void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nac
LOGPTBF(tbf, LOGL_DEBUG,
"RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n");
+ window = static_cast<gprs_rlc_dl_window *>(tbf->window());
LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: "
"ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, "
"urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n",
@@ -511,8 +513,8 @@ void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nac
(void *)&ack_nack->EGPRS_AckNack.Desc,
(int)offsetof(EGPRS_AckNack_t, Desc),
(int)offsetof(EGPRS_AckNack_w_len_t, Desc),
- tbf->window()->v_a(),
- tbf->window()->v_s(),
+ window->v_a(),
+ window->v_s(),
osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB,
sizeof(ack_nack->EGPRS_AckNack.Desc.URBB)));
@@ -522,7 +524,7 @@ void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nac
num_blocks = Decoding::decode_egprs_acknack_bits(
&ack_nack->EGPRS_AckNack.Desc, &bits,
- &bsn_begin, &bsn_end, tbf->window());
+ &bsn_begin, &bsn_end, window);
LOGP(DRLCMAC, LOGL_DEBUG,
"Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), "