From 89778d6e2a39027977e2de822808bd82afd6ea46 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Thu, 21 Aug 2014 14:29:16 +0300 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/hbm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'drivers/misc/mei/hbm.c') 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 @@ #include "hbm.h" #include "client.h" +static const char *mei_hbm_status_str(enum mei_hbm_status status) +{ +#define MEI_HBM_STATUS(status) case MEI_HBMS_##status: return #status + switch (status) { + MEI_HBM_STATUS(SUCCESS); + MEI_HBM_STATUS(CLIENT_NOT_FOUND); + MEI_HBM_STATUS(ALREADY_EXISTS); + MEI_HBM_STATUS(REJECTED); + MEI_HBM_STATUS(INVALID_PARAMETER); + MEI_HBM_STATUS(NOT_ALLOWED); + MEI_HBM_STATUS(ALREADY_STARTED); + MEI_HBM_STATUS(NOT_STARTED); + default: return "unknown"; + } +#undef MEI_HBM_STATUS +}; + static const char *mei_cl_conn_status_str(enum mei_cl_connect_status status) { #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) props_res = (struct hbm_props_response *)mei_msg; if (props_res->status) { - dev_err(&dev->pdev->dev, "hbm: properties response: wrong status = %d\n", - props_res->status); + dev_err(&dev->pdev->dev, "hbm: properties response: wrong status = %d %s\n", + props_res->status, + mei_hbm_status_str(props_res->status)); return -EPROTO; } -- cgit v1.2.3-55-g7522