]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/s390/block/dasd_int.h
Merge ../linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / s390 / block / dasd_int.h
index d1b08fa13fd224184a9387625c218302b1724eed..d4b13e300a76db523ad2f263ce2f55023c108e6e 100644 (file)
@@ -26,7 +26,7 @@
  *   new: the dasd_device structure is allocated.
  *   known: the discipline for the device is identified.
  *   basic: the device can do basic i/o.
- *   accept: the device is analysed (format is known).
+ *   unfmt: the device could not be analyzed (format is unknown).
  *   ready: partition detection is done and the device is can do block io.
  *   online: the device accepts requests from the block device queue.
  *
@@ -47,8 +47,9 @@
 #define DASD_STATE_NEW   0
 #define DASD_STATE_KNOWN  1
 #define DASD_STATE_BASIC  2
-#define DASD_STATE_READY  3
-#define DASD_STATE_ONLINE 4
+#define DASD_STATE_UNFMT  3
+#define DASD_STATE_READY  4
+#define DASD_STATE_ONLINE 5
 
 #include <linux/module.h>
 #include <linux/wait.h>
  */
 struct dasd_device;
 
-typedef int (*dasd_ioctl_fn_t) (struct block_device *bdev, int no, long args);
-
-struct dasd_ioctl {
-       struct list_head list;
-       struct module *owner;
-       int no;
-       dasd_ioctl_fn_t handler;
-};
-
 typedef enum {
        dasd_era_fatal = -1,    /* no chance to recover              */
        dasd_era_none = 0,      /* don't recover, everything alright */
@@ -271,10 +263,21 @@ struct dasd_discipline {
         /* i/o control functions. */
        int (*fill_geometry) (struct dasd_device *, struct hd_geometry *);
        int (*fill_info) (struct dasd_device *, struct dasd_information2_t *);
+       int (*ioctl) (struct dasd_device *, unsigned int, void __user *);
 };
 
 extern struct dasd_discipline *dasd_diag_discipline_pointer;
 
+/*
+ * Unique identifier for dasd device.
+ */
+struct dasd_uid {
+       __u8 alias;
+       char vendor[4];
+       char serial[15];
+       __u16 ssid;
+       __u8 unit_addr;
+};
 
 /*
  * Notification numbers for extended error reporting notifications:
@@ -292,17 +295,6 @@ extern struct dasd_discipline *dasd_diag_discipline_pointer;
 #define DASD_EER_STATECHANGE 3
 #define DASD_EER_PPRCSUSPEND 4
 
-/*
- * The dasd_eer_trigger structure contains all data that we need to send
- * along with an DASD_EER_TRIGGER notification.
- */
-struct dasd_eer_trigger {
-       unsigned int id;
-       struct dasd_device *device;
-       struct dasd_ccw_req *cqr;
-};
-
-
 struct dasd_device {
        /* Block device stuff. */
        struct gendisk *gdp;
@@ -317,10 +309,11 @@ struct dasd_device {
        unsigned short features;        /* copy of devmap-features (read-only!) */
 
        /* extended error reporting stuff (eer) */
-       void *eer;
+       struct dasd_ccw_req *eer_cqr;
 
        /* Device discipline stuff. */
        struct dasd_discipline *discipline;
+       struct dasd_discipline *base_discipline;
        char *private;
 
        /* Device state and target state. */
@@ -363,6 +356,8 @@ struct dasd_device {
 /* per device flags */
 #define DASD_FLAG_DSC_ERROR    2       /* return -EIO when disconnected */
 #define DASD_FLAG_OFFLINE      3       /* device is in offline processing */
+#define DASD_FLAG_EER_SNSS     4       /* A SNSS is required */
+#define DASD_FLAG_EER_IN_USE   5       /* A SNSS request is running */
 
 void dasd_put_device_wake(struct dasd_device *);
 
@@ -519,12 +514,6 @@ int dasd_generic_set_online(struct ccw_device *, struct dasd_discipline *);
 int dasd_generic_set_offline (struct ccw_device *cdev);
 int dasd_generic_notify(struct ccw_device *, int);
 void dasd_generic_auto_online (struct ccw_driver *);
-int dasd_register_eer_notifier(struct notifier_block *);
-int dasd_unregister_eer_notifier(struct notifier_block *);
-void dasd_write_eer_trigger(unsigned int , struct dasd_device *,
-                       struct dasd_ccw_req *);
-
-
 
 /* externals in dasd_devmap.c */
 extern int dasd_max_devindex;
@@ -537,6 +526,8 @@ void dasd_devmap_exit(void);
 struct dasd_device *dasd_create_device(struct ccw_device *);
 void dasd_delete_device(struct dasd_device *);
 
+int dasd_get_uid(struct ccw_device *, struct dasd_uid *);
+int dasd_set_uid(struct ccw_device *, struct dasd_uid *);
 int dasd_get_feature(struct ccw_device *, int);
 int dasd_set_feature(struct ccw_device *, int, int);
 
@@ -558,10 +549,6 @@ int dasd_scan_partitions(struct dasd_device *);
 void dasd_destroy_partitions(struct dasd_device *);
 
 /* externals in dasd_ioctl.c */
-int  dasd_ioctl_init(void);
-void dasd_ioctl_exit(void);
-int  dasd_ioctl_no_register(struct module *, int, dasd_ioctl_fn_t);
-int  dasd_ioctl_no_unregister(struct module *, int, dasd_ioctl_fn_t);
 int  dasd_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
 long dasd_compat_ioctl(struct file *, unsigned int, unsigned long);
 
@@ -592,6 +579,30 @@ dasd_era_t dasd_9336_erp_examine(struct dasd_ccw_req *, struct irb *);
 dasd_era_t dasd_9343_erp_examine(struct dasd_ccw_req *, struct irb *);
 struct dasd_ccw_req *dasd_9343_erp_action(struct dasd_ccw_req *);
 
+/* externals in dasd_eer.c */
+#ifdef CONFIG_DASD_EER
+int dasd_eer_init(void);
+void dasd_eer_exit(void);
+int dasd_eer_enable(struct dasd_device *);
+void dasd_eer_disable(struct dasd_device *);
+void dasd_eer_write(struct dasd_device *, struct dasd_ccw_req *cqr,
+                   unsigned int id);
+void dasd_eer_snss(struct dasd_device *);
+
+static inline int dasd_eer_enabled(struct dasd_device *device)
+{
+       return device->eer_cqr != NULL;
+}
+#else
+#define dasd_eer_init()                (0)
+#define dasd_eer_exit()                do { } while (0)
+#define dasd_eer_enable(d)     (0)
+#define dasd_eer_disable(d)    do { } while (0)
+#define dasd_eer_write(d,c,i)  do { } while (0)
+#define dasd_eer_snss(d)       do { } while (0)
+#define dasd_eer_enabled(d)    (0)
+#endif /* CONFIG_DASD_ERR */
+
 #endif                         /* __KERNEL__ */
 
 #endif                         /* DASD_H */