bulk_process.h 852 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _BULK_DATA_PROCESS_H_
  2. #define _BULK_DATA_PROCESS_H_
  3. #include "transfer.h"
  4. typedef struct bulk_cache_ctx
  5. {
  6. uint8* c_base; //cache buffer base
  7. uint32 c_offset; //cache buffer offset
  8. uint32 c_size; //cache buffer size
  9. } bulk_cache_ctx_t;
  10. typedef struct bulk_status
  11. {
  12. status_t handle_status;
  13. uint32 byte_to_process; // byte to be processed in one packet.
  14. uint64 image_address_offset;
  15. uint8 *buf; // byte buffer of one packet.
  16. bulk_cache_ctx_t ctx; //buffer download context
  17. partition_info_struct_t* partition;
  18. } bulk_status_t;
  19. void init_bulk_process_status(bulk_status_t* status, partition_info_struct_t* partition);
  20. void write_bulk_data(bulk_status_t* status, uint8* data, uint32 length);
  21. //ex functions
  22. void end_write_bulk(bulk_status_t* status);
  23. #endif