/* THOR protocol - transmission handling */
/* ********************************************************** */
DEFINE_CACHE_ALIGN_BUFFER(char, f_name, F_NAME_BUF_SIZE + 1);
-static size_t thor_file_size;
+static unsigned long long int thor_file_size;
#ifdef CONFIG_TIZEN
static unsigned long long int total_file_size;
static unsigned long long int downloaded_file_size;
size_t *left,
int *cnt)
{
- size_t rcv_cnt = 0, left_to_rcv, ret_rcv;
+ unsigned long long int rcv_cnt = 0;
+ size_t left_to_rcv, ret_rcv;
struct dfu_entity *dfu_entity = dfu_get_entity(alt_setting_num);
void *transfer_buffer = dfu_get_buf(dfu_entity);
void *buf = transfer_buffer;
if (ret < 0)
return ret;
rcv_cnt += ret_rcv;
- debug("%d: RCV data count: %zu cnt: %d\n", usb_pkt_cnt,
+ debug("%d: RCV data count: %llu cnt: %d\n", usb_pkt_cnt,
rcv_cnt, *cnt);
if ((rcv_cnt % THOR_STORE_UNIT_SIZE) == 0) {
}
/* Calculate the amount of data to arrive from PC (in bytes) */
- left_to_rcv = total - rcv_cnt;
+ left_to_rcv = (size_t)(total - rcv_cnt);
/*
* Calculate number of data already received. but not yet stored
send_data_rsp(0, ++usb_pkt_cnt);
}
- debug("%s: %zu total: %llu cnt: %d\n", __func__, rcv_cnt, total, *cnt);
+ debug("%s: %llu total: %llu cnt: %d\n", __func__, rcv_cnt, total, *cnt);
return 0;
}
switch (rqt->rqt_data) {
case RQT_DL_INIT:
- thor_file_size = (uint32_t)rqt->int_data[0];
+ thor_file_size = (unsigned long long int) rqt->int_data[0] +
+ (((unsigned long long int)rqt->int_data[1])
+ << 32);
#ifdef CONFIG_TIZEN
total_file_size = thor_file_size;
downloaded_file_size = 0;
#endif
- debug("INIT: total %zu bytes\n", thor_file_size);
+ debug("INIT: total %llu bytes\n", thor_file_size);
break;
case RQT_DL_FILE_INFO:
file_type = rqt->int_data[0];
break;
}
- thor_file_size = (uint32_t)rqt->int_data[1];
+ thor_file_size = (unsigned long long int)rqt->int_data[1] +
+ (((unsigned long long int)rqt->int_data[2])
+ << 32);
memcpy(f_name, rqt->str_data[0], F_NAME_BUF_SIZE);
f_name[F_NAME_BUF_SIZE] = '\0';
- debug("INFO: name(%s, %d), size(%zu), type(%d)\n",
+ debug("INFO: name(%s, %d), size(%llu), type(%d)\n",
f_name, 0, thor_file_size, file_type);
rsp->int_data[0] = THOR_PACKET_SIZE;