Commit b210d750 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: name space for mei device state

1. add MEI_DEV_ prefix for mei device state enums
2. rename mei_state to dev_state
3. add constant to string translation for debug purposes
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6ddf3aea
...@@ -24,6 +24,25 @@ ...@@ -24,6 +24,25 @@
#include "interface.h" #include "interface.h"
#include <linux/mei.h> #include <linux/mei.h>
const char *mei_dev_state_str(int state)
{
#define MEI_DEV_STATE(state) case MEI_DEV_##state: return #state
switch (state) {
MEI_DEV_STATE(INITIALIZING);
MEI_DEV_STATE(INIT_CLIENTS);
MEI_DEV_STATE(ENABLED);
MEI_DEV_STATE(RESETING);
MEI_DEV_STATE(DISABLED);
MEI_DEV_STATE(RECOVERING_FROM_RESET);
MEI_DEV_STATE(POWER_DOWN);
MEI_DEV_STATE(POWER_UP);
default:
return "unkown";
}
#undef MEI_DEV_STATE
}
const uuid_le mei_amthi_guid = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d, 0xac, const uuid_le mei_amthi_guid = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d, 0xac,
0xa8, 0x46, 0xe0, 0xff, 0x65, 0xa8, 0x46, 0xe0, 0xff, 0x65,
0x81, 0x4c); 0x81, 0x4c);
...@@ -123,7 +142,7 @@ struct mei_device *mei_device_init(struct pci_dev *pdev) ...@@ -123,7 +142,7 @@ struct mei_device *mei_device_init(struct pci_dev *pdev)
mutex_init(&dev->device_lock); mutex_init(&dev->device_lock);
init_waitqueue_head(&dev->wait_recvd_msg); init_waitqueue_head(&dev->wait_recvd_msg);
init_waitqueue_head(&dev->wait_stop_wd); init_waitqueue_head(&dev->wait_stop_wd);
dev->mei_state = MEI_INITIALIZING; dev->dev_state = MEI_DEV_INITIALIZING;
dev->iamthif_state = MEI_IAMTHIF_IDLE; dev->iamthif_state = MEI_IAMTHIF_IDLE;
dev->wd_interface_reg = false; dev->wd_interface_reg = false;
...@@ -182,7 +201,7 @@ int mei_hw_init(struct mei_device *dev) ...@@ -182,7 +201,7 @@ int mei_hw_init(struct mei_device *dev)
} }
if (err <= 0 && !dev->recvd_msg) { if (err <= 0 && !dev->recvd_msg) {
dev->mei_state = MEI_DISABLED; dev->dev_state = MEI_DEV_DISABLED;
dev_dbg(&dev->pdev->dev, dev_dbg(&dev->pdev->dev,
"wait_event_interruptible_timeout failed" "wait_event_interruptible_timeout failed"
"on wait for ME to turn on ME_RDY.\n"); "on wait for ME to turn on ME_RDY.\n");
...@@ -192,7 +211,7 @@ int mei_hw_init(struct mei_device *dev) ...@@ -192,7 +211,7 @@ int mei_hw_init(struct mei_device *dev)
if (!(((dev->host_hw_state & H_RDY) == H_RDY) && if (!(((dev->host_hw_state & H_RDY) == H_RDY) &&
((dev->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA))) { ((dev->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA))) {
dev->mei_state = MEI_DISABLED; dev->dev_state = MEI_DEV_DISABLED;
dev_dbg(&dev->pdev->dev, dev_dbg(&dev->pdev->dev,
"host_hw_state = 0x%08x, me_hw_state = 0x%08x.\n", "host_hw_state = 0x%08x, me_hw_state = 0x%08x.\n",
dev->host_hw_state, dev->me_hw_state); dev->host_hw_state, dev->me_hw_state);
...@@ -258,15 +277,15 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) ...@@ -258,15 +277,15 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
struct mei_cl_cb *cb_next = NULL; struct mei_cl_cb *cb_next = NULL;
bool unexpected; bool unexpected;
if (dev->mei_state == MEI_RECOVERING_FROM_RESET) { if (dev->dev_state == MEI_DEV_RECOVERING_FROM_RESET) {
dev->need_reset = true; dev->need_reset = true;
return; return;
} }
unexpected = (dev->mei_state != MEI_INITIALIZING && unexpected = (dev->dev_state != MEI_DEV_INITIALIZING &&
dev->mei_state != MEI_DISABLED && dev->dev_state != MEI_DEV_DISABLED &&
dev->mei_state != MEI_POWER_DOWN && dev->dev_state != MEI_DEV_POWER_DOWN &&
dev->mei_state != MEI_POWER_UP); dev->dev_state != MEI_DEV_POWER_UP);
dev->host_hw_state = mei_hcsr_read(dev); dev->host_hw_state = mei_hcsr_read(dev);
...@@ -285,10 +304,10 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) ...@@ -285,10 +304,10 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
dev->need_reset = false; dev->need_reset = false;
if (dev->mei_state != MEI_INITIALIZING) { if (dev->dev_state != MEI_DEV_INITIALIZING) {
if (dev->mei_state != MEI_DISABLED && if (dev->dev_state != MEI_DEV_DISABLED &&
dev->mei_state != MEI_POWER_DOWN) dev->dev_state != MEI_DEV_POWER_DOWN)
dev->mei_state = MEI_RESETING; dev->dev_state = MEI_DEV_RESETING;
list_for_each_entry_safe(cl_pos, list_for_each_entry_safe(cl_pos,
cl_next, &dev->file_list, link) { cl_next, &dev->file_list, link) {
...@@ -322,7 +341,8 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) ...@@ -322,7 +341,8 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
dev->host_hw_state, dev->me_hw_state); dev->host_hw_state, dev->me_hw_state);
if (unexpected) if (unexpected)
dev_warn(&dev->pdev->dev, "unexpected reset.\n"); dev_warn(&dev->pdev->dev, "unexpected reset: dev_state = %s\n",
mei_dev_state_str(dev->dev_state));
/* Wake up all readings so they can be interrupted */ /* Wake up all readings so they can be interrupted */
list_for_each_entry_safe(cl_pos, cl_next, &dev->file_list, link) { list_for_each_entry_safe(cl_pos, cl_next, &dev->file_list, link) {
...@@ -371,7 +391,7 @@ void mei_host_start_message(struct mei_device *dev) ...@@ -371,7 +391,7 @@ void mei_host_start_message(struct mei_device *dev)
if (mei_write_message(dev, mei_hdr, (unsigned char *)host_start_req, if (mei_write_message(dev, mei_hdr, (unsigned char *)host_start_req,
mei_hdr->length)) { mei_hdr->length)) {
dev_dbg(&dev->pdev->dev, "write send version message to FW fail.\n"); dev_dbg(&dev->pdev->dev, "write send version message to FW fail.\n");
dev->mei_state = MEI_RESETING; dev->dev_state = MEI_DEV_RESETING;
mei_reset(dev, 1); mei_reset(dev, 1);
} }
dev->init_clients_state = MEI_START_MESSAGE; dev->init_clients_state = MEI_START_MESSAGE;
...@@ -403,7 +423,7 @@ void mei_host_enum_clients_message(struct mei_device *dev) ...@@ -403,7 +423,7 @@ void mei_host_enum_clients_message(struct mei_device *dev)
host_enum_req->hbm_cmd = HOST_ENUM_REQ_CMD; host_enum_req->hbm_cmd = HOST_ENUM_REQ_CMD;
if (mei_write_message(dev, mei_hdr, (unsigned char *)host_enum_req, if (mei_write_message(dev, mei_hdr, (unsigned char *)host_enum_req,
mei_hdr->length)) { mei_hdr->length)) {
dev->mei_state = MEI_RESETING; dev->dev_state = MEI_DEV_RESETING;
dev_dbg(&dev->pdev->dev, "write send enumeration request message to FW fail.\n"); dev_dbg(&dev->pdev->dev, "write send enumeration request message to FW fail.\n");
mei_reset(dev, 1); mei_reset(dev, 1);
} }
...@@ -444,7 +464,7 @@ void mei_allocate_me_clients_storage(struct mei_device *dev) ...@@ -444,7 +464,7 @@ void mei_allocate_me_clients_storage(struct mei_device *dev)
sizeof(struct mei_me_client), GFP_KERNEL); sizeof(struct mei_me_client), GFP_KERNEL);
if (!clients) { if (!clients) {
dev_dbg(&dev->pdev->dev, "memory allocation for ME clients failed.\n"); dev_dbg(&dev->pdev->dev, "memory allocation for ME clients failed.\n");
dev->mei_state = MEI_RESETING; dev->dev_state = MEI_DEV_RESETING;
mei_reset(dev, 1); mei_reset(dev, 1);
return ; return ;
} }
...@@ -490,7 +510,7 @@ int mei_host_client_properties(struct mei_device *dev) ...@@ -490,7 +510,7 @@ int mei_host_client_properties(struct mei_device *dev)
if (mei_write_message(dev, mei_header, if (mei_write_message(dev, mei_header,
(unsigned char *)host_cli_req, (unsigned char *)host_cli_req,
mei_header->length)) { mei_header->length)) {
dev->mei_state = MEI_RESETING; dev->dev_state = MEI_DEV_RESETING;
dev_dbg(&dev->pdev->dev, "write send enumeration request message to FW fail.\n"); dev_dbg(&dev->pdev->dev, "write send enumeration request message to FW fail.\n");
mei_reset(dev, 1); mei_reset(dev, 1);
return -EIO; return -EIO;
......
...@@ -633,7 +633,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, ...@@ -633,7 +633,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
if (version_res->host_version_supported) { if (version_res->host_version_supported) {
dev->version.major_version = HBM_MAJOR_VERSION; dev->version.major_version = HBM_MAJOR_VERSION;
dev->version.minor_version = HBM_MINOR_VERSION; dev->version.minor_version = HBM_MINOR_VERSION;
if (dev->mei_state == MEI_INIT_CLIENTS && if (dev->dev_state == MEI_DEV_INIT_CLIENTS &&
dev->init_clients_state == MEI_START_MESSAGE) { dev->init_clients_state == MEI_START_MESSAGE) {
dev->init_clients_timer = 0; dev->init_clients_timer = 0;
mei_host_enum_clients_message(dev); mei_host_enum_clients_message(dev);
...@@ -707,7 +707,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, ...@@ -707,7 +707,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
dev->me_clients[dev->me_client_presentation_num].props dev->me_clients[dev->me_client_presentation_num].props
= props_res->client_properties; = props_res->client_properties;
if (dev->mei_state == MEI_INIT_CLIENTS && if (dev->dev_state == MEI_DEV_INIT_CLIENTS &&
dev->init_clients_state == dev->init_clients_state ==
MEI_CLIENT_PROPERTIES_MESSAGE) { MEI_CLIENT_PROPERTIES_MESSAGE) {
dev->me_client_index++; dev->me_client_index++;
...@@ -734,7 +734,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, ...@@ -734,7 +734,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
* Client ID 2 - Reserved for AMTHI * Client ID 2 - Reserved for AMTHI
*/ */
bitmap_set(dev->host_clients_map, 0, 3); bitmap_set(dev->host_clients_map, 0, 3);
dev->mei_state = MEI_ENABLED; dev->dev_state = MEI_DEV_ENABLED;
/* if wd initialization fails, initialization the AMTHI client, /* if wd initialization fails, initialization the AMTHI client,
* otherwise the AMTHI client will be initialized after the WD client connect response * otherwise the AMTHI client will be initialized after the WD client connect response
...@@ -759,7 +759,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, ...@@ -759,7 +759,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
case HOST_ENUM_RES_CMD: case HOST_ENUM_RES_CMD:
enum_res = (struct hbm_host_enum_response *) mei_msg; enum_res = (struct hbm_host_enum_response *) mei_msg;
memcpy(dev->me_clients_map, enum_res->valid_addresses, 32); memcpy(dev->me_clients_map, enum_res->valid_addresses, 32);
if (dev->mei_state == MEI_INIT_CLIENTS && if (dev->dev_state == MEI_DEV_INIT_CLIENTS &&
dev->init_clients_state == MEI_ENUM_CLIENTS_MESSAGE) { dev->init_clients_state == MEI_ENUM_CLIENTS_MESSAGE) {
dev->init_clients_timer = 0; dev->init_clients_timer = 0;
dev->me_client_presentation_num = 0; dev->me_client_presentation_num = 0;
...@@ -776,7 +776,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, ...@@ -776,7 +776,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
break; break;
case HOST_STOP_RES_CMD: case HOST_STOP_RES_CMD:
dev->mei_state = MEI_DISABLED; dev->dev_state = MEI_DEV_DISABLED;
dev_dbg(&dev->pdev->dev, "resetting because of FW stop response.\n"); dev_dbg(&dev->pdev->dev, "resetting because of FW stop response.\n");
mei_reset(dev, 1); mei_reset(dev, 1);
break; break;
...@@ -1240,7 +1240,7 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list, ...@@ -1240,7 +1240,7 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
*slots -= dev->extra_write_index; *slots -= dev->extra_write_index;
dev->extra_write_index = 0; dev->extra_write_index = 0;
} }
if (dev->mei_state == MEI_ENABLED) { if (dev->dev_state == MEI_DEV_ENABLED) {
if (dev->wd_pending && if (dev->wd_pending &&
mei_flow_ctrl_creds(dev, &dev->wd_cl) > 0) { mei_flow_ctrl_creds(dev, &dev->wd_cl) > 0) {
if (mei_wd_send(dev)) if (mei_wd_send(dev))
...@@ -1361,8 +1361,8 @@ void mei_timer(struct work_struct *work) ...@@ -1361,8 +1361,8 @@ void mei_timer(struct work_struct *work)
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
if (dev->mei_state == MEI_INIT_CLIENTS) { if (dev->dev_state == MEI_DEV_INIT_CLIENTS) {
if (dev->init_clients_timer) { if (dev->init_clients_timer) {
if (--dev->init_clients_timer == 0) { if (--dev->init_clients_timer == 0) {
dev_dbg(&dev->pdev->dev, "IMEI reset due to init clients timeout ,init clients state = %d.\n", dev_dbg(&dev->pdev->dev, "IMEI reset due to init clients timeout ,init clients state = %d.\n",
...@@ -1484,8 +1484,8 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id) ...@@ -1484,8 +1484,8 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id)
/* check if ME wants a reset */ /* check if ME wants a reset */
if ((dev->me_hw_state & ME_RDY_HRA) == 0 && if ((dev->me_hw_state & ME_RDY_HRA) == 0 &&
dev->mei_state != MEI_RESETING && dev->dev_state != MEI_DEV_RESETING &&
dev->mei_state != MEI_INITIALIZING) { dev->dev_state != MEI_DEV_INITIALIZING) {
dev_dbg(&dev->pdev->dev, "FW not ready.\n"); dev_dbg(&dev->pdev->dev, "FW not ready.\n");
mei_reset(dev, 1); mei_reset(dev, 1);
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
...@@ -1498,7 +1498,7 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id) ...@@ -1498,7 +1498,7 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id)
dev_dbg(&dev->pdev->dev, "we need to start the dev.\n"); dev_dbg(&dev->pdev->dev, "we need to start the dev.\n");
dev->host_hw_state |= (H_IE | H_IG | H_RDY); dev->host_hw_state |= (H_IE | H_IG | H_RDY);
mei_hcsr_set(dev); mei_hcsr_set(dev);
dev->mei_state = MEI_INIT_CLIENTS; dev->dev_state = MEI_DEV_INIT_CLIENTS;
dev_dbg(&dev->pdev->dev, "link is established start sending messages.\n"); dev_dbg(&dev->pdev->dev, "link is established start sending messages.\n");
/* link is established /* link is established
* start sending messages. * start sending messages.
......
...@@ -108,7 +108,7 @@ int mei_ioctl_connect_client(struct file *file, ...@@ -108,7 +108,7 @@ int mei_ioctl_connect_client(struct file *file,
cb->major_file_operations = MEI_IOCTL; cb->major_file_operations = MEI_IOCTL;
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
rets = -ENODEV; rets = -ENODEV;
goto end; goto end;
} }
...@@ -402,7 +402,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl) ...@@ -402,7 +402,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
if (cl->state != MEI_FILE_CONNECTED) if (cl->state != MEI_FILE_CONNECTED)
return -ENODEV; return -ENODEV;
if (dev->mei_state != MEI_ENABLED) if (dev->dev_state != MEI_DEV_ENABLED)
return -ENODEV; return -ENODEV;
dev_dbg(&dev->pdev->dev, "check if read is pending.\n"); dev_dbg(&dev->pdev->dev, "check if read is pending.\n");
......
...@@ -232,9 +232,9 @@ static int mei_open(struct inode *inode, struct file *file) ...@@ -232,9 +232,9 @@ static int mei_open(struct inode *inode, struct file *file)
goto out_unlock; goto out_unlock;
err = -ENODEV; err = -ENODEV;
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
dev_dbg(&dev->pdev->dev, "mei_state != MEI_ENABLED mei_state= %d\n", dev_dbg(&dev->pdev->dev, "dev_state != MEI_ENABLED dev_state = %s\n",
dev->mei_state); mei_dev_state_str(dev->dev_state));
goto out_unlock; goto out_unlock;
} }
err = -EMFILE; err = -EMFILE;
...@@ -384,7 +384,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf, ...@@ -384,7 +384,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
dev = cl->dev; dev = cl->dev;
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
rets = -ENODEV; rets = -ENODEV;
goto out; goto out;
} }
...@@ -538,7 +538,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -538,7 +538,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
return -ENODEV; return -ENODEV;
} }
...@@ -613,7 +613,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf, ...@@ -613,7 +613,7 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
rets = -ENOMEM; rets = -ENOMEM;
goto unlock_dev; goto unlock_dev;
} }
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
rets = -ENODEV; rets = -ENODEV;
goto unlock_dev; goto unlock_dev;
} }
...@@ -769,7 +769,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data) ...@@ -769,7 +769,7 @@ static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
dev_dbg(&dev->pdev->dev, "IOCTL cmd = 0x%x", cmd); dev_dbg(&dev->pdev->dev, "IOCTL cmd = 0x%x", cmd);
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
rets = -ENODEV; rets = -ENODEV;
goto out; goto out;
} }
...@@ -848,7 +848,7 @@ static unsigned int mei_poll(struct file *file, poll_table *wait) ...@@ -848,7 +848,7 @@ static unsigned int mei_poll(struct file *file, poll_table *wait)
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (dev->mei_state != MEI_ENABLED) if (dev->dev_state != MEI_DEV_ENABLED)
goto out; goto out;
...@@ -1118,9 +1118,9 @@ static int mei_pci_suspend(struct device *device) ...@@ -1118,9 +1118,9 @@ static int mei_pci_suspend(struct device *device)
/* Stop watchdog if exists */ /* Stop watchdog if exists */
err = mei_wd_stop(dev, true); err = mei_wd_stop(dev, true);
/* Set new mei state */ /* Set new mei state */
if (dev->mei_state == MEI_ENABLED || if (dev->dev_state == MEI_DEV_ENABLED ||
dev->mei_state == MEI_RECOVERING_FROM_RESET) { dev->dev_state == MEI_DEV_RECOVERING_FROM_RESET) {
dev->mei_state = MEI_POWER_DOWN; dev->dev_state = MEI_DEV_POWER_DOWN;
mei_reset(dev, 0); mei_reset(dev, 0);
} }
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
...@@ -1162,7 +1162,7 @@ static int mei_pci_resume(struct device *device) ...@@ -1162,7 +1162,7 @@ static int mei_pci_resume(struct device *device)
} }
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
dev->mei_state = MEI_POWER_UP; dev->dev_state = MEI_DEV_POWER_UP;
mei_reset(dev, 1); mei_reset(dev, 1);
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
......
...@@ -78,17 +78,19 @@ enum file_state { ...@@ -78,17 +78,19 @@ enum file_state {
}; };
/* MEI device states */ /* MEI device states */
enum mei_states { enum mei_dev_state {
MEI_INITIALIZING = 0, MEI_DEV_INITIALIZING = 0,
MEI_INIT_CLIENTS, MEI_DEV_INIT_CLIENTS,
MEI_ENABLED, MEI_DEV_ENABLED,
MEI_RESETING, MEI_DEV_RESETING,
MEI_DISABLED, MEI_DEV_DISABLED,
MEI_RECOVERING_FROM_RESET, MEI_DEV_RECOVERING_FROM_RESET,
MEI_POWER_DOWN, MEI_DEV_POWER_DOWN,
MEI_POWER_UP MEI_DEV_POWER_UP
}; };
const char *mei_dev_state_str(int state);
/* init clients states*/ /* init clients states*/
enum mei_init_clients_states { enum mei_init_clients_states {
MEI_START_MESSAGE = 0, MEI_START_MESSAGE = 0,
...@@ -218,7 +220,7 @@ struct mei_device { ...@@ -218,7 +220,7 @@ struct mei_device {
/* /*
* mei device states * mei device states
*/ */
enum mei_states mei_state; enum mei_dev_state dev_state;
enum mei_init_clients_states init_clients_state; enum mei_init_clients_states init_clients_state;
u16 init_clients_timer; u16 init_clients_timer;
bool stop; bool stop;
......
...@@ -202,10 +202,10 @@ static int mei_wd_ops_start(struct watchdog_device *wd_dev) ...@@ -202,10 +202,10 @@ static int mei_wd_ops_start(struct watchdog_device *wd_dev)
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (dev->mei_state != MEI_ENABLED) { if (dev->dev_state != MEI_DEV_ENABLED) {
dev_dbg(&dev->pdev->dev, dev_dbg(&dev->pdev->dev,
"wd: mei_state != MEI_ENABLED mei_state = %d\n", "wd: dev_state != MEI_DEV_ENABLED dev_state = %s\n",
dev->mei_state); mei_dev_state_str(dev->dev_state));
goto end_unlock; goto end_unlock;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment