Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Print out the contents of an otherwise unrepo...



details:   https://anonhg.NetBSD.org/src/rev/e925a908015a
branches:  trunk
changeset: 480497:e925a908015a
user:      mjacob <mjacob%NetBSD.org@localhost>
date:      Fri Jan 14 02:40:45 2000 +0000

description:
Print out the contents of an otherwise unreported undecodable
sense data buffer. This helps catch adapter breakage mostly.

diffstat:

 sys/dev/scsipi/scsipi_base.c |  20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 6ad35d1a7fe8 -r e925a908015a sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Fri Jan 14 02:39:22 2000 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Fri Jan 14 02:40:45 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.27 1999/10/20 15:22:28 enami Exp $   */
+/*     $NetBSD: scsipi_base.c,v 1.28 2000/01/14 02:40:45 mjacob Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -409,6 +409,23 @@
         * Not code 70, just report it
         */
        default:
+#if    defined(SCSIDEBUG) || defined(DEBUG)
+       {
+               static char *uc = "undecodable sense error";
+               int i;
+               u_int8_t *cptr = (u_int8_t *) sense;
+               sc_link->sc_print_addr(sc_link);
+               if (xs->cmd == &xs->cmdstore) {
+                       printf("%s for opcode 0x%x, data=",
+                           uc, xs->cmdstore.opcode);
+               } else {
+                       printf("%s, data=", uc);
+               }
+               for (i = 0; i < sizeof (sense); i++)
+                       printf(" 0x%02x", *(cptr++) & 0xff);
+               printf("\n");
+       }
+#else
                sc_link->sc_print_addr(sc_link);
                printf("Sense Error Code 0x%x",
                        sense->error_code & SSD_ERRCODE);
@@ -419,6 +436,7 @@
                            _3btol(usense->block));
                }
                printf("\n");
+#endif
                return (EIO);
        }
 }



Home | Main Index | Thread Index | Old Index