Commit fd49f41a authored by Horst Hummel's avatar Horst Hummel Committed by Linus Torvalds

[PATCH] s390: 64 bit diag250 support

Add support for diag 250 access to dasd devices for 64 bit kernels.  In
addition fix detach/attach for diag disks.  The VM control block needs to get
recreated by a call to mdsk_init_io.
Signed-off-by: default avatarHorst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c6eb7b77
...@@ -49,7 +49,7 @@ config DASD_FBA ...@@ -49,7 +49,7 @@ config DASD_FBA
config DASD_DIAG config DASD_DIAG
tristate "Support for DIAG access to Disks" tristate "Support for DIAG access to Disks"
depends on DASD && ARCH_S390X = 'n' depends on DASD && ( ARCH_S390X = 'n' || EXPERIMENTAL)
help help
Select this option if you want to use Diagnose250 command to access Select this option if you want to use Diagnose250 command to access
Disks under VM. If you are not running under VM or unsure what it is, Disks under VM. If you are not running under VM or unsure what it is,
......
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
*/ */
#define MDSK_WRITE_REQ 0x01 #define MDSK_WRITE_REQ 0x01
...@@ -19,6 +19,18 @@ ...@@ -19,6 +19,18 @@
#define DEV_CLASS_FBA 0x01 #define DEV_CLASS_FBA 0x01
#define DEV_CLASS_ECKD 0x04 #define DEV_CLASS_ECKD 0x04
#define DASD_DIAG_LC_INT_CODE 132
#define DASD_DIAG_LC_INT_STATUS 133
#define DASD_DIAG_LC_INT_PARM_31BIT 128
#define DASD_DIAG_LC_INT_PARM_64BIT 4536
#define DASD_DIAG_CODE_31BIT 0x03
#define DASD_DIAG_CODE_64BIT 0x07
#define DASD_DIAG_RWFLAG_ASYNC 0x02
#define DASD_DIAG_RWFLAG_NOCACHE 0x01
#define DASD_DIAG_FLAGA_FORMAT_64BIT 0x80
struct dasd_diag_characteristics { struct dasd_diag_characteristics {
u16 dev_nr; u16 dev_nr;
u16 rdc_len; u16 rdc_len;
...@@ -32,35 +44,106 @@ struct dasd_diag_characteristics { ...@@ -32,35 +44,106 @@ struct dasd_diag_characteristics {
u8 rdev_features; u8 rdev_features;
} __attribute__ ((packed, aligned(4))); } __attribute__ ((packed, aligned(4)));
struct dasd_diag_cms_label {
u8 label_id[4];
u8 vol_id[6];
u16 version_id;
u32 block_size;
u32 origin_ptr;
u32 usable_count;
u32 formatted_count;
u32 block_count;
u32 used_count;
u32 fst_size;
u32 fst_count;
u8 format_date[6];
u8 reserved1[2];
u32 disk_offset;
u32 map_block;
u32 hblk_disp;
u32 user_disp;
u8 reserved2[4];
u8 segment_name[8];
} __attribute__ ((packed));
#ifdef CONFIG_ARCH_S390X
#define DASD_DIAG_FLAGA_DEFAULT DASD_DIAG_FLAGA_FORMAT_64BIT
typedef u64 blocknum_t;
typedef s64 sblocknum_t;
struct dasd_diag_bio {
u8 type;
u8 status;
u8 spare1[2];
u32 alet;
blocknum_t block_number;
u64 buffer;
} __attribute__ ((packed, aligned(8)));
struct dasd_diag_init_io {
u16 dev_nr;
u8 flaga;
u8 spare1[21];
u32 block_size;
u8 spare2[4];
blocknum_t offset;
sblocknum_t start_block;
blocknum_t end_block;
u8 spare3[8];
} __attribute__ ((packed, aligned(8)));
struct dasd_diag_rw_io {
u16 dev_nr;
u8 flaga;
u8 spare1[21];
u8 key;
u8 flags;
u8 spare2[2];
u32 block_count;
u32 alet;
u8 spare3[4];
u64 interrupt_params;
u64 bio_list;
u8 spare4[8];
} __attribute__ ((packed, aligned(8)));
#else /* CONFIG_ARCH_S390X */
#define DASD_DIAG_FLAGA_DEFAULT 0x0
typedef u32 blocknum_t;
typedef s32 sblocknum_t;
struct dasd_diag_bio { struct dasd_diag_bio {
u8 type; u8 type;
u8 status; u8 status;
u16 spare1; u16 spare1;
u32 block_number; blocknum_t block_number;
u32 alet; u32 alet;
u32 buffer; u32 buffer;
} __attribute__ ((packed, aligned(8))); } __attribute__ ((packed, aligned(8)));
struct dasd_diag_init_io { struct dasd_diag_init_io {
u16 dev_nr; u16 dev_nr;
u16 spare1[11]; u8 flaga;
u8 spare1[21];
u32 block_size; u32 block_size;
u32 offset; blocknum_t offset;
u32 start_block; sblocknum_t start_block;
u32 end_block; blocknum_t end_block;
u32 spare2[6]; u8 spare2[24];
} __attribute__ ((packed, aligned(8))); } __attribute__ ((packed, aligned(8)));
struct dasd_diag_rw_io { struct dasd_diag_rw_io {
u16 dev_nr; u16 dev_nr;
u16 spare1[11]; u8 flaga;
u8 spare1[21];
u8 key; u8 key;
u8 flags; u8 flags;
u16 spare2; u8 spare2[2];
u32 block_count; u32 block_count;
u32 alet; u32 alet;
u32 bio_list; u32 bio_list;
u32 interrupt_params; u32 interrupt_params;
u32 spare3[5]; u8 spare3[20];
} __attribute__ ((packed, aligned(8))); } __attribute__ ((packed, aligned(8)));
#endif /* CONFIG_ARCH_S390X */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment