mei: amthif: prefix cb list with amthif
[firefly-linux-kernel-4.4.55.git] / drivers / misc / mei / mei_dev.h
index 6adcb3f6621ae77c7ca1e25b7522387409023314..ce246b0fb2d69f0366de707290110bcc7c7a07fe 100644 (file)
@@ -184,16 +184,13 @@ struct mei_device {
        /*
         * lists of queues
         */
-        /* array of pointers to aio lists */
+       /* array of pointers to aio lists */
        struct mei_cl_cb read_list;             /* driver read queue */
        struct mei_cl_cb write_list;            /* driver write queue */
        struct mei_cl_cb write_waiting_list;    /* write waiting queue */
        struct mei_cl_cb ctrl_wr_list;          /* managed write IOCTL list */
        struct mei_cl_cb ctrl_rd_list;          /* managed read IOCTL list */
-       struct mei_cl_cb amthi_cmd_list;        /* amthi list for cmd waiting */
 
-       /* driver managed amthi list for reading completed amthi cmd data */
-       struct mei_cl_cb amthi_read_complete_list;
        /*
         * list of files
         */
@@ -249,12 +246,15 @@ struct mei_device {
 
        struct mei_cl wd_cl;
        enum mei_wd_states wd_state;
-       bool wd_interface_reg;
        bool wd_pending;
        u16 wd_timeout;
        unsigned char wd_data[MEI_WD_START_MSG_SIZE];
 
 
+       /* amthif list for cmd waiting */
+       struct mei_cl_cb amthif_cmd_list;
+       /* driver managed amthif list for reading completed amthif cmd data */
+       struct mei_cl_cb amthif_rd_complete_list;
        struct file *iamthif_file_object;
        struct mei_cl iamthif_cl;
        struct mei_cl_cb *iamthif_current_cb;
@@ -270,6 +270,11 @@ struct mei_device {
        bool iamthif_canceled;
 };
 
+static inline unsigned long mei_secs_to_jiffies(unsigned long sec)
+{
+       return msecs_to_jiffies(sec * MSEC_PER_SEC);
+}
+
 
 /*
  * mei init function prototypes
@@ -281,7 +286,6 @@ int mei_task_initialize_clients(void *data);
 int mei_initialize_clients(struct mei_device *dev);
 int mei_disconnect_host_client(struct mei_device *dev, struct mei_cl *cl);
 void mei_remove_client_from_file_list(struct mei_device *dev, u8 host_client_id);
-void mei_host_init_iamthif(struct mei_device *dev);
 void mei_allocate_me_clients_storage(struct mei_device *dev);
 
 
@@ -357,17 +361,37 @@ int mei_ioctl_connect_client(struct file *file,
 
 int mei_start_read(struct mei_device *dev, struct mei_cl *cl);
 
-int amthi_write(struct mei_device *dev, struct mei_cl_cb *priv_cb);
 
-int amthi_read(struct mei_device *dev, struct file *file,
+/*
+ * AMTHIF - AMT Host Interface Functions
+ */
+void mei_amthif_reset_params(struct mei_device *dev);
+
+void mei_amthif_host_init(struct mei_device *dev);
+
+int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *priv_cb);
+
+int mei_amthif_read(struct mei_device *dev, struct file *file,
              char __user *ubuf, size_t length, loff_t *offset);
 
-struct mei_cl_cb *find_amthi_read_list_entry(struct mei_device *dev,
+struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
                                                struct file *file);
 
-void mei_run_next_iamthif_cmd(struct mei_device *dev);
+void mei_amthif_run_next_cmd(struct mei_device *dev);
+
+
+int mei_amthif_read_message(struct mei_cl_cb *complete_list,
+               struct mei_device *dev, struct mei_msg_hdr *mei_hdr);
 
+int mei_amthif_irq_process_completed(struct mei_device *dev, s32 *slots,
+                       struct mei_cl_cb *cb_pos,
+                       struct mei_cl *cl,
+                       struct mei_cl_cb *cmpl_list);
 
+void mei_amthif_complete(struct mei_device *dev, struct mei_cl_cb *cb);
+int mei_amthif_irq_read_message(struct mei_cl_cb *complete_list,
+               struct mei_device *dev, struct mei_msg_hdr *mei_hdr);
+int mei_amthif_irq_read(struct mei_device *dev, s32 *slots);
 
 /*
  * Register Access Function