diff options
Diffstat (limited to 'src/download.h')
-rw-r--r-- | src/download.h | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/src/download.h b/src/download.h index 4117e7c..fc215a6 100644 --- a/src/download.h +++ b/src/download.h @@ -18,6 +18,9 @@ #ifndef _DOWNLOAD_H_ #define _DOWNLOAD_H_ +#include <stdint.h> +#include <sys/types.h> + #include "lg-downloader.h" /* @@ -52,46 +55,46 @@ */ struct download_request { - unsigned char command; + uint8_t command; } __attribute__((__packed__)); struct download_write_request { - unsigned char command; - unsigned char binary_type; - unsigned short reserved; - unsigned int address; - unsigned int length; + uint8_t command; + uint8_t binary_type; + uint16_t reserved; + uint32_t address; + uint32_t length; } __attribute__((__packed__)); struct download_erase_request { - unsigned char command; - unsigned char reserved[3]; - unsigned int address; - unsigned int length; + uint8_t command; + uint8_t reserved[3]; + uint32_t address; + uint32_t length; } __attribute__((__packed__)); struct download_read_request { - unsigned char command; - unsigned char reserved; - unsigned int length; + uint8_t command; + uint8_t reserved; + uint32_t length; } __attribute__((__packed__)); struct download_initialize_partition_request { - unsigned char command; - unsigned char binary_type; - unsigned int address; - unsigned int length; + uint8_t command; + uint8_t binary_type; + uint32_t address; + uint32_t length; } __attribute__((__packed__)); struct download_ready_read_request { - unsigned char command; - unsigned char reserved; - unsigned int address; - unsigned int length; + uint8_t command; + uint8_t reserved; + uint32_t address; + uint32_t length; } __attribute__((__packed__)); struct download_response { - unsigned char ack; + uint8_t ack; } __attribute__((__packed__)); /* @@ -99,11 +102,11 @@ struct download_response { */ int download_start_flash_write(struct context *context); -int download_write(struct context *context, void *buffer, unsigned int address, unsigned int length); -int download_erase(struct context *context, unsigned int address, unsigned int length); -int download_read(struct context *context, void *buffer, unsigned int length); -int download_initialize_partition(struct context *context, unsigned int address, unsigned int length); -int download_ready_read(struct context *context, unsigned int address, unsigned int length); +int download_write(struct context *context, void *buffer, off_t address, size_t length); +int download_erase(struct context *context, off_t address, size_t length); +int download_read(struct context *context, void *buffer, size_t length); +int download_initialize_partition(struct context *context, off_t address, size_t length); +int download_ready_read(struct context *context, off_t address, size_t length); int download_reset(struct context *context); int download_notify_start_dl(struct context *context); |