aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-12-23 16:40:56 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-01 13:58:12 +0100
commite1ca87f0570674526e6586c697e06a1c83b8071b (patch)
tree150b34d8f5a9273021e4611f7bb39aefc0540a86
parent93c55d04e5917aa54ce37a9e997d0af87cc8be85 (diff)
rlc/edge: Consistently use uint16_t for BSNs and SSNs
Currently in some places uint8_t is being used to encode BSNs and SSNs. This is inconsistent and (even worse) not enough for EPGRS which uses an SNS of 2014. This commit changes these to uint16_t. Sponsored-by: On-Waves ehf
-rw-r--r--src/rlc.cpp2
-rw-r--r--src/rlc.h10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp
index c733667..f6d6f4a 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -98,7 +98,7 @@ static uint16_t bitnum_to_bsn(int bitnum, uint16_t ssn)
return (ssn - 1 - bitnum);
}
-void gprs_rlc_dl_window::update(BTS *bts, char *show_rbb, uint8_t ssn,
+void gprs_rlc_dl_window::update(BTS *bts, char *show_rbb, uint16_t ssn,
uint16_t *lost, uint16_t *received)
{
/* SSN - 1 is in range V(A)..V(S)-1 */
diff --git a/src/rlc.h b/src/rlc.h
index 4905aa1..f16a910 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -158,7 +158,7 @@ struct gprs_rlc_dl_window {
/* Methods to manage reception */
int resend_needed();
int mark_for_resend();
- void update(BTS *bts, char *show_rbb, uint8_t ssn,
+ void update(BTS *bts, char *show_rbb, uint16_t ssn,
uint16_t *lost, uint16_t *received);
int move_window();
void show_state(char *show_rbb);
@@ -196,8 +196,8 @@ struct gprs_rlc_ul_window {
const uint16_t ssn() const;
- bool is_in_window(uint8_t bsn) const;
- bool is_received(uint8_t bsn) const;
+ bool is_in_window(uint16_t bsn) const;
+ bool is_received(uint16_t bsn) const;
void update_rbb(char *rbb);
void raise_v_r_to(int moves);
@@ -400,7 +400,7 @@ inline const int16_t gprs_rlc_dl_window::distance() const
return (m_v_s - m_v_a) & mod_sns();
}
-inline bool gprs_rlc_ul_window::is_in_window(uint8_t bsn) const
+inline bool gprs_rlc_ul_window::is_in_window(uint16_t bsn) const
{
uint16_t offset_v_q;
@@ -411,7 +411,7 @@ inline bool gprs_rlc_ul_window::is_in_window(uint8_t bsn) const
return offset_v_q < ws();
}
-inline bool gprs_rlc_ul_window::is_received(uint8_t bsn) const
+inline bool gprs_rlc_ul_window::is_received(uint16_t bsn) const
{
uint16_t offset_v_r;