From ec68c188175b8b8f087c08ccabacbbadcc0f2843 Mon Sep 17 00:00:00 2001 From: krw Date: Mon, 1 Aug 2016 10:56:31 +0000 Subject: [PATCH] Set SDEV_UMASS on all umass devices, even when they use ATAPI or UFI command sets. Probe all the LUNs a device reports instead of assuming ATAPI and UFI devices always have 1 LUN. Motivated by the device David Vasek reported as claiming to be ATAPI but wanting to use >1 LUN. Committing quickly to smoke out the inevitable device that works in the exact opposite way. All hail USB. ok kettenis@ --- sys/dev/usb/umass_scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c index 3c37d036afe..a7e691262ed 100644 --- a/sys/dev/usb/umass_scsi.c +++ b/sys/dev/usb/umass_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass_scsi.c,v 1.43 2015/12/16 14:50:26 mpi Exp $ */ +/* $OpenBSD: umass_scsi.c,v 1.44 2016/08/01 10:56:31 krw Exp $ */ /* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -118,9 +118,9 @@ umass_atapi_attach(struct umass_softc *sc) scbus = umass_scsi_setup(sc); scbus->sc_link.adapter_target = UMASS_SCSIID_HOST; - scbus->sc_link.luns = 1; + scbus->sc_link.luns = sc->maxlun + 1; scbus->sc_link.openings = 1; - scbus->sc_link.flags |= SDEV_ATAPI; + scbus->sc_link.flags |= SDEV_UMASS | SDEV_ATAPI; bzero(&saa, sizeof(saa)); saa.saa_sc_link = &scbus->sc_link; -- 2.20.1