diff options
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 35 |
1 files changed, 25 insertions, 10 deletions
@@ -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; @@ -56,21 +56,29 @@ extern int verbose; #define CMD_WRITE 64 #define CMD_QUERY 192 - struct piece_t { char *name; char *type; - char *vers; + char *device; + char *hwrevs; + char *version; +}; + +enum flash_mode { + FLASH_COLD, + FLASH_NORMAL, + FLASH_MKII, + FLASH_DISK, }; struct devices { char *name; unsigned short vendor_id; unsigned short product_id; - unsigned short flags; + enum flash_mode mode; }; -#define SUPPORTED_DEVICES 6 +#define SUPPORTED_DEVICES 10 extern struct devices supported_devices[SUPPORTED_DEVICES]; extern int pcs_n; @@ -84,18 +92,26 @@ enum { PIECE_INITFS, PIECE_ROOTFS, PIECE_OMAPNAND, + PIECE_MMC, + PIECE_CMT_2ND, + PIECE_CMT_ALGO, + PIECE_CMT_MCUSW, PIECE_FIASCO, PIECE_LAST }; struct header_t { int fd; - char fwname[128]; - char name[128]; + char swver[128]; + char type[128]; + char device[16]; + char hwrevs[128]; char version[128]; unsigned short hash; unsigned int size; unsigned char *data; + char *name; + char *layout; }; extern char *pieces[]; @@ -103,12 +119,11 @@ extern char *modes[]; extern char *root_devices[]; // fiasco -int openfiasco(char *name, char *grep, int v); +int openfiasco(const char *name, const char *type, const char *device, const char *hwrev, const char *version, int v); int fiasco_new(const char *filename, const char *name); void fiasco_data_read(struct header_t *header); -int fiasco_add_eof(int fd); extern int (*fiasco_callback)(struct header_t *header); -int fiasco_add(int fd, const char *name, const char *file, const char *version); +int fiasco_add(int fd, const char *name, const char *file, const char *layout, const char *device, const char *hwrevs, const char *version); int fiasco_pack(int optind, char *argv[]); int nanddump(char *mtddev, unsigned long start_addr, unsigned long length, char *dumpfile, int isbl, int ioob); |