mei: fix client functions names
[deliverable/linux.git] / drivers / misc / mei / wd.c
index 636409f9667f397c7ea3ea972fda636cf171e81d..5ad5225ea2b93a070129274951c4846b18947da4 100644 (file)
 #include <linux/sched.h>
 #include <linux/watchdog.h>
 
+#include <linux/mei.h>
+
 #include "mei_dev.h"
-#include "hw.h"
+#include "hbm.h"
 #include "interface.h"
-#include <linux/mei.h>
+#include "client.h"
 
 static const u8 mei_start_wd_params[] = { 0x02, 0x12, 0x13, 0x10 };
 static const u8 mei_stop_wd_params[] = { 0x02, 0x02, 0x14, 0x10 };
@@ -71,7 +73,7 @@ int mei_wd_host_init(struct mei_device *dev)
        dev->wd_state = MEI_WD_IDLE;
 
        /* Connect WD ME client to the host client */
-       id = mei_me_cl_link(dev, &dev->wd_cl,
+       id = mei_cl_link_me(&dev->wd_cl,
                                &mei_wd_guid, MEI_WD_HOST_CLIENT_ID);
 
        if (id < 0) {
@@ -79,7 +81,7 @@ int mei_wd_host_init(struct mei_device *dev)
                return -ENOENT;
        }
 
-       if (mei_connect(dev, &dev->wd_cl)) {
+       if (mei_hbm_cl_connect_req(dev, &dev->wd_cl)) {
                dev_err(&dev->pdev->dev, "wd: failed to connect to the client\n");
                dev->wd_cl.state = MEI_FILE_DISCONNECTED;
                dev->wd_cl.host_client_id = 0;
@@ -101,22 +103,21 @@ int mei_wd_host_init(struct mei_device *dev)
  */
 int mei_wd_send(struct mei_device *dev)
 {
-       struct mei_msg_hdr *mei_hdr;
+       struct mei_msg_hdr hdr;
 
-       mei_hdr = (struct mei_msg_hdr *) &dev->wr_msg_buf[0];
-       mei_hdr->host_addr = dev->wd_cl.host_client_id;
-       mei_hdr->me_addr = dev->wd_cl.me_client_id;
-       mei_hdr->msg_complete = 1;
-       mei_hdr->reserved = 0;
+       hdr.host_addr = dev->wd_cl.host_client_id;
+       hdr.me_addr = dev->wd_cl.me_client_id;
+       hdr.msg_complete = 1;
+       hdr.reserved = 0;
 
        if (!memcmp(dev->wd_data, mei_start_wd_params, MEI_WD_HDR_SIZE))
-               mei_hdr->length = MEI_WD_START_MSG_SIZE;
+               hdr.length = MEI_WD_START_MSG_SIZE;
        else if (!memcmp(dev->wd_data, mei_stop_wd_params, MEI_WD_HDR_SIZE))
-               mei_hdr->length = MEI_WD_STOP_MSG_SIZE;
+               hdr.length = MEI_WD_STOP_MSG_SIZE;
        else
                return -EINVAL;
 
-       return mei_write_message(dev, mei_hdr, dev->wd_data, mei_hdr->length);
+       return mei_write_message(dev, &hdr, dev->wd_data);
 }
 
 /**
@@ -141,7 +142,7 @@ int mei_wd_stop(struct mei_device *dev)
 
        dev->wd_state = MEI_WD_STOPPING;
 
-       ret = mei_flow_ctrl_creds(dev, &dev->wd_cl);
+       ret = mei_cl_flow_ctrl_creds(&dev->wd_cl);
        if (ret < 0)
                goto out;
 
@@ -150,7 +151,7 @@ int mei_wd_stop(struct mei_device *dev)
                dev->mei_host_buffer_is_empty = false;
 
                if (!mei_wd_send(dev)) {
-                       ret = mei_flow_ctrl_reduce(dev, &dev->wd_cl);
+                       ret = mei_cl_flow_ctrl_reduce(&dev->wd_cl);
                        if (ret)
                                goto out;
                } else {
@@ -271,7 +272,7 @@ static int mei_wd_ops_ping(struct watchdog_device *wd_dev)
 
        /* Check if we can send the ping to HW*/
        if (dev->mei_host_buffer_is_empty &&
-               mei_flow_ctrl_creds(dev, &dev->wd_cl) > 0) {
+           mei_cl_flow_ctrl_creds(&dev->wd_cl) > 0) {
 
                dev->mei_host_buffer_is_empty = false;
                dev_dbg(&dev->pdev->dev, "wd: sending ping\n");
@@ -282,9 +283,9 @@ static int mei_wd_ops_ping(struct watchdog_device *wd_dev)
                        goto end;
                }
 
-               if (mei_flow_ctrl_reduce(dev, &dev->wd_cl)) {
+               if (mei_cl_flow_ctrl_reduce(&dev->wd_cl)) {
                        dev_err(&dev->pdev->dev,
-                               "wd: mei_flow_ctrl_reduce() failed.\n");
+                               "wd: mei_cl_flow_ctrl_reduce() failed.\n");
                        ret = -EIO;
                        goto end;
                }
@@ -370,7 +371,7 @@ void mei_watchdog_register(struct mei_device *dev)
 
 void mei_watchdog_unregister(struct mei_device *dev)
 {
-       if (test_bit(WDOG_UNREGISTERED, &amt_wd_dev.status))
+       if (watchdog_get_drvdata(&amt_wd_dev) == NULL)
                return;
 
        watchdog_set_drvdata(&amt_wd_dev, NULL);
This page took 0.027257 seconds and 5 git commands to generate.