summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h')
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h105
1 files changed, 90 insertions, 15 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
index 6e9c197c..1f0db785 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
@@ -1,11 +1,16 @@
#ifndef _GSM48_MM_H
#define _GSM48_MM_H
+struct gsm_settings;
+
/* GSM 04.07 9.2.2 */
#define GSM48_MMXX_MASK 0xf00
#define GSM48_MMCC_CLASS 0x100
#define GSM48_MMSS_CLASS 0x200
#define GSM48_MMSMS_CLASS 0x300
+#define GSM48_MMGCC_CLASS 0x500
+#define GSM48_MMBCC_CLASS 0x600
+#define GSM48_MMXX_REL_IND 0x022
#define GSM48_MMCC_EST_REQ 0x110
#define GSM48_MMCC_EST_IND 0x112
#define GSM48_MMCC_EST_CNF 0x111
@@ -49,19 +54,67 @@
#define GSM48_MMSMS_ERR_IND 0x372
#define GSM48_MMSMS_PROMPT_IND 0x382
#define GSM48_MMSMS_PROMPT_REJ 0x384
+/* MM messages for Voice Group/Broadcast Calls */
+#define GSM48_MMGCC_EST_REQ 0x510
+#define GSM48_MMGCC_EST_CNF 0x511
+#define GSM48_MMGCC_REL_REQ 0x520
+#define GSM48_MMGCC_REL_IND 0x522
+#define GSM48_MMGCC_DATA_REQ 0x530
+#define GSM48_MMGCC_DATA_IND 0x532
+#define GSM48_MMGCC_UNIT_DATA_REQ 0x540
+#define GSM48_MMGCC_UNIT_DATA_IND 0x542
+#define GSM48_MMGCC_REEST_REQ 0x560
+#define GSM48_MMGCC_REEST_CNF 0x561
+#define GSM48_MMGCC_ERR_IND 0x572
+#define GSM48_MMGCC_NOTIF_IND 0x582
+#define GSM48_MMGCC_GROUP_REQ 0x590
+#define GSM48_MMGCC_GROUP_CNF 0x591
+#define GSM48_MMGCC_UPLINK_REQ 0x5a0
+#define GSM48_MMGCC_UPLINK_CNF 0x5a1
+#define GSM48_MMGCC_UPLINK_REL_REQ 0x5a8
+#define GSM48_MMGCC_UPLINK_REL_IND 0x5aa
+#define GSM48_MMGCC_UPLINK_FREE_IND 0x5b2
+#define GSM48_MMGCC_UPLINK_BUSY_IND 0x5b6
+#define GSM48_MMBCC_EST_REQ 0x610
+#define GSM48_MMBCC_EST_CNF 0x611
+#define GSM48_MMBCC_REL_REQ 0x620
+#define GSM48_MMBCC_REL_IND 0x622
+#define GSM48_MMBCC_DATA_REQ 0x630
+#define GSM48_MMBCC_DATA_IND 0x632
+#define GSM48_MMBCC_UNIT_DATA_REQ 0x640
+#define GSM48_MMBCC_UNIT_DATA_IND 0x642
+#define GSM48_MMBCC_REEST_REQ 0x660
+#define GSM48_MMBCC_REEST_CNF 0x661
+#define GSM48_MMBCC_ERR_IND 0x672
+#define GSM48_MMBCC_NOTIF_IND 0x682
+#define GSM48_MMBCC_GROUP_REQ 0x690
+#define GSM48_MMBCC_GROUP_CNF 0x691
+#define GSM48_MMBCC_UPLINK_REQ 0x6a0
+#define GSM48_MMBCC_UPLINK_CNF 0x6a1
+#define GSM48_MMBCC_UPLINK_REL_REQ 0x6a8
+#define GSM48_MMBCC_UPLINK_REL_IND 0x6aa
+#define GSM48_MMBCC_UPLINK_FREE_IND 0x6b2
+#define GSM48_MMBCC_UPLINK_BUSY_IND 0x6b6
+
#define MMXX_ALLOC_SIZE 256
#define MMXX_ALLOC_HEADROOM 64
+#define MMXX_NOTIFY_SETUP 0
+#define MMXX_NOTIFY_RELEASE 1
+
/* MMxx-SAP header */
struct gsm48_mmxx_hdr {
- int msg_type; /* MMxx_* primitive */
- uint32_t ref; /* reference to transaction */
- uint32_t transaction_id; /* transaction identifier */
- uint8_t sapi; /* sapi */
- uint8_t emergency; /* emergency type of call */
- uint8_t cause; /* cause used for release */
-};
+ uint16_t msg_type; /* MMxx_* primitive */
+ uint32_t ref; /* reference to transaction */
+ uint32_t transaction_id; /* transaction identifier */
+ uint8_t sapi; /* sapi */
+ uint8_t emergency; /* emergency type of call */
+ uint8_t cause; /* cause used for release */
+ uint8_t notify; /* notify ongoing ASCI call */
+ bool ch_desc_present; /* notifies channel */
+ struct gsm48_chan_desc ch_desc; /* group channel */
+} __attribute__((packed));
/* GSM 6.1.2 */
#define GSM48_MMR_REG_REQ 0x01
@@ -71,10 +124,9 @@ struct gsm48_mmxx_hdr {
/* MMR-SAP header */
struct gsm48_mmr {
- int msg_type;
-
+ uint8_t msg_type;
uint8_t cause;
-};
+} __attribute__((packed));
/* GSM 04.07 9.2.1 */
#define GSM48_MMXX_ST_IDLE 0
@@ -134,13 +186,26 @@ struct gsm48_mmr {
#define GSM48_MM_EVENT_SYSINFO 14
#define GSM48_MM_EVENT_USER_PLMN_SEL 15
#define GSM48_MM_EVENT_LOST_COVERAGE 16
+#define GSM48_MM_EVENT_NOTIFICATION 17
+#define GSM48_MM_EVENT_UPLINK_FREE 18
+#define GSM48_MM_EVENT_UPLINK_BUSY 19
/* message for MM events */
struct gsm48_mm_event {
- uint32_t msg_type;
+ uint32_t msg_type;
- uint8_t sres[4];
-};
+ union {
+ /* GSM48_MM_EVENT_AUTH_RESPONSE */
+ uint8_t sres[4];
+ /* GSM48_MM_EVENT_NOTIFICATION */
+ struct {
+ uint8_t gcr[5];
+ bool ch_desc_present;
+ struct gsm48_chan_desc ch_desc;
+ bool gone;
+ } __attribute__((packed)) notification;
+ };
+} __attribute__((packed));
/* GSM 04.08 MM timers */
#define GSM_T3210_MS 20, 0
@@ -185,7 +250,7 @@ struct gsm48_mmlayer {
uint8_t lupd_rej_cause; /* cause of last reject */
uint8_t lupd_periodic; /* periodic update pending */
uint8_t lupd_retry; /* pending T3211/T3213 to */
- uint16_t lupd_mcc, lupd_mnc, lupd_lac;
+ struct osmo_location_area_id lupd_lai;
/* imsi detach */
uint8_t delay_detach; /* do detach when possible */
@@ -197,6 +262,14 @@ struct gsm48_mmlayer {
/* sapi 3 */
int sapi3_link;
+
+ /* VGCS additional states */
+ struct {
+ bool enabled; /* We are in group/broadcast mode. */
+ bool group_call; /* This is a group call, not a broadcast call. */
+ uint32_t callref; /* Callref of this call. */
+ bool normal_service; /* Service state before group transmit mode. */
+ } vgcs;
};
/* MM connection entry */
@@ -204,7 +277,7 @@ struct gsm48_mm_conn {
struct llist_head list;
struct gsm48_mmlayer *mm;
- /* ref and type form a unique tupple */
+ /* ref and protocol form a unique tuple */
uint32_t ref; /* reference to trans */
uint8_t protocol;
uint8_t transaction_id;
@@ -213,6 +286,8 @@ struct gsm48_mm_conn {
int state;
};
+int gsm48_encode_mi_lv(struct osmocom_ms *ms, struct msgb *msg, uint8_t mi_type, bool emergency_imsi);
+int gsm48_encode_mi_tlv(struct osmocom_ms *ms, struct msgb *msg, uint8_t mi_type, bool emergency_imsi);
uint8_t gsm48_current_pwr_lev(struct gsm_settings *set, uint16_t arfcn);
int gsm48_mm_init(struct osmocom_ms *ms);
int gsm48_mm_exit(struct osmocom_ms *ms);