Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: lightnvm.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* Copyright (C) 2015 CNEX Labs. All rights reserved.
[2] Fix | Delete
*
[3] Fix | Delete
* This program is free software; you can redistribute it and/or
[4] Fix | Delete
* modify it under the terms of the GNU General Public License version
[5] Fix | Delete
* 2 as published by the Free Software Foundation.
[6] Fix | Delete
*
[7] Fix | Delete
* This program is distributed in the hope that it will be useful, but
[8] Fix | Delete
* WITHOUT ANY WARRANTY; without even the implied warranty of
[9] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[10] Fix | Delete
* General Public License for more details.
[11] Fix | Delete
*
[12] Fix | Delete
* You should have received a copy of the GNU General Public License
[13] Fix | Delete
* along with this program; see the file COPYING. If not, write to
[14] Fix | Delete
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
[15] Fix | Delete
* USA.
[16] Fix | Delete
*/
[17] Fix | Delete
[18] Fix | Delete
#ifndef _LINUX_LIGHTNVM_H
[19] Fix | Delete
#define _LINUX_LIGHTNVM_H
[20] Fix | Delete
[21] Fix | Delete
#include <stdio.h>
[22] Fix | Delete
#include <sys/ioctl.h>
[23] Fix | Delete
#define DISK_NAME_LEN 32
[24] Fix | Delete
[25] Fix | Delete
#include <linux/types.h>
[26] Fix | Delete
#include <linux/ioctl.h>
[27] Fix | Delete
[28] Fix | Delete
#define NVM_TTYPE_NAME_MAX 48
[29] Fix | Delete
#define NVM_TTYPE_MAX 63
[30] Fix | Delete
#define NVM_MMTYPE_LEN 8
[31] Fix | Delete
[32] Fix | Delete
#define NVM_CTRL_FILE "/dev/lightnvm/control"
[33] Fix | Delete
[34] Fix | Delete
struct nvm_ioctl_info_tgt {
[35] Fix | Delete
__u32 version[3];
[36] Fix | Delete
__u32 reserved;
[37] Fix | Delete
char tgtname[NVM_TTYPE_NAME_MAX];
[38] Fix | Delete
};
[39] Fix | Delete
[40] Fix | Delete
struct nvm_ioctl_info {
[41] Fix | Delete
__u32 version[3]; /* in/out - major, minor, patch */
[42] Fix | Delete
__u16 tgtsize; /* number of targets */
[43] Fix | Delete
__u16 reserved16; /* pad to 4K page */
[44] Fix | Delete
__u32 reserved[12];
[45] Fix | Delete
struct nvm_ioctl_info_tgt tgts[NVM_TTYPE_MAX];
[46] Fix | Delete
};
[47] Fix | Delete
[48] Fix | Delete
enum {
[49] Fix | Delete
NVM_DEVICE_ACTIVE = 1 << 0,
[50] Fix | Delete
};
[51] Fix | Delete
[52] Fix | Delete
struct nvm_ioctl_device_info {
[53] Fix | Delete
char devname[DISK_NAME_LEN];
[54] Fix | Delete
char bmname[NVM_TTYPE_NAME_MAX];
[55] Fix | Delete
__u32 bmversion[3];
[56] Fix | Delete
__u32 flags;
[57] Fix | Delete
__u32 reserved[8];
[58] Fix | Delete
};
[59] Fix | Delete
[60] Fix | Delete
struct nvm_ioctl_get_devices {
[61] Fix | Delete
__u32 nr_devices;
[62] Fix | Delete
__u32 reserved[31];
[63] Fix | Delete
struct nvm_ioctl_device_info info[31];
[64] Fix | Delete
};
[65] Fix | Delete
[66] Fix | Delete
struct nvm_ioctl_create_simple {
[67] Fix | Delete
__u32 lun_begin;
[68] Fix | Delete
__u32 lun_end;
[69] Fix | Delete
};
[70] Fix | Delete
[71] Fix | Delete
struct nvm_ioctl_create_extended {
[72] Fix | Delete
__u16 lun_begin;
[73] Fix | Delete
__u16 lun_end;
[74] Fix | Delete
__u16 op;
[75] Fix | Delete
__u16 rsv;
[76] Fix | Delete
};
[77] Fix | Delete
[78] Fix | Delete
enum {
[79] Fix | Delete
NVM_CONFIG_TYPE_SIMPLE = 0,
[80] Fix | Delete
NVM_CONFIG_TYPE_EXTENDED = 1,
[81] Fix | Delete
};
[82] Fix | Delete
[83] Fix | Delete
struct nvm_ioctl_create_conf {
[84] Fix | Delete
__u32 type;
[85] Fix | Delete
union {
[86] Fix | Delete
struct nvm_ioctl_create_simple s;
[87] Fix | Delete
struct nvm_ioctl_create_extended e;
[88] Fix | Delete
};
[89] Fix | Delete
};
[90] Fix | Delete
[91] Fix | Delete
enum {
[92] Fix | Delete
NVM_TARGET_FACTORY = 1 << 0, /* Init target in factory mode */
[93] Fix | Delete
};
[94] Fix | Delete
[95] Fix | Delete
struct nvm_ioctl_create {
[96] Fix | Delete
char dev[DISK_NAME_LEN]; /* open-channel SSD device */
[97] Fix | Delete
char tgttype[NVM_TTYPE_NAME_MAX]; /* target type name */
[98] Fix | Delete
char tgtname[DISK_NAME_LEN]; /* dev to expose target as */
[99] Fix | Delete
[100] Fix | Delete
__u32 flags;
[101] Fix | Delete
[102] Fix | Delete
struct nvm_ioctl_create_conf conf;
[103] Fix | Delete
};
[104] Fix | Delete
[105] Fix | Delete
struct nvm_ioctl_remove {
[106] Fix | Delete
char tgtname[DISK_NAME_LEN];
[107] Fix | Delete
[108] Fix | Delete
__u32 flags;
[109] Fix | Delete
};
[110] Fix | Delete
[111] Fix | Delete
struct nvm_ioctl_dev_init {
[112] Fix | Delete
char dev[DISK_NAME_LEN]; /* open-channel SSD device */
[113] Fix | Delete
char mmtype[NVM_MMTYPE_LEN]; /* register to media manager */
[114] Fix | Delete
[115] Fix | Delete
__u32 flags;
[116] Fix | Delete
};
[117] Fix | Delete
[118] Fix | Delete
enum {
[119] Fix | Delete
NVM_FACTORY_ERASE_ONLY_USER = 1 << 0, /* erase only blocks used as
[120] Fix | Delete
* host blks or grown blks */
[121] Fix | Delete
NVM_FACTORY_RESET_HOST_BLKS = 1 << 1, /* remove host blk marks */
[122] Fix | Delete
NVM_FACTORY_RESET_GRWN_BBLKS = 1 << 2, /* remove grown blk marks */
[123] Fix | Delete
NVM_FACTORY_NR_BITS = 1 << 3, /* stops here */
[124] Fix | Delete
};
[125] Fix | Delete
[126] Fix | Delete
struct nvm_ioctl_dev_factory {
[127] Fix | Delete
char dev[DISK_NAME_LEN];
[128] Fix | Delete
[129] Fix | Delete
__u32 flags;
[130] Fix | Delete
};
[131] Fix | Delete
[132] Fix | Delete
struct nvm_user_vio {
[133] Fix | Delete
__u8 opcode;
[134] Fix | Delete
__u8 flags;
[135] Fix | Delete
__u16 control;
[136] Fix | Delete
__u16 nppas;
[137] Fix | Delete
__u16 rsvd;
[138] Fix | Delete
__u64 metadata;
[139] Fix | Delete
__u64 addr;
[140] Fix | Delete
__u64 ppa_list;
[141] Fix | Delete
__u32 metadata_len;
[142] Fix | Delete
__u32 data_len;
[143] Fix | Delete
__u64 status;
[144] Fix | Delete
__u32 result;
[145] Fix | Delete
__u32 rsvd3[3];
[146] Fix | Delete
};
[147] Fix | Delete
[148] Fix | Delete
struct nvm_passthru_vio {
[149] Fix | Delete
__u8 opcode;
[150] Fix | Delete
__u8 flags;
[151] Fix | Delete
__u8 rsvd[2];
[152] Fix | Delete
__u32 nsid;
[153] Fix | Delete
__u32 cdw2;
[154] Fix | Delete
__u32 cdw3;
[155] Fix | Delete
__u64 metadata;
[156] Fix | Delete
__u64 addr;
[157] Fix | Delete
__u32 metadata_len;
[158] Fix | Delete
__u32 data_len;
[159] Fix | Delete
__u64 ppa_list;
[160] Fix | Delete
__u16 nppas;
[161] Fix | Delete
__u16 control;
[162] Fix | Delete
__u32 cdw13;
[163] Fix | Delete
__u32 cdw14;
[164] Fix | Delete
__u32 cdw15;
[165] Fix | Delete
__u64 status;
[166] Fix | Delete
__u32 result;
[167] Fix | Delete
__u32 timeout_ms;
[168] Fix | Delete
};
[169] Fix | Delete
[170] Fix | Delete
/* The ioctl type, 'L', 0x20 - 0x2F documented in ioctl-number.txt */
[171] Fix | Delete
enum {
[172] Fix | Delete
/* top level cmds */
[173] Fix | Delete
NVM_INFO_CMD = 0x20,
[174] Fix | Delete
NVM_GET_DEVICES_CMD,
[175] Fix | Delete
[176] Fix | Delete
/* device level cmds */
[177] Fix | Delete
NVM_DEV_CREATE_CMD,
[178] Fix | Delete
NVM_DEV_REMOVE_CMD,
[179] Fix | Delete
[180] Fix | Delete
/* Init a device to support LightNVM media managers */
[181] Fix | Delete
NVM_DEV_INIT_CMD,
[182] Fix | Delete
[183] Fix | Delete
/* Factory reset device */
[184] Fix | Delete
NVM_DEV_FACTORY_CMD,
[185] Fix | Delete
[186] Fix | Delete
/* Vector user I/O */
[187] Fix | Delete
NVM_DEV_VIO_ADMIN_CMD = 0x41,
[188] Fix | Delete
NVM_DEV_VIO_CMD = 0x42,
[189] Fix | Delete
NVM_DEV_VIO_USER_CMD = 0x43,
[190] Fix | Delete
};
[191] Fix | Delete
[192] Fix | Delete
#define NVM_IOCTL 'L' /* 0x4c */
[193] Fix | Delete
[194] Fix | Delete
#define NVM_INFO _IOWR(NVM_IOCTL, NVM_INFO_CMD, \
[195] Fix | Delete
struct nvm_ioctl_info)
[196] Fix | Delete
#define NVM_GET_DEVICES _IOR(NVM_IOCTL, NVM_GET_DEVICES_CMD, \
[197] Fix | Delete
struct nvm_ioctl_get_devices)
[198] Fix | Delete
#define NVM_DEV_CREATE _IOW(NVM_IOCTL, NVM_DEV_CREATE_CMD, \
[199] Fix | Delete
struct nvm_ioctl_create)
[200] Fix | Delete
#define NVM_DEV_REMOVE _IOW(NVM_IOCTL, NVM_DEV_REMOVE_CMD, \
[201] Fix | Delete
struct nvm_ioctl_remove)
[202] Fix | Delete
#define NVM_DEV_INIT _IOW(NVM_IOCTL, NVM_DEV_INIT_CMD, \
[203] Fix | Delete
struct nvm_ioctl_dev_init)
[204] Fix | Delete
#define NVM_DEV_FACTORY _IOW(NVM_IOCTL, NVM_DEV_FACTORY_CMD, \
[205] Fix | Delete
struct nvm_ioctl_dev_factory)
[206] Fix | Delete
[207] Fix | Delete
#define NVME_NVM_IOCTL_IO_VIO _IOWR(NVM_IOCTL, NVM_DEV_VIO_USER_CMD, \
[208] Fix | Delete
struct nvm_passthru_vio)
[209] Fix | Delete
#define NVME_NVM_IOCTL_ADMIN_VIO _IOWR(NVM_IOCTL, NVM_DEV_VIO_ADMIN_CMD,\
[210] Fix | Delete
struct nvm_passthru_vio)
[211] Fix | Delete
#define NVME_NVM_IOCTL_SUBMIT_VIO _IOWR(NVM_IOCTL, NVM_DEV_VIO_CMD,\
[212] Fix | Delete
struct nvm_user_vio)
[213] Fix | Delete
[214] Fix | Delete
#define NVM_VERSION_MAJOR 1
[215] Fix | Delete
#define NVM_VERSION_MINOR 0
[216] Fix | Delete
#define NVM_VERSION_PATCHLEVEL 0
[217] Fix | Delete
[218] Fix | Delete
#endif
[219] Fix | Delete
[220] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function