Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 1 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 12 | #ifndef _ASM_S390_VTOC_H |
| 13 | #define _ASM_S390_VTOC_H |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #include <linux/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 17 | struct vtoc_ttr |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 19 | __u16 tt; |
| 20 | __u8 r; |
| 21 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 23 | struct vtoc_cchhb |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 25 | __u16 cc; |
| 26 | __u16 hh; |
| 27 | __u8 b; |
| 28 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 30 | struct vtoc_cchh |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 32 | __u16 cc; |
| 33 | __u16 hh; |
| 34 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 36 | struct vtoc_labeldate |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 38 | __u8 year; |
| 39 | __u16 day; |
| 40 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Stefan Weinhuber | b44b0ab3 | 2009-03-26 15:23:47 +0100 | [diff] [blame] | 42 | struct vtoc_volume_label_cdl |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 44 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
Stefan Weinhuber | b44b0ab3 | 2009-03-26 15:23:47 +0100 | [diff] [blame] | 59 | struct vtoc_volume_label_ldl { |
| 60 | char vollbl[4]; /* volume label */ |
| 61 | char volid[6]; /* volume identifier */ |
| 62 | char res3[69]; /* reserved */ |
| 63 | char ldl_version; /* version number, valid for ldl format */ |
| 64 | __u64 formatted_blocks; /* valid when ldl_version >= f2 */ |
| 65 | } __attribute__ ((packed)); |
| 66 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 67 | struct vtoc_extent |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 69 | __u8 typeind; /* extent type indicator */ |
| 70 | __u8 seqno; /* extent sequence number */ |
| 71 | struct vtoc_cchh llimit; /* starting point of this extent */ |
| 72 | struct vtoc_cchh ulimit; /* ending point of this extent */ |
| 73 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 75 | struct vtoc_dev_const |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 77 | __u16 DS4DSCYL; /* number of logical cyls */ |
| 78 | __u16 DS4DSTRK; /* number of tracks in a logical cylinder */ |
| 79 | __u16 DS4DEVTK; /* device track length */ |
| 80 | __u8 DS4DEVI; /* non-last keyed record overhead */ |
| 81 | __u8 DS4DEVL; /* last keyed record overhead */ |
| 82 | __u8 DS4DEVK; /* non-keyed record overhead differential */ |
| 83 | __u8 DS4DEVFG; /* flag byte */ |
| 84 | __u16 DS4DEVTL; /* device tolerance */ |
| 85 | __u8 DS4DEVDT; /* number of DSCB's per track */ |
| 86 | __u8 DS4DEVDB; /* number of directory blocks per track */ |
| 87 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 89 | struct vtoc_format1_label |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 91 | char DS1DSNAM[44]; /* data set name */ |
| 92 | __u8 DS1FMTID; /* format identifier */ |
| 93 | char DS1DSSN[6]; /* data set serial number */ |
| 94 | __u16 DS1VOLSQ; /* volume sequence number */ |
| 95 | struct vtoc_labeldate DS1CREDT; /* creation date: ydd */ |
| 96 | struct vtoc_labeldate DS1EXPDT; /* expiration date */ |
| 97 | __u8 DS1NOEPV; /* number of extents on volume */ |
| 98 | __u8 DS1NOBDB; /* no. of bytes used in last direction blk */ |
| 99 | __u8 DS1FLAG1; /* flag 1 */ |
| 100 | char DS1SYSCD[13]; /* system code */ |
| 101 | struct vtoc_labeldate DS1REFD; /* date last referenced */ |
| 102 | __u8 DS1SMSFG; /* system managed storage indicators */ |
| 103 | __u8 DS1SCXTF; /* sec. space extension flag byte */ |
| 104 | __u16 DS1SCXTV; /* secondary space extension value */ |
| 105 | __u8 DS1DSRG1; /* data set organisation byte 1 */ |
| 106 | __u8 DS1DSRG2; /* data set organisation byte 2 */ |
| 107 | __u8 DS1RECFM; /* record format */ |
| 108 | __u8 DS1OPTCD; /* option code */ |
| 109 | __u16 DS1BLKL; /* block length */ |
| 110 | __u16 DS1LRECL; /* record length */ |
| 111 | __u8 DS1KEYL; /* key length */ |
| 112 | __u16 DS1RKP; /* relative key position */ |
| 113 | __u8 DS1DSIND; /* data set indicators */ |
| 114 | __u8 DS1SCAL1; /* secondary allocation flag byte */ |
| 115 | char DS1SCAL3[3]; /* secondary allocation quantity */ |
| 116 | struct vtoc_ttr DS1LSTAR; /* last used track and block on track */ |
| 117 | __u16 DS1TRBAL; /* space remaining on last used track */ |
| 118 | __u16 res1; /* reserved */ |
| 119 | struct vtoc_extent DS1EXT1; /* first extent description */ |
| 120 | struct vtoc_extent DS1EXT2; /* second extent description */ |
| 121 | struct vtoc_extent DS1EXT3; /* third extent description */ |
| 122 | struct vtoc_cchhb DS1PTRDS; /* possible pointer to f2 or f3 DSCB */ |
| 123 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 125 | struct vtoc_format4_label |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 127 | char DS4KEYCD[44]; /* key code for VTOC labels: 44 times 0x04 */ |
| 128 | __u8 DS4IDFMT; /* format identifier */ |
| 129 | struct vtoc_cchhb DS4HPCHR; /* highest address of a format 1 DSCB */ |
| 130 | __u16 DS4DSREC; /* number of available DSCB's */ |
| 131 | struct vtoc_cchh DS4HCCHH; /* CCHH of next available alternate track */ |
| 132 | __u16 DS4NOATK; /* number of remaining alternate tracks */ |
| 133 | __u8 DS4VTOCI; /* VTOC indicators */ |
| 134 | __u8 DS4NOEXT; /* number of extents in VTOC */ |
| 135 | __u8 DS4SMSFG; /* system managed storage indicators */ |
| 136 | __u8 DS4DEVAC; /* number of alternate cylinders. |
| 137 | * Subtract from first two bytes of |
| 138 | * DS4DEVSZ to get number of usable |
| 139 | * cylinders. can be zero. valid |
| 140 | * only if DS4DEVAV on. */ |
| 141 | struct vtoc_dev_const DS4DEVCT; /* device constants */ |
| 142 | char DS4AMTIM[8]; /* VSAM time stamp */ |
| 143 | char DS4AMCAT[3]; /* VSAM catalog indicator */ |
| 144 | char DS4R2TIM[8]; /* VSAM volume/catalog match time stamp */ |
| 145 | char res1[5]; /* reserved */ |
| 146 | char DS4F6PTR[5]; /* pointer to first format 6 DSCB */ |
| 147 | struct vtoc_extent DS4VTOCE; /* VTOC extent description */ |
| 148 | char res2[10]; /* reserved */ |
| 149 | __u8 DS4EFLVL; /* extended free-space management level */ |
| 150 | struct vtoc_cchhb DS4EFPTR; /* pointer to extended free-space info */ |
Stefan Weinhuber | b44b0ab3 | 2009-03-26 15:23:47 +0100 | [diff] [blame] | 151 | char res3; /* reserved */ |
| 152 | __u32 DS4DCYL; /* number of logical cyls */ |
| 153 | char res4[2]; /* reserved */ |
| 154 | __u8 DS4DEVF2; /* device flags */ |
| 155 | char res5; /* reserved */ |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 156 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 158 | struct vtoc_ds5ext |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 160 | __u16 t; /* RTA of the first track of free extent */ |
| 161 | __u16 fc; /* number of whole cylinders in free ext. */ |
| 162 | __u8 ft; /* number of remaining free tracks */ |
| 163 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 164 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 165 | struct vtoc_format5_label |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 167 | char DS5KEYID[4]; /* key identifier */ |
| 168 | struct vtoc_ds5ext DS5AVEXT; /* first available (free-space) extent. */ |
| 169 | struct vtoc_ds5ext DS5EXTAV[7]; /* seven available extents */ |
| 170 | __u8 DS5FMTID; /* format identifier */ |
| 171 | struct vtoc_ds5ext DS5MAVET[18]; /* eighteen available extents */ |
| 172 | struct vtoc_cchhb DS5PTRDS; /* pointer to next format5 DSCB */ |
| 173 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 174 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 175 | struct vtoc_ds7ext |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 176 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 177 | __u32 a; /* starting RTA value */ |
| 178 | __u32 b; /* ending RTA value + 1 */ |
| 179 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 180 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 181 | struct vtoc_format7_label |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 182 | { |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 183 | char DS7KEYID[4]; /* key identifier */ |
| 184 | struct vtoc_ds7ext DS7EXTNT[5]; /* space for 5 extent descriptions */ |
| 185 | __u8 DS7FMTID; /* format identifier */ |
| 186 | struct vtoc_ds7ext DS7ADEXT[11]; /* space for 11 extent descriptions */ |
| 187 | char res1[2]; /* reserved */ |
| 188 | struct vtoc_cchhb DS7PTRDS; /* pointer to next FMT7 DSCB */ |
| 189 | } __attribute__ ((packed)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | |
Peter Oberparleiter | 56dc6a8 | 2006-01-06 00:19:09 -0800 | [diff] [blame] | 191 | struct vtoc_cms_label { |
David Woodhouse | 56b192c | 2006-05-04 01:18:33 +0100 | [diff] [blame] | 192 | __u8 label_id[4]; /* Label identifier */ |
| 193 | __u8 vol_id[6]; /* Volid */ |
| 194 | __u16 version_id; /* Version identifier */ |
| 195 | __u32 block_size; /* Disk block size */ |
| 196 | __u32 origin_ptr; /* Disk origin pointer */ |
| 197 | __u32 usable_count; /* Number of usable cylinders/blocks */ |
| 198 | __u32 formatted_count; /* Maximum number of formatted cylinders/ |
Peter Oberparleiter | 56dc6a8 | 2006-01-06 00:19:09 -0800 | [diff] [blame] | 199 | * blocks */ |
David Woodhouse | 56b192c | 2006-05-04 01:18:33 +0100 | [diff] [blame] | 200 | __u32 block_count; /* Disk size in CMS blocks */ |
| 201 | __u32 used_count; /* Number of CMS blocks in use */ |
| 202 | __u32 fst_size; /* File Status Table (FST) size */ |
| 203 | __u32 fst_count; /* Number of FSTs per CMS block */ |
| 204 | __u8 format_date[6]; /* Disk FORMAT date */ |
| 205 | __u8 reserved1[2]; |
| 206 | __u32 disk_offset; /* Disk offset when reserved*/ |
| 207 | __u32 map_block; /* Allocation Map Block with next hole */ |
| 208 | __u32 hblk_disp; /* Displacement into HBLK data of next hole */ |
| 209 | __u32 user_disp; /* Displacement into user part of Allocation |
Peter Oberparleiter | 56dc6a8 | 2006-01-06 00:19:09 -0800 | [diff] [blame] | 210 | * map */ |
David Woodhouse | 56b192c | 2006-05-04 01:18:33 +0100 | [diff] [blame] | 211 | __u8 reserved2[4]; |
| 212 | __u8 segment_name[8]; /* Name of shared segment */ |
Peter Oberparleiter | 56dc6a8 | 2006-01-06 00:19:09 -0800 | [diff] [blame] | 213 | } __attribute__ ((packed)); |
| 214 | |
Peter Oberparleiter | 4cd5b9f | 2005-11-07 00:59:09 -0800 | [diff] [blame] | 215 | #endif /* _ASM_S390_VTOC_H */ |