From 870fb2619d1ddecef84f374e37e94a76d24cf1d7 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 27 Apr 2012 15:03:58 +0200 Subject: [PATCH] csr_bcsp: fix link establishment The current link-establishment implementation times out if a packet is not received after the link is active (i.e. reception of CONF_RESP). Fix by making sure that the link establishment loop in open is terminated when ubcsp sets the UBCSP_PACKET_SENT flag (on reception of CONF_RESP) rather than UBCSP_PACKET_RECEIVED (on reception of any later packages). --- tools/csr_bcsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/csr_bcsp.c b/tools/csr_bcsp.c index 7bfaf5a90..f7afe537c 100644 --- a/tools/csr_bcsp.c +++ b/tools/csr_bcsp.c @@ -118,7 +118,7 @@ int csr_open_bcsp(char *device, speed_t bcsp_rate) while (1) { delay = ubcsp_poll(&activity); - if (activity & UBCSP_PACKET_RECEIVED) + if (activity & UBCSP_PACKET_SENT) break; if (delay) { -- 2.47.3