diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-01-22 17:06:14 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-08 00:45:39 +0100 |
commit | 7c72acaa941fd7f3663b0f9b36fe30f4974f1979 (patch) | |
tree | 534822e70b8d4ca7e91d6589f9771c926c234f14 /src | |
parent | 1ff70c26e3a79aa583f5da8f595364efdebbfa06 (diff) |
ms: Add current_pacch_slots method
The PACCH is specific to an MS and may change when a TBF is
established or removed (see TS 44.060, 8.1.1.2.2). For multislot
class type 2 phones, more than one timeslot may be used to transmit
RLC/MAC control messages.
Add a method that returns a set of TS which can be used for the
PACCH.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src')
-rw-r--r-- | src/gprs_ms.cpp | 26 | ||||
-rw-r--r-- | src/gprs_ms.h | 1 | ||||
-rw-r--r-- | src/pcu_vty_functions.cpp | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 9126543e..f522586b 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -25,6 +25,7 @@ #include "tbf.h" #include "gprs_debug.h" #include "gprs_codel.h" +#include "pcu_utils.h" #include <time.h> @@ -762,6 +763,31 @@ uint8_t GprsMs::ul_slots() const return slots; } +uint8_t GprsMs::current_pacch_slots() const +{ + uint8_t slots = 0; + + bool is_dl_active = m_dl_tbf && m_dl_tbf->is_tfi_assigned(); + bool is_ul_active = m_ul_tbf && m_ul_tbf->is_tfi_assigned(); + + if (!is_dl_active && !is_ul_active) + return 0; + + /* see TS 44.060, 8.1.1.2.2 */ + if (is_dl_active && !is_ul_active) + slots = m_dl_tbf->dl_slots(); + else if (!is_dl_active && is_ul_active) + slots = m_ul_tbf->ul_slots(); + else + slots = m_ul_tbf->ul_slots() & m_dl_tbf->dl_slots(); + + /* Assume a multislot class 1 device */ + /* TODO: For class 2 devices, this could be removed */ + slots = pcu_lsb(slots); + + return slots; +} + void GprsMs::set_reserved_slots(gprs_rlcmac_trx *trx, uint8_t ul_slots, uint8_t dl_slots) { diff --git a/src/gprs_ms.h b/src/gprs_ms.h index 246f71e4..b07f1757 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -97,6 +97,7 @@ public: uint8_t ul_slots() const; uint8_t reserved_dl_slots() const; uint8_t reserved_ul_slots() const; + uint8_t current_pacch_slots() const; gprs_rlcmac_trx *current_trx() const; void set_reserved_slots(gprs_rlcmac_trx *trx, uint8_t ul_slots, uint8_t dl_slots); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 3fcd3e60..166b15eb 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -118,6 +118,7 @@ static int show_ms(struct vty *vty, GprsMs *ms) { unsigned i; LListHead<gprs_rlcmac_tbf> *i_tbf; + uint8_t slots; vty_out(vty, "MS TLLI=%08x, IMSI=%s%s", ms->tlli(), ms->imsi(), VTY_NEWLINE); vty_out(vty, " Timing advance (TA): %d%s", ms->ta(), VTY_NEWLINE); @@ -129,6 +130,12 @@ static int show_ms(struct vty *vty, GprsMs *ms) GprsCodingScheme::modeName(ms->mode()), VTY_NEWLINE); vty_out(vty, " MS class: %d%s", ms->ms_class(), VTY_NEWLINE); vty_out(vty, " EGPRS MS class: %d%s", ms->egprs_ms_class(), VTY_NEWLINE); + vty_out(vty, " PACCH: "); + slots = ms->current_pacch_slots(); + for (int i = 0; i < 8; i++) + if (slots & (1 << i)) + vty_out(vty, "%d ", i); + vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " LLC queue length: %d%s", ms->llc_queue()->size(), VTY_NEWLINE); vty_out(vty, " LLC queue octets: %d%s", ms->llc_queue()->octets(), |