diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2019-06-03 05:14:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-06 09:15:42 -0400 |
commit | 7e527e11d672e90f1a3dc8de84e0bfaccda15bba (patch) | |
tree | ee1893abef28b0de98f5ebb3c43aae41b877f733 | |
parent | 381e9760ee87ba53df882c4affadfcc07bdf3bc2 (diff) |
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>
-rw-r--r-- | Documentation/driver-api/index.rst | 1 | ||||
-rw-r--r-- | Documentation/driver-api/mei/index.rst | 22 | ||||
-rw-r--r-- | Documentation/driver-api/mei/mei-client-bus.rst (renamed from Documentation/misc-devices/mei/mei-client-bus.txt) | 135 | ||||
-rw-r--r-- | Documentation/driver-api/mei/mei.rst (renamed from Documentation/misc-devices/mei/mei.txt) | 30 | ||||
-rw-r--r-- | MAINTAINERS | 2 |
5 files changed, 104 insertions, 86 deletions
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst index d26308af6036..0dbaa987aa11 100644 --- a/Documentation/driver-api/index.rst +++ b/Documentation/driver-api/index.rst | |||
@@ -42,6 +42,7 @@ available subsections can be seen below. | |||
42 | target | 42 | target |
43 | mtdnand | 43 | mtdnand |
44 | miscellaneous | 44 | miscellaneous |
45 | mei/index | ||
45 | w1 | 46 | w1 |
46 | rapidio | 47 | rapidio |
47 | s390-drivers | 48 | s390-drivers |
diff --git a/Documentation/driver-api/mei/index.rst b/Documentation/driver-api/mei/index.rst new file mode 100644 index 000000000000..35c1117d8366 --- /dev/null +++ b/Documentation/driver-api/mei/index.rst | |||
@@ -0,0 +1,22 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | .. include:: <isonum.txt> | ||
4 | |||
5 | =================================================== | ||
6 | Intel(R) Management Engine Interface (Intel(R) MEI) | ||
7 | =================================================== | ||
8 | |||
9 | **Copyright** |copy| 2019 Intel Corporation | ||
10 | |||
11 | |||
12 | .. only:: html | ||
13 | |||
14 | .. class:: toc-title | ||
15 | |||
16 | Table of Contents | ||
17 | |||
18 | .. toctree:: | ||
19 | :maxdepth: 2 | ||
20 | |||
21 | mei | ||
22 | mei-client-bus | ||
diff --git a/Documentation/misc-devices/mei/mei-client-bus.txt b/Documentation/driver-api/mei/mei-client-bus.rst index 743be4ec8989..a26a85453bdf 100644 --- a/Documentation/misc-devices/mei/mei-client-bus.txt +++ b/Documentation/driver-api/mei/mei-client-bus.rst | |||
@@ -1,3 +1,6 @@ | |||
1 | .. SPDX-License-Identifier: GPL-2.0 | ||
2 | |||
3 | ============================================== | ||
1 | Intel(R) Management Engine (ME) Client bus API | 4 | Intel(R) Management Engine (ME) Client bus API |
2 | ============================================== | 5 | ============================================== |
3 | 6 | ||
@@ -22,22 +25,24 @@ MEI CL bus API | |||
22 | 25 | ||
23 | A driver implementation for an MEI Client is very similar to existing bus | 26 | A driver implementation for an MEI Client is very similar to existing bus |
24 | based device drivers. The driver registers itself as an MEI CL bus driver through | 27 | based device drivers. The driver registers itself as an MEI CL bus driver through |
25 | the mei_cl_driver structure: | 28 | the ``struct mei_cl_driver`` structure: |
29 | |||
30 | .. code-block:: C | ||
26 | 31 | ||
27 | struct mei_cl_driver { | 32 | struct mei_cl_driver { |
28 | struct device_driver driver; | 33 | struct device_driver driver; |
29 | const char *name; | 34 | const char *name; |
30 | 35 | ||
31 | const struct mei_cl_device_id *id_table; | 36 | const struct mei_cl_device_id *id_table; |
32 | 37 | ||
33 | int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id *id); | 38 | int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id *id); |
34 | int (*remove)(struct mei_cl_device *dev); | 39 | int (*remove)(struct mei_cl_device *dev); |
35 | }; | 40 | }; |
36 | 41 | ||
37 | struct mei_cl_id { | 42 | struct mei_cl_id { |
38 | char name[MEI_NAME_SIZE]; | 43 | char name[MEI_NAME_SIZE]; |
39 | kernel_ulong_t driver_info; | 44 | kernel_ulong_t driver_info; |
40 | }; | 45 | }; |
41 | 46 | ||
42 | The mei_cl_id structure allows the driver to bind itself against a device name. | 47 | The mei_cl_id structure allows the driver to bind itself against a device name. |
43 | 48 | ||
@@ -61,58 +66,62 @@ Example | |||
61 | As a theoretical example let's pretend the ME comes with a "contact" NFC IP. | 66 | As a theoretical example let's pretend the ME comes with a "contact" NFC IP. |
62 | The driver init and exit routines for this device would look like: | 67 | The driver init and exit routines for this device would look like: |
63 | 68 | ||
64 | #define CONTACT_DRIVER_NAME "contact" | 69 | .. code-block:: C |
65 | 70 | ||
66 | static struct mei_cl_device_id contact_mei_cl_tbl[] = { | 71 | #define CONTACT_DRIVER_NAME "contact" |
67 | { CONTACT_DRIVER_NAME, }, | ||
68 | 72 | ||
69 | /* required last entry */ | 73 | static struct mei_cl_device_id contact_mei_cl_tbl[] = { |
70 | { } | 74 | { CONTACT_DRIVER_NAME, }, |
71 | }; | ||
72 | MODULE_DEVICE_TABLE(mei_cl, contact_mei_cl_tbl); | ||
73 | 75 | ||
74 | static struct mei_cl_driver contact_driver = { | 76 | /* required last entry */ |
75 | .id_table = contact_mei_tbl, | 77 | { } |
76 | .name = CONTACT_DRIVER_NAME, | 78 | }; |
79 | MODULE_DEVICE_TABLE(mei_cl, contact_mei_cl_tbl); | ||
77 | 80 | ||
78 | .probe = contact_probe, | 81 | static struct mei_cl_driver contact_driver = { |
79 | .remove = contact_remove, | 82 | .id_table = contact_mei_tbl, |
80 | }; | 83 | .name = CONTACT_DRIVER_NAME, |
81 | 84 | ||
82 | static int contact_init(void) | 85 | .probe = contact_probe, |
83 | { | 86 | .remove = contact_remove, |
84 | int r; | 87 | }; |
85 | 88 | ||
86 | r = mei_cl_driver_register(&contact_driver); | 89 | static int contact_init(void) |
87 | if (r) { | 90 | { |
88 | pr_err(CONTACT_DRIVER_NAME ": driver registration failed\n"); | 91 | int r; |
89 | return r; | 92 | |
90 | } | 93 | r = mei_cl_driver_register(&contact_driver); |
94 | if (r) { | ||
95 | pr_err(CONTACT_DRIVER_NAME ": driver registration failed\n"); | ||
96 | return r; | ||
97 | } | ||
91 | 98 | ||
92 | return 0; | 99 | return 0; |
93 | } | 100 | } |
94 | 101 | ||
95 | static void __exit contact_exit(void) | 102 | static void __exit contact_exit(void) |
96 | { | 103 | { |
97 | mei_cl_driver_unregister(&contact_driver); | 104 | mei_cl_driver_unregister(&contact_driver); |
98 | } | 105 | } |
99 | 106 | ||
100 | module_init(contact_init); | 107 | module_init(contact_init); |
101 | module_exit(contact_exit); | 108 | module_exit(contact_exit); |
102 | 109 | ||
103 | And the driver's simplified probe routine would look like that: | 110 | And the driver's simplified probe routine would look like that: |
104 | 111 | ||
105 | int contact_probe(struct mei_cl_device *dev, struct mei_cl_device_id *id) | 112 | .. code-block:: C |
106 | { | ||
107 | struct contact_driver *contact; | ||
108 | 113 | ||
109 | [...] | 114 | int contact_probe(struct mei_cl_device *dev, struct mei_cl_device_id *id) |
110 | mei_cl_enable_device(dev); | 115 | { |
116 | struct contact_driver *contact; | ||
111 | 117 | ||
112 | mei_cl_register_event_cb(dev, contact_event_cb, contact); | 118 | [...] |
119 | mei_cl_enable_device(dev); | ||
113 | 120 | ||
114 | return 0; | 121 | mei_cl_register_event_cb(dev, contact_event_cb, contact); |
115 | } | 122 | |
123 | return 0; | ||
124 | } | ||
116 | 125 | ||
117 | In the probe routine the driver first enable the MEI device and then registers | 126 | In the probe routine the driver first enable the MEI device and then registers |
118 | an ME bus event handler which is as close as it can get to registering a | 127 | an ME bus event handler which is as close as it can get to registering a |
@@ -122,20 +131,22 @@ the pending events: | |||
122 | 131 | ||
123 | #define MAX_NFC_PAYLOAD 128 | 132 | #define MAX_NFC_PAYLOAD 128 |
124 | 133 | ||
125 | static void contact_event_cb(struct mei_cl_device *dev, u32 events, | 134 | .. code-block:: C |
126 | void *context) | 135 | |
127 | { | 136 | static void contact_event_cb(struct mei_cl_device *dev, u32 events, |
128 | struct contact_driver *contact = context; | 137 | void *context) |
138 | { | ||
139 | struct contact_driver *contact = context; | ||
129 | 140 | ||
130 | if (events & BIT(MEI_EVENT_RX)) { | 141 | if (events & BIT(MEI_EVENT_RX)) { |
131 | u8 payload[MAX_NFC_PAYLOAD]; | 142 | u8 payload[MAX_NFC_PAYLOAD]; |
132 | int payload_size; | 143 | int payload_size; |
133 | 144 | ||
134 | payload_size = mei_recv(dev, payload, MAX_NFC_PAYLOAD); | 145 | payload_size = mei_recv(dev, payload, MAX_NFC_PAYLOAD); |
135 | if (payload_size <= 0) | 146 | if (payload_size <= 0) |
136 | return; | 147 | return; |
137 | 148 | ||
138 | /* Hook to the NFC subsystem */ | 149 | /* Hook to the NFC subsystem */ |
139 | nfc_hci_recv_frame(contact->hdev, payload, payload_size); | 150 | nfc_hci_recv_frame(contact->hdev, payload, payload_size); |
151 | } | ||
140 | } | 152 | } |
141 | } | ||
diff --git a/Documentation/misc-devices/mei/mei.txt b/Documentation/driver-api/mei/mei.rst index 2b80a0cd621f..5aa3a5e6496a 100644 --- a/Documentation/misc-devices/mei/mei.txt +++ b/Documentation/driver-api/mei/mei.rst | |||
@@ -1,5 +1,4 @@ | |||
1 | Intel(R) Management Engine Interface (Intel(R) MEI) | 1 | .. SPDX-License-Identifier: GPL-2.0 |
2 | =================================================== | ||
3 | 2 | ||
4 | Introduction | 3 | Introduction |
5 | ============ | 4 | ============ |
@@ -70,6 +69,8 @@ user to access it. | |||
70 | 69 | ||
71 | A code snippet for an application communicating with Intel AMTHI client: | 70 | A code snippet for an application communicating with Intel AMTHI client: |
72 | 71 | ||
72 | .. code-block:: C | ||
73 | |||
73 | struct mei_connect_client_data data; | 74 | struct mei_connect_client_data data; |
74 | fd = open(MEI_DEVICE); | 75 | fd = open(MEI_DEVICE); |
75 | 76 | ||
@@ -93,8 +94,8 @@ A code snippet for an application communicating with Intel AMTHI client: | |||
93 | close(fd); | 94 | close(fd); |
94 | 95 | ||
95 | 96 | ||
96 | IOCTL | 97 | IOCTLs |
97 | ===== | 98 | ====== |
98 | 99 | ||
99 | The Intel MEI Driver supports the following IOCTL commands: | 100 | The Intel MEI Driver supports the following IOCTL commands: |
100 | IOCTL_MEI_CONNECT_CLIENT Connect to firmware Feature (client). | 101 | IOCTL_MEI_CONNECT_CLIENT Connect to firmware Feature (client). |
@@ -114,8 +115,7 @@ The Intel MEI Driver supports the following IOCTL commands: | |||
114 | 115 | ||
115 | error returns: | 116 | error returns: |
116 | EINVAL Wrong IOCTL Number | 117 | EINVAL Wrong IOCTL Number |
117 | ENODEV Device or Connection is not initialized or ready. | 118 | ENODEV Device or Connection is not initialized or ready. (e.g. Wrong UUID) |
118 | (e.g. Wrong UUID) | ||
119 | ENOMEM Unable to allocate memory to client internal data. | 119 | ENOMEM Unable to allocate memory to client internal data. |
120 | EFAULT Fatal Error (e.g. Unable to access user input data) | 120 | EFAULT Fatal Error (e.g. Unable to access user input data) |
121 | EBUSY Connection Already Open | 121 | EBUSY Connection Already Open |
@@ -241,26 +241,10 @@ watchdog is 120 seconds. | |||
241 | If the Intel AMT is not enabled in the firmware then the watchdog client won't enumerate | 241 | If the Intel AMT is not enabled in the firmware then the watchdog client won't enumerate |
242 | on the me client bus and watchdog devices won't be exposed. | 242 | on the me client bus and watchdog devices won't be exposed. |
243 | 243 | ||
244 | |||
245 | Supported Chipsets | 244 | Supported Chipsets |
246 | ================== | 245 | ================== |
246 | 82X38/X48 Express and newer | ||
247 | 247 | ||
248 | 7 Series Chipset Family | ||
249 | 6 Series Chipset Family | ||
250 | 5 Series Chipset Family | ||
251 | 4 Series Chipset Family | ||
252 | Mobile 4 Series Chipset Family | ||
253 | ICH9 | ||
254 | 82946GZ/GL | ||
255 | 82G35 Express | ||
256 | 82Q963/Q965 | ||
257 | 82P965/G965 | ||
258 | Mobile PM965/GM965 | ||
259 | Mobile GME965/GLE960 | ||
260 | 82Q35 Express | ||
261 | 82G33/G31/P35/P31 Express | ||
262 | 82Q33 Express | ||
263 | 82X38/X48 Express | ||
264 | 248 | ||
265 | --- | 249 | --- |
266 | linux-mei@linux.intel.com | 250 | linux-mei@linux.intel.com |
diff --git a/MAINTAINERS b/MAINTAINERS index 5cfbea4ce575..bfe48cbea84c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -8021,7 +8021,7 @@ F: include/uapi/linux/mei.h | |||
8021 | F: include/linux/mei_cl_bus.h | 8021 | F: include/linux/mei_cl_bus.h |
8022 | F: drivers/misc/mei/* | 8022 | F: drivers/misc/mei/* |
8023 | F: drivers/watchdog/mei_wdt.c | 8023 | F: drivers/watchdog/mei_wdt.c |
8024 | F: Documentation/misc-devices/mei/* | 8024 | F: Documentation/driver-api/mei/* |
8025 | F: samples/mei/* | 8025 | F: samples/mei/* |
8026 | 8026 | ||
8027 | INTEL MENLOW THERMAL DRIVER | 8027 | INTEL MENLOW THERMAL DRIVER |