Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
mei_dev.h File Reference
#include <linux/types.h>
#include <linux/watchdog.h>
#include <linux/mei.h>
#include "hw.h"

Go to the source code of this file.

Data Structures

struct  mei_message_data
 
struct  mei_cl_cb
 
struct  mei_cl
 
struct  mei_io_list
 
struct  mei_device
 

Macros

#define MEI_WD_HDR_SIZE   4
 
#define MEI_WD_STOP_MSG_SIZE   MEI_WD_HDR_SIZE
 
#define MEI_WD_START_MSG_SIZE   (MEI_WD_HDR_SIZE + 16)
 
#define MEI_WD_DEFAULT_TIMEOUT   120 /* seconds */
 
#define MEI_WD_MIN_TIMEOUT   120 /* seconds */
 
#define MEI_WD_MAX_TIMEOUT   65535 /* seconds */
 
#define MEI_WD_STOP_TIMEOUT   10 /* msecs */
 
#define MEI_WD_STATE_INDEPENDENCE_MSG_SENT   (1 << 0)
 
#define MEI_RD_MSG_BUF_SIZE   (128 * sizeof(u32))
 
#define MEI_CLIENTS_MAX   256
 
#define MEI_MAX_OPEN_HANDLE_COUNT   (MEI_CLIENTS_MAX - 3)
 

Enumerations

enum  file_state {
  MEI_FILE_INITIALIZING = 0, MEI_FILE_CONNECTING, MEI_FILE_CONNECTED, MEI_FILE_DISCONNECTING,
  MEI_FILE_DISCONNECTED
}
 
enum  mei_dev_state {
  MEI_DEV_INITIALIZING = 0, MEI_DEV_INIT_CLIENTS, MEI_DEV_ENABLED, MEI_DEV_RESETING,
  MEI_DEV_DISABLED, MEI_DEV_RECOVERING_FROM_RESET, MEI_DEV_POWER_DOWN, MEI_DEV_POWER_UP
}
 
enum  mei_init_clients_states { MEI_START_MESSAGE = 0, MEI_ENUM_CLIENTS_MESSAGE, MEI_CLIENT_PROPERTIES_MESSAGE }
 
enum  iamthif_states {
  MEI_IAMTHIF_IDLE, MEI_IAMTHIF_WRITING, MEI_IAMTHIF_FLOW_CONTROL, MEI_IAMTHIF_READING,
  MEI_IAMTHIF_READ_COMPLETE
}
 
enum  mei_file_transaction_states {
  MEI_IDLE, MEI_WRITING, MEI_WRITE_COMPLETE, MEI_FLOW_CONTROL,
  MEI_READING, MEI_READ_COMPLETE
}
 
enum  mei_wd_states { MEI_WD_IDLE, MEI_WD_RUNNING, MEI_WD_STOPPING }
 
enum  mei_cb_major_types {
  MEI_READ = 0, MEI_WRITE, MEI_IOCTL, MEI_OPEN,
  MEI_CLOSE
}
 

Functions

const charmei_dev_state_str (int state)
 
struct mei_devicemei_device_init (struct pci_dev *pdev)
 
void mei_reset (struct mei_device *dev, int interrupts)
 
int mei_hw_init (struct mei_device *dev)
 
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)
 
int mei_me_cl_update_filext (struct mei_device *dev, struct mei_cl *cl, const uuid_le *cguid, u8 host_client_id)
 
int mei_me_cl_by_uuid (const struct mei_device *dev, const uuid_le *cuuid)
 
int mei_me_cl_by_id (struct mei_device *dev, u8 client_id)
 
void mei_io_list_init (struct mei_io_list *list)
 
void mei_io_list_flush (struct mei_io_list *list, struct mei_cl *cl)
 
struct mei_clmei_cl_allocate (struct mei_device *dev)
 
void mei_cl_init (struct mei_cl *cl, struct mei_device *dev)
 
int mei_cl_flush_queues (struct mei_cl *cl)
 
void mei_host_start_message (struct mei_device *dev)
 
void mei_host_enum_clients_message (struct mei_device *dev)
 
int mei_host_client_properties (struct mei_device *dev)
 
irqreturn_t mei_interrupt_quick_handler (int irq, void *dev_id)
 
irqreturn_t mei_interrupt_thread_handler (int irq, void *dev_id)
 
void mei_timer (struct work_struct *work)
 
int mei_ioctl_connect_client (struct file *file, struct mei_connect_client_data *data)
 
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, char __user *ubuf, size_t length, loff_t *offset)
 
struct mei_cl_cbfind_amthi_read_list_entry (struct mei_device *dev, struct file *file)
 
void mei_run_next_iamthif_cmd (struct mei_device *dev)
 
void mei_free_cb_private (struct mei_cl_cb *priv_cb)
 
void mei_hcsr_set (struct mei_device *dev)
 
void mei_csr_clear_his (struct mei_device *dev)
 
void mei_enable_interrupts (struct mei_device *dev)
 
void mei_disable_interrupts (struct mei_device *dev)
 

Variables

const uuid_le mei_amthi_guid
 
const uuid_le mei_wd_guid
 
const u8 mei_wd_state_independence_msg [3][4]
 

Macro Definition Documentation

#define MEI_CLIENTS_MAX   256

Definition at line 61 of file mei_dev.h.

#define MEI_MAX_OPEN_HANDLE_COUNT   (MEI_CLIENTS_MAX - 3)

Definition at line 72 of file mei_dev.h.

#define MEI_RD_MSG_BUF_SIZE   (128 * sizeof(u32))

Definition at line 40 of file mei_dev.h.

#define MEI_WD_DEFAULT_TIMEOUT   120 /* seconds */

Definition at line 32 of file mei_dev.h.

#define MEI_WD_HDR_SIZE   4

Definition at line 28 of file mei_dev.h.

#define MEI_WD_MAX_TIMEOUT   65535 /* seconds */

Definition at line 34 of file mei_dev.h.

#define MEI_WD_MIN_TIMEOUT   120 /* seconds */

Definition at line 33 of file mei_dev.h.

#define MEI_WD_START_MSG_SIZE   (MEI_WD_HDR_SIZE + 16)

Definition at line 30 of file mei_dev.h.

#define MEI_WD_STATE_INDEPENDENCE_MSG_SENT   (1 << 0)

Definition at line 38 of file mei_dev.h.

#define MEI_WD_STOP_MSG_SIZE   MEI_WD_HDR_SIZE

Definition at line 29 of file mei_dev.h.

#define MEI_WD_STOP_TIMEOUT   10 /* msecs */

Definition at line 36 of file mei_dev.h.

Enumeration Type Documentation

enum file_state
Enumerator:
MEI_FILE_INITIALIZING 
MEI_FILE_CONNECTING 
MEI_FILE_CONNECTED 
MEI_FILE_DISCONNECTING 
MEI_FILE_DISCONNECTED 

Definition at line 76 of file mei_dev.h.

Enumerator:
MEI_IAMTHIF_IDLE 
MEI_IAMTHIF_WRITING 
MEI_IAMTHIF_FLOW_CONTROL 
MEI_IAMTHIF_READING 
MEI_IAMTHIF_READ_COMPLETE 

Definition at line 105 of file mei_dev.h.

Enumerator:
MEI_READ 
MEI_WRITE 
MEI_IOCTL 
MEI_OPEN 
MEI_CLOSE 

Definition at line 129 of file mei_dev.h.

Enumerator:
MEI_DEV_INITIALIZING 
MEI_DEV_INIT_CLIENTS 
MEI_DEV_ENABLED 
MEI_DEV_RESETING 
MEI_DEV_DISABLED 
MEI_DEV_RECOVERING_FROM_RESET 
MEI_DEV_POWER_DOWN 
MEI_DEV_POWER_UP 

Definition at line 85 of file mei_dev.h.

Enumerator:
MEI_IDLE 
MEI_WRITING 
MEI_WRITE_COMPLETE 
MEI_FLOW_CONTROL 
MEI_READING 
MEI_READ_COMPLETE 

Definition at line 113 of file mei_dev.h.

Enumerator:
MEI_START_MESSAGE 
MEI_ENUM_CLIENTS_MESSAGE 
MEI_CLIENT_PROPERTIES_MESSAGE 

Definition at line 99 of file mei_dev.h.

Enumerator:
MEI_WD_IDLE 
MEI_WD_RUNNING 
MEI_WD_STOPPING 

Definition at line 122 of file mei_dev.h.

Function Documentation

int amthi_read ( struct mei_device dev,
struct file file,
char __user ubuf,
size_t  length,
loff_t *  offset 
)

Definition at line 284 of file iorw.c.

int amthi_write ( struct mei_device dev,
struct mei_cl_cb cb 
)

amthi_write - write iamthif data to amthi client

: the device structure : mei call back struct

returns 0 on success, <0 on failure.

Definition at line 463 of file iorw.c.

struct mei_cl_cb* find_amthi_read_list_entry ( struct mei_device dev,
struct file file 
)
read

Definition at line 249 of file iorw.c.

void mei_allocate_me_clients_storage ( struct mei_device dev)

allocate_me_clients_storage - allocates storage for me clients

: the device structure

returns none.

Definition at line 442 of file init.c.

struct mei_cl* mei_cl_allocate ( struct mei_device dev)
read

Definition at line 647 of file init.c.

int mei_cl_flush_queues ( struct mei_cl cl)

mei_cl_flush_queues - flushes queue lists belonging to cl.

: the device structure : private data of the file object

Definition at line 88 of file init.c.

void mei_cl_init ( struct mei_cl cl,
struct mei_device dev 
)

Definition at line 532 of file init.c.

void mei_csr_clear_his ( struct mei_device dev)
const char* mei_dev_state_str ( int  state)

Definition at line 27 of file init.c.

struct mei_device* mei_device_init ( struct pci_dev pdev)
read

init_mei_device - allocates and initializes the mei device structure

: The pci device structure

returns The mei_device_device pointer on success, NULL on failure.

Definition at line 130 of file init.c.

void mei_disable_interrupts ( struct mei_device dev)

mei_csr_disable_interrupts - disables mei device interrupts

: the device structure

Definition at line 54 of file interface.c.

int mei_disconnect_host_client ( struct mei_device dev,
struct mei_cl cl 
)

mei_disconnect_host_client - sends disconnect message to fw from host client.

: the device structure : private data of the file object

Locking: called under "dev->device_lock" lock

returns 0 on success, <0 on failure.

Definition at line 672 of file init.c.

void mei_enable_interrupts ( struct mei_device dev)

mei_csr_enable_interrupts - enables mei device interrupts

: the device structure

Definition at line 43 of file interface.c.

void mei_free_cb_private ( struct mei_cl_cb cb)

mei_free_cb_private - free mei_cb_private related memory

: mei callback struct

Definition at line 583 of file iorw.c.

void mei_hcsr_set ( struct mei_device dev)

mei_set_csr_register - writes H_CSR register to the mei device, and ignores the H_IS bit for it is write-one-to-zero.

: the device structure

Definition at line 30 of file interface.c.

int mei_host_client_properties ( struct mei_device dev)

host_client_properties - reads properties for client

: the device structure

returns: < 0 - Error. = 0 - no more clients. = 1 - still have clients to send properties request.

Definition at line 483 of file init.c.

void mei_host_enum_clients_message ( struct mei_device dev)

host_enum_clients_message - host sends enumeration client request message.

: the device structure

returns none.

Definition at line 408 of file init.c.

void mei_host_init_iamthif ( struct mei_device dev)

host_init_iamthif - mei initialization iamthif client.

: the device structure

Definition at line 597 of file init.c.

void mei_host_start_message ( struct mei_device dev)

host_start_message - mei host sends start message.

: the device structure

returns none.

Definition at line 370 of file init.c.

int mei_hw_init ( struct mei_device dev)

mei_hw_init - initializes host and fw to start work.

: the device structure

returns 0 on success, <0 on failure.

Definition at line 168 of file init.c.

int mei_initialize_clients ( struct mei_device dev)
irqreturn_t mei_interrupt_quick_handler ( int  irq,
void dev_id 
)

mei_interrupt_quick_handler - The ISR of the MEI device

: The irq number : pointer to the device structure

returns irqreturn_t

Definition at line 38 of file interrupt.c.

irqreturn_t mei_interrupt_thread_handler ( int  irq,
void dev_id 
)

mei_interrupt_thread_handler - function called after ISR to handle the interrupt processing.

: The irq number : pointer to the device structure

returns irqreturn_t

Definition at line 1451 of file interrupt.c.

void mei_io_list_flush ( struct mei_io_list list,
struct mei_cl cl 
)

mei_io_list_flush - removes list entry belonging to cl.

: An instance of our list structure : private data of the file object

Definition at line 68 of file init.c.

void mei_io_list_init ( struct mei_io_list list)

mei_io_list_init - Sets up a queue list.

: An instance io list structure : the device structure

Definition at line 56 of file init.c.

int mei_ioctl_connect_client ( struct file file,
struct mei_connect_client_data data 
)

Definition at line 78 of file iorw.c.

int mei_me_cl_by_id ( struct mei_device dev,
u8  client_id 
)

mei_me_cl_by_id return index to me_clients for client_id

: the device structure : me client id

Locking: called under "dev->device_lock" lock

returns index on success, -ENOENT on failure.

Definition at line 52 of file iorw.c.

int mei_me_cl_by_uuid ( const struct mei_device dev,
const uuid_le cuuid 
)

Definition at line 544 of file init.c.

int mei_me_cl_update_filext ( struct mei_device dev,
struct mei_cl cl,
const uuid_le cuuid,
u8  host_cl_id 
)

mei_me_cl_update_filext - searches for ME client guid sets client_id in mei_file_private if found : the device structure : private file structure to set client_id in : searched uuid of ME client : id of host client to be set in file private structure

returns ME client index

Definition at line 569 of file init.c.

void mei_remove_client_from_file_list ( struct mei_device dev,
u8  host_client_id 
)

mei_remove_client_from_file_list - removes file private data from device file list

: the device structure : host client id to be removed

Definition at line 742 of file init.c.

void mei_reset ( struct mei_device dev,
int  interrupts_enabled 
)

mei_reset - resets host and fw.

: the device structure : if interrupt should be enabled after reset.

Definition at line 272 of file init.c.

void mei_run_next_iamthif_cmd ( struct mei_device dev)

iamthif_ioctl_send_msg - send cmd data to amthi client

: the device structure

returns 0 on success, <0 on failure.

Definition at line 540 of file iorw.c.

int mei_start_read ( struct mei_device dev,
struct mei_cl cl 
)

mei_start_read - the start read client message function.

: the device structure : minor number : private data of the file object

returns 0 on success, <0 on failure.

Definition at line 396 of file iorw.c.

int mei_task_initialize_clients ( void data)
void mei_timer ( struct work_struct work)

mei_timer - timer function.

: pointer to the work_struct structure

NOTE: This function is called by timer interrupt work

Definition at line 1340 of file interrupt.c.

Variable Documentation

const uuid_le mei_amthi_guid

Definition at line 46 of file init.c.

const uuid_le mei_wd_guid

Definition at line 44 of file wd.c.

const u8 mei_wd_state_independence_msg[3][4]

Definition at line 32 of file wd.c.