blob: 12b0f4bbe1f1fb07b49125caa4ce189a694ac36a [file] [log] [blame]
Tomas Winkler9dc64d62013-01-08 23:07:17 +02001/*
2 *
Tomas Winkler66ef5ea2012-12-25 19:06:02 +02003 * Intel Management Engine Interface (Intel MEI) Linux driver
Tomas Winkler9dc64d62013-01-08 23:07:17 +02004 * Copyright (c) 2003-2012, Intel Corporation.
Tomas Winkler66ef5ea2012-12-25 19:06:02 +02005 *
Tomas Winkler9dc64d62013-01-08 23:07:17 +02006 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
Tomas Winkler66ef5ea2012-12-25 19:06:02 +02009 *
Tomas Winkler9dc64d62013-01-08 23:07:17 +020010 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
Tomas Winkler66ef5ea2012-12-25 19:06:02 +020014 *
Tomas Winkler66ef5ea2012-12-25 19:06:02 +020015 */
16
Tomas Winkler66ef5ea2012-12-25 19:06:02 +020017
18
Tomas Winkler9dc64d62013-01-08 23:07:17 +020019#ifndef _MEI_INTERFACE_H_
20#define _MEI_INTERFACE_H_
21
22#include <linux/mei.h>
Bjorn Helgaas81ec5502014-02-14 14:06:14 -070023#include <linux/irqreturn.h>
Tomas Winkler9dc64d62013-01-08 23:07:17 +020024#include "mei_dev.h"
Tomas Winkler52c34562013-02-06 14:06:40 +020025#include "client.h"
Tomas Winkler66ef5ea2012-12-25 19:06:02 +020026
Tomas Winkler180ea052014-03-18 22:52:02 +020027#define MEI_ME_RPM_TIMEOUT 500 /* ms */
28
Tomas Winkler52c34562013-02-06 14:06:40 +020029struct mei_me_hw {
30 void __iomem *mem_addr;
31 /*
32 * hw states of host and fw(ME)
33 */
34 u32 host_hw_state;
35 u32 me_hw_state;
Tomas Winklerba9cdd02014-03-18 22:52:00 +020036 enum mei_pg_state pg_state;
Tomas Winkler52c34562013-02-06 14:06:40 +020037};
Tomas Winkler66ef5ea2012-12-25 19:06:02 +020038
Tomas Winkler52c34562013-02-06 14:06:40 +020039#define to_me_hw(dev) (struct mei_me_hw *)((dev)->hw)
40
Alexander Usyskin8d929d42014-05-13 01:30:53 +030041extern const struct mei_cfg mei_me_legacy_cfg;
42extern const struct mei_cfg mei_me_ich_cfg;
43extern const struct mei_cfg mei_me_pch_cfg;
Tomas Winklerc9199512014-05-13 01:30:54 +030044extern const struct mei_cfg mei_me_pch_cpt_pbg_cfg;
45extern const struct mei_cfg mei_me_lpt_cfg;
Alexander Usyskin8d929d42014-05-13 01:30:53 +030046
47struct mei_device *mei_me_dev_init(struct pci_dev *pdev,
48 const struct mei_cfg *cfg);
Tomas Winkler66ef5ea2012-12-25 19:06:02 +020049
Tomas Winklerba9cdd02014-03-18 22:52:00 +020050int mei_me_pg_set_sync(struct mei_device *dev);
51int mei_me_pg_unset_sync(struct mei_device *dev);
52
Tomas Winkler06ecd642013-02-06 14:06:42 +020053irqreturn_t mei_me_irq_quick_handler(int irq, void *dev_id);
54irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id);
55
Tomas Winkler9dc64d62013-01-08 23:07:17 +020056#endif /* _MEI_INTERFACE_H_ */