Pay attention to the timeout value passed down by the scsipi layer.
This commit is contained in:
parent
4fbe7a81e0
commit
596224e54f
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: umass.c,v 1.66 2001/11/23 01:15:28 augustss Exp $ */
|
/* $NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $ */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
|
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
|
||||||
* Nick Hibma <n_hibma@freebsd.org>
|
* Nick Hibma <n_hibma@freebsd.org>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.66 2001/11/23 01:15:28 augustss Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.67 2001/11/25 19:05:22 augustss Exp $");
|
||||||
|
|
||||||
#include "atapibus.h"
|
#include "atapibus.h"
|
||||||
|
|
||||||
|
@ -181,12 +181,12 @@ Static void umass_reset(struct umass_softc *sc, transfer_cb_f cb, void *priv);
|
||||||
/* Bulk-Only related functions */
|
/* Bulk-Only related functions */
|
||||||
Static void umass_bbb_reset(struct umass_softc *sc, int status);
|
Static void umass_bbb_reset(struct umass_softc *sc, int status);
|
||||||
Static void umass_bbb_transfer(struct umass_softc *sc, int lun,
|
Static void umass_bbb_transfer(struct umass_softc *sc, int lun,
|
||||||
void *cmd, int cmdlen,
|
void *cmd, int cmdlen,
|
||||||
void *data, int datalen, int dir,
|
void *data, int datalen, int dir,
|
||||||
transfer_cb_f cb, void *priv);
|
u_int timeout, transfer_cb_f cb, void *priv);
|
||||||
Static void umass_bbb_state(usbd_xfer_handle xfer,
|
Static void umass_bbb_state(usbd_xfer_handle xfer,
|
||||||
usbd_private_handle priv,
|
usbd_private_handle priv,
|
||||||
usbd_status err);
|
usbd_status err);
|
||||||
usbd_status umass_bbb_get_max_lun(struct umass_softc *sc, u_int8_t *maxlun);
|
usbd_status umass_bbb_get_max_lun(struct umass_softc *sc, u_int8_t *maxlun);
|
||||||
|
|
||||||
|
|
||||||
|
@ -195,9 +195,9 @@ Static int umass_cbi_adsc(struct umass_softc *sc, char *buffer,int buflen,
|
||||||
usbd_xfer_handle xfer);
|
usbd_xfer_handle xfer);
|
||||||
Static void umass_cbi_reset(struct umass_softc *sc, int status);
|
Static void umass_cbi_reset(struct umass_softc *sc, int status);
|
||||||
Static void umass_cbi_transfer(struct umass_softc *sc, int lun,
|
Static void umass_cbi_transfer(struct umass_softc *sc, int lun,
|
||||||
void *cmd, int cmdlen,
|
void *cmd, int cmdlen,
|
||||||
void *data, int datalen, int dir,
|
void *data, int datalen, int dir,
|
||||||
transfer_cb_f cb, void *priv);
|
u_int timeout, transfer_cb_f cb, void *priv);
|
||||||
Static void umass_cbi_state(usbd_xfer_handle xfer,
|
Static void umass_cbi_state(usbd_xfer_handle xfer,
|
||||||
usbd_private_handle priv, usbd_status err);
|
usbd_private_handle priv, usbd_status err);
|
||||||
|
|
||||||
|
@ -916,8 +916,8 @@ umass_bbb_reset(struct umass_softc *sc, int status)
|
||||||
|
|
||||||
Static void
|
Static void
|
||||||
umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
|
umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
|
||||||
void *data, int datalen, int dir,
|
void *data, int datalen, int dir, u_int timeout,
|
||||||
transfer_cb_f cb, void *priv)
|
transfer_cb_f cb, void *priv)
|
||||||
{
|
{
|
||||||
static int dCBWtag = 42; /* unique for CBW of transfer */
|
static int dCBWtag = 42; /* unique for CBW of transfer */
|
||||||
|
|
||||||
|
@ -928,6 +928,9 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
|
||||||
("sc->proto == 0x%02x wrong for umass_bbb_transfer\n",
|
("sc->proto == 0x%02x wrong for umass_bbb_transfer\n",
|
||||||
sc->proto));
|
sc->proto));
|
||||||
|
|
||||||
|
/* Be a little generous. */
|
||||||
|
sc->timeout = timeout + USBD_DEFAULT_TIMEOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do a Bulk-Only transfer with cmdlen bytes from cmd, possibly
|
* Do a Bulk-Only transfer with cmdlen bytes from cmd, possibly
|
||||||
* a data phase of datalen bytes from/to the device and finally a
|
* a data phase of datalen bytes from/to the device and finally a
|
||||||
|
@ -1401,8 +1404,8 @@ umass_cbi_reset(struct umass_softc *sc, int status)
|
||||||
|
|
||||||
Static void
|
Static void
|
||||||
umass_cbi_transfer(struct umass_softc *sc, int lun,
|
umass_cbi_transfer(struct umass_softc *sc, int lun,
|
||||||
void *cmd, int cmdlen, void *data, int datalen, int dir,
|
void *cmd, int cmdlen, void *data, int datalen, int dir,
|
||||||
transfer_cb_f cb, void *priv)
|
u_int timeout, transfer_cb_f cb, void *priv)
|
||||||
{
|
{
|
||||||
DPRINTF(UDMASS_CBI,("%s: umass_cbi_transfer cmd=0x%02x, len=%d\n",
|
DPRINTF(UDMASS_CBI,("%s: umass_cbi_transfer cmd=0x%02x, len=%d\n",
|
||||||
USBDEVNAME(sc->sc_dev), *(u_char*)cmd, datalen));
|
USBDEVNAME(sc->sc_dev), *(u_char*)cmd, datalen));
|
||||||
|
@ -1414,6 +1417,9 @@ umass_cbi_transfer(struct umass_softc *sc, int lun,
|
||||||
if (sc->sc_dying)
|
if (sc->sc_dying)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Be a little generous. */
|
||||||
|
sc->timeout = timeout + USBD_DEFAULT_TIMEOUT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do a CBI transfer with cmdlen bytes from cmd, possibly
|
* Do a CBI transfer with cmdlen bytes from cmd, possibly
|
||||||
* a data phase of datalen bytes from/to the device and finally a
|
* a data phase of datalen bytes from/to the device and finally a
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: umassbus.c,v 1.13 2001/11/13 07:56:04 augustss Exp $ */
|
/* $NetBSD: umassbus.c,v 1.14 2001/11/25 19:05:23 augustss Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
* Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: umassbus.c,v 1.13 2001/11/13 07:56:04 augustss Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: umassbus.c,v 1.14 2001/11/25 19:05:23 augustss Exp $");
|
||||||
|
|
||||||
#include "atapibus.h"
|
#include "atapibus.h"
|
||||||
#include "scsibus.h"
|
#include "scsibus.h"
|
||||||
|
@ -339,7 +339,8 @@ umass_scsipi_request(struct scsipi_channel *chan,
|
||||||
sc->sc_xfer_flags = USBD_SYNCHRONOUS;
|
sc->sc_xfer_flags = USBD_SYNCHRONOUS;
|
||||||
sc->bus.sc_sync_status = USBD_INVAL;
|
sc->bus.sc_sync_status = USBD_INVAL;
|
||||||
sc->transfer(sc, periph->periph_lun, cmd, cmdlen,
|
sc->transfer(sc, periph->periph_lun, cmd, cmdlen,
|
||||||
xs->data, xs->datalen, dir, 0, xs);
|
xs->data, xs->datalen, dir, xs->timeout,
|
||||||
|
0, xs);
|
||||||
sc->sc_xfer_flags = 0;
|
sc->sc_xfer_flags = 0;
|
||||||
DPRINTF(UDMASS_SCSI, ("umass_scsi_cmd: done err=%d\n",
|
DPRINTF(UDMASS_SCSI, ("umass_scsi_cmd: done err=%d\n",
|
||||||
sc->bus.sc_sync_status));
|
sc->bus.sc_sync_status));
|
||||||
|
@ -361,7 +362,8 @@ umass_scsipi_request(struct scsipi_channel *chan,
|
||||||
" datalen=%d\n",
|
" datalen=%d\n",
|
||||||
dir, cmdlen, xs->datalen));
|
dir, cmdlen, xs->datalen));
|
||||||
sc->transfer(sc, periph->periph_lun, cmd, cmdlen,
|
sc->transfer(sc, periph->periph_lun, cmd, cmdlen,
|
||||||
xs->data, xs->datalen, dir, umass_scsipi_cb, xs);
|
xs->data, xs->datalen, dir, xs->timeout,
|
||||||
|
umass_scsipi_cb, xs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,7 +478,7 @@ umass_scsipi_cb(struct umass_softc *sc, void *priv, int residue, int status)
|
||||||
sc->transfer(sc, periph->periph_lun,
|
sc->transfer(sc, periph->periph_lun,
|
||||||
&sc->bus.sc_sense_cmd, cmdlen,
|
&sc->bus.sc_sense_cmd, cmdlen,
|
||||||
&xs->sense, sizeof(xs->sense), DIR_IN,
|
&xs->sense, sizeof(xs->sense), DIR_IN,
|
||||||
umass_scsipi_sense_cb, xs);
|
xs->timeout, umass_scsipi_sense_cb, xs);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case STATUS_WIRE_FAILED:
|
case STATUS_WIRE_FAILED:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: umassvar.h,v 1.3 2001/04/17 00:50:13 augustss Exp $ */
|
/* $NetBSD: umassvar.h,v 1.4 2001/11/25 19:05:23 augustss Exp $ */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
|
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
|
||||||
* Nick Hibma <n_hibma@freebsd.org>
|
* Nick Hibma <n_hibma@freebsd.org>
|
||||||
|
@ -139,7 +139,8 @@ typedef void (*transfer_cb_f)(struct umass_softc *sc, void *priv,
|
||||||
typedef void (*wire_reset_f)(struct umass_softc *sc, int status);
|
typedef void (*wire_reset_f)(struct umass_softc *sc, int status);
|
||||||
typedef void (*wire_transfer_f)(struct umass_softc *sc, int lun,
|
typedef void (*wire_transfer_f)(struct umass_softc *sc, int lun,
|
||||||
void *cmd, int cmdlen, void *data, int datalen,
|
void *cmd, int cmdlen, void *data, int datalen,
|
||||||
int dir, transfer_cb_f cb, void *priv);
|
int dir, u_int timeout, transfer_cb_f cb,
|
||||||
|
void *priv);
|
||||||
typedef void (*wire_state_f)(usbd_xfer_handle xfer,
|
typedef void (*wire_state_f)(usbd_xfer_handle xfer,
|
||||||
usbd_private_handle priv, usbd_status err);
|
usbd_private_handle priv, usbd_status err);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue