blob: 405b6feed465c284f7c80ae1b3b144ce5f03123b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Horst Hummel138c0142006-06-29 14:58:12 +02002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * 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>
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02007 * Copyright IBM Corp. 1999, 2000
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
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#define DASD_DIAG_FLAGA_DEFAULT DASD_DIAG_FLAGA_FORMAT_64BIT
43
44typedef u64 blocknum_t;
45typedef s64 sblocknum_t;
46
47struct dasd_diag_bio {
48 u8 type;
49 u8 status;
50 u8 spare1[2];
51 u32 alet;
52 blocknum_t block_number;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080053 void *buffer;
Horst Hummelfd49f412005-09-03 15:58:00 -070054} __attribute__ ((packed, aligned(8)));
55
56struct dasd_diag_init_io {
57 u16 dev_nr;
58 u8 flaga;
59 u8 spare1[21];
60 u32 block_size;
61 u8 spare2[4];
62 blocknum_t offset;
63 sblocknum_t start_block;
64 blocknum_t end_block;
65 u8 spare3[8];
66} __attribute__ ((packed, aligned(8)));
67
68struct dasd_diag_rw_io {
69 u16 dev_nr;
70 u8 flaga;
71 u8 spare1[21];
72 u8 key;
73 u8 flags;
74 u8 spare2[2];
75 u32 block_count;
76 u32 alet;
77 u8 spare3[4];
78 u64 interrupt_params;
Peter Oberparleiter86b368a2005-11-07 00:59:08 -080079 struct dasd_diag_bio *bio_list;
Horst Hummelfd49f412005-09-03 15:58:00 -070080 u8 spare4[8];
81} __attribute__ ((packed, aligned(8)));