summaryrefslogtreecommitdiff
path: root/include/gsmd
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2006-09-02 10:32:06 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2006-09-02 10:32:06 +0000
commit1584a74a4acdfb17aab0d6a2b13b18a7799aa37d (patch)
tree3d20dd370920df32bedb5b7205fb9ee7d35bef8b /include/gsmd
first compiling (unfinished, not-working) version of userspace gsm infrastructure
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@40 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'include/gsmd')
-rw-r--r--include/gsmd/event.h52
-rw-r--r--include/gsmd/gsmd.h4
-rw-r--r--include/gsmd/usock.h83
3 files changed, 139 insertions, 0 deletions
diff --git a/include/gsmd/event.h b/include/gsmd/event.h
new file mode 100644
index 0000000..9403164
--- /dev/null
+++ b/include/gsmd/event.h
@@ -0,0 +1,52 @@
+#ifndef _GSMD_EVENT_H
+#define _GSMD_EVENT_H
+
+enum gsmd_events {
+ GSMD_EVT_NONE = 0,
+ GSMD_EVT_IN_CALL = 1, /* Incoming call */
+ GSMD_EVT_IN_SMS = 2, /* Incoming SMS */
+ GSMD_EVT_IN_GPRS = 3, /* Network initiated GPRS */
+ GSMD_EVT_IN_CLIP = 4, /* Incoming CLIP */
+ GSMD_EVT_NETREG = 5, /* Network (un)registration event */
+ GSMD_EVT_SIGNAL = 6, /* Signal quality event */
+ GSMD_EVT_PIN = 7, /* Modem is waiting for some PIN/PUK */
+ GSMD_EVT_OUT_STATUS = 8, /* Outgoing call status */
+ GSMD_EVT_OUT_COLP = 9, /* Outgoing COLP */
+ GSMD_EVT_CALL_WAIT = 10, /* Call Waiting */
+};
+
+/* Chapter 8.3 */
+enum gsmd_pin_type { /* waiting for ... */
+ GSMD_PIN_NONE = 0, /* not for any PIN */
+ GSMD_PIN_SIM_PIN = 1, /* SIM PIN */
+ GSMD_PIN_SIM_PUK = 2, /* SIM PUK */
+ GSMD_PIN_PH_SIM_PIN = 3, /* phone-to-SIM passowrd */
+ GSMD_PIN_PH_FSIM_PIN = 4, /* phone-to-very-first SIM password */
+ GSMD_PIN_PH_FSIM_PUK = 5, /* phone-to-very-first SIM PUK password */
+ GSMD_PIN_SIM_PIN2 = 6, /* SIM PIN2 */
+ GSMD_PIN_SIM_PUK2 = 7, /* SIM PUK2 */
+ GSMD_PIN_PH_NET_PIN = 8, /* netwokr personalisation password */
+ GSMD_PIN_PH_NET_PUK = 9, /* network personalisation PUK */
+ GSMD_PIN_PH_NETSUB_PIN = 10, /* network subset personalisation PIN */
+ GSMD_PIN_PH_NETSUB_PUK = 11, /* network subset personalisation PUK */
+ GSMD_PIN_PH_SP_PIN = 12, /* service provider personalisation PIN */
+ GSMD_PIN_PH_SP_PUK = 13, /* service provider personalisation PUK */
+ GSMD_PIN_PH_CORP_PIN = 14, /* corporate personalisation PIN */
+ GSMD_PIN_PH_CORP_PUK = 15, /* corporate personalisation PUK */
+};
+
+enum gsmd_call_type {
+ GSMD_CALL_NONE = 0,
+ GSMD_CALL_UNSPEC = 1,
+ GSMD_CALL_VOICE = 2,
+ GSMD_CALL_FAX = 4,
+ GSMD_CALL_DATA_SYNC = 5,
+ GSMD_CALL_DATA_REL_ASYNC= 6,
+ GSMD_CALL_DATA_REL_SYNC = 7,
+};
+
+enum gsmd_netreg_state {
+ GSMD_NETREG_NONE = 0,
+};
+
+#endif
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
new file mode 100644
index 0000000..f5b61d5
--- /dev/null
+++ b/include/gsmd/gsmd.h
@@ -0,0 +1,4 @@
+#ifndef _GSMD_H
+#define _GSMD_H
+
+#endif /* _GSMD_H */
diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h
new file mode 100644
index 0000000..43ed792
--- /dev/null
+++ b/include/gsmd/usock.h
@@ -0,0 +1,83 @@
+#ifndef _GSMD_USOCK_H
+#define _GSMD_USOCK_H
+
+#include <gsmd/event.h>
+
+#define GSMD_UNIX_SOCKET "\0gsmd"
+#define GSMD_UNIX_SOCKET_TYPE SOCK_SEQPACKET
+
+#define GSMD_PROTO_VERSION 1
+
+enum gsmd_prot_cmd {
+ GSMD_PCMD_NONE,
+ GSMD_PCMD_EVT_SUBSCRIPTIONS, /* alter event subscriptions */
+ GSMD_PCMD_PASSTHROUGH, /* transparent atcmd passthrough */
+};
+
+enum gsmd_pcmd_result {
+ GSMD_PCMD_OK = 0,
+ GSMD_PCMD_ERR_UNSPEC = 0xff,
+};
+
+struct gsmd_prot_hdr {
+ u_int16_t cmd;
+ u_int8_t result;
+ u_int8_t version;
+} __attribute__((packed));
+
+
+enum gsmd_msg_type {
+ GSMD_MSG_NONE = 0,
+ GSMD_MSG_EVENT = 1,
+ GSMD_MSG_PASSTHROUGH = 2,
+};
+
+enum gsmd_passthrough_type {
+ GSMD_PASSTHROUGH_NONE = 0,
+ GSMD_PASSTHROUGH_REQ = 1,
+ GSMD_PASSTHROUGH_RESP = 2,
+};
+
+/* Length from 3GPP TS 04.08, Clause 10.5.4.7 */
+
+#define GSMD_ADDR_MAXLEN 13
+struct gsmd_addr {
+ u_int8_t type;
+ char number[GSMD_ADDR_MAXLEN+1];
+};
+
+struct gsmd_evt_auxdata {
+ union {
+ struct {
+ enum gsmd_call_type type;
+ } call;
+ struct {
+ struct gsmd_addr addr;
+ } clip;
+ struct {
+ struct gsmd_addr addr;
+ } colp;
+ struct {
+ /* TBD */
+ struct gsmd_addr addr;
+ } sms;
+ struct {
+ enum gsmd_pin_type type;
+ } pin;
+ struct {
+ enum gsmd_netreg_state state;
+ u_int16_t lac;
+ u_int16_t ci;
+ } netreg;
+ } u;
+};
+
+struct gsmd_msg_hdr {
+ u_int8_t version;
+ u_int8_t msg_type;
+ u_int8_t msg_subtype;
+ u_int8_t len;
+} __attribute__((packed));
+
+
+#endif
personal git repositories of Harald Welte. Your mileage may vary