From 9e6e3c0b206d521339621ac41a0384bb8ee0045d Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 30 Jan 2020 18:51:33 +0100 Subject: devices: transport: pass the ipc_client struct This enables to use logging inside the callbacks. At this point the ipc_client struct is already available, so it is safe to do that. Signed-off-by: Denis 'GNUtoo' Carikli --- configure.ac | 2 +- include/samsung-ipc.h | 10 ++++---- samsung-ipc/devices/aries/aries.c | 34 ++++++++++++++++------------ samsung-ipc/devices/crespo/crespo.c | 23 +++++++++++-------- samsung-ipc/devices/galaxys2/galaxys2.c | 15 ++++++++---- samsung-ipc/devices/i9300/i9300.c | 14 ++++++++---- samsung-ipc/devices/maguro/maguro.c | 14 ++++++++---- samsung-ipc/devices/n5100/n5100.c | 14 ++++++++---- samsung-ipc/devices/n7100/n7100.c | 14 ++++++++---- samsung-ipc/devices/piranha/piranha.c | 14 ++++++++---- samsung-ipc/ipc.c | 20 ++++++++-------- samsung-ipc/ipc.h | 16 +++++++------ samsung-ipc/modems/xmm626/xmm626_sec_modem.c | 20 ++++++++-------- 13 files changed, 125 insertions(+), 85 deletions(-) diff --git a/configure.ac b/configure.ac index 8c01dab..2dd8c6e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([libsamsung-ipc], [0.4.0], [contact@replicant.us], [libsamsung-ipc]) +AC_INIT([libsamsung-ipc], [0.5.0], [contact@replicant.us], [libsamsung-ipc]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects]) diff --git a/include/samsung-ipc.h b/include/samsung-ipc.h index f78cc74..cc48994 100644 --- a/include/samsung-ipc.h +++ b/include/samsung-ipc.h @@ -70,11 +70,11 @@ struct ipc_client *ipc_client_create(int type); int ipc_client_destroy(struct ipc_client *client); int ipc_client_transport_handlers_register(struct ipc_client *client, - int (*open)(void *transport_data, int type), - int (*close)(void *transport_data), - int (*read)(void *transport_data, void *data, size_t size), - int (*write)(void *transport_data, const void *data, size_t size), - int (*poll)(void *transport_data, struct ipc_poll_fds *fds, struct timeval *timeout), + int (*open)(struct ipc_client *client, void *transport_data, int type), + int (*close)(struct ipc_client *client, void *transport_data), + int (*read)(struct ipc_client *client, void *transport_data, void *data, size_t size), + int (*write)(struct ipc_client *client, void *transport_data, const void *data, size_t size), + int (*poll)(struct ipc_client *client, void *transport_data, struct ipc_poll_fds *fds, struct timeval *timeout), void *transport_data); int ipc_client_power_handlers_register(struct ipc_client *client, int (*power_on)(struct ipc_client *client, void *power_data), diff --git a/samsung-ipc/devices/aries/aries.c b/samsung-ipc/devices/aries/aries.c index 2b356bb..3e5f681 100644 --- a/samsung-ipc/devices/aries/aries.c +++ b/samsung-ipc/devices/aries/aries.c @@ -277,8 +277,8 @@ int aries_fmt_send(struct ipc_client *client, struct ipc_message *message) chunk = (length - count) < ARIES_BUFFER_LENGTH ? length - count : ARIES_BUFFER_LENGTH; - rc = client->handlers->write(client->handlers->transport_data, p, - chunk); + rc = client->handlers->write(client, client->handlers->transport_data, + p, chunk); if (rc < 0) { ipc_client_log(client, "Writing FMT data failed"); goto error; @@ -319,8 +319,8 @@ int aries_fmt_recv(struct ipc_client *client, struct ipc_message *message) length = ARIES_BUFFER_LENGTH; buffer = calloc(1, length); - rc = client->handlers->read(client->handlers->transport_data, buffer, - length); + rc = client->handlers->read(client, client->handlers->transport_data, + buffer, length); if (rc < (int) sizeof(struct ipc_fmt_header)) { ipc_client_log(client, "Reading FMT header failed"); goto error; @@ -348,7 +348,8 @@ int aries_fmt_recv(struct ipc_client *client, struct ipc_message *message) chunk = (length - count) < ARIES_BUFFER_LENGTH ? length - count : ARIES_BUFFER_LENGTH; - rc = client->handlers->read(client->handlers->transport_data, p, chunk); + rc = client->handlers->read(client, client->handlers->transport_data, p, + chunk); if (rc < 0) { ipc_client_log(client, "Reading FMT data failed"); goto error; @@ -407,7 +408,7 @@ int aries_rfs_send(struct ipc_client *client, struct ipc_message *message) chunk = (length - count) < ARIES_BUFFER_LENGTH ? length - count : ARIES_BUFFER_LENGTH; - rc = client->handlers->write(client->handlers->transport_data, + rc = client->handlers->write(client, client->handlers->transport_data, p, chunk); if (rc < 0) { ipc_client_log(client, "Writing RFS data failed"); @@ -449,8 +450,8 @@ int aries_rfs_recv(struct ipc_client *client, struct ipc_message *message) length = ARIES_BUFFER_LENGTH; buffer = calloc(1, length); - rc = client->handlers->read(client->handlers->transport_data, buffer, - length); + rc = client->handlers->read(client, client->handlers->transport_data, + buffer, length); if (rc < (int) sizeof(struct ipc_rfs_header)) { ipc_client_log(client, "Reading RFS header failed"); goto error; @@ -482,7 +483,8 @@ int aries_rfs_recv(struct ipc_client *client, struct ipc_message *message) chunk = (length - count) < ARIES_BUFFER_LENGTH ? length - count : ARIES_BUFFER_LENGTH; - rc = client->handlers->read(client->handlers->transport_data, p, chunk); + rc = client->handlers->read(client, client->handlers->transport_data, p, + chunk); if (rc < 0) { ipc_client_log(client, "Reading RFS data failed"); goto error; @@ -507,7 +509,8 @@ complete: return rc; } -int aries_open(void *data, int type) +int aries_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct aries_transport_data *transport_data; struct sockaddr_pn *spn; @@ -581,7 +584,7 @@ int aries_open(void *data, int type) return 0; } -int aries_close(void *data) +int aries_close(__attribute__((unused)) struct ipc_client *client, void *data) { struct aries_transport_data *transport_data; int fd; @@ -601,7 +604,8 @@ int aries_close(void *data) return 0; } -int aries_read(void *data, void *buffer, size_t length) +int aries_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct aries_transport_data *transport_data; int spn_size; @@ -626,7 +630,8 @@ int aries_read(void *data, void *buffer, size_t length) return rc; } -int aries_write(void *data, const void *buffer, size_t length) +int aries_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct aries_transport_data *transport_data; int spn_size; @@ -650,7 +655,8 @@ int aries_write(void *data, const void *buffer, size_t length) return rc; } -int aries_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int aries_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct aries_transport_data *transport_data; fd_set set; diff --git a/samsung-ipc/devices/crespo/crespo.c b/samsung-ipc/devices/crespo/crespo.c index b89f3cf..89bf67b 100644 --- a/samsung-ipc/devices/crespo/crespo.c +++ b/samsung-ipc/devices/crespo/crespo.c @@ -153,7 +153,7 @@ int crespo_fmt_send(struct ipc_client *client, struct ipc_message *message) ipc_client_log_send(client, message, __func__); - rc = client->handlers->write(client->handlers->transport_data, + rc = client->handlers->write(client, client->handlers->transport_data, (void *) &mio, sizeof(struct modem_io)); if (rc < 0) { ipc_client_log(client, "Writing FMT data failed"); @@ -187,7 +187,7 @@ int crespo_fmt_recv(struct ipc_client *client, struct ipc_message *message) mio.size = CRESPO_BUFFER_LENGTH; mio.data = calloc(1, mio.size); - rc = client->handlers->read(client->handlers->transport_data, &mio, + rc = client->handlers->read(client, client->handlers->transport_data, &mio, sizeof(struct modem_io) + mio.size); if (rc < 0 || mio.data == NULL || mio.size < sizeof(struct ipc_fmt_header) || @@ -247,7 +247,7 @@ int crespo_rfs_send(struct ipc_client *client, struct ipc_message *message) ipc_client_log_send(client, message, __func__); - rc = client->handlers->write(client->handlers->transport_data, + rc = client->handlers->write(client, client->handlers->transport_data, (void *) &mio, sizeof(struct modem_io)); if (rc < 0) { ipc_client_log(client, "Writing RFS data failed"); @@ -280,7 +280,7 @@ int crespo_rfs_recv(struct ipc_client *client, struct ipc_message *message) mio.size = CRESPO_BUFFER_LENGTH; mio.data = calloc(1, mio.size); - rc = client->handlers->read(client->handlers->transport_data, &mio, + rc = client->handlers->read(client, client->handlers->transport_data, &mio, sizeof(struct modem_io) + mio.size); if (rc < 0 || mio.data == NULL || mio.size <= 0 || mio.size > CRESPO_BUFFER_LENGTH) { @@ -314,7 +314,8 @@ complete: return rc; } -int crespo_open(void *data, int type) +int crespo_open(__attribute__((unused)) struct ipc_client *client, + void *data, int type) { struct crespo_transport_data *transport_data; int fd; @@ -343,7 +344,8 @@ int crespo_open(void *data, int type) return 0; } -int crespo_close(void *data) +int crespo_close(__attribute__((unused)) struct ipc_client *client, + void *data) { struct crespo_transport_data *transport_data; int fd; @@ -363,7 +365,8 @@ int crespo_close(void *data) return 0; } -int crespo_read(void *data, void *buffer, size_t length) +int crespo_read(__attribute__((unused)) struct ipc_client *client, + void *data, void *buffer, size_t length) { struct crespo_transport_data *transport_data; int fd; @@ -385,7 +388,8 @@ int crespo_read(void *data, void *buffer, size_t length) return 0; } -int crespo_write(void *data, const void *buffer, size_t length) +int crespo_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct crespo_transport_data *transport_data; int fd; @@ -407,7 +411,8 @@ int crespo_write(void *data, const void *buffer, size_t length) return 0; } -int crespo_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int crespo_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct crespo_transport_data *transport_data; fd_set set; diff --git a/samsung-ipc/devices/galaxys2/galaxys2.c b/samsung-ipc/devices/galaxys2/galaxys2.c index 9c641e3..fcfaa7d 100644 --- a/samsung-ipc/devices/galaxys2/galaxys2.c +++ b/samsung-ipc/devices/galaxys2/galaxys2.c @@ -235,7 +235,8 @@ complete: return rc; } -int galaxys2_open(void *data, int type) +int galaxys2_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct galaxys2_transport_data *transport_data; @@ -251,7 +252,8 @@ int galaxys2_open(void *data, int type) return 0; } -int galaxys2_close(void *data) +int galaxys2_close(__attribute__((unused)) struct ipc_client *client, + void *data) { struct galaxys2_transport_data *transport_data; @@ -266,7 +268,8 @@ int galaxys2_close(void *data) return 0; } -int galaxys2_read(void *data, void *buffer, size_t length) +int galaxys2_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct galaxys2_transport_data *transport_data; int rc; @@ -281,7 +284,8 @@ int galaxys2_read(void *data, void *buffer, size_t length) return rc; } -int galaxys2_write(void *data, const void *buffer, size_t length) +int galaxys2_write(__attribute__((unused)) struct ipc_client *client, + void *data, const void *buffer, size_t length) { struct galaxys2_transport_data *transport_data; int rc; @@ -296,7 +300,8 @@ int galaxys2_write(void *data, const void *buffer, size_t length) return rc; } -int galaxys2_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int galaxys2_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct galaxys2_transport_data *transport_data; int rc; diff --git a/samsung-ipc/devices/i9300/i9300.c b/samsung-ipc/devices/i9300/i9300.c index 07b2b4f..5728abe 100644 --- a/samsung-ipc/devices/i9300/i9300.c +++ b/samsung-ipc/devices/i9300/i9300.c @@ -229,7 +229,8 @@ complete: return rc; } -int i9300_open(void *data, int type) +int i9300_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct i9300_transport_data *transport_data; @@ -245,7 +246,7 @@ int i9300_open(void *data, int type) return 0; } -int i9300_close(void *data) +int i9300_close(__attribute__((unused)) struct ipc_client *client, void *data) { struct i9300_transport_data *transport_data; @@ -260,7 +261,8 @@ int i9300_close(void *data) return 0; } -int i9300_read(void *data, void *buffer, size_t length) +int i9300_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct i9300_transport_data *transport_data; int rc; @@ -275,7 +277,8 @@ int i9300_read(void *data, void *buffer, size_t length) return rc; } -int i9300_write(void *data, const void *buffer, size_t length) +int i9300_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct i9300_transport_data *transport_data; int rc; @@ -290,7 +293,8 @@ int i9300_write(void *data, const void *buffer, size_t length) return rc; } -int i9300_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int i9300_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct i9300_transport_data *transport_data; int rc; diff --git a/samsung-ipc/devices/maguro/maguro.c b/samsung-ipc/devices/maguro/maguro.c index 797ce43..3c6f4da 100644 --- a/samsung-ipc/devices/maguro/maguro.c +++ b/samsung-ipc/devices/maguro/maguro.c @@ -213,7 +213,8 @@ complete: return rc; } -int maguro_open(void *data, int type) +int maguro_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct maguro_transport_data *transport_data; @@ -229,7 +230,7 @@ int maguro_open(void *data, int type) return 0; } -int maguro_close(void *data) +int maguro_close(__attribute__((unused)) struct ipc_client *client, void *data) { struct maguro_transport_data *transport_data; @@ -244,7 +245,8 @@ int maguro_close(void *data) return 0; } -int maguro_read(void *data, void *buffer, size_t length) +int maguro_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct maguro_transport_data *transport_data; int rc; @@ -259,7 +261,8 @@ int maguro_read(void *data, void *buffer, size_t length) return rc; } -int maguro_write(void *data, const void *buffer, size_t length) +int maguro_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct maguro_transport_data *transport_data; int rc; @@ -274,7 +277,8 @@ int maguro_write(void *data, const void *buffer, size_t length) return rc; } -int maguro_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int maguro_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct maguro_transport_data *transport_data; int rc; diff --git a/samsung-ipc/devices/n5100/n5100.c b/samsung-ipc/devices/n5100/n5100.c index 04a0585..d50d86f 100644 --- a/samsung-ipc/devices/n5100/n5100.c +++ b/samsung-ipc/devices/n5100/n5100.c @@ -230,7 +230,8 @@ complete: return rc; } -int n5100_open(void *data, int type) +int n5100_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct n5100_transport_data *transport_data; @@ -246,7 +247,7 @@ int n5100_open(void *data, int type) return 0; } -int n5100_close(void *data) +int n5100_close(__attribute__((unused)) struct ipc_client *client, void *data) { struct n5100_transport_data *transport_data; @@ -261,7 +262,8 @@ int n5100_close(void *data) return 0; } -int n5100_read(void *data, void *buffer, size_t length) +int n5100_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct n5100_transport_data *transport_data; int rc; @@ -276,7 +278,8 @@ int n5100_read(void *data, void *buffer, size_t length) return rc; } -int n5100_write(void *data, const void *buffer, size_t length) +int n5100_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct n5100_transport_data *transport_data; int rc; @@ -291,7 +294,8 @@ int n5100_write(void *data, const void *buffer, size_t length) return rc; } -int n5100_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int n5100_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct n5100_transport_data *transport_data; int rc; diff --git a/samsung-ipc/devices/n7100/n7100.c b/samsung-ipc/devices/n7100/n7100.c index 365efdd..d6aced8 100644 --- a/samsung-ipc/devices/n7100/n7100.c +++ b/samsung-ipc/devices/n7100/n7100.c @@ -229,7 +229,8 @@ complete: return rc; } -int n7100_open(void *data, int type) +int n7100_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct n7100_transport_data *transport_data; @@ -245,7 +246,7 @@ int n7100_open(void *data, int type) return 0; } -int n7100_close(void *data) +int n7100_close(__attribute__((unused)) struct ipc_client *client, void *data) { struct n7100_transport_data *transport_data; @@ -260,7 +261,8 @@ int n7100_close(void *data) return 0; } -int n7100_read(void *data, void *buffer, size_t length) +int n7100_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct n7100_transport_data *transport_data; int rc; @@ -275,7 +277,8 @@ int n7100_read(void *data, void *buffer, size_t length) return rc; } -int n7100_write(void *data, const void *buffer, size_t length) +int n7100_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct n7100_transport_data *transport_data; int rc; @@ -290,7 +293,8 @@ int n7100_write(void *data, const void *buffer, size_t length) return rc; } -int n7100_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int n7100_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct n7100_transport_data *transport_data; int rc; diff --git a/samsung-ipc/devices/piranha/piranha.c b/samsung-ipc/devices/piranha/piranha.c index f4527c6..5f1b3a0 100644 --- a/samsung-ipc/devices/piranha/piranha.c +++ b/samsung-ipc/devices/piranha/piranha.c @@ -178,7 +178,8 @@ complete: return rc; } -int piranha_open(void *data, int type) +int piranha_open(__attribute__((unused)) struct ipc_client *client, void *data, + int type) { struct piranha_transport_data *transport_data; @@ -194,7 +195,7 @@ int piranha_open(void *data, int type) return 0; } -int piranha_close(void *data) +int piranha_close(__attribute__((unused)) struct ipc_client *client, void *data) { struct piranha_transport_data *transport_data; @@ -209,7 +210,8 @@ int piranha_close(void *data) return 0; } -int piranha_read(void *data, void *buffer, size_t length) +int piranha_read(__attribute__((unused)) struct ipc_client *client, void *data, + void *buffer, size_t length) { struct piranha_transport_data *transport_data; int rc; @@ -224,7 +226,8 @@ int piranha_read(void *data, void *buffer, size_t length) return rc; } -int piranha_write(void *data, const void *buffer, size_t length) +int piranha_write(__attribute__((unused)) struct ipc_client *client, void *data, + const void *buffer, size_t length) { struct piranha_transport_data *transport_data; int rc; @@ -239,7 +242,8 @@ int piranha_write(void *data, const void *buffer, size_t length) return rc; } -int piranha_poll(void *data, struct ipc_poll_fds *fds, struct timeval *timeout) +int piranha_poll(__attribute__((unused)) struct ipc_client *client, void *data, + struct ipc_poll_fds *fds, struct timeval *timeout) { struct piranha_transport_data *transport_data; int rc; diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 49573eb..c52911b 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -255,12 +255,14 @@ int ipc_client_destroy(struct ipc_client *client) } int ipc_client_transport_handlers_register(struct ipc_client *client, - int (*open)(void *transport_data, int type), - int (*close)(void *transport_data), - int (*read)(void *transport_data, void *data, size_t size), - int (*write)(void *transport_data, const void *data, size_t size), - int (*poll)(void *transport_data, struct ipc_poll_fds *fds, - struct timeval *timeout), + int (*open)(struct ipc_client *client, void *transport_data, int type), + int (*close)(struct ipc_client *client, void *transport_data), + int (*read)(struct ipc_client *client, void *transport_data, void *data, + size_t size), + int (*write)(struct ipc_client *client, void *transport_data, + const void *data, size_t size), + int (*poll)(struct ipc_client *client, void *transport_data, + struct ipc_poll_fds *fds, struct timeval *timeout), void *transport_data) { if (client == NULL || client->handlers == NULL) @@ -398,7 +400,7 @@ int ipc_client_open(struct ipc_client *client) return -1; } - return client->handlers->open(client->handlers->transport_data, + return client->handlers->open(client, client->handlers->transport_data, client->type); } @@ -409,7 +411,7 @@ int ipc_client_close(struct ipc_client *client) return -1; } - return client->handlers->close(client->handlers->transport_data); + return client->handlers->close(client, client->handlers->transport_data); } int ipc_client_poll(struct ipc_client *client, struct ipc_poll_fds *fds, @@ -420,7 +422,7 @@ int ipc_client_poll(struct ipc_client *client, struct ipc_poll_fds *fds, return -1; } - return client->handlers->poll(client->handlers->transport_data, fds, + return client->handlers->poll(client, client->handlers->transport_data, fds, timeout); } diff --git a/samsung-ipc/ipc.h b/samsung-ipc/ipc.h index b52707b..7c7f314 100644 --- a/samsung-ipc/ipc.h +++ b/samsung-ipc/ipc.h @@ -38,13 +38,15 @@ struct ipc_client_ops { struct ipc_client_handlers { /* Transport handlers */ - int (*open)(void *transport_data, int type); - int (*close)(void *transport_data); - - int (*read)(void *transport_data, void *buffer, size_t length); - int (*write)(void *transport_data, const void *buffer, size_t length); - int (*poll)(void *transport_data, struct ipc_poll_fds *fds, - struct timeval *timeout); + int (*open)(struct ipc_client *client, void *transport_data, int type); + int (*close)(struct ipc_client *client, void *transport_data); + + int (*read)(struct ipc_client *client, void *transport_data, + void *buffer, size_t length); + int (*write)(struct ipc_client *client, void *transport_data, + const void *buffer, size_t length); + int (*poll)(struct ipc_client *client, void *transport_data, + struct ipc_poll_fds *fds, struct timeval *timeout); void *transport_data; diff --git a/samsung-ipc/modems/xmm626/xmm626_sec_modem.c b/samsung-ipc/modems/xmm626/xmm626_sec_modem.c index 690d5e5..e63ad89 100644 --- a/samsung-ipc/modems/xmm626/xmm626_sec_modem.c +++ b/samsung-ipc/modems/xmm626/xmm626_sec_modem.c @@ -212,8 +212,7 @@ int xmm626_sec_modem_fmt_send(struct ipc_client *client, count = 0; while (count < length) { - rc = client->handlers->write(client->handlers->transport_data, p, - length - count); + rc = client->handlers->write(client, client->handlers->transport_data, p, length - count); if (rc <= 0) { ipc_client_log(client, "Writing FMT data failed"); goto error; @@ -254,8 +253,7 @@ int xmm626_sec_modem_fmt_recv(struct ipc_client *client, length = XMM626_DATA_SIZE; buffer = calloc(1, length); - rc = client->handlers->read(client->handlers->transport_data, buffer, - length); + rc = client->handlers->read(client, client->handlers->transport_data, buffer, length); if (rc < (int) sizeof(struct ipc_fmt_header)) { ipc_client_log(client, "Reading FMT header failed"); goto error; @@ -279,7 +277,8 @@ int xmm626_sec_modem_fmt_recv(struct ipc_client *client, } while (count < message->size) { - rc = client->handlers->read(client->handlers->transport_data, p, + rc = client->handlers->read(client, + client->handlers->transport_data, p, message->size - count); if (rc <= 0) { ipc_client_log(client, "Reading FMT data failed"); @@ -338,8 +337,8 @@ int xmm626_sec_modem_rfs_send(struct ipc_client *client, count = 0; while (count < length) { - rc = client->handlers->write(client->handlers->transport_data, p, - length - count); + rc = client->handlers->write(client, client->handlers->transport_data, + p, length - count); if (rc <= 0) { ipc_client_log(client, "Writing RFS data failed"); goto error; @@ -380,8 +379,8 @@ int xmm626_sec_modem_rfs_recv(struct ipc_client *client, length = XMM626_DATA_SIZE; buffer = calloc(1, length); - rc = client->handlers->read(client->handlers->transport_data, buffer, - length); + rc = client->handlers->read(client, client->handlers->transport_data, + buffer, length); if (rc < (int) sizeof(struct ipc_rfs_header)) { ipc_client_log(client, "Reading RFS header failed"); goto error; @@ -410,7 +409,8 @@ int xmm626_sec_modem_rfs_recv(struct ipc_client *client, } while (count < message->size) { - rc = client->handlers->read(client->handlers->transport_data, p, + rc = client->handlers->read(client, + client->handlers->transport_data, p, message->size - count); if (rc <= 0) { ipc_client_log(client, "Reading RFS data failed"); -- cgit v1.2.3