From 1d6049a3b14feb39c8d6c8f538a711dcc54f88e0 Mon Sep 17 00:00:00 2001 From: John Garry Date: Thu, 17 Feb 2022 23:42:30 +0800 Subject: scsi: libsas: Use enum for response frame DATAPRES field As defined in table 126 of the SAS spec 1.1, use an enum for the DATAPRES field, which makes reading the code easier. Also change sas_ssp_task_response() to use a switch statement, which is more suitable (than if-else), as suggested by Christoph. Link: https://lore.kernel.org/r/1645112566-115804-3-git-send-email-john.garry@huawei.com Suggested-by: Xiang Chen Tested-by: Yihang Li Tested-by: Damien Le Moal Reviewed-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen --- include/scsi/sas.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/sas.h b/include/scsi/sas.h index 64154c1fed02..332a463d08ef 100644 --- a/include/scsi/sas.h +++ b/include/scsi/sas.h @@ -191,6 +191,13 @@ enum sas_gpio_reg_type { SAS_GPIO_REG_TX_GP = 4, }; +/* Response frame DATAPRES field */ +enum { + SAS_DATAPRES_NO_DATA = 0, + SAS_DATAPRES_RESPONSE_DATA = 1, + SAS_DATAPRES_SENSE_DATA = 2, +}; + struct dev_to_host_fis { u8 fis_type; /* 0x34 */ u8 flags; -- cgit v1.2.3