dasd_diag.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
  3. * Based on.......: linux/drivers/s390/block/mdisk.h
  4. * ...............: by Hartmunt Penner <hpenner@de.ibm.com>
  5. * Bugreports.to..: <Linux390@de.ibm.com>
  6. * Copyright IBM Corp. 1999, 2000
  7. *
  8. */
  9. #define MDSK_WRITE_REQ 0x01
  10. #define MDSK_READ_REQ 0x02
  11. #define INIT_BIO 0x00
  12. #define RW_BIO 0x01
  13. #define TERM_BIO 0x02
  14. #define DEV_CLASS_FBA 0x01
  15. #define DEV_CLASS_ECKD 0x04
  16. #define DASD_DIAG_CODE_31BIT 0x03
  17. #define DASD_DIAG_CODE_64BIT 0x07
  18. #define DASD_DIAG_RWFLAG_ASYNC 0x02
  19. #define DASD_DIAG_RWFLAG_NOCACHE 0x01
  20. #define DASD_DIAG_FLAGA_FORMAT_64BIT 0x80
  21. struct dasd_diag_characteristics {
  22. u16 dev_nr;
  23. u16 rdc_len;
  24. u8 vdev_class;
  25. u8 vdev_type;
  26. u8 vdev_status;
  27. u8 vdev_flags;
  28. u8 rdev_class;
  29. u8 rdev_type;
  30. u8 rdev_model;
  31. u8 rdev_features;
  32. } __attribute__ ((packed, aligned(4)));
  33. #ifdef CONFIG_64BIT
  34. #define DASD_DIAG_FLAGA_DEFAULT DASD_DIAG_FLAGA_FORMAT_64BIT
  35. typedef u64 blocknum_t;
  36. typedef s64 sblocknum_t;
  37. struct dasd_diag_bio {
  38. u8 type;
  39. u8 status;
  40. u8 spare1[2];
  41. u32 alet;
  42. blocknum_t block_number;
  43. void *buffer;
  44. } __attribute__ ((packed, aligned(8)));
  45. struct dasd_diag_init_io {
  46. u16 dev_nr;
  47. u8 flaga;
  48. u8 spare1[21];
  49. u32 block_size;
  50. u8 spare2[4];
  51. blocknum_t offset;
  52. sblocknum_t start_block;
  53. blocknum_t end_block;
  54. u8 spare3[8];
  55. } __attribute__ ((packed, aligned(8)));
  56. struct dasd_diag_rw_io {
  57. u16 dev_nr;
  58. u8 flaga;
  59. u8 spare1[21];
  60. u8 key;
  61. u8 flags;
  62. u8 spare2[2];
  63. u32 block_count;
  64. u32 alet;
  65. u8 spare3[4];
  66. u64 interrupt_params;
  67. struct dasd_diag_bio *bio_list;
  68. u8 spare4[8];
  69. } __attribute__ ((packed, aligned(8)));
  70. #else /* CONFIG_64BIT */
  71. #define DASD_DIAG_FLAGA_DEFAULT 0x0
  72. typedef u32 blocknum_t;
  73. typedef s32 sblocknum_t;
  74. struct dasd_diag_bio {
  75. u8 type;
  76. u8 status;
  77. u16 spare1;
  78. blocknum_t block_number;
  79. u32 alet;
  80. void *buffer;
  81. } __attribute__ ((packed, aligned(8)));
  82. struct dasd_diag_init_io {
  83. u16 dev_nr;
  84. u8 flaga;
  85. u8 spare1[21];
  86. u32 block_size;
  87. blocknum_t offset;
  88. sblocknum_t start_block;
  89. blocknum_t end_block;
  90. u8 spare2[24];
  91. } __attribute__ ((packed, aligned(8)));
  92. struct dasd_diag_rw_io {
  93. u16 dev_nr;
  94. u8 flaga;
  95. u8 spare1[21];
  96. u8 key;
  97. u8 flags;
  98. u8 spare2[2];
  99. u32 block_count;
  100. u32 alet;
  101. struct dasd_diag_bio *bio_list;
  102. u32 interrupt_params;
  103. u8 spare3[20];
  104. } __attribute__ ((packed, aligned(8)));
  105. #endif /* CONFIG_64BIT */