This source file includes following definitions.
- sch_get_cdev
- sch_set_cdev
1
2 #ifndef S390_IO_SCH_H
3 #define S390_IO_SCH_H
4
5 #include <linux/types.h>
6 #include <asm/schid.h>
7 #include <asm/ccwdev.h>
8 #include <asm/irq.h>
9 #include "css.h"
10 #include "orb.h"
11
12 struct io_subchannel_dma_area {
13 struct ccw1 sense_ccw;
14 };
15
16 struct io_subchannel_private {
17 union orb orb;
18 struct ccw_device *cdev;
19 struct {
20 unsigned int suspend:1;
21 unsigned int prefetch:1;
22 unsigned int inter:1;
23 } __packed options;
24 struct io_subchannel_dma_area *dma_area;
25 dma_addr_t dma_area_dma;
26 } __aligned(8);
27
28 #define to_io_private(n) ((struct io_subchannel_private *) \
29 dev_get_drvdata(&(n)->dev))
30 #define set_io_private(n, p) (dev_set_drvdata(&(n)->dev, p))
31
32 static inline struct ccw_device *sch_get_cdev(struct subchannel *sch)
33 {
34 struct io_subchannel_private *priv = to_io_private(sch);
35 return priv ? priv->cdev : NULL;
36 }
37
38 static inline void sch_set_cdev(struct subchannel *sch,
39 struct ccw_device *cdev)
40 {
41 struct io_subchannel_private *priv = to_io_private(sch);
42 if (priv)
43 priv->cdev = cdev;
44 }
45
46 #define MAX_CIWS 8
47
48
49
50
51 enum io_status {
52 IO_DONE,
53 IO_RUNNING,
54 IO_STATUS_ERROR,
55 IO_PATH_ERROR,
56 IO_REJECTED,
57 IO_KILLED
58 };
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 struct ccw_request {
78 struct ccw1 *cp;
79 unsigned long timeout;
80 u16 maxretries;
81 u8 lpm;
82 int (*check)(struct ccw_device *, void *);
83 enum io_status (*filter)(struct ccw_device *, void *, struct irb *,
84 enum io_status);
85 void (*callback)(struct ccw_device *, void *, int);
86 void *data;
87 unsigned int singlepath:1;
88
89 unsigned int cancel:1;
90 unsigned int done:1;
91 u16 mask;
92 u16 retries;
93 int drc;
94 } __attribute__((packed));
95
96
97
98
99 struct senseid {
100
101 u8 reserved;
102 u16 cu_type;
103 u8 cu_model;
104 u16 dev_type;
105 u8 dev_model;
106 u8 unused;
107
108 struct ciw ciw[MAX_CIWS];
109 } __attribute__ ((packed, aligned(4)));
110
111 enum cdev_todo {
112 CDEV_TODO_NOTHING,
113 CDEV_TODO_ENABLE_CMF,
114 CDEV_TODO_REBIND,
115 CDEV_TODO_REGISTER,
116 CDEV_TODO_UNREG,
117 CDEV_TODO_UNREG_EVAL,
118 };
119
120 #define FAKE_CMD_IRB 1
121 #define FAKE_TM_IRB 2
122
123 struct ccw_device_dma_area {
124 struct senseid senseid;
125 struct ccw1 iccws[2];
126 struct irb irb;
127 struct pgid pgid[8];
128 };
129
130 struct ccw_device_private {
131 struct ccw_device *cdev;
132 struct subchannel *sch;
133 int state;
134 atomic_t onoff;
135 struct ccw_dev_id dev_id;
136 struct ccw_request req;
137 int iretry;
138 u8 pgid_valid_mask;
139 u8 pgid_todo_mask;
140 u8 pgid_reset_mask;
141 u8 path_noirq_mask;
142
143 u8 path_notoper_mask;
144
145 u8 path_gone_mask;
146 u8 path_new_mask;
147 u8 path_broken_mask;
148
149 struct {
150 unsigned int fast:1;
151 unsigned int repall:1;
152 unsigned int pgroup:1;
153 unsigned int force:1;
154 unsigned int mpath:1;
155 } __attribute__ ((packed)) options;
156 struct {
157 unsigned int esid:1;
158 unsigned int dosense:1;
159 unsigned int doverify:1;
160 unsigned int donotify:1;
161 unsigned int recog_done:1;
162 unsigned int fake_irb:2;
163 unsigned int resuming:1;
164 unsigned int pgroup:1;
165 unsigned int mpath:1;
166 unsigned int pgid_unknown:1;
167 unsigned int initialized:1;
168 } __attribute__((packed)) flags;
169 unsigned long intparm;
170 struct qdio_irq *qdio_data;
171 int async_kill_io_rc;
172 struct work_struct todo_work;
173 enum cdev_todo todo;
174 wait_queue_head_t wait_q;
175 struct timer_list timer;
176 void *cmb;
177 struct list_head cmb_list;
178 u64 cmb_start_time;
179 void *cmb_wait;
180 struct gen_pool *dma_pool;
181 struct ccw_device_dma_area *dma_area;
182 enum interruption_class int_class;
183 };
184
185 #endif