Commit ce23139c authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman

mei: fix kernel-doc warnings

Add missed parameters descriptions and return values descriptions
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8605ea2
...@@ -64,6 +64,7 @@ void mei_amthif_reset_params(struct mei_device *dev) ...@@ -64,6 +64,7 @@ void mei_amthif_reset_params(struct mei_device *dev)
* *
* @dev: the device structure * @dev: the device structure
* *
* Return: 0 on success, <0 on failure.
*/ */
int mei_amthif_host_init(struct mei_device *dev) int mei_amthif_host_init(struct mei_device *dev)
{ {
...@@ -352,7 +353,7 @@ int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *cb) ...@@ -352,7 +353,7 @@ int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *cb)
return mei_amthif_send_cmd(dev, cb); return mei_amthif_send_cmd(dev, cb);
} }
/** /**
* mei_amthif_run_next_cmd * mei_amthif_run_next_cmd - send next amt command from queue
* *
* @dev: the device structure * @dev: the device structure
*/ */
...@@ -496,7 +497,7 @@ int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb, ...@@ -496,7 +497,7 @@ int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
} }
/** /**
* mei_amthif_irq_read_message - read routine after ISR to * mei_amthif_irq_read_msg - read routine after ISR to
* handle the read amthif message * handle the read amthif message
* *
* @dev: the device structure * @dev: the device structure
......
...@@ -271,6 +271,8 @@ int mei_io_cb_alloc_resp_buf(struct mei_cl_cb *cb, size_t length) ...@@ -271,6 +271,8 @@ int mei_io_cb_alloc_resp_buf(struct mei_cl_cb *cb, size_t length)
* mei_cl_flush_queues - flushes queue lists belonging to cl. * mei_cl_flush_queues - flushes queue lists belonging to cl.
* *
* @cl: host client * @cl: host client
*
* Return: 0 on success, -EINVAL if cl or cl->dev is NULL.
*/ */
int mei_cl_flush_queues(struct mei_cl *cl) int mei_cl_flush_queues(struct mei_cl *cl)
{ {
...@@ -402,6 +404,8 @@ int mei_cl_link(struct mei_cl *cl, int id) ...@@ -402,6 +404,8 @@ int mei_cl_link(struct mei_cl *cl, int id)
* mei_cl_unlink - remove me_cl from the list * mei_cl_unlink - remove me_cl from the list
* *
* @cl: host client * @cl: host client
*
* Return: always 0
*/ */
int mei_cl_unlink(struct mei_cl *cl) int mei_cl_unlink(struct mei_cl *cl)
{ {
...@@ -756,6 +760,7 @@ int mei_cl_flow_ctrl_reduce(struct mei_cl *cl) ...@@ -756,6 +760,7 @@ int mei_cl_flow_ctrl_reduce(struct mei_cl *cl)
* mei_cl_read_start - the start read client message function. * mei_cl_read_start - the start read client message function.
* *
* @cl: host client * @cl: host client
* @length: number of bytes to read
* *
* Return: 0 on success, <0 on failure. * Return: 0 on success, <0 on failure.
*/ */
...@@ -916,6 +921,7 @@ int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb, ...@@ -916,6 +921,7 @@ int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
* *
* @cl: host client * @cl: host client
* @cb: write callback with filled data * @cb: write callback with filled data
* @blocking: block until completed
* *
* Return: number of bytes sent on success, <0 on failure. * Return: number of bytes sent on success, <0 on failure.
*/ */
......
...@@ -177,6 +177,8 @@ void mei_dbgfs_deregister(struct mei_device *dev) ...@@ -177,6 +177,8 @@ void mei_dbgfs_deregister(struct mei_device *dev)
* *
* @dev: the mei device structure * @dev: the mei device structure
* @name: the mei device name * @name: the mei device name
*
* Return: 0 on success, <0 on failure.
*/ */
int mei_dbgfs_register(struct mei_device *dev, const char *name) int mei_dbgfs_register(struct mei_device *dev, const char *name)
{ {
......
...@@ -176,6 +176,8 @@ void mei_hbm_cl_hdr(struct mei_cl *cl, u8 hbm_cmd, void *buf, size_t len) ...@@ -176,6 +176,8 @@ void mei_hbm_cl_hdr(struct mei_cl *cl, u8 hbm_cmd, void *buf, size_t len)
* @cl: client * @cl: client
* @hbm_cmd: host bus message command * @hbm_cmd: host bus message command
* @len: buffer length * @len: buffer length
*
* Return: 0 on success, <0 on failure.
*/ */
static inline static inline
int mei_hbm_cl_write(struct mei_device *dev, int mei_hbm_cl_write(struct mei_device *dev,
......
...@@ -94,6 +94,7 @@ static inline u32 mei_hcsr_read(const struct mei_me_hw *hw) ...@@ -94,6 +94,7 @@ static inline u32 mei_hcsr_read(const struct mei_me_hw *hw)
* and ignores the H_IS bit for it is write-one-to-zero. * and ignores the H_IS bit for it is write-one-to-zero.
* *
* @hw: the me hardware structure * @hw: the me hardware structure
* @hcsr: new register value
*/ */
static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr) static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr)
{ {
...@@ -106,6 +107,8 @@ static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr) ...@@ -106,6 +107,8 @@ static inline void mei_hcsr_set(struct mei_me_hw *hw, u32 hcsr)
* *
* @dev: mei device * @dev: mei device
* @fw_status: fw status register values * @fw_status: fw status register values
*
* Return: 0 on success, error otherwise
*/ */
static int mei_me_fw_status(struct mei_device *dev, static int mei_me_fw_status(struct mei_device *dev,
struct mei_fw_status *fw_status) struct mei_fw_status *fw_status)
...@@ -149,8 +152,9 @@ static void mei_me_hw_config(struct mei_device *dev) ...@@ -149,8 +152,9 @@ static void mei_me_hw_config(struct mei_device *dev)
* mei_me_pg_state - translate internal pg state * mei_me_pg_state - translate internal pg state
* to the mei power gating state * to the mei power gating state
* *
* @hw - me hardware * @dev: mei device
* returns: MEI_PG_OFF if aliveness is on and MEI_PG_ON otherwise *
* Return: MEI_PG_OFF if aliveness is on and MEI_PG_ON otherwise
*/ */
static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev) static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev)
{ {
...@@ -160,7 +164,7 @@ static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev) ...@@ -160,7 +164,7 @@ static inline enum mei_pg_state mei_me_pg_state(struct mei_device *dev)
} }
/** /**
* mei_clear_interrupts - clear and stop interrupts * mei_me_intr_clear - clear and stop interrupts
* *
* @dev: the device structure * @dev: the device structure
*/ */
...@@ -187,7 +191,7 @@ static void mei_me_intr_enable(struct mei_device *dev) ...@@ -187,7 +191,7 @@ static void mei_me_intr_enable(struct mei_device *dev)
} }
/** /**
* mei_disable_interrupts - disables mei device interrupts * mei_me_intr_disable - disables mei device interrupts
* *
* @dev: the device structure * @dev: the device structure
*/ */
...@@ -222,6 +226,8 @@ static void mei_me_hw_reset_release(struct mei_device *dev) ...@@ -222,6 +226,8 @@ static void mei_me_hw_reset_release(struct mei_device *dev)
* *
* @dev: the device structure * @dev: the device structure
* @intr_enable: if interrupt should be enabled after reset. * @intr_enable: if interrupt should be enabled after reset.
*
* Return: always 0
*/ */
static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable) static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
{ {
...@@ -259,10 +265,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable) ...@@ -259,10 +265,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
/** /**
* mei_me_host_set_ready - enable device * mei_me_host_set_ready - enable device
* *
* @dev - mei device * @dev: mei device
* returns bool
*/ */
static void mei_me_host_set_ready(struct mei_device *dev) static void mei_me_host_set_ready(struct mei_device *dev)
{ {
struct mei_me_hw *hw = to_me_hw(dev); 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,6 +275,7 @@ static void mei_me_host_set_ready(struct mei_device *dev)
hw->host_hw_state |= H_IE | H_IG | H_RDY; hw->host_hw_state |= H_IE | H_IG | H_RDY;
mei_hcsr_set(hw, hw->host_hw_state); mei_hcsr_set(hw, hw->host_hw_state);
} }
/** /**
* mei_me_host_is_ready - check whether the host has turned ready * mei_me_host_is_ready - check whether the host has turned ready
* *
...@@ -299,6 +304,13 @@ static bool mei_me_hw_is_ready(struct mei_device *dev) ...@@ -299,6 +304,13 @@ static bool mei_me_hw_is_ready(struct mei_device *dev)
return (hw->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA; return (hw->me_hw_state & ME_RDY_HRA) == ME_RDY_HRA;
} }
/**
* mei_me_hw_ready_wait - wait until the me(hw) has turned ready
* or timeout is reached
*
* @dev: mei device
* Return: 0 on success, error otherwise
*/
static int mei_me_hw_ready_wait(struct mei_device *dev) static int mei_me_hw_ready_wait(struct mei_device *dev)
{ {
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
...@@ -315,6 +327,12 @@ static int mei_me_hw_ready_wait(struct mei_device *dev) ...@@ -315,6 +327,12 @@ static int mei_me_hw_ready_wait(struct mei_device *dev)
return 0; return 0;
} }
/**
* mei_me_hw_start - hw start routine
*
* @dev: mei device
* Return: 0 on success, error otherwise
*/
static int mei_me_hw_start(struct mei_device *dev) static int mei_me_hw_start(struct mei_device *dev)
{ {
int ret = mei_me_hw_ready_wait(dev); int ret = mei_me_hw_ready_wait(dev);
...@@ -381,6 +399,13 @@ static int mei_me_hbuf_empty_slots(struct mei_device *dev) ...@@ -381,6 +399,13 @@ static int mei_me_hbuf_empty_slots(struct mei_device *dev)
return empty_slots; return empty_slots;
} }
/**
* mei_me_hbuf_max_len - returns size of hw buffer.
*
* @dev: the device structure
*
* Return: size of hw buffer in bytes
*/
static size_t mei_me_hbuf_max_len(const struct mei_device *dev) static size_t mei_me_hbuf_max_len(const struct mei_device *dev)
{ {
return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr); 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,6 +497,8 @@ static int mei_me_count_full_read_slots(struct mei_device *dev)
* @dev: the device structure * @dev: the device structure
* @buffer: message buffer will be written * @buffer: message buffer will be written
* @buffer_length: message size will be read * @buffer_length: message size will be read
*
* Return: always 0
*/ */
static int mei_me_read_slots(struct mei_device *dev, unsigned char *buffer, static int mei_me_read_slots(struct mei_device *dev, unsigned char *buffer,
unsigned long buffer_length) unsigned long buffer_length)
......
...@@ -47,7 +47,13 @@ struct mei_cfg { ...@@ -47,7 +47,13 @@ struct mei_cfg {
#define MEI_ME_RPM_TIMEOUT 500 /* ms */ #define MEI_ME_RPM_TIMEOUT 500 /* ms */
/** /**
* struct mei_me_hw - me hw specific data
*
* @cfg: per device generation config and ops * @cfg: per device generation config and ops
* @mem_addr: io memory address
* @host_hw_state: cached host state
* @me_hw_state: cached me (fw) state
* @pg_state: power gating state
*/ */
struct mei_me_hw { struct mei_me_hw {
const struct mei_cfg *cfg; const struct mei_cfg *cfg;
......
...@@ -28,11 +28,12 @@ ...@@ -28,11 +28,12 @@
#include "hbm.h" #include "hbm.h"
/** /**
* mei_txe_reg_read - Reads 32bit data from the device * mei_txe_reg_read - Reads 32bit data from the txe device
* *
* @base_addr: registers base address * @base_addr: registers base address
* @offset: register offset * @offset: register offset
* *
* Return: register value
*/ */
static inline u32 mei_txe_reg_read(void __iomem *base_addr, static inline u32 mei_txe_reg_read(void __iomem *base_addr,
unsigned long offset) unsigned long offset)
...@@ -41,7 +42,7 @@ static inline u32 mei_txe_reg_read(void __iomem *base_addr, ...@@ -41,7 +42,7 @@ static inline u32 mei_txe_reg_read(void __iomem *base_addr,
} }
/** /**
* mei_txe_reg_write - Writes 32bit data to the device * mei_txe_reg_write - Writes 32bit data to the txe device
* *
* @base_addr: registers base address * @base_addr: registers base address
* @offset: register offset * @offset: register offset
...@@ -56,10 +57,12 @@ static inline void mei_txe_reg_write(void __iomem *base_addr, ...@@ -56,10 +57,12 @@ static inline void mei_txe_reg_write(void __iomem *base_addr,
/** /**
* mei_txe_sec_reg_read_silent - Reads 32bit data from the SeC BAR * mei_txe_sec_reg_read_silent - Reads 32bit data from the SeC BAR
* *
* @dev: the device structure * @hw: the txe hardware structure
* @offset: register offset * @offset: register offset
* *
* Doesn't check for aliveness while Reads 32bit data from the SeC BAR * Doesn't check for aliveness while Reads 32bit data from the SeC BAR
*
* Return: register value
*/ */
static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw, static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw,
unsigned long offset) unsigned long offset)
...@@ -70,10 +73,12 @@ static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw, ...@@ -70,10 +73,12 @@ static inline u32 mei_txe_sec_reg_read_silent(struct mei_txe_hw *hw,
/** /**
* mei_txe_sec_reg_read - Reads 32bit data from the SeC BAR * mei_txe_sec_reg_read - Reads 32bit data from the SeC BAR
* *
* @dev: the device structure * @hw: the txe hardware structure
* @offset: register offset * @offset: register offset
* *
* Reads 32bit data from the SeC BAR and shout loud if aliveness is not set * Reads 32bit data from the SeC BAR and shout loud if aliveness is not set
*
* Return: register value
*/ */
static inline u32 mei_txe_sec_reg_read(struct mei_txe_hw *hw, static inline u32 mei_txe_sec_reg_read(struct mei_txe_hw *hw,
unsigned long offset) unsigned long offset)
...@@ -115,9 +120,10 @@ static inline void mei_txe_sec_reg_write(struct mei_txe_hw *hw, ...@@ -115,9 +120,10 @@ static inline void mei_txe_sec_reg_write(struct mei_txe_hw *hw,
/** /**
* mei_txe_br_reg_read - Reads 32bit data from the Bridge BAR * mei_txe_br_reg_read - Reads 32bit data from the Bridge BAR
* *
* @hw: the device structure * @hw: the txe hardware structure
* @offset: offset from which to read the data * @offset: offset from which to read the data
* *
* Return: the byte read.
*/ */
static inline u32 mei_txe_br_reg_read(struct mei_txe_hw *hw, static inline u32 mei_txe_br_reg_read(struct mei_txe_hw *hw,
unsigned long offset) unsigned long offset)
...@@ -147,7 +153,10 @@ static inline void mei_txe_br_reg_write(struct mei_txe_hw *hw, ...@@ -147,7 +153,10 @@ static inline void mei_txe_br_reg_write(struct mei_txe_hw *hw,
* Request for aliveness change and returns true if the change is * Request for aliveness change and returns true if the change is
* really needed and false if aliveness is already * really needed and false if aliveness is already
* in the requested state * in the requested state
* Requires device lock to be held *
* Locking: called under "dev->device_lock" lock
*
* Return: true if request was send
*/ */
static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req) static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req)
{ {
...@@ -172,6 +181,8 @@ static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req) ...@@ -172,6 +181,8 @@ static bool mei_txe_aliveness_set(struct mei_device *dev, u32 req)
* *
* Extract HICR_HOST_ALIVENESS_RESP_ACK bit from * Extract HICR_HOST_ALIVENESS_RESP_ACK bit from
* from HICR_HOST_ALIVENESS_REQ register value * from HICR_HOST_ALIVENESS_REQ register value
*
* Return: SICR_HOST_ALIVENESS_REQ_REQUESTED bit value
*/ */
static u32 mei_txe_aliveness_req_get(struct mei_device *dev) static u32 mei_txe_aliveness_req_get(struct mei_device *dev)
{ {
...@@ -184,10 +195,11 @@ static u32 mei_txe_aliveness_req_get(struct mei_device *dev) ...@@ -184,10 +195,11 @@ static u32 mei_txe_aliveness_req_get(struct mei_device *dev)
/** /**
* mei_txe_aliveness_get - get aliveness response register value * mei_txe_aliveness_get - get aliveness response register value
*
* @dev: the device structure * @dev: the device structure
* *
* Extract HICR_HOST_ALIVENESS_RESP_ACK bit * Return: HICR_HOST_ALIVENESS_RESP_ACK bit from HICR_HOST_ALIVENESS_RESP
* from HICR_HOST_ALIVENESS_RESP register value * register
*/ */
static u32 mei_txe_aliveness_get(struct mei_device *dev) static u32 mei_txe_aliveness_get(struct mei_device *dev)
{ {
...@@ -278,6 +290,7 @@ static int mei_txe_aliveness_wait(struct mei_device *dev, u32 expected) ...@@ -278,6 +290,7 @@ static int mei_txe_aliveness_wait(struct mei_device *dev, u32 expected)
* mei_txe_aliveness_set_sync - sets an wait for aliveness to complete * mei_txe_aliveness_set_sync - sets an wait for aliveness to complete
* *
* @dev: the device structure * @dev: the device structure
* @req: requested aliveness value
* *
* Return: 0 on success and < 0 otherwise * Return: 0 on success and < 0 otherwise
*/ */
...@@ -359,6 +372,8 @@ static void mei_txe_output_ready_set(struct mei_txe_hw *hw) ...@@ -359,6 +372,8 @@ static void mei_txe_output_ready_set(struct mei_txe_hw *hw)
* mei_txe_is_input_ready - check if TXE is ready for receiving data * mei_txe_is_input_ready - check if TXE is ready for receiving data
* *
* @dev: the device structure * @dev: the device structure
*
* Return: true if INPUT STATUS READY bit is set
*/ */
static bool mei_txe_is_input_ready(struct mei_device *dev) static bool mei_txe_is_input_ready(struct mei_device *dev)
{ {
...@@ -417,6 +432,8 @@ static void mei_txe_intr_enable(struct mei_device *dev) ...@@ -417,6 +432,8 @@ static void mei_txe_intr_enable(struct mei_device *dev)
* *
* Checks if there are pending interrupts * Checks if there are pending interrupts
* only Aliveness, Readiness, Input ready, and Output doorbell are relevant * only Aliveness, Readiness, Input ready, and Output doorbell are relevant
*
* Return: true if there are pending interrupts
*/ */
static bool mei_txe_pending_interrupts(struct mei_device *dev) static bool mei_txe_pending_interrupts(struct mei_device *dev)
{ {
...@@ -476,7 +493,7 @@ static u32 mei_txe_out_data_read(const struct mei_device *dev, ...@@ -476,7 +493,7 @@ static u32 mei_txe_out_data_read(const struct mei_device *dev,
/* Readiness */ /* Readiness */
/** /**
* mei_txe_readiness_set_host_rdy * mei_txe_readiness_set_host_rdy - set host readiness bit
* *
* @dev: the device structure * @dev: the device structure
*/ */
...@@ -490,7 +507,7 @@ static void mei_txe_readiness_set_host_rdy(struct mei_device *dev) ...@@ -490,7 +507,7 @@ static void mei_txe_readiness_set_host_rdy(struct mei_device *dev)
} }
/** /**
* mei_txe_readiness_clear * mei_txe_readiness_clear - clear host readiness bit
* *
* @dev: the device structure * @dev: the device structure
*/ */
...@@ -521,7 +538,9 @@ static u32 mei_txe_readiness_get(struct mei_device *dev) ...@@ -521,7 +538,9 @@ static u32 mei_txe_readiness_get(struct mei_device *dev)
* mei_txe_readiness_is_sec_rdy - check readiness * mei_txe_readiness_is_sec_rdy - check readiness
* for HICR_SEC_IPC_READINESS_SEC_RDY * for HICR_SEC_IPC_READINESS_SEC_RDY
* *
* @readiness - cached readiness state * @readiness: cached readiness state
*
* Return: true if readiness bit is set
*/ */
static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness) static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness)
{ {
...@@ -532,6 +551,8 @@ static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness) ...@@ -532,6 +551,8 @@ static inline bool mei_txe_readiness_is_sec_rdy(u32 readiness)
* mei_txe_hw_is_ready - check if the hw is ready * mei_txe_hw_is_ready - check if the hw is ready
* *
* @dev: the device structure * @dev: the device structure
*
* Return: true if sec is ready
*/ */
static bool mei_txe_hw_is_ready(struct mei_device *dev) static bool mei_txe_hw_is_ready(struct mei_device *dev)
{ {
...@@ -544,6 +565,8 @@ static bool mei_txe_hw_is_ready(struct mei_device *dev) ...@@ -544,6 +565,8 @@ static bool mei_txe_hw_is_ready(struct mei_device *dev)
* mei_txe_host_is_ready - check if the host is ready * mei_txe_host_is_ready - check if the host is ready
* *
* @dev: the device structure * @dev: the device structure
*
* Return: true if host is ready
*/ */
static inline bool mei_txe_host_is_ready(struct mei_device *dev) static inline bool mei_txe_host_is_ready(struct mei_device *dev)
{ {
...@@ -589,6 +612,8 @@ const struct mei_fw_status mei_txe_fw_sts = { ...@@ -589,6 +612,8 @@ const struct mei_fw_status mei_txe_fw_sts = {
* *
* @dev: mei device * @dev: mei device
* @fw_status: fw status register values * @fw_status: fw status register values
*
* Return: 0 on success, error otherwise
*/ */
static int mei_txe_fw_status(struct mei_device *dev, static int mei_txe_fw_status(struct mei_device *dev,
struct mei_fw_status *fw_status) struct mei_fw_status *fw_status)
...@@ -643,7 +668,7 @@ static void mei_txe_hw_config(struct mei_device *dev) ...@@ -643,7 +668,7 @@ static void mei_txe_hw_config(struct mei_device *dev)
* @header: header of message * @header: header of message
* @buf: message buffer will be written * @buf: message buffer will be written
* *
* Return: if success, 0 - otherwise. * Return: 0 if success, <0 - otherwise.
*/ */
static int mei_txe_write(struct mei_device *dev, static int mei_txe_write(struct mei_device *dev,
...@@ -710,7 +735,7 @@ static int mei_txe_write(struct mei_device *dev, ...@@ -710,7 +735,7 @@ static int mei_txe_write(struct mei_device *dev,
* *
* @dev: the device structure * @dev: the device structure
* *
* Return: PAYLOAD_SIZE - 4 * Return: the PAYLOAD_SIZE - 4
*/ */
static size_t mei_txe_hbuf_max_len(const struct mei_device *dev) static size_t mei_txe_hbuf_max_len(const struct mei_device *dev)
{ {
...@@ -859,7 +884,7 @@ static int mei_txe_hw_reset(struct mei_device *dev, bool intr_enable) ...@@ -859,7 +884,7 @@ static int mei_txe_hw_reset(struct mei_device *dev, bool intr_enable)
* *
* @dev: the device structure * @dev: the device structure
* *
* Return: 0 on success and < 0 in case of error * Return: 0 on success an error code otherwise
*/ */
static int mei_txe_hw_start(struct mei_device *dev) static int mei_txe_hw_start(struct mei_device *dev)
{ {
...@@ -915,6 +940,8 @@ static int mei_txe_hw_start(struct mei_device *dev) ...@@ -915,6 +940,8 @@ static int mei_txe_hw_start(struct mei_device *dev)
* *
* @dev: the device structure * @dev: the device structure
* @do_ack: acknowledge interrupts * @do_ack: acknowledge interrupts
*
* Return: true if found interrupts to process.
*/ */
static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack) static bool mei_txe_check_and_ack_intrs(struct mei_device *dev, bool do_ack)
{ {
...@@ -990,7 +1017,6 @@ irqreturn_t mei_txe_irq_quick_handler(int irq, void *dev_id) ...@@ -990,7 +1017,6 @@ irqreturn_t mei_txe_irq_quick_handler(int irq, void *dev_id)
* @dev_id: pointer to the device structure * @dev_id: pointer to the device structure
* *
* Return: IRQ_HANDLED * Return: IRQ_HANDLED
*
*/ */
irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id) irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id)
{ {
...@@ -1135,10 +1161,9 @@ static const struct mei_hw_ops mei_txe_hw_ops = { ...@@ -1135,10 +1161,9 @@ static const struct mei_hw_ops mei_txe_hw_ops = {
/** /**
* mei_txe_dev_init - allocates and initializes txe hardware specific structure * mei_txe_dev_init - allocates and initializes txe hardware specific structure
* *
* @pdev - pci device * @pdev: pci device
*
* Return: struct mei_device * on success or NULL;
* *
* Return: struct mei_device * on success or NULL
*/ */
struct mei_device *mei_txe_dev_init(struct pci_dev *pdev) struct mei_device *mei_txe_dev_init(struct pci_dev *pdev)
{ {
...@@ -1165,6 +1190,8 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev) ...@@ -1165,6 +1190,8 @@ struct mei_device *mei_txe_dev_init(struct pci_dev *pdev)
* @dev: the device structure * @dev: the device structure
* @addr: physical address start of the range * @addr: physical address start of the range
* @range: physical range size * @range: physical range size
*
* Return: 0 on success an error code otherwise
*/ */
int mei_txe_setup_satt2(struct mei_device *dev, phys_addr_t addr, u32 range) int mei_txe_setup_satt2(struct mei_device *dev, phys_addr_t addr, u32 range)
{ {
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
* @mem_addr: SeC and BRIDGE bars * @mem_addr: SeC and BRIDGE bars
* @aliveness: aliveness (power gating) state of the hardware * @aliveness: aliveness (power gating) state of the hardware
* @readiness: readiness state of the hardware * @readiness: readiness state of the hardware
* @slots: number of empty slots
* @wait_aliveness_resp: aliveness wait queue * @wait_aliveness_resp: aliveness wait queue
* @intr_cause: translated interrupt cause * @intr_cause: translated interrupt cause
*/ */
......
...@@ -109,6 +109,8 @@ enum mei_stop_reason_types { ...@@ -109,6 +109,8 @@ enum mei_stop_reason_types {
* @MEI_HBMS_NOT_ALLOWED : operation not allowed * @MEI_HBMS_NOT_ALLOWED : operation not allowed
* @MEI_HBMS_ALREADY_STARTED : system is already started * @MEI_HBMS_ALREADY_STARTED : system is already started
* @MEI_HBMS_NOT_STARTED : system not started * @MEI_HBMS_NOT_STARTED : system not started
*
* @MEI_HBMS_MAX : sentinel
*/ */
enum mei_hbm_status { enum mei_hbm_status {
MEI_HBMS_SUCCESS = 0, MEI_HBMS_SUCCESS = 0,
......
...@@ -59,8 +59,6 @@ const char *mei_pg_state_str(enum mei_pg_state state) ...@@ -59,8 +59,6 @@ const char *mei_pg_state_str(enum mei_pg_state state)
* mei_cancel_work - Cancel mei background jobs * mei_cancel_work - Cancel mei background jobs
* *
* @dev: the device structure * @dev: the device structure
*
* Return: 0 on success or < 0 if the reset hasn't succeeded
*/ */
void mei_cancel_work(struct mei_device *dev) void mei_cancel_work(struct mei_device *dev)
{ {
...@@ -75,6 +73,8 @@ EXPORT_SYMBOL_GPL(mei_cancel_work); ...@@ -75,6 +73,8 @@ EXPORT_SYMBOL_GPL(mei_cancel_work);
* mei_reset - resets host and fw. * mei_reset - resets host and fw.
* *
* @dev: the device structure * @dev: the device structure
*
* Return: 0 on success or < 0 if the reset hasn't succeeded
*/ */
int mei_reset(struct mei_device *dev) int mei_reset(struct mei_device *dev)
{ {
......
...@@ -87,7 +87,7 @@ static bool mei_cl_is_reading(struct mei_cl *cl, struct mei_msg_hdr *mei_hdr) ...@@ -87,7 +87,7 @@ static bool mei_cl_is_reading(struct mei_cl *cl, struct mei_msg_hdr *mei_hdr)
} }
/** /**
* mei_irq_read_client_message - process client message * mei_cl_irq_read_msg - process client message
* *
* @dev: the device structure * @dev: the device structure
* @mei_hdr: header of mei client message * @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,7 +234,7 @@ static int mei_cl_irq_disconnect(struct mei_cl *cl, struct mei_cl_cb *cb,
/** /**
* mei_cl_irq_close - processes client read related operation from the * mei_cl_irq_read - processes client read related operation from the
* interrupt thread context - request for flow control credits * interrupt thread context - request for flow control credits
* *
* @cl: client * @cl: client
......
...@@ -129,11 +129,11 @@ enum mei_wd_states { ...@@ -129,11 +129,11 @@ enum mei_wd_states {
/** /**
* enum mei_cb_file_ops - file operation associated with the callback * enum mei_cb_file_ops - file operation associated with the callback
* @MEI_FOP_READ - read * @MEI_FOP_READ: read
* @MEI_FOP_WRITE - write * @MEI_FOP_WRITE: write
* @MEI_FOP_CONNECT - connect * @MEI_FOP_CONNECT: connect
* @MEI_FOP_DISCONNECT - disconnect * @MEI_FOP_DISCONNECT: disconnect
* @MEI_FOP_DISCONNECT_RSP - disconnect response * @MEI_FOP_DISCONNECT_RSP: disconnect response
*/ */
enum mei_cb_file_ops { enum mei_cb_file_ops {
MEI_FOP_READ = 0, MEI_FOP_READ = 0,
...@@ -189,6 +189,12 @@ struct mei_cl; ...@@ -189,6 +189,12 @@ struct mei_cl;
* @list: link in callback queue * @list: link in callback queue
* @cl: file client who is running this operation * @cl: file client who is running this operation
* @fop_type: file operation type * @fop_type: file operation type
* @request_buffer: buffer to store request data
* @response_buffer: buffer to store response data
* @buf_idx: last read index
* @read_time: last read operation time stamp (iamthif)
* @file_object: pointer to file structure
* @internal: communication between driver and FW flag
*/ */
struct mei_cl_cb { struct mei_cl_cb {
struct list_head list; struct list_head list;
...@@ -202,7 +208,29 @@ struct mei_cl_cb { ...@@ -202,7 +208,29 @@ struct mei_cl_cb {
u32 internal:1; u32 internal:1;
}; };
/* MEI client instance carried as file->private_data*/ /**
* struct mei_cl - me client host representation
* carried in file->private_data
*
* @link: link in the clients list
* @dev: mei parent device
* @state: file operation state
* @tx_wait: wait queue for tx completion
* @rx_wait: wait queue for rx completion
* @wait: wait queue for management operation
* @status: connection status
* @cl_uuid: client uuid name
* @host_client_id: host id
* @me_client_id: me/fw id
* @mei_flow_ctrl_creds: transmit flow credentials
* @timer_count: watchdog timer for operation completion
* @reading_state: state of the rx
* @writing_state: state of the tx
* @read_cb: current pending reading callback
*
* @device: device on the mei client bus
* @device_link: link to bus clients
*/
struct mei_cl { struct mei_cl {
struct list_head link; struct list_head link;
struct mei_device *dev; struct mei_device *dev;
...@@ -211,7 +239,6 @@ struct mei_cl { ...@@ -211,7 +239,6 @@ struct mei_cl {
wait_queue_head_t rx_wait; wait_queue_head_t rx_wait;
wait_queue_head_t wait; wait_queue_head_t wait;
int status; int status;
/* ID of client connected */
uuid_le cl_uuid; uuid_le cl_uuid;
u8 host_client_id; u8 host_client_id;
u8 me_client_id; u8 me_client_id;
...@@ -334,8 +361,10 @@ void mei_cl_bus_exit(void); ...@@ -334,8 +361,10 @@ void mei_cl_bus_exit(void);
* @dev: linux driver model device pointer * @dev: linux driver model device pointer
* @cl: mei client * @cl: mei client
* @ops: ME transport ops * @ops: ME transport ops
* @event_work: async work to execute event callback
* @event_cb: Drivers register this callback to get asynchronous ME * @event_cb: Drivers register this callback to get asynchronous ME
* events (e.g. Rx buffer pending) notifications. * events (e.g. Rx buffer pending) notifications.
* @event_context: event callback run context
* @events: Events bitmask sent to the driver. * @events: Events bitmask sent to the driver.
* @priv_data: client private data * @priv_data: client private data
*/ */
...@@ -355,7 +384,7 @@ struct mei_cl_device { ...@@ -355,7 +384,7 @@ struct mei_cl_device {
}; };
/** /**
* enum mei_pg_event - power gating transition events * enum mei_pg_event - power gating transition events
* *
* @MEI_PG_EVENT_IDLE: the driver is not in power gating transition * @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,49 +412,102 @@ const char *mei_pg_state_str(enum mei_pg_state state);
/** /**
* struct mei_device - MEI private device struct * struct mei_device - MEI private device struct
*
* @dev : device on a bus * @dev : device on a bus
* @cdev : character device * @cdev : character device
* @minor : minor number allocated for device * @minor : minor number allocated for device
* *
* @reset_count : limits the number of consecutive resets * @read_list : read completion list
* @hbm_state : state of host bus message protocol * @write_list : write pending list
* @write_waiting_list : write completion list
* @ctrl_wr_list : pending control write list
* @ctrl_rd_list : pending control read list
* *
* @hbm_f_pg_supported : hbm feature pgi protocol * @file_list : list of opened handles
* @open_handle_count: number of opened handles
*
* @device_lock : big device lock
* @timer_work : MEI timer delayed work (timeouts)
*
* @recvd_hw_ready : hw ready message received flag
*
* @wait_hw_ready : wait queue for receive HW ready message form FW
* @wait_pg : wait queue for receive PG message from FW
* @wait_hbm_start : wait queue for receive HBM start message from FW
* @wait_stop_wd : wait queue for receive WD stop message from FW
*
* @reset_count : number of consecutive resets
* @dev_state : device state
* @hbm_state : state of host bus message protocol
* @init_clients_timer : HBM init handshake timeout
* *
* @pg_event : power gating event * @pg_event : power gating event
* @mem_addr : mem mapped base register address * @pg_domain : runtime PM domain
*
* @rd_msg_buf : control messages buffer
* @rd_msg_hdr : read message header storage
*
* @hbuf_depth : depth of hardware host/write buffer is slots * @hbuf_depth : depth of hardware host/write buffer is slots
* @hbuf_is_ready : query if the host host/write buffer is ready * @hbuf_is_ready : query if the host host/write buffer is ready
* @wr_msg : the buffer for hbm control messages * @wr_msg : the buffer for hbm control messages
*
* @version : HBM protocol version in use
* @hbm_f_pg_supported : hbm feature pgi protocol
*
* @me_clients : list of FW clients
* @me_clients_map : FW clients bit map
* @host_clients_map : host clients id pool
* @me_client_index : last FW client index in enumeration
*
* @wd_cl : watchdog client
* @wd_state : watchdog client state
* @wd_pending : watchdog command is pending
* @wd_timeout : watchdog expiration timeout
* @wd_data : watchdog message buffer
*
* @amthif_cmd_list : amthif list for cmd waiting
* @amthif_rd_complete_list : amthif list for reading completed cmd data
* @iamthif_file_object : file for current amthif operation
* @iamthif_cl : amthif host client
* @iamthif_current_cb : amthif current operation callback
* @iamthif_open_count : number of opened amthif connections
* @iamthif_mtu : amthif client max message length
* @iamthif_timer : time stamp of current amthif command completion
* @iamthif_stall_timer : timer to detect amthif hang
* @iamthif_msg_buf : amthif current message buffer
* @iamthif_msg_buf_size : size of current amthif message request buffer
* @iamthif_msg_buf_index : current index in amthif message request buffer
* @iamthif_state : amthif processor state
* @iamthif_flow_control_pending: amthif waits for flow control
* @iamthif_ioctl : wait for completion if amthif control message
* @iamthif_canceled : current amthif command is canceled
*
* @init_work : work item for the device init
* @reset_work : work item for the device reset
*
* @device_list : mei client bus list
*
* @dbgfs_dir : debugfs mei root directory
*
* @ops: : hw specific operations
* @hw : hw specific data
*/ */
struct mei_device { struct mei_device {
struct device *dev; struct device *dev;
struct cdev cdev; struct cdev cdev;
int minor; int minor;
/* struct mei_cl_cb read_list;
* lists of queues struct mei_cl_cb write_list;
*/ struct mei_cl_cb write_waiting_list;
/* array of pointers to aio lists */ struct mei_cl_cb ctrl_wr_list;
struct mei_cl_cb read_list; /* driver read queue */ struct mei_cl_cb ctrl_rd_list;
struct mei_cl_cb write_list; /* driver write queue */
struct mei_cl_cb write_waiting_list; /* write waiting queue */
struct mei_cl_cb ctrl_wr_list; /* managed write IOCTL list */
struct mei_cl_cb ctrl_rd_list; /* managed read IOCTL list */
/*
* list of files
*/
struct list_head file_list; struct list_head file_list;
long open_handle_count; long open_handle_count;
/* struct mutex device_lock;
* lock for the device struct delayed_work timer_work;
*/
struct mutex device_lock; /* device lock */
struct delayed_work timer_work; /* MEI timer delayed work (timeouts) */
bool recvd_hw_ready; bool recvd_hw_ready;
/* /*
...@@ -452,7 +534,7 @@ struct mei_device { ...@@ -452,7 +534,7 @@ struct mei_device {
struct dev_pm_domain pg_domain; struct dev_pm_domain pg_domain;
#endif /* CONFIG_PM_RUNTIME */ #endif /* CONFIG_PM_RUNTIME */
unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE]; /* control messages */ unsigned char rd_msg_buf[MEI_RD_MSG_BUF_SIZE];
u32 rd_msg_hdr; u32 rd_msg_hdr;
/* write buffer */ /* write buffer */
...@@ -522,6 +604,7 @@ static inline unsigned long mei_secs_to_jiffies(unsigned long sec) ...@@ -522,6 +604,7 @@ static inline unsigned long mei_secs_to_jiffies(unsigned long sec)
/** /**
* mei_data2slots - get slots - number of (dwords) from a message length * mei_data2slots - get slots - number of (dwords) from a message length
* + size of the mei header * + size of the mei header
*
* @length: size of the messages in bytes * @length: size of the messages in bytes
* *
* Return: number of slots * Return: number of slots
...@@ -532,8 +615,10 @@ static inline u32 mei_data2slots(size_t length) ...@@ -532,8 +615,10 @@ static inline u32 mei_data2slots(size_t length)
} }
/** /**
* mei_slots2data- get data in slots - bytes from slots * mei_slots2data - get data in slots - bytes from slots
*
* @slots: number of available slots * @slots: number of available slots
*
* Return: number of bytes in slots * Return: number of bytes in slots
*/ */
static inline u32 mei_slots2data(int slots) static inline u32 mei_slots2data(int slots)
......
...@@ -94,9 +94,14 @@ struct mei_nfc_hci_hdr { ...@@ -94,9 +94,14 @@ struct mei_nfc_hci_hdr {
* @cl: NFC host client * @cl: NFC host client
* @cl_info: NFC info host client * @cl_info: NFC info host client
* @init_work: perform connection to the info client * @init_work: perform connection to the info client
* @send_wq: send completion wait queue
* @fw_ivn: NFC Interface Version Number * @fw_ivn: NFC Interface Version Number
* @vendor_id: NFC manufacturer ID * @vendor_id: NFC manufacturer ID
* @radio_type: NFC radio type * @radio_type: NFC radio type
* @bus_name: bus name
*
* @req_id: message counter
* @recv_req_id: reception message counter
*/ */
struct mei_nfc_dev { struct mei_nfc_dev {
struct mei_cl *cl; struct mei_cl *cl;
......
...@@ -98,7 +98,7 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev) {} ...@@ -98,7 +98,7 @@ static inline void mei_me_unset_pm_domain(struct mei_device *dev) {}
#endif /* CONFIG_PM_RUNTIME */ #endif /* CONFIG_PM_RUNTIME */
/** /**
* mei_quirk_probe - probe for devices that doesn't valid ME interface * mei_me_quirk_probe - probe for devices that doesn't valid ME interface
* *
* @pdev: PCI device structure * @pdev: PCI device structure
* @cfg: per generation config * @cfg: per generation config
...@@ -117,7 +117,7 @@ static bool mei_me_quirk_probe(struct pci_dev *pdev, ...@@ -117,7 +117,7 @@ static bool mei_me_quirk_probe(struct pci_dev *pdev,
} }
/** /**
* mei_probe - Device Initialization Routine * mei_me_probe - Device Initialization Routine
* *
* @pdev: PCI device structure * @pdev: PCI device structure
* @ent: entry in kcs_pci_tbl * @ent: entry in kcs_pci_tbl
...@@ -249,7 +249,7 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -249,7 +249,7 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} }
/** /**
* mei_remove - Device Removal Routine * mei_me_remove - Device Removal Routine
* *
* @pdev: PCI device structure * @pdev: PCI device structure
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment