Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: ndctl.h
/*
[0] Fix | Delete
* Copyright (c) 2014-2016, Intel Corporation.
[1] Fix | Delete
*
[2] Fix | Delete
* This program is free software; you can redistribute it and/or modify it
[3] Fix | Delete
* under the terms and conditions of the GNU Lesser General Public License,
[4] Fix | Delete
* version 2.1, as published by the Free Software Foundation.
[5] Fix | Delete
*
[6] Fix | Delete
* This program is distributed in the hope it will be useful, but WITHOUT ANY
[7] Fix | Delete
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
[8] Fix | Delete
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
[9] Fix | Delete
* more details.
[10] Fix | Delete
*/
[11] Fix | Delete
#ifndef __NDCTL_H__
[12] Fix | Delete
#define __NDCTL_H__
[13] Fix | Delete
[14] Fix | Delete
#include <linux/types.h>
[15] Fix | Delete
[16] Fix | Delete
struct nd_cmd_dimm_flags {
[17] Fix | Delete
__u32 status;
[18] Fix | Delete
__u32 flags;
[19] Fix | Delete
} __attribute__((packed));
[20] Fix | Delete
[21] Fix | Delete
struct nd_cmd_get_config_size {
[22] Fix | Delete
__u32 status;
[23] Fix | Delete
__u32 config_size;
[24] Fix | Delete
__u32 max_xfer;
[25] Fix | Delete
} __attribute__((packed));
[26] Fix | Delete
[27] Fix | Delete
struct nd_cmd_get_config_data_hdr {
[28] Fix | Delete
__u32 in_offset;
[29] Fix | Delete
__u32 in_length;
[30] Fix | Delete
__u32 status;
[31] Fix | Delete
__u8 out_buf[0];
[32] Fix | Delete
} __attribute__((packed));
[33] Fix | Delete
[34] Fix | Delete
struct nd_cmd_set_config_hdr {
[35] Fix | Delete
__u32 in_offset;
[36] Fix | Delete
__u32 in_length;
[37] Fix | Delete
__u8 in_buf[0];
[38] Fix | Delete
} __attribute__((packed));
[39] Fix | Delete
[40] Fix | Delete
struct nd_cmd_vendor_hdr {
[41] Fix | Delete
__u32 opcode;
[42] Fix | Delete
__u32 in_length;
[43] Fix | Delete
__u8 in_buf[0];
[44] Fix | Delete
} __attribute__((packed));
[45] Fix | Delete
[46] Fix | Delete
struct nd_cmd_vendor_tail {
[47] Fix | Delete
__u32 status;
[48] Fix | Delete
__u32 out_length;
[49] Fix | Delete
__u8 out_buf[0];
[50] Fix | Delete
} __attribute__((packed));
[51] Fix | Delete
[52] Fix | Delete
struct nd_cmd_ars_cap {
[53] Fix | Delete
__u64 address;
[54] Fix | Delete
__u64 length;
[55] Fix | Delete
__u32 status;
[56] Fix | Delete
__u32 max_ars_out;
[57] Fix | Delete
__u32 clear_err_unit;
[58] Fix | Delete
__u16 flags;
[59] Fix | Delete
__u16 reserved;
[60] Fix | Delete
} __attribute__((packed));
[61] Fix | Delete
[62] Fix | Delete
struct nd_cmd_ars_start {
[63] Fix | Delete
__u64 address;
[64] Fix | Delete
__u64 length;
[65] Fix | Delete
__u16 type;
[66] Fix | Delete
__u8 flags;
[67] Fix | Delete
__u8 reserved[5];
[68] Fix | Delete
__u32 status;
[69] Fix | Delete
__u32 scrub_time;
[70] Fix | Delete
} __attribute__((packed));
[71] Fix | Delete
[72] Fix | Delete
struct nd_cmd_ars_status {
[73] Fix | Delete
__u32 status;
[74] Fix | Delete
__u32 out_length;
[75] Fix | Delete
__u64 address;
[76] Fix | Delete
__u64 length;
[77] Fix | Delete
__u64 restart_address;
[78] Fix | Delete
__u64 restart_length;
[79] Fix | Delete
__u16 type;
[80] Fix | Delete
__u16 flags;
[81] Fix | Delete
__u32 num_records;
[82] Fix | Delete
struct nd_ars_record {
[83] Fix | Delete
__u32 handle;
[84] Fix | Delete
__u32 reserved;
[85] Fix | Delete
__u64 err_address;
[86] Fix | Delete
__u64 length;
[87] Fix | Delete
} __attribute__((packed)) records[0];
[88] Fix | Delete
} __attribute__((packed));
[89] Fix | Delete
[90] Fix | Delete
struct nd_cmd_clear_error {
[91] Fix | Delete
__u64 address;
[92] Fix | Delete
__u64 length;
[93] Fix | Delete
__u32 status;
[94] Fix | Delete
__u8 reserved[4];
[95] Fix | Delete
__u64 cleared;
[96] Fix | Delete
} __attribute__((packed));
[97] Fix | Delete
[98] Fix | Delete
enum {
[99] Fix | Delete
ND_CMD_IMPLEMENTED = 0,
[100] Fix | Delete
[101] Fix | Delete
/* bus commands */
[102] Fix | Delete
ND_CMD_ARS_CAP = 1,
[103] Fix | Delete
ND_CMD_ARS_START = 2,
[104] Fix | Delete
ND_CMD_ARS_STATUS = 3,
[105] Fix | Delete
ND_CMD_CLEAR_ERROR = 4,
[106] Fix | Delete
[107] Fix | Delete
/* per-dimm commands */
[108] Fix | Delete
ND_CMD_SMART = 1,
[109] Fix | Delete
ND_CMD_SMART_THRESHOLD = 2,
[110] Fix | Delete
ND_CMD_DIMM_FLAGS = 3,
[111] Fix | Delete
ND_CMD_GET_CONFIG_SIZE = 4,
[112] Fix | Delete
ND_CMD_GET_CONFIG_DATA = 5,
[113] Fix | Delete
ND_CMD_SET_CONFIG_DATA = 6,
[114] Fix | Delete
ND_CMD_VENDOR_EFFECT_LOG_SIZE = 7,
[115] Fix | Delete
ND_CMD_VENDOR_EFFECT_LOG = 8,
[116] Fix | Delete
ND_CMD_VENDOR = 9,
[117] Fix | Delete
ND_CMD_CALL = 10,
[118] Fix | Delete
};
[119] Fix | Delete
[120] Fix | Delete
enum {
[121] Fix | Delete
ND_ARS_VOLATILE = 1,
[122] Fix | Delete
ND_ARS_PERSISTENT = 2,
[123] Fix | Delete
ND_ARS_RETURN_PREV_DATA = 1 << 1,
[124] Fix | Delete
ND_CONFIG_LOCKED = 1,
[125] Fix | Delete
};
[126] Fix | Delete
[127] Fix | Delete
static __inline__ const char *nvdimm_bus_cmd_name(unsigned cmd)
[128] Fix | Delete
{
[129] Fix | Delete
static const char * const names[] = {
[130] Fix | Delete
[ND_CMD_ARS_CAP] = "ars_cap",
[131] Fix | Delete
[ND_CMD_ARS_START] = "ars_start",
[132] Fix | Delete
[ND_CMD_ARS_STATUS] = "ars_status",
[133] Fix | Delete
[ND_CMD_CLEAR_ERROR] = "clear_error",
[134] Fix | Delete
[ND_CMD_CALL] = "cmd_call",
[135] Fix | Delete
};
[136] Fix | Delete
[137] Fix | Delete
if (cmd < ARRAY_SIZE(names) && names[cmd])
[138] Fix | Delete
return names[cmd];
[139] Fix | Delete
return "unknown";
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
static __inline__ const char *nvdimm_cmd_name(unsigned cmd)
[143] Fix | Delete
{
[144] Fix | Delete
static const char * const names[] = {
[145] Fix | Delete
[ND_CMD_SMART] = "smart",
[146] Fix | Delete
[ND_CMD_SMART_THRESHOLD] = "smart_thresh",
[147] Fix | Delete
[ND_CMD_DIMM_FLAGS] = "flags",
[148] Fix | Delete
[ND_CMD_GET_CONFIG_SIZE] = "get_size",
[149] Fix | Delete
[ND_CMD_GET_CONFIG_DATA] = "get_data",
[150] Fix | Delete
[ND_CMD_SET_CONFIG_DATA] = "set_data",
[151] Fix | Delete
[ND_CMD_VENDOR_EFFECT_LOG_SIZE] = "effect_size",
[152] Fix | Delete
[ND_CMD_VENDOR_EFFECT_LOG] = "effect_log",
[153] Fix | Delete
[ND_CMD_VENDOR] = "vendor",
[154] Fix | Delete
[ND_CMD_CALL] = "cmd_call",
[155] Fix | Delete
};
[156] Fix | Delete
[157] Fix | Delete
if (cmd < ARRAY_SIZE(names) && names[cmd])
[158] Fix | Delete
return names[cmd];
[159] Fix | Delete
return "unknown";
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
#define ND_IOCTL 'N'
[163] Fix | Delete
[164] Fix | Delete
#define ND_IOCTL_DIMM_FLAGS _IOWR(ND_IOCTL, ND_CMD_DIMM_FLAGS,\
[165] Fix | Delete
struct nd_cmd_dimm_flags)
[166] Fix | Delete
[167] Fix | Delete
#define ND_IOCTL_GET_CONFIG_SIZE _IOWR(ND_IOCTL, ND_CMD_GET_CONFIG_SIZE,\
[168] Fix | Delete
struct nd_cmd_get_config_size)
[169] Fix | Delete
[170] Fix | Delete
#define ND_IOCTL_GET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_GET_CONFIG_DATA,\
[171] Fix | Delete
struct nd_cmd_get_config_data_hdr)
[172] Fix | Delete
[173] Fix | Delete
#define ND_IOCTL_SET_CONFIG_DATA _IOWR(ND_IOCTL, ND_CMD_SET_CONFIG_DATA,\
[174] Fix | Delete
struct nd_cmd_set_config_hdr)
[175] Fix | Delete
[176] Fix | Delete
#define ND_IOCTL_VENDOR _IOWR(ND_IOCTL, ND_CMD_VENDOR,\
[177] Fix | Delete
struct nd_cmd_vendor_hdr)
[178] Fix | Delete
[179] Fix | Delete
#define ND_IOCTL_ARS_CAP _IOWR(ND_IOCTL, ND_CMD_ARS_CAP,\
[180] Fix | Delete
struct nd_cmd_ars_cap)
[181] Fix | Delete
[182] Fix | Delete
#define ND_IOCTL_ARS_START _IOWR(ND_IOCTL, ND_CMD_ARS_START,\
[183] Fix | Delete
struct nd_cmd_ars_start)
[184] Fix | Delete
[185] Fix | Delete
#define ND_IOCTL_ARS_STATUS _IOWR(ND_IOCTL, ND_CMD_ARS_STATUS,\
[186] Fix | Delete
struct nd_cmd_ars_status)
[187] Fix | Delete
[188] Fix | Delete
#define ND_IOCTL_CLEAR_ERROR _IOWR(ND_IOCTL, ND_CMD_CLEAR_ERROR,\
[189] Fix | Delete
struct nd_cmd_clear_error)
[190] Fix | Delete
[191] Fix | Delete
#define ND_DEVICE_DIMM 1 /* nd_dimm: container for "config data" */
[192] Fix | Delete
#define ND_DEVICE_REGION_PMEM 2 /* nd_region: (parent of PMEM namespaces) */
[193] Fix | Delete
#define ND_DEVICE_REGION_BLK 3 /* nd_region: (parent of BLK namespaces) */
[194] Fix | Delete
#define ND_DEVICE_NAMESPACE_IO 4 /* legacy persistent memory */
[195] Fix | Delete
#define ND_DEVICE_NAMESPACE_PMEM 5 /* PMEM namespace (may alias with BLK) */
[196] Fix | Delete
#define ND_DEVICE_NAMESPACE_BLK 6 /* BLK namespace (may alias with PMEM) */
[197] Fix | Delete
#define ND_DEVICE_DAX_PMEM 7 /* Device DAX interface to pmem */
[198] Fix | Delete
[199] Fix | Delete
enum nd_driver_flags {
[200] Fix | Delete
ND_DRIVER_DIMM = 1 << ND_DEVICE_DIMM,
[201] Fix | Delete
ND_DRIVER_REGION_PMEM = 1 << ND_DEVICE_REGION_PMEM,
[202] Fix | Delete
ND_DRIVER_REGION_BLK = 1 << ND_DEVICE_REGION_BLK,
[203] Fix | Delete
ND_DRIVER_NAMESPACE_IO = 1 << ND_DEVICE_NAMESPACE_IO,
[204] Fix | Delete
ND_DRIVER_NAMESPACE_PMEM = 1 << ND_DEVICE_NAMESPACE_PMEM,
[205] Fix | Delete
ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
[206] Fix | Delete
ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
[207] Fix | Delete
};
[208] Fix | Delete
[209] Fix | Delete
enum {
[210] Fix | Delete
ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
[211] Fix | Delete
};
[212] Fix | Delete
[213] Fix | Delete
enum ars_masks {
[214] Fix | Delete
ARS_STATUS_MASK = 0x0000FFFF,
[215] Fix | Delete
ARS_EXT_STATUS_SHIFT = 16,
[216] Fix | Delete
};
[217] Fix | Delete
[218] Fix | Delete
/*
[219] Fix | Delete
* struct nd_cmd_pkg
[220] Fix | Delete
*
[221] Fix | Delete
* is a wrapper to a quasi pass thru interface for invoking firmware
[222] Fix | Delete
* associated with nvdimms.
[223] Fix | Delete
*
[224] Fix | Delete
* INPUT PARAMETERS
[225] Fix | Delete
*
[226] Fix | Delete
* nd_family corresponds to the firmware (e.g. DSM) interface.
[227] Fix | Delete
*
[228] Fix | Delete
* nd_command are the function index advertised by the firmware.
[229] Fix | Delete
*
[230] Fix | Delete
* nd_size_in is the size of the input parameters being passed to firmware
[231] Fix | Delete
*
[232] Fix | Delete
* OUTPUT PARAMETERS
[233] Fix | Delete
*
[234] Fix | Delete
* nd_fw_size is the size of the data firmware wants to return for
[235] Fix | Delete
* the call. If nd_fw_size is greater than size of nd_size_out, only
[236] Fix | Delete
* the first nd_size_out bytes are returned.
[237] Fix | Delete
*/
[238] Fix | Delete
[239] Fix | Delete
struct nd_cmd_pkg {
[240] Fix | Delete
__u64 nd_family; /* family of commands */
[241] Fix | Delete
__u64 nd_command;
[242] Fix | Delete
__u32 nd_size_in; /* INPUT: size of input args */
[243] Fix | Delete
__u32 nd_size_out; /* INPUT: size of payload */
[244] Fix | Delete
__u32 nd_reserved2[9]; /* reserved must be zero */
[245] Fix | Delete
__u32 nd_fw_size; /* OUTPUT: size fw wants to return */
[246] Fix | Delete
unsigned char nd_payload[]; /* Contents of call */
[247] Fix | Delete
};
[248] Fix | Delete
[249] Fix | Delete
/* These NVDIMM families represent pre-standardization command sets */
[250] Fix | Delete
#define NVDIMM_FAMILY_INTEL 0
[251] Fix | Delete
#define NVDIMM_FAMILY_HPE1 1
[252] Fix | Delete
#define NVDIMM_FAMILY_HPE2 2
[253] Fix | Delete
#define NVDIMM_FAMILY_MSFT 3
[254] Fix | Delete
#define NVDIMM_FAMILY_HYPERV 4
[255] Fix | Delete
#define NVDIMM_FAMILY_PAPR 5
[256] Fix | Delete
[257] Fix | Delete
#define ND_IOCTL_CALL _IOWR(ND_IOCTL, ND_CMD_CALL,\
[258] Fix | Delete
struct nd_cmd_pkg)
[259] Fix | Delete
[260] Fix | Delete
#endif /* __NDCTL_H__ */
[261] Fix | Delete
[262] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function