Module Name: src Committed By: martin Date: Mon Jul 13 14:13:12 UTC 2020
Modified Files: src/sys/dev/pci [netbsd-8]: vioscsi.c Log Message: Pull up following revision(s) (requested by kim in ticket #1572): sys/dev/pci/vioscsi.c: revision 1.22 Fix off-by-one SCSI target reporting Use max_target as the controller ID instead of zero, so that the device located at SCSI ID zero (e.g. a disk) is not obscured through not being probed by scsi_probe_bus() (which skips the controller ID). Copy the target requested onto the wire without decrementing it by one. ok christos@ To generate a diff of this commit: cvs rdiff -u -r1.19.2.1 -r1.19.2.2 src/sys/dev/pci/vioscsi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/vioscsi.c diff -u src/sys/dev/pci/vioscsi.c:1.19.2.1 src/sys/dev/pci/vioscsi.c:1.19.2.2 --- src/sys/dev/pci/vioscsi.c:1.19.2.1 Mon Jul 15 08:23:23 2019 +++ src/sys/dev/pci/vioscsi.c Mon Jul 13 14:13:12 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vioscsi.c,v 1.19.2.1 2019/07/15 08:23:23 martin Exp $ */ +/* $NetBSD: vioscsi.c,v 1.19.2.2 2020/07/13 14:13:12 martin Exp $ */ /* $OpenBSD: vioscsi.c,v 1.3 2015/03/14 03:38:49 jsg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.19.2.1 2019/07/15 08:23:23 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.19.2.2 2020/07/13 14:13:12 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -198,7 +198,7 @@ vioscsi_attach(device_t parent, device_t chan->chan_channel = 0; chan->chan_ntargets = MIN(max_target, 16); /* cap reasonably */ chan->chan_nluns = MIN(max_lun, 1024); /* cap reasonably */ - chan->chan_id = 0; + chan->chan_id = max_target; chan->chan_flags = SCSIPI_CHAN_NOSETTLE; config_found(self, &sc->sc_channel, scsiprint); @@ -322,7 +322,7 @@ vioscsi_scsipi_request(struct scsipi_cha } req->lun[0] = 1; - req->lun[1] = periph->periph_target - 1; + req->lun[1] = periph->periph_target; req->lun[2] = 0x40 | ((periph->periph_lun >> 8) & 0x3F); req->lun[3] = periph->periph_lun & 0xFF; memset(req->lun + 4, 0, 4);