Linux-2.6.12-rc2
[linux-2.6/kvm.git] / drivers / scsi / scsi_obsolete.h
blobabeacb996ea05ec743b79f66bfc5d706304b60ea
1 /*
2 * scsi_obsolete.h Copyright (C) 1997 Eric Youngdale
4 */
6 #ifndef _SCSI_OBSOLETE_H
7 #define _SCSI_OBSOLETE_H
9 /*
10 * These are the return codes for the abort and reset functions. The mid-level
11 * code uses these to decide what to do next. Each of the low level abort
12 * and reset functions must correctly indicate what it has done.
13 * The descriptions are written from the point of view of the mid-level code,
14 * so that the return code is telling the mid-level drivers exactly what
15 * the low level driver has already done, and what remains to be done.
18 /* We did not do anything.
19 * Wait some more for this command to complete, and if this does not work,
20 * try something more serious. */
21 #define SCSI_ABORT_SNOOZE 0
23 /* This means that we were able to abort the command. We have already
24 * called the mid-level done function, and do not expect an interrupt that
25 * will lead to another call to the mid-level done function for this command */
26 #define SCSI_ABORT_SUCCESS 1
28 /* We called for an abort of this command, and we should get an interrupt
29 * when this succeeds. Thus we should not restore the timer for this
30 * command in the mid-level abort function. */
31 #define SCSI_ABORT_PENDING 2
33 /* Unable to abort - command is currently on the bus. Grin and bear it. */
34 #define SCSI_ABORT_BUSY 3
36 /* The command is not active in the low level code. Command probably
37 * finished. */
38 #define SCSI_ABORT_NOT_RUNNING 4
40 /* Something went wrong. The low level driver will indicate the correct
41 * error condition when it calls scsi_done, so the mid-level abort function
42 * can simply wait until this comes through */
43 #define SCSI_ABORT_ERROR 5
45 /* We do not know how to reset the bus, or we do not want to. Bummer.
46 * Anyway, just wait a little more for the command in question, and hope that
47 * it eventually finishes. If it never finishes, the SCSI device could
48 * hang, so use this with caution. */
49 #define SCSI_RESET_SNOOZE 0
51 /* We do not know how to reset the bus, or we do not want to. Bummer.
52 * We have given up on this ever completing. The mid-level code will
53 * request sense information to decide how to proceed from here. */
54 #define SCSI_RESET_PUNT 1
56 /* This means that we were able to reset the bus. We have restarted all of
57 * the commands that should be restarted, and we should be able to continue
58 * on normally from here. We do not expect any interrupts that will return
59 * DID_RESET to any of the other commands in the host_queue, and the mid-level
60 * code does not need to do anything special to keep the commands alive.
61 * If a hard reset was performed then all outstanding commands on the
62 * bus have been restarted. */
63 #define SCSI_RESET_SUCCESS 2
65 /* We called for a reset of this bus, and we should get an interrupt
66 * when this succeeds. Each command should get its own status
67 * passed up to scsi_done, but this has not happened yet.
68 * If a hard reset was performed, then we expect an interrupt
69 * for *each* of the outstanding commands that will have the
70 * effect of restarting the commands.
72 #define SCSI_RESET_PENDING 3
74 /* We did a reset, but do not expect an interrupt to signal DID_RESET.
75 * This tells the upper level code to request the sense info, and this
76 * should keep the command alive. */
77 #define SCSI_RESET_WAKEUP 4
79 /* The command is not active in the low level code. Command probably
80 finished. */
81 #define SCSI_RESET_NOT_RUNNING 5
83 /* Something went wrong, and we do not know how to fix it. */
84 #define SCSI_RESET_ERROR 6
86 #define SCSI_RESET_SYNCHRONOUS 0x01
87 #define SCSI_RESET_ASYNCHRONOUS 0x02
88 #define SCSI_RESET_SUGGEST_BUS_RESET 0x04
89 #define SCSI_RESET_SUGGEST_HOST_RESET 0x08
91 * This is a bitmask that is ored with one of the above codes.
92 * It tells the mid-level code that we did a hard reset.
94 #define SCSI_RESET_BUS_RESET 0x100
96 * This is a bitmask that is ored with one of the above codes.
97 * It tells the mid-level code that we did a host adapter reset.
99 #define SCSI_RESET_HOST_RESET 0x200
101 * Used to mask off bits and to obtain the basic action that was
102 * performed.
104 #define SCSI_RESET_ACTION 0xff
106 #endif /* SCSI_OBSOLETE_H */