diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-02-11 18:12:04 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-02-11 18:12:04 +0100 |
commit | e306f8923ecf41d9cdd65f16ff7f0715db447306 (patch) | |
tree | 835f7324caa53d1b1666c988a95bbc14cc20d722 /samsung-ipc/devices | |
parent | 5482a778f9574c2cf3d941d5065bad58a30d79cc (diff) | |
download | external_libsamsung-ipc-e306f8923ecf41d9cdd65f16ff7f0715db447306.zip external_libsamsung-ipc-e306f8923ecf41d9cdd65f16ff7f0715db447306.tar.gz external_libsamsung-ipc-e306f8923ecf41d9cdd65f16ff7f0715db447306.tar.bz2 |
rfs: Proper IPC functions for nv_data specs, without generic fallback values
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc/devices')
-rw-r--r-- | samsung-ipc/devices/aries/aries_ipc.c | 10 | ||||
-rw-r--r-- | samsung-ipc/devices/aries/aries_ipc.h | 1 | ||||
-rw-r--r-- | samsung-ipc/devices/crespo/crespo_ipc.c | 10 | ||||
-rw-r--r-- | samsung-ipc/devices/crespo/crespo_ipc.h | 1 | ||||
-rw-r--r-- | samsung-ipc/devices/galaxys2/galaxys2_ipc.c | 10 | ||||
-rw-r--r-- | samsung-ipc/devices/galaxys2/galaxys2_ipc.h | 1 | ||||
-rw-r--r-- | samsung-ipc/devices/i9300/i9300_ipc.c | 10 | ||||
-rw-r--r-- | samsung-ipc/devices/i9300/i9300_ipc.h | 1 | ||||
-rw-r--r-- | samsung-ipc/devices/maguro/maguro_ipc.c | 8 | ||||
-rw-r--r-- | samsung-ipc/devices/maguro/maguro_ipc.h | 5 | ||||
-rw-r--r-- | samsung-ipc/devices/n7100/n7100_ipc.c | 10 | ||||
-rw-r--r-- | samsung-ipc/devices/n7100/n7100_ipc.h | 1 | ||||
-rw-r--r-- | samsung-ipc/devices/piranha/piranha_ipc.c | 10 | ||||
-rw-r--r-- | samsung-ipc/devices/piranha/piranha_ipc.h | 1 | ||||
-rw-r--r-- | samsung-ipc/devices/xmm6160/xmm6160.c | 4 | ||||
-rw-r--r-- | samsung-ipc/devices/xmm6160/xmm6160.h | 8 | ||||
-rw-r--r-- | samsung-ipc/devices/xmm6260/xmm6260.h | 8 | ||||
-rw-r--r-- | samsung-ipc/devices/xmm6260/xmm6260_hsic.c | 4 | ||||
-rw-r--r-- | samsung-ipc/devices/xmm6260/xmm6260_mipi.c | 4 |
19 files changed, 95 insertions, 12 deletions
diff --git a/samsung-ipc/devices/aries/aries_ipc.c b/samsung-ipc/devices/aries/aries_ipc.c index 97df116..40e03d3 100644 --- a/samsung-ipc/devices/aries/aries_ipc.c +++ b/samsung-ipc/devices/aries/aries_ipc.c @@ -803,4 +803,14 @@ struct ipc_gprs_specs aries_ipc_gprs_specs = { .gprs_get_capabilities = aries_ipc_gprs_get_capabilities, }; +struct ipc_nv_data_specs aries_ipc_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, +}; + // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/aries/aries_ipc.h b/samsung-ipc/devices/aries/aries_ipc.h index e410dd2..bb42f27 100644 --- a/samsung-ipc/devices/aries/aries_ipc.h +++ b/samsung-ipc/devices/aries/aries_ipc.h @@ -58,6 +58,7 @@ extern struct ipc_ops aries_ipc_fmt_ops; extern struct ipc_ops aries_ipc_rfs_ops; extern struct ipc_handlers aries_ipc_handlers; extern struct ipc_gprs_specs aries_ipc_gprs_specs; +extern struct ipc_nv_data_specs aries_ipc_nv_data_specs; #endif diff --git a/samsung-ipc/devices/crespo/crespo_ipc.c b/samsung-ipc/devices/crespo/crespo_ipc.c index 457cd48..b29c4fc 100644 --- a/samsung-ipc/devices/crespo/crespo_ipc.c +++ b/samsung-ipc/devices/crespo/crespo_ipc.c @@ -556,4 +556,14 @@ struct ipc_gprs_specs crespo_ipc_gprs_specs = { .gprs_get_capabilities = crespo_ipc_gprs_get_capabilities, }; +struct ipc_nv_data_specs crespo_ipc_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, +}; + // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/crespo/crespo_ipc.h b/samsung-ipc/devices/crespo/crespo_ipc.h index 85bf21d..ff984d8 100644 --- a/samsung-ipc/devices/crespo/crespo_ipc.h +++ b/samsung-ipc/devices/crespo/crespo_ipc.h @@ -43,6 +43,7 @@ extern struct ipc_ops crespo_ipc_rfs_ops; extern struct ipc_handlers crespo_ipc_handlers; extern struct ipc_gprs_specs crespo_ipc_gprs_specs_single; extern struct ipc_gprs_specs crespo_ipc_gprs_specs; +extern struct ipc_nv_data_specs crespo_ipc_nv_data_specs; #endif diff --git a/samsung-ipc/devices/galaxys2/galaxys2_ipc.c b/samsung-ipc/devices/galaxys2/galaxys2_ipc.c index 5c1c9c3..44a315b 100644 --- a/samsung-ipc/devices/galaxys2/galaxys2_ipc.c +++ b/samsung-ipc/devices/galaxys2/galaxys2_ipc.c @@ -414,4 +414,14 @@ struct ipc_gprs_specs galaxys2_ipc_gprs_specs = { .gprs_get_capabilities = galaxys2_ipc_gprs_get_capabilities, }; +struct ipc_nv_data_specs galaxys2_ipc_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, +}; + // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/galaxys2/galaxys2_ipc.h b/samsung-ipc/devices/galaxys2/galaxys2_ipc.h index b8b6a12..7d68465 100644 --- a/samsung-ipc/devices/galaxys2/galaxys2_ipc.h +++ b/samsung-ipc/devices/galaxys2/galaxys2_ipc.h @@ -42,6 +42,7 @@ extern struct ipc_ops galaxys2_ipc_fmt_ops; extern struct ipc_ops galaxys2_ipc_rfs_ops; extern struct ipc_handlers galaxys2_ipc_handlers; extern struct ipc_gprs_specs galaxys2_ipc_gprs_specs; +extern struct ipc_nv_data_specs galaxys2_ipc_nv_data_specs; #endif diff --git a/samsung-ipc/devices/i9300/i9300_ipc.c b/samsung-ipc/devices/i9300/i9300_ipc.c index 59c2eb5..b7364df 100644 --- a/samsung-ipc/devices/i9300/i9300_ipc.c +++ b/samsung-ipc/devices/i9300/i9300_ipc.c @@ -408,4 +408,14 @@ struct ipc_gprs_specs i9300_ipc_gprs_specs = { .gprs_get_capabilities = i9300_ipc_gprs_get_capabilities, }; +struct ipc_nv_data_specs i9300_ipc_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, +}; + // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/i9300/i9300_ipc.h b/samsung-ipc/devices/i9300/i9300_ipc.h index 6eceb21..901c28d 100644 --- a/samsung-ipc/devices/i9300/i9300_ipc.h +++ b/samsung-ipc/devices/i9300/i9300_ipc.h @@ -42,6 +42,7 @@ extern struct ipc_ops i9300_ipc_fmt_ops; extern struct ipc_ops i9300_ipc_rfs_ops; extern struct ipc_handlers i9300_ipc_handlers; extern struct ipc_gprs_specs i9300_ipc_gprs_specs; +extern struct ipc_nv_data_specs i9300_ipc_nv_data_specs; #endif diff --git a/samsung-ipc/devices/maguro/maguro_ipc.c b/samsung-ipc/devices/maguro/maguro_ipc.c index 9b824a0..15c72ac 100644 --- a/samsung-ipc/devices/maguro/maguro_ipc.c +++ b/samsung-ipc/devices/maguro/maguro_ipc.c @@ -393,9 +393,11 @@ struct ipc_gprs_specs maguro_ipc_gprs_specs = { struct ipc_nv_data_specs maguro_ipc_nv_data_specs = { .nv_data_path = MAGURO_NV_DATA_PATH, .nv_data_md5_path = MAGURO_NV_DATA_MD5_PATH, - .nv_state_path = MAGURO_NV_STATE_PATH, - .nv_data_bak_path = MAGURO_NV_DATA_BAK_PATH, - .nv_data_md5_bak_path = MAGURO_NV_DATA_MD5_BAK_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, }; // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/maguro/maguro_ipc.h b/samsung-ipc/devices/maguro/maguro_ipc.h index 67836ba..c58178c 100644 --- a/samsung-ipc/devices/maguro/maguro_ipc.h +++ b/samsung-ipc/devices/maguro/maguro_ipc.h @@ -38,9 +38,8 @@ #define MAGURO_NV_DATA_PATH "/factory/nv_data.bin" #define MAGURO_NV_DATA_MD5_PATH "/factory/nv_data.bin.md5" -#define MAGURO_NV_STATE_PATH "/factory/.nv_state" -#define MAGURO_NV_DATA_BAK_PATH "/factory/.nv_data.bak" -#define MAGURO_NV_DATA_MD5_BAK_PATH "/factory/.nv_data.bak.md5" +#define MAGURO_NV_DATA_BACKUP_PATH "/factory/.nv_data.bak" +#define MAGURO_NV_DATA_BACKUP_MD5_PATH "/factory/.nv_data.bak.md5" struct maguro_ipc_transport_data { int fd; diff --git a/samsung-ipc/devices/n7100/n7100_ipc.c b/samsung-ipc/devices/n7100/n7100_ipc.c index 03c30dc..ad118da 100644 --- a/samsung-ipc/devices/n7100/n7100_ipc.c +++ b/samsung-ipc/devices/n7100/n7100_ipc.c @@ -408,4 +408,14 @@ struct ipc_gprs_specs n7100_ipc_gprs_specs = { .gprs_get_capabilities = n7100_ipc_gprs_get_capabilities, }; +struct ipc_nv_data_specs n7100_ipc_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, +}; + // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/n7100/n7100_ipc.h b/samsung-ipc/devices/n7100/n7100_ipc.h index a081315..0008627 100644 --- a/samsung-ipc/devices/n7100/n7100_ipc.h +++ b/samsung-ipc/devices/n7100/n7100_ipc.h @@ -42,6 +42,7 @@ extern struct ipc_ops n7100_ipc_fmt_ops; extern struct ipc_ops n7100_ipc_rfs_ops; extern struct ipc_handlers n7100_ipc_handlers; extern struct ipc_gprs_specs n7100_ipc_gprs_specs; +extern struct ipc_nv_data_specs n7100_ipc_nv_data_specs; #endif diff --git a/samsung-ipc/devices/piranha/piranha_ipc.c b/samsung-ipc/devices/piranha/piranha_ipc.c index 5bdd0cd..88754dd 100644 --- a/samsung-ipc/devices/piranha/piranha_ipc.c +++ b/samsung-ipc/devices/piranha/piranha_ipc.c @@ -355,4 +355,14 @@ struct ipc_gprs_specs piranha_ipc_gprs_specs = { .gprs_get_capabilities = piranha_ipc_gprs_get_capabilities, }; +struct ipc_nv_data_specs piranha_ipc_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, +}; + // vim:ts=4:sw=4:expandtab diff --git a/samsung-ipc/devices/piranha/piranha_ipc.h b/samsung-ipc/devices/piranha/piranha_ipc.h index 5c857fc..7cff520 100644 --- a/samsung-ipc/devices/piranha/piranha_ipc.h +++ b/samsung-ipc/devices/piranha/piranha_ipc.h @@ -43,6 +43,7 @@ extern struct ipc_ops piranha_ipc_rfs_ops; extern struct ipc_handlers piranha_ipc_handlers; extern struct ipc_gprs_specs piranha_ipc_gprs_specs; extern struct ipc_nv_data_specs piranha_ipc_nv_data_specs; +extern struct ipc_nv_data_specs piranha_ipc_nv_data_specs; #endif diff --git a/samsung-ipc/devices/xmm6160/xmm6160.c b/samsung-ipc/devices/xmm6160/xmm6160.c index 8374541..2af6837 100644 --- a/samsung-ipc/devices/xmm6160/xmm6160.c +++ b/samsung-ipc/devices/xmm6160/xmm6160.c @@ -252,7 +252,7 @@ int xmm6160_nv_data_send(struct ipc_client *client, int device_fd, } ipc_client_log(client, "Checked nv_data md5"); - nv_data = file_data_read(nv_data_path(client), nv_data_size(client), nv_data_chunk_size(client)); + nv_data = file_data_read(ipc_client_nv_data_path(client), ipc_client_nv_data_size(client), ipc_client_nv_data_chunk_size(client)); if (nv_data == NULL) { ipc_client_log(client, "Reading nv_data failed"); goto error; @@ -260,7 +260,7 @@ int xmm6160_nv_data_send(struct ipc_client *client, int device_fd, ipc_client_log(client, "Read nv_data"); p = (unsigned char *) nv_data; - nv_size = nv_data_size(client); + nv_size = ipc_client_nv_data_size(client); if (device_address != NULL) { memcpy(device_address, p, nv_size); diff --git a/samsung-ipc/devices/xmm6160/xmm6160.h b/samsung-ipc/devices/xmm6160/xmm6160.h index 2d2bdf9..14f337a 100644 --- a/samsung-ipc/devices/xmm6160/xmm6160.h +++ b/samsung-ipc/devices/xmm6160/xmm6160.h @@ -28,6 +28,14 @@ #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, void *psi_data, unsigned short psi_size); int xmm6160_firmware_send(struct ipc_client *client, int device_fd, diff --git a/samsung-ipc/devices/xmm6260/xmm6260.h b/samsung-ipc/devices/xmm6260/xmm6260.h index 64f7938..c116ede 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260.h +++ b/samsung-ipc/devices/xmm6260/xmm6260.h @@ -38,6 +38,14 @@ #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(void *buffer, int length); #endif diff --git a/samsung-ipc/devices/xmm6260/xmm6260_hsic.c b/samsung-ipc/devices/xmm6260/xmm6260_hsic.c index e4162ae..ed3b453 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260_hsic.c +++ b/samsung-ipc/devices/xmm6260/xmm6260_hsic.c @@ -561,14 +561,14 @@ int xmm6260_hsic_nv_data_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Checked nv_data md5"); - nv_data = file_data_read(nv_data_path(client), nv_data_size(client), nv_data_chunk_size(client)); + nv_data = file_data_read(ipc_client_nv_data_path(client), ipc_client_nv_data_size(client), ipc_client_nv_data_chunk_size(client)); if (nv_data == NULL) { ipc_client_log(client, "Reading nv_data failed"); goto error; } ipc_client_log(client, "Read nv_data"); - nv_size = nv_data_size(client); + nv_size = ipc_client_nv_data_size(client); rc = xmm6260_hsic_modem_data_send(device_fd, nv_data, nv_size, XMM6260_NV_DATA_ADDRESS); if (rc < 0) diff --git a/samsung-ipc/devices/xmm6260/xmm6260_mipi.c b/samsung-ipc/devices/xmm6260/xmm6260_mipi.c index df31755..4f11361 100644 --- a/samsung-ipc/devices/xmm6260/xmm6260_mipi.c +++ b/samsung-ipc/devices/xmm6260/xmm6260_mipi.c @@ -611,14 +611,14 @@ int xmm6260_mipi_nv_data_send(struct ipc_client *client, int device_fd) } ipc_client_log(client, "Checked nv_data md5"); - nv_data = file_data_read(nv_data_path(client), nv_data_size(client), nv_data_chunk_size(client)); + nv_data = file_data_read(ipc_client_nv_data_path(client), ipc_client_nv_data_size(client), ipc_client_nv_data_chunk_size(client)); if (nv_data == NULL) { ipc_client_log(client, "Reading nv_data failed"); goto error; } ipc_client_log(client, "Read nv_data"); - nv_size = nv_data_size(client); + nv_size = ipc_client_nv_data_size(client); rc = xmm6260_mipi_modem_data_send(device_fd, nv_data, nv_size, XMM6260_NV_DATA_ADDRESS); if (rc < 0) |