From 0e0c698a13ae658640af085591b809bbc9a6f658 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Tue, 25 Jun 2013 20:03:27 +0200 Subject: Renamed ipc_private.h to ipc.h Change-Id: Ie80159518b6d7d1a6422d3dc47a903eb7fdad6d8 Signed-off-by: Paul Kocialkowski --- samsung-ipc/Makefile.am | 2 +- samsung-ipc/device/aries/aries_ipc.c | 2 +- samsung-ipc/device/crespo/crespo_ipc.c | 2 +- samsung-ipc/device/galaxys2/galaxys2_ipc.c | 2 +- samsung-ipc/device/galaxys2/galaxys2_loader.c | 2 +- samsung-ipc/device/maguro/maguro_ipc.c | 2 +- samsung-ipc/device/maguro/maguro_loader.c | 2 +- samsung-ipc/device/piranha/piranha_ipc.c | 2 +- samsung-ipc/device/piranha/piranha_loader.c | 2 +- samsung-ipc/device/xmm6260/xmm6260_ipc.c | 2 +- samsung-ipc/device/xmm6260/xmm6260_loader.c | 2 +- samsung-ipc/device/xmm6260/xmm6260_modemctl.c | 2 +- samsung-ipc/ipc.c | 2 +- samsung-ipc/ipc.h | 105 ++++++++++++++++++++++++++ samsung-ipc/ipc_private.h | 97 ------------------------ samsung-ipc/ipc_util.c | 3 +- samsung-ipc/rfs.c | 2 +- 17 files changed, 121 insertions(+), 112 deletions(-) create mode 100644 samsung-ipc/ipc.h delete mode 100644 samsung-ipc/ipc_private.h (limited to 'samsung-ipc') diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am index 2942973..ea2035f 100644 --- a/samsung-ipc/Makefile.am +++ b/samsung-ipc/Makefile.am @@ -28,7 +28,7 @@ libsamsung_ipc_la_SOURCES = \ call.c \ net.c \ wakelock.c \ - ipc_private.h \ + ipc.h \ ipc_devices.h \ device/crespo/crespo_ipc.c \ device/aries/aries_ipc.c \ diff --git a/samsung-ipc/device/aries/aries_ipc.c b/samsung-ipc/device/aries/aries_ipc.c index 4f5bf42..5c8705d 100644 --- a/samsung-ipc/device/aries/aries_ipc.c +++ b/samsung-ipc/device/aries/aries_ipc.c @@ -43,7 +43,7 @@ #include #include "aries_ipc.h" -#include "ipc_private.h" +#include "ipc.h" #include "sipc4.h" #include "onedram.h" #include "phonet.h" diff --git a/samsung-ipc/device/crespo/crespo_ipc.c b/samsung-ipc/device/crespo/crespo_ipc.c index 026bb1f..6bef48a 100644 --- a/samsung-ipc/device/crespo/crespo_ipc.c +++ b/samsung-ipc/device/crespo/crespo_ipc.c @@ -38,7 +38,7 @@ #include "crespo_modem_ctl.h" #include "crespo_ipc.h" -#include "ipc_private.h" +#include "ipc.h" int crespo_modem_bootstrap(struct ipc_client *client) { diff --git a/samsung-ipc/device/galaxys2/galaxys2_ipc.c b/samsung-ipc/device/galaxys2/galaxys2_ipc.c index e9ae68f..dbaced5 100644 --- a/samsung-ipc/device/galaxys2/galaxys2_ipc.c +++ b/samsung-ipc/device/galaxys2/galaxys2_ipc.c @@ -25,7 +25,7 @@ #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_ipc.h" #include "galaxys2_loader.h" diff --git a/samsung-ipc/device/galaxys2/galaxys2_loader.c b/samsung-ipc/device/galaxys2/galaxys2_loader.c index c0610af..35fb4e1 100644 --- a/samsung-ipc/device/galaxys2/galaxys2_loader.c +++ b/samsung-ipc/device/galaxys2/galaxys2_loader.c @@ -38,7 +38,7 @@ #include #include -#include "ipc_private.h" +#include "ipc.h" #include "galaxys2_loader.h" #include "xmm6260_loader.h" diff --git a/samsung-ipc/device/maguro/maguro_ipc.c b/samsung-ipc/device/maguro/maguro_ipc.c index d746bb6..a25d357 100644 --- a/samsung-ipc/device/maguro/maguro_ipc.c +++ b/samsung-ipc/device/maguro/maguro_ipc.c @@ -26,7 +26,7 @@ #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_ipc.h" #include "maguro_loader.h" diff --git a/samsung-ipc/device/maguro/maguro_loader.c b/samsung-ipc/device/maguro/maguro_loader.c index 0d72d54..e6d8287 100644 --- a/samsung-ipc/device/maguro/maguro_loader.c +++ b/samsung-ipc/device/maguro/maguro_loader.c @@ -36,7 +36,7 @@ #include #include -#include "ipc_private.h" +#include "ipc.h" #include "maguro_loader.h" #include "xmm6260_loader.h" diff --git a/samsung-ipc/device/piranha/piranha_ipc.c b/samsung-ipc/device/piranha/piranha_ipc.c index 0277ec3..81761b9 100644 --- a/samsung-ipc/device/piranha/piranha_ipc.c +++ b/samsung-ipc/device/piranha/piranha_ipc.c @@ -19,7 +19,7 @@ #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_ipc.h" #include "piranha_loader.h" diff --git a/samsung-ipc/device/piranha/piranha_loader.c b/samsung-ipc/device/piranha/piranha_loader.c index 1577d54..d5b28ad 100644 --- a/samsung-ipc/device/piranha/piranha_loader.c +++ b/samsung-ipc/device/piranha/piranha_loader.c @@ -37,7 +37,7 @@ #include #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_loader.h" #include "xmm6260_modemctl.h" diff --git a/samsung-ipc/device/xmm6260/xmm6260_ipc.c b/samsung-ipc/device/xmm6260/xmm6260_ipc.c index 99d4727..c2d7a3b 100644 --- a/samsung-ipc/device/xmm6260/xmm6260_ipc.c +++ b/samsung-ipc/device/xmm6260/xmm6260_ipc.c @@ -40,7 +40,7 @@ #include #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_ipc.h" #include "xmm6260_loader.h" diff --git a/samsung-ipc/device/xmm6260/xmm6260_loader.c b/samsung-ipc/device/xmm6260/xmm6260_loader.c index 49de352..0c077c6 100644 --- a/samsung-ipc/device/xmm6260/xmm6260_loader.c +++ b/samsung-ipc/device/xmm6260/xmm6260_loader.c @@ -36,7 +36,7 @@ #include #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_loader.h" #include "xmm6260_modemctl.h" diff --git a/samsung-ipc/device/xmm6260/xmm6260_modemctl.c b/samsung-ipc/device/xmm6260/xmm6260_modemctl.c index 161a024..e0048e7 100644 --- a/samsung-ipc/device/xmm6260/xmm6260_modemctl.c +++ b/samsung-ipc/device/xmm6260/xmm6260_modemctl.c @@ -36,7 +36,7 @@ #include #include -#include "ipc_private.h" +#include "ipc.h" #include "xmm6260_loader.h" #include "xmm6260_modemctl.h" diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 1201823..7225901 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -39,7 +39,7 @@ #include -#include "ipc_private.h" +#include "ipc.h" #include "ipc_devices.h" void log_handler_default(const char *message, void *user_data) diff --git a/samsung-ipc/ipc.h b/samsung-ipc/ipc.h new file mode 100644 index 0000000..98d7935 --- /dev/null +++ b/samsung-ipc/ipc.h @@ -0,0 +1,105 @@ +/* + * This file is part of libsamsung-ipc. + * + * Copyright (C) 2011 Simon Busch + * + * 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 2 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 . + * + */ + +#include + +#ifndef __IPC_H__ +#define __IPC_H__ + +/* + * Structures + */ + +struct ipc_ops { + int (*bootstrap)(struct ipc_client *client); + int (*send)(struct ipc_client *client, struct ipc_message_info *); + int (*recv)(struct ipc_client *client, struct ipc_message_info *); +}; + +struct ipc_handlers { + /* Transport handlers/data */ + ipc_io_handler_cb read; + void *read_data; + ipc_io_handler_cb write; + void *write_data; + + int (*open)(int type, void *io_data); + int (*close)(void *io_data); + void *open_data; + void *close_data; + + /* Power handlers */ + ipc_handler_cb power_on; + void *power_on_data; + ipc_handler_cb power_off; + void *power_off_data; + + /* GPRS handlers */ + int (*gprs_activate)(void *io_data, int cid); + void *gprs_activate_data; + int (*gprs_deactivate)(void *io_data, int cid); + void *gprs_deactivate_data; + + /* Handlers common data*/ + void *common_data; + + void *(*common_data_create)(void); + int (*common_data_destroy)(void *io_data); + int (*common_data_set_fd)(void *io_data, int fd); + int (*common_data_get_fd)(void *io_data); +}; + +struct ipc_gprs_specs { + char* (*gprs_get_iface)(int cid); + int (*gprs_get_capabilities)(struct ipc_client_gprs_capabilities *cap); +}; + +struct ipc_nv_data_specs { + char *nv_data_path; + char *nv_data_md5_path; + char *nv_data_bak_path; + char *nv_data_md5_bak_path; + char *nv_state_path; + char *nv_data_secret; + int nv_data_size; + int nv_data_chunk_size; +}; + +struct ipc_client { + int type; + + ipc_client_log_handler_cb log_handler; + void *log_data; + + struct ipc_ops *ops; + struct ipc_handlers *handlers; + struct ipc_gprs_specs *gprs_specs; + struct ipc_nv_data_specs *nv_data_specs; +}; + +/* + * Helpers + */ + +void ipc_client_log(struct ipc_client *client, const char *message, ...); + +#endif + +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/ipc_private.h b/samsung-ipc/ipc_private.h deleted file mode 100644 index cf51d4f..0000000 --- a/samsung-ipc/ipc_private.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2011 Simon Busch - * - * 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 2 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 . - * - */ - -#ifndef __IPC_PRIVATE_H__ -#define __IPC_PRIVATE_H__ - -#include - -struct ipc_ops { - int (*bootstrap)(struct ipc_client *client); - int (*send)(struct ipc_client *client, struct ipc_message_info *); - int (*recv)(struct ipc_client *client, struct ipc_message_info *); -}; - -struct ipc_handlers { - /* Transport handlers/data */ - ipc_io_handler_cb read; - void *read_data; - ipc_io_handler_cb write; - void *write_data; - - int (*open)(int type, void *io_data); - int (*close)(void *io_data); - void *open_data; - void *close_data; - - /* Power handlers */ - ipc_handler_cb power_on; - void *power_on_data; - ipc_handler_cb power_off; - void *power_off_data; - - /* GPRS handlers */ - int (*gprs_activate)(void *io_data, int cid); - void *gprs_activate_data; - int (*gprs_deactivate)(void *io_data, int cid); - void *gprs_deactivate_data; - - /* Handlers common data*/ - void *common_data; - - void *(*common_data_create)(void); - int (*common_data_destroy)(void *io_data); - int (*common_data_set_fd)(void *io_data, int fd); - int (*common_data_get_fd)(void *io_data); -}; - -struct ipc_gprs_specs { - char* (*gprs_get_iface)(int cid); - int (*gprs_get_capabilities)(struct ipc_client_gprs_capabilities *cap); -}; - -struct ipc_nv_data_specs { - char *nv_data_path; - char *nv_data_md5_path; - char *nv_data_bak_path; - char *nv_data_md5_bak_path; - char *nv_state_path; - char *nv_data_secret; - int nv_data_size; - int nv_data_chunk_size; -}; - -struct ipc_client { - int type; - - ipc_client_log_handler_cb log_handler; - void *log_data; - - struct ipc_ops *ops; - struct ipc_handlers *handlers; - struct ipc_gprs_specs *gprs_specs; - struct ipc_nv_data_specs *nv_data_specs; -}; - -void ipc_client_log(struct ipc_client *client, const char *message, ...); - -#endif - -// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/ipc_util.c b/samsung-ipc/ipc_util.c index adfc99a..249f2e2 100644 --- a/samsung-ipc/ipc_util.c +++ b/samsung-ipc/ipc_util.c @@ -30,7 +30,8 @@ #include #include -#include "ipc_private.h" + +#include "ipc.h" #define IPC_STR(f) case f: return strdup(#f); diff --git a/samsung-ipc/rfs.c b/samsung-ipc/rfs.c index aa38cff..7075bd1 100644 --- a/samsung-ipc/rfs.c +++ b/samsung-ipc/rfs.c @@ -31,7 +31,7 @@ #include -#include "ipc_private.h" +#include "ipc.h" void md5hash2string(char *out, unsigned char *in) { -- cgit v1.1