Commit 63867af3 authored by Robert Sprowson's avatar Robert Sprowson

Update a few versions

Contemporary with umass.c revision 1.123 from NetBSD. This is the latest version we can take without needing to make changes to USBDriver to reflect additions to the usb_attach_args struct (short of having a local copy which overrides it).

Version 0.26. Tagged as 'SCSISoftUSB-0_26'
parent 634df397
/* (0.25)
/* (0.26)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.25
#define Module_MajorVersion_CMHG 0.26
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Jul 2018
#define Module_Date_CMHG 13 Apr 2019
#define Module_MajorVersion "0.25"
#define Module_Version 25
#define Module_MajorVersion "0.26"
#define Module_Version 26
#define Module_MinorVersion ""
#define Module_Date "13 Jul 2018"
#define Module_Date "13 Apr 2019"
#define Module_ApplicationDate "13-Jul-18"
#define Module_ApplicationDate "13-Apr-19"
#define Module_ComponentName "SCSISoftUSB"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/SCSI/SCSISoftUSB"
#define Module_FullVersion "0.25"
#define Module_HelpVersion "0.25 (13 Jul 2018)"
#define Module_LibraryVersionInfo "0:25"
#define Module_FullVersion "0.26"
#define Module_HelpVersion "0.26 (13 Apr 2019)"
#define Module_LibraryVersionInfo "0:26"
/* $NetBSD: umass.c,v 1.112 2004/06/22 12:21:04 mycroft Exp $ */
/* $NetBSD: umass.c,v 1.123 2007/01/09 16:46:02 christos Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
......@@ -142,7 +142,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.112 2004/06/22 12:21:04 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.123 2007/01/09 16:46:02 christos Exp $");
#include "atapibus.h"
#include "scsibus.h"
......@@ -194,7 +194,7 @@ __KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.112 2004/06/22 12:21:04 mycroft Exp $");
#include <stdio.h>
int umassdebug = 0;
char *states[TSTATE_STATES+1] = {
const char *states[TSTATE_STATES+1] = {
/* should be kept in sync with the list at transfer_state */
"Idle",
"BBB CBW",
......@@ -433,12 +433,14 @@ USB_ATTACH(umass)
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
const char *sWire, *sCommand;
char devinfo[1024];
char *devinfop;
usbd_status err;
int i, bno, error;
usbd_devinfo(uaa->device, 0, devinfo, sizeof(devinfo));
devinfop = usbd_devinfo_alloc(uaa->device, 0);
USB_ATTACH_SETUP;
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfop);
usbd_devinfo_free(devinfop);
#endif
sc->sc_udev = uaa->device;
......@@ -536,10 +538,6 @@ USB_ATTACH(umass)
}
}
#ifndef __riscos
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
#endif
switch (sc->sc_wire) {
case UMASS_WPROTO_CBI:
sWire = "CBI";
......@@ -847,10 +845,8 @@ USB_DETACH(umass)
/* Abort the pipes to wake up any waiting processes. */
for (i = 0 ; i < UMASS_NEP ; i++) {
if (sc->sc_pipe[i] != NULL) {
if (sc->sc_pipe[i] != NULL)
usbd_abort_pipe(sc->sc_pipe[i]);
sc->sc_pipe[i] = NULL;
}
}
/* Do we really need reference counting? Perhaps in ioctl() */
......@@ -1136,6 +1132,9 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, const void *cmd, int cmdlen,
sc->sc_wire));
#ifndef __riscos
if (sc->sc_dying)
return;
/* Be a little generous. */
sc->timeout = timeout + USBD_DEFAULT_TIMEOUT;
#endif
......@@ -1731,6 +1730,16 @@ umass_cbi_adsc(struct umass_softc *sc,
("sc->sc_wire == 0x%02x wrong for umass_cbi_adsc\n",
sc->sc_wire));
if ((sc->sc_cmd == UMASS_CPROTO_RBC) &&
(sc->sc_quirks & UMASS_QUIRK_RBC_PAD_TO_12) != 0 && buflen < 12) {
#ifdef __riscos
memset((void *)(buffer + buflen), 0, 12 - buflen);
#else
(void)memset(buffer + buflen, 0, 12 - buflen);
#endif
buflen = 12;
}
sc->sc_req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
sc->sc_req.bRequest = UR_CBI_ADSC;
USETW(sc->sc_req.wValue, 0);
......@@ -1970,8 +1979,7 @@ umass_cbi_state(
(*err =
#endif
umass_setup_transfer(sc, sc->sc_pipe[UMASS_BULKIN],
sc->transfer_data,
sc->transfer_datalen,
sc->data_buffer, sc->transfer_datalen,
#ifdef __riscos
USBD_DATA_IS_SCATTER_LIST)) != USBD_NORMAL_COMPLETION)
#else
......@@ -1995,8 +2003,7 @@ umass_cbi_state(
(*err =
#endif
umass_setup_transfer(sc, sc->sc_pipe[UMASS_BULKOUT],
sc->transfer_data,
sc->transfer_datalen,
sc->data_buffer, sc->transfer_datalen,
#ifdef __riscos
USBD_DATA_IS_SCATTER_LIST)) != USBD_NORMAL_COMPLETION)
#else
......@@ -2197,40 +2204,41 @@ umass_cbi_state(
return;
case TSTATE_CBI_DCLEAR:
if (RISCOSSTAR err) { /* should not occur */
#ifndef __riscos
if (err) /* should not occur */
printf("%s: CBI bulk-%s stall clear failed, %s\n",
USBDEVNAME(sc->sc_dev),
(sc->transfer_dir == DIR_IN? "in":"out"),
usbd_errstr(err));
#endif
umass_cbi_reset(sc, STATUS_WIRE_FAILED
umass_cbi_reset(sc, STATUS_WIRE_FAILED
#ifdef __riscos
, err
, err
#endif
);
);
} else {
sc->transfer_state = TSTATE_IDLE;
sc->transfer_cb(sc, sc->transfer_priv,
sc->transfer_datalen, STATUS_CMD_FAILED);
}
return;
case TSTATE_CBI_SCLEAR:
if (RISCOSSTAR err) { /* should not occur */
#ifndef __riscos
if (err) /* should not occur */
printf("%s: CBI intr-in stall clear failed, %s\n",
USBDEVNAME(sc->sc_dev), usbd_errstr(err));
#else
if (RISCOSSTAR err) { /* should not occur */
umass_cbi_reset(sc, STATUS_WIRE_FAILED, err);
#endif
umass_cbi_reset(sc, STATUS_WIRE_FAILED
#ifdef __riscos
, err
#endif
);
} else {
sc->transfer_state = TSTATE_IDLE;
sc->transfer_cb(sc, sc->transfer_priv,
sc->transfer_datalen, STATUS_CMD_FAILED);
}
#endif
/* Something really bad is going on. Reset the device */
umass_cbi_reset(sc, STATUS_CMD_FAILED
#ifdef __riscos
, err
#endif
);
return;
/***** CBI Reset *****/
......
/* $NetBSD: umass_quirks.c,v 1.64 2003/11/07 01:04:27 kivinen Exp $ */
/* $NetBSD: umass_quirks.c,v 1.71 2007/01/09 16:46:02 christos Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by MAEKAWA Masahide (gehenna@NetBSD.org).
* This code is derived from software contributed to The NetBSD Foundation
* by Charles M. Hannum.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -39,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef __riscos
__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.64 2003/11/07 01:04:27 kivinen Exp $");
__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.71 2007/01/09 16:46:02 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
......@@ -73,6 +75,19 @@ Static usbd_status umass_init_shuttle(struct umass_softc *);
Static void umass_fixup_sony(struct umass_softc *);
#endif
/*
* XXX
* PLEASE NOTE that if you want quirk entries added to this table, you MUST
* compile a kernel with USB_DEBUG, and submit a full log of the output from
* whatever operation is "failing" with ?hcidebug=20 or higher and
* umassdebug=0xffffff. (It's usually helpful to also set MSGBUFSIZE to
* something "large" unless you're using a serial console.) Without this
* information, the source of the problem cannot be properly analyzed, and
* the quirk entry WILL NOT be accepted.
* Also, when an entry is committed to this table, a concise but clear
* description of the problem MUST accompany it.
* - mycroft
*/
#ifdef __riscos
extern const struct umass_quirk umass_quirks[];
#endif
......@@ -139,12 +154,11 @@ Static const struct umass_quirk umass_quirks[] = {
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, NULL
},
{ { USB_VENDOR_SHUTTLE, USB_PRODUCT_SHUTTLE_ORCA },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
UMASS_QUIRK_WRONG_CSWTAG,
0,
UMATCH_VENDOR_PRODUCT,
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, NULL
},
......@@ -155,12 +169,23 @@ Static const struct umass_quirk umass_quirks[] = {
*/
{ { USB_VENDOR_SONY, USB_PRODUCT_SONY_DSC },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
0,
UMASS_QUIRK_RBC_PAD_TO_12,
0,
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, umass_fixup_sony
},
#endif
/*
* Stupid device reports itself as SFF-8070, but actually returns a UFI
* interrupt descriptor. - mycroft, 2004/06/28
*/
{ { USB_VENDOR_SONY, USB_PRODUCT_SONY_CLIE_40_MS },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UFI,
0,
0,
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, NULL
},
/*
* The DiskOnKey does not reject commands it doesn't recognize in a
......@@ -182,6 +207,13 @@ Static const struct umass_quirk umass_quirks[] = {
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, NULL
},
{ { USB_VENDOR_MSYSTEMS, USB_PRODUCT_MSYSTEMS_DISKONKEY3 },
UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
0,
PQUIRK_NOBIGMODESENSE,
UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
NULL, NULL
},
};
#ifdef __riscos
......@@ -248,6 +280,6 @@ umass_fixup_sony(struct umass_softc *sc)
id = usbd_get_interface_descriptor(sc->sc_iface);
if (id->bInterfaceSubClass == 0xff)
sc->sc_cmd = UMASS_CPROTO_SCSI;
sc->sc_cmd = UMASS_CPROTO_RBC;
}
#endif
/* $NetBSD: umassvar.h,v 1.23 2004/03/22 14:55:42 tls Exp $ */
/* $NetBSD: umassvar.h,v 1.25 2007/01/09 16:46:02 christos Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>,
* Nick Hibma <n_hibma@freebsd.org>
......@@ -212,8 +212,9 @@ struct umass_softc {
#define UMASS_CPROTO_ISD_ATA 5
u_int32_t sc_quirks;
#define UMASS_QUIRK_WRONG_CSWSIG 0x00000001
#define UMASS_QUIRK_WRONG_CSWTAG 0x00000002
#define UMASS_QUIRK_WRONG_CSWSIG 0x00000001
#define UMASS_QUIRK_WRONG_CSWTAG 0x00000002
#define UMASS_QUIRK_RBC_PAD_TO_12 0x00000004
u_int32_t sc_busquirks;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment