From 314ec4db40d46634e38adcbe1be93986278b605a Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 11 Jan 2016 13:27:07 +0100 Subject: tbf: Remove obsolete TLLI functions This commit removes gprs_rlcmac_tbf::extract_tlli and Decoding::tlli_from_ul_data. Sponsored-by: On-Waves ehf --- src/decoding.cpp | 41 ----------------------------------------- src/decoding.h | 2 -- src/tbf.cpp | 27 --------------------------- src/tbf.h | 1 - 4 files changed, 71 deletions(-) (limited to 'src') diff --git a/src/decoding.cpp b/src/decoding.cpp index 45716413..cb1b34d4 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -281,47 +281,6 @@ int Decoding::rlc_data_from_ul_data( return num_chunks; } -int Decoding::tlli_from_ul_data(const uint8_t *data, uint8_t len, - uint32_t *tlli) -{ - struct rlc_ul_header *rh = (struct rlc_ul_header *)data; - struct rlc_li_field *li; - uint8_t e; - uint32_t _tlli; - - if (!rh->ti) - return -EINVAL; - - data += 3; - len -= 3; - e = rh->e; - /* if E is not set (LI follows) */ - while (!e) { - if (!len) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA LI extended, " - "but no more data\n"); - return -EINVAL; - } - /* get new E */ - li = (struct rlc_li_field *)data; - if (li->e == 0) /* if LI==0, E is interpreted as '1' */ - e = 1; - else - e = li->e; - data++; - len--; - } - if (len < 4) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA TLLI out of frame " - "border\n"); - return -EINVAL; - } - memcpy(&_tlli, data, 4); - *tlli = ntohl(_tlli); - - return 0; -} - uint8_t Decoding::get_ms_class_by_capability(MS_Radio_Access_capability_t *cap) { int i; diff --git a/src/decoding.h b/src/decoding.h index 94926946..c75b19a1 100644 --- a/src/decoding.h +++ b/src/decoding.h @@ -32,8 +32,6 @@ public: bool is_complete; }; - static int tlli_from_ul_data(const uint8_t *data, uint8_t len, - uint32_t *tlli); static int rlc_data_from_ul_data( const struct gprs_rlc_data_block_info *rdbi, GprsCodingScheme cs, const uint8_t *data, RlcData *chunks, diff --git a/src/tbf.cpp b/src/tbf.cpp index 9c5502a8..1f0576af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1060,33 +1060,6 @@ int gprs_rlcmac_tbf::set_tlli_from_ul(uint32_t new_tlli) return 1; } -int gprs_rlcmac_tbf::extract_tlli(const uint8_t *data, const size_t len) -{ - struct rlc_ul_header *rh = (struct rlc_ul_header *)data; - uint32_t new_tlli; - int rc; - - OSMO_ASSERT(direction == GPRS_RLCMAC_UL_TBF); - - /* no TLLI yet */ - if (!rh->ti) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA TFI=%d without " - "TLLI, but no TLLI received yet\n", rh->tfi); - return 0; - } - rc = Decoding::tlli_from_ul_data(data, len, &new_tlli); - if (rc) { - bts->decode_error(); - LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI " - "of UL DATA TFI=%d.\n", rh->tfi); - return 0; - } - LOGP(DRLCMACUL, LOGL_INFO, "Decoded premier TLLI=0x%08x of " - "UL DATA TFI=%d.\n", new_tlli, rh->tfi); - - return set_tlli_from_ul(new_tlli); -} - const char *tbf_name(gprs_rlcmac_tbf *tbf) { return tbf->name(); diff --git a/src/tbf.h b/src/tbf.h index 7c3fba8d..cd982739 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -218,7 +218,6 @@ struct gprs_rlcmac_tbf { protected: gprs_rlcmac_bts *bts_data() const; - int extract_tlli(const uint8_t *data, const size_t len); int set_tlli_from_ul(uint32_t new_tlli); void merge_and_clear_ms(GprsMs *old_ms); -- cgit v1.2.3