lkml.org 
[lkml]   [2013]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] scsi: ufs: Set fDeviceInit flag to initiate device initialization
>
> /**
> + * ufshcd_query_request() - API for issuing query request to the device.
> + * @hba: ufs driver context
> + * @query: params for query request
> + * @descriptor: buffer for sending/receiving descriptor
> + * @retries: number of times to try executing the command
> + *
> + * All necessary fields for issuing a query and receiving its response
> + * are stored in the UFS hba struct. We can use this method since we know
> + * there is only one active query request or any internal command at all
> + * times.
> + */
> +static int ufshcd_send_query_request(struct ufs_hba *hba,
> + struct ufs_query_req *query,
> + u8 *descriptor,
> + struct ufs_query_res *response)
> +{
> + int ret;
> +
> + BUG_ON(!hba);
> + if (!query || !response) {
> + dev_err(hba->dev,
> + "%s: NULL pointer query = %p, response = %p\n",
> + __func__, query, response);
> + return -EINVAL;
> + }
> +
> + mutex_lock(&hba->i_cmd.dev_cmd_lock);
> + hba->i_cmd.query.request = query;
> + hba->i_cmd.query.response = response;
> + hba->i_cmd.query.descriptor = descriptor;
> +
> + ret = ufshcd_exec_internal_cmd(hba, DEV_CMD_TYPE_QUERY,
> + QUERY_REQ_TIMEOUT);

Can this be generic, as external query commands might also use it?

> +
> + hba->i_cmd.query.request = NULL;
> + hba->i_cmd.query.response = NULL;
> + hba->i_cmd.query.descriptor = NULL;
> + mutex_unlock(&hba->i_cmd.dev_cmd_lock);
> +
> + return ret;
> +}
> +
> +/**


--
~Santosh


\
 
 \ /
  Last update: 2013-06-12 07:41    [W:0.154 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site