Patching btusb to enable compatibility with the BCM20702A0 chip

I just recently built a brand new machine and noticed that I wasn’t seeing my Bluetooth chip. After a bunch of digging, I found that my Broadcom combo chip which came with my ASUS Maximus V motherboard hosted both a BCM43228 WiFi module and a BCM20702A0 Bluetooth module. Stranger still is that the Bluetooth chip is actually an embedded USB device running on the PCI port.

In any case, due to Ubuntu/upstream kernel backports policy, it doesn’t look like a fix will be backported down to current versions of the Linux kernel and it seems that this patch won’t be included till kernel 3.8, which is a long way away as I sit here typing on kernel 3.2. After a bunch of hacking, I finally came up with a way to activate the card and use it, and have also came up with a DKMS module for the patch so that kernel updates won’t break the patch. This may void your warranty and I accept no responsibility for anything, at all, ever. This is written for Debian and Ubuntu derivatives, but may work on other distributions.

Before doing anything, verify that you have the same card as me before you go through any of this madness. Make sure that if you run lsusb | grep "0b05:17b5", you see some output. If you don’t, you’re don’t have the same card as me and this fix won’t help you at all.

First, download your build environment for building the Linux kernel.

sudo apt-get install build-essential linux-headers-$(uname -r)
apt-get source linux-source 3.2.0

Don’t run that second line as root. Note that I didn’t write sudo apt-get source linux-source-3.2.0. I wrote apt-get source linux-3.2.0 and I meant it. It’s not a typo.

Now, cd into your new kernel source directory: ./linux-source-3.2.0. We’re going to manually patch the btusb driver in order to enable support for our card. Open up ./drivers/bluetooth/btusb.c in your favorite editor and find a line that looks like this:

/* Broadcom BCM20702A0 */

Immediately underneath that line, add the following line:

{ USB_DEVICE(0x0b05, 0x17b5) }

This will match your Bluetooth card’s hardware id.

Now, download the Bash scripts and DKMS configuration file from this Gist and put them in your current Linux kernel source directory. Make sure to chmod +x *.sh to enable the Bash scripts to run.

Finally, copy over everything in this directory to /usr/src/btusb-0.6. We’ll now test building the module. If everything went correctly, the following two commands will build and install the kernel module, restarting Bluetooth in the process, allowing you to see your beautiful Bluetooth card:

sudo dkms build -m btusb -v 0.6
sudo dkms install -m btusb -v 0.6

Now, enjoy your Bluetooth chip. Seriously.

6 thoughts on “Patching btusb to enable compatibility with the BCM20702A0 chip

  1. Pingback: TK Kocheran

  2. In your article, you stated that your bluetooth device had an ID of 0b05:e042 yet in the patch to the bluetooth.c file, you added 0x0b05, 0x17b5.

    Was this a mistake?

    If not can you explain the relationship between the two differing values?

  3. Thanks for this–I was looking for a coherent way of adding my laptop’s built in adaptor to the current driver. I’ve heard of stuff like this (use of dkms) but haven’t had time or necessity to use it yet. Very cool.
    lsusb shows:
    Bus 002 Device 003: ID 13d3:3411 IMC Networks
    –but it is a BCM 20702A0 chip (not IMC whatever). These need a “rampatch” (firmware?) to work correctly, based on a file that can be pulled from the windows driver. I don’t know where the file is in linux, but it seems to work annyway. The line I added to btusb.c looked like:
    { USB_DEVICE(0x13d3, 0×3411), .driver_info = BTUSB_BCM_PATCHRAM },
    –and I adjusted the install script for the ID numbers accordingly.
    Two things: it’s not clear from your instructions, the dkms script files go in the “bottom” of the kernel source directory, and not where I first stumbled about by placing them in the /drivers/bluetooth/ directory, which didn’t work.
    Also , I ran into a string of strange errors using sudo with dkms. I finally got it to install the module by executing sudo -i, and then running the dkms commands from a root prompt. Otherwise I got complaints that version 0.6 was already installed, it ignored –force, and things went in circles for a while.
    A question: is it really necessary to have the entire kernel source untarred in /usr/src to build this one module?
    Thanks again!

    • I’m actually not completely sure whether it’s necessary to have the full kernel source, but I would assume so.

      I also remember having to do some strange hacks to get DKMS working, so thanks for your comment which may make it easier for someone in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>