From 7b741ad1e1fd3d6ad3c2e63e4abd06d10e6c0d09 Mon Sep 17 00:00:00 2001 From: pramod kotreshappa Date: Fri, 10 Jul 2015 16:32:54 -0700 Subject: Bluetooth: Fix to avoid hci event getting flushed Fix to to avoid valid hci event for baudrate change getting flushed while changing local baudrate. SoC is sending event during flow off,which is not expected by the host. Host as part of baud rate changes calls tcflush to flush any persistant data. During this process valid hci event is getting flushed casuing BT on failure. Change-Id: I937ce5e6578a061cfd52560fdbb65876e1e8d0f6 --- libbt-vendor/src/hci_uart.c | 2 +- libbt-vendor/src/hw_rome.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libbt-vendor/src/hci_uart.c b/libbt-vendor/src/hci_uart.c index 2fbba95..8c636cf 100644 --- a/libbt-vendor/src/hci_uart.c +++ b/libbt-vendor/src/hci_uart.c @@ -357,7 +357,7 @@ void userial_vendor_set_baud(uint8_t userial_baud) cfsetospeed(&vnd_userial.termios, tcio_baud); cfsetispeed(&vnd_userial.termios, tcio_baud); tcsetattr(vnd_userial.fd, TCSADRAIN, &vnd_userial.termios); /* don't change speed until last write done */ - tcflush(vnd_userial.fd, TCIOFLUSH); +// tcflush(vnd_userial.fd, TCIOFLUSH); } /******************************************************************************* diff --git a/libbt-vendor/src/hw_rome.c b/libbt-vendor/src/hw_rome.c index aa672a5..1464819 100644 --- a/libbt-vendor/src/hw_rome.c +++ b/libbt-vendor/src/hw_rome.c @@ -1440,7 +1440,7 @@ int rome_set_baudrate_req(int fd) /* Total length of the packet to be sent to the Controller */ size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + VSC_SET_BAUDRATE_REQ_LEN); - + tcflush(fd,TCIOFLUSH); /* Flow off during baudrate change */ if ((err = userial_vendor_ioctl(USERIAL_OP_FLOW_OFF , &flags)) < 0) { -- cgit v1.2.3