dasd_eckd.h 9.3 KB

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