summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-04-23 15:06:07 +0200
committerHarald Welte <laforge@osmocom.org>2020-04-25 19:08:34 +0200
commit3425527fb78a645ba4285c2ac9f4fc66e4c57fa4 (patch)
tree5f8afe26a37b84701f1b9d6f0c7864e5e020f05a
parentb217b9b3e597e96c0541c4493f8f4ded28ed7804 (diff)
firmware/rfch.[ch]: Document functions + constify input arguments
-rw-r--r--src/target/firmware/include/layer1/rfch.h2
-rw-r--r--src/target/firmware/layer1/rfch.c19
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) {