summaryrefslogtreecommitdiff
path: root/libthor/thor.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-31Re-structure lthor to extend its transfer methodsDongwoo Lee1-356/+109
Currently, thor has very specific code structure for considering only usb transfer, thus it is too hard to add other transfer methods. This patch makes lthor to be extendable by just implementing few operations: open, close, send, recv, and send_data. Change-Id: If455a9d7a5c7fd86cf6e8808f29c643456e80166 Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Fix to check protocol version before refusing large fileSeung-Woo Kim1-0/+13
From protocol version 5.0, it will be supported large file size with 64bit value. Fix to check protocol version before resuing large file. Change-Id: Ie2b76d5e857c143289332e543bb65254ac522081 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Update for THOR 5.0 supportSeung-Woo Kim1-3/+9
Until THOR 4.0, it uses only 32bit to send file size. From THOR 5.0, it starts to use two 32bit variables for the file size. Update for the THOR 5.0 protocol support. Change-Id: I3569d51179bb75b034a62f902e8640a1232d6ed3 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2018-05-18Fix overflow of filenameSeung-Woo Kim1-1/+23
In thor protocol, only filename with 32 characters is allowed to send but there was overflow of filename more than 32 and it is crashed with 193 or longer length filename. Fix the overflow of filename. Note: ARTIK530 and ARTIK710 already misuse overflowed 33 length dtb filename, and exact modification as thor protocol breaks flashing on the boards. So fix with extention for the ARTIK borads by appending more 32 bytes in rqt_pkt.str_data[1] as artik u-boot expects. Change-Id: I4081024cafa276617497091e00cbb6fbc21348b7 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-09-02Fix file testingKrzysztof Opasiak1-0/+3
Change-Id: Ide8250910005c37a6ecadcb81d4d3b8e1e646bda Reported-by: Tomasz Wozniak <t.wozniak@samsung.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-09-02Fix double free on error conditionKrzysztof Opasiak1-1/+4
Change-Id: I41224563de4d6176e60a5f4c893560e3dcf96b86 Reported-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add support for large filesKrzysztof Opasiak1-6/+6
Currently session size is send over USB as integer 32b. So max size of all files is 2GB. Some fixed uboot versions treat this value as unsigned integer 32b. So there max size of all files is 4GB. Let's provide initial support for large files in lthor by counting all size using off_t which thanks to define is 64b on all platforms. This patch also add a suitable warning if image is larger than 2GB and reports an error if image is larger than 4GB. Change-Id: I402b3684fa96c7531edb580e38f109ecc8a5ebd0 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Use asynchronous API to improve performanceKrzysztof Opasiak1-46/+234
Change-Id: I18f0aa14778d06751e7005e4b555c6c68f2839d4 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2016-07-25Add core file with thor communication protocolKrzysztof Opasiak1-0/+340
Add main file of libthor with implementation of API and thor communication protocol. Change-Id: Ic6e4c13ad89eef8080f955af5a71c11cd201ad78 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>