Skip to contentSkip to conversation

hciattach: add fixed delay between brf actions for texas devices

PATCH New Martin Hundebøll 1 participant 1 message Apr 7, 2016 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hciattach: add fixed delay between brf actions for texas devices

Add a small delay between doing brf action to avoid stalling the device and thus failing initialization.

This is tested with wl1835 on a custom mx28 board running mainline linux-4.4

Without the delay, hciattach fails like this:

~ # ./hciattach ttyAPP1 texas 3000000 flow
Found a Texas Instruments' chip!
Firmware file : /lib/firmware/ti-connectivity/TIInit_11.8.32.bts Sending script to serial device
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1 Initialization timed out. CCCCCCCCCCCCCCCCCCWRCWRCCWRCSCCCWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRW RWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWR WRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRW RWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRCWRCWRCWRCWRCCCCCCWRCWRCCCCCCCCCCWRWRW RWRWRWRWRWRCCCCCCCCCCCCCCCCCWRCCCCCCWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRW RWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWR WRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRW RWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRCCCCCWRWRW RWRWRCCCCCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRCWRC WRCWRCCCWRCCCCCCCCCCCCCCCCCCCCCCCCCCW

---
 tools/hciattach_ti.c | 3 +++
 1 file changed, 3 insertions(+)
tools/hciattach_ti.c +3 -0
index 828dd61..1935781 100644
@@ -345,6 +345,9 @@ static int brf_do_action(uint16_t brf_type, uint8_t *brf_action, long brf_size,
 		break;
 	}
 
+	/* sleep here to avoid overwhelming the device leading to a timeout */
+	usleep(1000);
+
 	return ret;
 }
 
Signature · 1 line
2.8.0