diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2009-12-07 12:51:25 +0100 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2009-12-07 12:51:31 +0100 |
commit | e1f0fbd655539b0093738f58d57db83a0ac2dd6c (patch) | |
tree | 2f0d37096b2cd563e113fd0b1a378bc8387ba8a9 /drivers/s390/cio/io_sch.h | |
parent | 16b9a0571da4ee5cd15ca75e871722b0b5aee64d (diff) | |
download | blackbird-op-linux-e1f0fbd655539b0093738f58d57db83a0ac2dd6c.tar.gz blackbird-op-linux-e1f0fbd655539b0093738f58d57db83a0ac2dd6c.zip |
[S390] cio: consistent infrastructure for internal I/O requests
Reduce code duplication by introducing a central infrastructure to
perform an internal I/O operation on a CCW device.
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/io_sch.h')
-rw-r--r-- | drivers/s390/cio/io_sch.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h index b770e4202131..f9ff7683e242 100644 --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h @@ -1,7 +1,10 @@ #ifndef S390_IO_SCH_H #define S390_IO_SCH_H +#include <linux/types.h> #include <asm/schid.h> +#include <asm/ccwdev.h> +#include "css.h" /* * command-mode operation request block @@ -68,6 +71,52 @@ struct io_subchannel_private { #define MAX_CIWS 8 /* + * Possible status values for a CCW request's I/O. + */ +enum io_status { + IO_DONE, + IO_RUNNING, + IO_STATUS_ERROR, + IO_PATH_ERROR, + IO_REJECTED, + IO_KILLED +}; + +/** + * ccw_request - Internal CCW request. + * @cp: channel program to start + * @timeout: maximum allowable time in jiffies between start I/O and interrupt + * @maxretries: number of retries per I/O operation and path + * @lpm: mask of paths to use + * @check: optional callback that determines if results are final + * @filter: optional callback to adjust request status based on IRB data + * @callback: final callback + * @data: user-defined pointer passed to all callbacks + * @mask: current path mask + * @retries: current number of retries + * @drc: delayed return code + * @cancel: non-zero if request was cancelled + * @done: non-zero if request was finished + */ +struct ccw_request { + struct ccw1 *cp; + unsigned long timeout; + u16 maxretries; + u8 lpm; + int (*check)(struct ccw_device *, void *); + enum io_status (*filter)(struct ccw_device *, void *, struct irb *, + enum io_status); + void (*callback)(struct ccw_device *, void *, int); + void *data; + /* These fields are used internally. */ + u8 mask; + u16 retries; + int drc; + int cancel:1; + int done:1; +} __attribute__((packed)); + +/* * sense-id response buffer layout */ struct senseid { @@ -99,6 +148,7 @@ struct ccw_device_private { unsigned long registered; struct ccw_dev_id dev_id; /* device id */ struct subchannel_id schid; /* subchannel number */ + struct ccw_request req; /* internal I/O request */ u8 imask; /* lpm mask for SNID/SID/SPGID */ int iretry; /* retry counter SNID/SID/SPGID */ struct { |