On Fri, Mar 06, 2015 at 05:46:19PM -0600, Don Brace wrote: > From: Stephen Cameron <stephenmcameron@xxxxxxxxx> > > In hba mode, we could get sense data in descriptor format so > we need to handle that. > > It's possible for CommandStatus to have value 0x0D > "TMF Function Status", which we should handle. We will get > this from a P1224 when aborting a non-existent tag, for > example. The "ScsiStatus" field of the errinfo field > will contain the TMF function status value. > > Reviewed-by: Scott Teel <scott.teel@xxxxxxxx> > Reviewed-by: Kevin Barnett <kevin.barnett@xxxxxxxx> > Signed-off-by: Don Brace <don.brace@xxxxxxxx> > --- > drivers/scsi/hpsa.c | 143 +++++++++++++++++++++++++++++++++++------------ > drivers/scsi/hpsa_cmd.h | 9 +++ > 2 files changed, 117 insertions(+), 35 deletions(-) > > diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c > index 7ff59b7..5e18ee5 100644 > --- a/drivers/scsi/hpsa.c > +++ b/drivers/scsi/hpsa.c > @@ -43,6 +43,7 @@ > #include <scsi/scsi_device.h> > #include <scsi/scsi_host.h> > #include <scsi/scsi_tcq.h> > +#include <scsi/scsi_eh.h> > #include <linux/cciss_ioctl.h> > #include <linux/string.h> > #include <linux/bitmap.h> > @@ -268,16 +269,49 @@ static inline struct ctlr_info *shost_to_hba(struct Scsi_Host *sh) > return (struct ctlr_info *) *priv; > } > > +/* extract sense key, asc, and ascq from sense data. -1 means invalid. */ > +static void decode_sense_data(const u8 *sense_data, int sense_data_len, > + int *sense_key, int *asc, int *ascq) Woudn't it be cleaner to just use scsi_normalize_sense directly instead of the wrapper? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html