summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/umass_scsi.c14
-rw-r--r--sys/dev/usb/usscanner.c8
2 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c
index 575f232f62b..ddf33188013 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.13 2005/05/25 21:12:54 krw Exp $ */
+/* $OpenBSD: umass_scsi.c,v 1.14 2006/11/28 23:59:45 dlg Exp $ */
/* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -93,6 +93,7 @@ struct scsi_device umass_atapiscsi_dev = { NULL, NULL, NULL, NULL, };
int
umass_scsi_attach(struct umass_softc *sc)
{
+ struct scsibus_attach_args saa;
struct umass_scsi_softc *scbus;
scbus = umass_scsi_setup(sc);
@@ -102,13 +103,14 @@ umass_scsi_attach(struct umass_softc *sc)
scbus->sc_link.flags |= SDEV_UMASS;
scbus->sc_link.device = &umass_scsi_dev;
+
DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: SCSI\n"
"sc = 0x%x, scbus = 0x%x\n",
USBDEVNAME(sc->sc_dev), sc, scbus));
sc->sc_refcnt++;
scbus->base.sc_child =
- config_found((struct device *)sc, &scbus->sc_link, scsiprint);
+ config_found((struct device *)sc, &saa, scsiprint);
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(USBDEV(sc->sc_dev));
@@ -119,6 +121,7 @@ umass_scsi_attach(struct umass_softc *sc)
int
umass_atapi_attach(struct umass_softc *sc)
{
+ struct scsibus_attach_args saa;
struct umass_scsi_softc *scbus;
scbus = umass_scsi_setup(sc);
@@ -128,13 +131,16 @@ umass_atapi_attach(struct umass_softc *sc)
scbus->sc_link.flags |= SDEV_ATAPI;
scbus->sc_link.device = &umass_atapiscsi_dev;
+ bzero(&saa, sizeof(saa));
+ saa.saa_sc_link = &scbus->sc_link;
+
DPRINTF(UDMASS_USB, ("%s: umass_attach_bus: ATAPI\n"
"sc = 0x%x, scbus = 0x%x\n",
USBDEVNAME(sc->sc_dev), sc, scbus));
sc->sc_refcnt++;
- scbus->base.sc_child =
- config_found((struct device *)sc, &scbus->sc_link, scsiprint);
+ scbus->base.sc_child = config_found((struct device *)sc,
+ &saa, scsiprint);
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(USBDEV(sc->sc_dev));
diff --git a/sys/dev/usb/usscanner.c b/sys/dev/usb/usscanner.c
index d669ee1d245..e588d4b2ed3 100644
--- a/sys/dev/usb/usscanner.c
+++ b/sys/dev/usb/usscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usscanner.c,v 1.11 2006/06/23 06:27:12 miod Exp $ */
+/* $OpenBSD: usscanner.c,v 1.12 2006/11/28 23:59:45 dlg Exp $ */
/* $NetBSD: usscanner.c,v 1.6 2001/01/23 14:04:14 augustss Exp $ */
/*
@@ -204,6 +204,7 @@ USB_MATCH(usscanner)
USB_ATTACH(usscanner)
{
USB_ATTACH_START(usscanner, sc, uaa);
+ struct scsibus_attach_args saa;
usbd_device_handle dev = uaa->device;
usbd_interface_handle iface;
char *devinfop;
@@ -364,7 +365,10 @@ USB_ATTACH(usscanner)
sc->sc_link.scsipi_scsi.max_lun = 0;
#endif
- sc->sc_child = config_found(&sc->sc_dev, &sc->sc_link, scsiprint);
+ bzero(&saa, sizeof(saa));
+ saa.saa_sc_link = &sc->sc_link;
+
+ sc->sc_child = config_found(&sc->sc_dev, &saa, scsiprint);
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
USBDEV(sc->sc_dev));