Andreas Eversberg | aa85a2d | 2013-02-07 12:18:37 +0100 | [diff] [blame^] | 1 | #ifndef _OSMOCOM_L1SAP_H |
| 2 | #define _OSMOCOM_L1SAP_H |
| 3 | |
| 4 | #include <osmocom/core/prim.h> |
| 5 | |
| 6 | /*! \brief LAPDm related primitives (L1<->L2 SAP) */ |
| 7 | enum osmo_ph_prim { |
| 8 | PRIM_PH_DATA, /*!< \brief PH-DATA */ |
| 9 | PRIM_PH_RACH, /*!< \brief PH-RANDOM_ACCESS */ |
| 10 | PRIM_PH_CONN, /*!< \brief PH-CONNECT */ |
| 11 | PRIM_PH_EMPTY_FRAME, /*!< \brief PH-EMPTY_FRAME */ |
| 12 | PRIM_PH_RTS, /*!< \brief PH-RTS */ |
| 13 | }; |
| 14 | |
| 15 | /*! \brief for PH-RANDOM_ACCESS.req */ |
| 16 | struct ph_rach_req_param { |
| 17 | uint8_t ra; /*!< \brief Random Access */ |
| 18 | uint8_t ta; /*!< \brief Timing Advance */ |
| 19 | uint8_t tx_power; /*!< \brief Transmit Power */ |
| 20 | uint8_t is_combined_ccch;/*!< \brief Are we using a combined CCCH? */ |
| 21 | uint16_t offset; /*!< \brief Timing Offset */ |
| 22 | }; |
| 23 | |
| 24 | /*! \brief for PH-RANDOM_ACCESS.ind */ |
| 25 | struct ph_rach_ind_param { |
| 26 | uint8_t ra; /*!< \brief Random Access */ |
| 27 | uint8_t acc_delay; /*!< \brief Delay in bit periods */ |
| 28 | uint32_t fn; /*!< \brief GSM Frame Number at time of RA */ |
| 29 | }; |
| 30 | |
| 31 | /*! \brief for PH-[UNIT]DATA.{req,ind} */ |
| 32 | struct ph_data_param { |
| 33 | uint8_t link_id; /*!< \brief Link Identifier (Like RSL) */ |
| 34 | uint8_t chan_nr; /*!< \brief Channel Number (Like RSL) */ |
| 35 | }; |
| 36 | |
| 37 | /*! \brief for PH-CONN.ind */ |
| 38 | struct ph_conn_ind_param { |
| 39 | uint32_t fn; /*!< \brief GSM Frame Number */ |
| 40 | }; |
| 41 | |
| 42 | /*! \brief primitive header for LAPDm PH-SAP primitives */ |
| 43 | struct osmo_phsap_prim { |
| 44 | struct osmo_prim_hdr oph; /*!< \brief generic primitive header */ |
| 45 | union { |
| 46 | struct ph_data_param data; |
| 47 | struct ph_rach_req_param rach_req; |
| 48 | struct ph_rach_ind_param rach_ind; |
| 49 | struct ph_conn_ind_param conn_ind; |
| 50 | } u; /*!< \brief request-specific data */ |
| 51 | }; |
| 52 | |
| 53 | #endif /* _OSMOCOM_L1SAP_H */ |