dasd_3370_erp.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. */
  8. #define PRINTK_HEADER "dasd_erp(3370)"
  9. #include "dasd_int.h"
  10. /*
  11. * DASD_3370_ERP_EXAMINE
  12. *
  13. * DESCRIPTION
  14. * Checks only for fatal/no/recover error.
  15. * A detailed examination of the sense data is done later outside
  16. * the interrupt handler.
  17. *
  18. * The logic is based on the 'IBM 3880 Storage Control Reference' manual
  19. * 'Chapter 7. 3370 Sense Data'.
  20. *
  21. * RETURN VALUES
  22. * dasd_era_none no error
  23. * dasd_era_fatal for all fatal (unrecoverable errors)
  24. * dasd_era_recover for all others.
  25. */
  26. dasd_era_t
  27. dasd_3370_erp_examine(struct dasd_ccw_req * cqr, struct irb * irb)
  28. {
  29. char *sense = irb->ecw;
  30. /* check for successful execution first */
  31. if (irb->scsw.cstat == 0x00 &&
  32. irb->scsw.dstat == (DEV_STAT_CHN_END | DEV_STAT_DEV_END))
  33. return dasd_era_none;
  34. if (sense[0] & 0x80) { /* CMD reject */
  35. return dasd_era_fatal;
  36. }
  37. if (sense[0] & 0x40) { /* Drive offline */
  38. return dasd_era_recover;
  39. }
  40. if (sense[0] & 0x20) { /* Bus out parity */
  41. return dasd_era_recover;
  42. }
  43. if (sense[0] & 0x10) { /* equipment check */
  44. if (sense[1] & 0x80) {
  45. return dasd_era_fatal;
  46. }
  47. return dasd_era_recover;
  48. }
  49. if (sense[0] & 0x08) { /* data check */
  50. if (sense[1] & 0x80) {
  51. return dasd_era_fatal;
  52. }
  53. return dasd_era_recover;
  54. }
  55. if (sense[0] & 0x04) { /* overrun */
  56. if (sense[1] & 0x80) {
  57. return dasd_era_fatal;
  58. }
  59. return dasd_era_recover;
  60. }
  61. if (sense[1] & 0x40) { /* invalid blocksize */
  62. return dasd_era_fatal;
  63. }
  64. if (sense[1] & 0x04) { /* file protected */
  65. return dasd_era_recover;
  66. }
  67. if (sense[1] & 0x01) { /* operation incomplete */
  68. return dasd_era_recover;
  69. }
  70. if (sense[2] & 0x80) { /* check data erroor */
  71. return dasd_era_recover;
  72. }
  73. if (sense[2] & 0x10) { /* Env. data present */
  74. return dasd_era_recover;
  75. }
  76. /* examine the 24 byte sense data */
  77. return dasd_era_recover;
  78. } /* END dasd_3370_erp_examine */