1 #ifndef _SCSI_SCSI_EH_H
2 #define _SCSI_SCSI_EH_H
4 #include <linux/scatterlist.h>
6 #include <scsi/scsi_cmnd.h>
10 extern void scsi_eh_finish_cmd(struct scsi_cmnd
*scmd
,
11 struct list_head
*done_q
);
12 extern void scsi_eh_flush_done_q(struct list_head
*done_q
);
13 extern void scsi_report_bus_reset(struct Scsi_Host
*, int);
14 extern void scsi_report_device_reset(struct Scsi_Host
*, int, int);
15 extern int scsi_block_when_processing_errors(struct scsi_device
*);
16 extern bool scsi_command_normalize_sense(const struct scsi_cmnd
*cmd
,
17 struct scsi_sense_hdr
*sshdr
);
19 static inline bool scsi_sense_is_deferred(const struct scsi_sense_hdr
*sshdr
)
21 return ((sshdr
->response_code
>= 0x70) && (sshdr
->response_code
& 1));
24 extern const u8
* scsi_sense_desc_find(const u8
* sense_buffer
, int sb_len
,
27 extern int scsi_get_sense_info_fld(const u8
* sense_buffer
, int sb_len
,
30 extern void scsi_build_sense_buffer(int desc
, u8
*buf
, u8 key
, u8 asc
, u8 ascq
);
31 extern void scsi_set_sense_information(u8
*buf
, u64 info
);
33 extern int scsi_ioctl_reset(struct scsi_device
*, int __user
*);
38 enum dma_data_direction data_direction
;
40 unsigned char cmd_len
;
41 unsigned char prot_op
;
43 struct scsi_data_buffer sdb
;
44 struct request
*next_rq
;
45 /* new command support */
46 unsigned char eh_cmnd
[BLK_MAX_CDB
];
47 struct scatterlist sense_sgl
;
50 extern void scsi_eh_prep_cmnd(struct scsi_cmnd
*scmd
,
51 struct scsi_eh_save
*ses
, unsigned char *cmnd
,
52 int cmnd_size
, unsigned sense_bytes
);
54 extern void scsi_eh_restore_cmnd(struct scsi_cmnd
* scmd
,
55 struct scsi_eh_save
*ses
);
57 #endif /* _SCSI_SCSI_EH_H */