diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-06-23 13:05:46 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-06-23 13:05:46 +0200 |
commit | b1cfc3181bc83b43e07f3b801166c8c8181cecf8 (patch) | |
tree | 6fa045db48f7aa8d9b27f464bd9c4b984df57001 | |
parent | 1ddf269c699c4028d4f5ae580b22cad0dd62d274 (diff) | |
download | 0xFFFF-b1cfc3181bc83b43e07f3b801166c8c8181cecf8.tar.bz2 |
Prepair flash_image for specifing device and hw revisions
-rw-r--r-- | src/flash.c | 2 | ||||
-rw-r--r-- | src/main.c | 8 | ||||
-rw-r--r-- | src/main.h | 2 | ||||
-rw-r--r-- | src/qmode.c | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/src/flash.c b/src/flash.c index 43c79bb..d1d7efd 100644 --- a/src/flash.c +++ b/src/flash.c @@ -74,7 +74,7 @@ void check_nolo_order() check_nolo_order_failed(); } -void flash_image(const char *filename, const char *piece, const char *version) +void flash_image(const char *filename, const char *piece, const char *device, const char *hwrevs, const char *version) { FILE *fd; int vlen = 0; @@ -146,9 +146,11 @@ int flash_callback(struct header_t *header) return 1; } - type = (char *)fpid_file(header->name); + type = header->type; + if (!type[0]) + type = (char *)fpid_file(header->name); printf("\nFlashing %s (%s)\n", header->name, type); - flash_image(header->name, type, NULL); + flash_image(header->name, type, header->device, header->hwrevs, header->version); return 0; } @@ -447,7 +449,7 @@ int main(int argc, char **argv) for(c=0;c<pcs_n;c++) { printf("Flashing %s (%s)\n", pcs[c].type, pcs[c].name); - flash_image(pcs[c].name, pcs[c].type, pcs[c].vers); + flash_image(pcs[c].name, pcs[c].type, pcs[c].device, pcs[c].hwrevs, pcs[c].version); } } @@ -15,7 +15,7 @@ struct devices; int queue_mode(); int reverse_extract_pieces(char *dir); -void flash_image(const char *filename, const char *piece, const char *version); +void flash_image(const char *filename, const char *piece, const char *device, const char *hwrevs, const char *version); int fiasco_read_image(char *file); void check_nolo_order(); extern struct usb_dev_handle *dev; diff --git a/src/qmode.c b/src/qmode.c index d8c22db..64ee94a 100644 --- a/src/qmode.c +++ b/src/qmode.c @@ -56,7 +56,7 @@ void process_message(char *msg) const char *type = fpid_file(arg); if (type == NULL) { squeue_push2(p, "error", "Unknown piece format", 1); - } else flash_image(arg, type, NULL); + } else flash_image(arg, type, NULL, NULL, NULL); } else if (!strcmp(str, "reset")) { if (reboot_board() == 0) { |