diff options
author | Avri Altman <avri.altman@wdc.com> | 2018-10-07 17:30:39 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-10 23:09:47 -0400 |
commit | e77044c5a8422e4e139f0a2ac5d49f4075779594 (patch) | |
tree | ec23493895bb8c555fb4a876cf3c3d324fa54955 /drivers/scsi/ufs/ufs_bsg.c | |
parent | 95e34bf930eaee51dab23495342b148cd0ee2ba1 (diff) | |
download | linux-next-e77044c5a8422e4e139f0a2ac5d49f4075779594.tar.gz |
scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()
Make ufshcd_send_uic_cmd() public for that.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <Bart.VanAssche@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs_bsg.c')
-rw-r--r-- | drivers/scsi/ufs/ufs_bsg.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs_bsg.c b/drivers/scsi/ufs/ufs_bsg.c index 306e5f11a818..e5f8e54bf644 100644 --- a/drivers/scsi/ufs/ufs_bsg.c +++ b/drivers/scsi/ufs/ufs_bsg.c @@ -84,6 +84,7 @@ static int ufs_bsg_request(struct bsg_job *job) struct ufs_hba *hba = shost_priv(dev_to_shost(job->dev->parent)); unsigned int req_len = job->request_len; unsigned int reply_len = job->reply_len; + struct uic_command uc = {}; int msgcode; uint8_t *desc_buff = NULL; int desc_len = 0; @@ -117,6 +118,16 @@ static int ufs_bsg_request(struct bsg_job *job) "exe raw upiu: error code %d\n", ret); break; + case UPIU_TRANSACTION_UIC_CMD: + memcpy(&uc, &bsg_request->upiu_req.uc, UIC_CMD_SIZE); + ret = ufshcd_send_uic_cmd(hba, &uc); + if (ret) + dev_dbg(hba->dev, + "send uic cmd: error code %d\n", ret); + + memcpy(&bsg_reply->upiu_rsp.uc, &uc, UIC_CMD_SIZE); + + break; default: ret = -ENOTSUPP; dev_err(hba->dev, "unsupported msgcode 0x%x\n", msgcode); |