tbf, ...: Make the fields in the dl/ul struct member variables
There is no need for the union/struct anymore. Make the variable members
of the UL/DL class.
As a result gprs_rlc_dl_window gets a reset() method because
memset(&dir.dl, 0, sizeof(dir.dl)) doesn't work anymore in reuse_tbf().
Ticket: SYS#389
Sponsored by: On-Waves ehf
diff --git a/src/tbf.h b/src/tbf.h
index 2f8cd58..23f8a7b 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -319,13 +319,9 @@
* All states that need reset must be in this struct, so this is why
* variables are in both (dl and ul) structs and not outside union.
*/
- union {
- struct {
- gprs_rlc_dl_window window;
- int32_t tx_counter; /* count all transmitted blocks */
- uint8_t wait_confirm; /* wait for CCCH IMM.ASS cnf */
- } dl;
- } dir;
+ gprs_rlc_dl_window m_window;
+ int32_t m_tx_counter; /* count all transmitted blocks */
+ uint8_t m_wait_confirm; /* wait for CCCH IMM.ASS cnf */
protected:
struct msgb *create_new_bsn(const uint32_t fn, const uint8_t ts);
@@ -348,16 +344,12 @@
* All states that need reset must be in this struct, so this is why
* variables are in both (dl and ul) structs and not outside union.
*/
- union {
- struct {
- gprs_rlc_ul_window window;
- int32_t rx_counter; /* count all received blocks */
- uint8_t n3103; /* N3103 counter */
- uint8_t usf[8]; /* list USFs per PDCH (timeslot) */
- uint8_t contention_resolution_done; /* set after done */
- uint8_t final_ack_sent; /* set if we sent final ack */
- } ul;
- } dir;
+ gprs_rlc_ul_window m_window;
+ int32_t m_rx_counter; /* count all received blocks */
+ uint8_t m_n3103; /* N3103 counter */
+ uint8_t m_usf[8]; /* list USFs per PDCH (timeslot) */
+ uint8_t m_contention_resolution_done; /* set after done */
+ uint8_t m_final_ack_sent; /* set if we sent final ack */
protected:
void maybe_schedule_uplink_acknack(const rlc_ul_header *rh);