From owner-svn-src-projects@FreeBSD.ORG Sat Mar 17 17:10:15 2012 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78E6E106564A; Sat, 17 Mar 2012 17:10:15 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B35D8FC12; Sat, 17 Mar 2012 17:10:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2HHAFEW079654; Sat, 17 Mar 2012 17:10:15 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2HHAFiq079651; Sat, 17 Mar 2012 17:10:15 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201203171710.q2HHAFiq079651@svn.freebsd.org> From: Grzegorz Bernacki Date: Sat, 17 Mar 2012 17:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233091 - in projects/nand: sbin/fdisk sys/sys X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Mar 2012 17:10:15 -0000 Author: gber Date: Sat Mar 17 17:10:14 2012 New Revision: 233091 URL: http://svn.freebsd.org/changeset/base/233091 Log: Add ioctl and structures for accessing nand disk devices. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks Modified: projects/nand/sbin/fdisk/fdisk.c projects/nand/sys/sys/disk.h Modified: projects/nand/sbin/fdisk/fdisk.c ============================================================================== --- projects/nand/sbin/fdisk/fdisk.c Sat Mar 17 16:40:15 2012 (r233090) +++ projects/nand/sbin/fdisk/fdisk.c Sat Mar 17 17:10:14 2012 (r233091) @@ -27,11 +27,11 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include -#include #include #include #include Modified: projects/nand/sys/sys/disk.h ============================================================================== --- projects/nand/sys/sys/disk.h Sat Mar 17 16:40:15 2012 (r233090) +++ projects/nand/sys/sys/disk.h Sat Mar 17 17:10:14 2012 (r233091) @@ -116,6 +116,32 @@ void disk_err(struct bio *bp, const char * This should be a multiple of the sector size. */ +#define DIOCNOOBSIZE _IOR('d', 141, u_int) /* Get oob size */ + /*- + * Get the OOB area size of NAND flash device. + */ + +#define DIOCNBLKSIZE _IOR('d', 142, u_int) /* Get block size */ + /* - + * Get the block size of NAND flash device. + */ + +struct nand_oob_request { + off_t offset; /* offset in bytes, page-aligned */ + off_t length; /* length */ + void * ubuf; /* buffer supplied by user */ +}; + +#define DIOCNREADOOB _IOW('d', 143, struct nand_oob_request) /* Read OOB area */ + /*- + * Read page OOB area from NAND flash device. + */ + +#define DIOCNWRITEOOB _IOW('d', 144, struct nand_oob_request) /* Write OOB area */ + /*- + * Write page OOB area to NAND flash device. + */ + #define DIOCGPHYSPATH _IOR('d', 141, char[MAXPATHLEN]) /* * Get a string defining the physical path for a given provider.