diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-21 09:26:17 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-12-21 13:33:10 +0100 |
commit | 38fe2a67e1a376e4370ddfed2f75687075cc9e6b (patch) | |
tree | a0911edf70783dc13139ee26ad1c5607708f3b62 /openbsc/include/openbsc/meas_rep.h | |
parent | 56315f02bb88f0595d369c2d80f6556922758f62 (diff) |
meas_rep: utility function for processing of measurement reports
This provides two functions: get_meas_rep_avg() to obtain the sliding
window average of one particular field, and meas_rep_n_out_of_m_be()
to check if at least N out of M measurments are >= BE.
Diffstat (limited to 'openbsc/include/openbsc/meas_rep.h')
-rw-r--r-- | openbsc/include/openbsc/meas_rep.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/meas_rep.h b/openbsc/include/openbsc/meas_rep.h index c36352e2a..fd5fced43 100644 --- a/openbsc/include/openbsc/meas_rep.h +++ b/openbsc/include/openbsc/meas_rep.h @@ -1,11 +1,14 @@ #ifndef _MEAS_REP_H #define _MEAS_REP_H +#define MRC_F_PROCESSED 0x0001 + /* extracted from a L3 measurement report IE */ struct gsm_meas_rep_cell { u_int8_t rxlev; u_int8_t bsic; u_int16_t arfcn; + unsigned int flags; }; /* RX Level and RX Quality */ @@ -54,4 +57,28 @@ struct gsm_meas_rep { struct gsm_meas_rep_cell cell[6]; }; +enum meas_rep_field { + MEAS_REP_DL_RXLEV_FULL, + MEAS_REP_DL_RXLEV_SUB, + MEAS_REP_DL_RXQUAL_FULL, + MEAS_REP_DL_RXQUAL_SUB, + MEAS_REP_UL_RXLEV_FULL, + MEAS_REP_UL_RXLEV_SUB, + MEAS_REP_UL_RXQUAL_FULL, + MEAS_REP_UL_RXQUAL_SUB, +}; + +/* obtain an average over the last 'num' fields in the meas reps */ +int get_meas_rep_avg(const struct gsm_lchan *lchan, + enum meas_rep_field field, unsigned int num); + +/* Check if N out of M last values for FIELD are >= bd */ +int meas_rep_n_out_of_m_be(const struct gsm_lchan *lchan, + enum meas_rep_field field, + unsigned int n, unsigned int m, int be); + +unsigned int calc_initial_idx(unsigned int array_size, + unsigned int meas_rep_idx, + unsigned int num_values); + #endif /* _MEAS_REP_H */ |