From owner-freebsd-usb@FreeBSD.ORG Sat Oct 29 18:38:56 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91D13106566C for ; Sat, 29 Oct 2011 18:38:56 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 4324B8FC08 for ; Sat, 29 Oct 2011 18:38:56 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 65BD8F93; Sat, 29 Oct 2011 20:38:54 +0200 (CEST) Date: Sat, 29 Oct 2011 20:38:07 +0200 From: Pawel Jakub Dawidek To: Hans Petter Selasky Message-ID: <20111029183807.GF1713@garage.freebsd.pl> References: <4EA9127E.80504@entel.upc.edu> <201110281549.15561.hselasky@c2i.net> <4EAAC562.3000201@entel.upc.edu> <201110290851.15130.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="v2Uk6McLiE8OV1El" Content-Disposition: inline In-Reply-To: <201110290851.15130.hselasky@c2i.net> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-usb@freebsd.org Subject: Re: Quirk for a USB mass storage device X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2011 18:38:56 -0000 --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--