Horst Hummel | 138c014 | 2006-06-29 14:58:12 +0200 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | */ |
| 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 Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 21 | #define DASD_DIAG_LC_INT_CODE 132 |
| 22 | #define DASD_DIAG_LC_INT_STATUS 133 |
| 23 | #define DASD_DIAG_LC_INT_PARM_31BIT 128 |
| 24 | #define DASD_DIAG_LC_INT_PARM_64BIT 4536 |
| 25 | #define DASD_DIAG_CODE_31BIT 0x03 |
| 26 | #define DASD_DIAG_CODE_64BIT 0x07 |
| 27 | |
| 28 | #define DASD_DIAG_RWFLAG_ASYNC 0x02 |
| 29 | #define DASD_DIAG_RWFLAG_NOCACHE 0x01 |
| 30 | |
| 31 | #define DASD_DIAG_FLAGA_FORMAT_64BIT 0x80 |
| 32 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | struct dasd_diag_characteristics { |
| 34 | u16 dev_nr; |
| 35 | u16 rdc_len; |
| 36 | u8 vdev_class; |
| 37 | u8 vdev_type; |
| 38 | u8 vdev_status; |
| 39 | u8 vdev_flags; |
| 40 | u8 rdev_class; |
| 41 | u8 rdev_type; |
| 42 | u8 rdev_model; |
| 43 | u8 rdev_features; |
| 44 | } __attribute__ ((packed, aligned(4))); |
| 45 | |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 46 | |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 47 | #ifdef CONFIG_64BIT |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 48 | #define DASD_DIAG_FLAGA_DEFAULT DASD_DIAG_FLAGA_FORMAT_64BIT |
| 49 | |
| 50 | typedef u64 blocknum_t; |
| 51 | typedef s64 sblocknum_t; |
| 52 | |
| 53 | struct dasd_diag_bio { |
| 54 | u8 type; |
| 55 | u8 status; |
| 56 | u8 spare1[2]; |
| 57 | u32 alet; |
| 58 | blocknum_t block_number; |
Peter Oberparleiter | 86b368a | 2005-11-07 00:59:08 -0800 | [diff] [blame] | 59 | void *buffer; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 60 | } __attribute__ ((packed, aligned(8))); |
| 61 | |
| 62 | struct dasd_diag_init_io { |
| 63 | u16 dev_nr; |
| 64 | u8 flaga; |
| 65 | u8 spare1[21]; |
| 66 | u32 block_size; |
| 67 | u8 spare2[4]; |
| 68 | blocknum_t offset; |
| 69 | sblocknum_t start_block; |
| 70 | blocknum_t end_block; |
| 71 | u8 spare3[8]; |
| 72 | } __attribute__ ((packed, aligned(8))); |
| 73 | |
| 74 | struct dasd_diag_rw_io { |
| 75 | u16 dev_nr; |
| 76 | u8 flaga; |
| 77 | u8 spare1[21]; |
| 78 | u8 key; |
| 79 | u8 flags; |
| 80 | u8 spare2[2]; |
| 81 | u32 block_count; |
| 82 | u32 alet; |
| 83 | u8 spare3[4]; |
| 84 | u64 interrupt_params; |
Peter Oberparleiter | 86b368a | 2005-11-07 00:59:08 -0800 | [diff] [blame] | 85 | struct dasd_diag_bio *bio_list; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 86 | u8 spare4[8]; |
| 87 | } __attribute__ ((packed, aligned(8))); |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 88 | #else /* CONFIG_64BIT */ |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 89 | #define DASD_DIAG_FLAGA_DEFAULT 0x0 |
| 90 | |
| 91 | typedef u32 blocknum_t; |
| 92 | typedef s32 sblocknum_t; |
| 93 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | struct dasd_diag_bio { |
| 95 | u8 type; |
| 96 | u8 status; |
| 97 | u16 spare1; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 98 | blocknum_t block_number; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | u32 alet; |
Peter Oberparleiter | 86b368a | 2005-11-07 00:59:08 -0800 | [diff] [blame] | 100 | void *buffer; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | } __attribute__ ((packed, aligned(8))); |
| 102 | |
| 103 | struct dasd_diag_init_io { |
| 104 | u16 dev_nr; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 105 | u8 flaga; |
| 106 | u8 spare1[21]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | u32 block_size; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 108 | blocknum_t offset; |
| 109 | sblocknum_t start_block; |
| 110 | blocknum_t end_block; |
| 111 | u8 spare2[24]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | } __attribute__ ((packed, aligned(8))); |
| 113 | |
| 114 | struct dasd_diag_rw_io { |
| 115 | u16 dev_nr; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 116 | u8 flaga; |
| 117 | u8 spare1[21]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | u8 key; |
| 119 | u8 flags; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 120 | u8 spare2[2]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 121 | u32 block_count; |
| 122 | u32 alet; |
Peter Oberparleiter | 86b368a | 2005-11-07 00:59:08 -0800 | [diff] [blame] | 123 | struct dasd_diag_bio *bio_list; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | u32 interrupt_params; |
Horst Hummel | fd49f41 | 2005-09-03 15:58:00 -0700 | [diff] [blame] | 125 | u8 spare3[20]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | } __attribute__ ((packed, aligned(8))); |
Martin Schwidefsky | 347a8dc | 2006-01-06 00:19:28 -0800 | [diff] [blame] | 127 | #endif /* CONFIG_64BIT */ |