Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Improve the documentation of UFS data frames

In source code comments, use terminology that comes from the JEDEC UFS
standard. This makes it easier to compare the UFS driver code with the
JEDEC UFS standard. Add static_assert() statements that verify the size
of data structures defined in the UFS standard.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260106190017.2527978-1-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
309b23a1 bf286f55

+12 -10
+8 -9
include/uapi/scsi/scsi_bsg_ufs.h
··· 94 94 }; 95 95 96 96 /** 97 - * struct utp_upiu_query - upiu request buffer structure for 98 - * query request. 99 - * @opcode: command to perform B-0 100 - * @idn: a value that indicates the particular type of data B-1 101 - * @index: Index to further identify data B-2 102 - * @selector: Index to further identify data B-3 97 + * struct utp_upiu_query - QUERY REQUEST UPIU structure. 98 + * @opcode: query function to perform B-0 99 + * @idn: descriptor or attribute identification number B-1 100 + * @index: Index that further identifies which data to access B-2 101 + * @selector: Index that further identifies which data to access B-3 103 102 * @reserved_osf: spec reserved field B-4,5 104 - * @length: number of descriptor bytes to read/write B-6,7 105 - * @value: Attribute value to be written DW-5 106 - * @reserved: spec reserved DW-6,7 103 + * @length: number of descriptor bytes to read or write B-6,7 104 + * @value: if @opcode == UPIU_QUERY_OPCODE_WRITE_ATTR, the value to be written B-6,7 105 + * @reserved: reserved for future use DW-6,7 107 106 */ 108 107 struct utp_upiu_query { 109 108 __u8 opcode;
+4 -1
include/ufs/ufs.h
··· 21 21 * in this header file of the size of struct utp_upiu_header. 22 22 */ 23 23 static_assert(sizeof(struct utp_upiu_header) == 12); 24 + static_assert(sizeof(struct utp_upiu_query) == 20); 24 25 25 26 #define GENERAL_UPIU_REQUEST_SIZE (sizeof(struct utp_upiu_req)) 26 27 #define QUERY_DESC_MAX_SIZE 255 ··· 562 561 #define UFS_WB_BUF_REMAIN_PERCENT(val) ((val) / 10) 563 562 564 563 /** 565 - * struct utp_cmd_rsp - Response UPIU structure 564 + * struct utp_cmd_rsp - RESPONSE UPIU structure 566 565 * @residual_transfer_count: Residual transfer count DW-3 567 566 * @reserved: Reserved double words DW-4 to DW-7 568 567 * @sense_data_len: Sense data length DW-8 U16 ··· 574 573 __be16 sense_data_len; 575 574 u8 sense_data[UFS_SENSE_SIZE]; 576 575 }; 576 + 577 + static_assert(sizeof(struct utp_cmd_rsp) == 40); 577 578 578 579 /** 579 580 * struct utp_upiu_rsp - general upiu response structure