sense data helpers lk 2.6.11-rc1-bk1
PATCH 1/1 sense data helpers lk 2.6.11-rc1-bk1
Here are two helper functions for processing sense data. These will allow the sd driver (and constants.c) to fetch the information field in sense data. For a medium or hardware error on a disk the information field is the lba of the first failure.
Changelog:
- add sense data helper functions:
- scsi_sense_desc_find() to find a given sense descriptor (e.g. type 0 -> information)
- scsi_get_sense_info_fld() to get the information field from fixed or descriptor sense data
Kai Makisara proposed the "find" function. For example, it will help the st driver find the Filemark, EOM and ILI flags which have been placed in the "stream commands" sense data descriptor.
include/scsi/scsi_eh.h2611r1b1desc renamed from include/scsi/scsi_eh.h +6 -0
@@ -44,6 +44,12 @@ { return ((sshdr->response_code >= 0x70) && (sshdr->response_code & 1)); } + +extern const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len, + int desc_type); + +extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len, + u64 * info_out); /* * Reset request from external source
drivers/scsi/scsi_error.c2611r1b1desc renamed from drivers/scsi/scsi_error.c +93 -0
96 lines not on this page · raw message