dasd_eckd.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. /*
  2. * File...........: linux/drivers/s390/block/dasd_eckd.h
  3. * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
  4. * Horst Hummel <Horst.Hummel@de.ibm.com>
  5. * Bugreports.to..: <Linux390@de.ibm.com>
  6. * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
  7. *
  8. */
  9. #ifndef DASD_ECKD_H
  10. #define DASD_ECKD_H
  11. /*****************************************************************************
  12. * SECTION: CCW Definitions
  13. ****************************************************************************/
  14. #define DASD_ECKD_CCW_WRITE 0x05
  15. #define DASD_ECKD_CCW_READ 0x06
  16. #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09
  17. #define DASD_ECKD_CCW_READ_HOME_ADDRESS 0x0a
  18. #define DASD_ECKD_CCW_WRITE_KD 0x0d
  19. #define DASD_ECKD_CCW_READ_KD 0x0e
  20. #define DASD_ECKD_CCW_ERASE 0x11
  21. #define DASD_ECKD_CCW_READ_COUNT 0x12
  22. #define DASD_ECKD_CCW_SLCK 0x14
  23. #define DASD_ECKD_CCW_WRITE_RECORD_ZERO 0x15
  24. #define DASD_ECKD_CCW_READ_RECORD_ZERO 0x16
  25. #define DASD_ECKD_CCW_WRITE_CKD 0x1d
  26. #define DASD_ECKD_CCW_READ_CKD 0x1e
  27. #define DASD_ECKD_CCW_PSF 0x27
  28. #define DASD_ECKD_CCW_RSSD 0x3e
  29. #define DASD_ECKD_CCW_LOCATE_RECORD 0x47
  30. #define DASD_ECKD_CCW_SNSS 0x54
  31. #define DASD_ECKD_CCW_DEFINE_EXTENT 0x63
  32. #define DASD_ECKD_CCW_WRITE_MT 0x85
  33. #define DASD_ECKD_CCW_READ_MT 0x86
  34. #define DASD_ECKD_CCW_WRITE_KD_MT 0x8d
  35. #define DASD_ECKD_CCW_READ_KD_MT 0x8e
  36. #define DASD_ECKD_CCW_RELEASE 0x94
  37. #define DASD_ECKD_CCW_READ_CKD_MT 0x9e
  38. #define DASD_ECKD_CCW_WRITE_CKD_MT 0x9d
  39. #define DASD_ECKD_CCW_RESERVE 0xB4
  40. /*
  41. *Perform Subsystem Function / Sub-Orders
  42. */
  43. #define PSF_ORDER_PRSSD 0x18
  44. /*****************************************************************************
  45. * SECTION: Type Definitions
  46. ****************************************************************************/
  47. struct eckd_count {
  48. __u16 cyl;
  49. __u16 head;
  50. __u8 record;
  51. __u8 kl;
  52. __u16 dl;
  53. } __attribute__ ((packed));
  54. struct ch_t {
  55. __u16 cyl;
  56. __u16 head;
  57. } __attribute__ ((packed));
  58. struct chs_t {
  59. __u16 cyl;
  60. __u16 head;
  61. __u32 sector;
  62. } __attribute__ ((packed));
  63. struct chr_t {
  64. __u16 cyl;
  65. __u16 head;
  66. __u8 record;
  67. } __attribute__ ((packed));
  68. struct geom_t {
  69. __u16 cyl;
  70. __u16 head;
  71. __u32 sector;
  72. } __attribute__ ((packed));
  73. struct eckd_home {
  74. __u8 skip_control[14];
  75. __u16 cell_number;
  76. __u8 physical_addr[3];
  77. __u8 flag;
  78. struct ch_t track_addr;
  79. __u8 reserved;
  80. __u8 key_length;
  81. __u8 reserved2[2];
  82. } __attribute__ ((packed));
  83. struct DE_eckd_data {
  84. struct {
  85. unsigned char perm:2; /* Permissions on this extent */
  86. unsigned char reserved:1;
  87. unsigned char seek:2; /* Seek control */
  88. unsigned char auth:2; /* Access authorization */
  89. unsigned char pci:1; /* PCI Fetch mode */
  90. } __attribute__ ((packed)) mask;
  91. struct {
  92. unsigned char mode:2; /* Architecture mode */
  93. unsigned char ckd:1; /* CKD Conversion */
  94. unsigned char operation:3; /* Operation mode */
  95. unsigned char cfw:1; /* Cache fast write */
  96. unsigned char dfw:1; /* DASD fast write */
  97. } __attribute__ ((packed)) attributes;
  98. __u16 blk_size; /* Blocksize */
  99. __u16 fast_write_id;
  100. __u8 ga_additional; /* Global Attributes Additional */
  101. __u8 ga_extended; /* Global Attributes Extended */
  102. struct ch_t beg_ext;
  103. struct ch_t end_ext;
  104. unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
  105. __u8 ep_format; /* Extended Parameter format byte */
  106. __u8 ep_prio; /* Extended Parameter priority I/O byte */
  107. __u8 ep_reserved[6]; /* Extended Parameter Reserved */
  108. } __attribute__ ((packed));
  109. struct LO_eckd_data {
  110. struct {
  111. unsigned char orientation:2;
  112. unsigned char operation:6;
  113. } __attribute__ ((packed)) operation;
  114. struct {
  115. unsigned char last_bytes_used:1;
  116. unsigned char reserved:6;
  117. unsigned char read_count_suffix:1;
  118. } __attribute__ ((packed)) auxiliary;
  119. __u8 unused;
  120. __u8 count;
  121. struct ch_t seek_addr;
  122. struct chr_t search_arg;
  123. __u8 sector;
  124. __u16 length;
  125. } __attribute__ ((packed));
  126. struct dasd_eckd_characteristics {
  127. __u16 cu_type;
  128. struct {
  129. unsigned char support:2;
  130. unsigned char async:1;
  131. unsigned char reserved:1;
  132. unsigned char cache_info:1;
  133. unsigned char model:3;
  134. } __attribute__ ((packed)) cu_model;
  135. __u16 dev_type;
  136. __u8 dev_model;
  137. struct {
  138. unsigned char mult_burst:1;
  139. unsigned char RT_in_LR:1;
  140. unsigned char reserved1:1;
  141. unsigned char RD_IN_LR:1;
  142. unsigned char reserved2:4;
  143. unsigned char reserved3:8;
  144. unsigned char defect_wr:1;
  145. unsigned char XRC_supported:1;
  146. unsigned char reserved4:1;
  147. unsigned char striping:1;
  148. unsigned char reserved5:4;
  149. unsigned char cfw:1;
  150. unsigned char reserved6:2;
  151. unsigned char cache:1;
  152. unsigned char dual_copy:1;
  153. unsigned char dfw:1;
  154. unsigned char reset_alleg:1;
  155. unsigned char sense_down:1;
  156. } __attribute__ ((packed)) facilities;
  157. __u8 dev_class;
  158. __u8 unit_type;
  159. __u16 no_cyl;
  160. __u16 trk_per_cyl;
  161. __u8 sec_per_trk;
  162. __u8 byte_per_track[3];
  163. __u16 home_bytes;
  164. __u8 formula;
  165. union {
  166. struct {
  167. __u8 f1;
  168. __u16 f2;
  169. __u16 f3;
  170. } __attribute__ ((packed)) f_0x01;
  171. struct {
  172. __u8 f1;
  173. __u8 f2;
  174. __u8 f3;
  175. __u8 f4;
  176. __u8 f5;
  177. } __attribute__ ((packed)) f_0x02;
  178. } __attribute__ ((packed)) factors;
  179. __u16 first_alt_trk;
  180. __u16 no_alt_trk;
  181. __u16 first_dia_trk;
  182. __u16 no_dia_trk;
  183. __u16 first_sup_trk;
  184. __u16 no_sup_trk;
  185. __u8 MDR_ID;
  186. __u8 OBR_ID;
  187. __u8 director;
  188. __u8 rd_trk_set;
  189. __u16 max_rec_zero;
  190. __u8 reserved1;
  191. __u8 RWANY_in_LR;
  192. __u8 factor6;
  193. __u8 factor7;
  194. __u8 factor8;
  195. __u8 reserved2[3];
  196. __u8 reserved3[10];
  197. } __attribute__ ((packed));
  198. struct dasd_eckd_confdata {
  199. struct {
  200. struct {
  201. unsigned char identifier:2;
  202. unsigned char token_id:1;
  203. unsigned char sno_valid:1;
  204. unsigned char subst_sno:1;
  205. unsigned char recNED:1;
  206. unsigned char emuNED:1;
  207. unsigned char reserved:1;
  208. } __attribute__ ((packed)) flags;
  209. __u8 descriptor;
  210. __u8 dev_class;
  211. __u8 reserved;
  212. unsigned char dev_type[6];
  213. unsigned char dev_model[3];
  214. unsigned char HDA_manufacturer[3];
  215. unsigned char HDA_location[2];
  216. unsigned char HDA_seqno[12];
  217. __u8 ID;
  218. __u8 unit_addr;
  219. } __attribute__ ((packed)) ned1;
  220. union {
  221. struct {
  222. struct {
  223. unsigned char identifier:2;
  224. unsigned char token_id:1;
  225. unsigned char sno_valid:1;
  226. unsigned char subst_sno:1;
  227. unsigned char recNED:1;
  228. unsigned char emuNED:1;
  229. unsigned char reserved:1;
  230. } __attribute__ ((packed)) flags;
  231. __u8 descriptor;
  232. __u8 reserved[2];
  233. unsigned char dev_type[6];
  234. unsigned char dev_model[3];
  235. unsigned char DASD_manufacturer[3];
  236. unsigned char DASD_location[2];
  237. unsigned char DASD_seqno[12];
  238. __u16 ID;
  239. } __attribute__ ((packed)) ned;
  240. struct {
  241. unsigned char flags; /* byte 0 */
  242. unsigned char res2[7]; /* byte 1- 7 */
  243. unsigned char sua_flags; /* byte 8 */
  244. __u8 base_unit_addr; /* byte 9 */
  245. unsigned char res3[22]; /* byte 10-31 */
  246. } __attribute__ ((packed)) sneq;
  247. } __attribute__ ((packed)) ned2;
  248. struct {
  249. struct {
  250. unsigned char identifier:2;
  251. unsigned char token_id:1;
  252. unsigned char sno_valid:1;
  253. unsigned char subst_sno:1;
  254. unsigned char recNED:1;
  255. unsigned char emuNED:1;
  256. unsigned char reserved:1;
  257. } __attribute__ ((packed)) flags;
  258. __u8 descriptor;
  259. __u8 reserved[2];
  260. unsigned char cont_type[6];
  261. unsigned char cont_model[3];
  262. unsigned char cont_manufacturer[3];
  263. unsigned char cont_location[2];
  264. unsigned char cont_seqno[12];
  265. __u16 ID;
  266. } __attribute__ ((packed)) ned3;
  267. struct {
  268. struct {
  269. unsigned char identifier:2;
  270. unsigned char token_id:1;
  271. unsigned char sno_valid:1;
  272. unsigned char subst_sno:1;
  273. unsigned char recNED:1;
  274. unsigned char emuNED:1;
  275. unsigned char reserved:1;
  276. } __attribute__ ((packed)) flags;
  277. __u8 descriptor;
  278. __u8 reserved[2];
  279. unsigned char cont_type[6];
  280. unsigned char empty[3];
  281. unsigned char cont_manufacturer[3];
  282. unsigned char cont_location[2];
  283. unsigned char cont_seqno[12];
  284. __u16 ID;
  285. } __attribute__ ((packed)) ned4;
  286. unsigned char ned5[32];
  287. unsigned char ned6[32];
  288. unsigned char ned7[32];
  289. struct {
  290. struct {
  291. unsigned char identifier:2;
  292. unsigned char reserved:6;
  293. } __attribute__ ((packed)) flags;
  294. __u8 selector;
  295. __u16 interfaceID;
  296. __u32 reserved;
  297. __u16 subsystemID;
  298. struct {
  299. unsigned char sp0:1;
  300. unsigned char sp1:1;
  301. unsigned char reserved:5;
  302. unsigned char scluster:1;
  303. } __attribute__ ((packed)) spathID;
  304. __u8 unit_address;
  305. __u8 dev_ID;
  306. __u8 dev_address;
  307. __u8 adapterID;
  308. __u16 link_address;
  309. struct {
  310. unsigned char parallel:1;
  311. unsigned char escon:1;
  312. unsigned char reserved:1;
  313. unsigned char ficon:1;
  314. unsigned char reserved2:4;
  315. } __attribute__ ((packed)) protocol_type;
  316. struct {
  317. unsigned char PID_in_236:1;
  318. unsigned char reserved:7;
  319. } __attribute__ ((packed)) format_flags;
  320. __u8 log_dev_address;
  321. unsigned char reserved2[12];
  322. } __attribute__ ((packed)) neq;
  323. } __attribute__ ((packed));
  324. struct dasd_eckd_path {
  325. __u8 opm;
  326. __u8 ppm;
  327. __u8 npm;
  328. };
  329. /*
  330. * Perform Subsystem Function - Prepare for Read Subsystem Data
  331. */
  332. struct dasd_psf_prssd_data {
  333. unsigned char order;
  334. unsigned char flags;
  335. unsigned char reserved[4];
  336. unsigned char suborder;
  337. unsigned char varies[9];
  338. } __attribute__ ((packed));
  339. #endif /* DASD_ECKD_H */