blob: 4f71fbe60c8294df766d783c2ace72c33ef0d50a [file] [log] [blame]
Horst Hummel138c0142006-06-29 14:58:12 +02001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * 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 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 */
10
11#define MDSK_WRITE_REQ 0x01
12#define MDSK_READ_REQ 0x02
13
14#define INIT_BIO 0x00
15#define RW_BIO 0x01
16#define TERM_BIO 0x02
17
18#define DEV_CLASS_FBA 0x01
19#define DEV_CLASS_ECKD 0x04
20
Horst Hummelfd49f412005-09-03 15:58:00 -070021#define DASD_DIAG_CODE_31BIT 0x03
22#define DASD_DIAG_CODE_64BIT 0x07
23
24#define DASD_DIAG_RWFLAG_ASYNC 0x02
25#define DASD_DIAG_RWFLAG_NOCACHE 0x01
26
27#define DASD_DIAG_FLAGA_FORMAT_64BIT 0x80
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029struct dasd_diag_characteristics {
30 u16 dev_nr;
31 u16 rdc_len;
32 u8 vdev_class;
33 u8 vdev_type;
34 u8 vdev_status;
35 u8 vdev_flags;
36 u8 rdev_class;
37 u8 rdev_type;
38 u8 rdev_model;
39 u8 rdev_features;
40} __attribute__ ((packed, aligned(4)));
41
Horst Hummelfd49f412005-09-03 15:58:00 -070042
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -080043#ifdef CONFIG_64BIT
Horst Hummelfd49f412005-09-03 15:58:00 -070044#define DASD_DIAG_FLAGA_DEFAULT DASD_DIAG_FLAGA_FORMAT_64BIT
45
46typedef u64 blocknum_t;
47typedef s64 sblocknum_t;
48
49struct dasd_diag_bio {
50 u8 type;
51 u8 status;
52 u8 spare1[2];
53 u32 alet;
54 blocknum_t block_number;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080055 void *buffer;
Horst Hummelfd49f412005-09-03 15:58:00 -070056} __attribute__ ((packed, aligned(8)));
57
58struct dasd_diag_init_io {
59 u16 dev_nr;
60 u8 flaga;
61 u8 spare1[21];
62 u32 block_size;
63 u8 spare2[4];
64 blocknum_t offset;
65 sblocknum_t start_block;
66 blocknum_t end_block;
67 u8 spare3[8];
68} __attribute__ ((packed, aligned(8)));
69
70struct dasd_diag_rw_io {
71 u16 dev_nr;
72 u8 flaga;
73 u8 spare1[21];
74 u8 key;
75 u8 flags;
76 u8 spare2[2];
77 u32 block_count;
78 u32 alet;
79 u8 spare3[4];
80 u64 interrupt_params;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080081 struct dasd_diag_bio *bio_list;
Horst Hummelfd49f412005-09-03 15:58:00 -070082 u8 spare4[8];
83} __attribute__ ((packed, aligned(8)));
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -080084#else /* CONFIG_64BIT */
Horst Hummelfd49f412005-09-03 15:58:00 -070085#define DASD_DIAG_FLAGA_DEFAULT 0x0
86
87typedef u32 blocknum_t;
88typedef s32 sblocknum_t;
89
Linus Torvalds1da177e2005-04-16 15:20:36 -070090struct dasd_diag_bio {
91 u8 type;
92 u8 status;
93 u16 spare1;
Horst Hummelfd49f412005-09-03 15:58:00 -070094 blocknum_t block_number;
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 u32 alet;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080096 void *buffer;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097} __attribute__ ((packed, aligned(8)));
98
99struct dasd_diag_init_io {
100 u16 dev_nr;
Horst Hummelfd49f412005-09-03 15:58:00 -0700101 u8 flaga;
102 u8 spare1[21];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 u32 block_size;
Horst Hummelfd49f412005-09-03 15:58:00 -0700104 blocknum_t offset;
105 sblocknum_t start_block;
106 blocknum_t end_block;
107 u8 spare2[24];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108} __attribute__ ((packed, aligned(8)));
109
110struct dasd_diag_rw_io {
111 u16 dev_nr;
Horst Hummelfd49f412005-09-03 15:58:00 -0700112 u8 flaga;
113 u8 spare1[21];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 u8 key;
115 u8 flags;
Horst Hummelfd49f412005-09-03 15:58:00 -0700116 u8 spare2[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 u32 block_count;
118 u32 alet;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -0800119 struct dasd_diag_bio *bio_list;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 u32 interrupt_params;
Horst Hummelfd49f412005-09-03 15:58:00 -0700121 u8 spare3[20];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122} __attribute__ ((packed, aligned(8)));
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -0800123#endif /* CONFIG_64BIT */