]> err.no Git - linux-2.6/blobdiff - drivers/s390/cio/device_ops.c
Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6
[linux-2.6] / drivers / s390 / cio / device_ops.c
index d269607336ec212368d7302511426c43c7cefab0..16f59fcb66b13938480a497f4d2deeda2d9fa669 100644 (file)
 
 #include <asm/ccwdev.h>
 #include <asm/idals.h>
+#include <asm/chpid.h>
 
 #include "cio.h"
 #include "cio_debug.h"
 #include "css.h"
 #include "chsc.h"
 #include "device.h"
+#include "chp.h"
 
-int
-ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
+int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
 {
        /*
        * The flag usage is mutal exclusive ...
@@ -39,6 +40,33 @@ ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
        return 0;
 }
 
+int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
+{
+       /*
+       * The flag usage is mutal exclusive ...
+       */
+       if (((flags & CCWDEV_EARLY_NOTIFICATION) &&
+           (flags & CCWDEV_REPORT_ALL)) ||
+           ((flags & CCWDEV_EARLY_NOTIFICATION) &&
+            cdev->private->options.repall) ||
+           ((flags & CCWDEV_REPORT_ALL) &&
+            cdev->private->options.fast))
+               return -EINVAL;
+       cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0;
+       cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0;
+       cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0;
+       cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0;
+       return 0;
+}
+
+void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags)
+{
+       cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0;
+       cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0;
+       cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0;
+       cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0;
+}
+
 int
 ccw_device_clear(struct ccw_device *cdev, unsigned long intparm)
 {
@@ -302,7 +330,7 @@ ccw_device_wake_up(struct ccw_device *cdev, unsigned long ip, struct irb *irb)
        wake_up(&cdev->private->wait_q);
 }
 
-static inline int
+static int
 __ccw_device_retry_loop(struct ccw_device *cdev, struct ccw1 *ccw, long magic, __u8 lpm)
 {
        int ret;
@@ -580,9 +608,12 @@ void *
 ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
 {
        struct subchannel *sch;
+       struct chp_id chpid;
 
        sch = to_subchannel(cdev->dev.parent);
-       return chsc_get_chp_desc(sch, chp_no);
+       chp_id_init(&chpid);
+       chpid.id = sch->schib.pmcw.chpid[chp_no];
+       return chp_get_chp_desc(chpid);
 }
 
 // FIXME: these have to go:
@@ -601,7 +632,9 @@ _ccw_device_get_device_number(struct ccw_device *cdev)
 
 
 MODULE_LICENSE("GPL");
+EXPORT_SYMBOL(ccw_device_set_options_mask);
 EXPORT_SYMBOL(ccw_device_set_options);
+EXPORT_SYMBOL(ccw_device_clear_options);
 EXPORT_SYMBOL(ccw_device_clear);
 EXPORT_SYMBOL(ccw_device_halt);
 EXPORT_SYMBOL(ccw_device_resume);