diff options
author | Harald Welte <laforge@gnumonks.org> | 2019-05-27 17:34:02 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-05-27 23:34:21 +0200 |
commit | c1e2ff65250334d570a057245e3ecda91fa1a528 (patch) | |
tree | 9f3c193d0e7068e77eb1cd8fd342d442ea0cf1cc /src/host | |
parent | 9ba051bae8bdb3866912decdfdc26ccb62ec9051 (diff) |
trxcon: Use RSL channel mode #defines from libosmogsm
Wherever possible, use #defines from libosmogsm as opposed to magic
numbers. Using magic numbers in several places has the danger of
different programs/repositories having different views on what those
values mean.
Change-Id: I7ab4958801b3422973b67ff0452b90afa8a3f501
Related: OS#4027
Depends: libosmocore Change-Id I93e557358cf1c1b622f77f906959df7ca6d5cb12
Diffstat (limited to 'src/host')
-rw-r--r-- | src/host/trxcon/sched_lchan_desc.c | 19 | ||||
-rw-r--r-- | src/host/trxcon/sched_trx.c | 13 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/host/trxcon/sched_lchan_desc.c b/src/host/trxcon/sched_lchan_desc.c index ee712d55..8bc336e5 100644 --- a/src/host/trxcon/sched_lchan_desc.c +++ b/src/host/trxcon/sched_lchan_desc.c @@ -23,6 +23,7 @@ * */ +#include <osmocom/gsm/protocol/gsm_08_58.h> #include "sched_trx.h" /* Forward declaration of handlers */ @@ -94,31 +95,31 @@ const struct trx_lchan_desc trx_lchan_desc[_TRX_CHAN_MAX] = { }, { TRXC_BCCH, "BCCH", - 0x80, TRX_CH_LID_DEDIC, + RSL_CHAN_BCCH, TRX_CH_LID_DEDIC, 4 * GSM_BURST_PL_LEN, TRX_CH_FLAG_AUTO, rx_data_fn, NULL, }, { TRXC_RACH, "RACH", - 0x88, TRX_CH_LID_DEDIC, + RSL_CHAN_RACH, TRX_CH_LID_DEDIC, 0x00, TRX_CH_FLAG_AUTO, NULL, tx_rach_fn, }, { TRXC_CCCH, "CCCH", - 0x90, TRX_CH_LID_DEDIC, + RSL_CHAN_PCH_AGCH, TRX_CH_LID_DEDIC, 4 * GSM_BURST_PL_LEN, TRX_CH_FLAG_AUTO, rx_data_fn, NULL, }, { TRXC_TCHF, "TCH/F", - 0x08, TRX_CH_LID_DEDIC, + RSL_CHAN_Bm_ACCHs, TRX_CH_LID_DEDIC, 8 * GSM_BURST_PL_LEN, TRX_CH_FLAG_CBTX, rx_tchf_fn, tx_tchf_fn, }, { TRXC_TCHH_0, "TCH/H(0)", - 0x10, TRX_CH_LID_DEDIC, + RSL_CHAN_Lm_ACCHs, TRX_CH_LID_DEDIC, 6 * GSM_BURST_PL_LEN, TRX_CH_FLAG_CBTX, rx_tchh_fn, tx_tchh_fn, }, @@ -292,25 +293,25 @@ const struct trx_lchan_desc trx_lchan_desc[_TRX_CHAN_MAX] = { }, { TRXC_PDTCH, "PDTCH", - 0xc0, TRX_CH_LID_DEDIC, + RSL_CHAN_OSMO_PDCH, TRX_CH_LID_DEDIC, 12 * GSM_BURST_PL_LEN, TRX_CH_FLAG_PDCH, rx_pdtch_fn, tx_pdtch_fn, }, { TRXC_PTCCH, "PTCCH", - 0xc0, TRX_CH_LID_DEDIC, + RSL_CHAN_OSMO_PDCH, TRX_CH_LID_DEDIC, 4 * GSM_BURST_PL_LEN, TRX_CH_FLAG_PDCH, rx_data_fn, tx_data_fn, }, [TRXC_SDCCH4_CBCH] = { TRXC_SDCCH4_CBCH, "SDCCH/4(CBCH)", - 0xc8, TRX_CH_LID_DEDIC, + RSL_CHAN_OSMO_CBCH4, TRX_CH_LID_DEDIC, 4 * GSM_BURST_PL_LEN, TRX_CH_FLAG_AUTO, rx_data_fn, NULL, }, [TRXC_SDCCH8_CBCH] = { TRXC_SDCCH8_CBCH, "SDCCH/8(CBCH)", - 0xd0, TRX_CH_LID_DEDIC, + RSL_CHAN_OSMO_CBCH8, TRX_CH_LID_DEDIC, 4 * GSM_BURST_PL_LEN, 0x00, rx_data_fn, NULL, }, diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c index 721db026..4c93a3c4 100644 --- a/src/host/trxcon/sched_trx.c +++ b/src/host/trxcon/sched_trx.c @@ -29,6 +29,7 @@ #include <stdbool.h> #include <osmocom/gsm/a5.h> +#include <osmocom/gsm/protocol/gsm_08_58.h> #include <osmocom/core/bits.h> #include <osmocom/core/msgb.h> #include <osmocom/core/logging.h> @@ -530,17 +531,17 @@ enum gsm_phys_chan_config sched_trx_chan_nr2pchan_config(uint8_t chan_nr) { uint8_t cbits = chan_nr >> 3; - if (cbits == 0x01) + if (cbits == ABIS_RSL_CHAN_NR_CBITS_Bm_ACCHs) return GSM_PCHAN_TCH_F; - else if ((cbits & 0x1e) == 0x02) + else if ((cbits & 0x1e) == ABIS_RSL_CHAN_NR_CBITS_Lm_ACCHs(0)) return GSM_PCHAN_TCH_H; - else if ((cbits & 0x1c) == 0x04) + else if ((cbits & 0x1c) == ABIS_RSL_CHAN_NR_CBITS_SDCCH4_ACCH(0)) return GSM_PCHAN_CCCH_SDCCH4; - else if ((cbits & 0x18) == 0x08) + else if ((cbits & 0x18) == ABIS_RSL_CHAN_NR_CBITS_SDCCH8_ACCH(0)) return GSM_PCHAN_SDCCH8_SACCH8C; - else if ((cbits & 0x1f) == 0x19) + else if ((cbits & 0x1f) == ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH4) return GSM_PCHAN_CCCH_SDCCH4_CBCH; - else if ((cbits & 0x1f) == 0x1a) + else if ((cbits & 0x1f) == ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH8) return GSM_PCHAN_SDCCH8_SACCH8C_CBCH; return GSM_PCHAN_NONE; |