diff options
Diffstat (limited to 'include/osmo-bts/l1sap.h')
-rw-r--r-- | include/osmo-bts/l1sap.h | 83 |
1 files changed, 66 insertions, 17 deletions
diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 70b45647..34259bd3 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -2,6 +2,9 @@ #define L1SAP_H #include <osmocom/gsm/protocol/gsm_04_08.h> +#include <osmocom/gsm/protocol/gsm_08_58.h> + +#define L1SAP_MSGB_HEADROOM 128 /* lchan link ID */ #define LID_SACCH 0x40 @@ -15,16 +18,32 @@ #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 || \ + (chan_nr & 0xf8) == RSL_CHAN_OSMO_VAMOS_Bm_ACCHs) +#define L1SAP_IS_CHAN_TCHH(chan_nr) \ + ((chan_nr & 0xf0) == RSL_CHAN_Lm_ACCHs || \ + (chan_nr & 0xf0) == RSL_CHAN_OSMO_VAMOS_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) \ + || ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH8) +#define L1SAP_IS_CHAN_VAMOS(chan_nr) \ + ((chan_nr & 0xf8) == RSL_CHAN_OSMO_VAMOS_Bm_ACCHs || \ + (chan_nr & 0xf0) == RSL_CHAN_OSMO_VAMOS_Lm_ACCHs) /* rach type from ra */ #define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f) @@ -79,25 +98,55 @@ void l1sap_rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl, uint32_t timestamp, bool marker); /* channel control */ -int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp); +int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_deact_sacch(struct gsm_bts_trx *trx, uint8_t chan_nr); int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr); +int l1sap_uplink_access(struct gsm_lchan *lchan, bool active); + +enum l1sap_common_sapi { + L1SAP_COMMON_SAPI_UNKNOWN, + /* alphabetic order */ + L1SAP_COMMON_SAPI_AGCH, + L1SAP_COMMON_SAPI_BCCH, + L1SAP_COMMON_SAPI_CBCH, + L1SAP_COMMON_SAPI_FACCH_F, + L1SAP_COMMON_SAPI_FACCH_H, + L1SAP_COMMON_SAPI_FCCH, + L1SAP_COMMON_SAPI_IDLE, + L1SAP_COMMON_SAPI_NCH, + L1SAP_COMMON_SAPI_PACCH, + L1SAP_COMMON_SAPI_PAGCH, + L1SAP_COMMON_SAPI_PBCCH, + L1SAP_COMMON_SAPI_PCH, + L1SAP_COMMON_SAPI_PDTCH, + L1SAP_COMMON_SAPI_PNCH, + L1SAP_COMMON_SAPI_PPCH, + L1SAP_COMMON_SAPI_PRACH, + L1SAP_COMMON_SAPI_PTCCH, + L1SAP_COMMON_SAPI_RACH, + L1SAP_COMMON_SAPI_SACCH, + L1SAP_COMMON_SAPI_SCH, + L1SAP_COMMON_SAPI_SDCCH, + L1SAP_COMMON_SAPI_TCH_F, + L1SAP_COMMON_SAPI_TCH_H, +}; -extern const struct value_string gsmtap_sapi_names[]; -extern struct gsmtap_inst *gsmtap; -extern uint32_t gsmtap_sapi_mask; -extern uint8_t gsmtap_sapi_acch; +extern uint16_t l1sap_log_ctx_sapi; +extern const struct value_string l1sap_common_sapi_names[]; int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, - uint16_t ber10k, int16_t lqual_cb); + uint16_t ber10k, int16_t lqual_cb, int8_t rssi, + int16_t ta_offs, uint8_t is_sub); #define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h) +void radio_link_timeout_reset(struct gsm_lchan *lchan); + int bts_check_for_first_ciphrd(struct gsm_lchan *lchan, uint8_t *data, int len); -int is_ccch_for_agch(struct gsm_bts_trx *trx, uint32_t fn); +enum ccch_msgt get_ccch_msgt(struct gsm_bts_trx *trx, uint32_t fn); #endif /* L1SAP_H */ |