diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-01-05 15:33:03 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-01 13:58:14 +0100 |
commit | cb7289094a40f179f6c538780f3117f7ad9688bd (patch) | |
tree | dc25962feb9c18814fe944fe9d39adedcf859dc6 /src/gprs_ms.h | |
parent | 96ccea8436f9a5bbd9f459c6c1bdb9a24dd2bed9 (diff) |
edge: Replace integer cs by GprsCodingScheme
Currently the TBF and MS object use a plain integer value
(current_cs) to manage the coding scheme. This makes it difficult to
support the MCS schemes. GprsCodingScheme supports a partial ordering
of these values (CS and MCS) and provides safe increment and
decrement methods.
Use the GprsCodingScheme type instead of integer for cs fields and
variables. Add a 'mode' to GprsMs which can be set to either GPRS,
EGPRS, or EGPRS_GMSK which also set the initial values of
current_cs_ul/dl. Select the mode based on max_mcs_ul and max_mcs_dl.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/gprs_ms.h')
-rw-r--r-- | src/gprs_ms.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gprs_ms.h b/src/gprs_ms.h index f9b63f26..246f71e4 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -74,6 +74,8 @@ public: bool check_tlli(uint32_t tlli); void reset(); + GprsCodingScheme::Mode mode() const; + void set_mode(GprsCodingScheme::Mode mode); const char *imsi() const; void set_imsi(const char *imsi); @@ -85,8 +87,10 @@ public: void set_ms_class(uint8_t ms_class); void set_egprs_ms_class(uint8_t ms_class); - uint8_t current_cs_ul() const; - uint8_t current_cs_dl() const; + GprsCodingScheme current_cs_ul() const; + GprsCodingScheme current_cs_dl() const; + GprsCodingScheme max_cs_ul() const; + GprsCodingScheme max_cs_dl() const; int first_common_ts() const; uint8_t dl_slots() const; @@ -134,6 +138,7 @@ protected: void unref(); void start_timer(); void stop_timer(); + void update_cs_ul(const pcu_l1_meas*); private: BTS *m_bts; @@ -152,8 +157,8 @@ private: uint8_t m_ms_class; uint8_t m_egprs_ms_class; /* current coding scheme */ - uint8_t m_current_cs_ul; - uint8_t m_current_cs_dl; + GprsCodingScheme m_current_cs_ul; + GprsCodingScheme m_current_cs_dl; gprs_llc_queue m_llc_queue; @@ -172,6 +177,7 @@ private: gprs_rlcmac_trx *m_current_trx; struct gprs_codel *m_codel_state; + GprsCodingScheme::Mode m_mode; }; inline bool GprsMs::is_idle() const @@ -220,11 +226,16 @@ inline uint8_t GprsMs::egprs_ms_class() const return m_egprs_ms_class; } -inline uint8_t GprsMs::current_cs_ul() const +inline GprsCodingScheme GprsMs::current_cs_ul() const { return m_current_cs_ul; } +inline GprsCodingScheme::Mode GprsMs::mode() const +{ + return m_mode; +} + inline void GprsMs::set_timeout(unsigned secs) { m_delay = secs; |