diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-06-02 17:36:21 +0200 |
---|---|---|
committer | laforge <laforge@gnumonks.org> | 2019-06-13 15:37:13 +0000 |
commit | b24ef2357032c1ed25c2f95f8ca2e7b4cd013e82 (patch) | |
tree | 1b0f8a5eda17b1636e027e60db4b771c12684f22 /include | |
parent | 01c539284e85c5d907300e45548d497cca27217b (diff) |
l1sap: Compute statistics on FN advance in PH-RTS.ind
Let's keep some statistics about the min/max/average frame number
advance that we're observing above L1SAP when comparing the time in the
PH-RTS.ind and the frame number we observe in PH-DATA.ind of data
that was received on the uplink.
The statistics are currently only shown in the VTY, but this is a
precursor to using them to correctly advance the LAPDm timers in a
follow-up patch.
Change-Id: I8f739fdb808a614f080afbc4654641ec3df19eb2
Related: OS#2294
Related: OS#3906
Diffstat (limited to 'include')
-rw-r--r-- | include/osmo-bts/bts.h | 2 | ||||
-rw-r--r-- | include/osmo-bts/gsm_data_shared.h | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 970fb1bf..4d132145 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -65,5 +65,7 @@ int bts_main(int argc, char **argv); int bts_supports_cm(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm); +int32_t bts_get_avg_fn_advance(struct gsm_bts *bts); + #endif /* _BTS_H */ diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index 90772e22..f972a673 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -738,6 +738,14 @@ struct gsm_bts { uint8_t tc4_ctr; } si; struct gsm_time gsm_time; + /* frame number statistics (FN in PH-RTS.ind vs. PH-DATA.ind */ + struct { + int32_t min; /* minimum observed */ + int32_t max; /* maximum observed */ + int32_t avg256; /* accumulator */ + uint32_t avg_count; /* number of samples accumulated in avg256 */ + uint32_t avg_window; /* number of averages in avg_count */ + } fn_stats; /* Radio Link Timeout counter. -1 disables timeout for * lab/measurement purpose */ int radio_link_timeout; |