From c0f55b3c1cc3adf0af8492b86177020dc365cbc3 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Tue, 5 Apr 2011 15:28:50 +0000 Subject: provide VSCSI_STAT_RESET so userland can tell us that the connection to the device was reset rather than blindly fail it. requested by claudio@ --- sys/dev/vscsi.c | 5 ++++- sys/dev/vscsivar.h | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index c5444f55396..30fa71931cf 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.21 2010/09/25 00:31:31 dlg Exp $ */ +/* $OpenBSD: vscsi.c,v 1.22 2011/04/05 15:28:49 dlg Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -456,6 +456,9 @@ vscsi_t2i(struct vscsi_softc *sc, struct vscsi_ioc_t2i *t2i) xs->error = XS_SENSE; bcopy(&t2i->sense, &xs->sense, sizeof(xs->sense)); break; + case VSCSI_STAT_RESET: + xs->error = XS_RESET; + break; case VSCSI_STAT_ERR: default: xs->error = XS_DRIVER_STUFFUP; diff --git a/sys/dev/vscsivar.h b/sys/dev/vscsivar.h index dd704f917b0..5fef5be5add 100644 --- a/sys/dev/vscsivar.h +++ b/sys/dev/vscsivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsivar.h,v 1.4 2011/01/07 02:21:51 dlg Exp $ */ +/* $OpenBSD: vscsivar.h,v 1.5 2011/04/05 15:28:49 dlg Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -53,7 +53,8 @@ struct vscsi_ioc_t2i { int status; #define VSCSI_STAT_DONE 0 #define VSCSI_STAT_SENSE 1 -#define VSCSI_STAT_ERR 2 +#define VSCSI_STAT_RESET 2 +#define VSCSI_STAT_ERR 3 struct scsi_sense_data sense; }; -- cgit v1.2.3