aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/device/crespo/gen.h31
-rw-r--r--include/device/crespo/net.h41
-rw-r--r--include/device/h1/gen.h31
-rw-r--r--include/device/h1/net.h39
-rw-r--r--include/gen.h12
-rw-r--r--include/gprs.h21
-rw-r--r--include/misc.h4
-rw-r--r--include/net.h26
-rw-r--r--include/radio.h39
-rw-r--r--include/sec.h4
-rw-r--r--include/types.h6
11 files changed, 196 insertions, 58 deletions
diff --git a/include/device/crespo/gen.h b/include/device/crespo/gen.h
new file mode 100644
index 0000000..34f5ce9
--- /dev/null
+++ b/include/device/crespo/gen.h
@@ -0,0 +1,31 @@
+/**
+ * This file is part of libsamsung-ipc.
+ *
+ * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
+ *
+ * libsamsung-ipc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libsamsung-ipc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __DEVICE_CRESPO_GEN_H__
+#define __DEVICE_CRESPO_GEN_H__
+
+struct ipc_gen_phone_res {
+ unsigned char group, type;
+ unsigned char unk;
+ unsigned short code;
+} __attribute__((__packed__));
+
+#endif
diff --git a/include/device/crespo/net.h b/include/device/crespo/net.h
new file mode 100644
index 0000000..b6a1750
--- /dev/null
+++ b/include/device/crespo/net.h
@@ -0,0 +1,41 @@
+/**
+ * This file is part of libsamsung-ipc.
+ *
+ * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
+ *
+ * libsamsung-ipc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libsamsung-ipc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __DEVICE_CRESPO_NET_H__
+#define __DEVICE_CRESPO_NET_H__
+
+#define IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN 0xff
+#define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x00
+#define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x01
+#define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x02
+#define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x03
+#define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x04
+
+struct ipc_net_current_plmn {
+ char unk0;
+ unsigned char slevel;
+ char unk1;
+ unsigned char plmn[5];
+ unsigned char type; // IPC_NET_SERVICE_TYPE_... ?
+ unsigned short lac;
+} __attribute__((__packed__));
+
+#endif
diff --git a/include/device/h1/gen.h b/include/device/h1/gen.h
new file mode 100644
index 0000000..f74ad55
--- /dev/null
+++ b/include/device/h1/gen.h
@@ -0,0 +1,31 @@
+/**
+ * This file is part of libsamsung-ipc.
+ *
+ * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
+ *
+ * libsamsung-ipc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libsamsung-ipc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __DEVICE_H1_GEN_H__
+#define __DEVICE_H1_GEN_H__
+
+struct ipc_gen_phone_res {
+ unsigned char group, type;
+ unsigned short code;
+ unsigned char unk;
+} __attribute__((__packed__));
+
+#endif
diff --git a/include/device/h1/net.h b/include/device/h1/net.h
new file mode 100644
index 0000000..c2de8ec
--- /dev/null
+++ b/include/device/h1/net.h
@@ -0,0 +1,39 @@
+/**
+ * This file is part of libsamsung-ipc.
+ *
+ * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com>
+ * Copyright (C) 2011 Simon Busch <morphis@gravedo.de>
+ *
+ * libsamsung-ipc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * libsamsung-ipc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with libsamsung-ipc. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __DEVICE_H1_NET_H__
+#define __DEVICE_H1_NET_H__
+
+#define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x01
+#define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x02
+#define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x03
+#define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x04
+#define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x05
+
+struct ipc_net_current_plmn {
+ char unk0;
+ unsigned char slevel;
+ unsigned char plmn[6];
+ unsigned char type;
+ unsigned short lac;
+} __attribute__((__packed__));
+
+#endif
diff --git a/include/gen.h b/include/gen.h
index aae309b..e318168 100644
--- a/include/gen.h
+++ b/include/gen.h
@@ -21,13 +21,13 @@
#ifndef __GEN_H__
#define __GEN_H__
-#define IPC_GEN_PHONE_RES 0x8001
+#if defined(DEVICE_CRESPO)
+#include "device/crespo/gen.h"
+#elif defined(DEVICE_H1)
+#include "device/h1/gen.h"
+#endif
-struct ipc_gen_phone_res {
- unsigned char group, type;
- unsigned char unk;
- unsigned short code;
-} __attribute__((__packed__));
+#define IPC_GEN_PHONE_RES 0x8001
#endif
diff --git a/include/gprs.h b/include/gprs.h
index 78aa299..b32b2de 100644
--- a/include/gprs.h
+++ b/include/gprs.h
@@ -25,17 +25,18 @@
#define IPC_GPRS_QOS 0x0D02
#define IPC_GPRS_PS 0x0D03
#define IPC_GPRS_PDP_CONTEXT 0x0D04
-#define IPC_GPRS_SHOW_PDP_ADDR 0x0D05
-#define IPC_GPRS_MS_CLASS 0x0D06
-#define IPC_GPRS_3G_QUAL_SERVICE_PROFILE 0x0D07
-#define IPC_GPRS_DEFINE_SEC_PDP_CONTEXT 0x0D08
+#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_TFT 0x0D0A
-#define IPC_GPRS_HSDPA_STATUS 0x0D0B
-#define IPC_GPRS_CURRENT_SESSION_DATA_COUNT 0x0D0C
-#define IPC_GPRS_DATA_DORMANT 0x0D0D
-#define IPC_GPRS_DUN_PIN_CTRL 0x0D0E
-#define IPC_GPRS_CALL_STATUS 0x0D0F
+#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_CALL_STATUS_TYPE_ON 0x0
#define IPC_GPRS_CALL_STATUS_TYPE_OFF 0x3
diff --git a/include/misc.h b/include/misc.h
index cc26c93..111fe7b 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -21,7 +21,7 @@
#ifndef __MISC_H__
#define __MISC_H__
-struct ipc_response;
+struct ipc_message_info;
#define IPC_MISC_ME_VERSION 0x0A01
#define IPC_MISC_ME_IMSI 0x0A02
@@ -43,7 +43,7 @@ struct ipc_misc_time_info {
char plmn[6];
} __attribute__((__packed__));
-char* ipc_misc_me_imsi_response_get_imsi(struct ipc_response *response);
+char* ipc_misc_me_imsi_response_get_imsi(struct ipc_message_info *response);
#endif
diff --git a/include/net.h b/include/net.h
index 444d52b..fe6f328 100644
--- a/include/net.h
+++ b/include/net.h
@@ -21,6 +21,12 @@
#ifndef __NET_H__
#define __NET_H__
+#if defined(DEVICE_CRESPO)
+#include "device/crespo/net.h"
+#elif defined(DEVICE_H1)
+#include "device/h1/net.h"
+#endif
+
#define IPC_NET_PREF_PLMN 0x0801
#define IPC_NET_PLMN_SEL 0x0802
#define IPC_NET_CURRENT_PLMN 0x0803
@@ -42,13 +48,6 @@
#define IPC_NET_PLMN_SEL_MANUAL 0x00
#define IPC_NET_PLMN_SEL_AUTO 0x01
-#define IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN 0xff
-#define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x00
-#define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x01
-#define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x02
-#define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x03
-#define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x04
-
#define IPC_NET_REGISTRATION_STATE_NONE 0x01
#define IPC_NET_REGISTRATION_STATE_HOME 0x02
#define IPC_NET_REGISTRATION_STATE_SEARCHING 0x03
@@ -59,16 +58,7 @@
#define IPC_NET_SERVICE_DOMAIN_GSM 0x02
#define IPC_NET_SERVICE_DOMAIN_GPRS 0x03
-struct ipc_net_current_plmn {
- char unk0;
- unsigned char slevel;
- char unk1;
- unsigned char plmn[5];
- unsigned char type; // IPC_NET_SERVICE_TYPE_... ?
- unsigned short lac;
-} __attribute__((__packed__));
-
-struct ipc_net_regist_set {
+struct ipc_net_regist_get {
unsigned char net;
unsigned char domain;
} __attribute__((__packed__));
@@ -95,5 +85,7 @@ struct ipc_net_plmn_entries {
struct ipc_net_plmn_entry *data;
};
+void ipc_net_regist_get(struct ipc_net_regist_get *message, int domain);
+
#endif
diff --git a/include/radio.h b/include/radio.h
index 988ba5f..d1c842e 100644
--- a/include/radio.h
+++ b/include/radio.h
@@ -26,9 +26,8 @@
#include "types.h"
#include "util.h"
-#define IPC_CLIENT_TYPE_CRESPO_FMT 1
-#define IPC_CLIENT_TYPE_CRESPO_RFS 2
-#define IPC_CLIENT_TYPE_H1 3
+#define IPC_CLIENT_TYPE_FMT 0
+#define IPC_CLIENT_TYPE_RFS 1
#define IPC_COMMAND(f) ((f->group << 8) | f->index)
#define IPC_GROUP(m) (m >> 8)
@@ -40,7 +39,7 @@ struct ipc_header {
unsigned char group, index, type;
} __attribute__((__packed__));
-struct ipc_request {
+struct ipc_message_info {
unsigned char mseq;
unsigned char aseq;
unsigned char group;
@@ -50,30 +49,34 @@ struct ipc_request {
unsigned char *data;
};
-struct ipc_response {
- unsigned char mseq, aseq;
- unsigned short command;
- unsigned char type;
- unsigned int data_length;
- unsigned char *data;
-};
-
struct ipc_client;
+struct ipc_handlers;
-typedef int (*ipc_client_transport_cb)(uint8_t *data, unsigned int size, void *user_data);
-typedef int (*ipc_client_log_handler_cb)(const char *message, void *user_data);
+typedef void (*ipc_client_log_handler_cb)(const char *message, void *user_data);
+
+typedef void *(*ipc_handler_data_cb)(void);
+typedef int (*ipc_io_handler_cb)(void *data, unsigned int size, void *io_data);
+typedef int (*ipc_handler_cb)(void *data);
struct ipc_client *ipc_client_new(int client_type);
-int ipc_client_set_log_handler(struct ipc_client *client, ipc_client_log_handler_cb log_handler_cb, void *user_data);
-int ipc_client_set_delegates(struct ipc_client *client, ipc_client_transport_cb write, void *write_data,
- ipc_client_transport_cb read, void *read_data);
int ipc_client_free(struct ipc_client *client);
+int ipc_client_set_log_handler(struct ipc_client *client, ipc_client_log_handler_cb log_handler_cb, void *user_data);
+
+int ipc_client_set_handlers(struct ipc_client *client, struct ipc_handlers *handlers);
+int ipc_client_set_io_handlers(struct ipc_client *client, void *io_data,
+ ipc_io_handler_cb read, ipc_io_handler_cb write,
+ ipc_io_handler_cb open, ipc_io_handler_cb close);
+void *ipc_client_get_handlers_io_data(struct ipc_client *client);
+int ipc_client_set_handlers_io_data(struct ipc_client *client, void *io_data);
+
int ipc_client_bootstrap_modem(struct ipc_client *client);
int ipc_client_open(struct ipc_client *client);
int ipc_client_close(struct ipc_client *client);
+int ipc_client_power_on(struct ipc_client *client);
+int ipc_client_power_off(struct ipc_client *client);
-int ipc_client_recv(struct ipc_client *client, struct ipc_response *response);
+int ipc_client_recv(struct ipc_client *client, struct ipc_message_info *response);
/* Convenience functions for ipc_send */
void ipc_client_send(struct ipc_client *client, const unsigned short command, const char type, unsigned char *data,
diff --git a/include/sec.h b/include/sec.h
index 3401a40..d5dee00 100644
--- a/include/sec.h
+++ b/include/sec.h
@@ -21,7 +21,7 @@
#ifndef __SEC_H__
#define __SEC_H__
-struct ipc_response;
+struct ipc_message_info;
#define IPC_SEC_PIN_STATUS 0x0501
#define IPC_SEC_PHONE_LOCK 0x0502
@@ -109,7 +109,7 @@ struct ipc_sec_lock_info_response {
unsigned char attempts;
} __attribute__((__packed__));
-char* ipc_sec_rsim_access_response_get_file_data(struct ipc_response *response);
+char* ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response);
void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message,
unsigned char pin_type, char *pin1, char *pin2);
diff --git a/include/types.h b/include/types.h
index e85d921..375d6d7 100644
--- a/include/types.h
+++ b/include/types.h
@@ -39,9 +39,9 @@
#define IPC_TYPE_EVENT 0x05
/* Baseband -> AP */
-#define IPC_TYPE_INDICATION 0x01
-#define IPC_TYPE_RESPONSE 0x02
-#define IPC_TYPE_NOTIFICATION 0x03
+#define IPC_TYPE_INDI 0x01
+#define IPC_TYPE_RESP 0x02
+#define IPC_TYPE_NOTI 0x03
/* Message groups */
#define IPC_GROUP_PWR 0x01