diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-08-28 10:45:42 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-09-26 09:44:58 -0400 |
commit | 184b08afb5eab8a43d75f4aa0a0f912653f797d7 (patch) | |
tree | 67bf2ce49c623d899335d44a2783c5bad815f81d /drivers/s390/cio/chsc.c | |
parent | d2fc439b99820cccd6978918c260730dd97bf373 (diff) |
s390/chsc: implement store SCM information
chsc_scm_info will be used to detect all available increments of
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 'drivers/s390/cio/chsc.c')
-rw-r--r-- | drivers/s390/cio/chsc.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index cfe0c087fe5c..121865385c05 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c | |||
@@ -52,6 +52,11 @@ int chsc_error_from_response(int response) | |||
52 | return -EINVAL; | 52 | return -EINVAL; |
53 | case 0x0004: | 53 | case 0x0004: |
54 | return -EOPNOTSUPP; | 54 | return -EOPNOTSUPP; |
55 | case 0x000b: | ||
56 | return -EBUSY; | ||
57 | case 0x0100: | ||
58 | case 0x0102: | ||
59 | return -ENOMEM; | ||
55 | default: | 60 | default: |
56 | return -EIO; | 61 | return -EIO; |
57 | } | 62 | } |
@@ -1047,3 +1052,33 @@ out: | |||
1047 | return rc; | 1052 | return rc; |
1048 | } | 1053 | } |
1049 | EXPORT_SYMBOL_GPL(chsc_siosl); | 1054 | EXPORT_SYMBOL_GPL(chsc_siosl); |
1055 | |||
1056 | /** | ||
1057 | * chsc_scm_info() - store SCM information (SSI) | ||
1058 | * @scm_area: request and response block for SSI | ||
1059 | * @token: continuation token | ||
1060 | * | ||
1061 | * Returns 0 on success. | ||
1062 | */ | ||
1063 | int chsc_scm_info(struct chsc_scm_info *scm_area, u64 token) | ||
1064 | { | ||
1065 | int ccode, ret; | ||
1066 | |||
1067 | memset(scm_area, 0, sizeof(*scm_area)); | ||
1068 | scm_area->request.length = 0x0020; | ||
1069 | scm_area->request.code = 0x004C; | ||
1070 | scm_area->reqtok = token; | ||
1071 | |||
1072 | ccode = chsc(scm_area); | ||
1073 | if (ccode > 0) { | ||
1074 | ret = (ccode == 3) ? -ENODEV : -EBUSY; | ||
1075 | goto out; | ||
1076 | } | ||
1077 | ret = chsc_error_from_response(scm_area->response.code); | ||
1078 | if (ret != 0) | ||
1079 | CIO_MSG_EVENT(2, "chsc: scm info failed (rc=%04x)\n", | ||
1080 | scm_area->response.code); | ||
1081 | out: | ||
1082 | return ret; | ||
1083 | } | ||
1084 | EXPORT_SYMBOL_GPL(chsc_scm_info); | ||