summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-28 13:03:15 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-03-13 12:24:17 +0100
commit4f3cbd9240c2357de363199f8366c699899609b4 (patch)
tree002315e491868942cb9441c5efa89d4d99acdcc0
parentlibblock: Avoid bdbuf API (diff)
downloadrtems-4f3cbd9240c2357de363199f8366c699899609b4.tar.bz2
libblock: New IO control RTEMS_BLKIO_GETDISKDEV
-rw-r--r--cpukit/libblock/include/rtems/blkdev.h1
-rw-r--r--cpukit/libblock/src/blkdev.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/cpukit/libblock/include/rtems/blkdev.h b/cpukit/libblock/include/rtems/blkdev.h
index e9fa86b248..978e93056f 100644
--- a/cpukit/libblock/include/rtems/blkdev.h
+++ b/cpukit/libblock/include/rtems/blkdev.h
@@ -161,6 +161,7 @@ typedef struct rtems_blkdev_request {
#define RTEMS_BLKIO_SYNCDEV _IO('B', 6)
#define RTEMS_BLKIO_DELETED _IO('B', 7)
#define RTEMS_BLKIO_CAPABILITIES _IO('B', 8)
+#define RTEMS_BLKIO_GETDISKDEV _IOR('B', 9, rtems_disk_device *)
/** @} */
diff --git a/cpukit/libblock/src/blkdev.c b/cpukit/libblock/src/blkdev.c
index 10c14dfaf2..c986e69889 100644
--- a/cpukit/libblock/src/blkdev.c
+++ b/cpukit/libblock/src/blkdev.c
@@ -211,6 +211,11 @@ rtems_blkdev_generic_ioctl(
args->ioctl_return = (uint32_t) (rc == RTEMS_SUCCESSFUL ? 0 : -1);
break;
+ case RTEMS_BLKIO_GETDISKDEV:
+ *((rtems_disk_device **) args->buffer) = dd;
+ args->ioctl_return = 0;
+ break;
+
case RTEMS_BLKIO_REQUEST:
/*
* It is not allowed to directly access the driver circumventing