blob: d1de5b7ebb0b45aeb9bd83d29ed59f04ee675f3b [file] [log] [blame]
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -08001/*
2 * include/asm-s390/vtoc.h
3 *
4 * This file contains volume label definitions for DASD devices.
5 *
6 * (C) Copyright IBM Corp. 2005
7 *
8 * Author(s): Volker Sameske <sameske@de.ibm.com>
9 *
10 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080012#ifndef _ASM_S390_VTOC_H
13#define _ASM_S390_VTOC_H
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <linux/types.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080017struct vtoc_ttr
Linus Torvalds1da177e2005-04-16 15:20:36 -070018{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080019 __u16 tt;
20 __u8 r;
21} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080023struct vtoc_cchhb
Linus Torvalds1da177e2005-04-16 15:20:36 -070024{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080025 __u16 cc;
26 __u16 hh;
27 __u8 b;
28} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080030struct vtoc_cchh
Linus Torvalds1da177e2005-04-16 15:20:36 -070031{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080032 __u16 cc;
33 __u16 hh;
34} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080036struct vtoc_labeldate
Linus Torvalds1da177e2005-04-16 15:20:36 -070037{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080038 __u8 year;
39 __u16 day;
40} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080042struct vtoc_volume_label
Linus Torvalds1da177e2005-04-16 15:20:36 -070043{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080044 char volkey[4]; /* volume key = volume label */
45 char vollbl[4]; /* volume label */
46 char volid[6]; /* volume identifier */
47 __u8 security; /* security byte */
48 struct vtoc_cchhb vtoc; /* VTOC address */
49 char res1[5]; /* reserved */
50 char cisize[4]; /* CI-size for FBA,... */
51 /* ...blanks for CKD */
52 char blkperci[4]; /* no of blocks per CI (FBA), blanks for CKD */
53 char labperci[4]; /* no of labels per CI (FBA), blanks for CKD */
54 char res2[4]; /* reserved */
55 char lvtoc[14]; /* owner code for LVTOC */
56 char res3[29]; /* reserved */
57} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080059struct vtoc_extent
Linus Torvalds1da177e2005-04-16 15:20:36 -070060{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080061 __u8 typeind; /* extent type indicator */
62 __u8 seqno; /* extent sequence number */
63 struct vtoc_cchh llimit; /* starting point of this extent */
64 struct vtoc_cchh ulimit; /* ending point of this extent */
65} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080067struct vtoc_dev_const
Linus Torvalds1da177e2005-04-16 15:20:36 -070068{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080069 __u16 DS4DSCYL; /* number of logical cyls */
70 __u16 DS4DSTRK; /* number of tracks in a logical cylinder */
71 __u16 DS4DEVTK; /* device track length */
72 __u8 DS4DEVI; /* non-last keyed record overhead */
73 __u8 DS4DEVL; /* last keyed record overhead */
74 __u8 DS4DEVK; /* non-keyed record overhead differential */
75 __u8 DS4DEVFG; /* flag byte */
76 __u16 DS4DEVTL; /* device tolerance */
77 __u8 DS4DEVDT; /* number of DSCB's per track */
78 __u8 DS4DEVDB; /* number of directory blocks per track */
79} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080081struct vtoc_format1_label
Linus Torvalds1da177e2005-04-16 15:20:36 -070082{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -080083 char DS1DSNAM[44]; /* data set name */
84 __u8 DS1FMTID; /* format identifier */
85 char DS1DSSN[6]; /* data set serial number */
86 __u16 DS1VOLSQ; /* volume sequence number */
87 struct vtoc_labeldate DS1CREDT; /* creation date: ydd */
88 struct vtoc_labeldate DS1EXPDT; /* expiration date */
89 __u8 DS1NOEPV; /* number of extents on volume */
90 __u8 DS1NOBDB; /* no. of bytes used in last direction blk */
91 __u8 DS1FLAG1; /* flag 1 */
92 char DS1SYSCD[13]; /* system code */
93 struct vtoc_labeldate DS1REFD; /* date last referenced */
94 __u8 DS1SMSFG; /* system managed storage indicators */
95 __u8 DS1SCXTF; /* sec. space extension flag byte */
96 __u16 DS1SCXTV; /* secondary space extension value */
97 __u8 DS1DSRG1; /* data set organisation byte 1 */
98 __u8 DS1DSRG2; /* data set organisation byte 2 */
99 __u8 DS1RECFM; /* record format */
100 __u8 DS1OPTCD; /* option code */
101 __u16 DS1BLKL; /* block length */
102 __u16 DS1LRECL; /* record length */
103 __u8 DS1KEYL; /* key length */
104 __u16 DS1RKP; /* relative key position */
105 __u8 DS1DSIND; /* data set indicators */
106 __u8 DS1SCAL1; /* secondary allocation flag byte */
107 char DS1SCAL3[3]; /* secondary allocation quantity */
108 struct vtoc_ttr DS1LSTAR; /* last used track and block on track */
109 __u16 DS1TRBAL; /* space remaining on last used track */
110 __u16 res1; /* reserved */
111 struct vtoc_extent DS1EXT1; /* first extent description */
112 struct vtoc_extent DS1EXT2; /* second extent description */
113 struct vtoc_extent DS1EXT3; /* third extent description */
114 struct vtoc_cchhb DS1PTRDS; /* possible pointer to f2 or f3 DSCB */
115} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800117struct vtoc_format4_label
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800119 char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */
120 __u8 DS4IDFMT; /* format identifier */
121 struct vtoc_cchhb DS4HPCHR; /* highest address of a format 1 DSCB */
122 __u16 DS4DSREC; /* number of available DSCB's */
123 struct vtoc_cchh DS4HCCHH; /* CCHH of next available alternate track */
124 __u16 DS4NOATK; /* number of remaining alternate tracks */
125 __u8 DS4VTOCI; /* VTOC indicators */
126 __u8 DS4NOEXT; /* number of extents in VTOC */
127 __u8 DS4SMSFG; /* system managed storage indicators */
128 __u8 DS4DEVAC; /* number of alternate cylinders.
129 * Subtract from first two bytes of
130 * DS4DEVSZ to get number of usable
131 * cylinders. can be zero. valid
132 * only if DS4DEVAV on. */
133 struct vtoc_dev_const DS4DEVCT; /* device constants */
134 char DS4AMTIM[8]; /* VSAM time stamp */
135 char DS4AMCAT[3]; /* VSAM catalog indicator */
136 char DS4R2TIM[8]; /* VSAM volume/catalog match time stamp */
137 char res1[5]; /* reserved */
138 char DS4F6PTR[5]; /* pointer to first format 6 DSCB */
139 struct vtoc_extent DS4VTOCE; /* VTOC extent description */
140 char res2[10]; /* reserved */
141 __u8 DS4EFLVL; /* extended free-space management level */
142 struct vtoc_cchhb DS4EFPTR; /* pointer to extended free-space info */
143 char res3[9]; /* reserved */
144} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800146struct vtoc_ds5ext
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800148 __u16 t; /* RTA of the first track of free extent */
149 __u16 fc; /* number of whole cylinders in free ext. */
150 __u8 ft; /* number of remaining free tracks */
151} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800153struct vtoc_format5_label
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800155 char DS5KEYID[4]; /* key identifier */
156 struct vtoc_ds5ext DS5AVEXT; /* first available (free-space) extent. */
157 struct vtoc_ds5ext DS5EXTAV[7]; /* seven available extents */
158 __u8 DS5FMTID; /* format identifier */
159 struct vtoc_ds5ext DS5MAVET[18]; /* eighteen available extents */
160 struct vtoc_cchhb DS5PTRDS; /* pointer to next format5 DSCB */
161} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800163struct vtoc_ds7ext
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800165 __u32 a; /* starting RTA value */
166 __u32 b; /* ending RTA value + 1 */
167} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800169struct vtoc_format7_label
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170{
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800171 char DS7KEYID[4]; /* key identifier */
172 struct vtoc_ds7ext DS7EXTNT[5]; /* space for 5 extent descriptions */
173 __u8 DS7FMTID; /* format identifier */
174 struct vtoc_ds7ext DS7ADEXT[11]; /* space for 11 extent descriptions */
175 char res1[2]; /* reserved */
176 struct vtoc_cchhb DS7PTRDS; /* pointer to next FMT7 DSCB */
177} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
Peter Oberparleiter56dc6a82006-01-06 00:19:09 -0800179struct vtoc_cms_label {
180 u8 label_id[4]; /* Label identifier */
181 u8 vol_id[6]; /* Volid */
182 u16 version_id; /* Version identifier */
183 u32 block_size; /* Disk block size */
184 u32 origin_ptr; /* Disk origin pointer */
185 u32 usable_count; /* Number of usable cylinders/blocks */
186 u32 formatted_count; /* Maximum number of formatted cylinders/
187 * blocks */
188 u32 block_count; /* Disk size in CMS blocks */
189 u32 used_count; /* Number of CMS blocks in use */
190 u32 fst_size; /* File Status Table (FST) size */
191 u32 fst_count; /* Number of FSTs per CMS block */
192 u8 format_date[6]; /* Disk FORMAT date */
193 u8 reserved1[2];
194 u32 disk_offset; /* Disk offset when reserved*/
195 u32 map_block; /* Allocation Map Block with next hole */
196 u32 hblk_disp; /* Displacement into HBLK data of next hole */
197 u32 user_disp; /* Displacement into user part of Allocation
198 * map */
199 u8 reserved2[4];
200 u8 segment_name[8]; /* Name of shared segment */
201} __attribute__ ((packed));
202
Peter Oberparleiter4cd5b9f2005-11-07 00:59:09 -0800203#endif /* _ASM_S390_VTOC_H */