RTEMS: cpukit/include/rtems/nvdisk.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
nvdisk.h
Go to the documentation of this file.
1
7/*
8 * Copyright (C) 2007 Chris Johns
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
25#if !defined (_RTEMS_NVDISK_H_)
26#define _RTEMS_NVDISK_H_
27
28#include <stdint.h>
29#include <sys/ioctl.h>
30
31#include <rtems.h>
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
40#define RTEMS_NVDISK_DEVICE_BASE_NAME "/dev/nvd"
41
61#define RTEMS_NVDISK_IOCTL_ERASE_DISK _IO('B', 128)
62#define RTEMS_NVDISK_IOCTL_MONITORING _IO('B', 129)
63#define RTEMS_NVDISK_IOCTL_INFO_LEVEL _IO('B', 130)
64#define RTEMS_NVDISK_IOCTL_PRINT_STATUS _IO('B', 131)
65
70 typedef struct rtems_nvdisk_monitor_data
71{
72 uint32_t block_size;
73 uint32_t block_count;
74 uint32_t page_count;
75 uint32_t pages_available;
76 uint32_t pages_used;
77 uint32_t info_level;
78} rtems_nvdisk_monitor_data;
79
83#define RTEMS_NVDISK_KBYTES(_k) ((_k) * 1024)
84
93 typedef struct rtems_nvdisk_driver_handlers
94{
108 int (*read) (uint32_t device, uint32_t flags, void* base,
109 uint32_t offset, void* buffer, size_t size);
110
124 int (*write) (uint32_t device, uint32_t flags, void* base,
125 uint32_t offset, const void* buffer, size_t size);
126
140 int (*verify) (uint32_t device, uint32_t flags, void* base,
141 uint32_t offset, const void* buffer, size_t size);
142
143} rtems_nvdisk_driver_handlers;
144
154 typedef struct rtems_nvdisk_device_desc
155{
156 uint32_t flags;
157 void* base;
158 uint32_t size;
159 const rtems_nvdisk_driver_handlers* nv_ops;
160} rtems_nvdisk_device_desc;
161
166 typedef struct rtems_nvdisk_config
167{
168 uint32_t block_size;
169 uint32_t device_count;
170 const rtems_nvdisk_device_desc* devices;
171 uint32_t flags;
173 uint32_t info_level;
174} rtems_nvdisk_config;
175
176/*
177 * Driver flags.
178 */
179
185#define RTEMS_NVDISK_CHECK_PAGES (1 << 0)
186
198 rtems_device_driver
199rtems_nvdisk_initialize (rtems_device_major_number major,
200 rtems_device_minor_number minor,
201 void* arg);
202
207extern const rtems_nvdisk_config rtems_nvdisk_configuration[];
208
213extern uint32_t rtems_nvdisk_configuration_size;
214
215#ifdef __cplusplus
216}
217#endif /* __cplusplus */
218
219#endif
rtems_status_code
rtems_status_code
Classic API Status.
Definition: status.h:43
rtems_nvdisk_configuration
const rtems_nvdisk_config rtems_nvdisk_configuration[]
rtems_nvdisk_initialize
rtems_device_driver rtems_nvdisk_initialize(rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
rtems_nvdisk_configuration_size
uint32_t rtems_nvdisk_configuration_size
rtems.h
device
Definition: rtemscompat1.h:15
rtems_nvdisk_config
Definition: nvdisk.h:167
rtems_nvdisk_config::block_size
uint32_t block_size
Definition: nvdisk.h:168
rtems_nvdisk_config::info_level
uint32_t info_level
Definition: nvdisk.h:173
rtems_nvdisk_config::device_count
uint32_t device_count
Definition: nvdisk.h:169
rtems_nvdisk_config::flags
uint32_t flags
Definition: nvdisk.h:171
rtems_nvdisk_config::devices
const rtems_nvdisk_device_desc * devices
Definition: nvdisk.h:170
rtems_nvdisk_device_desc
Definition: nvdisk.h:155
rtems_nvdisk_device_desc::nv_ops
const rtems_nvdisk_driver_handlers * nv_ops
Definition: nvdisk.h:159
rtems_nvdisk_device_desc::size
uint32_t size
Definition: nvdisk.h:158
rtems_nvdisk_device_desc::flags
uint32_t flags
Definition: nvdisk.h:156
rtems_nvdisk_device_desc::base
void * base
Definition: nvdisk.h:157
rtems_nvdisk_driver_handlers
Definition: nvdisk.h:94
rtems_nvdisk_driver_handlers::read
int(* read)(uint32_t device, uint32_t flags, void *base, uint32_t offset, void *buffer, size_t size)
Definition: nvdisk.h:108
rtems_nvdisk_driver_handlers::verify
int(* verify)(uint32_t device, uint32_t flags, void *base, uint32_t offset, const void *buffer, size_t size)
Definition: nvdisk.h:140
rtems_nvdisk_driver_handlers::write
int(* write)(uint32_t device, uint32_t flags, void *base, uint32_t offset, const void *buffer, size_t size)
Definition: nvdisk.h:124
rtems_nvdisk_monitor_data
Definition: nvdisk.h:71