svn commit: r233091 - in projects/nand: sbin/fdisk sys/sys
Grzegorz Bernacki
gber at FreeBSD.org
Sat Mar 17 17:10:15 UTC 2012
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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/param.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/diskmbr.h>
#include <sys/endian.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <ctype.h>
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.
More information about the svn-src-projects
mailing list