aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-08-16 12:39:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 12:51:02 -0400
commit248ffdf7c95726a8dae76e25fdb037899c5b77fa (patch)
tree339cbe37183da713ae6d761d1f7b0e4588aef4ba /drivers/misc/mei
parentc8df72920c9cd8e43899a5660ee54a46ac2588a6 (diff)
mei: wd: rename watchdog constants to be more descriptive
1. rename defines to more be descriptive 2. remove duplicated defines from interface.h 3. add common prefix MEI_ Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/interface.h8
-rw-r--r--drivers/misc/mei/interrupt.c4
-rw-r--r--drivers/misc/mei/mei_dev.h13
-rw-r--r--drivers/misc/mei/wd.c24
4 files changed, 23 insertions, 26 deletions
diff --git a/drivers/misc/mei/interface.h b/drivers/misc/mei/interface.h
index fb5c7db4723b..c1988f564aa2 100644
--- a/drivers/misc/mei/interface.h
+++ b/drivers/misc/mei/interface.h
@@ -23,14 +23,6 @@
23#include "mei_dev.h" 23#include "mei_dev.h"
24 24
25 25
26#define AMT_WD_DEFAULT_TIMEOUT 120 /* seconds */
27#define AMT_WD_MIN_TIMEOUT 120 /* seconds */
28#define AMT_WD_MAX_TIMEOUT 65535 /* seconds */
29
30#define MEI_WATCHDOG_DATA_SIZE 16
31#define MEI_START_WD_DATA_SIZE 20
32#define MEI_WD_PARAMS_SIZE 4
33
34 26
35void mei_read_slots(struct mei_device *dev, 27void mei_read_slots(struct mei_device *dev,
36 unsigned char *buffer, 28 unsigned char *buffer,
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 7d9a91298ec1..0f25cee6ab85 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -1251,9 +1251,9 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
1251 dev->wd_pending = false; 1251 dev->wd_pending = false;
1252 1252
1253 if (dev->wd_timeout) 1253 if (dev->wd_timeout)
1254 *slots -= mei_data2slots(MEI_START_WD_DATA_SIZE); 1254 *slots -= mei_data2slots(MEI_WD_START_MSG_SIZE);
1255 else 1255 else
1256 *slots -= mei_data2slots(MEI_WD_PARAMS_SIZE); 1256 *slots -= mei_data2slots(MEI_WD_STOP_MSG_SIZE);
1257 } 1257 }
1258 } 1258 }
1259 if (dev->stop) 1259 if (dev->stop)
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 35d0538a5974..64a4f17893e5 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -25,9 +25,14 @@
25/* 25/*
26 * watch dog definition 26 * watch dog definition
27 */ 27 */
28#define MEI_WATCHDOG_DATA_SIZE 16 28#define MEI_WD_HDR_SIZE 4
29#define MEI_START_WD_DATA_SIZE 20 29#define MEI_WD_STOP_MSG_SIZE MEI_WD_HDR_SIZE
30#define MEI_WD_PARAMS_SIZE 4 30#define MEI_WD_START_MSG_SIZE (MEI_WD_HDR_SIZE + 16)
31
32#define MEI_WD_DEFAULT_TIMEOUT 120 /* seconds */
33#define MEI_WD_MIN_TIMEOUT 120 /* seconds */
34#define MEI_WD_MAX_TIMEOUT 65535 /* seconds */
35
31#define MEI_WD_STATE_INDEPENDENCE_MSG_SENT (1 << 0) 36#define MEI_WD_STATE_INDEPENDENCE_MSG_SENT (1 << 0)
32 37
33#define MEI_RD_MSG_BUF_SIZE (128 * sizeof(u32)) 38#define MEI_RD_MSG_BUF_SIZE (128 * sizeof(u32))
@@ -248,7 +253,7 @@ struct mei_device {
248 bool wd_stopped; 253 bool wd_stopped;
249 bool wd_bypass; /* if false, don't refresh watchdog ME client */ 254 bool wd_bypass; /* if false, don't refresh watchdog ME client */
250 u16 wd_timeout; /* seconds ((wd_data[1] << 8) + wd_data[0]) */ 255 u16 wd_timeout; /* seconds ((wd_data[1] << 8) + wd_data[0]) */
251 unsigned char wd_data[MEI_START_WD_DATA_SIZE]; 256 unsigned char wd_data[MEI_WD_START_MSG_SIZE];
252 257
253 258
254 struct file *iamthif_file_object; 259 struct file *iamthif_file_object;
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c
index 94f2c0a12d94..755a58305a7e 100644
--- a/drivers/misc/mei/wd.c
+++ b/drivers/misc/mei/wd.c
@@ -48,8 +48,8 @@ const uuid_le mei_wd_guid = UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, 0x89,
48static void mei_wd_set_start_timeout(struct mei_device *dev, u16 timeout) 48static void mei_wd_set_start_timeout(struct mei_device *dev, u16 timeout)
49{ 49{
50 dev_dbg(&dev->pdev->dev, "wd: set timeout=%d.\n", timeout); 50 dev_dbg(&dev->pdev->dev, "wd: set timeout=%d.\n", timeout);
51 memcpy(dev->wd_data, mei_start_wd_params, MEI_WD_PARAMS_SIZE); 51 memcpy(dev->wd_data, mei_start_wd_params, MEI_WD_HDR_SIZE);
52 memcpy(dev->wd_data + MEI_WD_PARAMS_SIZE, &timeout, sizeof(u16)); 52 memcpy(dev->wd_data + MEI_WD_HDR_SIZE, &timeout, sizeof(u16));
53} 53}
54 54
55/** 55/**
@@ -66,7 +66,7 @@ int mei_wd_host_init(struct mei_device *dev)
66 66
67 /* look for WD client and connect to it */ 67 /* look for WD client and connect to it */
68 dev->wd_cl.state = MEI_FILE_DISCONNECTED; 68 dev->wd_cl.state = MEI_FILE_DISCONNECTED;
69 dev->wd_timeout = AMT_WD_DEFAULT_TIMEOUT; 69 dev->wd_timeout = MEI_WD_DEFAULT_TIMEOUT;
70 70
71 /* find ME WD client */ 71 /* find ME WD client */
72 mei_me_cl_update_filext(dev, &dev->wd_cl, 72 mei_me_cl_update_filext(dev, &dev->wd_cl,
@@ -108,10 +108,10 @@ int mei_wd_send(struct mei_device *dev)
108 mei_hdr->msg_complete = 1; 108 mei_hdr->msg_complete = 1;
109 mei_hdr->reserved = 0; 109 mei_hdr->reserved = 0;
110 110
111 if (!memcmp(dev->wd_data, mei_start_wd_params, MEI_WD_PARAMS_SIZE)) 111 if (!memcmp(dev->wd_data, mei_start_wd_params, MEI_WD_HDR_SIZE))
112 mei_hdr->length = MEI_START_WD_DATA_SIZE; 112 mei_hdr->length = MEI_WD_START_MSG_SIZE;
113 else if (!memcmp(dev->wd_data, mei_stop_wd_params, MEI_WD_PARAMS_SIZE)) 113 else if (!memcmp(dev->wd_data, mei_stop_wd_params, MEI_WD_HDR_SIZE))
114 mei_hdr->length = MEI_WD_PARAMS_SIZE; 114 mei_hdr->length = MEI_WD_STOP_MSG_SIZE;
115 else 115 else
116 return -EINVAL; 116 return -EINVAL;
117 117
@@ -138,7 +138,7 @@ int mei_wd_stop(struct mei_device *dev, bool preserve)
138 return 0; 138 return 0;
139 139
140 dev->wd_timeout = 0; 140 dev->wd_timeout = 0;
141 memcpy(dev->wd_data, mei_stop_wd_params, MEI_WD_PARAMS_SIZE); 141 memcpy(dev->wd_data, mei_stop_wd_params, MEI_WD_STOP_MSG_SIZE);
142 dev->stop = true; 142 dev->stop = true;
143 143
144 ret = mei_flow_ctrl_creds(dev, &dev->wd_cl); 144 ret = mei_flow_ctrl_creds(dev, &dev->wd_cl);
@@ -315,7 +315,7 @@ static int mei_wd_ops_set_timeout(struct watchdog_device *wd_dev, unsigned int t
315 return -ENODEV; 315 return -ENODEV;
316 316
317 /* Check Timeout value */ 317 /* Check Timeout value */
318 if (timeout < AMT_WD_MIN_TIMEOUT || timeout > AMT_WD_MAX_TIMEOUT) 318 if (timeout < MEI_WD_MIN_TIMEOUT || timeout > MEI_WD_MAX_TIMEOUT)
319 return -EINVAL; 319 return -EINVAL;
320 320
321 mutex_lock(&dev->device_lock); 321 mutex_lock(&dev->device_lock);
@@ -349,9 +349,9 @@ static const struct watchdog_info wd_info = {
349static struct watchdog_device amt_wd_dev = { 349static struct watchdog_device amt_wd_dev = {
350 .info = &wd_info, 350 .info = &wd_info,
351 .ops = &wd_ops, 351 .ops = &wd_ops,
352 .timeout = AMT_WD_DEFAULT_TIMEOUT, 352 .timeout = MEI_WD_DEFAULT_TIMEOUT,
353 .min_timeout = AMT_WD_MIN_TIMEOUT, 353 .min_timeout = MEI_WD_MIN_TIMEOUT,
354 .max_timeout = AMT_WD_MAX_TIMEOUT, 354 .max_timeout = MEI_WD_MAX_TIMEOUT,
355}; 355};
356 356
357 357