mei: docs: move documentation under driver-api
Move mei driver documentation under Documentation/driver-api/ Perform some minimal formating changes to produce correct sphinx rendering and add index.rst Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
381e9760ee
commit
7e527e11d6
|
@ -42,6 +42,7 @@ available subsections can be seen below.
|
||||||
target
|
target
|
||||||
mtdnand
|
mtdnand
|
||||||
miscellaneous
|
miscellaneous
|
||||||
|
mei/index
|
||||||
w1
|
w1
|
||||||
rapidio
|
rapidio
|
||||||
s390-drivers
|
s390-drivers
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
.. SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
.. include:: <isonum.txt>
|
||||||
|
|
||||||
|
===================================================
|
||||||
|
Intel(R) Management Engine Interface (Intel(R) MEI)
|
||||||
|
===================================================
|
||||||
|
|
||||||
|
**Copyright** |copy| 2019 Intel Corporation
|
||||||
|
|
||||||
|
|
||||||
|
.. only:: html
|
||||||
|
|
||||||
|
.. class:: toc-title
|
||||||
|
|
||||||
|
Table of Contents
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
mei
|
||||||
|
mei-client-bus
|
|
@ -1,3 +1,6 @@
|
||||||
|
.. SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
==============================================
|
||||||
Intel(R) Management Engine (ME) Client bus API
|
Intel(R) Management Engine (ME) Client bus API
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
|
@ -22,22 +25,24 @@ MEI CL bus API
|
||||||
|
|
||||||
A driver implementation for an MEI Client is very similar to existing bus
|
A driver implementation for an MEI Client is very similar to existing bus
|
||||||
based device drivers. The driver registers itself as an MEI CL bus driver through
|
based device drivers. The driver registers itself as an MEI CL bus driver through
|
||||||
the mei_cl_driver structure:
|
the ``struct mei_cl_driver`` structure:
|
||||||
|
|
||||||
struct mei_cl_driver {
|
.. code-block:: C
|
||||||
struct device_driver driver;
|
|
||||||
const char *name;
|
|
||||||
|
|
||||||
const struct mei_cl_device_id *id_table;
|
struct mei_cl_driver {
|
||||||
|
struct device_driver driver;
|
||||||
|
const char *name;
|
||||||
|
|
||||||
int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id *id);
|
const struct mei_cl_device_id *id_table;
|
||||||
int (*remove)(struct mei_cl_device *dev);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct mei_cl_id {
|
int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id *id);
|
||||||
char name[MEI_NAME_SIZE];
|
int (*remove)(struct mei_cl_device *dev);
|
||||||
kernel_ulong_t driver_info;
|
};
|
||||||
};
|
|
||||||
|
struct mei_cl_id {
|
||||||
|
char name[MEI_NAME_SIZE];
|
||||||
|
kernel_ulong_t driver_info;
|
||||||
|
};
|
||||||
|
|
||||||
The mei_cl_id structure allows the driver to bind itself against a device name.
|
The mei_cl_id structure allows the driver to bind itself against a device name.
|
||||||
|
|
||||||
|
@ -61,58 +66,62 @@ Example
|
||||||
As a theoretical example let's pretend the ME comes with a "contact" NFC IP.
|
As a theoretical example let's pretend the ME comes with a "contact" NFC IP.
|
||||||
The driver init and exit routines for this device would look like:
|
The driver init and exit routines for this device would look like:
|
||||||
|
|
||||||
#define CONTACT_DRIVER_NAME "contact"
|
.. code-block:: C
|
||||||
|
|
||||||
static struct mei_cl_device_id contact_mei_cl_tbl[] = {
|
#define CONTACT_DRIVER_NAME "contact"
|
||||||
{ CONTACT_DRIVER_NAME, },
|
|
||||||
|
|
||||||
/* required last entry */
|
static struct mei_cl_device_id contact_mei_cl_tbl[] = {
|
||||||
{ }
|
{ CONTACT_DRIVER_NAME, },
|
||||||
};
|
|
||||||
MODULE_DEVICE_TABLE(mei_cl, contact_mei_cl_tbl);
|
|
||||||
|
|
||||||
static struct mei_cl_driver contact_driver = {
|
/* required last entry */
|
||||||
.id_table = contact_mei_tbl,
|
{ }
|
||||||
.name = CONTACT_DRIVER_NAME,
|
};
|
||||||
|
MODULE_DEVICE_TABLE(mei_cl, contact_mei_cl_tbl);
|
||||||
|
|
||||||
.probe = contact_probe,
|
static struct mei_cl_driver contact_driver = {
|
||||||
.remove = contact_remove,
|
.id_table = contact_mei_tbl,
|
||||||
};
|
.name = CONTACT_DRIVER_NAME,
|
||||||
|
|
||||||
static int contact_init(void)
|
.probe = contact_probe,
|
||||||
{
|
.remove = contact_remove,
|
||||||
int r;
|
};
|
||||||
|
|
||||||
r = mei_cl_driver_register(&contact_driver);
|
static int contact_init(void)
|
||||||
if (r) {
|
{
|
||||||
pr_err(CONTACT_DRIVER_NAME ": driver registration failed\n");
|
int r;
|
||||||
return r;
|
|
||||||
|
r = mei_cl_driver_register(&contact_driver);
|
||||||
|
if (r) {
|
||||||
|
pr_err(CONTACT_DRIVER_NAME ": driver registration failed\n");
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
static void __exit contact_exit(void)
|
||||||
}
|
{
|
||||||
|
mei_cl_driver_unregister(&contact_driver);
|
||||||
|
}
|
||||||
|
|
||||||
static void __exit contact_exit(void)
|
module_init(contact_init);
|
||||||
{
|
module_exit(contact_exit);
|
||||||
mei_cl_driver_unregister(&contact_driver);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(contact_init);
|
|
||||||
module_exit(contact_exit);
|
|
||||||
|
|
||||||
And the driver's simplified probe routine would look like that:
|
And the driver's simplified probe routine would look like that:
|
||||||
|
|
||||||
int contact_probe(struct mei_cl_device *dev, struct mei_cl_device_id *id)
|
.. code-block:: C
|
||||||
{
|
|
||||||
struct contact_driver *contact;
|
|
||||||
|
|
||||||
[...]
|
int contact_probe(struct mei_cl_device *dev, struct mei_cl_device_id *id)
|
||||||
mei_cl_enable_device(dev);
|
{
|
||||||
|
struct contact_driver *contact;
|
||||||
|
|
||||||
mei_cl_register_event_cb(dev, contact_event_cb, contact);
|
[...]
|
||||||
|
mei_cl_enable_device(dev);
|
||||||
|
|
||||||
return 0;
|
mei_cl_register_event_cb(dev, contact_event_cb, contact);
|
||||||
}
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
In the probe routine the driver first enable the MEI device and then registers
|
In the probe routine the driver first enable the MEI device and then registers
|
||||||
an ME bus event handler which is as close as it can get to registering a
|
an ME bus event handler which is as close as it can get to registering a
|
||||||
|
@ -122,20 +131,22 @@ the pending events:
|
||||||
|
|
||||||
#define MAX_NFC_PAYLOAD 128
|
#define MAX_NFC_PAYLOAD 128
|
||||||
|
|
||||||
static void contact_event_cb(struct mei_cl_device *dev, u32 events,
|
.. code-block:: C
|
||||||
void *context)
|
|
||||||
{
|
|
||||||
struct contact_driver *contact = context;
|
|
||||||
|
|
||||||
if (events & BIT(MEI_EVENT_RX)) {
|
static void contact_event_cb(struct mei_cl_device *dev, u32 events,
|
||||||
u8 payload[MAX_NFC_PAYLOAD];
|
void *context)
|
||||||
int payload_size;
|
{
|
||||||
|
struct contact_driver *contact = context;
|
||||||
|
|
||||||
payload_size = mei_recv(dev, payload, MAX_NFC_PAYLOAD);
|
if (events & BIT(MEI_EVENT_RX)) {
|
||||||
if (payload_size <= 0)
|
u8 payload[MAX_NFC_PAYLOAD];
|
||||||
return;
|
int payload_size;
|
||||||
|
|
||||||
/* Hook to the NFC subsystem */
|
payload_size = mei_recv(dev, payload, MAX_NFC_PAYLOAD);
|
||||||
nfc_hci_recv_frame(contact->hdev, payload, payload_size);
|
if (payload_size <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Hook to the NFC subsystem */
|
||||||
|
nfc_hci_recv_frame(contact->hdev, payload, payload_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -1,5 +1,4 @@
|
||||||
Intel(R) Management Engine Interface (Intel(R) MEI)
|
.. SPDX-License-Identifier: GPL-2.0
|
||||||
===================================================
|
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
|
@ -70,6 +69,8 @@ user to access it.
|
||||||
|
|
||||||
A code snippet for an application communicating with Intel AMTHI client:
|
A code snippet for an application communicating with Intel AMTHI client:
|
||||||
|
|
||||||
|
.. code-block:: C
|
||||||
|
|
||||||
struct mei_connect_client_data data;
|
struct mei_connect_client_data data;
|
||||||
fd = open(MEI_DEVICE);
|
fd = open(MEI_DEVICE);
|
||||||
|
|
||||||
|
@ -93,8 +94,8 @@ A code snippet for an application communicating with Intel AMTHI client:
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
|
||||||
IOCTL
|
IOCTLs
|
||||||
=====
|
======
|
||||||
|
|
||||||
The Intel MEI Driver supports the following IOCTL commands:
|
The Intel MEI Driver supports the following IOCTL commands:
|
||||||
IOCTL_MEI_CONNECT_CLIENT Connect to firmware Feature (client).
|
IOCTL_MEI_CONNECT_CLIENT Connect to firmware Feature (client).
|
||||||
|
@ -114,8 +115,7 @@ The Intel MEI Driver supports the following IOCTL commands:
|
||||||
|
|
||||||
error returns:
|
error returns:
|
||||||
EINVAL Wrong IOCTL Number
|
EINVAL Wrong IOCTL Number
|
||||||
ENODEV Device or Connection is not initialized or ready.
|
ENODEV Device or Connection is not initialized or ready. (e.g. Wrong UUID)
|
||||||
(e.g. Wrong UUID)
|
|
||||||
ENOMEM Unable to allocate memory to client internal data.
|
ENOMEM Unable to allocate memory to client internal data.
|
||||||
EFAULT Fatal Error (e.g. Unable to access user input data)
|
EFAULT Fatal Error (e.g. Unable to access user input data)
|
||||||
EBUSY Connection Already Open
|
EBUSY Connection Already Open
|
||||||
|
@ -241,26 +241,10 @@ watchdog is 120 seconds.
|
||||||
If the Intel AMT is not enabled in the firmware then the watchdog client won't enumerate
|
If the Intel AMT is not enabled in the firmware then the watchdog client won't enumerate
|
||||||
on the me client bus and watchdog devices won't be exposed.
|
on the me client bus and watchdog devices won't be exposed.
|
||||||
|
|
||||||
|
|
||||||
Supported Chipsets
|
Supported Chipsets
|
||||||
==================
|
==================
|
||||||
|
82X38/X48 Express and newer
|
||||||
|
|
||||||
7 Series Chipset Family
|
|
||||||
6 Series Chipset Family
|
|
||||||
5 Series Chipset Family
|
|
||||||
4 Series Chipset Family
|
|
||||||
Mobile 4 Series Chipset Family
|
|
||||||
ICH9
|
|
||||||
82946GZ/GL
|
|
||||||
82G35 Express
|
|
||||||
82Q963/Q965
|
|
||||||
82P965/G965
|
|
||||||
Mobile PM965/GM965
|
|
||||||
Mobile GME965/GLE960
|
|
||||||
82Q35 Express
|
|
||||||
82G33/G31/P35/P31 Express
|
|
||||||
82Q33 Express
|
|
||||||
82X38/X48 Express
|
|
||||||
|
|
||||||
---
|
---
|
||||||
linux-mei@linux.intel.com
|
linux-mei@linux.intel.com
|
|
@ -8021,7 +8021,7 @@ F: include/uapi/linux/mei.h
|
||||||
F: include/linux/mei_cl_bus.h
|
F: include/linux/mei_cl_bus.h
|
||||||
F: drivers/misc/mei/*
|
F: drivers/misc/mei/*
|
||||||
F: drivers/watchdog/mei_wdt.c
|
F: drivers/watchdog/mei_wdt.c
|
||||||
F: Documentation/misc-devices/mei/*
|
F: Documentation/driver-api/mei/*
|
||||||
F: samples/mei/*
|
F: samples/mei/*
|
||||||
|
|
||||||
INTEL MENLOW THERMAL DRIVER
|
INTEL MENLOW THERMAL DRIVER
|
||||||
|
|
Loading…
Reference in New Issue