From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 07/14] mei: add hbm commands return status values
Date: Thu, 21 Aug 2014 14:29:16 +0300 [thread overview]
Message-ID: <1408620563-25834-7-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1408620563-25834-1-git-send-email-tomas.winkler@intel.com>
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>
---
drivers/misc/mei/hbm.c | 22 ++++++++++++++++++++--
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 5fb177b..d50c8d1 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;
}
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h
index 50526f9..6e31113 100644
--- a/drivers/misc/mei/hw.h
+++ b/drivers/misc/mei/hw.h
@@ -97,23 +97,50 @@ enum mei_stop_reason_types {
SYSTEM_S5_ENTRY = 0x08
};
+
+/**
+ * mei_hbm_status - mei host bus messages return values
+ *
+ * @MEI_HBMS_SUCCESS - status success
+ * @MEI_HBMS_CLIENT_NOT_FOUND - client not found
+ * @MEI_HBMS_ALREADY_EXISTS - connection already established
+ * @MEI_HBMS_REJECTED - connection is rejected
+ * @MEI_HBMS_INVALID_PARAMETER - invalid parameter
+ * @MEI_HBMS_NOT_ALLOWED - operation not allowed
+ * @MEI_HBMS_ALREADY_STARTED - system is already started
+ * @MEI_HBMS_NOT_STARTED - system not started
+ */
+enum mei_hbm_status {
+ MEI_HBMS_SUCCESS = 0,
+ MEI_HBMS_CLIENT_NOT_FOUND = 1,
+ MEI_HBMS_ALREADY_EXISTS = 2,
+ MEI_HBMS_REJECTED = 3,
+ MEI_HBMS_INVALID_PARAMETER = 4,
+ MEI_HBMS_NOT_ALLOWED = 5,
+ MEI_HBMS_ALREADY_STARTED = 6,
+ MEI_HBMS_NOT_STARTED = 7,
+
+ MEI_HBMS_MAX
+};
+
+
/*
* Client Connect Status
* used by hbm_client_connect_response.status
*/
enum mei_cl_connect_status {
- MEI_CL_CONN_SUCCESS = 0x00,
- MEI_CL_CONN_NOT_FOUND = 0x01,
- MEI_CL_CONN_ALREADY_STARTED = 0x02,
- MEI_CL_CONN_OUT_OF_RESOURCES = 0x03,
- MEI_CL_CONN_MESSAGE_SMALL = 0x04
+ MEI_CL_CONN_SUCCESS = MEI_HBMS_SUCCESS,
+ MEI_CL_CONN_NOT_FOUND = MEI_HBMS_CLIENT_NOT_FOUND,
+ MEI_CL_CONN_ALREADY_STARTED = MEI_HBMS_ALREADY_EXISTS,
+ MEI_CL_CONN_OUT_OF_RESOURCES = MEI_HBMS_REJECTED,
+ MEI_CL_CONN_MESSAGE_SMALL = MEI_HBMS_INVALID_PARAMETER,
};
/*
* Client Disconnect Status
*/
enum mei_cl_disconnect_status {
- MEI_CL_DISCONN_SUCCESS = 0x00
+ MEI_CL_DISCONN_SUCCESS = MEI_HBMS_SUCCESS
};
/*
--
1.9.3
next prev parent reply other threads:[~2014-08-21 11:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 11:29 [char-misc-next 01/14] mei: use consistently me_addr in the hbm structures Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 02/14] mei: use wrapper for simple hbm client message Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 03/14] mei: me_client lookup function to return me_client object Tomas Winkler
2014-08-21 12:32 ` Josh Boyer
2014-08-21 13:14 ` Winkler, Tomas
2014-08-21 11:29 ` [char-misc-next 04/14] mei: use list for me clients book keeping Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 05/14] mei: add me client remove functions Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 06/14] mei: add mei_me_cl_by_uuid_id function Tomas Winkler
2014-08-21 11:29 ` Tomas Winkler [this message]
2014-08-21 11:29 ` [char-misc-next 08/14] mei: use disconnect name consistently Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 09/14] mei: revamp connect and disconnect response handling Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 10/14] mei: wait for hbm start non-interruptible Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 11/14] mei: simplify handling of hbm client events Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 12/14] mei: extract supported features from the hbm version Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 13/14] mei: enable adding more IOCTL handlers Tomas Winkler
2014-08-21 11:29 ` [char-misc-next 14/14] mei: use connect_data on the stack Tomas Winkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1408620563-25834-7-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®