Quirk for a USB mass storage device

Pawel Jakub Dawidek pjd at FreeBSD.org
Sat Oct 29 18:38:56 UTC 2011


On Sat, Oct 29, 2011 at 08:51:15AM +0200, Hans Petter Selasky wrote:
> On Friday 28 October 2011 17:08:18 Gustau Pérez wrote:
> > >>   Do you want the patch? I can generate it in a second if you wish.
> > > 
> > > Yes, please do.
> > 
> >    This one applies over both current and 9.0RC1.
> > 
> >    Gus
> 
> Hi Pawel and Gustau,
> 
> Can you both clean out your own patches and try the attached one?

Unfortunately it doesn't fix the problem for me. There is no change
after applying the patch.

The modules I have loaded:

	ehci
	usb
	umass
	(usb_quirk)

As for the patch itself:

> --- sys/dev/usb/usb_msctest.c	(revision 226805)
> +++ sys/dev/usb/usb_msctest.c	(local)
> @@ -603,6 +603,29 @@
>  	return (is_cdrom);
>  }
>  
> +static uint8_t
> +usb_msc_get_max_lun(struct usb_device *udev, uint8_t iface_index)
> +{
> +	struct usb_device_request req;
> +	usb_error_t err;
> +	uint8_t buf = 0;
> +
> +
> +	/* The Get Max Lun command is a class-specific request. */
> +	req.bmRequestType = UT_READ_CLASS_INTERFACE;
> +	req.bRequest = 0xFE;		/* GET_MAX_LUN */
> +	USETW(req.wValue, 0);
> +	req.wIndex[0] = iface_index;
> +	req.wIndex[1] = 0;
> +	USETW(req.wLength, 1);
> +
> +	err = usbd_do_request(udev, NULL, &req, &buf);
> +	if (err)
> +		buf = 0;
> +
> +	return (buf);
> +}

You could drop 'err' variable and just check function return directly.
There is only one extra empty line at the begining of the function.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-usb/attachments/20111029/55319e5f/attachment.pgp


More information about the freebsd-usb mailing list