blob: 37edf6e917151d298a911a249fb4ee5dca90a7f7 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * File...........: linux/drivers/s390/block/dasd_diag.h
3 * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
4 * Based on.......: linux/drivers/s390/block/mdisk.h
5 * ...............: by Hartmunt Penner <hpenner@de.ibm.com>
6 * Bugreports.to..: <Linux390@de.ibm.com>
7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
8 *
Peter Oberparleiter56dc6a82006-01-06 00:19:09 -08009 * $Revision: 1.9 $
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 */
11
12#define MDSK_WRITE_REQ 0x01
13#define MDSK_READ_REQ 0x02
14
15#define INIT_BIO 0x00
16#define RW_BIO 0x01
17#define TERM_BIO 0x02
18
19#define DEV_CLASS_FBA 0x01
20#define DEV_CLASS_ECKD 0x04
21
Horst Hummelfd49f412005-09-03 15:58:00 -070022#define DASD_DIAG_LC_INT_CODE 132
23#define DASD_DIAG_LC_INT_STATUS 133
24#define DASD_DIAG_LC_INT_PARM_31BIT 128
25#define DASD_DIAG_LC_INT_PARM_64BIT 4536
26#define DASD_DIAG_CODE_31BIT 0x03
27#define DASD_DIAG_CODE_64BIT 0x07
28
29#define DASD_DIAG_RWFLAG_ASYNC 0x02
30#define DASD_DIAG_RWFLAG_NOCACHE 0x01
31
32#define DASD_DIAG_FLAGA_FORMAT_64BIT 0x80
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034struct dasd_diag_characteristics {
35 u16 dev_nr;
36 u16 rdc_len;
37 u8 vdev_class;
38 u8 vdev_type;
39 u8 vdev_status;
40 u8 vdev_flags;
41 u8 rdev_class;
42 u8 rdev_type;
43 u8 rdev_model;
44 u8 rdev_features;
45} __attribute__ ((packed, aligned(4)));
46
Horst Hummelfd49f412005-09-03 15:58:00 -070047
48#ifdef CONFIG_ARCH_S390X
49#define DASD_DIAG_FLAGA_DEFAULT DASD_DIAG_FLAGA_FORMAT_64BIT
50
51typedef u64 blocknum_t;
52typedef s64 sblocknum_t;
53
54struct dasd_diag_bio {
55 u8 type;
56 u8 status;
57 u8 spare1[2];
58 u32 alet;
59 blocknum_t block_number;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080060 void *buffer;
Horst Hummelfd49f412005-09-03 15:58:00 -070061} __attribute__ ((packed, aligned(8)));
62
63struct dasd_diag_init_io {
64 u16 dev_nr;
65 u8 flaga;
66 u8 spare1[21];
67 u32 block_size;
68 u8 spare2[4];
69 blocknum_t offset;
70 sblocknum_t start_block;
71 blocknum_t end_block;
72 u8 spare3[8];
73} __attribute__ ((packed, aligned(8)));
74
75struct dasd_diag_rw_io {
76 u16 dev_nr;
77 u8 flaga;
78 u8 spare1[21];
79 u8 key;
80 u8 flags;
81 u8 spare2[2];
82 u32 block_count;
83 u32 alet;
84 u8 spare3[4];
85 u64 interrupt_params;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080086 struct dasd_diag_bio *bio_list;
Horst Hummelfd49f412005-09-03 15:58:00 -070087 u8 spare4[8];
88} __attribute__ ((packed, aligned(8)));
89#else /* CONFIG_ARCH_S390X */
90#define DASD_DIAG_FLAGA_DEFAULT 0x0
91
92typedef u32 blocknum_t;
93typedef s32 sblocknum_t;
94
Linus Torvalds1da177e2005-04-16 15:20:36 -070095struct dasd_diag_bio {
96 u8 type;
97 u8 status;
98 u16 spare1;
Horst Hummelfd49f412005-09-03 15:58:00 -070099 blocknum_t block_number;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100 u32 alet;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -0800101 void *buffer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102} __attribute__ ((packed, aligned(8)));
103
104struct dasd_diag_init_io {
105 u16 dev_nr;
Horst Hummelfd49f412005-09-03 15:58:00 -0700106 u8 flaga;
107 u8 spare1[21];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108 u32 block_size;
Horst Hummelfd49f412005-09-03 15:58:00 -0700109 blocknum_t offset;
110 sblocknum_t start_block;
111 blocknum_t end_block;
112 u8 spare2[24];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113} __attribute__ ((packed, aligned(8)));
114
115struct dasd_diag_rw_io {
116 u16 dev_nr;
Horst Hummelfd49f412005-09-03 15:58:00 -0700117 u8 flaga;
118 u8 spare1[21];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 u8 key;
120 u8 flags;
Horst Hummelfd49f412005-09-03 15:58:00 -0700121 u8 spare2[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 u32 block_count;
123 u32 alet;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -0800124 struct dasd_diag_bio *bio_list;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 u32 interrupt_params;
Horst Hummelfd49f412005-09-03 15:58:00 -0700126 u8 spare3[20];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127} __attribute__ ((packed, aligned(8)));
Horst Hummelfd49f412005-09-03 15:58:00 -0700128#endif /* CONFIG_ARCH_S390X */