diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2014-08-21 07:29:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-24 01:57:48 -0400 |
commit | 89778d6e2a39027977e2de822808bd82afd6ea46 (patch) | |
tree | 0b4fa5b14004648ae4a1643e3f6bdb3ef78f46d9 | |
parent | d880f3294d0576e79dfab4e2cd5a2eb62fe188f0 (diff) |
mei: add hbm commands return status values
HBM uses global list of status values
from which the values of particular commands
are derived
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/mei/hbm.c | 22 | ||||
-rw-r--r-- | drivers/misc/mei/hw.h | 39 |
2 files changed, 53 insertions, 8 deletions
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index 5fb177b3bfef..d50c8d1fb36d 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c | |||
@@ -25,6 +25,23 @@ | |||
25 | #include "hbm.h" | 25 | #include "hbm.h" |
26 | #include "client.h" | 26 | #include "client.h" |
27 | 27 | ||
28 | static const char *mei_hbm_status_str(enum mei_hbm_status status) | ||
29 | { | ||
30 | #define MEI_HBM_STATUS(status) case MEI_HBMS_##status: return #status | ||
31 | switch (status) { | ||
32 | MEI_HBM_STATUS(SUCCESS); | ||
33 | MEI_HBM_STATUS(CLIENT_NOT_FOUND); | ||
34 | MEI_HBM_STATUS(ALREADY_EXISTS); | ||
35 | MEI_HBM_STATUS(REJECTED); | ||
36 | MEI_HBM_STATUS(INVALID_PARAMETER); | ||
37 | MEI_HBM_STATUS(NOT_ALLOWED); | ||
38 | MEI_HBM_STATUS(ALREADY_STARTED); | ||
39 | MEI_HBM_STATUS(NOT_STARTED); | ||
40 | default: return "unknown"; | ||
41 | } | ||
42 | #undef MEI_HBM_STATUS | ||
43 | }; | ||
44 | |||
28 | static const char *mei_cl_conn_status_str(enum mei_cl_connect_status status) | 45 | static const char *mei_cl_conn_status_str(enum mei_cl_connect_status status) |
29 | { | 46 | { |
30 | #define MEI_CL_CS(status) case MEI_CL_CONN_##status: return #status | 47 | #define MEI_CL_CS(status) case MEI_CL_CONN_##status: return #status |
@@ -770,8 +787,9 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) | |||
770 | props_res = (struct hbm_props_response *)mei_msg; | 787 | props_res = (struct hbm_props_response *)mei_msg; |
771 | 788 | ||
772 | if (props_res->status) { | 789 | if (props_res->status) { |
773 | dev_err(&dev->pdev->dev, "hbm: properties response: wrong status = %d\n", | 790 | dev_err(&dev->pdev->dev, "hbm: properties response: wrong status = %d %s\n", |
774 | props_res->status); | 791 | props_res->status, |
792 | mei_hbm_status_str(props_res->status)); | ||
775 | return -EPROTO; | 793 | return -EPROTO; |
776 | } | 794 | } |
777 | 795 | ||
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h index 50526f92f092..6e31113b63df 100644 --- a/drivers/misc/mei/hw.h +++ b/drivers/misc/mei/hw.h | |||
@@ -97,23 +97,50 @@ enum mei_stop_reason_types { | |||
97 | SYSTEM_S5_ENTRY = 0x08 | 97 | SYSTEM_S5_ENTRY = 0x08 |
98 | }; | 98 | }; |
99 | 99 | ||
100 | |||
101 | /** | ||
102 | * mei_hbm_status - mei host bus messages return values | ||
103 | * | ||
104 | * @MEI_HBMS_SUCCESS - status success | ||
105 | * @MEI_HBMS_CLIENT_NOT_FOUND - client not found | ||
106 | * @MEI_HBMS_ALREADY_EXISTS - connection already established | ||
107 | * @MEI_HBMS_REJECTED - connection is rejected | ||
108 | * @MEI_HBMS_INVALID_PARAMETER - invalid parameter | ||
109 | * @MEI_HBMS_NOT_ALLOWED - operation not allowed | ||
110 | * @MEI_HBMS_ALREADY_STARTED - system is already started | ||
111 | * @MEI_HBMS_NOT_STARTED - system not started | ||
112 | */ | ||
113 | enum mei_hbm_status { | ||
114 | MEI_HBMS_SUCCESS = 0, | ||
115 | MEI_HBMS_CLIENT_NOT_FOUND = 1, | ||
116 | MEI_HBMS_ALREADY_EXISTS = 2, | ||
117 | MEI_HBMS_REJECTED = 3, | ||
118 | MEI_HBMS_INVALID_PARAMETER = 4, | ||
119 | MEI_HBMS_NOT_ALLOWED = 5, | ||
120 | MEI_HBMS_ALREADY_STARTED = 6, | ||
121 | MEI_HBMS_NOT_STARTED = 7, | ||
122 | |||
123 | MEI_HBMS_MAX | ||
124 | }; | ||
125 | |||
126 | |||
100 | /* | 127 | /* |
101 | * Client Connect Status | 128 | * Client Connect Status |
102 | * used by hbm_client_connect_response.status | 129 | * used by hbm_client_connect_response.status |
103 | */ | 130 | */ |
104 | enum mei_cl_connect_status { | 131 | enum mei_cl_connect_status { |
105 | MEI_CL_CONN_SUCCESS = 0x00, | 132 | MEI_CL_CONN_SUCCESS = MEI_HBMS_SUCCESS, |
106 | MEI_CL_CONN_NOT_FOUND = 0x01, | 133 | MEI_CL_CONN_NOT_FOUND = MEI_HBMS_CLIENT_NOT_FOUND, |
107 | MEI_CL_CONN_ALREADY_STARTED = 0x02, | 134 | MEI_CL_CONN_ALREADY_STARTED = MEI_HBMS_ALREADY_EXISTS, |
108 | MEI_CL_CONN_OUT_OF_RESOURCES = 0x03, | 135 | MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED, |
109 | MEI_CL_CONN_MESSAGE_SMALL = 0x04 | 136 | MEI_CL_CONN_MESSAGE_SMALL = MEI_HBMS_INVALID_PARAMETER, |
110 | }; | 137 | }; |
111 | 138 | ||
112 | /* | 139 | /* |
113 | * Client Disconnect Status | 140 | * Client Disconnect Status |
114 | */ | 141 | */ |
115 | enum mei_cl_disconnect_status { | 142 | enum mei_cl_disconnect_status { |
116 | MEI_CL_DISCONN_SUCCESS = 0x00 | 143 | MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS |
117 | }; | 144 | }; |
118 | 145 | ||
119 | /* | 146 | /* |