aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390/ccwdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390/ccwdev.h')
-rw-r--r--include/asm-s390/ccwdev.h75
1 files changed, 33 insertions, 42 deletions
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 1aeda27d5a8b..8e961aa4b394 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -67,36 +67,53 @@ ccw_device_id_match(const struct ccw_device_id *array,
67 return NULL; 67 return NULL;
68} 68}
69 69
70/* The struct ccw device is our replacement for the globally accessible 70/**
71 * ioinfo array. ioinfo will mutate into a subchannel device later. 71 * struct ccw_device - channel attached device
72 * @ccwlock: pointer to device lock
73 * @id: id of this device
74 * @drv: ccw driver for this device
75 * @dev: embedded device structure
76 * @online: online status of device
77 * @handler: interrupt handler
72 * 78 *
73 * Reference: Documentation/s390/driver-model.txt */ 79 * @handler is a member of the device rather than the driver since a driver
80 * can have different interrupt handlers for different ccw devices
81 * (multi-subchannel drivers).
82 */
74struct ccw_device { 83struct ccw_device {
75 spinlock_t *ccwlock; 84 spinlock_t *ccwlock;
85/* private: */
76 struct ccw_device_private *private; /* cio private information */ 86 struct ccw_device_private *private; /* cio private information */
77 struct ccw_device_id id; /* id of this device, driver_info is 87/* public: */
78 set by ccw_find_driver */ 88 struct ccw_device_id id;
79 struct ccw_driver *drv; /* */ 89 struct ccw_driver *drv;
80 struct device dev; /* */ 90 struct device dev;
81 int online; 91 int online;
82 /* This is sick, but a driver can have different interrupt handlers
83 for different ccw_devices (multi-subchannel drivers)... */
84 void (*handler) (struct ccw_device *, unsigned long, struct irb *); 92 void (*handler) (struct ccw_device *, unsigned long, struct irb *);
85}; 93};
86 94
87 95
88/* Each ccw driver registers with the ccw root bus */ 96/**
97 * struct ccw driver - device driver for channel attached devices
98 * @owner: owning module
99 * @ids: ids supported by this driver
100 * @probe: function called on probe
101 * @remove: function called on remove
102 * @set_online: called when setting device online
103 * @set_offline: called when setting device offline
104 * @notify: notify driver of device state changes
105 * @driver: embedded device driver structure
106 * @name: device driver name
107 */
89struct ccw_driver { 108struct ccw_driver {
90 struct module *owner; /* for automatic MOD_INC_USE_COUNT */ 109 struct module *owner;
91 struct ccw_device_id *ids; /* probe driver with these devs */ 110 struct ccw_device_id *ids;
92 int (*probe) (struct ccw_device *); /* ask driver to probe dev */ 111 int (*probe) (struct ccw_device *);
93 void (*remove) (struct ccw_device *); 112 void (*remove) (struct ccw_device *);
94 /* device is no longer available */
95 int (*set_online) (struct ccw_device *); 113 int (*set_online) (struct ccw_device *);
96 int (*set_offline) (struct ccw_device *); 114 int (*set_offline) (struct ccw_device *);
97 int (*notify) (struct ccw_device *, int); 115 int (*notify) (struct ccw_device *, int);
98 struct device_driver driver; /* higher level structure, don't init 116 struct device_driver driver;
99 this from your driver */
100 char *name; 117 char *name;
101}; 118};
102 119
@@ -124,36 +141,10 @@ extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
124/* Allow forced onlining of boxed devices. */ 141/* Allow forced onlining of boxed devices. */
125#define CCWDEV_ALLOW_FORCE 0x0008 142#define CCWDEV_ALLOW_FORCE 0x0008
126 143
127/*
128 * ccw_device_start()
129 *
130 * Start a S/390 channel program. When the interrupt arrives, the
131 * IRQ handler is called, either immediately, delayed (dev-end missing,
132 * or sense required) or never (no IRQ handler registered).
133 * Depending on the action taken, ccw_device_start() returns:
134 * 0 - Success
135 * -EBUSY - Device busy, or status pending
136 * -ENODEV - Device not operational
137 * -EINVAL - Device invalid for operation
138 */
139extern int ccw_device_start(struct ccw_device *, struct ccw1 *, 144extern int ccw_device_start(struct ccw_device *, struct ccw1 *,
140 unsigned long, __u8, unsigned long); 145 unsigned long, __u8, unsigned long);
141/*
142 * ccw_device_start_timeout()
143 *
144 * This function notifies the device driver if the channel program has not
145 * completed during the specified time. If a timeout occurs, the channel
146 * program is terminated via xsch(), hsch() or csch().
147 */
148extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *, 146extern int ccw_device_start_timeout(struct ccw_device *, struct ccw1 *,
149 unsigned long, __u8, unsigned long, int); 147 unsigned long, __u8, unsigned long, int);
150/*
151 * ccw_device_start_key()
152 * ccw_device_start_key_timeout()
153 *
154 * Same as ccw_device_start() and ccw_device_start_timeout(), except a
155 * storage key != default key can be provided for the I/O.
156 */
157extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *, 148extern int ccw_device_start_key(struct ccw_device *, struct ccw1 *,
158 unsigned long, __u8, __u8, unsigned long); 149 unsigned long, __u8, __u8, unsigned long);
159extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *, 150extern int ccw_device_start_timeout_key(struct ccw_device *, struct ccw1 *,