From: "Marek Behún" <kabel@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: u-boot@lists.denx.de, pali@kernel.org,
"Marek Behún" <marek.behun@nic.cz>
Subject: [PATCH u-boot-marvell 04/14] tools: kwboot: Remove code for handling CAN byte
Date: Tue, 25 Jan 2022 18:13:03 +0100 [thread overview]
Message-ID: <20220125171313.14498-5-kabel@kernel.org> (raw)
In-Reply-To: <20220125171313.14498-1-kabel@kernel.org>
From: Pali Rohár <pali@kernel.org>
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>
---
tools/kwboot.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c
index be9a751406..0b97990d09 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -63,7 +63,6 @@ static unsigned char kwboot_msg_debug[] = {
#define EOT 4 /* sender end of block transfer */
#define ACK 6 /* target block ack */
#define NAK 21 /* target block negative ack */
-#define CAN 24 /* target/sender transfer cancellation */
#define KWBOOT_XM_BLKSZ 128 /* xmodem block size */
@@ -826,7 +825,7 @@ _now(void)
static int
_is_xm_reply(char c)
{
- return c == ACK || c == NAK || c == CAN;
+ return c == ACK || c == NAK;
}
static int
@@ -841,9 +840,6 @@ _xm_reply_to_error(int c)
case NAK:
errno = EBADMSG;
break;
- case CAN:
- errno = ECANCELED;
- break;
default:
errno = EPROTO;
break;
@@ -966,7 +962,7 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm,
do {
rc = kwboot_tty_send(fd, block, sizeof(*block), 1);
if (rc)
- return rc;
+ goto err;
if (allow_non_xm && !*done_print) {
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,
baudrate, &baud_changed);
if (rc)
- goto can;
+ goto err;
if (!allow_non_xm && c != ACK)
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) {
fprintf(stderr, "Baudrate was not changed\n");
- rc = -1;
errno = EPROTO;
- goto can;
+ return -1;
}
return _xm_reply_to_error(c);
-can:
+err:
err = errno;
- kwboot_tty_send_char(fd, CAN);
kwboot_printv("\n");
errno = err;
return rc;
--
2.34.1
next prev parent reply other threads:[~2022-01-25 17:14 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-25 17:12 [PATCH u-boot-marvell 00/14] Another set of kwboot improvements Marek Behún
2022-01-25 17:13 ` [PATCH u-boot-marvell 01/14] tools: kwboot: Increase blk_rsp_timeo to 2s Marek Behún
2022-01-26 15:34 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 02/14] tools: kwboot: Wait blk_rsp_timeo when flushing Marek Behún
2022-01-26 15:34 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 03/14] tools: kwboot: Improve retrying logic for incomplete xmodem packets Marek Behún
2022-01-26 15:34 ` Stefan Roese
2022-01-25 17:13 ` Marek Behún [this message]
2022-01-26 15:35 ` [PATCH u-boot-marvell 04/14] tools: kwboot: Remove code for handling CAN byte Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 05/14] tools: kwboot: Do not change received character in kwboot_xm_recv_reply() Marek Behún
2022-01-26 15:38 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 06/14] tools: kwboot: Fix handling of repeated xmodem packets Marek Behún
2022-01-26 15:39 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 07/14] tools: kwboot: Show 'E' in progress output when error occurs Marek Behún
2022-01-26 15:39 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 08/14] tools: kwboot: Allow to use option -b without image path Marek Behún
2022-01-26 15:39 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 09/14] tools: kwboot: Force BootROM to flush input queue after boot pattern Marek Behún
2022-01-26 15:40 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 10/14] tools: kwboot: Remove 2s delay before sending first xmodem packet Marek Behún
2022-01-26 15:41 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 11/14] tools: kwboot: Handle EINTR in kwboot_write() Marek Behún
2022-01-26 15:41 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 12/14] tools: kwboot: Handle EINTR in kwboot_tty_recv() Marek Behún
2022-01-26 15:41 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 13/14] tools: kwboot: Fix usage of -D without -t Marek Behún
2022-01-26 15:42 ` Stefan Roese
2022-01-25 17:13 ` [PATCH u-boot-marvell 14/14] tools: kwboot: Set debug flag to 1 Marek Behún
2022-01-26 15:42 ` Stefan Roese
2022-01-31 11:33 ` [PATCH u-boot-marvell 00/14] Another set of kwboot improvements Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220125171313.14498-5-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=marek.behun@nic.cz \
--cc=pali@kernel.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox