From 3425527fb78a645ba4285c2ac9f4fc66e4c57fa4 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 23 Apr 2020 15:06:07 +0200 Subject: firmware/rfch.[ch]: Document functions + constify input arguments Change-Id: I16d5190b3cdc997c5609b52d41203f10264b017c --- src/target/firmware/include/layer1/rfch.h | 2 +- src/target/firmware/layer1/rfch.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/target/firmware/include/layer1/rfch.h b/src/target/firmware/include/layer1/rfch.h index 344523c3..0c4f9a0f 100644 --- a/src/target/firmware/include/layer1/rfch.h +++ b/src/target/firmware/include/layer1/rfch.h @@ -3,7 +3,7 @@ struct gsm_time; -void rfch_get_params(struct gsm_time *t, +void rfch_get_params(const struct gsm_time *t, uint16_t *arfcn_p, uint8_t *tsc_p, uint8_t *tn_p); #endif /* _L1_RFCH_H */ diff --git a/src/target/firmware/layer1/rfch.c b/src/target/firmware/layer1/rfch.c index d0818d04..3c4e6764 100644 --- a/src/target/firmware/layer1/rfch.c +++ b/src/target/firmware/layer1/rfch.c @@ -82,9 +82,16 @@ static int pow_nbin_mask(int n) return x; } -static int16_t rfch_hop_seq_gen(struct gsm_time *t, +/*! Hopping sequence generator. + * \param[in] t GSM time (frame number) + * \param[in] hsn Hopping Sequence Number + * \param[in] maio Mobile Allocation Index OFfset + * \param[in] n number of entries in mobile allocation (arfcn table) + * \param[in] arfcn_tbl Array of ARFCN representing the mobile allocation + * \returns ARFCN to use for given input parameters at time 't' or MAI if arfcn_tbl == NULL */ +static int16_t rfch_hop_seq_gen(const struct gsm_time *t, uint8_t hsn, uint8_t maio, - uint8_t n, uint16_t *arfcn_tbl) + uint8_t n, const uint16_t *arfcn_tbl) { int mai; @@ -114,8 +121,12 @@ static int16_t rfch_hop_seq_gen(struct gsm_time *t, } -/* RF Channel parameters */ -void rfch_get_params(struct gsm_time *t, +/*! Get RF Channel parameters at a given GSM time (frame number) + * \param[in] t GSM time for which to obtain parameters + * \param[out] arfcn_p ARFCN to use at time t + * \oaram[out] tsc_p Training sequence to use at time t + * \param[out] tn_p Timeslot Number to use at time t */ +void rfch_get_params(const struct gsm_time *t, uint16_t *arfcn_p, uint8_t *tsc_p, uint8_t *tn_p) { if (l1s.dedicated.type == GSM_DCHAN_NONE) { -- cgit v1.2.3