aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.h
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-02-20 18:16:11 +0100
committerMax <msuraev@sysmocom.de>2018-02-20 18:16:11 +0100
commit847ed9f8cd4fd95776052c8d1934813f0ea2c813 (patch)
tree48a7749fd3326af60bd3c8bdf3f7e60f282bc268 /src/tbf.h
parent4da385998acedd83e2f2bb029340d3c1ce710faf (diff)
TBF: make network counters internal
* store N310* counters in shared array similar to corresponding timers * add functions to increment/reset counters This avoids direct access to TBF counters from PDCH. Change-Id: I8ffff9c7186f74bde7e6ac5f6e98f0b3e4c35274 Related: OS#1539
Diffstat (limited to 'src/tbf.h')
-rw-r--r--src/tbf.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/tbf.h b/src/tbf.h
index 239b8fdc..803b294d 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -108,7 +108,7 @@ enum tbf_dl_prio {
DL_PRIO_CONTROL, /* a control block needs to be sent */
};
-enum tbf_counters {
+enum tbf_rlc_counters {
TBF_CTR_RLC_NACKED,
};
@@ -175,6 +175,14 @@ enum tbf_timers {
T_MAX
};
+enum tbf_counters { /* TBF counters from 3GPP TS 44.060 ยง13.4 */
+ /* counters are reset when: */
+ N3101, /* received a valid data block from mobile station in a block assigned for this USF */
+ N3103, /* transmitting the final PACKET UPLINK ACK/NACK message */
+ N3105, /* after sending a RRBP field in the downlink RLC data block, receives a valid RLC/MAC control message */
+ N_MAX
+};
+
#define GPRS_RLCMAC_FLAG_CCCH 0 /* assignment on CCCH */
#define GPRS_RLCMAC_FLAG_PACCH 1 /* assignment on PACCH */
#define GPRS_RLCMAC_FLAG_UL_DATA 2 /* uplink data received */
@@ -234,6 +242,9 @@ struct gprs_rlcmac_tbf {
int rlcmac_diag();
+ bool n_inc(enum tbf_counters n);
+ void n_reset(enum tbf_counters n);
+
int update();
void handle_timeout();
void stop_timers(const char *reason);
@@ -301,9 +312,7 @@ struct gprs_rlcmac_tbf {
uint8_t poll_ts; /* TS to poll */
gprs_rlc m_rlc;
-
- uint8_t n3105; /* N3105 counter */
-
+
struct osmo_gsm_timer_list gsm_timer;
unsigned int fT; /* fTxxxx number */
unsigned int num_fT_exp; /* number of consecutive fT expirations */
@@ -326,8 +335,6 @@ struct gprs_rlcmac_tbf {
/* store the BTS this TBF belongs to */
BTS *bts;
- uint8_t m_n3101; /* N3101 counter */
-
/*
* private fields. We can't make it private as it is breaking the
* llist macros.
@@ -364,6 +371,7 @@ private:
LListHead<gprs_rlcmac_tbf> m_ms_list;
bool m_egprs_enabled;
struct osmo_timer_list T[T_MAX];
+ uint8_t N[N_MAX];
mutable char m_name_buf[60];
};
@@ -751,7 +759,6 @@ struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf {
* variables are in both (dl and ul) structs and not outside union.
*/
int32_t m_rx_counter; /* count all received blocks */
- uint8_t m_n3103; /* N3103 counter */
uint8_t m_usf[8]; /* list USFs per PDCH (timeslot) */
uint8_t m_contention_resolution_done; /* set after done */
uint8_t m_final_ack_sent; /* set if we sent final ack */