From patchwork Mon Jun 6 13:11:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume GARDET X-Patchwork-Id: 630898 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rNZq874K7z9sxR for ; Mon, 6 Jun 2016 23:12:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F26F9A7534; Mon, 6 Jun 2016 15:12:02 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aMwXqZhIQeRa; Mon, 6 Jun 2016 15:12:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5E6D3A7517; Mon, 6 Jun 2016 15:12:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41F37A7517 for ; Mon, 6 Jun 2016 15:11:59 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WSsFHwA6iqUj for ; Mon, 6 Jun 2016 15:11:59 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by theia.denx.de (Postfix) with ESMTPS id 07447A74DB for ; Mon, 6 Jun 2016 15:11:54 +0200 (CEST) Received: from OLI01.site (unknown [82.244.147.214]) by smtp2-g21.free.fr (Postfix) with ESMTP id DD4F22003FC; Mon, 6 Jun 2016 13:03:29 +0200 (CEST) From: Guillaume GARDET To: u-boot@lists.denx.de Date: Mon, 6 Jun 2016 15:11:45 +0200 Message-Id: <1465218705-1123-1-git-send-email-guillaume.gardet@free.fr> X-Mailer: git-send-email 1.8.4.5 Cc: joe.hershberger@ni.com, Guillaume GARDET Subject: [U-Boot] [PATCH] NFS: Add error message when U-Boot NFS version (V2) is not supported by NFS server X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Guillaume GARDET Cc: joe.hershberger@ni.com Acked-by: Joe Hershberger --- net/nfs.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/net/nfs.c b/net/nfs.c index 78968d8..0ed47c9 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -481,8 +481,22 @@ static int nfs_lookup_reply(uchar *pkt, unsigned len) if (rpc_pkt.u.reply.rstatus || rpc_pkt.u.reply.verifier || rpc_pkt.u.reply.astatus || - rpc_pkt.u.reply.data[0]) + rpc_pkt.u.reply.data[0]){ + switch(ntohl(rpc_pkt.u.reply.astatus)){ + case 0: /* Not an error */ + break; + case 2: /* Remote can't support NFS version */ + printf("*** ERROR: NFS version not supported: Requested: V%d, accepted: min V%d - max V%d\n", + 2, + ntohl(rpc_pkt.u.reply.data[0]), + ntohl(rpc_pkt.u.reply.data[1])); + break; + default: /* Unknown error on 'accept state' flag */ + printf("*** ERROR: accept state error (%d)\n", ntohl(rpc_pkt.u.reply.astatus)); + break; + } return -1; + } memcpy(filefh, rpc_pkt.u.reply.data + 1, NFS_FHSIZE);