aboutsummaryrefslogtreecommitdiffstats
path: root/include/gprs.h
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-06-25 16:22:19 +0200
committerPaul Kocialkowski <contact@paulk.fr>2013-06-25 16:22:19 +0200
commit9d1137d9197552439af937fee4b9ec5368f562bf (patch)
treeea7fc5e6a73761d414daa9f09eadf05a5937bb89 /include/gprs.h
parente207275718352c781c5ddcfdd1015fde36259e9b (diff)
downloadexternal_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.zip
external_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.tar.gz
external_libsamsung-ipc-9d1137d9197552439af937fee4b9ec5368f562bf.tar.bz2
Drop support for the (incomplete) old protocol implementation used on H1.
Also refactor headers: values aligned to 16x4 spaces and other cosmetics Change-Id: I5a6f2c2471599c88c4be74591117d0ab2dfaaddf Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'include/gprs.h')
-rw-r--r--include/gprs.h121
1 files changed, 69 insertions, 52 deletions
diff --git a/include/gprs.h b/include/gprs.h
index 09da61d..f3f5fc1 100644
--- a/include/gprs.h
+++ b/include/gprs.h
@@ -1,6 +1,7 @@
-/**
+/*
* This file is part of libsamsung-ipc.
*
+ * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr>
* Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
*
* libsamsung-ipc is free software: you can redistribute it and/or modify
@@ -18,50 +19,64 @@
*
*/
-#ifndef __GPRS_H__
-#define __GPRS_H__
-
-#define IPC_GPRS_DEFINE_PDP_CONTEXT 0x0D01
-#define IPC_GPRS_QOS 0x0D02
-#define IPC_GPRS_PS 0x0D03
-#define IPC_GPRS_PDP_CONTEXT 0x0D04
-#define IPC_GPRS_ENTER_DATA 0x0D05
-#define IPC_GPRS_SHOW_PDP_ADDR 0x0D06
-#define IPC_GPRS_MS_CLASS 0x0D07
-#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D08
-#define IPC_GPRS_IP_CONFIGURATION 0x0D09
-#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D0A
-#define IPC_GPRS_TFT 0x0D0B
-#define IPC_GPRS_HSDPA_STATUS 0x0D0C
-#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0D
-#define IPC_GPRS_DATA_DORMANT 0x0D0E
-#define IPC_GPRS_DUN_PIN_CTRL 0x0D0F
-#define IPC_GPRS_CALL_STATUS 0x0D10
-#define IPC_GPRS_PORT_LIST 0x0D11
-
-#define IPC_GPRS_STATE_NOT_ENABLED 0x00
-#define IPC_GPRS_STATE_ENABLED 0x01
-#define IPC_GPRS_STATE_DISABLED 0x03
-
-#define IPC_GPRS_FAIL_INSUFFICIENT_RESOURCES 0x0004
-#define IPC_GPRS_FAIL_MISSING_UKNOWN_APN 0x0005
-#define IPC_GPRS_FAIL_UNKNOWN_PDP_ADDRESS_TYPE 0x0006
-#define IPC_GPRS_FAIL_USER_AUTHENTICATION 0x0007
-#define IPC_GPRS_FAIL_ACTIVATION_REJECT_GGSN 0x0008
-#define IPC_GPRS_FAIL_ACTIVATION_REJECT_UNSPECIFIED 0x0009
-#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUPPORTED 0x000A
-#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED 0x000B
-#define IPC_GPRS_FAIL_SERVICE_OPTION_OUT_OF_ORDER 0x000C
-#define IPC_GPRS_FAIL_NSAPI_IN_USE 0x000D
-
-#define IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT 3
+#include <samsung-ipc.h>
+
+#ifndef __SAMSUNG_IPC_GPRS_H__
+#define __SAMSUNG_IPC_GPRS_H__
+
+/*
+ * Types
+ */
+
+#define IPC_GPRS_DEFINE_PDP_CONTEXT 0x0D01
+#define IPC_GPRS_QOS 0x0D02
+#define IPC_GPRS_PS 0x0D03
+#define IPC_GPRS_PDP_CONTEXT 0x0D04
+#define IPC_GPRS_ENTER_DATA 0x0D05
+#define IPC_GPRS_SHOW_PDP_ADDR 0x0D06
+#define IPC_GPRS_MS_CLASS 0x0D07
+#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D08
+#define IPC_GPRS_IP_CONFIGURATION 0x0D09
+#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D0A
+#define IPC_GPRS_TFT 0x0D0B
+#define IPC_GPRS_HSDPA_STATUS 0x0D0C
+#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0D
+#define IPC_GPRS_DATA_DORMANT 0x0D0E
+#define IPC_GPRS_DUN_PIN_CTRL 0x0D0F
+#define IPC_GPRS_CALL_STATUS 0x0D10
+#define IPC_GPRS_PORT_LIST 0x0D11
+
+/*
+ * Values
+ */
+
+#define IPC_GPRS_STATE_NOT_ENABLED 0x00
+#define IPC_GPRS_STATE_ENABLED 0x01
+#define IPC_GPRS_STATE_DISABLED 0x03
+
+#define IPC_GPRS_FAIL_INSUFFICIENT_RESOURCES 0x0004
+#define IPC_GPRS_FAIL_MISSING_UKNOWN_APN 0x0005
+#define IPC_GPRS_FAIL_UNKNOWN_PDP_ADDRESS_TYPE 0x0006
+#define IPC_GPRS_FAIL_USER_AUTHENTICATION 0x0007
+#define IPC_GPRS_FAIL_ACTIVATION_REJECT_GGSN 0x0008
+#define IPC_GPRS_FAIL_ACTIVATION_REJECT_UNSPECIFIED 0x0009
+#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUPPORTED 0x000A
+#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED 0x000B
+#define IPC_GPRS_FAIL_SERVICE_OPTION_OUT_OF_ORDER 0x000C
+#define IPC_GPRS_FAIL_NSAPI_IN_USE 0x000D
+
+#define IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT 0x03
+
+/*
+ * Structures
+ */
struct ipc_gprs_define_pdp_context {
unsigned char enable;
unsigned char cid;
unsigned char unk;
unsigned char apn[124];
-};
+} __attribute__((__packed__));
struct ipc_gprs_pdp_context_set {
unsigned char enable;
@@ -71,17 +86,17 @@ struct ipc_gprs_pdp_context_set {
unsigned char password[32];
unsigned char unk1[32];
unsigned char unk2;
-};
+} __attribute__((__packed__));
struct ipc_gprs_pdp_context_get_desc {
unsigned char cid;
unsigned char state;
-};
+} __attribute__((__packed__));
struct ipc_gprs_pdp_context_get {
unsigned char unk;
struct ipc_gprs_pdp_context_get_desc desc[IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT];
-};
+} __attribute__((__packed__));
struct ipc_gprs_ip_configuration {
unsigned char cid;
@@ -93,37 +108,39 @@ struct ipc_gprs_ip_configuration {
unsigned char gateway[4];
unsigned char subnet_mask[4];
unsigned char unk2[4];
-};
+} __attribute__((__packed__));
struct ipc_gprs_call_status {
unsigned char cid;
unsigned char state;
unsigned short fail_cause;
-};
+} __attribute__((__packed__));
struct ipc_gprs_hsdpa_status {
unsigned char reg_state;
-};
+} __attribute__((__packed__));
struct ipc_gprs_ps {
unsigned char unk[2];
-};
+} __attribute__((__packed__));
struct ipc_gprs_current_session_data_counter {
unsigned char cid;
unsigned int rx_count;
unsigned int tx_count;
-};
+} __attribute__((__packed__));
struct ipc_gprs_port_list {
unsigned char unk[804];
-};
+} __attribute__((__packed__));
+
+/*
+ * Helpers
+ */
void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message);
-void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message,
- unsigned char cid, int enable, char *username, char *password);
-void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message,
- unsigned char cid, int enable, char *apn);
+void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message, unsigned char cid, int enable, char *username, char *password);
+void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message, unsigned char cid, int enable, char *apn);
#endif