Bluetooth: HID: Use dynamic memory instead while sending data

This patch uses dynamic memory allocation while sending HID output data to
remote device depending on size of data to be sent. Without this patch
fixed size static buffer of 200 bytes was being used for sending data to
remote device, which was resulting in crash in case data size to be sent
to remote device was greater than 200 bytes.

Change-Id: I5ed12422355e88d7ef0391668800d7619ca3b685
CRs-Fixed: 566444
Bluetooth: Cleaning up pan_conn DB, if connection is not successful.

A case where DUT is paired with remoteDeviceA &  remoteDeviceB.
remoteDeviceA is not pagable(turned off or some other reason).
DUT(PANU) try to connect remoteDeviceA(NAP). But connection is
unsuccessful, Because remoteDeviceA is not pagable, In this scenario
btpan_conn Database is not cleaning up at btif layer. Later
remoteDeviceB(PANU) connect to DUT(NAP) & connection is succesful,
When remoteDeviceB disconnect existing connection. As database
still has remoteDeviceA BD address at Btif layer. remoteDeviceA
BD address is passed instead of remoteDeviceB BD address from Btif
to UI. So remoteDeviceB still shows connected on UI. Cleaning up
pan_conn database for particular pan connection at BTIF layer,
whichever connection is not successful will solve this issue.

Change-Id: I31dfe3ef46295e74bbfb57563e4fd4fc7155f006
CRs-Fixed: 555310
Bluetooth: Fixes read/write report characteristic for HOGP

This fixes issues to read and write report characterstics
to get the correct report for HIDinput UUID.
Adds logic to read/write rpt/descr/chars for mulitple
instances of HID service

Change-Id: I445fe413a11cb88c23bf4964ea08de1a9879d4c8
CRs-Fixed: 563295,557628,557656,562073
Merge "Bluetooth: Cleaning up pan_conn DB, if connection is not successful."
Merge "Bluetooth: HID: Use dynamic memory instead while sending data"
Bluetooth: HID: Use dynamic memory while sending report

This patch uses dynamic memory allocation while sending HID output data to
remote device depending on size of data to be sent. Without this patch
fixed size static buffer of 200 bytes was being used for sending data to
remote device, which was resulting in crash in case data size to be sent
to remote device was greater than 200 bytes.

CRs-Fixed: 568112
Change-Id: Icc8cd4a4ecfd4bc30cbf848a7c865fcf9308ddf8
Bluetooth: HID: Serialize L2CAP disconnection

This patch serializes host initiated hid disconnection by sending
control channel disconnect request only when disconnection response
for interrupt channel has been received. Also to prevent IOT issues
link policy is updated to disable sniff when hid disconnection is
in progress.

Change-Id: Ie0c5c62593bb0dd32f83b76bf0d6c1d950f1a684
CRs-Fixed: 568111
Bluetooth: HID: Update HID Device name to actual device name

This patch sets the HID Remote Device name while adding hid driver in
kernel instead of using hardcoded name "Broadcom Bluetooth HID".

Change-Id: I0755d6e51507121b037e0baff166abe578480456
CRs-Fixed: 566241
Bluetooth: HID: Synchronize access to uhid open and close API's

This patch synchronizes access to uhid open and close API's by calling
both from BTA context. Moving to btif context for uhid close was causing
lot of issues since the close was in some cases executed after a new
uhid open was processed because of delay in change in context from BTA
to BTIF context. To fix issues of glitch in A2DP while disconnecting
HID, poll timeout is reduced to 50 ms so that uhid poll thread can be
closed within 50 ms max thereby keeping max block time in BTA thread to
50 ms. Also some additional logging is added in code to provide better
debugging in future wrt uhid open and closei API's.

Change-Id: Id4f30f16d51994bf19d11b8472320b818fe31115
CRs-Fixed: 567656
Merge "Bluetooth: HID: Use dynamic memory while sending report"
Merge "Bluetooth: HID: Serialize L2CAP disconnection"
Merge "Bluetooth: HID: Update HID Device name to actual device name"
Merge "Bluetooth: HID: Synchronize access to uhid open and close API's"
Bluetooth: Generalize bluedroid for smd and uart based soc's

Remove compile time dependency to use bluedroid for SMD
based soc or uart based soc.

Change-Id: Ibb5ec04577af19b70bf0320db6e6349f2d3a079f
Bluedroid: Add support to send h/w error event.

Bluedroid stack needs to be reset whenever H/w chip restarts
like Subsytem restart.

CRs-fixed: 514760
Change-Id: I5888f0c7a29eb540b77c789774d672180f330168
bluetooth: Added IBS feature to support ROME.

Inband Sleep Tx and Rx supported in H4 layer for ROME

Change-Id: I193785c470b581414cd86d05791482c49c45f439
CRs-fixed: 540383
Bluetooth: Add SIBS Macro to enable or disable based on a target

Based on a target, the bluetooth chipset can suppourt software
Inband sleep or not. So, SIBS feature should be controllable
to enable or disable base on a target

Change-Id: Ib8c20017f2ddcd22005d361e3b2ad1045e386b4d
CRs-fixed: 549989
Bluetooth: Check A2dp device priority.

Check for device priority in stack before sending connect
request on time-out for remote open event.

Change-Id: I191f5f3089d7945cbd6facc223a341452462421c
CRs-Fixed: 510957
Bluetooth: HID: Parse paired hid devices from bluez.

This patch adds support for parsing SDP records of paired HID devices
from bluez device storage path and store the parsed hid sdp data into
bluedroid storage path. Without this patch, it was not possible to
have paired HID devices during upgrade from BlueZ to Bluedroid Stack.

Change-Id: I7db4a801f3cf9ca46fc0eabfd929e8d7c16b5edb
CRs-Fixed: 566605
Merge "Bluetooth: HID: Parse paired hid devices from bluez."