dasd_eckd.h 8.6 KB

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