xref: /dragonfly/sys/dev/disk/nvme/nvme_ns.h (revision 97a077a0)
1*97a077a0SMatthew Dillon /*
2*97a077a0SMatthew Dillon  * Copyright (c) 2016 The DragonFly Project.  All rights reserved.
3*97a077a0SMatthew Dillon  *
4*97a077a0SMatthew Dillon  * This code is derived from software contributed to The DragonFly Project
5*97a077a0SMatthew Dillon  * by Matthew Dillon <dillon@backplane.com>
6*97a077a0SMatthew Dillon  *
7*97a077a0SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
8*97a077a0SMatthew Dillon  * modification, are permitted provided that the following conditions
9*97a077a0SMatthew Dillon  * are met:
10*97a077a0SMatthew Dillon  *
11*97a077a0SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
12*97a077a0SMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
13*97a077a0SMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
14*97a077a0SMatthew Dillon  *    notice, this list of conditions and the following disclaimer in
15*97a077a0SMatthew Dillon  *    the documentation and/or other materials provided with the
16*97a077a0SMatthew Dillon  *    distribution.
17*97a077a0SMatthew Dillon  * 3. Neither the name of The DragonFly Project nor the names of its
18*97a077a0SMatthew Dillon  *    contributors may be used to endorse or promote products derived
19*97a077a0SMatthew Dillon  *    from this software without specific, prior written permission.
20*97a077a0SMatthew Dillon  *
21*97a077a0SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22*97a077a0SMatthew Dillon  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23*97a077a0SMatthew Dillon  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24*97a077a0SMatthew Dillon  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
25*97a077a0SMatthew Dillon  * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26*97a077a0SMatthew Dillon  * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27*97a077a0SMatthew Dillon  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28*97a077a0SMatthew Dillon  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29*97a077a0SMatthew Dillon  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30*97a077a0SMatthew Dillon  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31*97a077a0SMatthew Dillon  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32*97a077a0SMatthew Dillon  * SUCH DAMAGE.
33*97a077a0SMatthew Dillon  */
34*97a077a0SMatthew Dillon 
35*97a077a0SMatthew Dillon /*
36*97a077a0SMatthew Dillon  * Namespace Management data structure for create
37*97a077a0SMatthew Dillon  *
38*97a077a0SMatthew Dillon  * driver must set all reserved fields to 0.  Driver only specifies
39*97a077a0SMatthew Dillon  * initial fields through offset 384, all remaining fields must be 0.
40*97a077a0SMatthew Dillon  */
41*97a077a0SMatthew Dillon typedef struct {
42*97a077a0SMatthew Dillon 	uint64_t	ns_size;
43*97a077a0SMatthew Dillon 	uint64_t	ns_capacity;
44*97a077a0SMatthew Dillon 	uint8_t		reserved16[10];
45*97a077a0SMatthew Dillon 	uint8_t		sect_size;		/* 1 << n ? */
46*97a077a0SMatthew Dillon 	uint8_t		reserved27;
47*97a077a0SMatthew Dillon 	uint8_t		reserved28;
48*97a077a0SMatthew Dillon 	uint8_t		dps;			/* data-prot type settings */
49*97a077a0SMatthew Dillon 	uint8_t		nmic;			/* ns sharing caps */
50*97a077a0SMatthew Dillon 	uint8_t		reserved31[353];
51*97a077a0SMatthew Dillon 	uint8_t		reserved384[640];
52*97a077a0SMatthew Dillon 	uint8_t		vendor[3072];
53*97a077a0SMatthew Dillon } __packed nvme_nsmgmt_create_data_t;
54