From aa85a2d4b4988f5fe8271a076866c0669bb793f2 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 7 Feb 2013 12:18:37 +0100 Subject: Remove osmo_phsap_prim from lapdm.h and move to a seperate header file --- include/Makefile.am | 1 + include/osmocom/gsm/l1sap.h | 53 +++++++++++++++++++++++++++++++++++++++++++++ include/osmocom/gsm/lapdm.h | 50 +----------------------------------------- 3 files changed, 55 insertions(+), 49 deletions(-) create mode 100644 include/osmocom/gsm/l1sap.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am index b94abec7..3875fecd 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -57,6 +57,7 @@ nobase_include_HEADERS = \ osmocom/gsm/meas_rep.h \ osmocom/gsm/mncc.h \ osmocom/gsm/prim.h \ + osmocom/gsm/l1sap.h \ osmocom/gsm/protocol/gsm_03_41.h \ osmocom/gsm/protocol/gsm_04_08.h \ osmocom/gsm/protocol/gsm_04_11.h \ diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h new file mode 100644 index 00000000..9547c325 --- /dev/null +++ b/include/osmocom/gsm/l1sap.h @@ -0,0 +1,53 @@ +#ifndef _OSMOCOM_L1SAP_H +#define _OSMOCOM_L1SAP_H + +#include + +/*! \brief LAPDm related primitives (L1<->L2 SAP) */ +enum osmo_ph_prim { + PRIM_PH_DATA, /*!< \brief PH-DATA */ + PRIM_PH_RACH, /*!< \brief PH-RANDOM_ACCESS */ + PRIM_PH_CONN, /*!< \brief PH-CONNECT */ + PRIM_PH_EMPTY_FRAME, /*!< \brief PH-EMPTY_FRAME */ + PRIM_PH_RTS, /*!< \brief PH-RTS */ +}; + +/*! \brief for PH-RANDOM_ACCESS.req */ +struct ph_rach_req_param { + uint8_t ra; /*!< \brief Random Access */ + uint8_t ta; /*!< \brief Timing Advance */ + uint8_t tx_power; /*!< \brief Transmit Power */ + uint8_t is_combined_ccch;/*!< \brief Are we using a combined CCCH? */ + uint16_t offset; /*!< \brief Timing Offset */ +}; + +/*! \brief for PH-RANDOM_ACCESS.ind */ +struct ph_rach_ind_param { + uint8_t ra; /*!< \brief Random Access */ + uint8_t acc_delay; /*!< \brief Delay in bit periods */ + uint32_t fn; /*!< \brief GSM Frame Number at time of RA */ +}; + +/*! \brief for PH-[UNIT]DATA.{req,ind} */ +struct ph_data_param { + uint8_t link_id; /*!< \brief Link Identifier (Like RSL) */ + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ +}; + +/*! \brief for PH-CONN.ind */ +struct ph_conn_ind_param { + uint32_t fn; /*!< \brief GSM Frame Number */ +}; + +/*! \brief primitive header for LAPDm PH-SAP primitives */ +struct osmo_phsap_prim { + struct osmo_prim_hdr oph; /*!< \brief generic primitive header */ + union { + struct ph_data_param data; + struct ph_rach_req_param rach_req; + struct ph_rach_ind_param rach_ind; + struct ph_conn_ind_param conn_ind; + } u; /*!< \brief request-specific data */ +}; + +#endif /* _OSMOCOM_L1SAP_H */ diff --git a/include/osmocom/gsm/lapdm.h b/include/osmocom/gsm/lapdm.h index 571fd460..a6e4ad72 100644 --- a/include/osmocom/gsm/lapdm.h +++ b/include/osmocom/gsm/lapdm.h @@ -1,6 +1,7 @@ #ifndef _OSMOCOM_LAPDM_H #define _OSMOCOM_LAPDM_H +#include #include /*! \defgroup lapdm LAPDm implementation according to GSM TS 04.06 @@ -9,55 +10,6 @@ /*! \file lapdm.h */ -/* primitive related sutff */ - -/*! \brief LAPDm related primitives (L1<->L2 SAP) */ -enum osmo_ph_prim { - PRIM_PH_DATA, /*!< \brief PH-DATA */ - PRIM_PH_RACH, /*!< \brief PH-RANDOM_ACCESS */ - PRIM_PH_CONN, /*!< \brief PH-CONNECT */ - PRIM_PH_EMPTY_FRAME, /*!< \brief PH-EMPTY_FRAME */ - PRIM_PH_RTS, /*!< \brief PH-RTS */ -}; - -/*! \brief for PH-RANDOM_ACCESS.req */ -struct ph_rach_req_param { - uint8_t ra; /*!< \brief Random Access */ - uint8_t ta; /*!< \brief Timing Advance */ - uint8_t tx_power; /*!< \brief Transmit Power */ - uint8_t is_combined_ccch;/*!< \brief Are we using a combined CCCH? */ - uint16_t offset; /*!< \brief Timing Offset */ -}; - -/*! \brief for PH-RANDOM_ACCESS.ind */ -struct ph_rach_ind_param { - uint8_t ra; /*!< \brief Random Access */ - uint8_t acc_delay; /*!< \brief Delay in bit periods */ - uint32_t fn; /*!< \brief GSM Frame Number at time of RA */ -}; - -/*! \brief for PH-[UNIT]DATA.{req,ind} */ -struct ph_data_param { - uint8_t link_id; /*!< \brief Link Identifier (Like RSL) */ - uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ -}; - -/*! \brief for PH-CONN.ind */ -struct ph_conn_ind_param { - uint32_t fn; /*!< \brief GSM Frame Number */ -}; - -/*! \brief primitive header for LAPDm PH-SAP primitives */ -struct osmo_phsap_prim { - struct osmo_prim_hdr oph; /*!< \brief generic primitive header */ - union { - struct ph_data_param data; - struct ph_rach_req_param rach_req; - struct ph_rach_ind_param rach_ind; - struct ph_conn_ind_param conn_ind; - } u; /*!< \brief request-specific data */ -}; - /*! \brief LAPDm mode/role */ enum lapdm_mode { LAPDM_MODE_MS, /*!< \brief behave like a MS (mobile phone) */ -- cgit v1.2.3 From 227a9de51e2797757f09bab86ee418ff039742fb Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Thu, 7 Feb 2013 12:21:33 +0100 Subject: Add MPH and TCH primitives to layer 1 SAP In order to control layer 1 via primitives, MPH primitives are required. There is only one (MPH-INFO) primitive defined in TS 04.04 for all control and measurement functions. A type identifier inside this primitive is used to differentiate between different functions. The TCH primitives are used to carry traffic. TCH primitives carry voice or data traffic, whereas PH-DATA primitives carry FACCH data. PH_RTS and TCH_RTS (ready-to-send) primitives are used to poll requests from upper layers. --- include/osmocom/gsm/l1sap.h | 75 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 9547c325..485acbfc 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -3,13 +3,27 @@ #include -/*! \brief LAPDm related primitives (L1<->L2 SAP) */ +/*! \brief PH-SAP related primitives (L1<->L2 SAP) */ enum osmo_ph_prim { PRIM_PH_DATA, /*!< \brief PH-DATA */ PRIM_PH_RACH, /*!< \brief PH-RANDOM_ACCESS */ PRIM_PH_CONN, /*!< \brief PH-CONNECT */ PRIM_PH_EMPTY_FRAME, /*!< \brief PH-EMPTY_FRAME */ PRIM_PH_RTS, /*!< \brief PH-RTS */ + PRIM_MPH_INFO, /*!< \brief MPH-INFO */ + PRIM_TCH, /*!< \brief TCH */ + PRIM_TCH_RTS, /*!< \brief TCH */ +}; + +/*! \brief PH-SAP related primitives (L1<->L2 SAP) */ +enum osmo_mph_info_type { + PRIM_INFO_TIME, /*!< \brief Current GSM time */ + PRIM_INFO_MEAS, /*!< \brief Measurement indication */ + PRIM_INFO_ACTIVATE, /*!< \brief Activation of channel */ + PRIM_INFO_DEACTIVATE, /*!< \brief Deactivation of channel */ + PRIM_INFO_MODIFY, /*!< \brief Mode Modify of channel */ + PRIM_INFO_ACT_CIPH, /*!< \brief Activation of ciphering */ + PRIM_INFO_DEACT_CIPH, /*!< \brief Deactivation of ciphering */ }; /*! \brief for PH-RANDOM_ACCESS.req */ @@ -28,10 +42,17 @@ struct ph_rach_ind_param { uint32_t fn; /*!< \brief GSM Frame Number at time of RA */ }; -/*! \brief for PH-[UNIT]DATA.{req,ind} */ +/*! \brief for PH-[UNIT]DATA.{req,ind} | PH-RTS.ind */ struct ph_data_param { uint8_t link_id; /*!< \brief Link Identifier (Like RSL) */ uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ + uint32_t fn; /*!< \brief GSM Frame Number */ +}; + +/*! \brief for TCH.{req,ind} | TCH-RTS.ind */ +struct ph_tch_param { + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ + uint32_t fn; /*!< \brief GSM Frame Number */ }; /*! \brief for PH-CONN.ind */ @@ -39,14 +60,62 @@ struct ph_conn_ind_param { uint32_t fn; /*!< \brief GSM Frame Number */ }; -/*! \brief primitive header for LAPDm PH-SAP primitives */ +/*! \brief for TIME MPH-INFO.ind */ +struct info_time_ind_param { + uint32_t fn; /*!< \brief GSM Frame Number */ +}; + +/*! \brief for MEAS MPH-INFO.ind */ +struct info_meas_ind_param { + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ + uint16_t ber10k; /*!< \brief BER in units of 0.01% */ + int16_t ta_offs_qbits; /*!< \brief timing advance offset (in qbits) */ + int16_t c_i_cb; /*!< \brief C/I ratio in 0.1 dB */ + uint8_t is_sub:1; /*!< \brief flags */ + uint8_t inv_rssi; /*!< \brief RSSI in dBm * -1 */ +}; + +/*! \brief for {ACTIVATE,DEACTIVATE,MODIFY} MPH-INFO.req */ +struct info_act_req_param { + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ + uint8_t sacch_only; /*!< \breif Only deactivate SACCH */ +}; + +/*! \brief for {ACTIVATE,DEACTIVATE} MPH-INFO.cnf */ +struct info_act_cnf_param { + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ + uint8_t cause; /*!< \brief RSL cause in case of nack */ +}; + +/*! \brief for {ACTIVATE,DEACTIVATE} MPH-INFO.{req,cnf} */ +struct info_ciph_req_param { + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ + uint8_t downlink; /*!< \brief Apply to downlink */ + uint8_t uplink; /*!< \brief Apply to uplink */ +}; + +/*! \brief for MPH-INFO.ind */ +struct mph_info_param { + enum osmo_mph_info_type type; /*!< \brief Info message type */ + union { + struct info_time_ind_param time_ind; + struct info_meas_ind_param meas_ind; + struct info_act_req_param act_req; + struct info_act_cnf_param act_cnf; + struct info_ciph_req_param ciph_req; + } u; +}; + +/*! \brief primitive header for PH-SAP primitives */ struct osmo_phsap_prim { struct osmo_prim_hdr oph; /*!< \brief generic primitive header */ union { struct ph_data_param data; + struct ph_tch_param tch; struct ph_rach_req_param rach_req; struct ph_rach_ind_param rach_ind; struct ph_conn_ind_param conn_ind; + struct mph_info_param info; } u; /*!< \brief request-specific data */ }; -- cgit v1.2.3 From 15b8057085a52daddc01b82c244b051a28309dfd Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 16 Mar 2013 16:34:55 +0100 Subject: Add RSSI to l1sap --- include/osmocom/gsm/l1sap.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 485acbfc..22cfcf1b 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -47,12 +47,14 @@ struct ph_data_param { uint8_t link_id; /*!< \brief Link Identifier (Like RSL) */ uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ uint32_t fn; /*!< \brief GSM Frame Number */ + int8_t rssi; /*!< \brief RSSI of receivedindication */ }; /*! \brief for TCH.{req,ind} | TCH-RTS.ind */ struct ph_tch_param { uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ uint32_t fn; /*!< \brief GSM Frame Number */ + int8_t rssi; /*!< \brief RSSI of received indication */ }; /*! \brief for PH-CONN.ind */ -- cgit v1.2.3 From 610517c8bd5f9e87729acdb4529c0870b0b5dced Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 12 Jun 2013 09:21:18 +0200 Subject: Add chan_nr to RACH info at L1SAP interface The chan_nr is required to locate timeslot and subslot of access bursts during handover procedure. --- include/osmocom/gsm/l1sap.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/osmocom/gsm/l1sap.h b/include/osmocom/gsm/l1sap.h index 22cfcf1b..c21abe5e 100644 --- a/include/osmocom/gsm/l1sap.h +++ b/include/osmocom/gsm/l1sap.h @@ -37,6 +37,7 @@ struct ph_rach_req_param { /*! \brief for PH-RANDOM_ACCESS.ind */ struct ph_rach_ind_param { + uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ uint8_t ra; /*!< \brief Random Access */ uint8_t acc_delay; /*!< \brief Delay in bit periods */ uint32_t fn; /*!< \brief GSM Frame Number at time of RA */ -- cgit v1.2.3 From c8cac64abbf91b1a515010b43347ab408caf2549 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 19 Jun 2013 20:58:59 +0200 Subject: Fix RR cause values --- include/osmocom/gsm/protocol/gsm_04_08.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index bb8a87ed..bd6d707a 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1052,9 +1052,9 @@ enum gsm48_rr_cause { GSM48_RR_CAUSE_ABNORMAL_TIMER = 0x03, GSM48_RR_CAUSE_ABNORMAL_NOACT = 0x04, GSM48_RR_CAUSE_PREMPTIVE_REL = 0x05, - GSM48_RR_CAUSE_HNDOVER_IMP = 0x06, - GSM48_RR_CAUSE_CHAN_MODE_UNACCT = 0x07, - GSM48_RR_CAUSE_FREQ_NOT_IMPL = 0x08, + GSM48_RR_CAUSE_HNDOVER_IMP = 0x08, + GSM48_RR_CAUSE_CHAN_MODE_UNACCT = 0x09, + GSM48_RR_CAUSE_FREQ_NOT_IMPL = 0x0a, GSM48_RR_CAUSE_CALL_CLEARED = 0x41, GSM48_RR_CAUSE_SEMANT_INCORR = 0x5f, GSM48_RR_CAUSE_INVALID_MAND_INF = 0x60, -- cgit v1.2.3 From c62a1bf4d53edec94b0db05da717d24438824357 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 2 Jul 2013 09:10:11 +0200 Subject: libosmogb: Add function to close NS instance without destroying it --- include/osmocom/gprs/gprs_ns.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 8fca70cb..8ca5a887 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -129,7 +129,10 @@ struct gprs_nsvc { /* Create a new NS protocol instance */ struct gprs_ns_inst *gprs_ns_instantiate(gprs_ns_cb_t *cb, void *ctx); -/* Destroy a NS protocol instance */ +/* Close a NS protocol instance */ +void gprs_ns_close(struct gprs_ns_inst *nsi); + +/* Close and Destroy a NS protocol instance */ void gprs_ns_destroy(struct gprs_ns_inst *nsi); /* Listen for incoming GPRS packets via NS/UDP */ -- cgit v1.2.3