summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/eadm.h
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2012-08-28 16:46:26 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-09-26 15:44:59 +0200
commit1d1c8f78bed5f8e769757525bd9c2dec69f11a44 (patch)
tree75f1ef4eb3836975e46a86fad456e8bafa1a5ffe /arch/s390/include/asm/eadm.h
parent184b08afb5eab8a43d75f4aa0a0f912653f797d7 (diff)
s390: add scm bus driver
Bus driver to manage Storage Class Memory. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/eadm.h')
-rw-r--r--arch/s390/include/asm/eadm.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/s390/include/asm/eadm.h b/arch/s390/include/asm/eadm.h
index 4a65803baa0..3922f525717 100644
--- a/arch/s390/include/asm/eadm.h
+++ b/arch/s390/include/asm/eadm.h
@@ -2,6 +2,8 @@
#define _ASM_S390_EADM_H
#include <linux/types.h>
+#include <linux/device.h>
+#include <linux/spinlock.h>
struct arqb {
u64 data;
@@ -71,4 +73,53 @@ struct aob {
struct msb msb[AOB_NR_MSB];
} __packed __aligned(PAGE_SIZE);
+struct aob_rq_header {
+ struct scm_device *scmdev;
+ char data[0];
+};
+
+struct scm_device {
+ u64 address;
+ u64 size;
+ unsigned int nr_max_block;
+ struct device dev;
+ spinlock_t lock;
+ struct {
+ unsigned int persistence:4;
+ unsigned int oper_state:4;
+ unsigned int data_state:4;
+ unsigned int rank:4;
+ unsigned int release:1;
+ unsigned int res_id:8;
+ } __packed attrs;
+};
+
+#define OP_STATE_GOOD 1
+#define OP_STATE_TEMP_ERR 2
+#define OP_STATE_PERM_ERR 3
+
+struct scm_driver {
+ struct device_driver drv;
+ int (*probe) (struct scm_device *scmdev);
+ int (*remove) (struct scm_device *scmdev);
+ void (*handler) (struct scm_device *scmdev, void *data, int error);
+};
+
+int scm_driver_register(struct scm_driver *scmdrv);
+void scm_driver_unregister(struct scm_driver *scmdrv);
+
+int scm_start_aob(struct aob *aob);
+void scm_irq_handler(struct aob *aob, int error);
+
+struct eadm_ops {
+ int (*eadm_start) (struct aob *aob);
+ struct module *owner;
+};
+
+int scm_get_ref(void);
+void scm_put_ref(void);
+
+void register_eadm_ops(struct eadm_ops *ops);
+void unregister_eadm_ops(struct eadm_ops *ops);
+
#endif /* _ASM_S390_EADM_H */