Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / arch / s390 / include / asm / tape390.h
blobb2bc4bab79294210328534624946525c2c6f1b03
1 /*************************************************************************
3 * enables user programs to display messages and control encryption
4 * on s390 tape devices
6 * Copyright IBM Corp. 2001, 2006
7 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
9 *************************************************************************/
11 #ifndef _TAPE390_H
12 #define _TAPE390_H
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
25 * 4: Blink Message
26 * 5: Display Low/High Message
27 * 6: Reserved
28 * 7: Automatic Load Request
32 typedef struct display_struct {
33 char cntrl;
34 char message1[8];
35 char message2[8];
36 } display_struct;
39 * Tape encryption support
42 struct tape390_crypt_info {
43 char capability;
44 char status;
45 char medium_status;
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
82 struct tape390_kekl {
83 unsigned char type;
84 unsigned char type_on_tape;
85 char label[65];
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)
102 #endif