Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cio.h
Go to the documentation of this file.
1 /*
2  * Common interface for I/O on S/390
3  */
4 #ifndef _ASM_S390_CIO_H_
5 #define _ASM_S390_CIO_H_
6 
7 #include <linux/spinlock.h>
8 #include <asm/types.h>
9 
10 #define LPM_ANYPATH 0xff
11 #define __MAX_CSSID 0
12 #define __MAX_SUBCHANNEL 65535
13 #define __MAX_SSID 3
14 
15 #include <asm/scsw.h>
16 
28 struct ccw1 {
33 } __attribute__ ((packed,aligned(8)));
34 
35 #define CCW_FLAG_DC 0x80
36 #define CCW_FLAG_CC 0x40
37 #define CCW_FLAG_SLI 0x20
38 #define CCW_FLAG_SKIP 0x10
39 #define CCW_FLAG_PCI 0x08
40 #define CCW_FLAG_IDA 0x04
41 #define CCW_FLAG_SUSPEND 0x02
42 
43 #define CCW_CMD_READ_IPL 0x02
44 #define CCW_CMD_NOOP 0x03
45 #define CCW_CMD_BASIC_SENSE 0x04
46 #define CCW_CMD_TIC 0x08
47 #define CCW_CMD_STLCK 0x14
48 #define CCW_CMD_SENSE_PGID 0x34
49 #define CCW_CMD_SUSPEND_RECONN 0x5B
50 #define CCW_CMD_RDC 0x64
51 #define CCW_CMD_RELEASE 0x94
52 #define CCW_CMD_SET_PGID 0xAF
53 #define CCW_CMD_SENSE_ID 0xE4
54 #define CCW_CMD_DCTL 0xF3
55 
56 #define SENSE_MAX_COUNT 0x20
57 
71 struct erw {
72  __u32 res0 : 3;
73  __u32 auth : 1;
74  __u32 pvrf : 1;
75  __u32 cpt : 1;
76  __u32 fsavf : 1;
77  __u32 cons : 1;
78  __u32 scavf : 1;
79  __u32 fsaf : 1;
80  __u32 scnt : 6;
81  __u32 res16 : 16;
82 } __attribute__ ((packed));
83 
89 struct erw_eadm {
90  __u32 : 16;
91  __u32 b : 1;
92  __u32 r : 1;
93  __u32 : 14;
94 } __packed;
95 
110 struct sublog {
111  __u32 res0 : 1;
112  __u32 esf : 7;
113  __u32 lpum : 8;
114  __u32 arep : 1;
115  __u32 fvf : 5;
116  __u32 sacc : 2;
119  __u32 serr : 1;
121  __u32 seqc : 3;
122 } __attribute__ ((packed));
123 
131 struct esw0 {
132  struct sublog sublog;
133  struct erw erw;
136 } __attribute__ ((packed));
146 struct esw1 {
150  struct erw erw;
152 } __attribute__ ((packed));
162 struct esw2 {
166  struct erw erw;
168 } __attribute__ ((packed));
169 
178 struct esw3 {
182  struct erw erw;
184 } __attribute__ ((packed));
185 
191 struct esw_eadm {
193  struct erw_eadm erw;
194  __u32 : 32;
195  __u32 : 32;
196  __u32 : 32;
197 } __packed;
198 
214 struct irb {
215  union scsw scsw;
216  union {
217  struct esw0 esw0;
218  struct esw1 esw1;
219  struct esw2 esw2;
220  struct esw3 esw3;
221  struct esw_eadm eadm;
222  } esw;
223  __u8 ecw[32];
224 } __attribute__ ((packed,aligned(4)));
234 struct ciw {
235  __u32 et : 2;
237  __u32 ct : 4;
238  __u32 cmd : 8;
239  __u32 count : 16;
240 } __attribute__ ((packed));
242 #define CIW_TYPE_RCD 0x0 /* read configuration data */
243 #define CIW_TYPE_SII 0x1 /* set interface identifier */
244 #define CIW_TYPE_RNI 0x2 /* read node identifier */
245 
246 /*
247  * Flags used as input parameters for do_IO()
248  */
249 #define DOIO_ALLOW_SUSPEND 0x0001 /* allow for channel prog. suspend */
250 #define DOIO_DENY_PREFETCH 0x0002 /* don't allow for CCW prefetch */
251 #define DOIO_SUPPRESS_INTER 0x0004 /* suppress intermediate inter. */
252  /* ... for suspended CCWs */
253 /* Device or subchannel gone. */
254 #define CIO_GONE 0x0001
255 /* No path to device. */
256 #define CIO_NO_PATH 0x0002
257 /* Device has appeared. */
258 #define CIO_OPER 0x0004
259 /* Sick revalidation of device. */
260 #define CIO_REVALIDATE 0x0008
261 /* Device did not respond in time. */
262 #define CIO_BOXED 0x0010
263 
275 struct ccw_dev_id {
278 };
279 
290 static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
291  struct ccw_dev_id *dev_id2)
292 {
293  if ((dev_id1->ssid == dev_id2->ssid) &&
294  (dev_id1->devno == dev_id2->devno))
295  return 1;
296  return 0;
297 }
298 
299 extern void wait_cons_dev(void);
300 
301 extern void css_schedule_reprobe(void);
302 
303 extern void reipl_ccw_dev(struct ccw_dev_id *id);
304 
305 struct cio_iplinfo {
307  int is_qdio;
308 };
309 
310 extern int cio_get_iplinfo(struct cio_iplinfo *iplinfo);
311 
312 /* Function from drivers/s390/cio/chsc.c */
313 int chsc_sstpc(void *page, unsigned int op, u16 ctrl);
314 int chsc_sstpi(void *page, void *result, size_t size);
315 
316 #endif