summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpPacket.cpp
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-02-14 08:07:50 -0500
committerMike Lockwood <lockwood@android.com>2011-02-14 08:17:44 -0500
commit321aa99762dba7e5a4c60dc4087409c3c59f58a6 (patch)
tree0323c594087d69e4df0f24e409cedae6ea2e0c1a /media/mtp/MtpPacket.cpp
parent7265d9bd6d80c5bedaa6de2b80f6619a301a07c8 (diff)
downloadframeworks_base-321aa99762dba7e5a4c60dc4087409c3c59f58a6.zip
frameworks_base-321aa99762dba7e5a4c60dc4087409c3c59f58a6.tar.gz
frameworks_base-321aa99762dba7e5a4c60dc4087409c3c59f58a6.tar.bz2
MTP host: Use usb_device_bulk_transfer for synchronous transfers
Change-Id: Icf42ea0e5a848cee1565da49713ee9ad0db9f1a6 Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp/MtpPacket.cpp')
-rw-r--r--media/mtp/MtpPacket.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/media/mtp/MtpPacket.cpp b/media/mtp/MtpPacket.cpp
index d3f2cb4..baf99e5 100644
--- a/media/mtp/MtpPacket.cpp
+++ b/media/mtp/MtpPacket.cpp
@@ -153,12 +153,13 @@ void MtpPacket::setParameter(int index, uint32_t value) {
#ifdef MTP_HOST
int MtpPacket::transfer(struct usb_request* request) {
- if (usb_request_queue(request)) {
- LOGE("usb_endpoint_queue failed, errno: %d", errno);
- return -1;
- }
- request = usb_request_wait(request->dev);
- return (request ? request->actual_length : -1);
+ int result = usb_device_bulk_transfer(request->dev,
+ request->endpoint,
+ request->buffer,
+ request->buffer_length,
+ 0);
+ request->actual_length = result;
+ return result;
}
#endif