Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Oct 2011 20:38:07 +0200
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Quirk for a USB mass storage device
Message-ID:  <20111029183807.GF1713@garage.freebsd.pl>
In-Reply-To: <201110290851.15130.hselasky@c2i.net>
References:  <4EA9127E.80504@entel.upc.edu> <201110281549.15561.hselasky@c2i.net> <4EAAC562.3000201@entel.upc.edu> <201110290851.15130.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--v2Uk6McLiE8OV1El
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 29, 2011 at 08:51:15AM +0200, Hans Petter Selasky wrote:
> On Friday 28 October 2011 17:08:18 Gustau P=E9rez wrote:
> > >>   Do you want the patch? I can generate it in a second if you wish.
> > >=20
> > > Yes, please do.
> >=20
> >    This one applies over both current and 9.0RC1.
> >=20
> >    Gus
>=20
> Hi Pawel and Gustau,
>=20
> 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);
>  }
> =20
> +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 =3D 0;
> +
> +
> +	/* The Get Max Lun command is a class-specific request. */
> +	req.bmRequestType =3D UT_READ_CLASS_INTERFACE;
> +	req.bRequest =3D 0xFE;		/* GET_MAX_LUN */
> +	USETW(req.wValue, 0);
> +	req.wIndex[0] =3D iface_index;
> +	req.wIndex[1] =3D 0;
> +	USETW(req.wLength, 1);
> +
> +	err =3D usbd_do_request(udev, NULL, &req, &buf);
> +	if (err)
> +		buf =3D 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.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--v2Uk6McLiE8OV1El
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk6sSA4ACgkQForvXbEpPzQ1QgCeJlnUiRusw856glnkDlordyWn
6o0AoNjZsaSWnIXA8jcchq+7jAnCk5YY
=CL+S
-----END PGP SIGNATURE-----

--v2Uk6McLiE8OV1El--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111029183807.GF1713>