From owner-freebsd-embedded@FreeBSD.ORG Wed Nov 6 21:28:58 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 02432D07; Wed, 6 Nov 2013 21:28:58 +0000 (UTC) (envelope-from kp@vega.codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAA312FC2; Wed, 6 Nov 2013 21:28:57 +0000 (UTC) Received: from vega.codepro.be (unknown [172.16.1.3]) by venus.codepro.be (Postfix) with ESMTP id B82B594B5; Wed, 6 Nov 2013 22:28:55 +0100 (CET) Received: by vega.codepro.be (Postfix, from userid 1001) id B5381DC23; Wed, 6 Nov 2013 22:28:55 +0100 (CET) Date: Wed, 6 Nov 2013 22:28:55 +0100 From: Kristof Provost To: freebsd-embedded@freebsd.org Subject: Incorrect struct onfi_params definition Message-ID: <20131106212855.GF58987@vega.codepro.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-PGP-Fingerprint: E114 D9EA 909E D469 8F57 17A5 7D15 91C6 9EFA F286 User-Agent: Mutt/1.5.22 (2013-10-16) Cc: Grzegorz Bernacki X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2013 21:28:58 -0000 Hi, The definition of struct onfi_params in sys/dev/nand/nand.h is incorrect. The total structure size should be 256 bytes, but it's only 176 bytes. That's because the vendor_spec array was declared as being 8 bytes, rather than the 88 bytes it should be. Clearly a typo. This patch should fix it: diff --git a/sys/dev/nand/nand.h b/sys/dev/nand/nand.h index 0d6d7b4..46b6993 100644 --- a/sys/dev/nand/nand.h +++ b/sys/dev/nand/nand.h @@ -217,7 +217,7 @@ struct onfi_params { uint8_t driver_strength_support; uint8_t res4[12]; uint16_t vendor_rev; - uint8_t vendor_spec[8]; + uint8_t vendor_spec[88]; uint16_t crc; }__attribute__((packed)); Regards, Kristof