aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/lightnvm.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/uapi/linux/lightnvm.h b/include/uapi/linux/lightnvm.h
index 928f98997d8a..774a43128a7a 100644
--- a/include/uapi/linux/lightnvm.h
+++ b/include/uapi/linux/lightnvm.h
@@ -33,6 +33,7 @@
33 33
34#define NVM_TTYPE_NAME_MAX 48 34#define NVM_TTYPE_NAME_MAX 48
35#define NVM_TTYPE_MAX 63 35#define NVM_TTYPE_MAX 63
36#define NVM_MMTYPE_LEN 8
36 37
37#define NVM_CTRL_FILE "/dev/lightnvm/control" 38#define NVM_CTRL_FILE "/dev/lightnvm/control"
38 39
@@ -100,6 +101,26 @@ struct nvm_ioctl_remove {
100 __u32 flags; 101 __u32 flags;
101}; 102};
102 103
104struct nvm_ioctl_dev_init {
105 char dev[DISK_NAME_LEN]; /* open-channel SSD device */
106 char mmtype[NVM_MMTYPE_LEN]; /* register to media manager */
107
108 __u32 flags;
109};
110
111enum {
112 NVM_FACTORY_ERASE_ONLY_USER = 1 << 0, /* erase only blocks used as
113 * host blks or grown blks */
114 NVM_FACTORY_RESET_HOST_BLKS = 1 << 1, /* remove host blk marks */
115 NVM_FACTORY_RESET_GRWN_BBLKS = 1 << 2, /* remove grown blk marks */
116 NVM_FACTORY_NR_BITS = 1 << 3, /* stops here */
117};
118
119struct nvm_ioctl_dev_factory {
120 char dev[DISK_NAME_LEN];
121
122 __u32 flags;
123};
103 124
104/* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */ 125/* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
105enum { 126enum {
@@ -110,6 +131,12 @@ enum {
110 /* device level cmds */ 131 /* device level cmds */
111 NVM_DEV_CREATE_CMD, 132 NVM_DEV_CREATE_CMD,
112 NVM_DEV_REMOVE_CMD, 133 NVM_DEV_REMOVE_CMD,
134
135 /* Init a device to support LightNVM media managers */
136 NVM_DEV_INIT_CMD,
137
138 /* Factory reset device */
139 NVM_DEV_FACTORY_CMD,
113}; 140};
114 141
115#define NVM_IOCTL 'L' /* 0x4c */ 142#define NVM_IOCTL 'L' /* 0x4c */
@@ -122,6 +149,10 @@ enum {
122 struct nvm_ioctl_create) 149 struct nvm_ioctl_create)
123#define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, \ 150#define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, \
124 struct nvm_ioctl_remove) 151 struct nvm_ioctl_remove)
152#define NVM_DEV_INIT _IOW(NVM_IOCTL, NVM_DEV_INIT_CMD, \
153 struct nvm_ioctl_dev_init)
154#define NVM_DEV_FACTORY _IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \
155 struct nvm_ioctl_dev_factory)
125 156
126#define NVM_VERSION_MAJOR 1 157#define NVM_VERSION_MAJOR 1
127#define NVM_VERSION_MINOR 0 158#define NVM_VERSION_MINOR 0