History

scsi: ufs-bsg: Add support for uic commands in ufs_bsg_request()

Make ufshcd_send_uic_cmd() public for that.

Avri Altman committed 8 years ago

Commit e77044c1 parent 95e34bf4 files · +17 −2Browse files

Unified · Split

4 files
  1. drivers/scsi/ufs/ufs_bsg.c +11 −0
  2. drivers/scsi/ufs/ufshcd.c +1 −2
  3. drivers/scsi/ufs/ufshcd.h +2 −0
  4. include/uapi/scsi/scsi_bsg_ufs.h +3 −0
drivers/scsi/ufs/ufs_bsg.c+11−0
@@ -84,6 +84,7 @@ static int ufs_bsg_request(struct bsg_job *job) · 83 unmodified lines
84 struct ufs_hba *hba = shost_priv(dev_to_shost(job->dev->parent));84 struct ufs_hba *hba = shost_priv(dev_to_shost(job->dev->parent));
85 unsigned int req_len = job->request_len;85 unsigned int req_len = job->request_len;
86 unsigned int reply_len = job->reply_len;86 unsigned int reply_len = job->reply_len;
87 struct uic_command uc = {};
87 int msgcode;88 int msgcode;
88 uint8_t *desc_buff = NULL;89 uint8_t *desc_buff = NULL;
89 int desc_len = 0;90 int desc_len = 0;
@@ -116,6 +117,16 @@ static int ufs_bsg_request(struct bsg_job *job) · 26 unmodified lines
116 dev_err(hba->dev,117 dev_err(hba->dev,
117 "exe raw upiu: error code %d\n", ret);118 "exe raw upiu: error code %d\n", ret);
118 119
120 break;
121 case UPIU_TRANSACTION_UIC_CMD:
122 memcpy(&uc, &bsg_request->upiu_req.uc, UIC_CMD_SIZE);
123 ret = ufshcd_send_uic_cmd(hba, &uc);
124 if (ret)
125 dev_dbg(hba->dev,
126 "send uic cmd: error code %d\n", ret);
127
128 memcpy(&bsg_reply->upiu_rsp.uc, &uc, UIC_CMD_SIZE);
129
119 break;130 break;
120 default:131 default:
121 ret = -ENOTSUPP;132 ret = -ENOTSUPP;
drivers/scsi/ufs/ufshcd.c+1−2
@@ -2059,8 +2059,7 @@ __ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd, · 2058 unmodified lines
2059 *2059 *
2060 * Returns 0 only if success.2060 * Returns 0 only if success.
2061 */2061 */
2062static int2062int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
2063ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
2064{2063{
2065 int ret;2064 int ret;
2066 unsigned long flags;2065 unsigned long flags;
drivers/scsi/ufs/ufshcd.h+2−0
@@ -895,6 +895,8 @@ int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id, · 894 unmodified lines
895 895
896u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba);896u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba);
897 897
898int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd);
899
898int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,900int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
899 struct utp_upiu_req *req_upiu,901 struct utp_upiu_req *req_upiu,
900 struct utp_upiu_req *rsp_upiu,902 struct utp_upiu_req *rsp_upiu,
include/uapi/scsi/scsi_bsg_ufs.h+3−0
@@ -13,6 +13,9 @@ · 12 unmodified lines
13 */13 */
14 14
15#define UFS_CDB_SIZE 1615#define UFS_CDB_SIZE 16
16#define UPIU_TRANSACTION_UIC_CMD 0x1F
17/* uic commands are 4DW long, per UFSHCI V2.1 paragraph 5.6.1 */
18#define UIC_CMD_SIZE (sizeof(u32) * 4)
16 19
17/**20/**
18 * struct utp_upiu_header - UPIU header structure21 * struct utp_upiu_header - UPIU header structure

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t