lightnvm.h revision 05d08e9716b5974d6ed08973f44930804890b902
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_LIGHTNVM_H
20#define _UAPI_LINUX_LIGHTNVM_H
21#include <stdio.h>
22#include <sys/ioctl.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define DISK_NAME_LEN 32
25#include <linux/types.h>
26#include <linux/ioctl.h>
27#define NVM_TTYPE_NAME_MAX 48
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define NVM_TTYPE_MAX 63
30#define NVM_CTRL_FILE "/dev/lightnvm/control"
31struct nvm_ioctl_info_tgt {
32  __u32 version[3];
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  __u32 reserved;
35  char tgtname[NVM_TTYPE_NAME_MAX];
36};
37struct nvm_ioctl_info {
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  __u32 version[3];
40  __u16 tgtsize;
41  __u16 reserved16;
42  __u32 reserved[12];
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  struct nvm_ioctl_info_tgt tgts[NVM_TTYPE_MAX];
45};
46enum {
47  NVM_DEVICE_ACTIVE = 1 << 0,
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49};
50struct nvm_ioctl_device_info {
51  char devname[DISK_NAME_LEN];
52  char bmname[NVM_TTYPE_NAME_MAX];
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  __u32 bmversion[3];
55  __u32 flags;
56  __u32 reserved[8];
57};
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59struct nvm_ioctl_get_devices {
60  __u32 nr_devices;
61  __u32 reserved[31];
62  struct nvm_ioctl_device_info info[31];
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64};
65struct nvm_ioctl_create_simple {
66  __u32 lun_begin;
67  __u32 lun_end;
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69};
70enum {
71  NVM_CONFIG_TYPE_SIMPLE = 0,
72};
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74struct nvm_ioctl_create_conf {
75  __u32 type;
76  union {
77    struct nvm_ioctl_create_simple s;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  };
80};
81struct nvm_ioctl_create {
82  char dev[DISK_NAME_LEN];
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84  char tgttype[NVM_TTYPE_NAME_MAX];
85  char tgtname[DISK_NAME_LEN];
86  __u32 flags;
87  struct nvm_ioctl_create_conf conf;
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89};
90struct nvm_ioctl_remove {
91  char tgtname[DISK_NAME_LEN];
92  __u32 flags;
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94};
95enum {
96  NVM_INFO_CMD = 0x20,
97  NVM_GET_DEVICES_CMD,
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  NVM_DEV_CREATE_CMD,
100  NVM_DEV_REMOVE_CMD,
101};
102#define NVM_IOCTL 'L'
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define NVM_INFO _IOWR(NVM_IOCTL, NVM_INFO_CMD, struct nvm_ioctl_info)
105#define NVM_GET_DEVICES _IOR(NVM_IOCTL, NVM_GET_DEVICES_CMD, struct nvm_ioctl_get_devices)
106#define NVM_DEV_CREATE _IOW(NVM_IOCTL, NVM_DEV_CREATE_CMD, struct nvm_ioctl_create)
107#define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, struct nvm_ioctl_remove)
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define NVM_VERSION_MAJOR 1
110#define NVM_VERSION_MINOR 0
111#define NVM_VERSION_PATCHLEVEL 0
112#endif
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114