1 /*************************************************************************
3 * enables user programs to display messages and control encryption
6 * Copyright IBM Corp. 2001, 2006
7 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
9 *************************************************************************/
14 #define TAPE390_DISPLAY _IOW('d', 1, struct display_struct)
17 * The TAPE390_DISPLAY ioctl calls the Load Display command
18 * which transfers 17 bytes of data from the channel to the subsystem:
19 * - 1 format control byte, and
20 * - two 8-byte messages
22 * Format control byte:
23 * 0-2: New Message Overlay
24 * 3: Alternate Messages
26 * 5: Display Low/High Message
28 * 7: Automatic Load Request
32 typedef struct display_struct
{
39 * Tape encryption support
42 struct tape390_crypt_info
{
46 } __attribute__ ((packed
));
49 /* Macros for "capable" field */
50 #define TAPE390_CRYPT_SUPPORTED_MASK 0x01
51 #define TAPE390_CRYPT_SUPPORTED(x) \
52 ((x.capability & TAPE390_CRYPT_SUPPORTED_MASK))
54 /* Macros for "status" field */
55 #define TAPE390_CRYPT_ON_MASK 0x01
56 #define TAPE390_CRYPT_ON(x) (((x.status) & TAPE390_CRYPT_ON_MASK))
58 /* Macros for "medium status" field */
59 #define TAPE390_MEDIUM_LOADED_MASK 0x01
60 #define TAPE390_MEDIUM_ENCRYPTED_MASK 0x02
61 #define TAPE390_MEDIUM_ENCRYPTED(x) \
62 (((x.medium_status) & TAPE390_MEDIUM_ENCRYPTED_MASK))
63 #define TAPE390_MEDIUM_LOADED(x) \
64 (((x.medium_status) & TAPE390_MEDIUM_LOADED_MASK))
67 * The TAPE390_CRYPT_SET ioctl is used to switch on/off encryption.
68 * The "encryption_capable" and "tape_status" fields are ignored for this ioctl!
70 #define TAPE390_CRYPT_SET _IOW('d', 2, struct tape390_crypt_info)
73 * The TAPE390_CRYPT_QUERY ioctl is used to query the encryption state.
75 #define TAPE390_CRYPT_QUERY _IOR('d', 3, struct tape390_crypt_info)
77 /* Values for "kekl1/2_type" and "kekl1/2_type_on_tape" fields */
78 #define TAPE390_KEKL_TYPE_NONE 0
79 #define TAPE390_KEKL_TYPE_LABEL 1
80 #define TAPE390_KEKL_TYPE_HASH 2
84 unsigned char type_on_tape
;
86 } __attribute__ ((packed
));
88 struct tape390_kekl_pair
{
89 struct tape390_kekl kekl
[2];
90 } __attribute__ ((packed
));
93 * The TAPE390_KEKL_SET ioctl is used to set Key Encrypting Key labels.
95 #define TAPE390_KEKL_SET _IOW('d', 4, struct tape390_kekl_pair)
98 * The TAPE390_KEKL_QUERY ioctl is used to query Key Encrypting Key labels.
100 #define TAPE390_KEKL_QUERY _IOR('d', 5, struct tape390_kekl_pair)