From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtozE-0004M5-SP for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:43:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtozD-0002Oc-Ny for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:43:48 -0500 Date: Wed, 4 Nov 2015 14:12:03 +1100 From: David Gibson Message-ID: <20151104031203.GE21954@voom.redhat.com> References: <1445608598-24485-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1445608598-24485-5-git-send-email-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cPi+lWm09sJ+d57q" Content-Disposition: inline In-Reply-To: <1445608598-24485-5-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH 04/13] cuda.c: fix CUDA ADB error packet format List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: cormac@c-obrien.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --cPi+lWm09sJ+d57q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 23, 2015 at 02:56:29PM +0100, Mark Cave-Ayland wrote: > ADB error packets should be of the form (type, status, cmd) rather than j= ust > (type, status). This fixes ADB device detection under MacOS 9. Hmm.. are there any public doc on these ADB / CUDA things that we can look up to compare to? >=20 > Signed-off-by: Mark Cave-Ayland > --- > hw/misc/macio/cuda.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c > index 5d7043e..9ec19af 100644 > --- a/hw/misc/macio/cuda.c > +++ b/hw/misc/macio/cuda.c > @@ -560,19 +560,21 @@ static void cuda_receive_packet_from_host(CUDAState= *s, > switch(data[0]) { > case ADB_PACKET: > { > - uint8_t obuf[ADB_MAX_OUT_LEN + 2]; > + uint8_t obuf[ADB_MAX_OUT_LEN + 3]; > int olen; > olen =3D adb_request(&s->adb_bus, obuf + 2, data + 1, len - = 1); > if (olen > 0) { > obuf[0] =3D ADB_PACKET; > obuf[1] =3D 0x00; > + cuda_send_packet_to_host(s, obuf, olen + 2); > } else { > /* error */ > obuf[0] =3D ADB_PACKET; > obuf[1] =3D -olen; > + obuf[2] =3D data[1]; > olen =3D 0; > + cuda_send_packet_to_host(s, obuf, olen + 3); Using 'olen + 3' seems confusing here, rather than just '3', since you just set olen =3D 0. > } > - cuda_send_packet_to_host(s, obuf, olen + 2); > } > break; > case CUDA_PACKET: --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --cPi+lWm09sJ+d57q Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWOXeDAAoJEGw4ysog2bOS1ocQAOe4fw+piWtpnWBC6002w8x8 KHQY9kC9B3mT5BP7o3xaH0VvNwsB5rOr8oWZuaNq5ZWN0OG63HhoIQHUq0Vl0/fn Gnm3dHernELW7iQUfyygCfBKiDDmrO1QL3rR59ec8luLMSgX5WgZFJAWatnOtSx9 lLaGf9W4dbP34jCSU8Il/61+gckihIgevC5tYyhXveksm29tETXg1TPZaL2C/GUM g5NV64SE1vz80jsg6doeLf2lT1sazU+TI6eMKZNxEsXXkZ5+s9VU9iOnDpIj204N e6OOTRoo8GT/Lh9ElM51Kt9IomJHgSjYFwQ64VlQ6eSc7MJTjs1gM8Hqma2uneMW 0znn1EJJPkrHW/bXD7yPeCwxmUi77bkMc/aqbHmbBn6QgKEGuOvIDDPhvOdtt4a0 BeMrtbxGxC62HreuCddwKCBeu5PcdFZ+YlQPMNxaF54op3js1IfFRfkALd8YBeez wpo1U2jtaxkFjqVJH4Hk1Aa7BmTYjf+pZ9aYO4T7kRNkG547JOXJ0s5ak/vuIxhy 2h8V6bF5lnY6G3DScZfn+TJij84Cp37CwptDiu8WykGD4Oj582yFYhRhBn9/taPh +2AzbkRKVw7STnemvTN40MNzyb4vOKOGZVYdXIGZ9QH/U7a+pHe8RoVOtf934VXa +GQeX+UGch1c26QDop4y =NhDn -----END PGP SIGNATURE----- --cPi+lWm09sJ+d57q--