summaryrefslogtreecommitdiffstats
path: root/cpukit/libblock/include/rtems/blkdev.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2010-05-18 02:14:05 +0000
committerChris Johns <chrisj@rtems.org>2010-05-18 02:14:05 +0000
commit8aa608df3241d07de26d8700ce762476a09a7706 (patch)
tree5210870b71151291b3225aba7eb47b9381d4914a /cpukit/libblock/include/rtems/blkdev.h
parent010-05-18 Chris Johns <chrisj@rtems.org> (diff)
downloadrtems-8aa608df3241d07de26d8700ce762476a09a7706.tar.bz2
2010-05-18 Chris Johns <chrisj@rtems.org>
* libblock/src/diskdevs.c, libblock/include/rtems/blkdev.h, libblock/src/bdbuf.c: PR 1448/filesystem. * libblock/include/rtems/blkdev.h, libblock/src/bdbuf.c: PR 1514/filesystem.
Diffstat (limited to 'cpukit/libblock/include/rtems/blkdev.h')
-rw-r--r--cpukit/libblock/include/rtems/blkdev.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h
index 63fb2db108..85907278e9 100644
--- a/cpukit/libblock/include/rtems/blkdev.h
+++ b/cpukit/libblock/include/rtems/blkdev.h
@@ -42,23 +42,18 @@ extern "C" {
/**
* Block device request type.
+ *
+ * @warning The sync request is an IO one and only used from the cache. Use the
+ * Block IO when operating at the device level. We need a sync request
+ * to avoid requests looping for ever.
*/
typedef enum rtems_blkdev_request_op {
RTEMS_BLKDEV_REQ_READ, /**< Read the requested blocks of data. */
RTEMS_BLKDEV_REQ_WRITE, /**< Write the requested blocks of data. */
- RTEMS_BLKDEV_CAPABILITIES /**< Return the driver capabilities set. */
+ RTEMS_BLKDEV_REQ_SYNC /**< Sync any data with the media. */
} rtems_blkdev_request_op;
/**
- * Only consecutive multi-sector buffer requests are supported.
- *
- * This option means the cache will only supply multiple buffers that are
- * inorder so the ATA multi-sector command for example can be used. This is a
- * hack to work around the current ATA driver.
- */
-#define RTEMS_BLKDEV_CAP_MULTISECTOR_CONT (1 << 0)
-
-/**
* @brief Block device request done callback function type.
*
* The first parameter @a arg must be the argument provided by the block device
@@ -147,7 +142,7 @@ typedef struct rtems_blkdev_request {
/**
* The start block in a request.
*
- * Only valid if the driver has returned the @ref RTEMS_BLKDEV_CAPABILITIES of
+ * Only valid if the driver has returned the @ref RTEMS_BLKIO_CAPABILITIES of
* @ref RTEMS_BLKDEV_CAP_MULTISECTOR_CONT.
*/
#define RTEMS_BLKDEV_START_BLOCK(req) (req->bufs[0].block)
@@ -165,10 +160,26 @@ typedef struct rtems_blkdev_request {
#define RTEMS_BLKIO_GETSIZE _IOR('B', 5, rtems_blkdev_bnum)
#define RTEMS_BLKIO_SYNCDEV _IO('B', 6)
#define RTEMS_BLKIO_DELETED _IO('B', 7)
+#define RTEMS_BLKIO_CAPABILITIES _IO('B', 8)
/** @} */
/**
+ * Only consecutive multi-sector buffer requests are supported.
+ *
+ * This option means the cache will only supply multiple buffers that are
+ * inorder so the ATA multi-sector command for example can be used. This is a
+ * hack to work around the current ATA driver.
+ */
+#define RTEMS_BLKDEV_CAP_MULTISECTOR_CONT (1 << 0)
+
+/**
+ * The driver will accept a sync call. A sync call is made to a driver
+ * after a bdbuf cache sync has finished.
+ */
+#define RTEMS_BLKDEV_CAP_SYNC (1 << 1)
+
+/**
* The device driver interface conventions suppose that a driver may contain an
* initialize, open, close, read, write and IO control entry points. These
* primitives (except initialize) can be implemented in a generic fashion based