diff options
| author | reinoud <reinoud@NetBSD.org> | 2018-06-13 19:59:14 +0000 |
|---|---|---|
| committer | reinoud <reinoud@NetBSD.org> | 2018-06-13 19:59:14 +0000 |
| commit | fdcd6d4a982cf5717108702e2fc6053543377fec (patch) | |
| tree | 725d2db94de274a3e560727c71c8eba33d136ce2 /sys/arch/usermode/dev | |
| parent | b0bba65b293c9535e94147b6bd157d8df7fe12b3 (diff) | |
Split out error reporting and make it compile without SCSIVERBOSE
Diffstat (limited to 'sys/arch/usermode/dev')
| -rw-r--r-- | sys/arch/usermode/dev/vatapi.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/sys/arch/usermode/dev/vatapi.c b/sys/arch/usermode/dev/vatapi.c index ba944045d5c..d9b562cd7de 100644 --- a/sys/arch/usermode/dev/vatapi.c +++ b/sys/arch/usermode/dev/vatapi.c @@ -1,4 +1,4 @@ -/* $NetBSD: vatapi.c,v 1.1 2018/06/05 20:02:43 reinoud Exp $ */ +/* $NetBSD: vatapi.c,v 1.2 2018/06/13 19:59:14 reinoud Exp $ */ /*- * Copyright (c) 2018 Reinoud Zandijk <reinoud@NetBSD.org> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vatapi.c,v 1.1 2018/06/05 20:02:43 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vatapi.c,v 1.2 2018/06/13 19:59:14 reinoud Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -48,6 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: vatapi.c,v 1.1 2018/06/05 20:02:43 reinoud Exp $"); #include <dev/scsipi/scsipiconf.h> #include <dev/scsipi/atapiconf.h> +#include "opt_scsi.h" + /* parameter? */ #define VDEV_ATAPI_DRIVE 0 #define MAX_SIZE ((1<<16)) @@ -68,7 +70,9 @@ static void vatapi_probe_device(struct atapibus_softc *, int); static void vatapi_complete(void *arg); /* for debugging */ +#ifdef SCSIVERBOSE void scsipi_print_sense_data_real(struct scsi_sense_data *sense, int verbosity); +#endif /* Note its one vdev, one adapter, one channel for now */ @@ -279,6 +283,21 @@ vatapi_scsipi_request(struct scsipi_channel *chan, static void +vatapi_report_problem(scsireq_t *kreq) +{ +#ifdef SCSIVERBOSE + printf("vatapi cmd failed: "); + for (int i = 0; i < kreq->cmdlen; i++) { + printf("%02x ", kreq->cmd[i]); + } + printf("\n"); + scsipi_print_sense_data_real( + (struct scsi_sense_data *) kreq->sense, 1); +#endif +} + + +static void vatapi_complete(void *arg) { struct vatapi_softc *sc = arg; @@ -316,8 +335,7 @@ vatapi_complete(void *arg) xs->error = XS_SHORTSENSE; /* ATAPI */ memcpy(&xs->sense.scsi_sense, kreq.sense, sizeof(struct scsi_sense_data)); -// scsipi_print_sense_data_real( -// (struct scsi_sense_data *) kreq.sense, 1); + vatapi_report_problem(&kreq); break; default: thunk_printf("unhandled/unknown retstst %d\n", kreq.retsts); |
