mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
tools: kwboot: Remove code for handling CAN byte
It is unknown why handling of CAN byte was added into kwboot tool as Marvell BootROM does not support CAN byte. It never sends CAN byte to host and if host sends CAN byte BootROM handles it as an unknown byte. Remove code for handling and sending CAN bytes from the kwboot tool. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
82a9e13a9b
commit
94c906a0dd
1 changed files with 5 additions and 11 deletions
|
@ -63,7 +63,6 @@ static unsigned char kwboot_msg_debug[] = {
|
||||||
#define EOT 4 /* sender end of block transfer */
|
#define EOT 4 /* sender end of block transfer */
|
||||||
#define ACK 6 /* target block ack */
|
#define ACK 6 /* target block ack */
|
||||||
#define NAK 21 /* target block negative ack */
|
#define NAK 21 /* target block negative ack */
|
||||||
#define CAN 24 /* target/sender transfer cancellation */
|
|
||||||
|
|
||||||
#define KWBOOT_XM_BLKSZ 128 /* xmodem block size */
|
#define KWBOOT_XM_BLKSZ 128 /* xmodem block size */
|
||||||
|
|
||||||
|
@ -826,7 +825,7 @@ _now(void)
|
||||||
static int
|
static int
|
||||||
_is_xm_reply(char c)
|
_is_xm_reply(char c)
|
||||||
{
|
{
|
||||||
return c == ACK || c == NAK || c == CAN;
|
return c == ACK || c == NAK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -841,9 +840,6 @@ _xm_reply_to_error(int c)
|
||||||
case NAK:
|
case NAK:
|
||||||
errno = EBADMSG;
|
errno = EBADMSG;
|
||||||
break;
|
break;
|
||||||
case CAN:
|
|
||||||
errno = ECANCELED;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
errno = EPROTO;
|
errno = EPROTO;
|
||||||
break;
|
break;
|
||||||
|
@ -966,7 +962,7 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm,
|
||||||
do {
|
do {
|
||||||
rc = kwboot_tty_send(fd, block, sizeof(*block), 1);
|
rc = kwboot_tty_send(fd, block, sizeof(*block), 1);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
goto err;
|
||||||
|
|
||||||
if (allow_non_xm && !*done_print) {
|
if (allow_non_xm && !*done_print) {
|
||||||
kwboot_progress(100, '.');
|
kwboot_progress(100, '.');
|
||||||
|
@ -979,7 +975,7 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm,
|
||||||
allow_non_xm, &non_xm_print,
|
allow_non_xm, &non_xm_print,
|
||||||
baudrate, &baud_changed);
|
baudrate, &baud_changed);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto can;
|
goto err;
|
||||||
|
|
||||||
if (!allow_non_xm && c != ACK)
|
if (!allow_non_xm && c != ACK)
|
||||||
kwboot_progress(-1, '+');
|
kwboot_progress(-1, '+');
|
||||||
|
@ -990,15 +986,13 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm,
|
||||||
|
|
||||||
if (allow_non_xm && baudrate && !baud_changed) {
|
if (allow_non_xm && baudrate && !baud_changed) {
|
||||||
fprintf(stderr, "Baudrate was not changed\n");
|
fprintf(stderr, "Baudrate was not changed\n");
|
||||||
rc = -1;
|
|
||||||
errno = EPROTO;
|
errno = EPROTO;
|
||||||
goto can;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _xm_reply_to_error(c);
|
return _xm_reply_to_error(c);
|
||||||
can:
|
err:
|
||||||
err = errno;
|
err = errno;
|
||||||
kwboot_tty_send_char(fd, CAN);
|
|
||||||
kwboot_printv("\n");
|
kwboot_printv("\n");
|
||||||
errno = err;
|
errno = err;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in a new issue