From 364ce205e3428fbc6ccb73c6e94437c083d73406 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 8 Nov 2012 02:26:47 +0100 Subject: add support for iPad2,5 and iPad3,4 --- include/libirecovery.h | 12 ++++++++++-- src/libirecovery.c | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/include/libirecovery.h b/include/libirecovery.h index 95a353e..a44dcc3 100644 --- a/include/libirecovery.h +++ b/include/libirecovery.h @@ -57,11 +57,13 @@ extern "C" { #define CPID_IPHONE4S 0x8940 #define CPID_APPLETV31 0x8942 #define CPID_IPAD24 0x8942 +#define CPID_IPAD25 0x8942 +#define CPID_IPOD5G 0x8942 #define CPID_IPAD31 0x8945 #define CPID_IPAD32 0x8945 #define CPID_IPAD33 0x8945 #define CPID_IPHONE5 0x8950 -#define CPID_IPOD5G 0x8942 +#define CPID_IPAD34 0x8955 #define BDID_UNKNOWN -1 #define BDID_IPHONE2G 0x00 @@ -81,12 +83,14 @@ extern "C" { #define BDID_IPHONE4S 0x08 #define BDID_APPLETV31 0x08 #define BDID_IPAD24 0x06 +#define BDID_IPAD25 0x0a +#define BDID_IPOD5G 0x00 #define BDID_IPAD31 0x00 #define BDID_IPAD32 0x02 #define BDID_IPAD33 0x04 #define BDID_IPHONE51 0x00 #define BDID_IPHONE52 0x02 -#define BDID_IPOD5G 0x00 +#define BDID_IPAD34 0x00 #define DEVICE_UNKNOWN -1 #define DEVICE_IPHONE2G 0 @@ -112,6 +116,8 @@ extern "C" { #define DEVICE_IPHONE51 20 #define DEVICE_IPHONE52 21 #define DEVICE_IPOD5G 22 +#define DEVICE_IPAD25 23 +#define DEVICE_IPAD34 24 enum { kRecoveryMode1 = 0x1280, @@ -217,6 +223,8 @@ static struct irecv_device irecv_devices[] = { { 20, "iPhone5,1", "n41ap", 0x00, 0x8950 }, { 21, "iPhone5,2", "n42ap", 0x02, 0x8950 }, { 22, "iPod5,1", "n78ap", 0x00, 0x8942 }, + { 23, "iPad2,5", "p105ap", 0x0a, 0x8942 }, + { 24, "iPad3,4", "p101ap", 0x00, 0x8955 }, { -1, NULL, NULL, -1, -1 } }; diff --git a/src/libirecovery.c b/src/libirecovery.c index e8ce634..63072c6 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -1609,7 +1609,7 @@ irecv_error_t irecv_get_device(irecv_client_t client, irecv_device_t* device) { break; case CPID_APPLETV31: - // AppleTV 3rd gen. iPad2,4 and iPod5,1 share the same ChipID, so we need to check the BoardID + // AppleTV 3rd gen. iPad2,4, iPad 2,5 and iPod5,1 share the same ChipID, so we need to check the BoardID if (irecv_get_bdid(client, &bdid) < 0) { break; } @@ -1620,6 +1620,9 @@ irecv_error_t irecv_get_device(irecv_client_t client, irecv_device_t* device) { case BDID_IPAD24: device_id = DEVICE_IPAD24; break; + case BDID_IPAD25: + device_id = DEVICE_IPAD25; + break; case BDID_IPOD5G: device_id = DEVICE_IPOD5G; break; @@ -1646,6 +1649,20 @@ irecv_error_t irecv_get_device(irecv_client_t client, irecv_device_t* device) { } break; + case CPID_IPAD34: + if (irecv_get_bdid(client, &bdid) < 0) { + break; + } + switch (bdid) { + case BDID_IPAD34: + device_id = DEVICE_IPAD34; + break; + default: + device_id = DEVICE_UNKNOWN; + break; + } + break; + default: device_id = DEVICE_UNKNOWN; break; -- cgit v1.1-32-gdbae