diff options
Diffstat (limited to 'drivers/s390/cio/io_sch.h')
-rw-r--r-- | drivers/s390/cio/io_sch.h | 121 |
1 files changed, 30 insertions, 91 deletions
diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h index 469ef93f2302..ba31ad88f4f7 100644 --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h | |||
@@ -5,68 +5,36 @@ | |||
5 | #include <asm/schid.h> | 5 | #include <asm/schid.h> |
6 | #include <asm/ccwdev.h> | 6 | #include <asm/ccwdev.h> |
7 | #include "css.h" | 7 | #include "css.h" |
8 | 8 | #include "orb.h" | |
9 | /* | ||
10 | * command-mode operation request block | ||
11 | */ | ||
12 | struct cmd_orb { | ||
13 | u32 intparm; /* interruption parameter */ | ||
14 | u32 key : 4; /* flags, like key, suspend control, etc. */ | ||
15 | u32 spnd : 1; /* suspend control */ | ||
16 | u32 res1 : 1; /* reserved */ | ||
17 | u32 mod : 1; /* modification control */ | ||
18 | u32 sync : 1; /* synchronize control */ | ||
19 | u32 fmt : 1; /* format control */ | ||
20 | u32 pfch : 1; /* prefetch control */ | ||
21 | u32 isic : 1; /* initial-status-interruption control */ | ||
22 | u32 alcc : 1; /* address-limit-checking control */ | ||
23 | u32 ssic : 1; /* suppress-suspended-interr. control */ | ||
24 | u32 res2 : 1; /* reserved */ | ||
25 | u32 c64 : 1; /* IDAW/QDIO 64 bit control */ | ||
26 | u32 i2k : 1; /* IDAW 2/4kB block size control */ | ||
27 | u32 lpm : 8; /* logical path mask */ | ||
28 | u32 ils : 1; /* incorrect length */ | ||
29 | u32 zero : 6; /* reserved zeros */ | ||
30 | u32 orbx : 1; /* ORB extension control */ | ||
31 | u32 cpa; /* channel program address */ | ||
32 | } __attribute__ ((packed, aligned(4))); | ||
33 | |||
34 | /* | ||
35 | * transport-mode operation request block | ||
36 | */ | ||
37 | struct tm_orb { | ||
38 | u32 intparm; | ||
39 | u32 key:4; | ||
40 | u32 :9; | ||
41 | u32 b:1; | ||
42 | u32 :2; | ||
43 | u32 lpm:8; | ||
44 | u32 :7; | ||
45 | u32 x:1; | ||
46 | u32 tcw; | ||
47 | u32 prio:8; | ||
48 | u32 :8; | ||
49 | u32 rsvpgm:8; | ||
50 | u32 :8; | ||
51 | u32 :32; | ||
52 | u32 :32; | ||
53 | u32 :32; | ||
54 | u32 :32; | ||
55 | } __attribute__ ((packed, aligned(4))); | ||
56 | |||
57 | union orb { | ||
58 | struct cmd_orb cmd; | ||
59 | struct tm_orb tm; | ||
60 | } __attribute__ ((packed, aligned(4))); | ||
61 | 9 | ||
62 | struct io_subchannel_private { | 10 | struct io_subchannel_private { |
63 | union orb orb; /* operation request block */ | 11 | union orb orb; /* operation request block */ |
64 | struct ccw1 sense_ccw; /* static ccw for sense command */ | 12 | struct ccw1 sense_ccw; /* static ccw for sense command */ |
65 | } __attribute__ ((aligned(8))); | 13 | struct ccw_device *cdev;/* pointer to the child ccw device */ |
14 | struct { | ||
15 | unsigned int suspend:1; /* allow suspend */ | ||
16 | unsigned int prefetch:1;/* deny prefetch */ | ||
17 | unsigned int inter:1; /* suppress intermediate interrupts */ | ||
18 | } __packed options; | ||
19 | } __aligned(8); | ||
66 | 20 | ||
67 | #define to_io_private(n) ((struct io_subchannel_private *)n->private) | 21 | #define to_io_private(n) ((struct io_subchannel_private *) \ |
68 | #define sch_get_cdev(n) (dev_get_drvdata(&n->dev)) | 22 | dev_get_drvdata(&(n)->dev)) |
69 | #define sch_set_cdev(n, c) (dev_set_drvdata(&n->dev, c)) | 23 | #define set_io_private(n, p) (dev_set_drvdata(&(n)->dev, p)) |
24 | |||
25 | static inline struct ccw_device *sch_get_cdev(struct subchannel *sch) | ||
26 | { | ||
27 | struct io_subchannel_private *priv = to_io_private(sch); | ||
28 | return priv ? priv->cdev : NULL; | ||
29 | } | ||
30 | |||
31 | static inline void sch_set_cdev(struct subchannel *sch, | ||
32 | struct ccw_device *cdev) | ||
33 | { | ||
34 | struct io_subchannel_private *priv = to_io_private(sch); | ||
35 | if (priv) | ||
36 | priv->cdev = cdev; | ||
37 | } | ||
70 | 38 | ||
71 | #define MAX_CIWS 8 | 39 | #define MAX_CIWS 8 |
72 | 40 | ||
@@ -151,8 +119,11 @@ struct ccw_device_private { | |||
151 | struct subchannel_id schid; /* subchannel number */ | 119 | struct subchannel_id schid; /* subchannel number */ |
152 | struct ccw_request req; /* internal I/O request */ | 120 | struct ccw_request req; /* internal I/O request */ |
153 | int iretry; | 121 | int iretry; |
154 | u8 pgid_valid_mask; /* mask of valid PGIDs */ | 122 | u8 pgid_valid_mask; /* mask of valid PGIDs */ |
155 | u8 pgid_todo_mask; /* mask of PGIDs to be adjusted */ | 123 | u8 pgid_todo_mask; /* mask of PGIDs to be adjusted */ |
124 | u8 pgid_reset_mask; /* mask of PGIDs which were reset */ | ||
125 | u8 path_gone_mask; /* mask of paths, that became unavailable */ | ||
126 | u8 path_new_mask; /* mask of paths, that became available */ | ||
156 | struct { | 127 | struct { |
157 | unsigned int fast:1; /* post with "channel end" */ | 128 | unsigned int fast:1; /* post with "channel end" */ |
158 | unsigned int repall:1; /* report every interrupt status */ | 129 | unsigned int repall:1; /* report every interrupt status */ |
@@ -188,23 +159,6 @@ struct ccw_device_private { | |||
188 | void *cmb_wait; /* deferred cmb enable/disable */ | 159 | void *cmb_wait; /* deferred cmb enable/disable */ |
189 | }; | 160 | }; |
190 | 161 | ||
191 | static inline int ssch(struct subchannel_id schid, union orb *addr) | ||
192 | { | ||
193 | register struct subchannel_id reg1 asm("1") = schid; | ||
194 | int ccode = -EIO; | ||
195 | |||
196 | asm volatile( | ||
197 | " ssch 0(%2)\n" | ||
198 | "0: ipm %0\n" | ||
199 | " srl %0,28\n" | ||
200 | "1:\n" | ||
201 | EX_TABLE(0b, 1b) | ||
202 | : "+d" (ccode) | ||
203 | : "d" (reg1), "a" (addr), "m" (*addr) | ||
204 | : "cc", "memory"); | ||
205 | return ccode; | ||
206 | } | ||
207 | |||
208 | static inline int rsch(struct subchannel_id schid) | 162 | static inline int rsch(struct subchannel_id schid) |
209 | { | 163 | { |
210 | register struct subchannel_id reg1 asm("1") = schid; | 164 | register struct subchannel_id reg1 asm("1") = schid; |
@@ -220,21 +174,6 @@ static inline int rsch(struct subchannel_id schid) | |||
220 | return ccode; | 174 | return ccode; |
221 | } | 175 | } |
222 | 176 | ||
223 | static inline int csch(struct subchannel_id schid) | ||
224 | { | ||
225 | register struct subchannel_id reg1 asm("1") = schid; | ||
226 | int ccode; | ||
227 | |||
228 | asm volatile( | ||
229 | " csch\n" | ||
230 | " ipm %0\n" | ||
231 | " srl %0,28" | ||
232 | : "=d" (ccode) | ||
233 | : "d" (reg1) | ||
234 | : "cc"); | ||
235 | return ccode; | ||
236 | } | ||
237 | |||
238 | static inline int hsch(struct subchannel_id schid) | 177 | static inline int hsch(struct subchannel_id schid) |
239 | { | 178 | { |
240 | register struct subchannel_id reg1 asm("1") = schid; | 179 | register struct subchannel_id reg1 asm("1") = schid; |