UPSTREAM: gadget: f_thor: update to support more than 4GB file as thor 5.0
During file download, it only uses 32bit variable for file size and it limits maximum file size less than 4GB. Update to support more than 4GB file with using two 32bit variables for file size as thor protocol 5.0. Change-Id: If855ff85ef1984ac77d9caa6c49c99f32798121f Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Frank Wang <frank.wang@rock-chips.com> (cherry picked from commit 1fe9ae76b113103bcc40aa15949f9dd8aa0a06a2)
This commit is contained in:
parent
57086a026f
commit
667c22550f
|
|
@ -263,8 +263,10 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
|
|||
|
||||
switch (rqt->rqt_data) {
|
||||
case RQT_DL_INIT:
|
||||
thor_file_size = rqt->int_data[0];
|
||||
debug("INIT: total %d bytes\n", rqt->int_data[0]);
|
||||
thor_file_size = (unsigned long long int)rqt->int_data[0] +
|
||||
(((unsigned long long int)rqt->int_data[1])
|
||||
<< 32);
|
||||
debug("INIT: total %llu bytes\n", thor_file_size);
|
||||
break;
|
||||
case RQT_DL_FILE_INFO:
|
||||
file_type = rqt->int_data[0];
|
||||
|
|
@ -275,7 +277,9 @@ static long long int process_rqt_download(const struct rqt_box *rqt)
|
|||
break;
|
||||
}
|
||||
|
||||
thor_file_size = 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';
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ struct usb_cdc_attribute_vendor_descriptor {
|
|||
__u8 DAUValue;
|
||||
} __packed;
|
||||
|
||||
#define VER_PROTOCOL_MAJOR 4
|
||||
#define VER_PROTOCOL_MAJOR 5
|
||||
#define VER_PROTOCOL_MINOR 0
|
||||
|
||||
enum rqt {
|
||||
|
|
|
|||
Loading…
Reference in New Issue