diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-08-01 14:42:05 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-08-01 14:42:05 -0400 |
commit | c6557e7f2b6ae76a44653d38f835174074c42e05 (patch) | |
tree | da619a76b309cb1cd259d082af768a83cfcd6d52 /arch/s390/include/asm/tape390.h | |
parent | ab4227cb2d936886069ef1056c02500d05beb15d (diff) |
[S390] move include/asm-s390 to arch/s390/include/asm
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/tape390.h')
-rw-r--r-- | arch/s390/include/asm/tape390.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/arch/s390/include/asm/tape390.h b/arch/s390/include/asm/tape390.h new file mode 100644 index 000000000000..884fba48f1ff --- /dev/null +++ b/arch/s390/include/asm/tape390.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /************************************************************************* | ||
2 | * | ||
3 | * tape390.h | ||
4 | * enables user programs to display messages and control encryption | ||
5 | * on s390 tape devices | ||
6 | * | ||
7 | * Copyright IBM Corp. 2001,2006 | ||
8 | * Author(s): Michael Holzheu <holzheu@de.ibm.com> | ||
9 | * | ||
10 | *************************************************************************/ | ||
11 | |||
12 | #ifndef _TAPE390_H | ||
13 | #define _TAPE390_H | ||
14 | |||
15 | #define TAPE390_DISPLAY _IOW('d', 1, struct display_struct) | ||
16 | |||
17 | /* | ||
18 | * The TAPE390_DISPLAY ioctl calls the Load Display command | ||
19 | * which transfers 17 bytes of data from the channel to the subsystem: | ||
20 | * - 1 format control byte, and | ||
21 | * - two 8-byte messages | ||
22 | * | ||
23 | * Format control byte: | ||
24 | * 0-2: New Message Overlay | ||
25 | * 3: Alternate Messages | ||
26 | * 4: Blink Message | ||
27 | * 5: Display Low/High Message | ||
28 | * 6: Reserved | ||
29 | * 7: Automatic Load Request | ||
30 | * | ||
31 | */ | ||
32 | |||
33 | typedef struct display_struct { | ||
34 | char cntrl; | ||
35 | char message1[8]; | ||
36 | char message2[8]; | ||
37 | } display_struct; | ||
38 | |||
39 | /* | ||
40 | * Tape encryption support | ||
41 | */ | ||
42 | |||
43 | struct tape390_crypt_info { | ||
44 | char capability; | ||
45 | char status; | ||
46 | char medium_status; | ||
47 | } __attribute__ ((packed)); | ||
48 | |||
49 | |||
50 | /* Macros for "capable" field */ | ||
51 | #define TAPE390_CRYPT_SUPPORTED_MASK 0x01 | ||
52 | #define TAPE390_CRYPT_SUPPORTED(x) \ | ||
53 | ((x.capability & TAPE390_CRYPT_SUPPORTED_MASK)) | ||
54 | |||
55 | /* Macros for "status" field */ | ||
56 | #define TAPE390_CRYPT_ON_MASK 0x01 | ||
57 | #define TAPE390_CRYPT_ON(x) (((x.status) & TAPE390_CRYPT_ON_MASK)) | ||
58 | |||
59 | /* Macros for "medium status" field */ | ||
60 | #define TAPE390_MEDIUM_LOADED_MASK 0x01 | ||
61 | #define TAPE390_MEDIUM_ENCRYPTED_MASK 0x02 | ||
62 | #define TAPE390_MEDIUM_ENCRYPTED(x) \ | ||
63 | (((x.medium_status) & TAPE390_MEDIUM_ENCRYPTED_MASK)) | ||
64 | #define TAPE390_MEDIUM_LOADED(x) \ | ||
65 | (((x.medium_status) & TAPE390_MEDIUM_LOADED_MASK)) | ||
66 | |||
67 | /* | ||
68 | * The TAPE390_CRYPT_SET ioctl is used to switch on/off encryption. | ||
69 | * The "encryption_capable" and "tape_status" fields are ignored for this ioctl! | ||
70 | */ | ||
71 | #define TAPE390_CRYPT_SET _IOW('d', 2, struct tape390_crypt_info) | ||
72 | |||
73 | /* | ||
74 | * The TAPE390_CRYPT_QUERY ioctl is used to query the encryption state. | ||
75 | */ | ||
76 | #define TAPE390_CRYPT_QUERY _IOR('d', 3, struct tape390_crypt_info) | ||
77 | |||
78 | /* Values for "kekl1/2_type" and "kekl1/2_type_on_tape" fields */ | ||
79 | #define TAPE390_KEKL_TYPE_NONE 0 | ||
80 | #define TAPE390_KEKL_TYPE_LABEL 1 | ||
81 | #define TAPE390_KEKL_TYPE_HASH 2 | ||
82 | |||
83 | struct tape390_kekl { | ||
84 | unsigned char type; | ||
85 | unsigned char type_on_tape; | ||
86 | char label[65]; | ||
87 | } __attribute__ ((packed)); | ||
88 | |||
89 | struct tape390_kekl_pair { | ||
90 | struct tape390_kekl kekl[2]; | ||
91 | } __attribute__ ((packed)); | ||
92 | |||
93 | /* | ||
94 | * The TAPE390_KEKL_SET ioctl is used to set Key Encrypting Key labels. | ||
95 | */ | ||
96 | #define TAPE390_KEKL_SET _IOW('d', 4, struct tape390_kekl_pair) | ||
97 | |||
98 | /* | ||
99 | * The TAPE390_KEKL_QUERY ioctl is used to query Key Encrypting Key labels. | ||
100 | */ | ||
101 | #define TAPE390_KEKL_QUERY _IOR('d', 5, struct tape390_kekl_pair) | ||
102 | |||
103 | #endif | ||