aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2014-09-29 09:31:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-29 11:56:02 -0400
commitce23139c6c2ee92d5eace20f6f10d716cf295a5b (patch)
treed7632b38efdf2980ec778ced8d7bb9303e8d7f49 /drivers/misc
parenta8605ea2c20c2b97a54d7746c16ebef5ba29632a (diff)
mei: fix kernel-doc warnings
Add missed parameters descriptions and return values descriptions Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mei/amthif.c5
-rw-r--r--drivers/misc/mei/client.c6
-rw-r--r--drivers/misc/mei/debugfs.c2
-rw-r--r--drivers/misc/mei/hbm.c2
-rw-r--r--drivers/misc/mei/hw-me.c41
-rw-r--r--drivers/misc/mei/hw-me.h6
-rw-r--r--drivers/misc/mei/hw-txe.c63
-rw-r--r--drivers/misc/mei/hw-txe.h1
-rw-r--r--drivers/misc/mei/hw.h2
-rw-r--r--drivers/misc/mei/init.c4
-rw-r--r--drivers/misc/mei/interrupt.c4
-rw-r--r--drivers/misc/mei/mei_dev.h151
-rw-r--r--drivers/misc/mei/nfc.c5
-rw-r--r--drivers/misc/mei/pci-me.c6
14 files changed, 231 insertions, 67 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 29b3fd0ab505..6cdce8477f57 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -64,6 +64,7 @@ void mei_amthif_reset_params(struct mei_device *dev)
64 * 64 *
65 * @dev: the device structure 65 * @dev: the device structure
66 * 66 *
67 * Return: 0 on success, <0 on failure.
67 */ 68 */
68int mei_amthif_host_init(struct mei_device *dev) 69int mei_amthif_host_init(struct mei_device *dev)
69{ 70{
@@ -352,7 +353,7 @@ int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *cb)
352 return mei_amthif_send_cmd(dev, cb); 353 return mei_amthif_send_cmd(dev, cb);
353} 354}
354/** 355/**
355 * mei_amthif_run_next_cmd 356 * mei_amthif_run_next_cmd - send next amt command from queue
356 * 357 *
357 * @dev: the device structure 358 * @dev: the device structure
358 */ 359 */
@@ -496,7 +497,7 @@ int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
496} 497}
497 498
498/** 499/**
499 * mei_amthif_irq_read_message - read routine after ISR to 500 * mei_amthif_irq_read_msg - read routine after ISR to
500 * handle the read amthif message 501 * handle the read amthif message
501 * 502 *
502 * @dev: the device structure 503 * @dev: the device structure
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 1f91c55f7af5..bc9ba5359bc6 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -271,6 +271,8 @@ int mei_io_cb_alloc_resp_buf(struct mei_cl_cb *cb, size_t length)
271 * mei_cl_flush_queues - flushes queue lists belonging to cl. 271 * mei_cl_flush_queues - flushes queue lists belonging to cl.
272 * 272 *
273 * @cl: host client 273 * @cl: host client
274 *
275 * Return: 0 on success, -EINVAL if cl or cl->dev is NULL.
274 */ 276 */
275int mei_cl_flush_queues(struct mei_cl *cl) 277int mei_cl_flush_queues(struct mei_cl *cl)
276{ 278{
@@ -402,6 +404,8 @@ int mei_cl_link(struct mei_cl *cl, int id)
402 * mei_cl_unlink - remove me_cl from the list 404 * mei_cl_unlink - remove me_cl from the list
403 * 405 *
404 * @cl: host client 406 * @cl: host client
407 *
408 * Return: always 0
405 */ 409 */
406int mei_cl_unlink(struct mei_cl *cl) 410int mei_cl_unlink(struct mei_cl *cl)
407{ 411{
@@ -756,6 +760,7 @@ int mei_cl_flow_ctrl_reduce(struct mei_cl *cl)
756 * mei_cl_read_start - the start read client message function. 760 * mei_cl_read_start - the start read client message function.
757 * 761 *
758 * @cl: host client 762 * @cl: host client
763 * @length: number of bytes to read
759 * 764 *
760 * Return: 0 on success, <0 on failure. 765 * Return: 0 on success, <0 on failure.
761 */ 766 */
@@ -916,6 +921,7 @@ int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
916 * 921 *
917 * @cl: host client 922 * @cl: host client
918 * @cb: write callback with filled data 923 * @cb: write callback with filled data
924 * @blocking: block until completed
919 * 925 *
920 * Return: number of bytes sent on success, <0 on failure. 926 * Return: number of bytes sent on success, <0 on failure.
921 */ 927 */
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index 357b02c18d40..ce1566715f80 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -177,6 +177,8 @@ void mei_dbgfs_deregister(struct mei_device *dev)
177 * 177 *
178 * @dev: the mei device structure 178 * @dev: the mei device structure
179 * @name: the mei device name 179 * @name: the mei device name
180 *
181 * Return: 0 on success, <0 on failure.
180 */ 182 */
181int mei_dbgfs_register(struct mei_device *dev, const char *name) 183int mei_dbgfs_register(struct mei_device *dev, const char *name)
182{ 184{
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
index da476e8cac84..49a2653d91a5 100644
--- a/drivers/misc/mei/hbm.c
+++ b/drivers/misc/mei/hbm.c
@@ -176,6 +176,8 @@ void mei_hbm_cl_hdr(struct mei_cl *cl, u8 hbm_cmd, void *buf, size_t len)
176 * @cl: client 176 * @cl: client
177 * @hbm_cmd: host bus message command 177 * @hbm_cmd: host bus message command
178 * @len: buffer length 178 * @len: buffer length
179 *
180 * Return: 0 on success, <0 on failure.
179 */ 181 */
180static inline 182static inline
181int mei_hbm_cl_write(struct mei_device *dev, 183int mei_hbm_cl_write(struct mei_device *dev,
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 9dd7aa70bd85..4f2fd6fc1e23 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -94,6 +94,7 @@ static inline u32 mei_hcsr_read(const struct mei_me_hw *hw)
94 * and ignores the H_IS bit for it is write-one-to-zero. 94 * and ignores the H_IS bit for it is write-one-to-zero.
95 * 95 *
96 * @hw: the me hardware structure 96 * @hw: the me hardware structure
97 * @hcsr: new register value
97 */ 98 */
98static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr) 99static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr)
99{ 100{
@@ -106,6 +107,8 @@ static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr)
106 * 107 *
107 * @dev: mei device 108 * @dev: mei device
108 * @fw_status: fw status register values 109 * @fw_status: fw status register values
110 *
111 * Return: 0 on success, error otherwise
109 */ 112 */
110static int mei_me_fw_status(struct mei_device *dev, 113static int mei_me_fw_status(struct mei_device *dev,
111 struct mei_fw_status *fw_status) 114 struct mei_fw_status *fw_status)
@@ -149,8 +152,9 @@ static void mei_me_hw_config(struct mei_device *dev)
149 * mei_me_pg_state - translate internal pg state 152 * mei_me_pg_state - translate internal pg state
150 * to the mei power gating state 153 * to the mei power gating state
151 * 154 *
152 * @hw - me hardware 155 * @dev: mei device
153 * returns: MEI_PG_OFF if aliveness is on and MEI_PG_ON otherwise 156 *
157 * Return: MEI_PG_OFF if aliveness is on and MEI_PG_ON otherwise
154 */ 158 */
155static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev) 159static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev)
156{ 160{
@@ -160,7 +164,7 @@ static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev)
160} 164}
161 165
162/** 166/**
163 * mei_clear_interrupts - clear and stop interrupts 167 * mei_me_intr_clear - clear and stop interrupts
164 * 168 *
165 * @dev: the device structure 169 * @dev: the device structure
166 */ 170 */
@@ -187,7 +191,7 @@ static void mei_me_intr_enable(struct mei_device *dev)
187} 191}
188 192
189/** 193/**
190 * mei_disable_interrupts - disables mei device interrupts 194 * mei_me_intr_disable - disables mei device interrupts
191 * 195 *
192 * @dev: the device structure 196 * @dev: the device structure
193 */ 197 */
@@ -222,6 +226,8 @@ static void mei_me_hw_reset_release(struct mei_device *dev)
222 * 226 *
223 * @dev: the device structure 227 * @dev: the device structure
224 * @intr_enable: if interrupt should be enabled after reset. 228 * @intr_enable: if interrupt should be enabled after reset.
229 *
230 * Return: always 0
225 */ 231 */
226static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable) 232static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
227{ 233{
@@ -259,10 +265,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
259/** 265/**
260 * mei_me_host_set_ready - enable device 266 * mei_me_host_set_ready - enable device
261 * 267 *
262 * @dev - mei device 268 * @dev: mei device
263 * returns bool
264 */ 269 */
265
266static void mei_me_host_set_ready(struct mei_device *dev) 270static void mei_me_host_set_ready(struct mei_device *dev)
267{ 271{
268 struct mei_me_hw *hw = to_me_hw(dev); 272 struct mei_me_hw *hw = to_me_hw(dev);
@@ -271,6 +275,7 @@ static void mei_me_host_set_ready(struct mei_device *dev)
271 hw->host_hw_state |= H_IE | H_IG | H_RDY; 275 hw->host_hw_state |= H_IE | H_IG | H_RDY;
272 mei_hcsr_set(hw, hw->host_hw_state); 276 mei_hcsr_set(hw, hw->host_hw_state);
273} 277}
278
274/** 279/**
275 * mei_me_host_is_ready - check whether the host has turned ready 280 * mei_me_host_is_ready - check whether the host has turned ready
276 * 281 *
@@ -299,6 +304,13 @@ static bool mei_me_hw_is_ready(struct mei_device *dev)
299 return (hw->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA; 304 return (hw->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA;
300} 305}
301 306
307/**
308 * mei_me_hw_ready_wait - wait until the me(hw) has turned ready
309 * or timeout is reached
310 *
311 * @dev: mei device
312 * Return: 0 on success, error otherwise
313 */
302static int mei_me_hw_ready_wait(struct mei_device *dev) 314static int mei_me_hw_ready_wait(struct mei_device *dev)
303{ 315{
304 mutex_unlock(&dev->device_lock); 316 mutex_unlock(&dev->device_lock);
@@ -315,6 +327,12 @@ static int mei_me_hw_ready_wait(struct mei_device *dev)
315 return 0; 327 return 0;
316} 328}
317 329
330/**
331 * mei_me_hw_start - hw start routine
332 *
333 * @dev: mei device
334 * Return: 0 on success, error otherwise
335 */
318static int mei_me_hw_start(struct mei_device *dev) 336static int mei_me_hw_start(struct mei_device *dev)
319{ 337{
320 int ret = mei_me_hw_ready_wait(dev); 338 int ret = mei_me_hw_ready_wait(dev);
@@ -381,6 +399,13 @@ static int mei_me_hbuf_empty_slots(struct mei_device *dev)
381 return empty_slots; 399 return empty_slots;
382} 400}
383 401
402/**
403 * mei_me_hbuf_max_len - returns size of hw buffer.
404 *
405 * @dev: the device structure
406 *
407 * Return: size of hw buffer in bytes
408 */
384static size_t mei_me_hbuf_max_len(const struct mei_device *dev) 409static size_t mei_me_hbuf_max_len(const struct mei_device *dev)
385{ 410{
386 return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr); 411 return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr);
@@ -472,6 +497,8 @@ static int mei_me_count_full_read_slots(struct mei_device *dev)
472 * @dev: the device structure 497 * @dev: the device structure
473 * @buffer: message buffer will be written 498 * @buffer: message buffer will be written
474 * @buffer_length: message size will be read 499 * @buffer_length: message size will be read
500 *
501 * Return: always 0
475 */ 502 */
476static int mei_me_read_slots(struct mei_device *dev, unsigned char *buffer, 503static int mei_me_read_slots(struct mei_device *dev, unsigned char *buffer,
477 unsigned long buffer_length) 504 unsigned long buffer_length)
diff --git a/drivers/misc/mei/hw-me.h b/drivers/misc/mei/hw-me.h
index b0001b3a0fb5..e6a59a62573a 100644
--- a/drivers/misc/mei/hw-me.h
+++ b/drivers/misc/mei/hw-me.h
@@ -47,7 +47,13 @@ struct mei_cfg {
47#define MEI_ME_RPM_TIMEOUT 500 /* ms */ 47#define MEI_ME_RPM_TIMEOUT 500 /* ms */
48 48
49/** 49/**
50 * struct mei_me_hw - me hw specific data
51 *
50 * @cfg: per device generation config and ops 52 * @cfg: per device generation config and ops
53 * @mem_addr: io memory address
54 * @host_hw_state: cached host state
55 * @me_hw_state: cached me (fw) state
56 * @pg_state: power gating state
51 */ 57 */
52struct mei_me_hw { 58struct mei_me_hw {
53 const struct mei_cfg *cfg; 59 const struct mei_cfg *cfg;
diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
index 0a155228645b..d3cf042fc509 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -28,11 +28,12 @@
28#include "hbm.h" 28#include "hbm.h"
29 29
30/** 30/**
31 * mei_txe_reg_read - Reads 32bit data from the device 31 * mei_txe_reg_read - Reads 32bit data from the txe device
32 * 32 *
33 * @base_addr: registers base address 33 * @base_addr: registers base address
34 * @offset: register offset 34 * @offset: register offset
35 * 35 *
36 * Return: register value
36 */ 37 */
37static inline u32 mei_txe_reg_read(void __iomem *base_addr, 38static inline u32 mei_txe_reg_read(void __iomem *base_addr,
38 unsigned long offset) 39 unsigned long offset)
@@ -41,7 +42,7 @@ static inline u32 mei_txe_reg_read(void __iomem *base_addr,
41} 42}
42 43
43/** 44/**
44 * mei_txe_reg_write - Writes 32bit data to the device 45 * mei_txe_reg_write - Writes 32bit data to the txe device
45 * 46 *
46 * @base_addr: registers base address 47 * @base_addr: registers base address
47 * @offset: register offset 48 * @offset: register offset
@@ -56,10 +57,12 @@ static inline void mei_txe_reg_write(void __iomem *base_addr,
56/** 57/**
57 * mei_txe_sec_reg_read_silent - Reads 32bit data from the SeC BAR 58 * mei_txe_sec_reg_read_silent - Reads 32bit data from the SeC BAR
58 * 59 *
59 * @dev: the device structure 60 * @hw: the txe hardware structure
60 * @offset: register offset 61 * @offset: register offset
61 * 62 *
62 * Doesn't check for aliveness while Reads 32bit data from the SeC BAR 63 * Doesn't check for aliveness while Reads 32bit data from the SeC BAR
64 *
65 * Return: register value
63 */ 66 */
64static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw, 67static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw,
65 unsigned long offset) 68 unsigned long offset)
@@ -70,10 +73,12 @@ static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw,
70/** 73/**
71 * mei_txe_sec_reg_read - Reads 32bit data from the SeC BAR 74 * mei_txe_sec_reg_read - Reads 32bit data from the SeC BAR
72 * 75 *
73 * @dev: the device structure 76 * @hw: the txe hardware structure
74 * @offset: register offset 77 * @offset: register offset
75 * 78 *
76 * Reads 32bit data from the SeC BAR and shout loud if aliveness is not set 79 * Reads 32bit data from the SeC BAR and shout loud if aliveness is not set
80 *
81 * Return: register value
77 */ 82 */
78static inline u32 mei_txe_sec_reg_read(struct mei_txe_hw *hw, 83static inline u32 mei_txe_sec_reg_read(struct mei_txe_hw *hw,
79 unsigned long offset) 84 unsigned long offset)
@@ -115,9 +120,10 @@ static inline void mei_txe_sec_reg_write(struct mei_txe_hw *hw,
115/** 120/**
116 * mei_txe_br_reg_read - Reads 32bit data from the Bridge BAR 121 * mei_txe_br_reg_read - Reads 32bit data from the Bridge BAR
117 * 122 *
118 * @hw: the device structure 123 * @hw: the txe hardware structure
119 * @offset: offset from which to read the data 124 * @offset: offset from which to read the data
120 * 125 *
126 * Return: the byte read.
121 */ 127 */
122static inline u32 mei_txe_br_reg_read(struct mei_txe_hw *hw, 128static inline u32 mei_txe_br_reg_read(struct mei_txe_hw *hw,
123 unsigned long offset) 129 unsigned long offset)
@@ -147,7 +153,10 @@ static inline void mei_txe_br_reg_write(struct mei_txe_hw *hw,
147 * Request for aliveness change and returns true if the change is 153 * Request for aliveness change and returns true if the change is
148 * really needed and false if aliveness is already 154 * really needed and false if aliveness is already
149 * in the requested state 155 * in the requested state
150 * Requires device lock to be held 156 *
157 * Locking: called under "dev->device_lock" lock
158 *
159 * Return: true if request was send
151 */ 160 */
152static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req) 161static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req)
153{ 162{
@@ -172,6 +181,8 @@ static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req)
172 * 181 *
173 * Extract HICR_HOST_ALIVENESS_RESP_ACK bit from 182 * Extract HICR_HOST_ALIVENESS_RESP_ACK bit from
174 * from HICR_HOST_ALIVENESS_REQ register value 183 * from HICR_HOST_ALIVENESS_REQ register value
184 *
185 * Return: SICR_HOST_ALIVENESS_REQ_REQUESTED bit value
175 */ 186 */
176static u32 mei_txe_aliveness_req_get(struct mei_device *dev) 187static u32 mei_txe_aliveness_req_get(struct mei_device *dev)
177{ 188{
@@ -184,10 +195,11 @@ static u32 mei_txe_aliveness_req_get(struct mei_device *dev)
184 195
185/** 196/**
186 * mei_txe_aliveness_get - get aliveness response register value 197 * mei_txe_aliveness_get - get aliveness response register value
198 *
187 * @dev: the device structure 199 * @dev: the device structure
188 * 200 *
189 * Extract HICR_HOST_ALIVENESS_RESP_ACK bit 201 * Return: HICR_HOST_ALIVENESS_RESP_ACK bit from HICR_HOST_ALIVENESS_RESP
190 * from HICR_HOST_ALIVENESS_RESP register value 202 * register
191 */ 203 */
192static u32 mei_txe_aliveness_get(struct mei_device *dev) 204static u32 mei_txe_aliveness_get(struct mei_device *dev)
193{ 205{
@@ -278,6 +290,7 @@ static int mei_txe_aliveness_wait(struct mei_device *dev, u32 expected)
278 * mei_txe_aliveness_set_sync - sets an wait for aliveness to complete 290 * mei_txe_aliveness_set_sync - sets an wait for aliveness to complete
279 * 291 *
280 * @dev: the device structure 292 * @dev: the device structure
293 * @req: requested aliveness value
281 * 294 *
282 * Return: 0 on success and < 0 otherwise 295 * Return: 0 on success and < 0 otherwise
283 */ 296 */
@@ -359,6 +372,8 @@ static void mei_txe_output_ready_set(struct mei_txe_hw *hw)
359 * mei_txe_is_input_ready - check if TXE is ready for receiving data 372 * mei_txe_is_input_ready - check if TXE is ready for receiving data
360 * 373 *
361 * @dev: the device structure 374 * @dev: the device structure
375 *
376 * Return: true if INPUT STATUS READY bit is set
362 */ 377 */
363static bool mei_txe_is_input_ready(struct mei_device *dev) 378static bool mei_txe_is_input_ready(struct mei_device *dev)
364{ 379{
@@ -417,6 +432,8 @@ static void mei_txe_intr_enable(struct mei_device *dev)
417 * 432 *
418 * Checks if there are pending interrupts 433 * Checks if there are pending interrupts
419 * only Aliveness, Readiness, Input ready, and Output doorbell are relevant 434 * only Aliveness, Readiness, Input ready, and Output doorbell are relevant
435 *
436 * Return: true if there are pending interrupts
420 */ 437 */
421static bool mei_txe_pending_interrupts(struct mei_device *dev) 438static bool mei_txe_pending_interrupts(struct mei_device *dev)
422{ 439{
@@ -476,7 +493,7 @@ static u32 mei_txe_out_data_read(const struct mei_device *dev,
476/* Readiness */ 493/* Readiness */
477 494
478/** 495/**
479 * mei_txe_readiness_set_host_rdy 496 * mei_txe_readiness_set_host_rdy - set host readiness bit
480 * 497 *
481 * @dev: the device structure 498 * @dev: the device structure
482 */ 499 */
@@ -490,7 +507,7 @@ static void mei_txe_readiness_set_host_rdy(struct mei_device *dev)
490} 507}
491 508
492/** 509/**
493 * mei_txe_readiness_clear 510 * mei_txe_readiness_clear - clear host readiness bit
494 * 511 *
495 * @dev: the device structure 512 * @dev: the device structure
496 */ 513 */
@@ -521,7 +538,9 @@ static u32 mei_txe_readiness_get(struct mei_device *dev)
521 * mei_txe_readiness_is_sec_rdy - check readiness 538 * mei_txe_readiness_is_sec_rdy - check readiness
522 * for HICR_SEC_IPC_READINESS_SEC_RDY 539 * for HICR_SEC_IPC_READINESS_SEC_RDY
523 * 540 *
524 * @readiness - cached readiness state 541 * @readiness: cached readiness state
542 *
543 * Return: true if readiness bit is set
525 */ 544 */
526static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness) 545static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness)
527{ 546{
@@ -532,6 +551,8 @@ static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness)
532 * mei_txe_hw_is_ready - check if the hw is ready 551 * mei_txe_hw_is_ready - check if the hw is ready
533 * 552 *
534 * @dev: the device structure 553 * @dev: the device structure
554 *
555 * Return: true if sec is ready
535 */ 556 */
536static bool mei_txe_hw_is_ready(struct mei_device *dev) 557static bool mei_txe_hw_is_ready(struct mei_device *dev)
537{ 558{
@@ -544,6 +565,8 @@ static bool mei_txe_hw_is_ready(struct mei_device *dev)
544 * mei_txe_host_is_ready - check if the host is ready 565 * mei_txe_host_is_ready - check if the host is ready
545 * 566 *
546 * @dev: the device structure 567 * @dev: the device structure
568 *
569 * Return: true if host is ready
547 */ 570 */
548static inline bool mei_txe_host_is_ready(struct mei_device *dev) 571static inline bool mei_txe_host_is_ready(struct mei_device *dev)
549{ 572{
@@ -589,6 +612,8 @@ const struct mei_fw_status mei_txe_fw_sts = {
589 * 612 *
590 * @dev: mei device 613 * @dev: mei device
591 * @fw_status: fw status register values 614 * @fw_status: fw status register values
615 *
616 * Return: 0 on success, error otherwise
592 */ 617 */
593static int mei_txe_fw_status(struct mei_device *dev, 618static int mei_txe_fw_status(struct mei_device *dev,
594 struct mei_fw_status *fw_status) 619 struct mei_fw_status *fw_status)
@@ -643,7 +668,7 @@ static void mei_txe_hw_config(struct mei_device *dev)
643 * @header: header of message 668 * @header: header of message
644 * @buf: message buffer will be written 669 * @buf: message buffer will be written
645 * 670 *
646 * Return: if success, 0 - otherwise. 671 * Return: 0 if success, <0 - otherwise.
647 */ 672 */
648 673
649static int mei_txe_write(struct mei_device *dev, 674static int mei_txe_write(struct mei_device *dev,
@@ -710,7 +735,7 @@ static int mei_txe_write(struct mei_device *dev,
710 * 735 *
711 * @dev: the device structure 736 * @dev: the device structure
712 * 737 *
713 * Return: PAYLOAD_SIZE - 4 738 * Return: the PAYLOAD_SIZE - 4
714 */ 739 */
715static size_t mei_txe_hbuf_max_len(const struct mei_device *dev) 740static size_t mei_txe_hbuf_max_len(const struct mei_device *dev)
716{ 741{
@@ -859,7 +884,7 @@ static int mei_txe_hw_reset(struct mei_device *dev, bool intr_enable)
859 * 884 *
860 * @dev: the device structure 885 * @dev: the device structure
861 * 886 *
862 * Return: 0 on success and < 0 in case of error 887 * Return: 0 on success an error code otherwise
863 */ 888 */
864static int mei_txe_hw_start(struct mei_device *dev) 889static int mei_txe_hw_start(struct mei_device *dev)
865{ 890{
@@ -915,6 +940,8 @@ static int mei_txe_hw_start(struct mei_device *dev)
915 * 940 *
916 * @dev: the device structure 941 * @dev: the device structure
917 * @do_ack: acknowledge interrupts 942 * @do_ack: acknowledge interrupts
943 *
944 * Return: true if found interrupts to process.
918 */ 945 */
919static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack) 946static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack)
920{ 947{
@@ -990,7 +1017,6 @@ irqreturn_t mei_txe_irq_quick_handler(int irq, void *dev_id)
990 * @dev_id: pointer to the device structure 1017 * @dev_id: pointer to the device structure
991 * 1018 *
992 * Return: IRQ_HANDLED 1019 * Return: IRQ_HANDLED
993 *
994 */ 1020 */
995irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id) 1021irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id)
996{ 1022{
@@ -1135,10 +1161,9 @@ static const struct mei_hw_ops mei_txe_hw_ops = {
1135/** 1161/**
1136 * mei_txe_dev_init - allocates and initializes txe hardware specific structure 1162 * mei_txe_dev_init - allocates and initializes txe hardware specific structure
1137 * 1163 *
1138 * @pdev - pci device 1164 * @pdev: pci device
1139 *
1140 * Return: struct mei_device * on success or NULL;
1141 * 1165 *
1166 * Return: struct mei_device * on success or NULL
1142 */ 1167 */
1143struct mei_device *mei_txe_dev_init(struct pci_dev *pdev) 1168struct mei_device *mei_txe_dev_init(struct pci_dev *pdev)
1144{ 1169{
@@ -1165,6 +1190,8 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev)
1165 * @dev: the device structure 1190 * @dev: the device structure
1166 * @addr: physical address start of the range 1191 * @addr: physical address start of the range
1167 * @range: physical range size 1192 * @range: physical range size
1193 *
1194 * Return: 0 on success an error code otherwise
1168 */ 1195 */
1169int mei_txe_setup_satt2(struct mei_device *dev, phys_addr_t addr, u32 range) 1196int mei_txe_setup_satt2(struct mei_device *dev, phys_addr_t addr, u32 range)
1170{ 1197{
diff --git a/drivers/misc/mei/hw-txe.h b/drivers/misc/mei/hw-txe.h
index e8dd2d165c25..ce3ed0b88b0c 100644
--- a/drivers/misc/mei/hw-txe.h
+++ b/drivers/misc/mei/hw-txe.h
@@ -40,6 +40,7 @@
40 * @mem_addr: SeC and BRIDGE bars 40 * @mem_addr: SeC and BRIDGE bars
41 * @aliveness: aliveness (power gating) state of the hardware 41 * @aliveness: aliveness (power gating) state of the hardware
42 * @readiness: readiness state of the hardware 42 * @readiness: readiness state of the hardware
43 * @slots: number of empty slots
43 * @wait_aliveness_resp: aliveness wait queue 44 * @wait_aliveness_resp: aliveness wait queue
44 * @intr_cause: translated interrupt cause 45 * @intr_cause: translated interrupt cause
45 */ 46 */
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h
index ea8de2a88b31..16fef6dc4dd7 100644
--- a/drivers/misc/mei/hw.h
+++ b/drivers/misc/mei/hw.h
@@ -109,6 +109,8 @@ enum mei_stop_reason_types {
109 * @MEI_HBMS_NOT_ALLOWED : operation not allowed 109 * @MEI_HBMS_NOT_ALLOWED : operation not allowed
110 * @MEI_HBMS_ALREADY_STARTED : system is already started 110 * @MEI_HBMS_ALREADY_STARTED : system is already started
111 * @MEI_HBMS_NOT_STARTED : system not started 111 * @MEI_HBMS_NOT_STARTED : system not started
112 *
113 * @MEI_HBMS_MAX : sentinel
112 */ 114 */
113enum mei_hbm_status { 115enum mei_hbm_status {
114 MEI_HBMS_SUCCESS = 0, 116 MEI_HBMS_SUCCESS = 0,
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 52d7f425ff8d..7901d076c127 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -59,8 +59,6 @@ const char *mei_pg_state_str(enum mei_pg_state state)
59 * mei_cancel_work - Cancel mei background jobs 59 * mei_cancel_work - Cancel mei background jobs
60 * 60 *
61 * @dev: the device structure 61 * @dev: the device structure
62 *
63 * Return: 0 on success or < 0 if the reset hasn't succeeded
64 */ 62 */
65void mei_cancel_work(struct mei_device *dev) 63void mei_cancel_work(struct mei_device *dev)
66{ 64{
@@ -75,6 +73,8 @@ EXPORT_SYMBOL_GPL(mei_cancel_work);
75 * mei_reset - resets host and fw. 73 * mei_reset - resets host and fw.
76 * 74 *
77 * @dev: the device structure 75 * @dev: the device structure
76 *
77 * Return: 0 on success or < 0 if the reset hasn't succeeded
78 */ 78 */
79int mei_reset(struct mei_device *dev) 79int mei_reset(struct mei_device *dev)
80{ 80{
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index d8aa1d372f74..20c6c511f438 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -87,7 +87,7 @@ static bool mei_cl_is_reading(struct mei_cl *cl, struct mei_msg_hdr *mei_hdr)
87} 87}
88 88
89/** 89/**
90 * mei_irq_read_client_message - process client message 90 * mei_cl_irq_read_msg - process client message
91 * 91 *
92 * @dev: the device structure 92 * @dev: the device structure
93 * @mei_hdr: header of mei client message 93 * @mei_hdr: header of mei client message
@@ -234,7 +234,7 @@ static int mei_cl_irq_disconnect(struct mei_cl *cl, struct mei_cl_cb *cb,
234 234
235 235
236/** 236/**
237 * mei_cl_irq_close - processes client read related operation from the 237 * mei_cl_irq_read - processes client read related operation from the
238 * interrupt thread context - request for flow control credits 238 * interrupt thread context - request for flow control credits
239 * 239 *
240 * @cl: client 240 * @cl: client
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 563eebb62827..71744b16cc8c 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -129,11 +129,11 @@ enum mei_wd_states {
129 129
130/** 130/**
131 * enum mei_cb_file_ops - file operation associated with the callback 131 * enum mei_cb_file_ops - file operation associated with the callback
132 * @MEI_FOP_READ - read 132 * @MEI_FOP_READ: read
133 * @MEI_FOP_WRITE - write 133 * @MEI_FOP_WRITE: write
134 * @MEI_FOP_CONNECT - connect 134 * @MEI_FOP_CONNECT: connect
135 * @MEI_FOP_DISCONNECT - disconnect 135 * @MEI_FOP_DISCONNECT: disconnect
136 * @MEI_FOP_DISCONNECT_RSP - disconnect response 136 * @MEI_FOP_DISCONNECT_RSP: disconnect response
137 */ 137 */
138enum mei_cb_file_ops { 138enum mei_cb_file_ops {
139 MEI_FOP_READ = 0, 139 MEI_FOP_READ = 0,
@@ -189,6 +189,12 @@ struct mei_cl;
189 * @list: link in callback queue 189 * @list: link in callback queue
190 * @cl: file client who is running this operation 190 * @cl: file client who is running this operation
191 * @fop_type: file operation type 191 * @fop_type: file operation type
192 * @request_buffer: buffer to store request data
193 * @response_buffer: buffer to store response data
194 * @buf_idx: last read index
195 * @read_time: last read operation time stamp (iamthif)
196 * @file_object: pointer to file structure
197 * @internal: communication between driver and FW flag
192 */ 198 */
193struct mei_cl_cb { 199struct mei_cl_cb {
194 struct list_head list; 200 struct list_head list;
@@ -202,7 +208,29 @@ struct mei_cl_cb {
202 u32 internal:1; 208 u32 internal:1;
203}; 209};
204 210
205/* MEI client instance carried as file->private_data*/ 211/**
212 * struct mei_cl - me client host representation
213 * carried in file->private_data
214 *
215 * @link: link in the clients list
216 * @dev: mei parent device
217 * @state: file operation state
218 * @tx_wait: wait queue for tx completion
219 * @rx_wait: wait queue for rx completion
220 * @wait: wait queue for management operation
221 * @status: connection status
222 * @cl_uuid: client uuid name
223 * @host_client_id: host id
224 * @me_client_id: me/fw id
225 * @mei_flow_ctrl_creds: transmit flow credentials
226 * @timer_count: watchdog timer for operation completion
227 * @reading_state: state of the rx
228 * @writing_state: state of the tx
229 * @read_cb: current pending reading callback
230 *
231 * @device: device on the mei client bus
232 * @device_link: link to bus clients
233 */
206struct mei_cl { 234struct mei_cl {
207 struct list_head link; 235 struct list_head link;
208 struct mei_device *dev; 236 struct mei_device *dev;
@@ -211,7 +239,6 @@ struct mei_cl {
211 wait_queue_head_t rx_wait; 239 wait_queue_head_t rx_wait;
212 wait_queue_head_t wait; 240 wait_queue_head_t wait;
213 int status; 241 int status;
214 /* ID of client connected */
215 uuid_le cl_uuid; 242 uuid_le cl_uuid;
216 u8 host_client_id; 243 u8 host_client_id;
217 u8 me_client_id; 244 u8 me_client_id;
@@ -334,8 +361,10 @@ void mei_cl_bus_exit(void);
334 * @dev: linux driver model device pointer 361 * @dev: linux driver model device pointer
335 * @cl: mei client 362 * @cl: mei client
336 * @ops: ME transport ops 363 * @ops: ME transport ops
364 * @event_work: async work to execute event callback
337 * @event_cb: Drivers register this callback to get asynchronous ME 365 * @event_cb: Drivers register this callback to get asynchronous ME
338 * events (e.g. Rx buffer pending) notifications. 366 * events (e.g. Rx buffer pending) notifications.
367 * @event_context: event callback run context
339 * @events: Events bitmask sent to the driver. 368 * @events: Events bitmask sent to the driver.
340 * @priv_data: client private data 369 * @priv_data: client private data
341 */ 370 */
@@ -355,7 +384,7 @@ struct mei_cl_device {
355}; 384};
356 385
357 386
358 /** 387/**
359 * enum mei_pg_event - power gating transition events 388 * enum mei_pg_event - power gating transition events
360 * 389 *
361 * @MEI_PG_EVENT_IDLE: the driver is not in power gating transition 390 * @MEI_PG_EVENT_IDLE: the driver is not in power gating transition
@@ -383,49 +412,102 @@ const char *mei_pg_state_str(enum mei_pg_state state);
383 412
384/** 413/**
385 * struct mei_device - MEI private device struct 414 * struct mei_device - MEI private device struct
386 415 *
387 * @dev : device on a bus 416 * @dev : device on a bus
388 * @cdev : character device 417 * @cdev : character device
389 * @minor : minor number allocated for device 418 * @minor : minor number allocated for device
390 * 419 *
391 * @reset_count : limits the number of consecutive resets 420 * @read_list : read completion list
392 * @hbm_state : state of host bus message protocol 421 * @write_list : write pending list
422 * @write_waiting_list : write completion list
423 * @ctrl_wr_list : pending control write list
424 * @ctrl_rd_list : pending control read list
393 * 425 *
394 * @hbm_f_pg_supported : hbm feature pgi protocol 426 * @file_list : list of opened handles
427 * @open_handle_count: number of opened handles
428 *
429 * @device_lock : big device lock
430 * @timer_work : MEI timer delayed work (timeouts)
431 *
432 * @recvd_hw_ready : hw ready message received flag
433 *
434 * @wait_hw_ready : wait queue for receive HW ready message form FW
435 * @wait_pg : wait queue for receive PG message from FW
436 * @wait_hbm_start : wait queue for receive HBM start message from FW
437 * @wait_stop_wd : wait queue for receive WD stop message from FW
438 *
439 * @reset_count : number of consecutive resets
440 * @dev_state : device state
441 * @hbm_state : state of host bus message protocol
442 * @init_clients_timer : HBM init handshake timeout
395 * 443 *
396 * @pg_event : power gating event 444 * @pg_event : power gating event
397 * @mem_addr : mem mapped base register address 445 * @pg_domain : runtime PM domain
398 446 *
447 * @rd_msg_buf : control messages buffer
448 * @rd_msg_hdr : read message header storage
449 *
399 * @hbuf_depth : depth of hardware host/write buffer is slots 450 * @hbuf_depth : depth of hardware host/write buffer is slots
400 * @hbuf_is_ready : query if the host host/write buffer is ready 451 * @hbuf_is_ready : query if the host host/write buffer is ready
401 * @wr_msg : the buffer for hbm control messages 452 * @wr_msg : the buffer for hbm control messages
453 *
454 * @version : HBM protocol version in use
455 * @hbm_f_pg_supported : hbm feature pgi protocol
456 *
457 * @me_clients : list of FW clients
458 * @me_clients_map : FW clients bit map
459 * @host_clients_map : host clients id pool
460 * @me_client_index : last FW client index in enumeration
461 *
462 * @wd_cl : watchdog client
463 * @wd_state : watchdog client state
464 * @wd_pending : watchdog command is pending
465 * @wd_timeout : watchdog expiration timeout
466 * @wd_data : watchdog message buffer
467 *
468 * @amthif_cmd_list : amthif list for cmd waiting
469 * @amthif_rd_complete_list : amthif list for reading completed cmd data
470 * @iamthif_file_object : file for current amthif operation
471 * @iamthif_cl : amthif host client
472 * @iamthif_current_cb : amthif current operation callback
473 * @iamthif_open_count : number of opened amthif connections
474 * @iamthif_mtu : amthif client max message length
475 * @iamthif_timer : time stamp of current amthif command completion
476 * @iamthif_stall_timer : timer to detect amthif hang
477 * @iamthif_msg_buf : amthif current message buffer
478 * @iamthif_msg_buf_size : size of current amthif message request buffer
479 * @iamthif_msg_buf_index : current index in amthif message request buffer
480 * @iamthif_state : amthif processor state
481 * @iamthif_flow_control_pending: amthif waits for flow control
482 * @iamthif_ioctl : wait for completion if amthif control message
483 * @iamthif_canceled : current amthif command is canceled
484 *
485 * @init_work : work item for the device init
486 * @reset_work : work item for the device reset
487 *
488 * @device_list : mei client bus list
489 *
490 * @dbgfs_dir : debugfs mei root directory
491 *
492 * @ops: : hw specific operations
493 * @hw : hw specific data
402 */ 494 */
403struct mei_device { 495struct mei_device {
404 struct device *dev; 496 struct device *dev;
405 struct cdev cdev; 497 struct cdev cdev;
406 int minor; 498 int minor;
407 499
408 /* 500 struct mei_cl_cb read_list;
409 * lists of queues 501 struct mei_cl_cb write_list;
410 */ 502 struct mei_cl_cb write_waiting_list;
411 /* array of pointers to aio lists */ 503 struct mei_cl_cb ctrl_wr_list;
412 struct mei_cl_cb read_list; /* driver read queue */ 504 struct mei_cl_cb ctrl_rd_list;
413 struct mei_cl_cb write_list; /* driver write queue */
414 struct mei_cl_cb write_waiting_list; /* write waiting queue */
415 struct mei_cl_cb ctrl_wr_list; /* managed write IOCTL list */
416 struct mei_cl_cb ctrl_rd_list; /* managed read IOCTL list */
417 505
418 /*
419 * list of files
420 */
421 struct list_head file_list; 506 struct list_head file_list;
422 long open_handle_count; 507 long open_handle_count;
423 508
424 /* 509 struct mutex device_lock;
425 * lock for the device 510 struct delayed_work timer_work;
426 */
427 struct mutex device_lock; /* device lock */
428 struct delayed_work timer_work; /* MEI timer delayed work (timeouts) */
429 511
430 bool recvd_hw_ready; 512 bool recvd_hw_ready;
431 /* 513 /*
@@ -452,7 +534,7 @@ struct mei_device {
452 struct dev_pm_domain pg_domain; 534 struct dev_pm_domain pg_domain;
453#endif /* CONFIG_PM_RUNTIME */ 535#endif /* CONFIG_PM_RUNTIME */
454 536
455 unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; /* control messages */ 537 unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE];
456 u32 rd_msg_hdr; 538 u32 rd_msg_hdr;
457 539
458 /* write buffer */ 540 /* write buffer */
@@ -522,6 +604,7 @@ static inline unsigned long mei_secs_to_jiffies(unsigned long sec)
522/** 604/**
523 * mei_data2slots - get slots - number of (dwords) from a message length 605 * mei_data2slots - get slots - number of (dwords) from a message length
524 * + size of the mei header 606 * + size of the mei header
607 *
525 * @length: size of the messages in bytes 608 * @length: size of the messages in bytes
526 * 609 *
527 * Return: number of slots 610 * Return: number of slots
@@ -532,8 +615,10 @@ static inline u32 mei_data2slots(size_t length)
532} 615}
533 616
534/** 617/**
535 * mei_slots2data- get data in slots - bytes from slots 618 * mei_slots2data - get data in slots - bytes from slots
619 *
536 * @slots: number of available slots 620 * @slots: number of available slots
621 *
537 * Return: number of bytes in slots 622 * Return: number of bytes in slots
538 */ 623 */
539static inline u32 mei_slots2data(int slots) 624static inline u32 mei_slots2data(int slots)
diff --git a/drivers/misc/mei/nfc.c b/drivers/misc/mei/nfc.c
index 288665eb4862..622654323177 100644
--- a/drivers/misc/mei/nfc.c
+++ b/drivers/misc/mei/nfc.c
@@ -94,9 +94,14 @@ struct mei_nfc_hci_hdr {
94 * @cl: NFC host client 94 * @cl: NFC host client
95 * @cl_info: NFC info host client 95 * @cl_info: NFC info host client
96 * @init_work: perform connection to the info client 96 * @init_work: perform connection to the info client
97 * @send_wq: send completion wait queue
97 * @fw_ivn: NFC Interface Version Number 98 * @fw_ivn: NFC Interface Version Number
98 * @vendor_id: NFC manufacturer ID 99 * @vendor_id: NFC manufacturer ID
99 * @radio_type: NFC radio type 100 * @radio_type: NFC radio type
101 * @bus_name: bus name
102 *
103 * @req_id: message counter
104 * @recv_req_id: reception message counter
100 */ 105 */
101struct mei_nfc_dev { 106struct mei_nfc_dev {
102 struct mei_cl *cl; 107 struct mei_cl *cl;
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 532d39300498..badd4d8d2135 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -98,7 +98,7 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev) {}
98#endif /* CONFIG_PM_RUNTIME */ 98#endif /* CONFIG_PM_RUNTIME */
99 99
100/** 100/**
101 * mei_quirk_probe - probe for devices that doesn't valid ME interface 101 * mei_me_quirk_probe - probe for devices that doesn't valid ME interface
102 * 102 *
103 * @pdev: PCI device structure 103 * @pdev: PCI device structure
104 * @cfg: per generation config 104 * @cfg: per generation config
@@ -117,7 +117,7 @@ static bool mei_me_quirk_probe(struct pci_dev *pdev,
117} 117}
118 118
119/** 119/**
120 * mei_probe - Device Initialization Routine 120 * mei_me_probe - Device Initialization Routine
121 * 121 *
122 * @pdev: PCI device structure 122 * @pdev: PCI device structure
123 * @ent: entry in kcs_pci_tbl 123 * @ent: entry in kcs_pci_tbl
@@ -249,7 +249,7 @@ end:
249} 249}
250 250
251/** 251/**
252 * mei_remove - Device Removal Routine 252 * mei_me_remove - Device Removal Routine
253 * 253 *
254 * @pdev: PCI device structure 254 * @pdev: PCI device structure
255 * 255 *