dasd_3370_erp.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * File...........: linux/drivers/s390/block/dasd_3370_erp.c
  3. * Author(s)......: Holger Smolinski <Holger.Smolinski@de.ibm.com>
  4. * Bugreports.to..: <Linux390@de.ibm.com>
  5. * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
  6. *
  7. * $Revision: 1.9 $
  8. */
  9. #define PRINTK_HEADER "dasd_erp(3370)"
  10. #include "dasd_int.h"
  11. /*
  12. * DASD_3370_ERP_EXAMINE
  13. *
  14. * DESCRIPTION
  15. * Checks only for fatal/no/recover error.
  16. * A detailed examination of the sense data is done later outside
  17. * the interrupt handler.
  18. *
  19. * The logic is based on the 'IBM 3880 Storage Control Reference' manual
  20. * 'Chapter 7. 3370 Sense Data'.
  21. *
  22. * RETURN VALUES
  23. * dasd_era_none no error
  24. * dasd_era_fatal for all fatal (unrecoverable errors)
  25. * dasd_era_recover for all others.
  26. */
  27. dasd_era_t
  28. dasd_3370_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
  29. {
  30. char *sense = irb->ecw;
  31. /* check for successful execution first */
  32. if (irb->scsw.cstat == 0x00 &&
  33. irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END))
  34. return dasd_era_none;
  35. if (sense[0] & 0x80) { /* CMD reject */
  36. return dasd_era_fatal;
  37. }
  38. if (sense[0] & 0x40) { /* Drive offline */
  39. return dasd_era_recover;
  40. }
  41. if (sense[0] & 0x20) { /* Bus out parity */
  42. return dasd_era_recover;
  43. }
  44. if (sense[0] & 0x10) { /* equipment check */
  45. if (sense[1] & 0x80) {
  46. return dasd_era_fatal;
  47. }
  48. return dasd_era_recover;
  49. }
  50. if (sense[0] & 0x08) { /* data check */
  51. if (sense[1] & 0x80) {
  52. return dasd_era_fatal;
  53. }
  54. return dasd_era_recover;
  55. }
  56. if (sense[0] & 0x04) { /* overrun */
  57. if (sense[1] & 0x80) {
  58. return dasd_era_fatal;
  59. }
  60. return dasd_era_recover;
  61. }
  62. if (sense[1] & 0x40) { /* invalid blocksize */
  63. return dasd_era_fatal;
  64. }
  65. if (sense[1] & 0x04) { /* file protected */
  66. return dasd_era_recover;
  67. }
  68. if (sense[1] & 0x01) { /* operation incomplete */
  69. return dasd_era_recover;
  70. }
  71. if (sense[2] & 0x80) { /* check data erroor */
  72. return dasd_era_recover;
  73. }
  74. if (sense[2] & 0x10) { /* Env. data present */
  75. return dasd_era_recover;
  76. }
  77. /* examine the 24 byte sense data */
  78. return dasd_era_recover;
  79. } /* END dasd_3370_erp_examine */
  80. /*
  81. * Overrides for Emacs so that we follow Linus's tabbing style.
  82. * Emacs will notice this stuff at the end of the file and automatically
  83. * adjust the settings for this buffer only. This must remain at the end
  84. * of the file.
  85. * ---------------------------------------------------------------------------
  86. * Local variables:
  87. * c-indent-level: 4
  88. * c-brace-imaginary-offset: 0
  89. * c-brace-offset: -4
  90. * c-argdecl-indent: 4
  91. * c-label-offset: -4
  92. * c-continued-statement-offset: 4
  93. * c-continued-brace-offset: 0
  94. * indent-tabs-mode: 1
  95. * tab-width: 8
  96. * End:
  97. */