diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2013-06-27 13:07:47 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2013-06-27 13:07:47 +0200 |
commit | c99663fe46c3fc426d6f74ae146d1c5842764f1a (patch) | |
tree | ea8b39673534af2be8f0bf155dd135a83d9c5545 /samsung-ipc | |
parent | b73c6cf5a94e1c7f9be38917f26da37e13fe452e (diff) | |
download | external_libsamsung-ipc-c99663fe46c3fc426d6f74ae146d1c5842764f1a.zip external_libsamsung-ipc-c99663fe46c3fc426d6f74ae146d1c5842764f1a.tar.gz external_libsamsung-ipc-c99663fe46c3fc426d6f74ae146d1c5842764f1a.tar.bz2 |
Get rid of wakelocks, this should be dealt with on the upper layers
Change-Id: Iae3a43bc3019ee2bfdfc4ee3e3b2194b099372bc
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/Makefile.am | 1 | ||||
-rw-r--r-- | samsung-ipc/device/crespo/crespo_ipc.c | 9 | ||||
-rw-r--r-- | samsung-ipc/device/xmm6260/xmm6260_ipc.c | 18 | ||||
-rw-r--r-- | samsung-ipc/wakelock.c | 66 |
4 files changed, 0 insertions, 94 deletions
diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am index ea2035f..d303310 100644 --- a/samsung-ipc/Makefile.am +++ b/samsung-ipc/Makefile.am @@ -27,7 +27,6 @@ libsamsung_ipc_la_SOURCES = \ gprs.c \ call.c \ net.c \ - wakelock.c \ ipc.h \ ipc_devices.h \ device/crespo/crespo_ipc.c \ diff --git a/samsung-ipc/device/crespo/crespo_ipc.c b/samsung-ipc/device/crespo/crespo_ipc.c index c903e05..eae60d7 100644 --- a/samsung-ipc/device/crespo/crespo_ipc.c +++ b/samsung-ipc/device/crespo/crespo_ipc.c @@ -34,7 +34,6 @@ #include <assert.h> #include <samsung-ipc.h> -#include <wakelock.h> #include "crespo_modem_ctl.h" #include "crespo_ipc.h" @@ -339,8 +338,6 @@ int crespo_ipc_fmt_recv(struct ipc_client *client, struct ipc_message_info *resp memset(response, 0, sizeof(struct ipc_message_info)); - wake_lock("secril_fmt-interface"); - assert(client->handlers->read != NULL); bread = client->handlers->read(client->handlers->transport_data, (uint8_t*) &modem_data, sizeof(struct modem_io) + MAX_MODEM_DATA_SIZE); if (bread < 0) @@ -376,8 +373,6 @@ int crespo_ipc_fmt_recv(struct ipc_client *client, struct ipc_message_info *resp ipc_client_log_recv(client, response, __func__); - wake_unlock("secril_fmt-interface"); - return 0; } @@ -415,8 +410,6 @@ int crespo_ipc_rfs_recv(struct ipc_client *client, struct ipc_message_info *resp memset(response, 0, sizeof(struct ipc_message_info)); - wake_lock("secril_rfs-interface"); - assert(client->handlers->read != NULL); bread = client->handlers->read(client->handlers->transport_data, (uint8_t*) &modem_data, sizeof(struct modem_io) + MAX_MODEM_DATA_SIZE); if (bread < 0) @@ -449,8 +442,6 @@ int crespo_ipc_rfs_recv(struct ipc_client *client, struct ipc_message_info *resp ipc_client_log_recv(client, response, __func__); - wake_unlock("secril_rfs-interface"); - return 0; } diff --git a/samsung-ipc/device/xmm6260/xmm6260_ipc.c b/samsung-ipc/device/xmm6260/xmm6260_ipc.c index 2d485ab..b8c1f60 100644 --- a/samsung-ipc/device/xmm6260/xmm6260_ipc.c +++ b/samsung-ipc/device/xmm6260/xmm6260_ipc.c @@ -38,7 +38,6 @@ #include <assert.h> #include <samsung-ipc.h> -#include <wakelock.h> #include "ipc.h" @@ -47,9 +46,6 @@ #include "xmm6260_modemctl.h" #include "modem_prj.h" -#define FMT_LOCK_NAME "xmm6260-fmt-lock" -#define RFS_LOCK_NAME "xmm6260-rfs-lock" - int xmm6260_ipc_fmt_send(struct ipc_client *client, struct ipc_message_info *request) { struct ipc_header *hdr; @@ -57,8 +53,6 @@ int xmm6260_ipc_fmt_send(struct ipc_client *client, struct ipc_message_info *req unsigned char *payload; size_t frame_length; - wake_lock(FMT_LOCK_NAME); - /* Frame IPC header + payload length */ frame_length = (sizeof(*hdr) + request->length); @@ -83,8 +77,6 @@ int xmm6260_ipc_fmt_send(struct ipc_client *client, struct ipc_message_info *req free(frame); - wake_unlock(FMT_LOCK_NAME); - return 0; } @@ -104,8 +96,6 @@ int xmm6260_ipc_fmt_recv(struct ipc_client *client, struct ipc_message_info *res if (!client || !response) return -1; - wake_lock(FMT_LOCK_NAME); - num_read = client->handlers->read(client->handlers->transport_data, buf, IPC_MAX_XFER); if (num_read <= 0) { @@ -140,7 +130,6 @@ int xmm6260_ipc_fmt_recv(struct ipc_client *client, struct ipc_message_info *res ipc_client_log_recv(client, response, __func__); done: - wake_unlock(FMT_LOCK_NAME); return 0; } @@ -153,8 +142,6 @@ int xmm6260_ipc_rfs_recv(struct ipc_client *client, struct ipc_message_info *res int rc; int ret = 0; - wake_lock(RFS_LOCK_NAME); - do { rc = client->handlers->read(client->handlers->transport_data, buf, IPC_MAX_XFER); @@ -207,8 +194,6 @@ int xmm6260_ipc_rfs_recv(struct ipc_client *client, struct ipc_message_info *res ipc_client_log_recv(client, response, __func__); done: - - wake_unlock(RFS_LOCK_NAME); return ret; } @@ -219,8 +204,6 @@ int xmm6260_ipc_rfs_send(struct ipc_client *client, struct ipc_message_info *req int data_length; int rc; - wake_lock(RFS_LOCK_NAME); - data_length = sizeof(struct rfs_hdr) + request->length; data = malloc(data_length); memset(data, 0, data_length); @@ -236,7 +219,6 @@ int xmm6260_ipc_rfs_send(struct ipc_client *client, struct ipc_message_info *req rc = client->handlers->write(client->handlers->transport_data, data, data_length); - wake_unlock(RFS_LOCK_NAME); return rc; } diff --git a/samsung-ipc/wakelock.c b/samsung-ipc/wakelock.c deleted file mode 100644 index 2e42671..0000000 --- a/samsung-ipc/wakelock.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com> - * - * 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 <http://www.gnu.org/licenses/>. - * - */ - -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> - -#include <wakelock.h> - -static int wake_lock_fd = -1; -static int wake_unlock_fd = -1; - -int wake_lock(char *lock_name) -{ - int rc; - - if (lock_name == NULL) - return -1; - - if (wake_lock_fd < 0) - wake_lock_fd = open("/sys/power/wake_lock", O_RDWR); - - if (wake_lock_fd < 0) - return wake_lock_fd; - - rc = write(wake_lock_fd, lock_name, strlen(lock_name)); - - return rc; -} - -int wake_unlock(char *lock_name) -{ - int rc; - - if (lock_name == NULL) - return -1; - - if (wake_unlock_fd < 0) - wake_unlock_fd = open("/sys/power/wake_unlock", O_RDWR); - - if (wake_unlock_fd < 0) - return wake_lock_fd; - - rc = write(wake_unlock_fd, lock_name, strlen(lock_name)); - - return rc; -} - -// vim:ts=4:sw=4:expandtab |