FreeBSD kernel pms device code
encrypt_ioctl.h
Go to the documentation of this file.
1/*******************************************************************************
2*Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
4*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5*that the following conditions are met:
6*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7*following disclaimer.
8*2. Redistributions in binary form must reproduce the above copyright notice,
9*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10*with the distribution.
12*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20*
21* $FreeBSD$
22*
23*******************************************************************************/
24/*******************************************************************************
25**
26** Version Control Information:
27**
28** $Revision: 114125 $
29** $Author: lindfors $
30** $Date: 2012-01-06 17:12:27 -0800 (Fri, 06 Jan 2012) $
31** $Id: encrypt_ioctl.h 112360 2012-01-07 01:12:27Z mcleanda $
32**
33*******************************************************************************/
34#include <linux/ioctl.h>
35
36#ifndef __ENCRYPT_IOCTL_H__
37#define __ENCRYPT_IOCTL_H__
38
48
49typedef struct IoctlEncryptGetInfo_s {
51} __attribute__ ((packed)) IoctlEncryptGetInfo_t;
52
53typedef struct IoctlEncryptSetMode_s {
55} __attribute__ ((packed)) IoctlEncryptSetMode_t;
56
57typedef struct IoctlEncryptKekAdd_s {
62} __attribute__ ((packed)) IoctlEncryptKekAdd_t;
63
64typedef struct IoctlEncryptDekAdd_s {
71} __attribute__ ((packed)) IoctlEncryptDekAdd_t;
72
75} __attribute__ ((packed)) IoctlEncryptDekInvalidate_t;
76
77typedef struct IoctlEncryptKekNVRAM_s {
79} __attribute__ ((packed)) IoctlEncryptKekNVRAM_t;
80
81typedef struct IoctlEncryptDekTable_s {
84} __attribute__ ((packed)) IoctlEncryptDekTable_t;
85
86typedef struct EncryptDekMapEntry_s {
87#define ENCRYPT_DEK_MAP_ENTRY_CLEAR 0x00000001UL
88#define ENCRYPT_DEK_MAP_ENTRY_VALID 0x80000000UL
90 unsigned long long startLBA;
91 unsigned long long endLBA;
93} __attribute__ ((packed)) EncryptDekMapEntry_t;
94
95typedef struct EncryptDeviceDekMap_s {
102 EncryptDekMapEntry_t dekMapEntry[1];
103} __attribute__ ((packed)) EncryptDeviceDekMap_t;
104
106 EncryptDeviceDekMap_t dekMap[1];
107} __attribute__ ((packed)) IoctlEncryptDekMapTable_t;
108
109typedef struct IoctlEncryptIOError_s {
124} __attribute__ ((packed)) IoctlEncryptIOError_t;
125
126typedef struct __attribute__ ((packed)) IoctlEncryptErrorQuery_s {
127#define ERROR_QUERY_FLAG_BLOCK 1
128 bit32 query_flag;
129 bit32 valid_mask;
130 IoctlEncryptIOError_t error[32];
131} __attribute__ ((packed)) IoctlEncryptErrorQuery_t;
132
133typedef union IoctlEncryptOp_u {
134 IoctlEncryptGetInfo_t encryptGetInfo;
135 IoctlEncryptSetMode_t encryptSetMode;
136 IoctlEncryptKekAdd_t encryptKekAdd;
137 IoctlEncryptDekAdd_t encryptDekAdd;
138 IoctlEncryptDekInvalidate_t encryptDekInvalidate;
139 IoctlEncryptKekNVRAM_t encryptKekNVRAM;
140 IoctlEncryptDekMapTable_t encryptDekMap;
141 IoctlEncryptErrorQuery_t encryptErrorQuery;
142} __attribute__ ((packed)) IoctlEncryptOp_t;
143
150} __attribute__ ((packed)) tiIOCTLPayloadHeader_t;
151
152typedef struct IoctlTISAEncrypt_s {
153#define encryptGetInfo 0x00000001
154#define encryptSetMode 0x00000002
155#define encryptKekAdd 0x00000003
156#define encryptDekAdd 0x00000004
157#define encryptDekInvalidate 0x00000005
158#define encryptKekStore 0x00000006
159#define encryptKekLoad 0x00000007
160#define encryptGetDekTable 0x00000008
161#define encryptSetDekMap 0x00000009
162#define encryptDekDump 0x0000000a
163#define encryptErrorQuery 0x0000000c
167 IoctlEncryptOp_t request;
168} __attribute__ ((packed)) IoctlTISAEncrypt_t;
169
170typedef struct IOCTLEncrypt_s {
171 tiIOCTLPayloadHeader_t hdr;
172 IoctlTISAEncrypt_t body;
173} __attribute__ ((packed)) IoctlEncrypt_t;
174
175#endif
struct IoctlEncryptGetInfo_s __attribute__((packed)) IoctlEncryptGetInfo_t
unsigned short bit16
Definition: ostypes.h:98
unsigned long long bit64
Definition: ostypes.h:104
unsigned int bit32
Definition: ostypes.h:99
unsigned long long startLBA
Definition: encrypt_ioctl.h:90
unsigned long long endLBA
Definition: encrypt_ioctl.h:91
tiEncryptDek_t dek
Definition: encrypt_ioctl.h:92
EncryptDekMapEntry_t dekMapEntry[1]
tiIOCTLPayloadHeader_t hdr
IoctlTISAEncrypt_t body
tiEncryptDekBlob_t * dekBlob
Definition: encrypt_ioctl.h:70
EncryptDeviceDekMap_t dekMap[1]
tiEncryptInfo_t tisaEncryptInfo
Definition: encrypt_ioctl.h:50
tiEncryptKekBlob_t * EncryptKekBlob
Definition: encrypt_ioctl.h:61
IoctlEncryptOp_t request
Definition: titypes.h:67
IoctlEncryptDekMapTable_t encryptDekMap
IoctlEncryptDekInvalidate_t encryptDekInvalidate
IoctlEncryptErrorQuery_t encryptErrorQuery
IoctlEncryptKekAdd_t encryptKekAdd
IoctlEncryptSetMode_t encryptSetMode
IoctlEncryptGetInfo_t encryptGetInfo
IoctlEncryptKekNVRAM_t encryptKekNVRAM
IoctlEncryptDekAdd_t encryptDekAdd