hciattach: fix the delay timer for bcm43xx firmware download 17/162517/1 accepted/tizen/unified/20171207.070140 submit/tizen/20171206.015028
authorAndy Duan <fugang.duan@nxp.com>
Thu, 20 Jul 2017 13:14:59 +0000 (16:14 +0300)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 4 Dec 2017 05:21:50 +0000 (14:21 +0900)
From the log in .bcm43xx_load_firmware():
        /* Wait 50ms to let the firmware placed in download mode */
        nanosleep(&tm_mode, NULL);

But timespec tm_mode is real is 50us. Correct the delayed timer count.

[lhs: Cherry-Picked from
 git://git.kernel.org/pub/scm/bluetooth/bluez.git
 commit 76255f732d68aef2b90d36d9c7be51a9e1739ce7]

Change-Id: I52dfa83c0f7e0cdf17fa24ade36fc88716f56b05
Signed-off-by: Hackseung Lee <lhs@dignsys.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
tools/hciattach_bcm43xx.c

index 0d4caf1..44247c1 100755 (executable)
@@ -232,8 +232,8 @@ static int bcm43xx_set_speed(int fd, struct termios *ti, uint32_t speed)
 static int bcm43xx_load_firmware(int fd, const char *fw)
 {
        unsigned char cmd[] = { HCI_COMMAND_PKT, 0x2e, 0xfc, 0x00 };
-       struct timespec tm_mode = { 0, 50000 };
-       struct timespec tm_ready = { 0, 2000000 };
+       struct timespec tm_mode = { 0, 50000000 };
+       struct timespec tm_ready = { 0, 200000000 };
        unsigned char resp[CC_MIN_SIZE];
        unsigned char tx_buf[1024];
        int len, fd_fw, n;