[USB] JetFlash TS1GJF2B 2.00 Attempt to query devicesizefailed: UNIT ATTENTION

Barry Bouwsma freebsd-misuser at remove-NOSPAM-to-reply.NOSPAM.dyndns.dk
Tue Jan 11 06:07:59 PST 2005

On Tue, 11 Jan 2005 21:53:40 +1030, "Wilkinson, Alex" wrote:

>     >This is an unscientific trial-and-error thing, but if it's gotten me
>     >results, it can't be all bad, given that I have no clue what I'm doing,
>     >no?  (Three of my devices have gotten quirks this way)

> Okay, well then where do I find out how to add a quirk that skips the
> 'READ CAPACITY' command ?

Use the existing quirk entries in umass.c as a reference.  Simply
copy one of them, change the product to match your device, and
adjust to fit.

Here's an example of what I've added to add a new quirks entry for
an external drive, that speeds up boots by not waiting until one
particular command fails:

/* XXX HACK */

If your product and vendor IDs are already in usbdevs(*.h), then
it's a matter of tweaking the quirks (NO_GETMAXLUN in the above
example); alternatively your protocol could be wrong, in which
case you might see results by tweaking the PROTO strings given.

Look at the other products in this area for a feel of how it's

If your product isn't in usbdevs, then you can either add it to
your usbdevs and regenerate the .h files if needed, and submit
your addition up to the developers if it's necessary for your
quirk, or more quickly, you can use the ID values directly,
values that you see either in dmesg or via usbdevs or another
usb utility.

For exmaple, without the vendor/product IDs in usbdevs, I'd need
to use a line like
        { 0x0d49, 0x5000, RID_WILDCARD,
and then later, after figuring out which quirks work, adding
a suitable description to usbdevs.

Then go through the various quirks, or cut'n'paste those from
other similar-sounding devices, and for speed, build a module
of umass.ko for each change you make, try it out, and see if
there's any difference.

Julian quoted from cam/scsi quirks, I'm not sure if you would
need to go that far, as there are already some quirks in
sys/dev/usb/umass.c which I've used.  Though in one case, I'd
still see a warning thrown up by CAM that probably could be
ignored or quieted within CAM, where the USB layer returned
the error to CAM rather than letting the device return the
error (and then throw up further errors).

I hope this is what you're asking.  Unfortunately, you'll need
to contact a wizard to learn which quirks affect what errors.

barry bouwsma

More information about the freebsd-usb mailing list