summaryrefslogtreecommitdiff
path: root/rbutil/mkamsboot/mkamsboot.h
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-24 10:06:52 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-24 10:06:52 +0000
commitff6b0425e438add8d12393f90fdbfe93e1fb4746 (patch)
treeb8ac1a3254a8e01051a5d7f2c5c94e61bacd5c02 /rbutil/mkamsboot/mkamsboot.h
parenteae2464e9a93dc3a8918abcc62348af6c8d9bc9b (diff)
downloadrockbox-ff6b0425e438add8d12393f90fdbfe93e1fb4746.tar.gz
rockbox-ff6b0425e438add8d12393f90fdbfe93e1fb4746.zip
mkamsboot/rbutil/amsinfo : do not try to detect the model of a given Sansa AMS OF
The field we thought was representative of the model is not, it has changed in the past for fuzev1 and fuzev2. For example the value 0x23 is found in 2 old fuzev1 OF versions, and in the c200v2 OF The only reliable way to detect the model of a given OF is by using the built-in list of md5sums. Modify mkamsboot and rbutilqt to load the rockbox bootloader first, and then check if the model in the bootloader corresponds to the model of the known md5sum of the given OF. That way we can continue to present the user with a list of known OF versions in case the OF is unknown to mkamsboot Also explicit the dependency of main.c on mkamsboot.h in case the prototypes change Correct the header's description not updated in r21648 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26248 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/mkamsboot/mkamsboot.h')
-rw-r--r--rbutil/mkamsboot/mkamsboot.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/rbutil/mkamsboot/mkamsboot.h b/rbutil/mkamsboot/mkamsboot.h
index 835d024d98..d87a5df4f7 100644
--- a/rbutil/mkamsboot/mkamsboot.h
+++ b/rbutil/mkamsboot/mkamsboot.h
@@ -43,6 +43,9 @@ enum {
43 MODEL_C200V2, 43 MODEL_C200V2,
44 MODEL_CLIPPLUS, 44 MODEL_CLIPPLUS,
45 MODEL_FUZEV2, 45 MODEL_FUZEV2,
46 /* new models go here */
47
48 NUM_MODELS
46}; 49};
47 50
48 51
@@ -65,8 +68,7 @@ extern const int bootloader_sizes[];
65 * ARGUMENTS 68 * ARGUMENTS
66 * 69 *
67 * filename : bootloader file to load 70 * filename : bootloader file to load
68 * model : a 4 characters string representing the Sansa model 71 * model : will be set to this bootloader's model
69 * ("fuze", "clip", "e2v2", "m2v4", or "c2v2")
70 * bootloader_size : set to the uncompressed bootloader size 72 * bootloader_size : set to the uncompressed bootloader size
71 * rb_packed_size : set to the size of compressed bootloader 73 * rb_packed_size : set to the size of compressed bootloader
72 * errstr : provided buffer to store an eventual error 74 * errstr : provided buffer to store an eventual error
@@ -78,7 +80,7 @@ extern const int bootloader_sizes[];
78 */ 80 */
79 81
80unsigned char* load_rockbox_file( 82unsigned char* load_rockbox_file(
81 char* filename, int model, int* bootloader_size, int* rb_packedsize, 83 char* filename, int *model, int* bootloader_size, int* rb_packedsize,
82 char* errstr, int errstrsize); 84 char* errstr, int errstrsize);
83 85
84 86
@@ -89,10 +91,9 @@ unsigned char* load_rockbox_file(
89 * ARGUMENTS 91 * ARGUMENTS
90 * 92 *
91 * filename : firmware file to load 93 * filename : firmware file to load
94 * model : desired player's model
92 * bufsize : set to firmware file size 95 * bufsize : set to firmware file size
93 * md5sum : set to file md5sum, must be at least 33 bytes long 96 * md5sum : set to file md5sum, must be at least 33 bytes long
94 * model : set to firmware model (MODEL_XXX)
95 * fw_version : set to firmware format version (1 or 2)
96 * firmware_size : set to firmware block's size 97 * firmware_size : set to firmware block's size
97 * of_packed : pointer to allocated memory containing the compressed 98 * of_packed : pointer to allocated memory containing the compressed
98 * original firmware block 99 * original firmware block
@@ -106,7 +107,7 @@ unsigned char* load_rockbox_file(
106 */ 107 */
107 108
108unsigned char* load_of_file( 109unsigned char* load_of_file(
109 char* filename, off_t* bufsize, struct md5sums *sum, 110 char* filename, int model, off_t* bufsize, struct md5sums *sum,
110 int* firmware_size, unsigned char** of_packed, 111 int* firmware_size, unsigned char** of_packed,
111 int* of_packedsize, char* errstr, int errstrsize); 112 int* of_packedsize, char* errstr, int errstrsize);
112 113