aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/io_sch.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/io_sch.h')
-rw-r--r--drivers/s390/cio/io_sch.h73
1 files changed, 67 insertions, 6 deletions
diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h
index 0b8f381bd20e..d72ae4c93af9 100644
--- a/drivers/s390/cio/io_sch.h
+++ b/drivers/s390/cio/io_sch.h
@@ -1,7 +1,10 @@
1#ifndef S390_IO_SCH_H 1#ifndef S390_IO_SCH_H
2#define S390_IO_SCH_H 2#define S390_IO_SCH_H
3 3
4#include <linux/types.h>
4#include <asm/schid.h> 5#include <asm/schid.h>
6#include <asm/ccwdev.h>
7#include "css.h"
5 8
6/* 9/*
7 * command-mode operation request block 10 * command-mode operation request block
@@ -68,6 +71,52 @@ struct io_subchannel_private {
68#define MAX_CIWS 8 71#define MAX_CIWS 8
69 72
70/* 73/*
74 * Possible status values for a CCW request's I/O.
75 */
76enum io_status {
77 IO_DONE,
78 IO_RUNNING,
79 IO_STATUS_ERROR,
80 IO_PATH_ERROR,
81 IO_REJECTED,
82 IO_KILLED
83};
84
85/**
86 * ccw_request - Internal CCW request.
87 * @cp: channel program to start
88 * @timeout: maximum allowable time in jiffies between start I/O and interrupt
89 * @maxretries: number of retries per I/O operation and path
90 * @lpm: mask of paths to use
91 * @check: optional callback that determines if results are final
92 * @filter: optional callback to adjust request status based on IRB data
93 * @callback: final callback
94 * @data: user-defined pointer passed to all callbacks
95 * @mask: current path mask
96 * @retries: current number of retries
97 * @drc: delayed return code
98 * @cancel: non-zero if request was cancelled
99 * @done: non-zero if request was finished
100 */
101struct ccw_request {
102 struct ccw1 *cp;
103 unsigned long timeout;
104 u16 maxretries;
105 u8 lpm;
106 int (*check)(struct ccw_device *, void *);
107 enum io_status (*filter)(struct ccw_device *, void *, struct irb *,
108 enum io_status);
109 void (*callback)(struct ccw_device *, void *, int);
110 void *data;
111 /* These fields are used internally. */
112 u16 mask;
113 u16 retries;
114 int drc;
115 int cancel:1;
116 int done:1;
117} __attribute__((packed));
118
119/*
71 * sense-id response buffer layout 120 * sense-id response buffer layout
72 */ 121 */
73struct senseid { 122struct senseid {
@@ -82,32 +131,43 @@ struct senseid {
82 struct ciw ciw[MAX_CIWS]; /* variable # of CIWs */ 131 struct ciw ciw[MAX_CIWS]; /* variable # of CIWs */
83} __attribute__ ((packed, aligned(4))); 132} __attribute__ ((packed, aligned(4)));
84 133
134enum cdev_todo {
135 CDEV_TODO_NOTHING,
136 CDEV_TODO_ENABLE_CMF,
137 CDEV_TODO_REBIND,
138 CDEV_TODO_REGISTER,
139 CDEV_TODO_UNREG,
140 CDEV_TODO_UNREG_EVAL,
141};
142
85struct ccw_device_private { 143struct ccw_device_private {
86 struct ccw_device *cdev; 144 struct ccw_device *cdev;
87 struct subchannel *sch; 145 struct subchannel *sch;
88 int state; /* device state */ 146 int state; /* device state */
89 atomic_t onoff; 147 atomic_t onoff;
90 unsigned long registered;
91 struct ccw_dev_id dev_id; /* device id */ 148 struct ccw_dev_id dev_id; /* device id */
92 struct subchannel_id schid; /* subchannel number */ 149 struct subchannel_id schid; /* subchannel number */
93 u8 imask; /* lpm mask for SNID/SID/SPGID */ 150 struct ccw_request req; /* internal I/O request */
94 int iretry; /* retry counter SNID/SID/SPGID */ 151 int iretry;
152 u8 pgid_valid_mask; /* mask of valid PGIDs */
95 struct { 153 struct {
96 unsigned int fast:1; /* post with "channel end" */ 154 unsigned int fast:1; /* post with "channel end" */
97 unsigned int repall:1; /* report every interrupt status */ 155 unsigned int repall:1; /* report every interrupt status */
98 unsigned int pgroup:1; /* do path grouping */ 156 unsigned int pgroup:1; /* do path grouping */
99 unsigned int force:1; /* allow forced online */ 157 unsigned int force:1; /* allow forced online */
158 unsigned int mpath:1; /* do multipathing */
100 } __attribute__ ((packed)) options; 159 } __attribute__ ((packed)) options;
101 struct { 160 struct {
102 unsigned int pgid_single:1; /* use single path for Set PGID */
103 unsigned int esid:1; /* Ext. SenseID supported by HW */ 161 unsigned int esid:1; /* Ext. SenseID supported by HW */
104 unsigned int dosense:1; /* delayed SENSE required */ 162 unsigned int dosense:1; /* delayed SENSE required */
105 unsigned int doverify:1; /* delayed path verification */ 163 unsigned int doverify:1; /* delayed path verification */
106 unsigned int donotify:1; /* call notify function */ 164 unsigned int donotify:1; /* call notify function */
107 unsigned int recog_done:1; /* dev. recog. complete */ 165 unsigned int recog_done:1; /* dev. recog. complete */
108 unsigned int fake_irb:1; /* deliver faked irb */ 166 unsigned int fake_irb:1; /* deliver faked irb */
109 unsigned int intretry:1; /* retry internal operation */
110 unsigned int resuming:1; /* recognition while resume */ 167 unsigned int resuming:1; /* recognition while resume */
168 unsigned int pgroup:1; /* pathgroup is set up */
169 unsigned int mpath:1; /* multipathing is set up */
170 unsigned int initialized:1; /* set if initial reference held */
111 } __attribute__((packed)) flags; 171 } __attribute__((packed)) flags;
112 unsigned long intparm; /* user interruption parameter */ 172 unsigned long intparm; /* user interruption parameter */
113 struct qdio_irq *qdio_data; 173 struct qdio_irq *qdio_data;
@@ -115,7 +175,8 @@ struct ccw_device_private {
115 struct senseid senseid; /* SenseID info */ 175 struct senseid senseid; /* SenseID info */
116 struct pgid pgid[8]; /* path group IDs per chpid*/ 176 struct pgid pgid[8]; /* path group IDs per chpid*/
117 struct ccw1 iccws[2]; /* ccws for SNID/SID/SPGID commands */ 177 struct ccw1 iccws[2]; /* ccws for SNID/SID/SPGID commands */
118 struct work_struct kick_work; 178 struct work_struct todo_work;
179 enum cdev_todo todo;
119 wait_queue_head_t wait_q; 180 wait_queue_head_t wait_q;
120 struct timer_list timer; 181 struct timer_list timer;
121 void *cmb; /* measurement information */ 182 void *cmb; /* measurement information */