RTEMS  5.1
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables

Block Device Management. More...

#include <rtems.h>
#include <rtems/diskdevs.h>
#include <rtems/print.h>
#include <sys/ioccom.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  rtems_blkdev_sg_buffer
 Block device scatter or gather buffer structure. More...
 
struct  rtems_blkdev_request
 The block device transfer request is used to read or write a number of blocks from or to the device. More...
 

Macros

#define RTEMS_BLKDEV_START_BLOCK(req)   (req->bufs[0].block)
 The start block in a request. More...
 
#define RTEMS_GENERIC_BLOCK_DEVICE_DRIVER_ENTRIES
 
IO Control Request Codes
#define RTEMS_BLKIO_REQUEST   _IOWR('B', 1, rtems_blkdev_request)
 
#define RTEMS_BLKIO_GETMEDIABLKSIZE   _IOR('B', 2, uint32_t)
 
#define RTEMS_BLKIO_GETBLKSIZE   _IOR('B', 3, uint32_t)
 
#define RTEMS_BLKIO_SETBLKSIZE   _IOW('B', 4, uint32_t)
 
#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)
 
#define RTEMS_BLKIO_GETDISKDEV   _IOR('B', 9, rtems_disk_device *)
 
#define RTEMS_BLKIO_PURGEDEV   _IO('B', 10)
 
#define RTEMS_BLKIO_GETDEVSTATS   _IOR('B', 11, rtems_blkdev_stats *)
 
#define RTEMS_BLKIO_RESETDEVSTATS   _IO('B', 12)
 
Block Device Driver Capabilities
#define RTEMS_BLKDEV_CAP_MULTISECTOR_CONT   (1 << 0)
 Only consecutive multi-sector buffer requests are supported. More...
 
#define RTEMS_BLKDEV_CAP_SYNC   (1 << 1)
 The driver will accept a sync call. More...
 

Typedefs

typedef enum rtems_blkdev_request_op rtems_blkdev_request_op
 Block device request type. More...
 
typedef void(* rtems_blkdev_request_cb) (struct rtems_blkdev_request *req, rtems_status_code status)
 Block device request done callback function type.
 
typedef struct rtems_blkdev_sg_buffer rtems_blkdev_sg_buffer
 Block device scatter or gather buffer structure.
 
typedef struct rtems_blkdev_request rtems_blkdev_request
 The block device transfer request is used to read or write a number of blocks from or to the device. More...
 

Enumerations

enum  rtems_blkdev_request_op { RTEMS_BLKDEV_REQ_READ, RTEMS_BLKDEV_REQ_WRITE, RTEMS_BLKDEV_REQ_SYNC }
 Block device request type. More...
 

Functions

int rtems_blkdev_ioctl (rtems_disk_device *dd, uint32_t req, void *argp)
 Common IO control primitive. More...
 
rtems_status_code rtems_blkdev_create (const char *device, uint32_t media_block_size, rtems_blkdev_bnum media_block_count, rtems_block_device_ioctl handler, void *driver_data)
 Creates a block device. More...
 
rtems_status_code rtems_blkdev_create_partition (const char *partition, const char *parent_block_device, rtems_blkdev_bnum media_block_begin, rtems_blkdev_bnum media_block_count)
 Creates a partition within a parent block device. More...
 
void rtems_blkdev_print_stats (const rtems_blkdev_stats *stats, uint32_t media_block_size, uint32_t media_block_count, uint32_t block_size, const rtems_printer *printer)
 Prints the block device statistics.
 
void rtems_blkstats (const rtems_printer *printer, const char *device, bool reset)
 Block device statistics command.
 
RTEMS_DEPRECATED rtems_device_driver rtems_blkdev_generic_read (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 
RTEMS_DEPRECATED rtems_device_driver rtems_blkdev_generic_write (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 
RTEMS_DEPRECATED rtems_device_driver rtems_blkdev_generic_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 
RTEMS_DEPRECATED rtems_device_driver rtems_blkdev_generic_close (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 
RTEMS_DEPRECATED rtems_device_driver rtems_blkdev_generic_ioctl (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 

Variables

RTEMS_DEPRECATED const rtems_driver_address_table rtems_blkdev_generic_ops
 

Detailed Description

Block Device Management.