From 1c6a56fb97fbe8cca0c0d09f4ccde686bfb1d638 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 9 Oct 2019 02:03:59 +0700 Subject: L1SAP: use RSL_CHAN_* definitions from libosmogsm Change-Id: I2708b5d5bb6b92f90766ac752bafd28cff2549b0 --- include/osmo-bts/l1sap.h | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 70b45647..ccfcacc7 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -2,6 +2,7 @@ #define L1SAP_H #include +#include /* lchan link ID */ #define LID_SACCH 0x40 @@ -15,16 +16,26 @@ #define L1SAP_CHAN2SS_BCCH(chan_nr) (CCCH_LCHAN) /* logical channel from chan_nr + link_id */ -#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == LID_SACCH) -#define L1SAP_IS_CHAN_TCHF(chan_nr) ((chan_nr & 0xf8) == 0x08) -#define L1SAP_IS_CHAN_TCHH(chan_nr) ((chan_nr & 0xf0) == 0x10) -#define L1SAP_IS_CHAN_SDCCH4(chan_nr) ((chan_nr & 0xe0) == 0x20) -#define L1SAP_IS_CHAN_SDCCH8(chan_nr) ((chan_nr & 0xc0) == 0x40) -#define L1SAP_IS_CHAN_BCCH(chan_nr) ((chan_nr & 0xf8) == 0x80) -#define L1SAP_IS_CHAN_RACH(chan_nr) ((chan_nr & 0xf8) == 0x88) -#define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90) -#define L1SAP_IS_CHAN_PDCH(chan_nr) ((chan_nr & 0xf8) == 0xc0) -#define L1SAP_IS_CHAN_CBCH(chan_nr) ((chan_nr & 0xf8) == 0xc8) +#define L1SAP_IS_LINK_SACCH(link_id) \ + ((link_id & 0xC0) == LID_SACCH) +#define L1SAP_IS_CHAN_TCHF(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_Bm_ACCHs) +#define L1SAP_IS_CHAN_TCHH(chan_nr) \ + ((chan_nr & 0xf0) == RSL_CHAN_Lm_ACCHs) +#define L1SAP_IS_CHAN_SDCCH4(chan_nr) \ + ((chan_nr & 0xe0) == RSL_CHAN_SDCCH4_ACCH) +#define L1SAP_IS_CHAN_SDCCH8(chan_nr) \ + ((chan_nr & 0xc0) == RSL_CHAN_SDCCH8_ACCH) +#define L1SAP_IS_CHAN_BCCH(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_BCCH) +#define L1SAP_IS_CHAN_RACH(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_RACH) +#define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_PCH_AGCH) +#define L1SAP_IS_CHAN_PDCH(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_OSMO_PDCH) +#define L1SAP_IS_CHAN_CBCH(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH4) /* rach type from ra */ #define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f) -- cgit v1.2.3