aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
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 /drivers/s390/cio
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 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/ccwgroup.c67
-rw-r--r--drivers/s390/cio/device.c64
-rw-r--r--drivers/s390/cio/device_ops.c241
3 files changed, 315 insertions, 57 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index b0a18f5176aa..9c3b9ea1e66f 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -152,16 +152,24 @@ __ccwgroup_create_symlinks(struct ccwgroup_device *gdev)
152 return 0; 152 return 0;
153} 153}
154 154
155/* 155/**
156 * try to add a new ccwgroup device for one driver 156 * ccwgroup_create() - create and register a ccw group device
157 * argc and argv[] are a list of bus_id's of devices 157 * @root: parent device for the new device
158 * belonging to the driver. 158 * @creator_id: identifier of creating driver
159 * @cdrv: ccw driver of slave devices
160 * @argc: number of slave devices
161 * @argv: bus ids of slave devices
162 *
163 * Create and register a new ccw group device as a child of @root. Slave
164 * devices are obtained from the list of bus ids given in @argv[] and must all
165 * belong to @cdrv.
166 * Returns:
167 * %0 on success and an error code on failure.
168 * Context:
169 * non-atomic
159 */ 170 */
160int 171int ccwgroup_create(struct device *root, unsigned int creator_id,
161ccwgroup_create(struct device *root, 172 struct ccw_driver *cdrv, int argc, char *argv[])
162 unsigned int creator_id,
163 struct ccw_driver *cdrv,
164 int argc, char *argv[])
165{ 173{
166 struct ccwgroup_device *gdev; 174 struct ccwgroup_device *gdev;
167 int i; 175 int i;
@@ -390,8 +398,13 @@ static struct bus_type ccwgroup_bus_type = {
390 .remove = ccwgroup_remove, 398 .remove = ccwgroup_remove,
391}; 399};
392 400
393int 401/**
394ccwgroup_driver_register (struct ccwgroup_driver *cdriver) 402 * ccwgroup_driver_register() - register a ccw group driver
403 * @cdriver: driver to be registered
404 *
405 * This function is mainly a wrapper around driver_register().
406 */
407int ccwgroup_driver_register(struct ccwgroup_driver *cdriver)
395{ 408{
396 /* register our new driver with the core */ 409 /* register our new driver with the core */
397 cdriver->driver.bus = &ccwgroup_bus_type; 410 cdriver->driver.bus = &ccwgroup_bus_type;
@@ -406,8 +419,13 @@ __ccwgroup_match_all(struct device *dev, void *data)
406 return 1; 419 return 1;
407} 420}
408 421
409void 422/**
410ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver) 423 * ccwgroup_driver_unregister() - deregister a ccw group driver
424 * @cdriver: driver to be deregistered
425 *
426 * This function is mainly a wrapper around driver_unregister().
427 */
428void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver)
411{ 429{
412 struct device *dev; 430 struct device *dev;
413 431
@@ -427,8 +445,16 @@ ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver)
427 driver_unregister(&cdriver->driver); 445 driver_unregister(&cdriver->driver);
428} 446}
429 447
430int 448/**
431ccwgroup_probe_ccwdev(struct ccw_device *cdev) 449 * ccwgroup_probe_ccwdev() - probe function for slave devices
450 * @cdev: ccw device to be probed
451 *
452 * This is a dummy probe function for ccw devices that are slave devices in
453 * a ccw group device.
454 * Returns:
455 * always %0
456 */
457int ccwgroup_probe_ccwdev(struct ccw_device *cdev)
432{ 458{
433 return 0; 459 return 0;
434} 460}
@@ -452,8 +478,15 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
452 return NULL; 478 return NULL;
453} 479}
454 480
455void 481/**
456ccwgroup_remove_ccwdev(struct ccw_device *cdev) 482 * ccwgroup_remove_ccwdev() - remove function for slave devices
483 * @cdev: ccw device to be removed
484 *
485 * This is a remove function for ccw devices that are slave devices in a ccw
486 * group device. It sets the ccw device offline and also deregisters the
487 * embedding ccw group device.
488 */
489void ccwgroup_remove_ccwdev(struct ccw_device *cdev)
457{ 490{
458 struct ccwgroup_device *gdev; 491 struct ccwgroup_device *gdev;
459 492
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index e44d92eac8e9..3943a4fde22a 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -357,8 +357,18 @@ ccw_device_remove_disconnected(struct ccw_device *cdev)
357 cdev->private->dev_id.devno); 357 cdev->private->dev_id.devno);
358} 358}
359 359
360int 360/**
361ccw_device_set_offline(struct ccw_device *cdev) 361 * ccw_device_set_offline() - disable a ccw device for I/O
362 * @cdev: target ccw device
363 *
364 * This function calls the driver's set_offline() function for @cdev, if
365 * given, and then disables @cdev.
366 * Returns:
367 * %0 on success and a negative error value on failure.
368 * Context:
369 * enabled, ccw device lock not held
370 */
371int ccw_device_set_offline(struct ccw_device *cdev)
362{ 372{
363 int ret; 373 int ret;
364 374
@@ -396,8 +406,19 @@ ccw_device_set_offline(struct ccw_device *cdev)
396 return ret; 406 return ret;
397} 407}
398 408
399int 409/**
400ccw_device_set_online(struct ccw_device *cdev) 410 * ccw_device_set_online() - enable a ccw device for I/O
411 * @cdev: target ccw device
412 *
413 * This function first enables @cdev and then calls the driver's set_online()
414 * function for @cdev, if given. If set_online() returns an error, @cdev is
415 * disabled again.
416 * Returns:
417 * %0 on success and a negative error value on failure.
418 * Context:
419 * enabled, ccw device lock not held
420 */
421int ccw_device_set_online(struct ccw_device *cdev)
401{ 422{
402 int ret; 423 int ret;
403 424
@@ -1326,8 +1347,19 @@ __ccwdev_check_busid(struct device *dev, void *id)
1326} 1347}
1327 1348
1328 1349
1329struct ccw_device * 1350/**
1330get_ccwdev_by_busid(struct ccw_driver *cdrv, const char *bus_id) 1351 * get_ccwdev_by_busid() - obtain device from a bus id
1352 * @cdrv: driver the device is owned by
1353 * @bus_id: bus id of the device to be searched
1354 *
1355 * This function searches all devices owned by @cdrv for a device with a bus
1356 * id matching @bus_id.
1357 * Returns:
1358 * If a match is found, its reference count of the found device is increased
1359 * and it is returned; else %NULL is returned.
1360 */
1361struct ccw_device *get_ccwdev_by_busid(struct ccw_driver *cdrv,
1362 const char *bus_id)
1331{ 1363{
1332 struct device *dev; 1364 struct device *dev;
1333 struct device_driver *drv; 1365 struct device_driver *drv;
@@ -1409,8 +1441,15 @@ struct bus_type ccw_bus_type = {
1409 .remove = ccw_device_remove, 1441 .remove = ccw_device_remove,
1410}; 1442};
1411 1443
1412int 1444/**
1413ccw_driver_register (struct ccw_driver *cdriver) 1445 * ccw_driver_register() - register a ccw driver
1446 * @cdriver: driver to be registered
1447 *
1448 * This function is mainly a wrapper around driver_register().
1449 * Returns:
1450 * %0 on success and a negative error value on failure.
1451 */
1452int ccw_driver_register(struct ccw_driver *cdriver)
1414{ 1453{
1415 struct device_driver *drv = &cdriver->driver; 1454 struct device_driver *drv = &cdriver->driver;
1416 1455
@@ -1420,8 +1459,13 @@ ccw_driver_register (struct ccw_driver *cdriver)
1420 return driver_register(drv); 1459 return driver_register(drv);
1421} 1460}
1422 1461
1423void 1462/**
1424ccw_driver_unregister (struct ccw_driver *cdriver) 1463 * ccw_driver_unregister() - deregister a ccw driver
1464 * @cdriver: driver to be deregistered
1465 *
1466 * This function is mainly a wrapper around driver_unregister().
1467 */
1468void ccw_driver_unregister(struct ccw_driver *cdriver)
1425{ 1469{
1426 driver_unregister(&cdriver->driver); 1470 driver_unregister(&cdriver->driver);
1427} 1471}
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 14eba854b155..7fd2dadc3297 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -25,6 +25,16 @@
25#include "device.h" 25#include "device.h"
26#include "chp.h" 26#include "chp.h"
27 27
28/**
29 * ccw_device_set_options_mask() - set some options and unset the rest
30 * @cdev: device for which the options are to be set
31 * @flags: options to be set
32 *
33 * All flags specified in @flags are set, all flags not specified in @flags
34 * are cleared.
35 * Returns:
36 * %0 on success, -%EINVAL on an invalid flag combination.
37 */
28int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags) 38int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
29{ 39{
30 /* 40 /*
@@ -40,6 +50,15 @@ int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
40 return 0; 50 return 0;
41} 51}
42 52
53/**
54 * ccw_device_set_options() - set some options
55 * @cdev: device for which the options are to be set
56 * @flags: options to be set
57 *
58 * All flags specified in @flags are set, the remainder is left untouched.
59 * Returns:
60 * %0 on success, -%EINVAL if an invalid flag combination would ensue.
61 */
43int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) 62int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
44{ 63{
45 /* 64 /*
@@ -59,6 +78,13 @@ int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
59 return 0; 78 return 0;
60} 79}
61 80
81/**
82 * ccw_device_clear_options() - clear some options
83 * @cdev: device for which the options are to be cleared
84 * @flags: options to be cleared
85 *
86 * All flags specified in @flags are cleared, the remainder is left untouched.
87 */
62void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags) 88void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags)
63{ 89{
64 cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0; 90 cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0;
@@ -67,8 +93,22 @@ void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags)
67 cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0; 93 cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0;
68} 94}
69 95
70int 96/**
71ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) 97 * ccw_device_clear() - terminate I/O request processing
98 * @cdev: target ccw device
99 * @intparm: interruption parameter; value is only used if no I/O is
100 * outstanding, otherwise the intparm associated with the I/O request
101 * is returned
102 *
103 * ccw_device_clear() calls csch on @cdev's subchannel.
104 * Returns:
105 * %0 on success,
106 * -%ENODEV on device not operational,
107 * -%EINVAL on invalid device state.
108 * Context:
109 * Interrupts disabled, ccw device lock held
110 */
111int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm)
72{ 112{
73 struct subchannel *sch; 113 struct subchannel *sch;
74 int ret; 114 int ret;
@@ -89,10 +129,33 @@ ccw_device_clear(struct ccw_device *cdev, unsigned long intparm)
89 return ret; 129 return ret;
90} 130}
91 131
92int 132/**
93ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa, 133 * ccw_device_start_key() - start a s390 channel program with key
94 unsigned long intparm, __u8 lpm, __u8 key, 134 * @cdev: target ccw device
95 unsigned long flags) 135 * @cpa: logical start address of channel program
136 * @intparm: user specific interruption parameter; will be presented back to
137 * @cdev's interrupt handler. Allows a device driver to associate
138 * the interrupt with a particular I/O request.
139 * @lpm: defines the channel path to be used for a specific I/O request. A
140 * value of 0 will make cio use the opm.
141 * @key: storage key to be used for the I/O
142 * @flags: additional flags; defines the action to be performed for I/O
143 * processing.
144 *
145 * Start a S/390 channel program. When the interrupt arrives, the
146 * IRQ handler is called, either immediately, delayed (dev-end missing,
147 * or sense required) or never (no IRQ handler registered).
148 * Returns:
149 * %0, if the operation was successful;
150 * -%EBUSY, if the device is busy, or status pending;
151 * -%EACCES, if no path specified in @lpm is operational;
152 * -%ENODEV, if the device is not operational.
153 * Context:
154 * Interrupts disabled, ccw device lock held
155 */
156int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
157 unsigned long intparm, __u8 lpm, __u8 key,
158 unsigned long flags)
96{ 159{
97 struct subchannel *sch; 160 struct subchannel *sch;
98 int ret; 161 int ret;
@@ -135,11 +198,38 @@ ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
135 return ret; 198 return ret;
136} 199}
137 200
138 201/**
139int 202 * ccw_device_start_timeout_key() - start a s390 channel program with timeout and key
140ccw_device_start_timeout_key(struct ccw_device *cdev, struct ccw1 *cpa, 203 * @cdev: target ccw device
141 unsigned long intparm, __u8 lpm, __u8 key, 204 * @cpa: logical start address of channel program
142 unsigned long flags, int expires) 205 * @intparm: user specific interruption parameter; will be presented back to
206 * @cdev's interrupt handler. Allows a device driver to associate
207 * the interrupt with a particular I/O request.
208 * @lpm: defines the channel path to be used for a specific I/O request. A
209 * value of 0 will make cio use the opm.
210 * @key: storage key to be used for the I/O
211 * @flags: additional flags; defines the action to be performed for I/O
212 * processing.
213 * @expires: timeout value in jiffies
214 *
215 * Start a S/390 channel program. When the interrupt arrives, the
216 * IRQ handler is called, either immediately, delayed (dev-end missing,
217 * or sense required) or never (no IRQ handler registered).
218 * This function notifies the device driver if the channel program has not
219 * completed during the time specified by @expires. If a timeout occurs, the
220 * channel program is terminated via xsch, hsch or csch, and the device's
221 * interrupt handler will be called with an irb containing ERR_PTR(-%ETIMEDOUT).
222 * Returns:
223 * %0, if the operation was successful;
224 * -%EBUSY, if the device is busy, or status pending;
225 * -%EACCES, if no path specified in @lpm is operational;
226 * -%ENODEV, if the device is not operational.
227 * Context:
228 * Interrupts disabled, ccw device lock held
229 */
230int ccw_device_start_timeout_key(struct ccw_device *cdev, struct ccw1 *cpa,
231 unsigned long intparm, __u8 lpm, __u8 key,
232 unsigned long flags, int expires)
143{ 233{
144 int ret; 234 int ret;
145 235
@@ -152,18 +242,67 @@ ccw_device_start_timeout_key(struct ccw_device *cdev, struct ccw1 *cpa,
152 return ret; 242 return ret;
153} 243}
154 244
155int 245/**
156ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa, 246 * ccw_device_start() - start a s390 channel program
157 unsigned long intparm, __u8 lpm, unsigned long flags) 247 * @cdev: target ccw device
248 * @cpa: logical start address of channel program
249 * @intparm: user specific interruption parameter; will be presented back to
250 * @cdev's interrupt handler. Allows a device driver to associate
251 * the interrupt with a particular I/O request.
252 * @lpm: defines the channel path to be used for a specific I/O request. A
253 * value of 0 will make cio use the opm.
254 * @flags: additional flags; defines the action to be performed for I/O
255 * processing.
256 *
257 * Start a S/390 channel program. When the interrupt arrives, the
258 * IRQ handler is called, either immediately, delayed (dev-end missing,
259 * or sense required) or never (no IRQ handler registered).
260 * Returns:
261 * %0, if the operation was successful;
262 * -%EBUSY, if the device is busy, or status pending;
263 * -%EACCES, if no path specified in @lpm is operational;
264 * -%ENODEV, if the device is not operational.
265 * Context:
266 * Interrupts disabled, ccw device lock held
267 */
268int ccw_device_start(struct ccw_device *cdev, struct ccw1 *cpa,
269 unsigned long intparm, __u8 lpm, unsigned long flags)
158{ 270{
159 return ccw_device_start_key(cdev, cpa, intparm, lpm, 271 return ccw_device_start_key(cdev, cpa, intparm, lpm,
160 PAGE_DEFAULT_KEY, flags); 272 PAGE_DEFAULT_KEY, flags);
161} 273}
162 274
163int 275/**
164ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa, 276 * ccw_device_start_timeout() - start a s390 channel program with timeout
165 unsigned long intparm, __u8 lpm, unsigned long flags, 277 * @cdev: target ccw device
166 int expires) 278 * @cpa: logical start address of channel program
279 * @intparm: user specific interruption parameter; will be presented back to
280 * @cdev's interrupt handler. Allows a device driver to associate
281 * the interrupt with a particular I/O request.
282 * @lpm: defines the channel path to be used for a specific I/O request. A
283 * value of 0 will make cio use the opm.
284 * @flags: additional flags; defines the action to be performed for I/O
285 * processing.
286 * @expires: timeout value in jiffies
287 *
288 * Start a S/390 channel program. When the interrupt arrives, the
289 * IRQ handler is called, either immediately, delayed (dev-end missing,
290 * or sense required) or never (no IRQ handler registered).
291 * This function notifies the device driver if the channel program has not
292 * completed during the time specified by @expires. If a timeout occurs, the
293 * channel program is terminated via xsch, hsch or csch, and the device's
294 * interrupt handler will be called with an irb containing ERR_PTR(-%ETIMEDOUT).
295 * Returns:
296 * %0, if the operation was successful;
297 * -%EBUSY, if the device is busy, or status pending;
298 * -%EACCES, if no path specified in @lpm is operational;
299 * -%ENODEV, if the device is not operational.
300 * Context:
301 * Interrupts disabled, ccw device lock held
302 */
303int ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa,
304 unsigned long intparm, __u8 lpm,
305 unsigned long flags, int expires)
167{ 306{
168 return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm, 307 return ccw_device_start_timeout_key(cdev, cpa, intparm, lpm,
169 PAGE_DEFAULT_KEY, flags, 308 PAGE_DEFAULT_KEY, flags,
@@ -171,8 +310,23 @@ ccw_device_start_timeout(struct ccw_device *cdev, struct ccw1 *cpa,
171} 310}
172 311
173 312
174int 313/**
175ccw_device_halt(struct ccw_device *cdev, unsigned long intparm) 314 * ccw_device_halt() - halt I/O request processing
315 * @cdev: target ccw device
316 * @intparm: interruption parameter; value is only used if no I/O is
317 * outstanding, otherwise the intparm associated with the I/O request
318 * is returned
319 *
320 * ccw_device_halt() calls hsch on @cdev's subchannel.
321 * Returns:
322 * %0 on success,
323 * -%ENODEV on device not operational,
324 * -%EINVAL on invalid device state,
325 * -%EBUSY on device busy or interrupt pending.
326 * Context:
327 * Interrupts disabled, ccw device lock held
328 */
329int ccw_device_halt(struct ccw_device *cdev, unsigned long intparm)
176{ 330{
177 struct subchannel *sch; 331 struct subchannel *sch;
178 int ret; 332 int ret;
@@ -193,8 +347,20 @@ ccw_device_halt(struct ccw_device *cdev, unsigned long intparm)
193 return ret; 347 return ret;
194} 348}
195 349
196int 350/**
197ccw_device_resume(struct ccw_device *cdev) 351 * ccw_device_resume() - resume channel program execution
352 * @cdev: target ccw device
353 *
354 * ccw_device_resume() calls rsch on @cdev's subchannel.
355 * Returns:
356 * %0 on success,
357 * -%ENODEV on device not operational,
358 * -%EINVAL on invalid device state,
359 * -%EBUSY on device busy or interrupt pending.
360 * Context:
361 * Interrupts disabled, ccw device lock held
362 */
363int ccw_device_resume(struct ccw_device *cdev)
198{ 364{
199 struct subchannel *sch; 365 struct subchannel *sch;
200 366
@@ -260,11 +426,21 @@ ccw_device_call_handler(struct ccw_device *cdev)
260 return 1; 426 return 1;
261} 427}
262 428
263/* 429/**
264 * Search for CIW command in extended sense data. 430 * ccw_device_get_ciw() - Search for CIW command in extended sense data.
431 * @cdev: ccw device to inspect
432 * @ct: command type to look for
433 *
434 * During SenseID, command information words (CIWs) describing special
435 * commands available to the device may have been stored in the extended
436 * sense data. This function searches for CIWs of a specified command
437 * type in the extended sense data.
438 * Returns:
439 * %NULL if no extended sense data has been stored or if no CIW of the
440 * specified command type could be found,
441 * else a pointer to the CIW of the specified command type.
265 */ 442 */
266struct ciw * 443struct ciw *ccw_device_get_ciw(struct ccw_device *cdev, __u32 ct)
267ccw_device_get_ciw(struct ccw_device *cdev, __u32 ct)
268{ 444{
269 int ciw_cnt; 445 int ciw_cnt;
270 446
@@ -276,8 +452,14 @@ ccw_device_get_ciw(struct ccw_device *cdev, __u32 ct)
276 return NULL; 452 return NULL;
277} 453}
278 454
279__u8 455/**
280ccw_device_get_path_mask(struct ccw_device *cdev) 456 * ccw_device_get_path_mask() - get currently available paths
457 * @cdev: ccw device to be queried
458 * Returns:
459 * %0 if no subchannel for the device is available,
460 * else the mask of currently available paths for the ccw device's subchannel.
461 */
462__u8 ccw_device_get_path_mask(struct ccw_device *cdev)
281{ 463{
282 struct subchannel *sch; 464 struct subchannel *sch;
283 465
@@ -357,8 +539,7 @@ out_unlock:
357 return ret; 539 return ret;
358} 540}
359 541
360void * 542void *ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
361ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
362{ 543{
363 struct subchannel *sch; 544 struct subchannel *sch;
364 struct chp_id chpid; 545 struct chp_id chpid;