summaryrefslogtreecommitdiffstats
path: root/include/ufs/ufs.h
diff options
context:
space:
mode:
authorBean Huo <beanhuo@micron.com>2022-12-01 15:04:37 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2022-12-30 21:01:04 +0000
commit6ff265fc5ef660499e0edc4641647e99eed3f519 (patch)
tree26e4dc87b18bbea0988ef9b9ac4201cd838a7301 /include/ufs/ufs.h
parenta4b1c9b9b38c92da099aba234c96e818f8d2e4dd (diff)
downloadlinux-6ff265fc5ef660499e0edc4641647e99eed3f519.tar.gz
linux-6ff265fc5ef660499e0edc4641647e99eed3f519.tar.bz2
linux-6ff265fc5ef660499e0edc4641647e99eed3f519.zip
scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg
Add advanced RPMB support in ufs_bsg: 1. According to the UFS specification, only one RPMB operation can be performed at any time. We can ensure this by using reserved slot and its dev_cmd sync operation protection mechanism. 2. For Advanced RPMB, RPMB metadata is packaged in an EHS (Extra Header Segment) of a command UPIU, and the corresponding reply EHS (from the device) should also be returned to the user space. bsg_job->request and bsg_job->reply allow us to pass and return EHS from/back to userspace. Compared to normal/legacy RPMB, the advantages of advanced RPMB are: 1. The data length in the Advanced RPMB data read/write command can be larger than 4KB. For the legacy RPMB, the data length in a single RPMB data transfer is 256 bytes. 2. All of the advanced RPMB operations will be a single command. For legacy RPMB, take the read write-counter value as an example, you need two commands (first SECURITY PROTOCOL OUT, then second SECURITY PROTOCOL IN). Signed-off-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/ufs/ufs.h')
-rw-r--r--include/ufs/ufs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h
index 17e401df674c..0c112195b288 100644
--- a/include/ufs/ufs.h
+++ b/include/ufs/ufs.h
@@ -49,6 +49,11 @@
*/
#define UFS_WB_EXCEED_LIFETIME 0x0B
+/*
+ * In UFS Spec, the Extra Header Segment (EHS) starts from byte 32 in UPIU request/response packet
+ */
+#define EHS_OFFSET_IN_RESPONSE 32
+
/* Well known logical unit id in LUN field of UPIU */
enum {
UFS_UPIU_REPORT_LUNS_WLUN = 0x81,