aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/cio.h
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2007-10-12 10:11:17 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-10-12 10:12:59 -0400
commitb2ffd8e9a76ec90bd4a509f3d092e35978c568a3 (patch)
treea493d60fca8a714be8854bdb5b8de781b5f6a7b1 /include/asm-s390/cio.h
parentc02087162af5d8880ff2d688999d71e1bfa16f2f (diff)
[S390] cio: Add docbook comments.
Comment a bunch of function in docbook style and convert existing comments on structures to docbook. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'include/asm-s390/cio.h')
-rw-r--r--include/asm-s390/cio.h288
1 files changed, 200 insertions, 88 deletions
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index 1982fb344164..2f08c16e44ad 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -15,30 +15,50 @@
15#define LPM_ANYPATH 0xff 15#define LPM_ANYPATH 0xff
16#define __MAX_CSSID 0 16#define __MAX_CSSID 0
17 17
18/* 18/**
19 * subchannel status word 19 * struct scsw - subchannel status word
20 * @key: subchannel key
21 * @sctl: suspend control
22 * @eswf: esw format
23 * @cc: deferred condition code
24 * @fmt: format
25 * @pfch: prefetch
26 * @isic: initial-status interruption control
27 * @alcc: adress-limit checking control
28 * @ssi: supress-suspended interruption
29 * @zcc: zero condition code
30 * @ectl: extended control
31 * @pno: path not operational
32 * @res: reserved
33 * @fctl: function control
34 * @actl: activity control
35 * @stctl: status control
36 * @cpa: channel program address
37 * @dstat: device status
38 * @cstat: subchannel status
39 * @count: residual count
20 */ 40 */
21struct scsw { 41struct scsw {
22 __u32 key : 4; /* subchannel key */ 42 __u32 key : 4;
23 __u32 sctl : 1; /* suspend control */ 43 __u32 sctl : 1;
24 __u32 eswf : 1; /* ESW format */ 44 __u32 eswf : 1;
25 __u32 cc : 2; /* deferred condition code */ 45 __u32 cc : 2;
26 __u32 fmt : 1; /* format */ 46 __u32 fmt : 1;
27 __u32 pfch : 1; /* prefetch */ 47 __u32 pfch : 1;
28 __u32 isic : 1; /* initial-status interruption control */ 48 __u32 isic : 1;
29 __u32 alcc : 1; /* address-limit checking control */ 49 __u32 alcc : 1;
30 __u32 ssi : 1; /* supress-suspended interruption */ 50 __u32 ssi : 1;
31 __u32 zcc : 1; /* zero condition code */ 51 __u32 zcc : 1;
32 __u32 ectl : 1; /* extended control */ 52 __u32 ectl : 1;
33 __u32 pno : 1; /* path not operational */ 53 __u32 pno : 1;
34 __u32 res : 1; /* reserved */ 54 __u32 res : 1;
35 __u32 fctl : 3; /* function control */ 55 __u32 fctl : 3;
36 __u32 actl : 7; /* activity control */ 56 __u32 actl : 7;
37 __u32 stctl : 5; /* status control */ 57 __u32 stctl : 5;
38 __u32 cpa; /* channel program address */ 58 __u32 cpa;
39 __u32 dstat : 8; /* device status */ 59 __u32 dstat : 8;
40 __u32 cstat : 8; /* subchannel status */ 60 __u32 cstat : 8;
41 __u32 count : 16; /* residual count */ 61 __u32 count : 16;
42} __attribute__ ((packed)); 62} __attribute__ ((packed));
43 63
44#define SCSW_FCTL_CLEAR_FUNC 0x1 64#define SCSW_FCTL_CLEAR_FUNC 0x1
@@ -110,11 +130,22 @@ struct scsw {
110#define SNS2_ENV_DATA_PRESENT 0x10 130#define SNS2_ENV_DATA_PRESENT 0x10
111#define SNS2_INPRECISE_END 0x04 131#define SNS2_INPRECISE_END 0x04
112 132
133/**
134 * struct ccw1 - channel command word
135 * @cmd_code: command code
136 * @flags: flags, like IDA adressing, etc.
137 * @count: byte count
138 * @cda: data address
139 *
140 * The ccw is the basic structure to build channel programs that perform
141 * operations with the device or the control unit. Only Format-1 channel
142 * command words are supported.
143 */
113struct ccw1 { 144struct ccw1 {
114 __u8 cmd_code; /* command code */ 145 __u8 cmd_code;
115 __u8 flags; /* flags, like IDA addressing, etc. */ 146 __u8 flags;
116 __u16 count; /* byte count */ 147 __u16 count;
117 __u32 cda; /* data address */ 148 __u32 cda;
118} __attribute__ ((packed,aligned(8))); 149} __attribute__ ((packed,aligned(8)));
119 150
120#define CCW_FLAG_DC 0x80 151#define CCW_FLAG_DC 0x80
@@ -140,102 +171,162 @@ struct ccw1 {
140 171
141#define SENSE_MAX_COUNT 0x20 172#define SENSE_MAX_COUNT 0x20
142 173
174/**
175 * struct erw - extended report word
176 * @res0: reserved
177 * @auth: authorization check
178 * @pvrf: path-verification-required flag
179 * @cpt: channel-path timeout
180 * @fsavf: failing storage address validity flag
181 * @cons: concurrent sense
182 * @scavf: secondary ccw address validity flag
183 * @fsaf: failing storage address format
184 * @scnt: sense count, if @cons == %1
185 * @res16: reserved
186 */
143struct erw { 187struct erw {
144 __u32 res0 : 3; /* reserved */ 188 __u32 res0 : 3;
145 __u32 auth : 1; /* Authorization check */ 189 __u32 auth : 1;
146 __u32 pvrf : 1; /* path-verification-required flag */ 190 __u32 pvrf : 1;
147 __u32 cpt : 1; /* channel-path timeout */ 191 __u32 cpt : 1;
148 __u32 fsavf : 1; /* Failing storage address validity flag */ 192 __u32 fsavf : 1;
149 __u32 cons : 1; /* concurrent-sense */ 193 __u32 cons : 1;
150 __u32 scavf : 1; /* Secondary ccw address validity flag */ 194 __u32 scavf : 1;
151 __u32 fsaf : 1; /* Failing storage address format */ 195 __u32 fsaf : 1;
152 __u32 scnt : 6; /* sense count if cons == 1 */ 196 __u32 scnt : 6;
153 __u32 res16 : 16; /* reserved */ 197 __u32 res16 : 16;
154} __attribute__ ((packed)); 198} __attribute__ ((packed));
155 199
156/* 200/**
157 * subchannel logout area 201 * struct sublog - subchannel logout area
202 * @res0: reserved
203 * @esf: extended status flags
204 * @lpum: last path used mask
205 * @arep: ancillary report
206 * @fvf: field-validity flags
207 * @sacc: storage access code
208 * @termc: termination code
209 * @devsc: device-status check
210 * @serr: secondary error
211 * @ioerr: i/o-error alert
212 * @seqc: sequence code
158 */ 213 */
159struct sublog { 214struct sublog {
160 __u32 res0 : 1; /* reserved */ 215 __u32 res0 : 1;
161 __u32 esf : 7; /* extended status flags */ 216 __u32 esf : 7;
162 __u32 lpum : 8; /* last path used mask */ 217 __u32 lpum : 8;
163 __u32 arep : 1; /* ancillary report */ 218 __u32 arep : 1;
164 __u32 fvf : 5; /* field-validity flags */ 219 __u32 fvf : 5;
165 __u32 sacc : 2; /* storage access code */ 220 __u32 sacc : 2;
166 __u32 termc : 2; /* termination code */ 221 __u32 termc : 2;
167 __u32 devsc : 1; /* device-status check */ 222 __u32 devsc : 1;
168 __u32 serr : 1; /* secondary error */ 223 __u32 serr : 1;
169 __u32 ioerr : 1; /* i/o-error alert */ 224 __u32 ioerr : 1;
170 __u32 seqc : 3; /* sequence code */ 225 __u32 seqc : 3;
171} __attribute__ ((packed)); 226} __attribute__ ((packed));
172 227
173/* 228/**
174 * Format 0 Extended Status Word (ESW) 229 * struct esw0 - Format 0 Extended Status Word (ESW)
230 * @sublog: subchannel logout
231 * @erw: extended report word
232 * @faddr: failing storage address
233 * @saddr: secondary ccw address
175 */ 234 */
176struct esw0 { 235struct esw0 {
177 struct sublog sublog; /* subchannel logout */ 236 struct sublog sublog;
178 struct erw erw; /* extended report word */ 237 struct erw erw;
179 __u32 faddr[2]; /* failing storage address */ 238 __u32 faddr[2];
180 __u32 saddr; /* secondary ccw address */ 239 __u32 saddr;
181} __attribute__ ((packed)); 240} __attribute__ ((packed));
182 241
183/* 242/**
184 * Format 1 Extended Status Word (ESW) 243 * struct esw1 - Format 1 Extended Status Word (ESW)
244 * @zero0: reserved zeros
245 * @lpum: last path used mask
246 * @zero16: reserved zeros
247 * @erw: extended report word
248 * @zeros: three fullwords of zeros
185 */ 249 */
186struct esw1 { 250struct esw1 {
187 __u8 zero0; /* reserved zeros */ 251 __u8 zero0;
188 __u8 lpum; /* last path used mask */ 252 __u8 lpum;
189 __u16 zero16; /* reserved zeros */ 253 __u16 zero16;
190 struct erw erw; /* extended report word */ 254 struct erw erw;
191 __u32 zeros[3]; /* 2 fullwords of zeros */ 255 __u32 zeros[3];
192} __attribute__ ((packed)); 256} __attribute__ ((packed));
193 257
194/* 258/**
195 * Format 2 Extended Status Word (ESW) 259 * struct esw2 - Format 2 Extended Status Word (ESW)
260 * @zero0: reserved zeros
261 * @lpum: last path used mask
262 * @dcti: device-connect-time interval
263 * @erw: extended report word
264 * @zeros: three fullwords of zeros
196 */ 265 */
197struct esw2 { 266struct esw2 {
198 __u8 zero0; /* reserved zeros */ 267 __u8 zero0;
199 __u8 lpum; /* last path used mask */ 268 __u8 lpum;
200 __u16 dcti; /* device-connect-time interval */ 269 __u16 dcti;
201 struct erw erw; /* extended report word */ 270 struct erw erw;
202 __u32 zeros[3]; /* 2 fullwords of zeros */ 271 __u32 zeros[3];
203} __attribute__ ((packed)); 272} __attribute__ ((packed));
204 273
205/* 274/**
206 * Format 3 Extended Status Word (ESW) 275 * struct esw3 - Format 3 Extended Status Word (ESW)
276 * @zero0: reserved zeros
277 * @lpum: last path used mask
278 * @res: reserved
279 * @erw: extended report word
280 * @zeros: three fullwords of zeros
207 */ 281 */
208struct esw3 { 282struct esw3 {
209 __u8 zero0; /* reserved zeros */ 283 __u8 zero0;
210 __u8 lpum; /* last path used mask */ 284 __u8 lpum;
211 __u16 res; /* reserved */ 285 __u16 res;
212 struct erw erw; /* extended report word */ 286 struct erw erw;
213 __u32 zeros[3]; /* 2 fullwords of zeros */ 287 __u32 zeros[3];
214} __attribute__ ((packed)); 288} __attribute__ ((packed));
215 289
216/* 290/**
217 * interruption response block 291 * struct irb - interruption response block
292 * @scsw: subchannel status word
293 * @esw: extened status word, 4 formats
294 * @ecw: extended control word
295 *
296 * The irb that is handed to the device driver when an interrupt occurs. For
297 * solicited interrupts, the common I/O layer already performs checks whether
298 * a field is valid; a field not being valid is always passed as %0.
299 * If a unit check occured, @ecw may contain sense data; this is retrieved
300 * by the common I/O layer itself if the device doesn't support concurrent
301 * sense (so that the device driver never needs to perform basic sene itself).
302 * For unsolicited interrupts, the irb is passed as-is (expect for sense data,
303 * if applicable).
218 */ 304 */
219struct irb { 305struct irb {
220 struct scsw scsw; /* subchannel status word */ 306 struct scsw scsw;
221 union { /* extended status word, 4 formats */ 307 union {
222 struct esw0 esw0; 308 struct esw0 esw0;
223 struct esw1 esw1; 309 struct esw1 esw1;
224 struct esw2 esw2; 310 struct esw2 esw2;
225 struct esw3 esw3; 311 struct esw3 esw3;
226 } esw; 312 } esw;
227 __u8 ecw[32]; /* extended control word */ 313 __u8 ecw[32];
228} __attribute__ ((packed,aligned(4))); 314} __attribute__ ((packed,aligned(4)));
229 315
230/* 316/**
231 * command information word (CIW) layout 317 * struct ciw - command information word (CIW) layout
318 * @et: entry type
319 * @reserved: reserved bits
320 * @ct: command type
321 * @cmd: command code
322 * @count: command count
232 */ 323 */
233struct ciw { 324struct ciw {
234 __u32 et : 2; /* entry type */ 325 __u32 et : 2;
235 __u32 reserved : 2; /* reserved */ 326 __u32 reserved : 2;
236 __u32 ct : 4; /* command type */ 327 __u32 ct : 4;
237 __u32 cmd : 8; /* command */ 328 __u32 cmd : 8;
238 __u32 count : 16; /* coun */ 329 __u32 count : 16;
239} __attribute__ ((packed)); 330} __attribute__ ((packed));
240 331
241#define CIW_TYPE_RCD 0x0 /* read configuration data */ 332#define CIW_TYPE_RCD 0x0 /* read configuration data */
@@ -258,11 +349,32 @@ struct ciw {
258/* Sick revalidation of device. */ 349/* Sick revalidation of device. */
259#define CIO_REVALIDATE 0x0008 350#define CIO_REVALIDATE 0x0008
260 351
352/**
353 * struct ccw_dev_id - unique identifier for ccw devices
354 * @ssid: subchannel set id
355 * @devno: device number
356 *
357 * This structure is not directly based on any hardware structure. The
358 * hardware identifies a device by its device number and its subchannel,
359 * which is in turn identified by its id. In order to get a unique identifier
360 * for ccw devices across subchannel sets, @struct ccw_dev_id has been
361 * introduced.
362 */
261struct ccw_dev_id { 363struct ccw_dev_id {
262 u8 ssid; 364 u8 ssid;
263 u16 devno; 365 u16 devno;
264}; 366};
265 367
368/**
369 * ccw_device_id_is_equal() - compare two ccw_dev_ids
370 * @dev_id1: a ccw_dev_id
371 * @dev_id2: another ccw_dev_id
372 * Returns:
373 * %1 if the two structures are equal field-by-field,
374 * %0 if not.
375 * Context:
376 * any
377 */
266static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1, 378static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
267 struct ccw_dev_id *dev_id2) 379 struct ccw_dev_id *dev_id2)
268{ 380{