aboutsummaryrefslogtreecommitdiffstats
path: root/src/pdch.h
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-10-05 21:57:14 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-11-17 02:35:18 +0700
commitbd0dac3783a27023b0aaaa2c7db99c021866b7b5 (patch)
tree04827c4be21344b9c8276cf4380a9a5fabed0f9d /src/pdch.h
parent0bf622e0573ae44b90f14a0bbc2a9ef21f5bf457 (diff)
PTCCH: implement basic message codec and API
Diffstat (limited to 'src/pdch.h')
-rw-r--r--src/pdch.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pdch.h b/src/pdch.h
index 30150233..d55f58e1 100644
--- a/src/pdch.h
+++ b/src/pdch.h
@@ -35,6 +35,11 @@ extern "C" {
#include <stdint.h>
+/* PTCCH (Packet Timing Advance Control Channel) */
+#define PTCCH_TAI_FREE 0x7f /*!< Special value for unused TA Indexes */
+#define PTCCH_TAI_NUM 16 /*!< Number of PTCCH/U slots and thus TA Indexes */
+#define PTCCH_PADDING 0x2b /*!< PTCCH/D messages need to be padded to 23 octets */
+
/*
* PDCH instance
*/
@@ -88,6 +93,19 @@ struct gprs_rlcmac_pdch {
struct llist_head paging_list; /* list of paging messages */
uint32_t last_rts_fn; /* store last frame number of RTS */
+ /* PTCCH (Packet Timing Advance Control Channel) */
+ uint8_t ptcch_msg[GSM_MACBLOCK_LEN]; /* 'ready to use' PTCCH/D message */
+#ifdef __cplusplus
+ /* Initialize the PTCCH/D message */
+ void init_ptcch_msg(void);
+ /* Obtain an unused TA Index for a TBF */
+ uint8_t reserve_tai(uint8_t ta);
+ /* Mark a given TA Index as free, so it can be used again */
+ void release_tai(uint8_t tai);
+ /* Update the actual Timing Advance value for a given TA Index */
+ void update_ta(uint8_t tai, uint8_t ta);
+#endif
+
/* back pointers */
struct gprs_rlcmac_trx *trx;
uint8_t ts_no;