summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-11-04 13:12:31 +1000
committerDave Airlie <airlied@redhat.com>2014-11-04 13:12:31 +1000
commitfba2c4827864b074c82f275ad39d437217af4c41 (patch)
tree2aaca656d623406137e6357408fd7fb008e9abf9
parent8cf7fe28f26d3508637fc7c9d0fdb9ae97683cc5 (diff)
don't wait for packets
-rw-r--r--dl3.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dl3.c b/dl3.c
index ebc412b..18b6326 100644
--- a/dl3.c
+++ b/dl3.c
@@ -464,6 +464,7 @@ static int send_buffer(libusb_device_handle *handle, int endpoint_out, int endpo
{
unsigned char buf[1024];
int r;
+ int count;
int size;
int len2, len;
gcry_sexp_t km, result;
@@ -539,11 +540,15 @@ static int send_buffer(libusb_device_handle *handle, int endpoint_out, int endpo
if (r != 0)
goto out;
+ count = 4; /* ack, send_Rrx, send_h_prime, send_pairing */
do {
r = block_read_usb(handle, endpoint_in, buf, &size);
if (r < 0)
break;
+ count--;
decode_rx(&info, buf, size);
+ if (count == 0)
+ break;
/* find H' */
} while (1);