diff --git a/src/rlc.h b/src/rlc.h index aac6b138..5b6a0dd7 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -24,6 +24,7 @@ #include #include +#include #define RLC_GPRS_SNS 128 /* GPRS, must be power of 2 */ #define RLC_GPRS_WS 64 /* max window size */ @@ -232,6 +233,7 @@ void gprs_update_punct_scheme(enum egprs_puncturing_values *punct, * the routines to manipulate these arrays. */ struct gprs_rlc { + void init(); gprs_rlc_data *block(int bsn); gprs_rlc_data m_blocks[RLC_MAX_SNS/2]; }; @@ -647,6 +649,11 @@ inline gprs_rlc_ul_bsn_state gprs_rlc_v_n::state(int bsn) const return m_v_n[bsn & mod_sns_half()]; } +inline void gprs_rlc::init() +{ + memset(m_blocks, 0, sizeof(m_blocks)); +} + inline gprs_rlc_data *gprs_rlc::block(int bsn) { return &m_blocks[bsn & mod_sns_half()]; diff --git a/src/tbf.cpp b/src/tbf.cpp index d5fbb3ff..14c1ee28 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -219,9 +219,9 @@ gprs_rlcmac_tbf::gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir) : memset(&pdch, 0, sizeof(pdch)); memset(&T, 0, sizeof(T)); memset(&N, 0, sizeof(N)); - memset(&m_rlc, 0, sizeof(m_rlc)); memset(&gsm_timer, 0, sizeof(gsm_timer)); + m_rlc.init(); m_llc.init(); m_name_buf[0] = '\0';