mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
cuda.c: fix CUDA ADB error packet format
According to MOL, ADB error packets should be of the form (type, status, cmd) rather than just (type, status). This fixes ADB device detection under MacOS 9. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
72f1f97d49
commit
6729aa4013
1 changed files with 4 additions and 2 deletions
|
@ -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 = adb_request(&s->adb_bus, obuf + 2, data + 1, len - 1);
|
||||
if (olen > 0) {
|
||||
obuf[0] = ADB_PACKET;
|
||||
obuf[1] = 0x00;
|
||||
cuda_send_packet_to_host(s, obuf, olen + 2);
|
||||
} else {
|
||||
/* error */
|
||||
obuf[0] = ADB_PACKET;
|
||||
obuf[1] = -olen;
|
||||
obuf[2] = data[1];
|
||||
olen = 0;
|
||||
cuda_send_packet_to_host(s, obuf, olen + 3);
|
||||
}
|
||||
cuda_send_packet_to_host(s, obuf, olen + 2);
|
||||
}
|
||||
break;
|
||||
case CUDA_PACKET:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue