From 5fd12bac0eaeeee91cde53fe04044eb176fcccbc Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Tue, 5 Jan 2010 09:36:10 +0900 Subject: [PATCH] usbd: use status definitions Signed-off-by: Minkyu Kang --- common/cmd_usbd.c | 10 +++++----- include/usbd.h | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/common/cmd_usbd.c b/common/cmd_usbd.c index 507f718..b2439af 100644 --- a/common/cmd_usbd.c +++ b/common/cmd_usbd.c @@ -530,9 +530,9 @@ static int process_data(struct usbd_ops *usbd) (int)recvlen, (int)len); /* Retry this commad */ - *((ulong *) usbd->tx_data) = 1; + *((ulong *) usbd->tx_data) = STATUS_RETRY; } else - *((ulong *) usbd->tx_data) = 0; + *((ulong *) usbd->tx_data) = STATUS_DONE; usbd->send_data(usbd->tx_data, usbd->tx_len); return 1; @@ -692,7 +692,7 @@ static int process_data(struct usbd_ops *usbd) usbd_phone_down(); - *((ulong *) usbd->tx_data) = 0; + *((ulong *) usbd->tx_data) = STATUS_DONE; usbd->send_data(usbd->tx_data, usbd->tx_len); return 1; @@ -798,11 +798,11 @@ static int process_data(struct usbd_ops *usbd) if (ret) { /* Retry this commad */ - *((ulong *) usbd->tx_data) = 1; + *((ulong *) usbd->tx_data) = STATUS_RETRY; usbd->send_data(usbd->tx_data, usbd->tx_len); return 1; } else - *((ulong *) usbd->tx_data) = 0; + *((ulong *) usbd->tx_data) = STATUS_DONE; /* Write image success -> Report status */ usbd->send_data(usbd->tx_data, usbd->tx_len); diff --git a/include/usbd.h b/include/usbd.h index d7ab712..0ea1be9 100644 --- a/include/usbd.h +++ b/include/usbd.h @@ -54,6 +54,13 @@ enum { #endif #define COMMAND_PROGRESS 230 +/* status definition */ +enum { + STATUS_DONE = 0, + STATUS_RETRY, + STATUS_ERROR, +}; + /* * USB Downloader Operations * All functions and valuable are mandatory -- 2.7.4