From c8f7489251269b9c4d516c3075b902d2b067b1b3 Mon Sep 17 00:00:00 2001 From: "brking@us.ibm.com" Date: Tue, 1 Nov 2005 17:02:08 -0600 Subject: [PATCH] [SCSI] ipr: Handle device autosense Some newer ipr adapters are capable of returning autosense from devices that support it. This patch adds the data structures for the autosense buffer. Signed-off-by: Brian King Signed-off-by: James Bottomley --- drivers/scsi/ipr.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 8aad480e9b..b8ae306691 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h @@ -403,23 +403,26 @@ struct ipr_ioadl_desc { struct ipr_ioasa_vset { __be32 failing_lba_hi; __be32 failing_lba_lo; - __be32 ioa_data[22]; + __be32 reserved; }__attribute__((packed, aligned (4))); struct ipr_ioasa_af_dasd { __be32 failing_lba; + __be32 reserved[2]; }__attribute__((packed, aligned (4))); struct ipr_ioasa_gpdd { u8 end_state; u8 bus_phase; __be16 reserved; - __be32 ioa_data[23]; + __be32 ioa_data[2]; }__attribute__((packed, aligned (4))); -struct ipr_ioasa_raw { - __be32 ioa_data[24]; -}__attribute__((packed, aligned (4))); +struct ipr_auto_sense { + __be16 auto_sense_len; + __be16 ioa_data_len; + __be32 data[SCSI_SENSE_BUFFERSIZE/sizeof(__be32)]; +}; struct ipr_ioasa { __be32 ioasc; @@ -446,6 +449,8 @@ struct ipr_ioasa { __be32 fd_res_handle; __be32 ioasc_specific; /* status code specific field */ +#define IPR_ADDITIONAL_STATUS_FMT 0x80000000 +#define IPR_AUTOSENSE_VALID 0x40000000 #define IPR_IOASC_SPECIFIC_MASK 0x00ffffff #define IPR_FIELD_POINTER_VALID (0x80000000 >> 8) #define IPR_FIELD_POINTER_MASK 0x0000ffff @@ -454,8 +459,9 @@ struct ipr_ioasa { struct ipr_ioasa_vset vset; struct ipr_ioasa_af_dasd dasd; struct ipr_ioasa_gpdd gpdd; - struct ipr_ioasa_raw raw; } u; + + struct ipr_auto_sense auto_sense; }__attribute__((packed, aligned (4))); struct ipr_mode_parm_hdr { -- 2.39.5