diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2014-09-29 09:31:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-29 11:56:00 -0400 |
commit | 1beeb4b9fbb27432f93ae8fe157228b7b897974a (patch) | |
tree | 4dee2cee20c2d535a0fae7a959d7095b5ebdbff4 /drivers/misc | |
parent | 046c7911b224267062ab1caeabbf11bc46e9c152 (diff) |
mei: add hbm and pg state in devstate debugfs print
Add hbm state, pg enablement and state to devstate file in debugfs
(<debugfs>/mei/devstate)
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/mei/debugfs.c | 7 | ||||
-rw-r--r-- | drivers/misc/mei/hbm.c | 16 | ||||
-rw-r--r-- | drivers/misc/mei/hbm.h | 2 | ||||
-rw-r--r-- | drivers/misc/mei/init.c | 12 | ||||
-rw-r--r-- | drivers/misc/mei/mei_dev.h | 2 |
5 files changed, 38 insertions, 1 deletions
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c index 3b032881622d..2399b3181e6c 100644 --- a/drivers/misc/mei/debugfs.c +++ b/drivers/misc/mei/debugfs.c | |||
@@ -134,8 +134,13 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf, | |||
134 | if (!buf) | 134 | if (!buf) |
135 | return -ENOMEM; | 135 | return -ENOMEM; |
136 | 136 | ||
137 | pos += scnprintf(buf + pos, bufsz - pos, "%s\n", | 137 | pos += scnprintf(buf + pos, bufsz - pos, "dev: %s\n", |
138 | mei_dev_state_str(dev->dev_state)); | 138 | mei_dev_state_str(dev->dev_state)); |
139 | pos += scnprintf(buf + pos, bufsz - pos, "hbm: %s\n", | ||
140 | mei_hbm_state_str(dev->hbm_state)); | ||
141 | pos += scnprintf(buf + pos, bufsz - pos, "pg: %s, %s\n", | ||
142 | mei_pg_is_enabled(dev) ? "ENABLED" : "DISABLED", | ||
143 | mei_pg_state_str(mei_pg_state(dev))); | ||
139 | ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, pos); | 144 | ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, pos); |
140 | kfree(buf); | 145 | kfree(buf); |
141 | return ret; | 146 | return ret; |
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index 9fc051b7f1a3..3311b5c323af 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c | |||
@@ -56,6 +56,22 @@ static const char *mei_cl_conn_status_str(enum mei_cl_connect_status status) | |||
56 | #undef MEI_CL_CCS | 56 | #undef MEI_CL_CCS |
57 | } | 57 | } |
58 | 58 | ||
59 | const char *mei_hbm_state_str(enum mei_hbm_state state) | ||
60 | { | ||
61 | #define MEI_HBM_STATE(state) case MEI_HBM_##state: return #state | ||
62 | switch (state) { | ||
63 | MEI_HBM_STATE(IDLE); | ||
64 | MEI_HBM_STATE(STARTING); | ||
65 | MEI_HBM_STATE(STARTED); | ||
66 | MEI_HBM_STATE(ENUM_CLIENTS); | ||
67 | MEI_HBM_STATE(CLIENT_PROPERTIES); | ||
68 | MEI_HBM_STATE(STOPPED); | ||
69 | default: | ||
70 | return "unknown"; | ||
71 | } | ||
72 | #undef MEI_HBM_STATE | ||
73 | } | ||
74 | |||
59 | /** | 75 | /** |
60 | * mei_cl_conn_status_to_errno - convert client connect response | 76 | * mei_cl_conn_status_to_errno - convert client connect response |
61 | * status to error code | 77 | * status to error code |
diff --git a/drivers/misc/mei/hbm.h b/drivers/misc/mei/hbm.h index 80920f096c04..efcb0d45bbe6 100644 --- a/drivers/misc/mei/hbm.h +++ b/drivers/misc/mei/hbm.h | |||
@@ -40,6 +40,8 @@ enum mei_hbm_state { | |||
40 | MEI_HBM_STOPPED, | 40 | MEI_HBM_STOPPED, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | const char *mei_hbm_state_str(enum mei_hbm_state state); | ||
44 | |||
43 | int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr); | 45 | int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr); |
44 | 46 | ||
45 | static inline void mei_hbm_hdr(struct mei_msg_hdr *hdr, size_t length) | 47 | static inline void mei_hbm_hdr(struct mei_msg_hdr *hdr, size_t length) |
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index 9f635be684ea..81695e4cf0a0 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c | |||
@@ -43,6 +43,18 @@ const char *mei_dev_state_str(int state) | |||
43 | #undef MEI_DEV_STATE | 43 | #undef MEI_DEV_STATE |
44 | } | 44 | } |
45 | 45 | ||
46 | const char *mei_pg_state_str(enum mei_pg_state state) | ||
47 | { | ||
48 | #define MEI_PG_STATE(state) case MEI_PG_##state: return #state | ||
49 | switch (state) { | ||
50 | MEI_PG_STATE(OFF); | ||
51 | MEI_PG_STATE(ON); | ||
52 | default: | ||
53 | return "unknown"; | ||
54 | } | ||
55 | #undef MEI_PG_STATE | ||
56 | } | ||
57 | |||
46 | 58 | ||
47 | /** | 59 | /** |
48 | * mei_cancel_work. Cancel mei background jobs | 60 | * mei_cancel_work. Cancel mei background jobs |
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 719edeeb3ceb..be7b14766cfa 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
@@ -375,6 +375,8 @@ enum mei_pg_state { | |||
375 | MEI_PG_ON = 1, | 375 | MEI_PG_ON = 1, |
376 | }; | 376 | }; |
377 | 377 | ||
378 | const char *mei_pg_state_str(enum mei_pg_state state); | ||
379 | |||
378 | /* | 380 | /* |
379 | * mei_cfg | 381 | * mei_cfg |
380 | * | 382 | * |