if (io_hdr.info & SG_INFO_OK_MASK) {
int key = 0, asc, ascq;
+ switch (io_hdr.host_status) {
+ case DID_OK:
+ case DID_NO_CONNECT:
+ case DID_BAD_TARGET:
+ case DID_ABORT:
+ case DID_TRANSPORT_DISRUPTED:
+ case DID_TRANSPORT_FAILFAST:
+ break;
+ default:
+ /* Driver error, retry */
+ if (--retry_tur)
+ goto retry;
+ break;
+ }
if (io_hdr.sb_len_wr > 3) {
if (io_hdr.sbp[0] == 0x72 || io_hdr.sbp[0] == 0x73) {
key = io_hdr.sbp[1] & 0x0f;
#define __user
#include <scsi/sg.h>
+
+#ifndef DID_OK
+#define DID_OK 0x00 /* NO error */
+#define DID_NO_CONNECT 0x01 /* Couldn't connect before timeout period */
+#define DID_BUS_BUSY 0x02 /* BUS stayed busy through time out period */
+#define DID_TIME_OUT 0x03 /* TIMED OUT for other reason */
+#define DID_BAD_TARGET 0x04 /* BAD target. */
+#define DID_ABORT 0x05 /* Told to abort for some other reason */
+#define DID_PARITY 0x06 /* Parity error */
+#define DID_ERROR 0x07 /* Internal error */
+#define DID_RESET 0x08 /* Reset by somebody. */
+#define DID_BAD_INTR 0x09 /* Got an interrupt we weren't expecting. */
+#define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */
+#define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */
+#define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */
+#define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also
+ * without decrementing the retry count */
+#define DID_TRANSPORT_DISRUPTED 0x0e /* Transport error disrupted execution
+ * and the driver blocked the port to
+ * recover the link. Transport class will
+ * retry or fail IO */
+#define DID_TRANSPORT_FAILFAST 0x0f /* Transport class fastfailed the io */
+#endif