dasd_eckd.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. * $Revision: 1.10 $
  9. */
  10. #ifndef DASD_ECKD_H
  11. #define DASD_ECKD_H
  12. /*****************************************************************************
  13. * SECTION: CCW Definitions
  14. ****************************************************************************/
  15. #define DASD_ECKD_CCW_WRITE 0x05
  16. #define DASD_ECKD_CCW_READ 0x06
  17. #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09
  18. #define DASD_ECKD_CCW_READ_HOME_ADDRESS 0x0a
  19. #define DASD_ECKD_CCW_WRITE_KD 0x0d
  20. #define DASD_ECKD_CCW_READ_KD 0x0e
  21. #define DASD_ECKD_CCW_ERASE 0x11
  22. #define DASD_ECKD_CCW_READ_COUNT 0x12
  23. #define DASD_ECKD_CCW_SLCK 0x14
  24. #define DASD_ECKD_CCW_WRITE_RECORD_ZERO 0x15
  25. #define DASD_ECKD_CCW_READ_RECORD_ZERO 0x16
  26. #define DASD_ECKD_CCW_WRITE_CKD 0x1d
  27. #define DASD_ECKD_CCW_READ_CKD 0x1e
  28. #define DASD_ECKD_CCW_PSF 0x27
  29. #define DASD_ECKD_CCW_RSSD 0x3e
  30. #define DASD_ECKD_CCW_LOCATE_RECORD 0x47
  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. __u16 ID;
  218. } __attribute__ ((packed)) ned1;
  219. struct {
  220. struct {
  221. unsigned char identifier:2;
  222. unsigned char token_id:1;
  223. unsigned char sno_valid:1;
  224. unsigned char subst_sno:1;
  225. unsigned char recNED:1;
  226. unsigned char emuNED:1;
  227. unsigned char reserved:1;
  228. } __attribute__ ((packed)) flags;
  229. __u8 descriptor;
  230. __u8 reserved[2];
  231. unsigned char dev_type[6];
  232. unsigned char dev_model[3];
  233. unsigned char DASD_manufacturer[3];
  234. unsigned char DASD_location[2];
  235. unsigned char DASD_seqno[12];
  236. __u16 ID;
  237. } __attribute__ ((packed)) ned2;
  238. struct {
  239. struct {
  240. unsigned char identifier:2;
  241. unsigned char token_id:1;
  242. unsigned char sno_valid:1;
  243. unsigned char subst_sno:1;
  244. unsigned char recNED:1;
  245. unsigned char emuNED:1;
  246. unsigned char reserved:1;
  247. } __attribute__ ((packed)) flags;
  248. __u8 descriptor;
  249. __u8 reserved[2];
  250. unsigned char cont_type[6];
  251. unsigned char cont_model[3];
  252. unsigned char cont_manufacturer[3];
  253. unsigned char cont_location[2];
  254. unsigned char cont_seqno[12];
  255. __u16 ID;
  256. } __attribute__ ((packed)) ned3;
  257. struct {
  258. struct {
  259. unsigned char identifier:2;
  260. unsigned char token_id:1;
  261. unsigned char sno_valid:1;
  262. unsigned char subst_sno:1;
  263. unsigned char recNED:1;
  264. unsigned char emuNED:1;
  265. unsigned char reserved:1;
  266. } __attribute__ ((packed)) flags;
  267. __u8 descriptor;
  268. __u8 reserved[2];
  269. unsigned char cont_type[6];
  270. unsigned char empty[3];
  271. unsigned char cont_manufacturer[3];
  272. unsigned char cont_location[2];
  273. unsigned char cont_seqno[12];
  274. __u16 ID;
  275. } __attribute__ ((packed)) ned4;
  276. unsigned char ned5[32];
  277. unsigned char ned6[32];
  278. unsigned char ned7[32];
  279. struct {
  280. struct {
  281. unsigned char identifier:2;
  282. unsigned char reserved:6;
  283. } __attribute__ ((packed)) flags;
  284. __u8 selector;
  285. __u16 interfaceID;
  286. __u32 reserved;
  287. __u16 subsystemID;
  288. struct {
  289. unsigned char sp0:1;
  290. unsigned char sp1:1;
  291. unsigned char reserved:5;
  292. unsigned char scluster:1;
  293. } __attribute__ ((packed)) spathID;
  294. __u8 unit_address;
  295. __u8 dev_ID;
  296. __u8 dev_address;
  297. __u8 adapterID;
  298. __u16 link_address;
  299. struct {
  300. unsigned char parallel:1;
  301. unsigned char escon:1;
  302. unsigned char reserved:1;
  303. unsigned char ficon:1;
  304. unsigned char reserved2:4;
  305. } __attribute__ ((packed)) protocol_type;
  306. struct {
  307. unsigned char PID_in_236:1;
  308. unsigned char reserved:7;
  309. } __attribute__ ((packed)) format_flags;
  310. __u8 log_dev_address;
  311. unsigned char reserved2[12];
  312. } __attribute__ ((packed)) neq;
  313. } __attribute__ ((packed));
  314. struct dasd_eckd_path {
  315. __u8 opm;
  316. __u8 ppm;
  317. __u8 npm;
  318. };
  319. /*
  320. * Perform Subsystem Function - Prepare for Read Subsystem Data
  321. */
  322. struct dasd_psf_prssd_data {
  323. unsigned char order;
  324. unsigned char flags;
  325. unsigned char reserved[4];
  326. unsigned char suborder;
  327. unsigned char varies[9];
  328. } __attribute__ ((packed));
  329. #endif /* DASD_ECKD_H */