]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
mei: add common prefix to hbm function
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 25 Dec 2012 17:06:11 +0000 (19:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 18:31:29 +0000 (10:31 -0800)
1. use mei_hbm_ for basic host bus message function
2. use mei_hbm_cl prefix for host bus messages that operation
on behalf of a client

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/amthif.c
drivers/misc/mei/hbm.c
drivers/misc/mei/init.c
drivers/misc/mei/interface.h
drivers/misc/mei/interrupt.c
drivers/misc/mei/iorw.c
drivers/misc/mei/mei_dev.h
drivers/misc/mei/wd.c

index f9d458cced2185ba84b2f1f467f0dfe192579443..6e3cd31eae3b5c1c8086d825a6c21bf902a49632 100644 (file)
@@ -98,7 +98,7 @@ void mei_amthif_host_init(struct mei_device *dev)
 
        dev->iamthif_msg_buf = msg_buf;
 
-       if (mei_connect(dev, &dev->iamthif_cl)) {
+       if (mei_hbm_cl_connect_req(dev, &dev->iamthif_cl)) {
                dev_dbg(&dev->pdev->dev, "Failed to connect to AMTHI client\n");
                dev->iamthif_cl.state = MEI_FILE_DISCONNECTED;
                dev->iamthif_cl.host_client_id = 0;
@@ -558,7 +558,7 @@ int mei_amthif_irq_read(struct mei_device *dev, s32 *slots)
                return -EMSGSIZE;
        }
        *slots -= mei_data2slots(sizeof(struct hbm_flow_control));
-       if (mei_send_flow_control(dev, &dev->iamthif_cl)) {
+       if (mei_hbm_cl_flow_control_req(dev, &dev->iamthif_cl)) {
                dev_dbg(&dev->pdev->dev, "iamthif flow control failed\n");
                return -EIO;
        }
@@ -630,7 +630,8 @@ static bool mei_clear_list(struct mei_device *dev,
                        if (dev->iamthif_current_cb == cb_pos) {
                                dev->iamthif_current_cb = NULL;
                                /* send flow control to iamthif client */
-                               mei_send_flow_control(dev, &dev->iamthif_cl);
+                               mei_hbm_cl_flow_control_req(dev,
+                                                       &dev->iamthif_cl);
                        }
                        /* free all allocated buffers */
                        mei_io_cb_free(cb_pos);
index e9ba51d5a46ccc85d6b507be2684008fdd42827a..3c9914038490f97cd47d7785b6493cab5d58f74c 100644 (file)
@@ -59,13 +59,11 @@ bool mei_hbm_cl_addr_equal(struct mei_cl *cl, void *buf)
 
 
 /**
- * host_start_message - mei host sends start message.
+ * mei_hbm_start_req - sends start request message.
  *
  * @dev: the device structure
- *
- * returns none.
  */
-void mei_host_start_message(struct mei_device *dev)
+void mei_hbm_start_req(struct mei_device *dev)
 {
        struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
        struct hbm_host_version_request *start_req;
@@ -92,13 +90,13 @@ void mei_host_start_message(struct mei_device *dev)
 }
 
 /**
- * host_enum_clients_message - host sends enumeration client request message.
+ * mei_hbm_enum_clients_req - sends enumeration client request message.
  *
  * @dev: the device structure
  *
  * returns none.
  */
-void mei_host_enum_clients_message(struct mei_device *dev)
+static void mei_hbm_enum_clients_req(struct mei_device *dev)
 {
        struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
        struct hbm_host_enum_request *enum_req;
@@ -120,8 +118,15 @@ void mei_host_enum_clients_message(struct mei_device *dev)
        return;
 }
 
+/**
+ * mei_hbm_prop_requsest - request property for a single client
+ *
+ * @dev: the device structure
+ *
+ * returns none.
+ */
 
-int mei_host_client_enumerate(struct mei_device *dev)
+static int mei_hbm_prop_req(struct mei_device *dev)
 {
 
        struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
@@ -191,14 +196,14 @@ static void mei_hbm_stop_req_prepare(struct mei_device *dev,
 }
 
 /**
- * mei_send_flow_control - sends flow control to fw.
+ * mei_hbm_cl_flow_control_req - sends flow control requst.
  *
  * @dev: the device structure
- * @cl: private data of the file object
+ * @cl: client info
  *
  * This function returns -EIO on write failure
  */
-int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl)
+int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl)
 {
        struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
        const size_t len = sizeof(struct hbm_flow_control);
@@ -213,14 +218,14 @@ int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl)
 }
 
 /**
- * mei_disconnect - sends disconnect message to fw.
+ * mei_hbm_cl_disconnect_req - sends disconnect message to fw.
  *
  * @dev: the device structure
- * @cl: private data of the file object
+ * @cl: a client to disconnect from
  *
  * This function returns -EIO on write failure
  */
-int mei_disconnect(struct mei_device *dev, struct mei_cl *cl)
+int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl)
 {
        struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
        const size_t len = sizeof(struct hbm_client_connect_request);
@@ -232,14 +237,14 @@ int mei_disconnect(struct mei_device *dev, struct mei_cl *cl)
 }
 
 /**
- * mei_connect - sends connect message to fw.
+ * mei_hbm_cl_connect_req - send connection request to specific me client
  *
  * @dev: the device structure
- * @cl: private data of the file object
+ * @cl: a client to connect to
  *
- * This function returns -EIO on write failure
+ * returns -EIO on write failure
  */
-int mei_connect(struct mei_device *dev, struct mei_cl *cl)
+int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl)
 {
        struct mei_msg_hdr *mei_hdr = &dev->wr_msg.hdr;
        const size_t len = sizeof(struct hbm_client_connect_request);
@@ -251,12 +256,13 @@ int mei_connect(struct mei_device *dev, struct mei_cl *cl)
 }
 
 /**
- * mei_client_disconnect_request - disconnects from request irq routine
+ * mei_client_disconnect_request - disconnect request initiated by me
+ *  host sends disoconnect response
  *
  * @dev: the device structure.
- * @disconnect_req: disconnect request bus message.
+ * @disconnect_req: disconnect request bus message from the me
  */
-static void mei_client_disconnect_request(struct mei_device *dev,
+static void mei_hbm_fw_disconnect_req(struct mei_device *dev,
                struct hbm_client_connect_request *disconnect_req)
 {
        struct mei_cl *cl, *next;
@@ -327,7 +333,7 @@ void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
                if (dev->dev_state == MEI_DEV_INIT_CLIENTS &&
                    dev->init_clients_state == MEI_START_MESSAGE) {
                        dev->init_clients_timer = 0;
-                       mei_host_enum_clients_message(dev);
+                       mei_hbm_enum_clients_req(dev);
                } else {
                        dev->recvd_msg = false;
                        dev_dbg(&dev->pdev->dev, "reset due to received hbm: host start\n");
@@ -390,7 +396,8 @@ void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
                dev->me_client_index++;
                dev->me_client_presentation_num++;
 
-               mei_host_client_enumerate(dev);
+               /* request property for the next client */
+               mei_hbm_prop_req(dev);
 
                break;
 
@@ -406,7 +413,8 @@ void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
                                dev->init_clients_state =
                                        MEI_CLIENT_PROPERTIES_MESSAGE;
 
-                               mei_host_client_enumerate(dev);
+                               /* first property reqeust */
+                               mei_hbm_prop_req(dev);
                } else {
                        dev_dbg(&dev->pdev->dev, "reset due to received host enumeration clients response bus message.\n");
                        mei_reset(dev, 1);
@@ -423,7 +431,7 @@ void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
        case CLIENT_DISCONNECT_REQ_CMD:
                /* search for client */
                disconnect_req = (struct hbm_client_connect_request *)mei_msg;
-               mei_client_disconnect_request(dev, disconnect_req);
+               mei_hbm_fw_disconnect_req(dev, disconnect_req);
                break;
 
        case ME_STOP_REQ_CMD:
index 0536170ff856dce490fc7253087a94c3df08d8d7..418a85f315f1b5f7b77a654e09bd7ce5a188f6bc 100644 (file)
@@ -529,9 +529,9 @@ int mei_disconnect_host_client(struct mei_device *dev, struct mei_cl *cl)
        cb->fop_type = MEI_FOP_CLOSE;
        if (dev->mei_host_buffer_is_empty) {
                dev->mei_host_buffer_is_empty = false;
-               if (mei_disconnect(dev, cl)) {
+               if (mei_hbm_cl_disconnect_req(dev, cl)) {
                        rets = -ENODEV;
-                       dev_dbg(&dev->pdev->dev, "failed to call mei_disconnect.\n");
+                       dev_err(&dev->pdev->dev, "failed to disconnect.\n");
                        goto free;
                }
                mdelay(10); /* Wait for hardware disconnection ready */
index ca732990a7ebb8d472801b397be576a9def108f6..90a3dfda9db5803a7db77a0cb700cda6f388f17e 100644 (file)
@@ -69,12 +69,15 @@ void mei_watchdog_register(struct mei_device *dev);
  */
 void mei_watchdog_unregister(struct mei_device *dev);
 
+int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl);
 int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl);
 
-int mei_send_flow_control(struct mei_device *dev, struct mei_cl *cl);
+void mei_hbm_start_req(struct mei_device *dev);
 
-int mei_disconnect(struct mei_device *dev, struct mei_cl *cl);
-int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl);
-int mei_connect(struct mei_device *dev, struct mei_cl *cl);
+int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl);
+int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl);
+int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl);
+
+void mei_host_client_init(struct work_struct *work);
 
 #endif /* _MEI_INTERFACE_H_ */
index 9cbf148e02e0e96ce855b04423cd6ca01fbcb152..eb744cc4f72a5dbeaccb5a08ecc0751a480f9982 100644 (file)
@@ -157,7 +157,7 @@ static int _mei_irq_thread_close(struct mei_device *dev, s32 *slots,
 
        *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request));
 
-       if (mei_disconnect(dev, cl)) {
+       if (mei_hbm_cl_disconnect_req(dev, cl)) {
                cl->status = 0;
                cb_pos->buf_idx = 0;
                list_move_tail(&cb_pos->list, &cmpl_list->list);
@@ -407,7 +407,7 @@ static int _mei_irq_thread_read(struct mei_device *dev,     s32 *slots,
 
        *slots -= mei_data2slots(sizeof(struct hbm_flow_control));
 
-       if (mei_send_flow_control(dev, cl)) {
+       if (mei_hbm_cl_flow_control_req(dev, cl)) {
                cl->status = -ENODEV;
                cb_pos->buf_idx = 0;
                list_move_tail(&cb_pos->list, &cmpl_list->list);
@@ -443,8 +443,8 @@ static int _mei_irq_thread_ioctl(struct mei_device *dev, s32 *slots,
        }
 
        cl->state = MEI_FILE_CONNECTING;
-        *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request));
-       if (mei_connect(dev, cl)) {
+       *slots -= mei_data2slots(sizeof(struct hbm_client_connect_request));
+       if (mei_hbm_cl_connect_req(dev, cl)) {
                cl->status = -ENODEV;
                cb_pos->buf_idx = 0;
                list_del(&cb_pos->list);
@@ -927,7 +927,7 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id)
                        /* link is established
                         * start sending messages.
                         */
-                       mei_host_start_message(dev);
+                       mei_hbm_start_req(dev);
                        mutex_unlock(&dev->device_lock);
                        return IRQ_HANDLED;
                } else {
index 7ccc3d8a079e75d0bc6e718d60eee19b51a047c3..d8e08bcf3263ef5d7dcd73e7761480733315d2ed 100644 (file)
@@ -258,7 +258,7 @@ int mei_ioctl_connect_client(struct file *file,
            && !mei_other_client_is_connecting(dev, cl)) {
                dev_dbg(&dev->pdev->dev, "Sending Connect Message\n");
                dev->mei_host_buffer_is_empty = false;
-               if (mei_connect(dev, cl)) {
+               if (mei_hbm_cl_connect_req(dev, cl)) {
                        dev_dbg(&dev->pdev->dev, "Sending connect message - failed\n");
                        rets = -ENODEV;
                        goto end;
@@ -350,7 +350,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
        cl->read_cb = cb;
        if (dev->mei_host_buffer_is_empty) {
                dev->mei_host_buffer_is_empty = false;
-               if (mei_send_flow_control(dev, cl)) {
+               if (mei_hbm_cl_flow_control_req(dev, cl)) {
                        rets = -ENODEV;
                        goto err;
                }
index 1ea331ac2463bed9ce0c1366467497089ffb6e11..0ad32cc49c06ae6bc8240d50076d906ed610cc57 100644 (file)
@@ -383,15 +383,6 @@ static inline bool mei_cl_cmp_id(const struct mei_cl *cl1,
 }
 
 
-
-/*
- * MEI Host Client Functions
- */
-void mei_host_start_message(struct mei_device *dev);
-void mei_host_enum_clients_message(struct mei_device *dev);
-int mei_host_client_enumerate(struct mei_device *dev);
-void mei_host_client_init(struct work_struct *work);
-
 /*
  *  MEI interrupt functions prototype
  */
index 3997a630847f898ea0f4003f343bcb10f02c0abc..4f2e9db86478a341fbfc410429923061df441678 100644 (file)
@@ -79,7 +79,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;