]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
s390: Add a mechanism to get the subchannel id.
authorCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 30 May 2012 14:03:22 +0000 (16:03 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 12 Nov 2012 15:24:46 +0000 (16:24 +0100)
This will be needed by the new virtio-ccw transport.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/ccwdev.h
drivers/s390/cio/device_ops.c

index 1cb4bb3f32d92709d11cee7f96c198d2689d3a77..9ad79f7f1accc57d8a96c90b3bde52eecad2d844 100644 (file)
@@ -18,6 +18,9 @@ struct irb;
 struct ccw1;
 struct ccw_dev_id;
 
+/* from asm/schid.h */
+struct subchannel_id;
+
 /* simplified initializers for struct ccw_device:
  * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
  * entry in your MODULE_DEVICE_TABLE and set the match_flag correctly */
@@ -226,5 +229,7 @@ int ccw_device_siosl(struct ccw_device *);
 // FIXME: these have to go
 extern int _ccw_device_get_subchannel_number(struct ccw_device *);
 
+extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
+
 extern void *ccw_device_get_chp_desc(struct ccw_device *, int);
 #endif /* _S390_CCWDEV_H_ */
index ec7fb6d3b479a25a32bfad67ecc36a3539782b39..2ad832f8e340f56f78bd41b1ead3fa8d9f5ca435 100644 (file)
@@ -763,6 +763,18 @@ _ccw_device_get_subchannel_number(struct ccw_device *cdev)
        return cdev->private->schid.sch_no;
 }
 
+/**
+ * ccw_device_get_schid - obtain a subchannel id
+ * @cdev: device to obtain the id for
+ * @schid: where to fill in the values
+ */
+void ccw_device_get_schid(struct ccw_device *cdev, struct subchannel_id *schid)
+{
+       struct subchannel *sch = to_subchannel(cdev->dev.parent);
+
+       *schid = sch->schid;
+}
+EXPORT_SYMBOL_GPL(ccw_device_get_schid);
 
 MODULE_LICENSE("GPL");
 EXPORT_SYMBOL(ccw_device_set_options_mask);