diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-07-17 02:09:56 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-07-24 21:42:31 +0200 |
commit | 09694a34d4920cba49c4e4d20d1a3e41750bfc91 (patch) | |
tree | a3b83c9a8a376eb7058fb9aa6addf9347566ec18 /samsung-ipc | |
parent | 7455c7129cf3354cd6dc55ee7822671108837676 (diff) | |
download | hardware_replicant_libsamsung-ipc-09694a34d4920cba49c4e4d20d1a3e41750bfc91.tar.gz hardware_replicant_libsamsung-ipc-09694a34d4920cba49c4e4d20d1a3e41750bfc91.tar.bz2 hardware_replicant_libsamsung-ipc-09694a34d4920cba49c4e4d20d1a3e41750bfc91.zip |
xmm626_mipi_modem_command_send: 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 <GNUtoo@cyberdimension.org>
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/modems/xmm626/xmm626_mipi.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/samsung-ipc/modems/xmm626/xmm626_mipi.c b/samsung-ipc/modems/xmm626/xmm626_mipi.c index 75c49d5..a5cb188 100644 --- a/samsung-ipc/modems/xmm626/xmm626_mipi.c +++ b/samsung-ipc/modems/xmm626/xmm626_mipi.c @@ -300,7 +300,8 @@ complete: return rc; } -int xmm626_mipi_command_send(int device_fd, unsigned short code, +int xmm626_mipi_command_send(__attribute__((unused)) struct ipc_client *client, + int device_fd, unsigned short code, const void *data, size_t size, int ack, int short_footer) { @@ -419,8 +420,7 @@ complete: return rc; } -int xmm626_mipi_modem_data_send( - __attribute__((unused)) struct ipc_client *client, +int xmm626_mipi_modem_data_send(struct ipc_client *client, int device_fd, const void *data, size_t size, int address) { @@ -433,7 +433,7 @@ int xmm626_mipi_modem_data_send( if (device_fd < 0 || data == NULL || size == 0) return -1; - rc = xmm626_mipi_command_send(device_fd, + rc = xmm626_mipi_command_send(client, device_fd, XMM626_COMMAND_FLASH_SET_ADDRESS, &address, sizeof(address), 1, 0); if (rc < 0) @@ -446,7 +446,7 @@ int xmm626_mipi_modem_data_send( while (c < size) { count = chunk < size - c ? chunk : size - c; - rc = xmm626_mipi_command_send(device_fd, + rc = xmm626_mipi_command_send(client, device_fd, XMM626_COMMAND_FLASH_WRITE_BLOCK, p, count, 1, 1); if (rc < 0) @@ -522,8 +522,9 @@ int xmm626_mipi_port_config_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Read port config"); - rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_SET_PORT_CONFIG, - buffer, length, 1, 0); + rc = xmm626_mipi_command_send(client, device_fd, + XMM626_COMMAND_SET_PORT_CONFIG, buffer, + length, 1, 0); if (rc < 0) { ipc_client_log(client, "Sending port config command failed"); goto error; @@ -552,8 +553,9 @@ int xmm626_mipi_sec_start_send(struct ipc_client *client, int device_fd, return -1; } - rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_SEC_START, - sec_data, sec_size, 1, 0); + rc = xmm626_mipi_command_send(client, device_fd, + XMM626_COMMAND_SEC_START, sec_data, + sec_size, 1, 0); if (rc < 0) return -1; @@ -572,7 +574,7 @@ int xmm626_mipi_sec_end_send(struct ipc_client *client, int device_fd) sec_data = XMM626_SEC_END_MAGIC; sec_size = sizeof(sec_data); - rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_SEC_END, + rc = xmm626_mipi_command_send(client, device_fd, XMM626_COMMAND_SEC_END, &sec_data, sec_size, 1, 1); if (rc < 0) return -1; @@ -667,8 +669,9 @@ int xmm626_mipi_hw_reset_send(struct ipc_client *client, int device_fd) hw_reset_data = XMM626_HW_RESET_MAGIC; hw_reset_size = sizeof(hw_reset_data); - rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_HW_RESET, - &hw_reset_data, hw_reset_size, 0, 1); + rc = xmm626_mipi_command_send(client, device_fd, + XMM626_COMMAND_HW_RESET, &hw_reset_data, + hw_reset_size, 0, 1); if (rc < 0) return -1; |