/drivers/scsi/scsi_obsolete.h

https://bitbucket.org/abioy/linux · C Header · 106 lines · 23 code · 17 blank · 66 comment · 0 complexity · 76a2a47b41aade806026227bed552dbe MD5 · raw file

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