aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-07-17 02:09:56 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-07-24 21:42:32 +0200
commitc1b4a61f748e67833216baa52ef9fc21d7f9dae0 (patch)
tree72601d7f5c2ad474ea60fb9695c1fad86b1231d7
parent09694a34d4920cba49c4e4d20d1a3e41750bfc91 (diff)
downloadhardware_replicant_libsamsung-ipc-c1b4a61f748e67833216baa52ef9fc21d7f9dae0.tar.gz
hardware_replicant_libsamsung-ipc-c1b4a61f748e67833216baa52ef9fc21d7f9dae0.tar.bz2
hardware_replicant_libsamsung-ipc-c1b4a61f748e67833216baa52ef9fc21d7f9dae0.zip
xmm626_hsic_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>
-rw-r--r--samsung-ipc/modems/xmm626/xmm626_hsic.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/samsung-ipc/modems/xmm626/xmm626_hsic.c b/samsung-ipc/modems/xmm626/xmm626_hsic.c
index d59fea0..16aaf00 100644
--- a/samsung-ipc/modems/xmm626/xmm626_hsic.c
+++ b/samsung-ipc/modems/xmm626/xmm626_hsic.c
@@ -307,7 +307,8 @@ complete:
return rc;
}
-int xmm626_hsic_command_send(int device_fd, unsigned short code,
+int xmm626_hsic_command_send(__attribute__((unused)) struct ipc_client *client,
+ int device_fd, unsigned short code,
const void *data, size_t size,
size_t command_data_size, int ack)
{
@@ -405,7 +406,7 @@ int xmm626_hsic_modem_data_send(
if (device_fd < 0 || data == NULL || size == 0)
return -1;
- rc = xmm626_hsic_command_send(device_fd,
+ rc = xmm626_hsic_command_send(client, device_fd,
XMM626_COMMAND_FLASH_SET_ADDRESS,
&address, sizeof(address),
XMM626_HSIC_FLASH_SET_ADDRESS_SIZE, 1);
@@ -420,7 +421,7 @@ int xmm626_hsic_modem_data_send(
count = chunk < size - c ? chunk : size - c;
rc = xmm626_hsic_command_send(
- device_fd, XMM626_COMMAND_FLASH_WRITE_BLOCK,
+ client, device_fd, XMM626_COMMAND_FLASH_WRITE_BLOCK,
p, count, XMM626_HSIC_FLASH_WRITE_BLOCK_SIZE, 0);
if (rc < 0)
goto error;
@@ -474,9 +475,10 @@ int xmm626_hsic_port_config_send(struct ipc_client *client, int device_fd)
}
ipc_client_log(client, "Read port config");
- rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_SET_PORT_CONFIG,
- buffer, length,
- XMM626_HSIC_SET_PORT_CONFIG_SIZE, 1);
+ rc = xmm626_hsic_command_send(client, device_fd,
+ XMM626_COMMAND_SET_PORT_CONFIG, buffer,
+ length, XMM626_HSIC_SET_PORT_CONFIG_SIZE,
+ 1);
if (rc < 0) {
ipc_client_log(client, "Sending port config command failed");
goto error;
@@ -505,9 +507,10 @@ int xmm626_hsic_sec_start_send(struct ipc_client *client, int device_fd,
return -1;
}
- rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_SEC_START,
- sec_data, sec_size,
- XMM626_HSIC_SEC_START_SIZE, 1);
+ rc = xmm626_hsic_command_send(client, device_fd,
+ XMM626_COMMAND_SEC_START, sec_data,
+ sec_size, XMM626_HSIC_SEC_START_SIZE,
+ 1);
if (rc < 0)
return -1;
@@ -526,7 +529,7 @@ int xmm626_hsic_sec_end_send(struct ipc_client *client, int device_fd)
sec_data = XMM626_SEC_END_MAGIC;
sec_size = sizeof(sec_data);
- rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_SEC_END,
+ rc = xmm626_hsic_command_send(client, device_fd, XMM626_COMMAND_SEC_END,
&sec_data, sec_size,
XMM626_HSIC_SEC_END_SIZE, 1);
if (rc < 0)
@@ -604,9 +607,10 @@ int xmm626_hsic_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_hsic_command_send(device_fd, XMM626_COMMAND_HW_RESET,
- &hw_reset_data, hw_reset_size,
- XMM626_HSIC_HW_RESET_SIZE, 0);
+ rc = xmm626_hsic_command_send(client, device_fd,
+ XMM626_COMMAND_HW_RESET, &hw_reset_data,
+ hw_reset_size, XMM626_HSIC_HW_RESET_SIZE,
+ 0);
if (rc < 0)
return -1;