blob: 7aa35cd597e737c42e952b3ea1be6531369cbc8d [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file rxlev_stat.h */
2
Sylvain Munaut12ba7782014-06-16 10:13:40 +02003#pragma once
Harald Welte63d3e392010-03-06 11:34:27 +01004
5#define NUM_RXLEVS 32
6#define NUM_ARFCNS 1024
7
8struct rxlev_stats {
9 /* the maximum number of ARFCN's is 1024, and there are 32 RxLevels,
10 * so in we keep one 1024bit-bitvec for each RxLev */
11 uint8_t rxlev_buckets[NUM_RXLEVS][NUM_ARFCNS/8];
12};
13
14void rxlev_stat_input(struct rxlev_stats *st, uint16_t arfcn, uint8_t rxlev);
15
16/* get the next ARFCN that has the specified Rxlev */
17int16_t rxlev_stat_get_next(const struct rxlev_stats *st, uint8_t rxlev, int16_t arfcn);
18
19void rxlev_stat_reset(struct rxlev_stats *st);
20
21void rxlev_stat_dump(const struct rxlev_stats *st);