Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 1 | /*! \file gprs_rlc.h */ |
| 2 | |
Tom Tsou | 9a5bbf3 | 2016-07-14 15:13:45 -0700 | [diff] [blame] | 3 | #pragma once |
| 4 | |
| 5 | #include <stdint.h> |
| 6 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 7 | /*! Structure for CPS coding and puncturing scheme (TS 04.60 10.4.8a) */ |
Tom Tsou | 9a5bbf3 | 2016-07-14 15:13:45 -0700 | [diff] [blame] | 8 | struct egprs_cps { |
| 9 | uint8_t bits; |
| 10 | uint8_t mcs; |
| 11 | uint8_t p[2]; |
| 12 | }; |
| 13 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 14 | /*! CPS puncturing table selection (TS 04.60 10.4.8a) */ |
Tom Tsou | 9a5bbf3 | 2016-07-14 15:13:45 -0700 | [diff] [blame] | 15 | enum egprs_cps_punc { |
| 16 | EGPRS_CPS_P1, |
| 17 | EGPRS_CPS_P2, |
| 18 | EGPRS_CPS_P3, |
| 19 | EGPRS_CPS_NONE = -1, |
| 20 | }; |
| 21 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 22 | /*! EGPRS header types (TS 04.60 10.0a.2) */ |
Tom Tsou | 9a5bbf3 | 2016-07-14 15:13:45 -0700 | [diff] [blame] | 23 | enum egprs_hdr_type { |
| 24 | EGPRS_HDR_TYPE1, |
| 25 | EGPRS_HDR_TYPE2, |
| 26 | EGPRS_HDR_TYPE3, |
| 27 | }; |
| 28 | |
Harald Welte | 35b2632 | 2017-07-31 19:36:52 +0200 | [diff] [blame] | 29 | enum osmo_gprs_cs { |
| 30 | OSMO_GPRS_CS_NONE, |
| 31 | OSMO_GPRS_CS1, |
| 32 | OSMO_GPRS_CS2, |
| 33 | OSMO_GPRS_CS3, |
| 34 | OSMO_GPRS_CS4, |
| 35 | OSMO_GPRS_MCS1, |
| 36 | OSMO_GPRS_MCS2, |
| 37 | OSMO_GPRS_MCS3, |
| 38 | OSMO_GPRS_MCS4, |
| 39 | OSMO_GPRS_MCS5, |
| 40 | OSMO_GPRS_MCS6, |
| 41 | OSMO_GPRS_MCS7, |
| 42 | OSMO_GPRS_MCS8, |
| 43 | OSMO_GPRS_MCS9, |
| 44 | _NUM_OSMO_GPRS_CS |
| 45 | }; |
| 46 | |
Tom Tsou | 9a5bbf3 | 2016-07-14 15:13:45 -0700 | [diff] [blame] | 47 | int egprs_get_cps(struct egprs_cps *cps, uint8_t type, uint8_t bits); |
Harald Welte | 35b2632 | 2017-07-31 19:36:52 +0200 | [diff] [blame] | 48 | |
| 49 | int osmo_gprs_ul_block_size_bits(enum osmo_gprs_cs cs); |
| 50 | int osmo_gprs_dl_block_size_bits(enum osmo_gprs_cs cs); |
| 51 | int osmo_gprs_ul_block_size_bytes(enum osmo_gprs_cs cs); |
| 52 | int osmo_gprs_dl_block_size_bytes(enum osmo_gprs_cs cs); |
| 53 | enum osmo_gprs_cs osmo_gprs_ul_cs_by_block_bytes(uint8_t block_size); |
| 54 | enum osmo_gprs_cs osmo_gprs_dl_cs_by_block_bytes(uint8_t block_size); |