diff options
author | Hervé Poussineau <hpoussin@reactos.org> | 2016-02-07 21:34:08 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:45:29 -0600 |
commit | 09c4c2746f962b859167ad46abe270d4674324cb (patch) | |
tree | a2cc0aa89fc36e1b517ee94300defefeef9f16b2 /hw/input | |
parent | 6f9e78529b4adbf57232f5c806be70ce4724ec83 (diff) | |
download | hqemu-09c4c2746f962b859167ad46abe270d4674324cb.zip hqemu-09c4c2746f962b859167ad46abe270d4674324cb.tar.gz |
cuda: port SET_DEVICE_LIST command to new framework
Also implement the command, by taking device list mask into account
when polling ADB devices.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/input')
-rw-r--r-- | hw/input/adb.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/input/adb.c b/hw/input/adb.c index c384856..f0ad0d4 100644 --- a/hw/input/adb.c +++ b/hw/input/adb.c @@ -89,7 +89,7 @@ int adb_request(ADBBusState *s, uint8_t *obuf, const uint8_t *buf, int len) } /* XXX: move that to cuda ? */ -int adb_poll(ADBBusState *s, uint8_t *obuf) +int adb_poll(ADBBusState *s, uint8_t *obuf, uint16_t poll_mask) { ADBDevice *d; int olen, i; @@ -100,13 +100,15 @@ int adb_poll(ADBBusState *s, uint8_t *obuf) if (s->poll_index >= s->nb_devices) s->poll_index = 0; d = s->devices[s->poll_index]; - buf[0] = ADB_READREG | (d->devaddr << 4); - olen = adb_request(s, obuf + 1, buf, 1); - /* if there is data, we poll again the same device */ - if (olen > 0) { - obuf[0] = buf[0]; - olen++; - break; + if ((1 << d->devaddr) & poll_mask) { + buf[0] = ADB_READREG | (d->devaddr << 4); + olen = adb_request(s, obuf + 1, buf, 1); + /* if there is data, we poll again the same device */ + if (olen > 0) { + obuf[0] = buf[0]; + olen++; + break; + } } s->poll_index++; } |