summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-09-06 01:47:50 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-09-06 01:47:50 +0700
commit93728f6ec8421c1b662c7353d96c27bdfc23abc3 (patch)
treed99e0f60552ba3d30b947f6986ecdcbe16f53ba8
parent236dfd506d4d0c3669a6eb783304e5c5eae10f8f (diff)
trxcon: avoid arfcn / band_arfcn naming confusion
In the most cases an ARFCN value is stored together with some flags (e.g. DL/UL flag, DCS flag), so it should be taken into account e.g. when printing. Let's use the proper naming. Change-Id: I0b7634c80986dbff9d0da421c6a044cd36c9fd01
-rw-r--r--src/host/trxcon/l1ctl.c14
-rw-r--r--src/host/trxcon/trx_if.c40
-rw-r--r--src/host/trxcon/trx_if.h10
3 files changed, 32 insertions, 32 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 9d6871ed..49d6a127 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -349,7 +349,7 @@ exit:
static int l1ctl_rx_pm_req(struct l1ctl_link *l1l, struct msgb *msg)
{
- uint16_t arfcn_start, arfcn_stop;
+ uint16_t band_arfcn_start, band_arfcn_stop;
struct l1ctl_pm_req *pmr;
int rc = 0;
@@ -361,17 +361,17 @@ static int l1ctl_rx_pm_req(struct l1ctl_link *l1l, struct msgb *msg)
goto exit;
}
- arfcn_start = ntohs(pmr->range.band_arfcn_from);
- arfcn_stop = ntohs(pmr->range.band_arfcn_to);
+ band_arfcn_start = ntohs(pmr->range.band_arfcn_from);
+ band_arfcn_stop = ntohs(pmr->range.band_arfcn_to);
LOGP(DL1C, LOGL_NOTICE, "Received power measurement "
"request (%s: %d -> %d)\n",
- gsm_band_name(gsm_arfcn2band(arfcn_start)),
- arfcn_start &~ ARFCN_FLAG_MASK,
- arfcn_stop &~ ARFCN_FLAG_MASK);
+ gsm_band_name(gsm_arfcn2band(band_arfcn_start)),
+ band_arfcn_start &~ ARFCN_FLAG_MASK,
+ band_arfcn_stop &~ ARFCN_FLAG_MASK);
/* Send measurement request to transceiver */
- rc = trx_if_cmd_measure(l1l->trx, arfcn_start, arfcn_stop);
+ rc = trx_if_cmd_measure(l1l->trx, band_arfcn_start, band_arfcn_stop);
exit:
msgb_free(msg);
diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c
index cab5a9bd..e08857cd 100644
--- a/src/host/trxcon/trx_if.c
+++ b/src/host/trxcon/trx_if.c
@@ -310,28 +310,28 @@ int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, uint8_t type)
* RSP (RX/TX)TUNE <status> <kHz>
*/
-int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t arfcn)
+int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t band_arfcn)
{
uint16_t freq10;
/* RX is downlink on MS side */
- freq10 = gsm_arfcn2freq10(arfcn, 0);
+ freq10 = gsm_arfcn2freq10(band_arfcn, 0);
if (freq10 == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", arfcn);
+ LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn);
return -ENOTSUP;
}
return trx_ctrl_cmd(trx, 1, "RXTUNE", "%d", freq10 * 100);
}
-int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t arfcn)
+int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t band_arfcn)
{
uint16_t freq10;
/* TX is uplink on MS side */
- freq10 = gsm_arfcn2freq10(arfcn, 1);
+ freq10 = gsm_arfcn2freq10(band_arfcn, 1);
if (freq10 == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", arfcn);
+ LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn);
return -ENOTSUP;
}
@@ -351,18 +351,18 @@ int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t arfcn)
*/
int trx_if_cmd_measure(struct trx_instance *trx,
- uint16_t arfcn_start, uint16_t arfcn_stop)
+ uint16_t band_arfcn_start, uint16_t band_arfcn_stop)
{
uint16_t freq10;
/* Update ARFCN range for measurement */
- trx->pm_arfcn_start = arfcn_start;
- trx->pm_arfcn_stop = arfcn_stop;
+ trx->pm_band_arfcn_start = band_arfcn_start;
+ trx->pm_band_arfcn_stop = band_arfcn_stop;
/* Calculate a frequency for current ARFCN (DL) */
- freq10 = gsm_arfcn2freq10(arfcn_start, 0);
+ freq10 = gsm_arfcn2freq10(band_arfcn_start, 0);
if (freq10 == 0xffff) {
- LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", arfcn_start);
+ LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", band_arfcn_start);
return -ENOTSUP;
}
@@ -372,7 +372,7 @@ int trx_if_cmd_measure(struct trx_instance *trx,
static void trx_if_measure_rsp_cb(struct trx_instance *trx, char *resp)
{
unsigned int freq10;
- uint16_t arfcn;
+ uint16_t band_arfcn;
int dbm;
/* Parse freq. and power level */
@@ -380,22 +380,22 @@ static void trx_if_measure_rsp_cb(struct trx_instance *trx, char *resp)
freq10 /= 100;
/* Check received ARFCN against expected */
- arfcn = gsm_freq102arfcn((uint16_t) freq10, 0);
- if (arfcn != trx->pm_arfcn_start) {
+ band_arfcn = gsm_freq102arfcn((uint16_t) freq10, 0);
+ if (band_arfcn != trx->pm_band_arfcn_start) {
LOGP(DTRX, LOGL_ERROR, "Power measurement error: "
"response ARFCN=%u doesn't match expected ARFCN=%u\n",
- arfcn &~ ARFCN_FLAG_MASK,
- trx->pm_arfcn_start &~ ARFCN_FLAG_MASK);
+ band_arfcn &~ ARFCN_FLAG_MASK,
+ trx->pm_band_arfcn_start &~ ARFCN_FLAG_MASK);
return;
}
/* Send L1CTL_PM_CONF */
- l1ctl_tx_pm_conf(trx->l1l, arfcn, dbm,
- arfcn == trx->pm_arfcn_stop);
+ l1ctl_tx_pm_conf(trx->l1l, band_arfcn, dbm,
+ band_arfcn == trx->pm_band_arfcn_stop);
/* Schedule a next measurement */
- if (arfcn != trx->pm_arfcn_stop)
- trx_if_cmd_measure(trx, ++arfcn, trx->pm_arfcn_stop);
+ if (band_arfcn != trx->pm_band_arfcn_stop)
+ trx_if_cmd_measure(trx, ++band_arfcn, trx->pm_band_arfcn_stop);
}
/*
diff --git a/src/host/trxcon/trx_if.h b/src/host/trxcon/trx_if.h
index 6080dcee..ed6bd3f9 100644
--- a/src/host/trxcon/trx_if.h
+++ b/src/host/trxcon/trx_if.h
@@ -28,8 +28,8 @@ struct trx_instance {
uint32_t prev_state;
/* GSM L1 specific */
- uint16_t pm_arfcn_start;
- uint16_t pm_arfcn_stop;
+ uint16_t pm_band_arfcn_start;
+ uint16_t pm_band_arfcn_stop;
uint16_t band_arfcn;
uint8_t tx_power;
uint8_t bsic;
@@ -66,13 +66,13 @@ int trx_if_cmd_adjpower(struct trx_instance *trx, int db);
int trx_if_cmd_setta(struct trx_instance *trx, int8_t ta);
-int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t arfcn);
-int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t arfcn);
+int trx_if_cmd_rxtune(struct trx_instance *trx, uint16_t band_arfcn);
+int trx_if_cmd_txtune(struct trx_instance *trx, uint16_t band_arfcn);
int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, uint8_t type);
int trx_if_cmd_measure(struct trx_instance *trx,
- uint16_t arfcn_start, uint16_t arfcn_stop);
+ uint16_t band_arfcn_start, uint16_t band_arfcn_stop);
int trx_if_tx_burst(struct trx_instance *trx, uint8_t tn, uint32_t fn,
uint8_t pwr, const ubit_t *bits);