diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-05-16 18:55:14 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-05-16 18:55:14 +0200 |
commit | 2384bd83a173071c35e0bb559b3577978336965e (patch) | |
tree | 6f52453b2f12c55e3e3787dd0f6498e2cef20584 /samsung-ipc | |
parent | 1294c5f96d6279a3f9ac4100b2af63debca8996d (diff) | |
download | external_libsamsung-ipc-2384bd83a173071c35e0bb559b3577978336965e.zip external_libsamsung-ipc-2384bd83a173071c35e0bb559b3577978336965e.tar.gz external_libsamsung-ipc-2384bd83a173071c35e0bb559b3577978336965e.tar.bz2 |
Generic xmm616 and xmm626 names
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
26 files changed, 780 insertions, 780 deletions
diff --git a/samsung-ipc/Makefile.am b/samsung-ipc/Makefile.am index 7d64b41..766796e 100644 --- a/samsung-ipc/Makefile.am +++ b/samsung-ipc/Makefile.am @@ -3,8 +3,8 @@ NULL = AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/samsung-ipc \ - -I$(top_srcdir)/samsung-ipc/devices/xmm6160 \ - -I$(top_srcdir)/samsung-ipc/devices/xmm6260 \ + -I$(top_srcdir)/samsung-ipc/devices/xmm616 \ + -I$(top_srcdir)/samsung-ipc/devices/xmm626 \ $(OPENSSL_CFLAGS) \ $(NULL) @@ -22,19 +22,19 @@ libsamsung_ipc_la_SOURCES = \ ipc_devices.c \ ipc_devices.h \ ipc_utils.c \ - devices/xmm6160/xmm6160.c \ - devices/xmm6160/xmm6160.h \ - devices/xmm6260/xmm6260.c \ - devices/xmm6260/xmm6260.h \ - devices/xmm6260/xmm6260_hsic.c \ - devices/xmm6260/xmm6260_hsic.h \ - devices/xmm6260/xmm6260_mipi.c \ - devices/xmm6260/xmm6260_mipi.h \ - devices/xmm6260/xmm6260_sec_modem.c \ - devices/xmm6260/xmm6260_sec_modem.h \ - devices/xmm6260/modem.h \ - devices/xmm6260/modem_link_device_hsic.h \ - devices/xmm6260/modem_prj.h \ + devices/xmm616/xmm616.c \ + devices/xmm616/xmm616.h \ + devices/xmm626/xmm626.c \ + devices/xmm626/xmm626.h \ + devices/xmm626/xmm626_hsic.c \ + devices/xmm626/xmm626_hsic.h \ + devices/xmm626/xmm626_mipi.c \ + devices/xmm626/xmm626_mipi.h \ + devices/xmm626/xmm626_sec_modem.c \ + devices/xmm626/xmm626_sec_modem.h \ + devices/xmm626/modem.h \ + devices/xmm626/modem_link_device_hsic.h \ + devices/xmm626/modem_prj.h \ devices/crespo/crespo.c \ devices/crespo/crespo.h \ devices/crespo/crespo_modem_ctl.h \ diff --git a/samsung-ipc/devices/aries/aries.c b/samsung-ipc/devices/aries/aries.c index fcd3576..012d01d 100644 --- a/samsung-ipc/devices/aries/aries.c +++ b/samsung-ipc/devices/aries/aries.c @@ -37,7 +37,7 @@ #include "onedram.h" #include "phonet.h" -#include "xmm6160.h" +#include "xmm616.h" #include "aries.h" int aries_boot(struct ipc_client *client) @@ -109,12 +109,12 @@ int aries_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data; - rc = xmm6160_psi_send(client, serial_fd, (void *) p, ARIES_PSI_SIZE); + rc = xmm616_psi_send(client, serial_fd, (void *) p, ARIES_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6160 PSI failed"); + ipc_client_log(client, "Sending XMM616 PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6160 PSI"); + ipc_client_log(client, "Sent XMM616 PSI"); p += ARIES_PSI_SIZE; @@ -156,21 +156,21 @@ int aries_boot(struct ipc_client *client) pp = (unsigned char *) onedram_address; - rc = xmm6160_firmware_send(client, -1, (void *) pp, (void *) p, ARIES_MODEM_IMAGE_SIZE - ARIES_PSI_SIZE); + rc = xmm616_firmware_send(client, -1, (void *) pp, (void *) p, ARIES_MODEM_IMAGE_SIZE - ARIES_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6160 firmware failed"); + ipc_client_log(client, "Sending XMM616 firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6160 firmware"); + ipc_client_log(client, "Sent XMM616 firmware"); pp = (unsigned char *) onedram_address + ARIES_ONEDRAM_NV_DATA_OFFSET; - rc = xmm6160_nv_data_send(client, -1, pp); + rc = xmm616_nv_data_send(client, -1, pp); if (rc < 0) { - ipc_client_log(client, "Sending XMM6160 nv_data failed"); + ipc_client_log(client, "Sending XMM616 nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6160 nv_data"); + ipc_client_log(client, "Sent XMM616 nv_data"); munmap(onedram_address, ARIES_ONEDRAM_MEMORY_SIZE); onedram_address = NULL; @@ -802,13 +802,13 @@ struct ipc_client_gprs_specs aries_gprs_specs = { }; struct ipc_client_nv_data_specs aries_nv_data_specs = { - .nv_data_path = XMM6160_NV_DATA_PATH, - .nv_data_md5_path = XMM6160_NV_DATA_MD5_PATH, - .nv_data_backup_path = XMM6160_NV_DATA_BACKUP_PATH, - .nv_data_backup_md5_path = XMM6160_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6160_NV_DATA_SECRET, - .nv_data_size = XMM6160_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6160_NV_DATA_CHUNK_SIZE, + .nv_data_path = XMM616_NV_DATA_PATH, + .nv_data_md5_path = XMM616_NV_DATA_MD5_PATH, + .nv_data_backup_path = XMM616_NV_DATA_BACKUP_PATH, + .nv_data_backup_md5_path = XMM616_NV_DATA_BACKUP_MD5_PATH, + .nv_data_secret = XMM616_NV_DATA_SECRET, + .nv_data_size = XMM616_NV_DATA_SIZE, + .nv_data_chunk_size = XMM616_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/crespo/crespo.c b/samsung-ipc/devices/crespo/crespo.c index fe50012..23658c1 100644 --- a/samsung-ipc/devices/crespo/crespo.c +++ b/samsung-ipc/devices/crespo/crespo.c @@ -33,7 +33,7 @@ #include "crespo_modem_ctl.h" -#include "xmm6160.h" +#include "xmm616.h" #include "crespo.h" int crespo_boot(struct ipc_client *client) @@ -81,32 +81,32 @@ int crespo_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data; - rc = xmm6160_psi_send(client, serial_fd, (void *) p, CRESPO_PSI_SIZE); + rc = xmm616_psi_send(client, serial_fd, (void *) p, CRESPO_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6160 PSI failed"); + ipc_client_log(client, "Sending XMM616 PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6160 PSI"); + ipc_client_log(client, "Sent XMM616 PSI"); p += CRESPO_PSI_SIZE; lseek(modem_ctl_fd, 0, SEEK_SET); - rc = xmm6160_firmware_send(client, modem_ctl_fd, NULL, (void *) p, CRESPO_MODEM_IMAGE_SIZE - CRESPO_PSI_SIZE); + rc = xmm616_firmware_send(client, modem_ctl_fd, NULL, (void *) p, CRESPO_MODEM_IMAGE_SIZE - CRESPO_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6160 firmware failed"); + ipc_client_log(client, "Sending XMM616 firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6160 firmware"); + ipc_client_log(client, "Sent XMM616 firmware"); lseek(modem_ctl_fd, CRESPO_MODEM_CTL_NV_DATA_OFFSET, SEEK_SET); - rc = xmm6160_nv_data_send(client, modem_ctl_fd, NULL); + rc = xmm616_nv_data_send(client, modem_ctl_fd, NULL); if (rc < 0) { - ipc_client_log(client, "Sending XMM6160 nv_data failed"); + ipc_client_log(client, "Sending XMM616 nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6160 nv_data"); + ipc_client_log(client, "Sent XMM616 nv_data"); rc = 0; goto complete; @@ -552,13 +552,13 @@ struct ipc_client_gprs_specs crespo_gprs_specs = { }; struct ipc_client_nv_data_specs crespo_nv_data_specs = { - .nv_data_path = XMM6160_NV_DATA_PATH, - .nv_data_md5_path = XMM6160_NV_DATA_MD5_PATH, - .nv_data_backup_path = XMM6160_NV_DATA_BACKUP_PATH, - .nv_data_backup_md5_path = XMM6160_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6160_NV_DATA_SECRET, - .nv_data_size = XMM6160_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6160_NV_DATA_CHUNK_SIZE, + .nv_data_path = XMM616_NV_DATA_PATH, + .nv_data_md5_path = XMM616_NV_DATA_MD5_PATH, + .nv_data_backup_path = XMM616_NV_DATA_BACKUP_PATH, + .nv_data_backup_md5_path = XMM616_NV_DATA_BACKUP_MD5_PATH, + .nv_data_secret = XMM616_NV_DATA_SECRET, + .nv_data_size = XMM616_NV_DATA_SIZE, + .nv_data_chunk_size = XMM616_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/galaxys2/galaxys2.c b/samsung-ipc/devices/galaxys2/galaxys2.c index 7070376..fe623c4 100644 --- a/samsung-ipc/devices/galaxys2/galaxys2.c +++ b/samsung-ipc/devices/galaxys2/galaxys2.c @@ -26,9 +26,9 @@ #include <samsung-ipc.h> #include <ipc.h> -#include "xmm6260.h" -#include "xmm6260_hsic.h" -#include "xmm6260_sec_modem.h" +#include "xmm626.h" +#include "xmm626_hsic.h" +#include "xmm626_sec_modem.h" #include "galaxys2.h" int galaxys2_boot(struct ipc_client *client) @@ -59,24 +59,24 @@ int galaxys2_boot(struct ipc_client *client) } ipc_client_log(client, "Mapped modem image data to memory"); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; } ipc_client_log(client, "Opened modem boot device"); - modem_link_fd = open(XMM6260_SEC_MODEM_LINK_PM_DEVICE, O_RDWR); + modem_link_fd = open(XMM626_SEC_MODEM_LINK_PM_DEVICE, O_RDWR); if (modem_link_fd < 0) { ipc_client_log(client, "Opening modem link device failed"); goto error; } ipc_client_log(client, "Opened modem link device"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 0); - rc |= xmm6260_sec_modem_link_control_enable(modem_link_fd, 0); - rc |= xmm6260_sec_modem_hci_power(0); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 0); + rc = xmm626_sec_modem_power(modem_boot_fd, 0); + rc |= xmm626_sec_modem_link_control_enable(modem_link_fd, 0); + rc |= xmm626_sec_modem_hci_power(0); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); @@ -84,10 +84,10 @@ int galaxys2_boot(struct ipc_client *client) } ipc_client_log(client, "Turned the modem off"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 1); - rc |= xmm6260_sec_modem_link_control_enable(modem_link_fd, 1); - rc |= xmm6260_sec_modem_hci_power(1); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 1); + rc = xmm626_sec_modem_power(modem_boot_fd, 1); + rc |= xmm626_sec_modem_link_control_enable(modem_link_fd, 1); + rc |= xmm626_sec_modem_hci_power(1); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); @@ -95,7 +95,7 @@ int galaxys2_boot(struct ipc_client *client) } ipc_client_log(client, "Turned the modem on"); - rc = xmm6260_sec_modem_link_connected_wait(modem_link_fd); + rc = xmm626_sec_modem_link_connected_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for link connected failed"); goto error; @@ -104,101 +104,101 @@ int galaxys2_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + GALAXYS2_PSI_OFFSET; - rc = xmm6260_hsic_psi_send(client, modem_boot_fd, (void *) p, GALAXYS2_PSI_SIZE); + rc = xmm626_hsic_psi_send(client, modem_boot_fd, (void *) p, GALAXYS2_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC PSI failed"); + ipc_client_log(client, "Sending XMM626 HSIC PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC PSI"); + ipc_client_log(client, "Sent XMM626 HSIC PSI"); p = (unsigned char *) modem_image_data + GALAXYS2_EBL_OFFSET; - rc = xmm6260_hsic_ebl_send(client, modem_boot_fd, (void *) p, GALAXYS2_EBL_SIZE); + rc = xmm626_hsic_ebl_send(client, modem_boot_fd, (void *) p, GALAXYS2_EBL_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC EBL failed"); + ipc_client_log(client, "Sending XMM626 HSIC EBL failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC EBL"); + ipc_client_log(client, "Sent XMM626 HSIC EBL"); - rc = xmm6260_hsic_port_config_send(client, modem_boot_fd); + rc = xmm626_hsic_port_config_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC port config failed"); + ipc_client_log(client, "Sending XMM626 HSIC port config failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC port config"); + ipc_client_log(client, "Sent XMM626 HSIC port config"); p = (unsigned char *) modem_image_data + GALAXYS2_SEC_START_OFFSET; - rc = xmm6260_hsic_sec_start_send(client, modem_boot_fd, (void *) p, GALAXYS2_SEC_START_SIZE); + rc = xmm626_hsic_sec_start_send(client, modem_boot_fd, (void *) p, GALAXYS2_SEC_START_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC SEC start failed"); + ipc_client_log(client, "Sending XMM626 HSIC SEC start failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC SEC start"); + ipc_client_log(client, "Sent XMM626 HSIC SEC start"); p = (unsigned char *) modem_image_data + GALAXYS2_FIRMWARE_OFFSET; - rc = xmm6260_hsic_firmware_send(client, modem_boot_fd, (void *) p, GALAXYS2_FIRMWARE_SIZE); + rc = xmm626_hsic_firmware_send(client, modem_boot_fd, (void *) p, GALAXYS2_FIRMWARE_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC firmware failed"); + ipc_client_log(client, "Sending XMM626 HSIC firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC firmware"); + ipc_client_log(client, "Sent XMM626 HSIC firmware"); - rc = xmm6260_hsic_nv_data_send(client, modem_boot_fd); + rc = xmm626_hsic_nv_data_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC nv_data failed"); + ipc_client_log(client, "Sending XMM626 HSIC nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC nv_data"); + ipc_client_log(client, "Sent XMM626 HSIC nv_data"); - rc = xmm6260_hsic_sec_end_send(client, modem_boot_fd); + rc = xmm626_hsic_sec_end_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC SEC end failed"); + ipc_client_log(client, "Sending XMM626 HSIC SEC end failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC SEC end"); + ipc_client_log(client, "Sent XMM626 HSIC SEC end"); - rc = xmm6260_hsic_hw_reset_send(client, modem_boot_fd); + rc = xmm626_hsic_hw_reset_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC HW reset failed"); + ipc_client_log(client, "Sending XMM626 HSIC HW reset failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC HW reset"); + ipc_client_log(client, "Sent XMM626 HSIC HW reset"); usleep(300000); - rc = xmm6260_sec_modem_link_get_hostwake_wait(modem_link_fd); + rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for host wake failed"); } - rc = xmm6260_sec_modem_link_control_enable(modem_link_fd, 0); - rc |= xmm6260_sec_modem_hci_power(0); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 0); + rc = xmm626_sec_modem_link_control_enable(modem_link_fd, 0); + rc |= xmm626_sec_modem_hci_power(0); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } - rc = xmm6260_sec_modem_link_get_hostwake_wait(modem_link_fd); + rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for host wake failed"); goto error; } ipc_client_log(client, "Waited for host wake"); - rc = xmm6260_sec_modem_link_control_enable(modem_link_fd, 1); - rc |= xmm6260_sec_modem_hci_power(1); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 1); + rc = xmm626_sec_modem_link_control_enable(modem_link_fd, 1); + rc |= xmm626_sec_modem_hci_power(1); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); goto error; } - rc = xmm6260_sec_modem_link_connected_wait(modem_link_fd); + rc = xmm626_sec_modem_link_connected_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for link connected failed"); goto error; @@ -238,7 +238,7 @@ int galaxys2_open(void *data, int type) transport_data = (struct galaxys2_transport_data *) data; - transport_data->fd = xmm6260_sec_modem_open(type); + transport_data->fd = xmm626_sec_modem_open(type); if (transport_data->fd < 0) return -1; @@ -254,7 +254,7 @@ int galaxys2_close(void *data) transport_data = (struct galaxys2_transport_data *) data; - xmm6260_sec_modem_close(transport_data->fd); + xmm626_sec_modem_close(transport_data->fd); transport_data->fd = -1; return 0; @@ -270,7 +270,7 @@ int galaxys2_read(void *data, void *buffer, size_t length) transport_data = (struct galaxys2_transport_data *) data; - rc = xmm6260_sec_modem_read(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_read(transport_data->fd, buffer, length); return rc; } @@ -285,7 +285,7 @@ int galaxys2_write(void *data, const void *buffer, size_t length) transport_data = (struct galaxys2_transport_data *) data; - rc = xmm6260_sec_modem_write(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_write(transport_data->fd, buffer, length); return rc; } @@ -300,7 +300,7 @@ int galaxys2_poll(void *data, struct timeval *timeout) transport_data = (struct galaxys2_transport_data *) data; - rc = xmm6260_sec_modem_poll(transport_data->fd, timeout); + rc = xmm626_sec_modem_poll(transport_data->fd, timeout); return rc; } @@ -315,11 +315,11 @@ int galaxys2_power_off(void *data) int fd; int rc; - fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) return -1; - rc = xmm6260_sec_modem_power(fd, 0); + rc = xmm626_sec_modem_power(fd, 0); close(fd); @@ -353,14 +353,14 @@ int galaxys2_data_destroy(void *transport_data, void *power_data, struct ipc_client_ops galaxys2_fmt_ops = { .boot = galaxys2_boot, - .send = xmm6260_sec_modem_fmt_send, - .recv = xmm6260_sec_modem_fmt_recv, + .send = xmm626_sec_modem_fmt_send, + .recv = xmm626_sec_modem_fmt_recv, }; struct ipc_client_ops galaxys2_rfs_ops = { .boot = NULL, - .send = xmm6260_sec_modem_rfs_send, - .recv = xmm6260_sec_modem_rfs_recv, + .send = xmm626_sec_modem_rfs_send, + .recv = xmm626_sec_modem_rfs_recv, }; struct ipc_client_handlers galaxys2_handlers = { @@ -381,18 +381,18 @@ struct ipc_client_handlers galaxys2_handlers = { }; struct ipc_client_gprs_specs galaxys2_gprs_specs = { - .gprs_get_iface = xmm6260_sec_modem_gprs_get_iface, - .gprs_get_capabilities = xmm6260_sec_modem_gprs_get_capabilities, + .gprs_get_iface = xmm626_sec_modem_gprs_get_iface, + .gprs_get_capabilities = xmm626_sec_modem_gprs_get_capabilities, }; struct ipc_client_nv_data_specs galaxys2_nv_data_specs = { - .nv_data_path = XMM6260_NV_DATA_PATH, - .nv_data_md5_path = XMM6260_NV_DATA_MD5_PATH, - .nv_data_backup_path = XMM6260_NV_DATA_BACKUP_PATH, - .nv_data_backup_md5_path = XMM6260_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6260_NV_DATA_SECRET, - .nv_data_size = XMM6260_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6260_NV_DATA_CHUNK_SIZE, + .nv_data_path = XMM626_NV_DATA_PATH, + .nv_data_md5_path = XMM626_NV_DATA_MD5_PATH, + .nv_data_backup_path = XMM626_NV_DATA_BACKUP_PATH, + .nv_data_backup_md5_path = XMM626_NV_DATA_BACKUP_MD5_PATH, + .nv_data_secret = XMM626_NV_DATA_SECRET, + .nv_data_size = XMM626_NV_DATA_SIZE, + .nv_data_chunk_size = XMM626_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/i9300/i9300.c b/samsung-ipc/devices/i9300/i9300.c index a3c22bd..9c3611d 100644 --- a/samsung-ipc/devices/i9300/i9300.c +++ b/samsung-ipc/devices/i9300/i9300.c @@ -26,9 +26,9 @@ #include <samsung-ipc.h> #include <ipc.h> -#include "xmm6260.h" -#include "xmm6260_hsic.h" -#include "xmm6260_sec_modem.h" +#include "xmm626.h" +#include "xmm626_hsic.h" +#include "xmm626_sec_modem.h" #include "i9300.h" int i9300_boot(struct ipc_client *client) @@ -59,29 +59,29 @@ int i9300_boot(struct ipc_client *client) } ipc_client_log(client, "Mapped modem image data to memory"); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; } ipc_client_log(client, "Opened modem boot device"); - modem_link_fd = open(XMM6260_SEC_MODEM_LINK_PM_DEVICE, O_RDWR); + modem_link_fd = open(XMM626_SEC_MODEM_LINK_PM_DEVICE, O_RDWR); if (modem_link_fd < 0) { ipc_client_log(client, "Opening modem link device failed"); goto error; } ipc_client_log(client, "Opened modem link device"); - rc = xmm6260_sec_modem_hci_power(0); + rc = xmm626_sec_modem_hci_power(0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } ipc_client_log(client, "Turned the modem off"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 1); - rc |= xmm6260_sec_modem_hci_power(1); + rc = xmm626_sec_modem_power(modem_boot_fd, 1); + rc |= xmm626_sec_modem_hci_power(1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); @@ -89,7 +89,7 @@ int i9300_boot(struct ipc_client *client) } ipc_client_log(client, "Turned the modem on"); - rc = xmm6260_sec_modem_link_connected_wait(modem_link_fd); + rc = xmm626_sec_modem_link_connected_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for link connected failed"); goto error; @@ -98,101 +98,101 @@ int i9300_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + I9300_PSI_OFFSET; - rc = xmm6260_hsic_psi_send(client, modem_boot_fd, (void *) p, I9300_PSI_SIZE); + rc = xmm626_hsic_psi_send(client, modem_boot_fd, (void *) p, I9300_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC PSI failed"); + ipc_client_log(client, "Sending XMM626 HSIC PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC PSI"); + ipc_client_log(client, "Sent XMM626 HSIC PSI"); p = (unsigned char *) modem_image_data + I9300_EBL_OFFSET; - rc = xmm6260_hsic_ebl_send(client, modem_boot_fd, (void *) p, I9300_EBL_SIZE); + rc = xmm626_hsic_ebl_send(client, modem_boot_fd, (void *) p, I9300_EBL_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC EBL failed"); + ipc_client_log(client, "Sending XMM626 HSIC EBL failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC EBL"); + ipc_client_log(client, "Sent XMM626 HSIC EBL"); - rc = xmm6260_hsic_port_config_send(client, modem_boot_fd); + rc = xmm626_hsic_port_config_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC port config failed"); + ipc_client_log(client, "Sending XMM626 HSIC port config failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC port config"); + ipc_client_log(client, "Sent XMM626 HSIC port config"); p = (unsigned char *) modem_image_data + I9300_SEC_START_OFFSET; - rc = xmm6260_hsic_sec_start_send(client, modem_boot_fd, (void *) p, I9300_SEC_START_SIZE); + rc = xmm626_hsic_sec_start_send(client, modem_boot_fd, (void *) p, I9300_SEC_START_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC SEC start failed"); + ipc_client_log(client, "Sending XMM626 HSIC SEC start failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC SEC start"); + ipc_client_log(client, "Sent XMM626 HSIC SEC start"); p = (unsigned char *) modem_image_data + I9300_FIRMWARE_OFFSET; - rc = xmm6260_hsic_firmware_send(client, modem_boot_fd, (void *) p, I9300_FIRMWARE_SIZE); + rc = xmm626_hsic_firmware_send(client, modem_boot_fd, (void *) p, I9300_FIRMWARE_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC firmware failed"); + ipc_client_log(client, "Sending XMM626 HSIC firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC firmware"); + ipc_client_log(client, "Sent XMM626 HSIC firmware"); - rc = xmm6260_hsic_nv_data_send(client, modem_boot_fd); + rc = xmm626_hsic_nv_data_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC nv_data failed"); + ipc_client_log(client, "Sending XMM626 HSIC nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC nv_data"); + ipc_client_log(client, "Sent XMM626 HSIC nv_data"); - rc = xmm6260_hsic_sec_end_send(client, modem_boot_fd); + rc = xmm626_hsic_sec_end_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC SEC end failed"); + ipc_client_log(client, "Sending XMM626 HSIC SEC end failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC SEC end"); + ipc_client_log(client, "Sent XMM626 HSIC SEC end"); - rc = xmm6260_hsic_hw_reset_send(client, modem_boot_fd); + rc = xmm626_hsic_hw_reset_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC HW reset failed"); + ipc_client_log(client, "Sending XMM626 HSIC HW reset failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC HW reset"); + ipc_client_log(client, "Sent XMM626 HSIC HW reset"); usleep(300000); - rc = xmm6260_sec_modem_link_get_hostwake_wait(modem_link_fd); + rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for host wake failed"); } - rc = xmm6260_sec_modem_link_control_enable(modem_link_fd, 0); - rc |= xmm6260_sec_modem_hci_power(0); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 0); + rc = xmm626_sec_modem_link_control_enable(modem_link_fd, 0); + rc |= xmm626_sec_modem_hci_power(0); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } - rc = xmm6260_sec_modem_link_get_hostwake_wait(modem_link_fd); + rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for host wake failed"); goto error; } ipc_client_log(client, "Waited for host wake"); - rc = xmm6260_sec_modem_link_control_enable(modem_link_fd, 1); - rc |= xmm6260_sec_modem_hci_power(1); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 1); + rc = xmm626_sec_modem_link_control_enable(modem_link_fd, 1); + rc |= xmm626_sec_modem_hci_power(1); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); goto error; } - rc = xmm6260_sec_modem_link_connected_wait(modem_link_fd); + rc = xmm626_sec_modem_link_connected_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for link connected failed"); goto error; @@ -232,7 +232,7 @@ int i9300_open(void *data, int type) transport_data = (struct i9300_transport_data *) data; - transport_data->fd = xmm6260_sec_modem_open(type); + transport_data->fd = xmm626_sec_modem_open(type); if (transport_data->fd < 0) return -1; @@ -248,7 +248,7 @@ int i9300_close(void *data) transport_data = (struct i9300_transport_data *) data; - xmm6260_sec_modem_close(transport_data->fd); + xmm626_sec_modem_close(transport_data->fd); transport_data->fd = -1; return 0; @@ -264,7 +264,7 @@ int i9300_read(void *data, void *buffer, size_t length) transport_data = (struct i9300_transport_data *) data; - rc = xmm6260_sec_modem_read(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_read(transport_data->fd, buffer, length); return rc; } @@ -279,7 +279,7 @@ int i9300_write(void *data, const void *buffer, size_t length) transport_data = (struct i9300_transport_data *) data; - rc = xmm6260_sec_modem_write(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_write(transport_data->fd, buffer, length); return rc; } @@ -294,7 +294,7 @@ int i9300_poll(void *data, struct timeval *timeout) transport_data = (struct i9300_transport_data *) data; - rc = xmm6260_sec_modem_poll(transport_data->fd, timeout); + rc = xmm626_sec_modem_poll(transport_data->fd, timeout); return rc; } @@ -309,11 +309,11 @@ int i9300_power_off(void *data) int fd; int rc; - fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) return -1; - rc = xmm6260_sec_modem_power(fd, 0); + rc = xmm626_sec_modem_power(fd, 0); close(fd); @@ -346,14 +346,14 @@ int i9300_data_destroy(void *transport_data, void *power_data, void *gprs_data) struct ipc_client_ops i9300_fmt_ops = { .boot = i9300_boot, - .send = xmm6260_sec_modem_fmt_send, - .recv = xmm6260_sec_modem_fmt_recv, + .send = xmm626_sec_modem_fmt_send, + .recv = xmm626_sec_modem_fmt_recv, }; struct ipc_client_ops i9300_rfs_ops = { .boot = NULL, - .send = xmm6260_sec_modem_rfs_send, - .recv = xmm6260_sec_modem_rfs_recv, + .send = xmm626_sec_modem_rfs_send, + .recv = xmm626_sec_modem_rfs_recv, }; struct ipc_client_handlers i9300_handlers = { @@ -374,18 +374,18 @@ struct ipc_client_handlers i9300_handlers = { }; struct ipc_client_gprs_specs i9300_gprs_specs = { - .gprs_get_iface = xmm6260_sec_modem_gprs_get_iface, - .gprs_get_capabilities = xmm6260_sec_modem_gprs_get_capabilities, + .gprs_get_iface = xmm626_sec_modem_gprs_get_iface, + .gprs_get_capabilities = xmm626_sec_modem_gprs_get_capabilities, }; struct ipc_client_nv_data_specs i9300_nv_data_specs = { - .nv_data_path = XMM6260_NV_DATA_PATH, - .nv_data_md5_path = XMM6260_NV_DATA_MD5_PATH, - .nv_data_backup_path = XMM6260_NV_DATA_BACKUP_PATH, - .nv_data_backup_md5_path = XMM6260_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6260_NV_DATA_SECRET, - .nv_data_size = XMM6260_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6260_NV_DATA_CHUNK_SIZE, + .nv_data_path = XMM626_NV_DATA_PATH, + .nv_data_md5_path = XMM626_NV_DATA_MD5_PATH, + .nv_data_backup_path = XMM626_NV_DATA_BACKUP_PATH, + .nv_data_backup_md5_path = XMM626_NV_DATA_BACKUP_MD5_PATH, + .nv_data_secret = XMM626_NV_DATA_SECRET, + .nv_data_size = XMM626_NV_DATA_SIZE, + .nv_data_chunk_size = XMM626_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/maguro/maguro.c b/samsung-ipc/devices/maguro/maguro.c index f157883..7bb59af 100644 --- a/samsung-ipc/devices/maguro/maguro.c +++ b/samsung-ipc/devices/maguro/maguro.c @@ -28,9 +28,9 @@ #include <ipc.h> #include <utils.h> -#include "xmm6260.h" -#include "xmm6260_mipi.h" -#include "xmm6260_sec_modem.h" +#include "xmm626.h" +#include "xmm626_mipi.h" +#include "xmm626_sec_modem.h" #include "maguro.h" int maguro_boot(struct ipc_client *client) @@ -61,21 +61,21 @@ int maguro_boot(struct ipc_client *client) } ipc_client_log(client, "Mapped modem image data to memory"); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; } ipc_client_log(client, "Opened modem boot device"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 0); + rc = xmm626_sec_modem_power(modem_boot_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } ipc_client_log(client, "Turned the modem off"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 1); + rc = xmm626_sec_modem_power(modem_boot_fd, 1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); goto error; @@ -84,16 +84,16 @@ int maguro_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + MAGURO_PSI_OFFSET; - rc = xmm6260_mipi_psi_send(client, modem_boot_fd, (void *) p, MAGURO_PSI_SIZE); + rc = xmm626_mipi_psi_send(client, modem_boot_fd, (void *) p, MAGURO_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI PSI failed"); + ipc_client_log(client, "Sending XMM626 MIPI PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI PSI"); + ipc_client_log(client, "Sent XMM626 MIPI PSI"); close(modem_boot_fd); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT1_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT1_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; @@ -102,44 +102,44 @@ int maguro_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + MAGURO_EBL_OFFSET; - rc = xmm6260_mipi_ebl_send(client, modem_boot_fd, (void *) p, MAGURO_EBL_SIZE); + rc = xmm626_mipi_ebl_send(client, modem_boot_fd, (void *) p, MAGURO_EBL_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI EBL failed"); + ipc_client_log(client, "Sending XMM626 MIPI EBL failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI EBL"); + ipc_client_log(client, "Sent XMM626 MIPI EBL"); - rc = xmm6260_mipi_port_config_send(client, modem_boot_fd); + rc = xmm626_mipi_port_config_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI port config failed"); + ipc_client_log(client, "Sending XMM626 MIPI port config failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI port config"); + ipc_client_log(client, "Sent XMM626 MIPI port config"); p = (unsigned char *) modem_image_data + MAGURO_SEC_START_OFFSET; - rc = xmm6260_mipi_sec_start_send(client, modem_boot_fd, (void *) p, MAGURO_SEC_START_SIZE); + rc = xmm626_mipi_sec_start_send(client, modem_boot_fd, (void *) p, MAGURO_SEC_START_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI SEC start failed"); + ipc_client_log(client, "Sending XMM626 MIPI SEC start failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI SEC start"); + ipc_client_log(client, "Sent XMM626 MIPI SEC start"); p = (unsigned char *) modem_image_data + MAGURO_FIRMWARE_OFFSET; - rc = xmm6260_mipi_firmware_send(client, modem_boot_fd, (void *) p, MAGURO_FIRMWARE_SIZE); + rc = xmm626_mipi_firmware_send(client, modem_boot_fd, (void *) p, MAGURO_FIRMWARE_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI firmware failed"); + ipc_client_log(client, "Sending XMM626 MIPI firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI firmware"); + ipc_client_log(client, "Sent XMM626 MIPI firmware"); - rc = xmm6260_mipi_nv_data_send(client, modem_boot_fd); + rc = xmm626_mipi_nv_data_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI nv_data failed"); + ipc_client_log(client, "Sending XMM626 MIPI nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI nv_data"); + ipc_client_log(client, "Sent XMM626 MIPI nv_data"); mps_data = file_data_read(MAGURO_MPS_DATA_DEVICE, MAGURO_MPS_DATA_SIZE, MAGURO_MPS_DATA_SIZE, 0); if (mps_data == NULL) { @@ -148,35 +148,35 @@ int maguro_boot(struct ipc_client *client) } ipc_client_log(client, "Read MPS data"); - rc = xmm6260_mipi_mps_data_send(client, modem_boot_fd, mps_data, MAGURO_MPS_DATA_SIZE); + rc = xmm626_mipi_mps_data_send(client, modem_boot_fd, mps_data, MAGURO_MPS_DATA_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI MPS data failed"); + ipc_client_log(client, "Sending XMM626 MIPI MPS data failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI MPS data"); + ipc_client_log(client, "Sent XMM626 MIPI MPS data"); - rc = xmm6260_mipi_sec_end_send(client, modem_boot_fd); + rc = xmm626_mipi_sec_end_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI SEC end failed"); + ipc_client_log(client, "Sending XMM626 MIPI SEC end failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI SEC end"); + ipc_client_log(client, "Sent XMM626 MIPI SEC end"); - rc = xmm6260_mipi_hw_reset_send(client, modem_boot_fd); + rc = xmm626_mipi_hw_reset_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI HW reset failed"); + ipc_client_log(client, "Sending XMM626 MIPI HW reset failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI HW reset"); + ipc_client_log(client, "Sent XMM626 MIPI HW reset"); - rc = xmm6260_sec_modem_status_online_wait(modem_boot_fd); + rc = xmm626_sec_modem_status_online_wait(modem_boot_fd); if (rc < 0) { ipc_client_log(client, "Waiting for online status failed"); goto error; } ipc_client_log(client, "Waited for online status"); - rc = xmm6260_sec_modem_boot_power(modem_boot_fd, 0); + rc = xmm626_sec_modem_boot_power(modem_boot_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning modem boot off failed"); goto error; @@ -214,7 +214,7 @@ int maguro_open(void *data, int type) transport_data = (struct maguro_transport_data *) data; - transport_data->fd = xmm6260_sec_modem_open(type); + transport_data->fd = xmm626_sec_modem_open(type); if (transport_data->fd < 0) return -1; @@ -230,7 +230,7 @@ int maguro_close(void *data) transport_data = (struct maguro_transport_data *) data; - xmm6260_sec_modem_close(transport_data->fd); + xmm626_sec_modem_close(transport_data->fd); transport_data->fd = -1; return 0; @@ -246,7 +246,7 @@ int maguro_read(void *data, void *buffer, size_t length) transport_data = (struct maguro_transport_data *) data; - rc = xmm6260_sec_modem_read(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_read(transport_data->fd, buffer, length); return rc; } @@ -261,7 +261,7 @@ int maguro_write(void *data, const void *buffer, size_t length) transport_data = (struct maguro_transport_data *) data; - rc = xmm6260_sec_modem_write(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_write(transport_data->fd, buffer, length); return rc; } @@ -276,7 +276,7 @@ int maguro_poll(void *data, struct timeval *timeout) transport_data = (struct maguro_transport_data *) data; - rc = xmm6260_sec_modem_poll(transport_data->fd, timeout); + rc = xmm626_sec_modem_poll(transport_data->fd, timeout); return rc; } @@ -291,11 +291,11 @@ int maguro_power_off(void *data) int fd; int rc; - fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) return -1; - rc = xmm6260_sec_modem_power(fd, 0); + rc = xmm626_sec_modem_power(fd, 0); close(fd); @@ -329,14 +329,14 @@ int maguro_data_destroy(void *transport_data, void *power_data, struct ipc_client_ops maguro_fmt_ops = { .boot = maguro_boot, - .send = xmm6260_sec_modem_fmt_send, - .recv = xmm6260_sec_modem_fmt_recv, + .send = xmm626_sec_modem_fmt_send, + .recv = xmm626_sec_modem_fmt_recv, }; struct ipc_client_ops maguro_rfs_ops = { .boot = NULL, - .send = xmm6260_sec_modem_rfs_send, - .recv = xmm6260_sec_modem_rfs_recv, + .send = xmm626_sec_modem_rfs_send, + .recv = xmm626_sec_modem_rfs_recv, }; struct ipc_client_handlers maguro_handlers = { @@ -357,8 +357,8 @@ struct ipc_client_handlers maguro_handlers = { }; struct ipc_client_gprs_specs maguro_gprs_specs = { - .gprs_get_iface = xmm6260_sec_modem_gprs_get_iface, - .gprs_get_capabilities = xmm6260_sec_modem_gprs_get_capabilities, + .gprs_get_iface = xmm626_sec_modem_gprs_get_iface, + .gprs_get_capabilities = xmm626_sec_modem_gprs_get_capabilities, }; struct ipc_client_nv_data_specs maguro_nv_data_specs = { @@ -366,9 +366,9 @@ struct ipc_client_nv_data_specs maguro_nv_data_specs = { .nv_data_md5_path = MAGURO_NV_DATA_MD5_PATH, .nv_data_backup_path = MAGURO_NV_DATA_BACKUP_PATH, .nv_data_backup_md5_path = MAGURO_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6260_NV_DATA_SECRET, - .nv_data_size = XMM6260_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6260_NV_DATA_CHUNK_SIZE, + .nv_data_secret = XMM626_NV_DATA_SECRET, + .nv_data_size = XMM626_NV_DATA_SIZE, + .nv_data_chunk_size = XMM626_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/n7100/n7100.c b/samsung-ipc/devices/n7100/n7100.c index c72dcdd..a85ffe2 100644 --- a/samsung-ipc/devices/n7100/n7100.c +++ b/samsung-ipc/devices/n7100/n7100.c @@ -26,9 +26,9 @@ #include <samsung-ipc.h> #include <ipc.h> -#include "xmm6260.h" -#include "xmm6260_hsic.h" -#include "xmm6260_sec_modem.h" +#include "xmm626.h" +#include "xmm626_hsic.h" +#include "xmm626_sec_modem.h" #include "n7100.h" int n7100_boot(struct ipc_client *client) @@ -59,29 +59,29 @@ int n7100_boot(struct ipc_client *client) } ipc_client_log(client, "Mapped modem image data to memory"); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; } ipc_client_log(client, "Opened modem boot device"); - modem_link_fd = open(XMM6260_SEC_MODEM_LINK_PM_DEVICE, O_RDWR); + modem_link_fd = open(XMM626_SEC_MODEM_LINK_PM_DEVICE, O_RDWR); if (modem_link_fd < 0) { ipc_client_log(client, "Opening modem link device failed"); goto error; } ipc_client_log(client, "Opened modem link device"); - rc = xmm6260_sec_modem_hci_power(0); + rc = xmm626_sec_modem_hci_power(0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } ipc_client_log(client, "Turned the modem off"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 1); - rc |= xmm6260_sec_modem_hci_power(1); + rc = xmm626_sec_modem_power(modem_boot_fd, 1); + rc |= xmm626_sec_modem_hci_power(1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); @@ -89,7 +89,7 @@ int n7100_boot(struct ipc_client *client) } ipc_client_log(client, "Turned the modem on"); - rc = xmm6260_sec_modem_link_connected_wait(modem_link_fd); + rc = xmm626_sec_modem_link_connected_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for link connected failed"); goto error; @@ -98,101 +98,101 @@ int n7100_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + N7100_PSI_OFFSET; - rc = xmm6260_hsic_psi_send(client, modem_boot_fd, (void *) p, N7100_PSI_SIZE); + rc = xmm626_hsic_psi_send(client, modem_boot_fd, (void *) p, N7100_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC PSI failed"); + ipc_client_log(client, "Sending XMM626 HSIC PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC PSI"); + ipc_client_log(client, "Sent XMM626 HSIC PSI"); p = (unsigned char *) modem_image_data + N7100_EBL_OFFSET; - rc = xmm6260_hsic_ebl_send(client, modem_boot_fd, (void *) p, N7100_EBL_SIZE); + rc = xmm626_hsic_ebl_send(client, modem_boot_fd, (void *) p, N7100_EBL_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC EBL failed"); + ipc_client_log(client, "Sending XMM626 HSIC EBL failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC EBL"); + ipc_client_log(client, "Sent XMM626 HSIC EBL"); - rc = xmm6260_hsic_port_config_send(client, modem_boot_fd); + rc = xmm626_hsic_port_config_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC port config failed"); + ipc_client_log(client, "Sending XMM626 HSIC port config failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC port config"); + ipc_client_log(client, "Sent XMM626 HSIC port config"); p = (unsigned char *) modem_image_data + N7100_SEC_START_OFFSET; - rc = xmm6260_hsic_sec_start_send(client, modem_boot_fd, (void *) p, N7100_SEC_START_SIZE); + rc = xmm626_hsic_sec_start_send(client, modem_boot_fd, (void *) p, N7100_SEC_START_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC SEC start failed"); + ipc_client_log(client, "Sending XMM626 HSIC SEC start failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC SEC start"); + ipc_client_log(client, "Sent XMM626 HSIC SEC start"); p = (unsigned char *) modem_image_data + N7100_FIRMWARE_OFFSET; - rc = xmm6260_hsic_firmware_send(client, modem_boot_fd, (void *) p, N7100_FIRMWARE_SIZE); + rc = xmm626_hsic_firmware_send(client, modem_boot_fd, (void *) p, N7100_FIRMWARE_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC firmware failed"); + ipc_client_log(client, "Sending XMM626 HSIC firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC firmware"); + ipc_client_log(client, "Sent XMM626 HSIC firmware"); - rc = xmm6260_hsic_nv_data_send(client, modem_boot_fd); + rc = xmm626_hsic_nv_data_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC nv_data failed"); + ipc_client_log(client, "Sending XMM626 HSIC nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC nv_data"); + ipc_client_log(client, "Sent XMM626 HSIC nv_data"); - rc = xmm6260_hsic_sec_end_send(client, modem_boot_fd); + rc = xmm626_hsic_sec_end_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC SEC end failed"); + ipc_client_log(client, "Sending XMM626 HSIC SEC end failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC SEC end"); + ipc_client_log(client, "Sent XMM626 HSIC SEC end"); - rc = xmm6260_hsic_hw_reset_send(client, modem_boot_fd); + rc = xmm626_hsic_hw_reset_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 HSIC HW reset failed"); + ipc_client_log(client, "Sending XMM626 HSIC HW reset failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 HSIC HW reset"); + ipc_client_log(client, "Sent XMM626 HSIC HW reset"); usleep(300000); - rc = xmm6260_sec_modem_link_get_hostwake_wait(modem_link_fd); + rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for host wake failed"); } - rc = xmm6260_sec_modem_link_control_enable(modem_link_fd, 0); - rc |= xmm6260_sec_modem_hci_power(0); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 0); + rc = xmm626_sec_modem_link_control_enable(modem_link_fd, 0); + rc |= xmm626_sec_modem_hci_power(0); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } - rc = xmm6260_sec_modem_link_get_hostwake_wait(modem_link_fd); + rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for host wake failed"); goto error; } ipc_client_log(client, "Waited for host wake"); - rc = xmm6260_sec_modem_link_control_enable(modem_link_fd, 1); - rc |= xmm6260_sec_modem_hci_power(1); - rc |= xmm6260_sec_modem_link_control_active(modem_link_fd, 1); + rc = xmm626_sec_modem_link_control_enable(modem_link_fd, 1); + rc |= xmm626_sec_modem_hci_power(1); + rc |= xmm626_sec_modem_link_control_active(modem_link_fd, 1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); goto error; } - rc = xmm6260_sec_modem_link_connected_wait(modem_link_fd); + rc = xmm626_sec_modem_link_connected_wait(modem_link_fd); if (rc < 0) { ipc_client_log(client, "Waiting for link connected failed"); goto error; @@ -232,7 +232,7 @@ int n7100_open(void *data, int type) transport_data = (struct n7100_transport_data *) data; - transport_data->fd = xmm6260_sec_modem_open(type); + transport_data->fd = xmm626_sec_modem_open(type); if (transport_data->fd < 0) return -1; @@ -248,7 +248,7 @@ int n7100_close(void *data) transport_data = (struct n7100_transport_data *) data; - xmm6260_sec_modem_close(transport_data->fd); + xmm626_sec_modem_close(transport_data->fd); transport_data->fd = -1; return 0; @@ -264,7 +264,7 @@ int n7100_read(void *data, void *buffer, size_t length) transport_data = (struct n7100_transport_data *) data; - rc = xmm6260_sec_modem_read(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_read(transport_data->fd, buffer, length); return rc; } @@ -279,7 +279,7 @@ int n7100_write(void *data, const void *buffer, size_t length) transport_data = (struct n7100_transport_data *) data; - rc = xmm6260_sec_modem_write(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_write(transport_data->fd, buffer, length); return rc; } @@ -294,7 +294,7 @@ int n7100_poll(void *data, struct timeval *timeout) transport_data = (struct n7100_transport_data *) data; - rc = xmm6260_sec_modem_poll(transport_data->fd, timeout); + rc = xmm626_sec_modem_poll(transport_data->fd, timeout); return rc; } @@ -309,11 +309,11 @@ int n7100_power_off(void *data) int fd; int rc; - fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) return -1; - rc = xmm6260_sec_modem_power(fd, 0); + rc = xmm626_sec_modem_power(fd, 0); close(fd); @@ -347,14 +347,14 @@ int n7100_data_destroy(void *transport_data, void *power_data, struct ipc_client_ops n7100_fmt_ops = { .boot = n7100_boot, - .send = xmm6260_sec_modem_fmt_send, - .recv = xmm6260_sec_modem_fmt_recv, + .send = xmm626_sec_modem_fmt_send, + .recv = xmm626_sec_modem_fmt_recv, }; struct ipc_client_ops n7100_rfs_ops = { .boot = NULL, - .send = xmm6260_sec_modem_rfs_send, - .recv = xmm6260_sec_modem_rfs_recv, + .send = xmm626_sec_modem_rfs_send, + .recv = xmm626_sec_modem_rfs_recv, }; struct ipc_client_handlers n7100_handlers = { @@ -375,18 +375,18 @@ struct ipc_client_handlers n7100_handlers = { }; struct ipc_client_gprs_specs n7100_gprs_specs = { - .gprs_get_iface = xmm6260_sec_modem_gprs_get_iface, - .gprs_get_capabilities = xmm6260_sec_modem_gprs_get_capabilities, + .gprs_get_iface = xmm626_sec_modem_gprs_get_iface, + .gprs_get_capabilities = xmm626_sec_modem_gprs_get_capabilities, }; struct ipc_client_nv_data_specs n7100_nv_data_specs = { - .nv_data_path = XMM6260_NV_DATA_PATH, - .nv_data_md5_path = XMM6260_NV_DATA_MD5_PATH, - .nv_data_backup_path = XMM6260_NV_DATA_BACKUP_PATH, - .nv_data_backup_md5_path = XMM6260_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6260_NV_DATA_SECRET, - .nv_data_size = XMM6260_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6260_NV_DATA_CHUNK_SIZE, + .nv_data_path = XMM626_NV_DATA_PATH, + .nv_data_md5_path = XMM626_NV_DATA_MD5_PATH, + .nv_data_backup_path = XMM626_NV_DATA_BACKUP_PATH, + .nv_data_backup_md5_path = XMM626_NV_DATA_BACKUP_MD5_PATH, + .nv_data_secret = XMM626_NV_DATA_SECRET, + .nv_data_size = XMM626_NV_DATA_SIZE, + .nv_data_chunk_size = XMM626_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/piranha/piranha.c b/samsung-ipc/devices/piranha/piranha.c index 44af920..3ec4e5c 100644 --- a/samsung-ipc/devices/piranha/piranha.c +++ b/samsung-ipc/devices/piranha/piranha.c @@ -26,9 +26,9 @@ #include <samsung-ipc.h> #include <ipc.h> -#include "xmm6260.h" -#include "xmm6260_mipi.h" -#include "xmm6260_sec_modem.h" +#include "xmm626.h" +#include "xmm626_mipi.h" +#include "xmm626_sec_modem.h" #include "piranha.h" int piranha_boot(struct ipc_client *client) @@ -58,21 +58,21 @@ int piranha_boot(struct ipc_client *client) } ipc_client_log(client, "Mapped modem image data to memory"); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; } ipc_client_log(client, "Opened modem boot device"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 0); + rc = xmm626_sec_modem_power(modem_boot_fd, 0); if (rc < 0) { ipc_client_log(client, "Turning the modem off failed"); goto error; } ipc_client_log(client, "Turned the modem off"); - rc = xmm6260_sec_modem_power(modem_boot_fd, 1); + rc = xmm626_sec_modem_power(modem_boot_fd, 1); if (rc < 0) { ipc_client_log(client, "Turning the modem on failed"); goto error; @@ -81,16 +81,16 @@ int piranha_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + PIRANHA_PSI_OFFSET; - rc = xmm6260_mipi_psi_send(client, modem_boot_fd, (void *) p, PIRANHA_PSI_SIZE); + rc = xmm626_mipi_psi_send(client, modem_boot_fd, (void *) p, PIRANHA_PSI_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI PSI failed"); + ipc_client_log(client, "Sending XMM626 MIPI PSI failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI PSI"); + ipc_client_log(client, "Sent XMM626 MIPI PSI"); close(modem_boot_fd); - modem_boot_fd = open(XMM6260_SEC_MODEM_BOOT1_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + modem_boot_fd = open(XMM626_SEC_MODEM_BOOT1_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (modem_boot_fd < 0) { ipc_client_log(client, "Opening modem boot device failed"); goto error; @@ -99,58 +99,58 @@ int piranha_boot(struct ipc_client *client) p = (unsigned char *) modem_image_data + PIRANHA_EBL_OFFSET; - rc = xmm6260_mipi_ebl_send(client, modem_boot_fd, (void *) p, PIRANHA_EBL_SIZE); + rc = xmm626_mipi_ebl_send(client, modem_boot_fd, (void *) p, PIRANHA_EBL_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI EBL failed"); + ipc_client_log(client, "Sending XMM626 MIPI EBL failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI EBL"); + ipc_client_log(client, "Sent XMM626 MIPI EBL"); - rc = xmm6260_mipi_port_config_send(client, modem_boot_fd); + rc = xmm626_mipi_port_config_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI port config failed"); + ipc_client_log(client, "Sending XMM626 MIPI port config failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI port config"); + ipc_client_log(client, "Sent XMM626 MIPI port config"); p = (unsigned char *) modem_image_data + PIRANHA_SEC_START_OFFSET; - rc = xmm6260_mipi_sec_start_send(client, modem_boot_fd, (void *) p, PIRANHA_SEC_START_SIZE); + rc = xmm626_mipi_sec_start_send(client, modem_boot_fd, (void *) p, PIRANHA_SEC_START_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI SEC start failed"); + ipc_client_log(client, "Sending XMM626 MIPI SEC start failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI SEC start"); + ipc_client_log(client, "Sent XMM626 MIPI SEC start"); p = (unsigned char *) modem_image_data + PIRANHA_FIRMWARE_OFFSET; - rc = xmm6260_mipi_firmware_send(client, modem_boot_fd, (void *) p, PIRANHA_FIRMWARE_SIZE); + rc = xmm626_mipi_firmware_send(client, modem_boot_fd, (void *) p, PIRANHA_FIRMWARE_SIZE); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI firmware failed"); + ipc_client_log(client, "Sending XMM626 MIPI firmware failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI firmware"); + ipc_client_log(client, "Sent XMM626 MIPI firmware"); - rc = xmm6260_mipi_nv_data_send(client, modem_boot_fd); + rc = xmm626_mipi_nv_data_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI nv_data failed"); + ipc_client_log(client, "Sending XMM626 MIPI nv_data failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI nv_data"); + ipc_client_log(client, "Sent XMM626 MIPI nv_data"); - rc = xmm6260_mipi_sec_end_send(client, modem_boot_fd); + rc = xmm626_mipi_sec_end_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI SEC end failed"); + ipc_client_log(client, "Sending XMM626 MIPI SEC end failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI SEC end"); + ipc_client_log(client, "Sent XMM626 MIPI SEC end"); - rc = xmm6260_mipi_hw_reset_send(client, modem_boot_fd); + rc = xmm626_mipi_hw_reset_send(client, modem_boot_fd); if (rc < 0) { - ipc_client_log(client, "Sending XMM6260 MIPI HW reset failed"); + ipc_client_log(client, "Sending XMM626 MIPI HW reset failed"); goto error; } - ipc_client_log(client, "Sent XMM6260 MIPI HW reset"); + ipc_client_log(client, "Sent XMM626 MIPI HW reset"); rc = 0; goto complete; @@ -180,7 +180,7 @@ int piranha_open(void *data, int type) transport_data = (struct piranha_transport_data *) data; - transport_data->fd = xmm6260_sec_modem_open(type); + transport_data->fd = xmm626_sec_modem_open(type); if (transport_data->fd < 0) return -1; @@ -196,7 +196,7 @@ int piranha_close(void *data) transport_data = (struct piranha_transport_data *) data; - xmm6260_sec_modem_close(transport_data->fd); + xmm626_sec_modem_close(transport_data->fd); transport_data->fd = -1; return 0; @@ -212,7 +212,7 @@ int piranha_read(void *data, void *buffer, size_t length) transport_data = (struct piranha_transport_data *) data; - rc = xmm6260_sec_modem_read(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_read(transport_data->fd, buffer, length); return rc; } @@ -227,7 +227,7 @@ int piranha_write(void *data, const void *buffer, size_t length) transport_data = (struct piranha_transport_data *) data; - rc = xmm6260_sec_modem_write(transport_data->fd, buffer, length); + rc = xmm626_sec_modem_write(transport_data->fd, buffer, length); return rc; } @@ -242,7 +242,7 @@ int piranha_poll(void *data, struct timeval *timeout) transport_data = (struct piranha_transport_data *) data; - rc = xmm6260_sec_modem_poll(transport_data->fd, timeout); + rc = xmm626_sec_modem_poll(transport_data->fd, timeout); return rc; } @@ -257,11 +257,11 @@ int piranha_power_off(void *data) int fd; int rc; - fd = open(XMM6260_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) return -1; - rc = xmm6260_sec_modem_power(fd, 0); + rc = xmm626_sec_modem_power(fd, 0); close(fd); @@ -295,14 +295,14 @@ int piranha_data_destroy(void *transport_data, void *power_data, struct ipc_client_ops piranha_fmt_ops = { .boot = piranha_boot, - .send = xmm6260_sec_modem_fmt_send, - .recv = xmm6260_sec_modem_fmt_recv, + .send = xmm626_sec_modem_fmt_send, + .recv = xmm626_sec_modem_fmt_recv, }; struct ipc_client_ops piranha_rfs_ops = { .boot = NULL, - .send = xmm6260_sec_modem_rfs_send, - .recv = xmm6260_sec_modem_rfs_recv, + .send = xmm626_sec_modem_rfs_send, + .recv = xmm626_sec_modem_rfs_recv, }; struct ipc_client_handlers piranha_handlers = { @@ -323,18 +323,18 @@ struct ipc_client_handlers piranha_handlers = { }; struct ipc_client_gprs_specs piranha_gprs_specs = { - .gprs_get_iface = xmm6260_sec_modem_gprs_get_iface, - .gprs_get_capabilities = xmm6260_sec_modem_gprs_get_capabilities, + .gprs_get_iface = xmm626_sec_modem_gprs_get_iface, + .gprs_get_capabilities = xmm626_sec_modem_gprs_get_capabilities, }; struct ipc_client_nv_data_specs piranha_nv_data_specs = { - .nv_data_path = XMM6260_NV_DATA_PATH, - .nv_data_md5_path = XMM6260_NV_DATA_MD5_PATH, - .nv_data_backup_path = XMM6260_NV_DATA_BACKUP_PATH, - .nv_data_backup_md5_path = XMM6260_NV_DATA_BACKUP_MD5_PATH, - .nv_data_secret = XMM6260_NV_DATA_SECRET, - .nv_data_size = XMM6260_NV_DATA_SIZE, - .nv_data_chunk_size = XMM6260_NV_DATA_CHUNK_SIZE, + .nv_data_path = XMM626_NV_DATA_PATH, + .nv_data_md5_path = XMM626_NV_DATA_MD5_PATH, + .nv_data_backup_path = XMM626_NV_DATA_BACKUP_PATH, + .nv_data_backup_md5_path = XMM626_NV_DATA_BACKUP_MD5_PATH, + .nv_data_secret = XMM626_NV_DATA_SECRET, + .nv_data_size = XMM626_NV_DATA_SIZE, + .nv_data_chunk_size = XMM626_NV_DATA_CHUNK_SIZE, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6160/xmm6160.c b/samsung-ipc/devices/xmm616/xmm616.c index c0c5c35..3e7c614 100644 --- a/samsung-ipc/devices/xmm6160/xmm6160.c +++ b/samsung-ipc/devices/xmm616/xmm616.c @@ -27,12 +27,12 @@ #include <samsung-ipc.h> #include <utils.h> -#include "xmm6160.h" +#include "xmm616.h" -int xmm6160_psi_send(struct ipc_client *client, int serial_fd, +int xmm616_psi_send(struct ipc_client *client, int serial_fd, const void *psi_data, unsigned short psi_size) { - char at[] = XMM6160_AT; + char at[] = XMM616_AT; unsigned char version; unsigned char info; unsigned char psi_magic; @@ -58,7 +58,7 @@ int xmm6160_psi_send(struct ipc_client *client, int serial_fd, tcsetattr(serial_fd, TCSANOW, &termios); length = strlen(at); - for (i = 0; i < XMM6160_AT_COUNT; i++) { + for (i = 0; i < XMM616_AT_COUNT; i++) { rc = write(serial_fd, at, length); if (rc < (int) length) { ipc_client_log(client, "Writing AT in ASCII failed"); @@ -79,7 +79,7 @@ int xmm6160_psi_send(struct ipc_client *client, int serial_fd, goto error; } - if (version != XMM6160_BOOTCORE_VERSION) { + if (version != XMM616_BOOTCORE_VERSION) { ipc_client_log(client, "Read wrong bootcore version (0x%x)", version); goto error; } @@ -93,7 +93,7 @@ int xmm6160_psi_send(struct ipc_client *client, int serial_fd, } ipc_client_log(client, "Read info size (0x%x)", info); - psi_magic = XMM6160_PSI_MAGIC; + psi_magic = XMM616_PSI_MAGIC; rc = write(serial_fd, &psi_magic, sizeof(psi_magic)); if (rc < (int) sizeof(psi_magic)) { @@ -169,7 +169,7 @@ int xmm6160_psi_send(struct ipc_client *client, int serial_fd, ipc_client_log(client, "Reading PSI ACK failed"); goto error; } - } while (psi_ack != XMM6160_PSI_ACK); + } while (psi_ack != XMM616_PSI_ACK); ipc_client_log(client, "Read PSI ACK (0x%x)", psi_ack); rc = 0; @@ -182,7 +182,7 @@ complete: return rc; } -int xmm6160_firmware_send(struct ipc_client *client, int device_fd, +int xmm616_firmware_send(struct ipc_client *client, int device_fd, void *device_address, const void *firmware_data, size_t firmware_size) { size_t wc; @@ -222,7 +222,7 @@ complete: return rc; } -int xmm6160_nv_data_send(struct ipc_client *client, int device_fd, +int xmm616_nv_data_send(struct ipc_client *client, int device_fd, void *device_address) { void *nv_data = NULL; diff --git a/samsung-ipc/devices/xmm616/xmm616.h b/samsung-ipc/devices/xmm616/xmm616.h new file mode 100644 index 0000000..16ed059 --- /dev/null +++ b/samsung-ipc/devices/xmm616/xmm616.h @@ -0,0 +1,48 @@ +/* + * This file is part of libsamsung-ipc. + * + * Copyright (C) 2011-2014 Paul Kocialkowski <contact@paulk.fr> + * + * 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 <samsung-ipc.h> + +#ifndef __XMM616_H__ +#define __XMM616_H__ + +#define XMM616_AT "AT" +#define XMM616_AT_COUNT 20 +#define XMM616_PSI_MAGIC 0x30 +#define XMM616_PSI_ACK 0x01 +#define XMM616_BOOTCORE_VERSION 0xF0 + +#define XMM616_NV_DATA_PATH "/efs/nv_data.bin" +#define XMM616_NV_DATA_MD5_PATH "/efs/nv_data.bin.md5" +#define XMM616_NV_DATA_BACKUP_PATH "/efs/.nv_data.bak" +#define XMM616_NV_DATA_BACKUP_MD5_PATH "/efs/.nv_data.bak.md5" +#define XMM616_NV_DATA_SECRET "Samsung_Android_RIL" +#define XMM616_NV_DATA_SIZE 0x200000 +#define XMM616_NV_DATA_CHUNK_SIZE 0x1000 + +int xmm616_psi_send(struct ipc_client *client, int serial_fd, + const void *psi_data, unsigned short psi_size); +int xmm616_firmware_send(struct ipc_client *client, int device_fd, + void *device_address, const void *firmware_data, size_t firmware_size); +int xmm616_nv_data_send(struct ipc_client *client, int device_fd, + void *device_address); + +#endif + +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6160/xmm6160.h b/samsung-ipc/devices/xmm6160/xmm6160.h deleted file mode 100644 index 22ae2be..0000000 --- a/samsung-ipc/devices/xmm6160/xmm6160.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2011-2014 Paul Kocialkowski <contact@paulk.fr> - * - * 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 <samsung-ipc.h> - -#ifndef __XMM6160_H__ -#define __XMM6160_H__ - -#define XMM6160_AT "AT" -#define XMM6160_AT_COUNT 20 -#define XMM6160_PSI_MAGIC 0x30 -#define XMM6160_PSI_ACK 0x01 -#define XMM6160_BOOTCORE_VERSION 0xF0 - -#define XMM6160_NV_DATA_PATH "/efs/nv_data.bin" -#define XMM6160_NV_DATA_MD5_PATH "/efs/nv_data.bin.md5" -#define XMM6160_NV_DATA_BACKUP_PATH "/efs/.nv_data.bak" -#define XMM6160_NV_DATA_BACKUP_MD5_PATH "/efs/.nv_data.bak.md5" -#define XMM6160_NV_DATA_SECRET "Samsung_Android_RIL" -#define XMM6160_NV_DATA_SIZE 0x200000 -#define XMM6160_NV_DATA_CHUNK_SIZE 0x1000 - -int xmm6160_psi_send(struct ipc_client *client, int serial_fd, - const void *psi_data, unsigned short psi_size); -int xmm6160_firmware_send(struct ipc_client *client, int device_fd, - void *device_address, const void *firmware_data, size_t firmware_size); -int xmm6160_nv_data_send(struct ipc_client *client, int device_fd, - void *device_address); - -#endif - -// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/modem.h b/samsung-ipc/devices/xmm626/modem.h index 5a456f5..150bd8a 100644 --- a/samsung-ipc/devices/xmm6260/modem.h +++ b/samsung-ipc/devices/xmm626/modem.h @@ -17,7 +17,7 @@ #define __MODEM_IF_H__ enum modem_t { - IMC_XMM6260, + IMC_XMM626, IMC_XMM6262, VIA_CBP71, VIA_CBP72, diff --git a/samsung-ipc/devices/xmm6260/modem_link_device_hsic.h b/samsung-ipc/devices/xmm626/modem_link_device_hsic.h index 99e15cf..a8acca8 100755 --- a/samsung-ipc/devices/xmm6260/modem_link_device_hsic.h +++ b/samsung-ipc/devices/xmm626/modem_link_device_hsic.h @@ -29,7 +29,7 @@ enum { /* each pipe has 2 ep for in/out */ #define LINKPM_DEV_NUM (IF_USB_DEVNUM_MAX * 2) /******************/ -/* xmm6260 specific */ +/* xmm626 specific */ #define IOCTL_LINK_CONTROL_ENABLE _IO('o', 0x30) #define IOCTL_LINK_CONTROL_ACTIVE _IO('o', 0x31) @@ -37,7 +37,7 @@ enum { #define IOCTL_LINK_CONNECTED _IO('o', 0x33) #define IOCTL_LINK_SET_BIAS_CLEAR _IO('o', 0x34) -/* VID,PID for IMC - XMM6260, XMM6262*/ +/* VID,PID for IMC - XMM626, XMM6262*/ #define IMC_BOOT_VID 0x058b #define IMC_BOOT_PID 0x0041 #define IMC_MAIN_VID 0x1519 diff --git a/samsung-ipc/devices/xmm6260/modem_prj.h b/samsung-ipc/devices/xmm626/modem_prj.h index 99f6087..99f6087 100644 --- a/samsung-ipc/devices/xmm6260/modem_prj.h +++ b/samsung-ipc/devices/xmm626/modem_prj.h diff --git a/samsung-ipc/devices/xmm6260/xmm6260.c b/samsung-ipc/devices/xmm626/xmm626.c index 2711caf..0c6846d 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260.c +++ b/samsung-ipc/devices/xmm626/xmm626.c @@ -21,9 +21,9 @@ #include <stdlib.h> #include <sys/ioctl.h> -#include "xmm6260.h" +#include "xmm626.h" -unsigned char xmm6260_crc_calculate(const void *data, size_t size) +unsigned char xmm626_crc_calculate(const void *data, size_t size) { unsigned char crc; unsigned char *p; diff --git a/samsung-ipc/devices/xmm626/xmm626.h b/samsung-ipc/devices/xmm626/xmm626.h new file mode 100644 index 0000000..e93aca3 --- /dev/null +++ b/samsung-ipc/devices/xmm626/xmm626.h @@ -0,0 +1,53 @@ +/* + * This file is part of libsamsung-ipc. + * + * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> + * + * 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/>. + */ + +#ifndef __XMM626_H__ +#define __XMM626_H__ + +#define XMM626_AT "ATAT" +#define XMM626_PSI_PADDING 0xFF +#define XMM626_PSI_MAGIC 0x30 +#define XMM626_SEC_END_MAGIC 0x0000 +#define XMM626_HW_RESET_MAGIC 0x111001 +#define XMM626_DATA_SIZE 0x1000 + +#define XMM626_COMMAND_SET_PORT_CONFIG 0x86 +#define XMM626_COMMAND_SEC_START 0x204 +#define XMM626_COMMAND_SEC_END 0x205 +#define XMM626_COMMAND_HW_RESET 0x208 +#define XMM626_COMMAND_FLASH_SET_ADDRESS 0x802 +#define XMM626_COMMAND_FLASH_WRITE_BLOCK 0x804 + +#define XMM626_FIRMWARE_ADDRESS 0x60300000 +#define XMM626_NV_DATA_ADDRESS 0x60E80000 +#define XMM626_MPS_DATA_ADDRESS 0x61080000 + +#define XMM626_NV_DATA_PATH "/efs/nv_data.bin" +#define XMM626_NV_DATA_MD5_PATH "/efs/nv_data.bin.md5" +#define XMM626_NV_DATA_BACKUP_PATH "/efs/.nv_data.bak" +#define XMM626_NV_DATA_BACKUP_MD5_PATH "/efs/.nv_data.bak.md5" +#define XMM626_NV_DATA_SECRET "Samsung_Android_RIL" +#define XMM626_NV_DATA_SIZE 0x200000 +#define XMM626_NV_DATA_CHUNK_SIZE 0x1000 + +unsigned char xmm626_crc_calculate(const void *data, size_t size); + +#endif + +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260_hsic.c b/samsung-ipc/devices/xmm626/xmm626_hsic.c index 24b6567..d7a5d4f 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260_hsic.c +++ b/samsung-ipc/devices/xmm626/xmm626_hsic.c @@ -30,10 +30,10 @@ #include <samsung-ipc.h> #include <utils.h> -#include "xmm6260.h" -#include "xmm6260_hsic.h" +#include "xmm626.h" +#include "xmm626_hsic.h" -int xmm6260_hsic_ack_read(int device_fd, unsigned short ack) +int xmm626_hsic_ack_read(int device_fd, unsigned short ack) { struct timeval timeout; fd_set fds; @@ -64,11 +64,11 @@ int xmm6260_hsic_ack_read(int device_fd, unsigned short ack) return -1; } -int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, +int xmm626_hsic_psi_send(struct ipc_client *client, int device_fd, const void *psi_data, unsigned short psi_size) { - struct xmm6260_hsic_psi_header psi_header; - char at[] = XMM6260_AT; + struct xmm626_hsic_psi_header psi_header; + char at[] = XMM626_AT; unsigned char psi_ack; unsigned char chip_id; unsigned char psi_crc; @@ -126,7 +126,7 @@ int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, psi_ack = 0; rc = read(device_fd, &psi_ack, sizeof(psi_ack)); - if (rc <= 0 || psi_ack != XMM6260_HSIC_BOOT0_ACK) { + if (rc <= 0 || psi_ack != XMM626_HSIC_BOOT0_ACK) { ipc_client_log(client, "Reading boot ACK failed"); goto error; } @@ -145,9 +145,9 @@ int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Read chip id (0x%x)", chip_id); - psi_header.magic = XMM6260_PSI_MAGIC; + psi_header.magic = XMM626_PSI_MAGIC; psi_header.length = psi_size; - psi_header.padding = XMM6260_PSI_PADDING; + psi_header.padding = XMM626_PSI_PADDING; rc = write(device_fd, &psi_header, sizeof(psi_header)); if (rc < (int) sizeof(psi_header)) { @@ -170,7 +170,7 @@ int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, wc += rc; } - psi_crc = xmm6260_crc_calculate(psi_data, psi_size); + psi_crc = xmm626_crc_calculate(psi_data, psi_size); ipc_client_log(client, "Wrote PSI, CRC is 0x%x", psi_crc); @@ -184,7 +184,7 @@ int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, timeout.tv_sec = 0; timeout.tv_usec = 100000; - for (i = 0; i < XMM6260_HSIC_PSI_UNKNOWN_COUNT; i++) { + for (i = 0; i < XMM626_HSIC_PSI_UNKNOWN_COUNT; i++) { rc = select(device_fd + 1, &fds, NULL, NULL, &timeout); if (rc <= 0) { ipc_client_log(client, "Reading PSI unknown failed"); @@ -198,7 +198,7 @@ int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, } } - for (i = 0; i < XMM6260_HSIC_PSI_CRC_ACK_COUNT ; i++) { + for (i = 0; i < XMM626_HSIC_PSI_CRC_ACK_COUNT ; i++) { rc = select(device_fd + 1, &fds, NULL, NULL, &timeout); if (rc <= 0) { ipc_client_log(client, "Reading PSI CRC ACK failed"); @@ -206,14 +206,14 @@ int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, } rc = read(device_fd, &psi_ack, sizeof(psi_ack)); - if (rc < (int) sizeof(psi_ack) || psi_ack != XMM6260_HSIC_PSI_CRC_ACK) { + if (rc < (int) sizeof(psi_ack) || psi_ack != XMM626_HSIC_PSI_CRC_ACK) { ipc_client_log(client, "Reading PSI CRC ACK failed"); goto error; } } ipc_client_log(client, "Read PSI CRC ACK"); - rc = xmm6260_hsic_ack_read(device_fd, XMM6260_HSIC_PSI_ACK); + rc = xmm626_hsic_ack_read(device_fd, XMM626_HSIC_PSI_ACK); if (rc < 0) { ipc_client_log(client, "Reading PSI ACK failed"); goto error; @@ -230,7 +230,7 @@ complete: return rc; } -int xmm6260_hsic_ebl_send(struct ipc_client *client, int device_fd, +int xmm626_hsic_ebl_send(struct ipc_client *client, int device_fd, const void *ebl_data, size_t ebl_size) { unsigned char ebl_crc; @@ -253,7 +253,7 @@ int xmm6260_hsic_ebl_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Wrote EBL size"); - rc = xmm6260_hsic_ack_read(device_fd, XMM6260_HSIC_EBL_SIZE_ACK); + rc = xmm626_hsic_ack_read(device_fd, XMM626_HSIC_EBL_SIZE_ACK); if (rc < 0) { ipc_client_log(client, "Reading EBL size ACK failed"); goto error; @@ -261,7 +261,7 @@ int xmm6260_hsic_ebl_send(struct ipc_client *client, int device_fd, p = (unsigned char *) ebl_data; - chunk = XMM6260_HSIC_EBL_CHUNK; + chunk = XMM626_HSIC_EBL_CHUNK; wc = 0; while (wc < ebl_size) { count = chunk < ebl_size - wc ? chunk : ebl_size - wc; @@ -276,7 +276,7 @@ int xmm6260_hsic_ebl_send(struct ipc_client *client, int device_fd, wc += rc; } - ebl_crc = xmm6260_crc_calculate(ebl_data, ebl_size); + ebl_crc = xmm626_crc_calculate(ebl_data, ebl_size); ipc_client_log(client, "Wrote EBL, CRC is 0x%x", ebl_crc); @@ -287,7 +287,7 @@ int xmm6260_hsic_ebl_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Wrote EBL CRC (0x%x)", ebl_crc); - rc = xmm6260_hsic_ack_read(device_fd, XMM6260_HSIC_EBL_ACK); + rc = xmm626_hsic_ack_read(device_fd, XMM626_HSIC_EBL_ACK); if (rc < 0) { ipc_client_log(client, "Reading EBL ACK failed"); goto error; @@ -303,10 +303,10 @@ complete: return rc; } -int xmm6260_hsic_command_send(int device_fd, unsigned short code, +int xmm626_hsic_command_send(int device_fd, unsigned short code, const void *data, size_t size, size_t command_data_size, int ack) { - struct xmm6260_hsic_command_header header; + struct xmm626_hsic_command_header header; void *buffer = NULL; size_t length; struct timeval timeout; @@ -385,7 +385,7 @@ complete: return rc; } -int xmm6260_hsic_modem_data_send(int device_fd, const void *data, size_t size, +int xmm626_hsic_modem_data_send(int device_fd, const void *data, size_t size, int address) { size_t chunk; @@ -397,18 +397,18 @@ int xmm6260_hsic_modem_data_send(int device_fd, const void *data, size_t size, if (device_fd < 0 || data == NULL || size == 0) return -1; - rc = xmm6260_hsic_command_send(device_fd, XMM6260_COMMAND_FLASH_SET_ADDRESS, &address, sizeof(address), XMM6260_HSIC_FLASH_SET_ADDRESS_SIZE, 1); + rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_FLASH_SET_ADDRESS, &address, sizeof(address), XMM626_HSIC_FLASH_SET_ADDRESS_SIZE, 1); if (rc < 0) goto error; p = (unsigned char *) data; - chunk = XMM6260_HSIC_MODEM_DATA_CHUNK; + chunk = XMM626_HSIC_MODEM_DATA_CHUNK; c = 0; while (c < size) { count = chunk < size - c ? chunk : size - c; - rc = xmm6260_hsic_command_send(device_fd, XMM6260_COMMAND_FLASH_WRITE_BLOCK, p, count, XMM6260_HSIC_FLASH_WRITE_BLOCK_SIZE, 0); + rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_FLASH_WRITE_BLOCK, p, count, XMM626_HSIC_FLASH_WRITE_BLOCK_SIZE, 0); if (rc < 0) goto error; @@ -426,7 +426,7 @@ complete: return rc; } -int xmm6260_hsic_port_config_send(struct ipc_client *client, int device_fd) +int xmm626_hsic_port_config_send(struct ipc_client *client, int device_fd) { void *buffer = NULL; size_t length; @@ -447,7 +447,7 @@ int xmm6260_hsic_port_config_send(struct ipc_client *client, int device_fd) if (rc <= 0) goto error; - length = XMM6260_HSIC_PORT_CONFIG_SIZE; + length = XMM626_HSIC_PORT_CONFIG_SIZE; buffer = calloc(1, length); rc = select(device_fd + 1, &fds, NULL, NULL, &timeout); @@ -461,7 +461,7 @@ int xmm6260_hsic_port_config_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Read port config"); - rc = xmm6260_hsic_command_send(device_fd, XMM6260_COMMAND_SET_PORT_CONFIG, buffer, length, XMM6260_HSIC_SET_PORT_CONFIG_SIZE, 1); + rc = xmm626_hsic_command_send(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; @@ -480,7 +480,7 @@ complete: return rc; } -int xmm6260_hsic_sec_start_send(struct ipc_client *client, int device_fd, +int xmm626_hsic_sec_start_send(struct ipc_client *client, int device_fd, const void *sec_data, size_t sec_size) { int rc; @@ -488,14 +488,14 @@ int xmm6260_hsic_sec_start_send(struct ipc_client *client, int device_fd, if (client == NULL || device_fd < 0 || sec_data == NULL || sec_size == 0) return -1; - rc = xmm6260_hsic_command_send(device_fd, XMM6260_COMMAND_SEC_START, sec_data, sec_size, XMM6260_HSIC_SEC_START_SIZE, 1); + rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_SEC_START, sec_data, sec_size, XMM626_HSIC_SEC_START_SIZE, 1); if (rc < 0) return -1; return 0; } -int xmm6260_hsic_sec_end_send(struct ipc_client *client, int device_fd) +int xmm626_hsic_sec_end_send(struct ipc_client *client, int device_fd) { unsigned short sec_data; size_t sec_size; @@ -504,17 +504,17 @@ int xmm6260_hsic_sec_end_send(struct ipc_client *client, int device_fd) if (client == NULL || device_fd < 0) return -1; - sec_data = XMM6260_SEC_END_MAGIC; + sec_data = XMM626_SEC_END_MAGIC; sec_size = sizeof(sec_data); - rc = xmm6260_hsic_command_send(device_fd, XMM6260_COMMAND_SEC_END, &sec_data, sec_size, XMM6260_HSIC_SEC_END_SIZE, 1); + rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_SEC_END, &sec_data, sec_size, XMM626_HSIC_SEC_END_SIZE, 1); if (rc < 0) return -1; return 0; } -int xmm6260_hsic_firmware_send(struct ipc_client *client, int device_fd, +int xmm626_hsic_firmware_send(struct ipc_client *client, int device_fd, const void *firmware_data, size_t firmware_size) { int rc; @@ -522,14 +522,14 @@ int xmm6260_hsic_firmware_send(struct ipc_client *client, int device_fd, if (client == NULL || device_fd < 0 || firmware_data == NULL || firmware_size == 0) return -1; - rc = xmm6260_hsic_modem_data_send(device_fd, firmware_data, firmware_size, XMM6260_FIRMWARE_ADDRESS); + rc = xmm626_hsic_modem_data_send(device_fd, firmware_data, firmware_size, XMM626_FIRMWARE_ADDRESS); if (rc < 0) return -1; return 0; } -int xmm6260_hsic_nv_data_send(struct ipc_client *client, int device_fd) +int xmm626_hsic_nv_data_send(struct ipc_client *client, int device_fd) { void *nv_data = NULL; size_t nv_size; @@ -549,7 +549,7 @@ int xmm6260_hsic_nv_data_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Loaded nv_data"); - rc = xmm6260_hsic_modem_data_send(device_fd, nv_data, nv_size, XMM6260_NV_DATA_ADDRESS); + rc = xmm626_hsic_modem_data_send(device_fd, nv_data, nv_size, XMM626_NV_DATA_ADDRESS); if (rc < 0) goto error; @@ -566,7 +566,7 @@ complete: return rc; } -int xmm6260_hsic_hw_reset_send(struct ipc_client *client, int device_fd) +int xmm626_hsic_hw_reset_send(struct ipc_client *client, int device_fd) { unsigned int hw_reset_data; int hw_reset_size; @@ -575,10 +575,10 @@ int xmm6260_hsic_hw_reset_send(struct ipc_client *client, int device_fd) if (client == NULL || device_fd < 0) return -1; - hw_reset_data = XMM6260_HW_RESET_MAGIC; + hw_reset_data = XMM626_HW_RESET_MAGIC; hw_reset_size = sizeof(hw_reset_data); - rc = xmm6260_hsic_command_send(device_fd, XMM6260_COMMAND_HW_RESET, &hw_reset_data, hw_reset_size, XMM6260_HSIC_HW_RESET_SIZE, 0); + rc = xmm626_hsic_command_send(device_fd, XMM626_COMMAND_HW_RESET, &hw_reset_data, hw_reset_size, XMM626_HSIC_HW_RESET_SIZE, 0); if (rc < 0) return -1; diff --git a/samsung-ipc/devices/xmm626/xmm626_hsic.h b/samsung-ipc/devices/xmm626/xmm626_hsic.h new file mode 100644 index 0000000..6fd374c --- /dev/null +++ b/samsung-ipc/devices/xmm626/xmm626_hsic.h @@ -0,0 +1,69 @@ +/* + * This file is part of libsamsung-ipc. + * + * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com> + * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> + * + * 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/>. + */ + +#ifndef __XMM626_HSIC_H__ +#define __XMM626_HSIC_H__ + +#define XMM626_HSIC_BOOT0_ACK 0xF0 +#define XMM626_HSIC_PSI_UNKNOWN_COUNT 22 +#define XMM626_HSIC_PSI_CRC_ACK 0x01 +#define XMM626_HSIC_PSI_CRC_ACK_COUNT 2 +#define XMM626_HSIC_PSI_ACK 0xAA00 +#define XMM626_HSIC_EBL_SIZE_ACK 0xCCCC +#define XMM626_HSIC_EBL_ACK 0xA551 +#define XMM626_HSIC_EBL_CHUNK 0x4000 +#define XMM626_HSIC_PORT_CONFIG_SIZE 0x4C +#define XMM626_HSIC_SET_PORT_CONFIG_SIZE 0x800 +#define XMM626_HSIC_SEC_START_SIZE 0x4000 +#define XMM626_HSIC_SEC_END_SIZE 0x4000 +#define XMM626_HSIC_HW_RESET_SIZE 0x4000 +#define XMM626_HSIC_FLASH_SET_ADDRESS_SIZE 0x4000 +#define XMM626_HSIC_FLASH_WRITE_BLOCK_SIZE 0x4000 +#define XMM626_HSIC_MODEM_DATA_CHUNK 0x4000 + +struct xmm626_hsic_psi_header { + unsigned char magic; + unsigned short length; + unsigned char padding; +} __attribute__((packed)); + +struct xmm626_hsic_command_header { + unsigned short checksum; + unsigned short code; + unsigned int data_size; +} __attribute__((packed)); + +int xmm626_hsic_psi_send(struct ipc_client *client, int device_fd, + const void *psi_data, unsigned short psi_size); +int xmm626_hsic_ebl_send(struct ipc_client *client, int device_fd, + const void *ebl_data, size_t ebl_size); + +int xmm626_hsic_port_config_send(struct ipc_client *client, int device_fd); +int xmm626_hsic_sec_start_send(struct ipc_client *client, int device_fd, + const void *sec_data, size_t sec_size); +int xmm626_hsic_sec_end_send(struct ipc_client *client, int device_fd); +int xmm626_hsic_firmware_send(struct ipc_client *client, int device_fd, + const void *firmware_data, size_t firmware_size); +int xmm626_hsic_nv_data_send(struct ipc_client *client, int device_fd); +int xmm626_hsic_hw_reset_send(struct ipc_client *client, int device_fd); + +#endif + +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260_mipi.c b/samsung-ipc/devices/xmm626/xmm626_mipi.c index dd2a560..667a4ea 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260_mipi.c +++ b/samsung-ipc/devices/xmm626/xmm626_mipi.c @@ -30,21 +30,21 @@ #include <samsung-ipc.h> #include <utils.h> -#include "xmm6260.h" -#include "xmm6260_mipi.h" +#include "xmm626.h" +#include "xmm626_mipi.h" -int xmm6260_mipi_crc_calculate(const void *data, size_t size) +int xmm626_mipi_crc_calculate(const void *data, size_t size) { unsigned char crc; int mipi_crc; - crc = xmm6260_crc_calculate(data, size); + crc = xmm626_crc_calculate(data, size); mipi_crc = (crc << 24) | 0xffffff; return mipi_crc; } -int xmm6260_mipi_ack_read(int device_fd, unsigned short ack) +int xmm626_mipi_ack_read(int device_fd, unsigned short ack) { struct timeval timeout; fd_set fds; @@ -75,11 +75,11 @@ int xmm6260_mipi_ack_read(int device_fd, unsigned short ack) return -1; } -int xmm6260_mipi_psi_send(struct ipc_client *client, int device_fd, +int xmm626_mipi_psi_send(struct ipc_client *client, int device_fd, const void *psi_data, unsigned short psi_size) { - struct xmm6260_mipi_psi_header psi_header; - char at[] = XMM6260_AT; + struct xmm626_mipi_psi_header psi_header; + char at[] = XMM626_AT; int psi_crc; struct timeval timeout; fd_set fds; @@ -122,15 +122,15 @@ int xmm6260_mipi_psi_send(struct ipc_client *client, int device_fd, } } while(rc == 0); - rc = xmm6260_mipi_ack_read(device_fd, XMM6260_MIPI_BOOT0_ACK); + rc = xmm626_mipi_ack_read(device_fd, XMM626_MIPI_BOOT0_ACK); if (rc < 0) { ipc_client_log(client, "Reading boot ACK failed"); goto error; } - psi_header.padding = XMM6260_PSI_PADDING; + psi_header.padding = XMM626_PSI_PADDING; psi_header.length = ((psi_size >> 8) & 0xff) | ((psi_size & 0xff) << 8); - psi_header.magic = XMM6260_PSI_MAGIC; + psi_header.magic = XMM626_PSI_MAGIC; rc = write(device_fd, &psi_header, sizeof(psi_header)); if (rc < (int) sizeof(psi_header)) { @@ -153,7 +153,7 @@ int xmm6260_mipi_psi_send(struct ipc_client *client, int device_fd, wc += rc; } - psi_crc = xmm6260_mipi_crc_calculate(psi_data, psi_size); + psi_crc = xmm626_mipi_crc_calculate(psi_data, psi_size); ipc_client_log(client, "Wrote PSI, CRC is 0x%x", psi_crc); @@ -164,7 +164,7 @@ int xmm6260_mipi_psi_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Wrote PSI CRC (0x%x)", psi_crc); - rc = xmm6260_mipi_ack_read(device_fd, XMM6260_MIPI_PSI_ACK); + rc = xmm626_mipi_ack_read(device_fd, XMM626_MIPI_PSI_ACK); if (rc < 0) { ipc_client_log(client, "Reading PSI ACK failed"); goto error; @@ -180,7 +180,7 @@ complete: return rc; } -int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, +int xmm626_mipi_ebl_send(struct ipc_client *client, int device_fd, const void *ebl_data, size_t ebl_size) { unsigned short boot_magic[4]; @@ -198,8 +198,8 @@ int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, boot_magic[0] = 0; boot_magic[1] = 0; - boot_magic[2] = XMM6260_MIPI_BOOT1_MAGIC; - boot_magic[3] = XMM6260_MIPI_BOOT1_MAGIC; + boot_magic[2] = XMM626_MIPI_BOOT1_MAGIC; + boot_magic[3] = XMM626_MIPI_BOOT1_MAGIC; length = sizeof(boot_magic); @@ -216,7 +216,7 @@ int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Wrote boot magic"); - rc = xmm6260_mipi_ack_read(device_fd, XMM6260_MIPI_BOOT1_ACK); + rc = xmm626_mipi_ack_read(device_fd, XMM626_MIPI_BOOT1_ACK); if (rc < 0) { ipc_client_log(client, "Reading boot magic ACK failed"); goto error; @@ -237,7 +237,7 @@ int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Wrote EBL size"); - rc = xmm6260_mipi_ack_read(device_fd, XMM6260_MIPI_EBL_SIZE_ACK); + rc = xmm626_mipi_ack_read(device_fd, XMM626_MIPI_EBL_SIZE_ACK); if (rc < 0) { ipc_client_log(client, "Reading EBL size ACK failed"); goto error; @@ -255,7 +255,7 @@ int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, p = (unsigned char *) ebl_data; - chunk = XMM6260_MIPI_EBL_CHUNK; + chunk = XMM626_MIPI_EBL_CHUNK; wc = 0; while (wc < ebl_size) { count = chunk < ebl_size - wc ? chunk : ebl_size - wc; @@ -270,7 +270,7 @@ int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, wc += rc; } - ebl_crc = xmm6260_crc_calculate(ebl_data, ebl_size); + ebl_crc = xmm626_crc_calculate(ebl_data, ebl_size); ipc_client_log(client, "Wrote EBL, CRC is 0x%x", ebl_crc); @@ -281,7 +281,7 @@ int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Wrote EBL CRC (0x%x)", ebl_crc); - rc = xmm6260_mipi_ack_read(device_fd, XMM6260_MIPI_EBL_ACK); + rc = xmm626_mipi_ack_read(device_fd, XMM626_MIPI_EBL_ACK); if (rc < 0) { ipc_client_log(client, "Reading EBL ACK failed"); goto error; @@ -297,11 +297,11 @@ complete: return rc; } -int xmm6260_mipi_command_send(int device_fd, unsigned short code, +int xmm626_mipi_command_send(int device_fd, unsigned short code, const void *data, size_t size, int ack, int short_footer) { - struct xmm6260_mipi_command_header header; - struct xmm6260_mipi_command_footer footer; + struct xmm626_mipi_command_header header; + struct xmm626_mipi_command_footer footer; void *buffer = NULL; size_t length; size_t footer_length; @@ -317,13 +317,13 @@ int xmm6260_mipi_command_send(int device_fd, unsigned short code, return -1; header.size = size + sizeof(header); - header.magic = XMM6260_MIPI_COMMAND_HEADER_MAGIC; + header.magic = XMM626_MIPI_COMMAND_HEADER_MAGIC; header.code = code; header.data_size = size; footer.checksum = (size & 0xffff) + code; - footer.magic = XMM6260_MIPI_COMMAND_FOOTER_MAGIC; - footer.unknown = XMM6260_MIPI_COMMAND_FOOTER_UNKNOWN; + footer.magic = XMM626_MIPI_COMMAND_FOOTER_MAGIC; + footer.unknown = XMM626_MIPI_COMMAND_FOOTER_UNKNOWN; p = (unsigned char *) data; @@ -415,7 +415,7 @@ complete: return rc; } -int xmm6260_mipi_modem_data_send(int device_fd, const void *data, size_t size, +int xmm626_mipi_modem_data_send(int device_fd, const void *data, size_t size, int address) { size_t chunk; @@ -427,18 +427,18 @@ int xmm6260_mipi_modem_data_send(int device_fd, const void *data, size_t size, if (device_fd < 0 || data == NULL || size == 0) return -1; - rc = xmm6260_mipi_command_send(device_fd, XMM6260_COMMAND_FLASH_SET_ADDRESS, &address, sizeof(address), 1, 0); + rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_FLASH_SET_ADDRESS, &address, sizeof(address), 1, 0); if (rc < 0) goto error; p = (unsigned char *) data; - chunk = XMM6260_MIPI_MODEM_DATA_CHUNK; + chunk = XMM626_MIPI_MODEM_DATA_CHUNK; c = 0; while (c < size) { count = chunk < size - c ? chunk : size - c; - rc = xmm6260_mipi_command_send(device_fd, XMM6260_COMMAND_FLASH_WRITE_BLOCK, p, count, 1, 1); + rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_FLASH_WRITE_BLOCK, p, count, 1, 1); if (rc < 0) goto error; @@ -456,7 +456,7 @@ complete: return rc; } -int xmm6260_mipi_port_config_send(struct ipc_client *client, int device_fd) +int xmm626_mipi_port_config_send(struct ipc_client *client, int device_fd) { void *buffer = NULL; size_t length; @@ -512,7 +512,7 @@ int xmm6260_mipi_port_config_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Read port config"); - rc = xmm6260_mipi_command_send(device_fd, XMM6260_COMMAND_SET_PORT_CONFIG, buffer, length, 1, 0); + rc = xmm626_mipi_command_send(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; @@ -531,7 +531,7 @@ complete: return rc; } -int xmm6260_mipi_sec_start_send(struct ipc_client *client, int device_fd, +int xmm626_mipi_sec_start_send(struct ipc_client *client, int device_fd, const void *sec_data, size_t sec_size) { int rc; @@ -539,14 +539,14 @@ int xmm6260_mipi_sec_start_send(struct ipc_client *client, int device_fd, if (client == NULL || device_fd < 0 || sec_data == NULL || sec_size == 0) return -1; - rc = xmm6260_mipi_command_send(device_fd, XMM6260_COMMAND_SEC_START, sec_data, sec_size, 1, 0); + rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_SEC_START, sec_data, sec_size, 1, 0); if (rc < 0) return -1; return 0; } -int xmm6260_mipi_sec_end_send(struct ipc_client *client, int device_fd) +int xmm626_mipi_sec_end_send(struct ipc_client *client, int device_fd) { unsigned short sec_data; size_t sec_size; @@ -555,17 +555,17 @@ int xmm6260_mipi_sec_end_send(struct ipc_client *client, int device_fd) if (client == NULL || device_fd < 0) return -1; - sec_data = XMM6260_SEC_END_MAGIC; + sec_data = XMM626_SEC_END_MAGIC; sec_size = sizeof(sec_data); - rc = xmm6260_mipi_command_send(device_fd, XMM6260_COMMAND_SEC_END, &sec_data, sec_size, 1, 1); + rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_SEC_END, &sec_data, sec_size, 1, 1); if (rc < 0) return -1; return 0; } -int xmm6260_mipi_firmware_send(struct ipc_client *client, int device_fd, +int xmm626_mipi_firmware_send(struct ipc_client *client, int device_fd, const void *firmware_data, size_t firmware_size) { int rc; @@ -573,14 +573,14 @@ int xmm6260_mipi_firmware_send(struct ipc_client *client, int device_fd, if (client == NULL || device_fd < 0 || firmware_data == NULL || firmware_size == 0) return -1; - rc = xmm6260_mipi_modem_data_send(device_fd, firmware_data, firmware_size, XMM6260_FIRMWARE_ADDRESS); + rc = xmm626_mipi_modem_data_send(device_fd, firmware_data, firmware_size, XMM626_FIRMWARE_ADDRESS); if (rc < 0) return -1; return 0; } -int xmm6260_mipi_nv_data_send(struct ipc_client *client, int device_fd) +int xmm626_mipi_nv_data_send(struct ipc_client *client, int device_fd) { void *nv_data = NULL; size_t nv_size; @@ -600,7 +600,7 @@ int xmm6260_mipi_nv_data_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Loaded nv_data"); - rc = xmm6260_mipi_modem_data_send(device_fd, nv_data, nv_size, XMM6260_NV_DATA_ADDRESS); + rc = xmm626_mipi_modem_data_send(device_fd, nv_data, nv_size, XMM626_NV_DATA_ADDRESS); if (rc < 0) goto error; @@ -617,7 +617,7 @@ complete: return rc; } -int xmm6260_mipi_mps_data_send(struct ipc_client *client, int device_fd, +int xmm626_mipi_mps_data_send(struct ipc_client *client, int device_fd, const void *mps_data, size_t mps_size) { int rc; @@ -625,14 +625,14 @@ int xmm6260_mipi_mps_data_send(struct ipc_client *client, int device_fd, if (client == NULL || device_fd < 0 || mps_data == NULL || mps_size == 0) return -1; - rc = xmm6260_mipi_modem_data_send(device_fd, mps_data, mps_size, XMM6260_MPS_DATA_ADDRESS); + rc = xmm626_mipi_modem_data_send(device_fd, mps_data, mps_size, XMM626_MPS_DATA_ADDRESS); if (rc < 0) return -1; return 0; } -int xmm6260_mipi_hw_reset_send(struct ipc_client *client, int device_fd) +int xmm626_mipi_hw_reset_send(struct ipc_client *client, int device_fd) { unsigned int hw_reset_data; size_t hw_reset_size; @@ -641,10 +641,10 @@ int xmm6260_mipi_hw_reset_send(struct ipc_client *client, int device_fd) if (client == NULL || device_fd < 0) return -1; - hw_reset_data = XMM6260_HW_RESET_MAGIC; + hw_reset_data = XMM626_HW_RESET_MAGIC; hw_reset_size = sizeof(hw_reset_data); - rc = xmm6260_mipi_command_send(device_fd, XMM6260_COMMAND_HW_RESET, &hw_reset_data, hw_reset_size, 0, 1); + rc = xmm626_mipi_command_send(device_fd, XMM626_COMMAND_HW_RESET, &hw_reset_data, hw_reset_size, 0, 1); if (rc < 0) return -1; diff --git a/samsung-ipc/devices/xmm626/xmm626_mipi.h b/samsung-ipc/devices/xmm626/xmm626_mipi.h new file mode 100644 index 0000000..961744a --- /dev/null +++ b/samsung-ipc/devices/xmm626/xmm626_mipi.h @@ -0,0 +1,73 @@ +/* + * This file is part of libsamsung-ipc. + * + * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com> + * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> + * + * 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/>. + */ + +#ifndef __XMM626_MIPI_H__ +#define __XMM626_MIPI_H__ + +#define XMM626_MIPI_BOOT0_ACK 0xFFFF +#define XMM626_MIPI_BOOT1_MAGIC 0x02 +#define XMM626_MIPI_BOOT1_ACK 0xAA00 +#define XMM626_MIPI_PSI_ACK 0xDD01 +#define XMM626_MIPI_EBL_SIZE_ACK 0xCCCC +#define XMM626_MIPI_EBL_ACK 0xA551 +#define XMM626_MIPI_EBL_CHUNK 0xDFC +#define XMM626_MIPI_MODEM_DATA_CHUNK 0xDF2 +#define XMM626_MIPI_COMMAND_HEADER_MAGIC 0x02 +#define XMM626_MIPI_COMMAND_FOOTER_MAGIC 0x03 +#define XMM626_MIPI_COMMAND_FOOTER_UNKNOWN 0xEAEA + +struct xmm626_mipi_psi_header { + unsigned char padding; + unsigned short length; + unsigned char magic; +} __attribute__((packed)); + +struct xmm626_mipi_command_header { + unsigned int size; + unsigned short magic; + unsigned short code; + unsigned short data_size; +} __attribute__((packed)); + +struct xmm626_mipi_command_footer { + unsigned short checksum; + unsigned short magic; + unsigned short unknown; +} __attribute__((packed)); + +int xmm626_mipi_psi_send(struct ipc_client *client, int device_fd, + const void *psi_data, unsigned short psi_size); +int xmm626_mipi_ebl_send(struct ipc_client *client, int device_fd, + const void *ebl_data, size_t ebl_size); + +int xmm626_mipi_port_config_send(struct ipc_client *client, int device_fd); +int xmm626_mipi_sec_start_send(struct ipc_client *client, int device_fd, + const void *sec_data, size_t sec_size); +int xmm626_mipi_sec_end_send(struct ipc_client *client, int device_fd); +int xmm626_mipi_firmware_send(struct ipc_client *client, int device_fd, + const void *firmware_data, size_t firmware_size); +int xmm626_mipi_nv_data_send(struct ipc_client *client, int device_fd); +int xmm626_mipi_mps_data_send(struct ipc_client *client, int device_fd, + const void *mps_data, size_t mps_size); +int xmm626_mipi_hw_reset_send(struct ipc_client *client, int device_fd); + +#endif + +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260_sec_modem.c b/samsung-ipc/devices/xmm626/xmm626_sec_modem.c index 06731a7..100ef5f 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260_sec_modem.c +++ b/samsung-ipc/devices/xmm626/xmm626_sec_modem.c @@ -34,10 +34,10 @@ #include "modem_prj.h" #include "modem_link_device_hsic.h" -#include "xmm6260.h" -#include "xmm6260_sec_modem.h" +#include "xmm626.h" +#include "xmm626_sec_modem.h" -int xmm6260_sec_modem_power(int device_fd, int power) +int xmm626_sec_modem_power(int device_fd, int power) { int rc; @@ -51,7 +51,7 @@ int xmm6260_sec_modem_power(int device_fd, int power) return 0; } -int xmm6260_sec_modem_boot_power(int device_fd, int power) +int xmm626_sec_modem_boot_power(int device_fd, int power) { int rc; @@ -65,7 +65,7 @@ int xmm6260_sec_modem_boot_power(int device_fd, int power) return 0; } -int xmm6260_sec_modem_status_online_wait(int device_fd) +int xmm626_sec_modem_status_online_wait(int device_fd) { int status; int i; @@ -85,15 +85,15 @@ int xmm6260_sec_modem_status_online_wait(int device_fd) return -1; } -int xmm6260_sec_modem_hci_power(int power) +int xmm626_sec_modem_hci_power(int power) { int ehci_rc, ohci_rc; - ehci_rc = sysfs_value_write(XMM6260_SEC_MODEM_EHCI_POWER_SYSFS, !!power); + ehci_rc = sysfs_value_write(XMM626_SEC_MODEM_EHCI_POWER_SYSFS, !!power); if (ehci_rc >= 0) usleep(50000); - ohci_rc = sysfs_value_write(XMM6260_SEC_MODEM_OHCI_POWER_SYSFS, !!power); + ohci_rc = sysfs_value_write(XMM626_SEC_MODEM_OHCI_POWER_SYSFS, !!power); if (ohci_rc >= 0) usleep(50000); @@ -103,7 +103,7 @@ int xmm6260_sec_modem_hci_power(int power) return 0; } -int xmm6260_sec_modem_link_control_enable(int device_fd, int enable) +int xmm626_sec_modem_link_control_enable(int device_fd, int enable) { int rc; @@ -117,7 +117,7 @@ int xmm6260_sec_modem_link_control_enable(int device_fd, int enable) return 0; } -int xmm6260_sec_modem_link_control_active(int device_fd, int active) +int xmm626_sec_modem_link_control_active(int device_fd, int active) { int rc; @@ -131,7 +131,7 @@ int xmm6260_sec_modem_link_control_active(int device_fd, int active) return 0; } -int xmm6260_sec_modem_link_connected_wait(int device_fd) +int xmm626_sec_modem_link_connected_wait(int device_fd) { int status; int i; @@ -151,7 +151,7 @@ int xmm6260_sec_modem_link_connected_wait(int device_fd) return -1; } -int xmm6260_sec_modem_link_get_hostwake_wait(int device_fd) +int xmm626_sec_modem_link_get_hostwake_wait(int device_fd) { int status; int i; @@ -171,7 +171,7 @@ int xmm6260_sec_modem_link_get_hostwake_wait(int device_fd) return -1; } -int xmm6260_sec_modem_fmt_send(struct ipc_client *client, +int xmm626_sec_modem_fmt_send(struct ipc_client *client, struct ipc_message *message) { struct ipc_fmt_header header; @@ -222,7 +222,7 @@ complete: return rc; } -int xmm6260_sec_modem_fmt_recv(struct ipc_client *client, +int xmm626_sec_modem_fmt_recv(struct ipc_client *client, struct ipc_message *message) { struct ipc_fmt_header *header; @@ -235,7 +235,7 @@ int xmm6260_sec_modem_fmt_recv(struct ipc_client *client, if (client == NULL || client->handlers == NULL || client->handlers->read == NULL || message == NULL) return -1; - length = XMM6260_DATA_SIZE; + length = XMM626_DATA_SIZE; buffer = calloc(1, length); rc = client->handlers->read(client->handlers->transport_data, buffer, length); @@ -287,7 +287,7 @@ complete: return rc; } -int xmm6260_sec_modem_rfs_send(struct ipc_client *client, +int xmm626_sec_modem_rfs_send(struct ipc_client *client, struct ipc_message *message) { struct ipc_rfs_header header; @@ -338,7 +338,7 @@ complete: return rc; } -int xmm6260_sec_modem_rfs_recv(struct ipc_client *client, +int xmm626_sec_modem_rfs_recv(struct ipc_client *client, struct ipc_message *message) { struct ipc_rfs_header *header; @@ -351,7 +351,7 @@ int xmm6260_sec_modem_rfs_recv(struct ipc_client *client, if (client == NULL || client->handlers == NULL || client->handlers->read == NULL || message == NULL) return -1; - length = XMM6260_DATA_SIZE; + length = XMM626_DATA_SIZE; buffer = calloc(1, length); rc = client->handlers->read(client->handlers->transport_data, buffer, length); @@ -403,16 +403,16 @@ complete: return rc; } -int xmm6260_sec_modem_open(int type) +int xmm626_sec_modem_open(int type) { int fd; switch (type) { case IPC_CLIENT_TYPE_FMT: - fd = open(XMM6260_SEC_MODEM_IPC0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_IPC0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); break; case IPC_CLIENT_TYPE_RFS: - fd = open(XMM6260_SEC_MODEM_RFS0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); + fd = open(XMM626_SEC_MODEM_RFS0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK); break; default: return -1; @@ -421,7 +421,7 @@ int xmm6260_sec_modem_open(int type) return fd; } -int xmm6260_sec_modem_close(int fd) +int xmm626_sec_modem_close(int fd) { if (fd < 0) return -1; @@ -431,7 +431,7 @@ int xmm6260_sec_modem_close(int fd) return 0; } -int xmm6260_sec_modem_read(int fd, void *buffer, size_t length) +int xmm626_sec_modem_read(int fd, void *buffer, size_t length) { int rc; @@ -443,7 +443,7 @@ int xmm6260_sec_modem_read(int fd, void *buffer, size_t length) return rc; } -int xmm6260_sec_modem_write(int fd, const void *buffer, size_t length) +int xmm626_sec_modem_write(int fd, const void *buffer, size_t length) { int rc; @@ -455,7 +455,7 @@ int xmm6260_sec_modem_write(int fd, const void *buffer, size_t length) return rc; } -int xmm6260_sec_modem_poll(int fd, struct timeval *timeout) +int xmm626_sec_modem_poll(int fd, struct timeval *timeout) { fd_set fds; int rc; @@ -477,24 +477,24 @@ int xmm6260_sec_modem_poll(int fd, struct timeval *timeout) return rc; } -char *xmm6260_sec_modem_gprs_get_iface(int cid) +char *xmm626_sec_modem_gprs_get_iface(int cid) { char *iface = NULL; - if (cid > XMM6260_SEC_MODEM_GPRS_IFACE_COUNT) + if (cid > XMM626_SEC_MODEM_GPRS_IFACE_COUNT) return NULL; - asprintf(&iface, "%s%d", XMM6260_SEC_MODEM_GPRS_IFACE_PREFIX, cid - 1); + asprintf(&iface, "%s%d", XMM626_SEC_MODEM_GPRS_IFACE_PREFIX, cid - 1); return iface; } -int xmm6260_sec_modem_gprs_get_capabilities(struct ipc_client_gprs_capabilities *capabilities) +int xmm626_sec_modem_gprs_get_capabilities(struct ipc_client_gprs_capabilities *capabilities) { if (capabilities == NULL) return -1; - capabilities->cid_count = XMM6260_SEC_MODEM_GPRS_IFACE_COUNT; + capabilities->cid_count = XMM626_SEC_MODEM_GPRS_IFACE_COUNT; return 0; } diff --git a/samsung-ipc/devices/xmm626/xmm626_sec_modem.h b/samsung-ipc/devices/xmm626/xmm626_sec_modem.h new file mode 100644 index 0000000..900ddad --- /dev/null +++ b/samsung-ipc/devices/xmm626/xmm626_sec_modem.h @@ -0,0 +1,63 @@ +/* + * This file is part of libsamsung-ipc. + * + * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> + * + * 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/>. + */ + +#ifndef __XMM626_SEC_MODEM_H__ +#define __XMM626_SEC_MODEM_H__ + +#define XMM626_SEC_MODEM_BOOT0_DEVICE "/dev/umts_boot0" +#define XMM626_SEC_MODEM_BOOT1_DEVICE "/dev/umts_boot1" +#define XMM626_SEC_MODEM_IPC0_DEVICE "/dev/umts_ipc0" +#define XMM626_SEC_MODEM_RFS0_DEVICE "/dev/umts_rfs0" +#define XMM626_SEC_MODEM_LINK_PM_DEVICE "/dev/link_pm" +#define XMM626_SEC_MODEM_EHCI_POWER_SYSFS "/sys/devices/platform/s5p-ehci/ehci_power" +#define XMM626_SEC_MODEM_OHCI_POWER_SYSFS "/sys/devices/platform/s5p-ohci/ohci_power" + +#define XMM626_SEC_MODEM_GPRS_IFACE_PREFIX "rmnet" +#define XMM626_SEC_MODEM_GPRS_IFACE_COUNT 3 + +int xmm626_sec_modem_power(int device_fd, int power); +int xmm626_sec_modem_boot_power(int device_fd, int power); +int xmm626_sec_modem_status_online_wait(int device_fd); +int xmm626_sec_modem_hci_power(int power); +int xmm626_sec_modem_link_control_enable(int device_fd, int enable); +int xmm626_sec_modem_link_control_active(int device_fd, int active); +int xmm626_sec_modem_link_connected_wait(int device_fd); +int xmm626_sec_modem_link_get_hostwake_wait(int device_fd); + +int xmm626_sec_modem_fmt_send(struct ipc_client *client, + struct ipc_message *message); +int xmm626_sec_modem_fmt_recv(struct ipc_client *client, + struct ipc_message *message); +int xmm626_sec_modem_rfs_send(struct ipc_client *client, + struct ipc_message *message); +int xmm626_sec_modem_rfs_recv(struct ipc_client *client, + struct ipc_message *message); + +int xmm626_sec_modem_open(int type); +int xmm626_sec_modem_close(int fd); +int xmm626_sec_modem_read(int fd, void *buffer, size_t length); +int xmm626_sec_modem_write(int fd, const void *buffer, size_t length); +int xmm626_sec_modem_poll(int fd, struct timeval *timeout); + +char *xmm626_sec_modem_gprs_get_iface(int cid); +int xmm626_sec_modem_gprs_get_capabilities(struct ipc_client_gprs_capabilities *capabilities); + +#endif + +// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260.h b/samsung-ipc/devices/xmm6260/xmm6260.h deleted file mode 100644 index bc55a44..0000000 --- a/samsung-ipc/devices/xmm6260/xmm6260.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> - * - * 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/>. - */ - -#ifndef __XMM6260_H__ -#define __XMM6260_H__ - -#define XMM6260_AT "ATAT" -#define XMM6260_PSI_PADDING 0xFF -#define XMM6260_PSI_MAGIC 0x30 -#define XMM6260_SEC_END_MAGIC 0x0000 -#define XMM6260_HW_RESET_MAGIC 0x111001 -#define XMM6260_DATA_SIZE 0x1000 - -#define XMM6260_COMMAND_SET_PORT_CONFIG 0x86 -#define XMM6260_COMMAND_SEC_START 0x204 -#define XMM6260_COMMAND_SEC_END 0x205 -#define XMM6260_COMMAND_HW_RESET 0x208 -#define XMM6260_COMMAND_FLASH_SET_ADDRESS 0x802 -#define XMM6260_COMMAND_FLASH_WRITE_BLOCK 0x804 - -#define XMM6260_FIRMWARE_ADDRESS 0x60300000 -#define XMM6260_NV_DATA_ADDRESS 0x60E80000 -#define XMM6260_MPS_DATA_ADDRESS 0x61080000 - -#define XMM6260_NV_DATA_PATH "/efs/nv_data.bin" -#define XMM6260_NV_DATA_MD5_PATH "/efs/nv_data.bin.md5" -#define XMM6260_NV_DATA_BACKUP_PATH "/efs/.nv_data.bak" -#define XMM6260_NV_DATA_BACKUP_MD5_PATH "/efs/.nv_data.bak.md5" -#define XMM6260_NV_DATA_SECRET "Samsung_Android_RIL" -#define XMM6260_NV_DATA_SIZE 0x200000 -#define XMM6260_NV_DATA_CHUNK_SIZE 0x1000 - -unsigned char xmm6260_crc_calculate(const void *data, size_t size); - -#endif - -// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260_hsic.h b/samsung-ipc/devices/xmm6260/xmm6260_hsic.h deleted file mode 100644 index 1728a4c..0000000 --- a/samsung-ipc/devices/xmm6260/xmm6260_hsic.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com> - * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> - * - * 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/>. - */ - -#ifndef __XMM6260_HSIC_H__ -#define __XMM6260_HSIC_H__ - -#define XMM6260_HSIC_BOOT0_ACK 0xF0 -#define XMM6260_HSIC_PSI_UNKNOWN_COUNT 22 -#define XMM6260_HSIC_PSI_CRC_ACK 0x01 -#define XMM6260_HSIC_PSI_CRC_ACK_COUNT 2 -#define XMM6260_HSIC_PSI_ACK 0xAA00 -#define XMM6260_HSIC_EBL_SIZE_ACK 0xCCCC -#define XMM6260_HSIC_EBL_ACK 0xA551 -#define XMM6260_HSIC_EBL_CHUNK 0x4000 -#define XMM6260_HSIC_PORT_CONFIG_SIZE 0x4C -#define XMM6260_HSIC_SET_PORT_CONFIG_SIZE 0x800 -#define XMM6260_HSIC_SEC_START_SIZE 0x4000 -#define XMM6260_HSIC_SEC_END_SIZE 0x4000 -#define XMM6260_HSIC_HW_RESET_SIZE 0x4000 -#define XMM6260_HSIC_FLASH_SET_ADDRESS_SIZE 0x4000 -#define XMM6260_HSIC_FLASH_WRITE_BLOCK_SIZE 0x4000 -#define XMM6260_HSIC_MODEM_DATA_CHUNK 0x4000 - -struct xmm6260_hsic_psi_header { - unsigned char magic; - unsigned short length; - unsigned char padding; -} __attribute__((packed)); - -struct xmm6260_hsic_command_header { - unsigned short checksum; - unsigned short code; - unsigned int data_size; -} __attribute__((packed)); - -int xmm6260_hsic_psi_send(struct ipc_client *client, int device_fd, - const void *psi_data, unsigned short psi_size); -int xmm6260_hsic_ebl_send(struct ipc_client *client, int device_fd, - const void *ebl_data, size_t ebl_size); - -int xmm6260_hsic_port_config_send(struct ipc_client *client, int device_fd); -int xmm6260_hsic_sec_start_send(struct ipc_client *client, int device_fd, - const void *sec_data, size_t sec_size); -int xmm6260_hsic_sec_end_send(struct ipc_client *client, int device_fd); -int xmm6260_hsic_firmware_send(struct ipc_client *client, int device_fd, - const void *firmware_data, size_t firmware_size); -int xmm6260_hsic_nv_data_send(struct ipc_client *client, int device_fd); -int xmm6260_hsic_hw_reset_send(struct ipc_client *client, int device_fd); - -#endif - -// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260_mipi.h b/samsung-ipc/devices/xmm6260/xmm6260_mipi.h deleted file mode 100644 index 4744369..0000000 --- a/samsung-ipc/devices/xmm6260/xmm6260_mipi.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com> - * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> - * - * 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/>. - */ - -#ifndef __XMM6260_MIPI_H__ -#define __XMM6260_MIPI_H__ - -#define XMM6260_MIPI_BOOT0_ACK 0xFFFF -#define XMM6260_MIPI_BOOT1_MAGIC 0x02 -#define XMM6260_MIPI_BOOT1_ACK 0xAA00 -#define XMM6260_MIPI_PSI_ACK 0xDD01 -#define XMM6260_MIPI_EBL_SIZE_ACK 0xCCCC -#define XMM6260_MIPI_EBL_ACK 0xA551 -#define XMM6260_MIPI_EBL_CHUNK 0xDFC -#define XMM6260_MIPI_MODEM_DATA_CHUNK 0xDF2 -#define XMM6260_MIPI_COMMAND_HEADER_MAGIC 0x02 -#define XMM6260_MIPI_COMMAND_FOOTER_MAGIC 0x03 -#define XMM6260_MIPI_COMMAND_FOOTER_UNKNOWN 0xEAEA - -struct xmm6260_mipi_psi_header { - unsigned char padding; - unsigned short length; - unsigned char magic; -} __attribute__((packed)); - -struct xmm6260_mipi_command_header { - unsigned int size; - unsigned short magic; - unsigned short code; - unsigned short data_size; -} __attribute__((packed)); - -struct xmm6260_mipi_command_footer { - unsigned short checksum; - unsigned short magic; - unsigned short unknown; -} __attribute__((packed)); - -int xmm6260_mipi_psi_send(struct ipc_client *client, int device_fd, - const void *psi_data, unsigned short psi_size); -int xmm6260_mipi_ebl_send(struct ipc_client *client, int device_fd, - const void *ebl_data, size_t ebl_size); - -int xmm6260_mipi_port_config_send(struct ipc_client *client, int device_fd); -int xmm6260_mipi_sec_start_send(struct ipc_client *client, int device_fd, - const void *sec_data, size_t sec_size); -int xmm6260_mipi_sec_end_send(struct ipc_client *client, int device_fd); -int xmm6260_mipi_firmware_send(struct ipc_client *client, int device_fd, - const void *firmware_data, size_t firmware_size); -int xmm6260_mipi_nv_data_send(struct ipc_client *client, int device_fd); -int xmm6260_mipi_mps_data_send(struct ipc_client *client, int device_fd, - const void *mps_data, size_t mps_size); -int xmm6260_mipi_hw_reset_send(struct ipc_client *client, int device_fd); - -#endif - -// vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/xmm6260/xmm6260_sec_modem.h b/samsung-ipc/devices/xmm6260/xmm6260_sec_modem.h deleted file mode 100644 index d1c6fe6..0000000 --- a/samsung-ipc/devices/xmm6260/xmm6260_sec_modem.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of libsamsung-ipc. - * - * Copyright (C) 2013-2014 Paul Kocialkowski <contact@paulk.fr> - * - * 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/>. - */ - -#ifndef __XMM6260_SEC_MODEM_H__ -#define __XMM6260_SEC_MODEM_H__ - -#define XMM6260_SEC_MODEM_BOOT0_DEVICE "/dev/umts_boot0" -#define XMM6260_SEC_MODEM_BOOT1_DEVICE "/dev/umts_boot1" -#define XMM6260_SEC_MODEM_IPC0_DEVICE "/dev/umts_ipc0" -#define XMM6260_SEC_MODEM_RFS0_DEVICE "/dev/umts_rfs0" -#define XMM6260_SEC_MODEM_LINK_PM_DEVICE "/dev/link_pm" -#define XMM6260_SEC_MODEM_EHCI_POWER_SYSFS "/sys/devices/platform/s5p-ehci/ehci_power" -#define XMM6260_SEC_MODEM_OHCI_POWER_SYSFS "/sys/devices/platform/s5p-ohci/ohci_power" - -#define XMM6260_SEC_MODEM_GPRS_IFACE_PREFIX "rmnet" -#define XMM6260_SEC_MODEM_GPRS_IFACE_COUNT 3 - -int xmm6260_sec_modem_power(int device_fd, int power); -int xmm6260_sec_modem_boot_power(int device_fd, int power); -int xmm6260_sec_modem_status_online_wait(int device_fd); -int xmm6260_sec_modem_hci_power(int power); -int xmm6260_sec_modem_link_control_enable(int device_fd, int enable); -int xmm6260_sec_modem_link_control_active(int device_fd, int active); -int xmm6260_sec_modem_link_connected_wait(int device_fd); -int xmm6260_sec_modem_link_get_hostwake_wait(int device_fd); - -int xmm6260_sec_modem_fmt_send(struct ipc_client *client, - struct ipc_message *message); -int xmm6260_sec_modem_fmt_recv(struct ipc_client *client, - struct ipc_message *message); -int xmm6260_sec_modem_rfs_send(struct ipc_client *client, - struct ipc_message *message); -int xmm6260_sec_modem_rfs_recv(struct ipc_client *client, - struct ipc_message *message); - -int xmm6260_sec_modem_open(int type); -int xmm6260_sec_modem_close(int fd); -int xmm6260_sec_modem_read(int fd, void *buffer, size_t length); -int xmm6260_sec_modem_write(int fd, const void *buffer, size_t length); -int xmm6260_sec_modem_poll(int fd, struct timeval *timeout); - -char *xmm6260_sec_modem_gprs_get_iface(int cid); -int xmm6260_sec_modem_gprs_get_capabilities(struct ipc_client_gprs_capabilities *capabilities); - -#endif - -// vim:ts=4:sw=4:expandtab |