Bluetooth compat

Compat Drivers Location
Bluetooth Compat drivers are hosted at (bluetooth-compat) under the folder bluetooth-compat.

Building Bluetooth Compat Drivers
Set the following environment variables,

export ARCH=arm export CROSS_COMPILE=/path/to/arm-none-linux-gnueabi- export KLIB=/path/to/kernel/ export KLIB_BUILD=/path/to/kernel/

Build the drivers by providing this simple make command,

make

Drivers built
Bluetooth Compat drivers have been configured to build the following drivers only, hardware/ti/wpan/bluetooth-compat$ find ./ -iname *.ko ./compat/compat.ko ./net/bluetooth/bnep/bnep.ko ./net/bluetooth/rfcomm/rfcomm.ko ./net/bluetooth/bluetooth.ko ./net/bluetooth/hidp/hidp.ko ./drivers/bluetooth/hci_vhci.ko ./drivers/bluetooth/btmrvl.ko ./drivers/bluetooth/btwilink.ko

Drivers Installation
The below mentioned drivers need to be installed into the /system/lib/modules/ of the target AFS,

cp -v   ./net/bluetooth/bnep/bnep.ko                $TARGET_FS/system/lib/modules/ cp -v   ./net/bluetooth/rfcomm/rfcomm.ko     $TARGET_FS/system/lib/modules/ cp -v   ./net/bluetooth/bluetooth.ko                    $TARGET_FS/system/lib/modules/ cp -v   ./net/bluetooth/hidp/hidp.ko                   $TARGET_FS/system/lib/modules/ cp -v   ./drivers/bluetooth/btwilink.ko                $TARGET_FS/system/lib/modules/

Boot up time insertion into the kernel
These drivers needs to be insmod-ed during the boot-up of the Android FS. The following entries are in the init.rc that shall insert the modules into kernel with the relevant options.

insmod /system/lib/modules/bluetooth.ko force_acl_master=1 enable_mgmt=1 enable_le=1 insmod /system/lib/modules/rfcomm.ko insmod /system/lib/modules/hidp.ko insmod /system/lib/modules/bnep.ko insmod /system/lib/modules/btwilink.ko
 * 1) insert bluetooth modules

bluetooth-compat generation/configuration
You would need the following trees to generate the bluetooth-compat folder that is currently hosted on hardware/ti/wpan.git export GIT_TREE=/path/to/bluetooth-next/tree export GIT_COMPAT_TREE=/path/to/compat/tree & the compat-wireless tree itself, where the drivers are generated. Run the following commands to generate the compat-wireless folder that can be copied into the bluetooth-compat location, cd compat-wireless . ./scripts/admin-refresh.sh . ./scripts/drivers-select bt vim config.mk --> edit the config.mk to maintain only the required modules

Necessity of bluetooth-compat & Switch to BlueTI
bluetooth-compat is required to enable the BlueTI stack which is a TI developed stack on top of BlueZ. To switch a product from BlueZ to use BlueTI, You can follow these steps:  BLUETI_ENHANCEMENT compile time switch By enabling the below mentioned change, BlueTI components starts to get built. diff --git a/BoardConfig.mk b/BoardConfig.mk index 8834375..4434394 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -19,6 +19,7 @@ BOARD_USES_GENERIC_AUDIO := false USE_CAMERA_STUB := true OMAP_ENHANCEMENT := true +BLUETI_ENHANCEMENT := true ENHANCED_DOMX := true @@ -85,6 +86,9 @@ COMMON_GLOBAL_CFLAGS += -DOMAP_ENHANCEMENT -DTARGET_OMAP4 ifdef NFC_TI_DEVICE COMMON_GLOBAL_CFLAGS += -DNFC_JNI_TI_DEVICE endif +ifdef BLUETI_ENHANCEMENT +COMMON_GLOBAL_CFLAGS += -DBLUETI_ENHANCEMENT +endif endif blueti_enhancement run time switch Enable the following in your system.prop or built build.prop to enable the runtime components of blueti_enhancement to be true, diff --git a/system.prop b/system.prop index ddc52b1..99711bd 100644 --- a/system.prop +++ b/system.prop @@ -1,2 +1,3 @@ wifi.interface=wlan0 com.ti.omap_enhancement=true +com.ti.blueti_enhancement=true  check up on the manifest  Check whether the following trees are being repo-synced to your source code via the manifests? +<! BlueTI trees --> +  +  +  +  build bluetooth in kernel as modules  The following change in your local defconfig of the kernel should allow bluetooth in kernel to be built as modules, CONFIG_NET_ACT_MIRRED=y -CONFIG_BT=y +CONFIG_BT=m CONFIG_BT_L2CAP=y CONFIG_BT_SCO=y -CONFIG_BT_RFCOMM=y +CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y -CONFIG_BT_BNEP=y -CONFIG_BT_HIDP=y -CONFIG_BT_WILINK=y +CONFIG_BT_BNEP=m +# CONFIG_BT_BNEP_MC_FILTER is not set +# CONFIG_BT_BNEP_PROTO_FILTER is not set +CONFIG_BT_HIDP=m +CONFIG_BT_WILINK=m The follow the instructions (here) to build and install the modules in the file-system. 
 * 1) Use the non-open-source parts, if they're present
 * 2) -include vendor/ti/omap5sevm/BoardConfigVendor.mk
 * 1) CONFIG_CFG80211_WEXT is not set