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 /drivers/misc/mei/hbm.c | |
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>
Diffstat (limited to 'drivers/misc/mei/hbm.c')
-rw-r--r-- | drivers/misc/mei/hbm.c | 22 |
1 files changed, 20 insertions, 2 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 | ||