summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/libirecovery.h12
-rw-r--r--libirecovery.c29
2 files changed, 41 insertions, 0 deletions
diff --git a/include/libirecovery.h b/include/libirecovery.h
index 8f3208a..f62d599 100644
--- a/include/libirecovery.h
+++ b/include/libirecovery.h
@@ -46,6 +46,10 @@ extern "C" {
#define CPID_IPOD4G 8930
#define CPID_APPLETV2 8930
#define CPID_IPHONE42 8930
+#define CPID_IPAD21 8940
+#define CPID_IPAD22 8940
+#define CPID_IPAD23 8940
+#define CPID_IPHONE4S 8940
#define BDID_UNKNOWN -1
#define BDID_IPHONE2G 0
@@ -59,6 +63,10 @@ extern "C" {
#define BDID_IPOD4G 8
#define BDID_APPLETV2 10
#define BDID_IPHONE42 6
+#define BDID_IPAD21 4
+#define BDID_IPAD22 6
+#define BDID_IPAD23 2
+#define BDID_IPHONE4S 8
#define DEVICE_UNKNOWN -1
#define DEVICE_IPHONE2G 0
@@ -72,6 +80,10 @@ extern "C" {
#define DEVICE_IPOD4G 8
#define DEVICE_APPLETV2 9
#define DEVICE_IPHONE42 10
+#define DEVICE_IPAD21 11
+#define DEVICE_IPAD22 12
+#define DEVICE_IPAD23 13
+#define DEVICE_IPHONE4S 14
enum {
kRecoveryMode1 = 0x1280,
diff --git a/libirecovery.c b/libirecovery.c
index 614b81d..278a529 100644
--- a/libirecovery.c
+++ b/libirecovery.c
@@ -1224,6 +1224,35 @@ irecv_error_t irecv_get_device(irecv_client_t client, irecv_device_t* device) {
}
break;
+ case CPID_IPAD21:
+ // iPad2,1 iPad2,2 iPad2,3 and iPhone4,1 share the same ChipID, so we need to check the BoardID
+ if (irecv_get_bdid(client, &bdid) < 0) {
+ break;
+ }
+
+ switch (bdid) {
+ case BDID_IPAD21
+ device_id = DEVICE_IPAD21;
+ break;
+
+ case BDID_IPAD22
+ device_id = DEVICE_IPAD22;
+ break;
+
+ case BDID_IPAD23
+ device_id = DEVICE_IPAD23;
+ break;
+
+ case BDID_IPHONE4S
+ device_id = DEVICE_IPHONE4S;
+ break;
+
+ default:
+ device_id = DEVICE_UNKNOWN;
+ break;
+ }
+ break;
+
default:
device_id = DEVICE_UNKNOWN;
break;