# Bluetooth and 2.6 kernels

## gmichels

Hi all

I'm trying to get bluetooth working on my box which is currently running 2.6.0-test8-mm1.

All guides on this forum seem to be useful only for 2.4.x kernels, as they mention patches to those kernels and so on. I haven't found anything related to 2.6.x kernels.

So, I tried using the builtin drivers. Loading the bluetooth and hci-usb (I have an usb dongle, supported by bluez) then inserting the dongle returns the following output on the kernel log:

```
Oct 23 10:28:46 [kernel] Bluetooth: Core ver 2.3

Oct 23 10:28:57 [kernel] Bluetooth: HCI USB driver ver 2.4

Oct 23 10:29:38 [kernel] hub 3-0:1.0: new USB device on port 1, assigned address 2

Oct 23 10:29:38 [kernel] hci_usb: probe of 3-1:1.0 failed with error -5
```

I'm pretty much lost here, so any help would be appreciated.

----------

## gmichels

I found some new information and maybe my problem has turned to a compiling problem.

My bluetooth usb dongle is a Keyspan BT-2A. According to BlueZ's hardware support list, my dongle is supported by hci_usb + bluefw since it's based on a Broadcom chipset.

Anyway, I am having troubles compiling bluez-bluefw. Below is the emerge output:

```
gustavo root # emerge bluez-bluefw

Calculating dependencies ...done!

>>> emerge (1 of 1) net-wireless/bluez-bluefw-0.9 to /

>>> md5 src_uri ;-) bluez-bluefw-0.9.tar.gz

>>> Unpacking source...

>>> Unpacking bluez-bluefw-0.9.tar.gz to /var/tmp/portage/bluez-bluefw-0.9/work

>>> Source unpacked.

creating cache ./config.cache

checking whether to enable maintainer-specific portions of Makefiles... no

checking for a BSD compatible install... /bin/install -c

checking whether build environment is sane... yes

checking whether make sets ${MAKE}... yes

checking for working aclocal... found

checking for working autoconf... found

checking for working automake... found

checking for working autoheader... found

checking for working makeinfo... found

checking for gcc... gcc

checking whether the C compiler (gcc -Wall -g -O2 ) works... yes

checking whether the C compiler (gcc -Wall -g -O2 ) is a cross-compiler... no

checking whether we are using GNU C... yes

checking whether gcc accepts -g... yes

checking for a BSD compatible install... /bin/install -c

checking how to run the C preprocessor... gcc -E

checking for sys/io.h... yes

updating cache ./config.cache

creating ./config.status

creating Makefile

creating firmware/Makefile

creating hotplug/Makefile

Making all in firmware

make[1]: Entering directory `/var/tmp/portage/bluez-bluefw-0.9/work/bluez-bluefw-0.9/firmware'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/var/tmp/portage/bluez-bluefw-0.9/work/bluez-bluefw-0.9/firmware'

Making all in hotplug

make[1]: Entering directory `/var/tmp/portage/bluez-bluefw-0.9/work/bluez-bluefw-0.9/hotplug'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/var/tmp/portage/bluez-bluefw-0.9/work/bluez-bluefw-0.9/hotplug'

make[1]: Entering directory `/var/tmp/portage/bluez-bluefw-0.9/work/bluez-bluefw-0.9'

gcc -DPACKAGE=\"bluez-bluefw\" -DVERSION=\"0.9\" -DBT3C_SUPPORT=1  -I. -I.  -I/usr/src/linux/include    -Wall -g -O2 -c bluefw.c

gcc -DPACKAGE=\"bluez-bluefw\" -DVERSION=\"0.9\" -DBT3C_SUPPORT=1  -I. -I.  -I/usr/src/linux/include    -Wall -g -O2 -c usblib.c

In file included from usblib.h:30,

                 from bluefw.c:39:

/usr/src/linux/include/linux/usbdevice_fs.h:49: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:49: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:49: parse error before '*' token

/usr/src/linux/include/linux/usbdevice_fs.h:56: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:56: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:56: parse error before '*' token

/usr/src/linux/include/linux/usbdevice_fs.h:100: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:100: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:100: parse error before '*' token

/usr/src/linux/include/linux/usbdevice_fs.h:109: parse error before '}' token

/usr/src/linux/include/linux/usbdevice_fs.h:116: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:116: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:116: parse error before '*' token

make[1]: *** [bluefw.o] Error 1

make[1]: *** Waiting for unfinished jobs....

In file included from usblib.h:30,

                 from usblib.c:33:

/usr/src/linux/include/linux/usbdevice_fs.h:49: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:49: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:49: parse error before '*' token

/usr/src/linux/include/linux/usbdevice_fs.h:56: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:56: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:56: parse error before '*' token

/usr/src/linux/include/linux/usbdevice_fs.h:100: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:100: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:100: parse error before '*' token

/usr/src/linux/include/linux/usbdevice_fs.h:109: parse error before '}' token

/usr/src/linux/include/linux/usbdevice_fs.h:116: variable or field `__user' declared void

/usr/src/linux/include/linux/usbdevice_fs.h:116: warning: no semicolon at end of struct or union

/usr/src/linux/include/linux/usbdevice_fs.h:116: parse error before '*' token

usblib.c: In function `usb_intr_read':

usblib.c:78: storage size of `urb' isn't known

usblib.c:87: sizeof applied to an incomplete type

usblib.c:87: sizeof applied to an incomplete type

usblib.c:87: sizeof applied to an incomplete type

usblib.c:87: sizeof applied to an incomplete type

usblib.c:78: warning: unused variable `urb'

usblib.c: In function `usb_bulk_read':

usblib.c:109: storage size of `bulk' isn't known

usblib.c:116: sizeof applied to an incomplete type

usblib.c:116: sizeof applied to an incomplete type

usblib.c:116: sizeof applied to an incomplete type

usblib.c:116: sizeof applied to an incomplete type

usblib.c:109: warning: unused variable `bulk'

usblib.c: In function `usb_bulk_write':

usblib.c:121: storage size of `bulk' isn't known

usblib.c:128: sizeof applied to an incomplete type

usblib.c:128: sizeof applied to an incomplete type

usblib.c:128: sizeof applied to an incomplete type

usblib.c:128: sizeof applied to an incomplete type

usblib.c:121: warning: unused variable `bulk'

make[1]: *** [usblib.o] Error 1

make[1]: Leaving directory `/var/tmp/portage/bluez-bluefw-0.9/work/bluez-bluefw-0.9'

make: *** [all-recursive] Error 1

!!! ERROR: net-wireless/bluez-bluefw-0.9 failed.

!!! Function src_compile, Line 24, Exitcode 2

!!! (no error message)
```

I don't have a clue how to solve this, so maybe someone can look at the emerge output and point the error.

Here's some information that might help:

```
gustavo root # uname -r

2.6.0-test7-mm1

gustavo root # gcc --version

gcc (GCC) 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r2, propolice)

gustavo root # grep BT /usr/src/linux/.config

CONFIG_BT=m

CONFIG_BT_L2CAP=m

CONFIG_BT_SCO=m

CONFIG_BT_RFCOMM=m

CONFIG_BT_RFCOMM_TTY=y

CONFIG_BT_BNEP=m

# CONFIG_BT_BNEP_MC_FILTER is not set

# CONFIG_BT_BNEP_PROTO_FILTER is not set

CONFIG_BT_HCIUSB=m

# CONFIG_BT_USB_SCO is not set

# CONFIG_BT_USB_ZERO_PACKET is not set

# CONFIG_BT_HCIUART is not set

# CONFIG_BT_HCIVHCI is not set

gustavo root # lsusb

Bus 003 Device 002: ID 0a5c:2033 Broadcom Corp. BCM2033 Bluetooth

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 002: ID 045e:001e Microsoft Corp. IntelliMouse Explorer

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 001: ID 0000:0000

gustavo root # dmesg

----snip----

Bluetooth: Core ver 2.3

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: HCI USB driver ver 2.4

drivers/usb/core/usb.c: registered new driver hci_usb

Bluetooth: L2CAP ver 2.1

Bluetooth: L2CAP socket layer initialized

Bluetooth: SCO (Voice Link) ver 0.3

Bluetooth: SCO socket layer initialized

Bluetooth: RFCOMM ver 1.0

Bluetooth: RFCOMM socket layer initialized

hub 2-0:1.0: new USB device on port 1, assigned address 2

input: USB HID v1.00 Mouse [Microsoft Microsoft IntelliMouse® Explorer] on usb-0000:00:03.0-1

hub 3-0:1.0: new USB device on port 1, assigned address 2

hci_usb: probe of 3-1:1.0 failed with error -5

hci_usb: probe of 3-1:1.1 failed with error -5

hci_usb: probe of 3-1:1.2 failed with error -5

Bluetooth: RFCOMM TTY layer initialized
```

cheers

----------

## gmichels

Nevermind, I just got it working...  :Very Happy: 

```
gustavo root # ACCEPT_KEYWORDS="~x86" emerge -pv bluez-bluefw

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild  N    ] net-wireless/bluez-bluefw-0.9-r1
```

This r1 version has a special patch: Applying bluez-bluefw-0.9-kernel2.6.patch...

Now I get this:

```
gustavo linux # bluefw usb 003/002

bluefw[4748]: Loading firmware to usb device 0a5c:2033

bluefw[4748]: FW loaded

gustavo linux # hciconfig

hci0:   Type: USB

        BD Address: 00:00:00:00:00:00 ACL MTU: 0:0  SCO MTU: 0:0

        DOWN

        RX bytes:0 acl:0 sco:0 events:0 errors:0

        TX bytes:0 acl:0 sco:0 commands:0 errors:0
```

\o/

----------

## scoobydu

Hi

Can you confirm your final setup please ...

Do you have anything configured in the kernel for bluetooth?

I've installed the latest unstable bluefw from portage, but no joy.

I've a belkin F8T001 usb dongle.

also, do I really need hotplug installed? can I just load the drivers from the kernel?

Thanks

scooby

----------

## gmichels

You shouldn't need the r1 version of bluefw unless you are using a 2.6 kernel. If you are still on a 2.4 kernel, use the stable package.

What is your problem getting it to work?

----------

## scoobydu

Drago

Yes, I'm using a 2.6 kernel  :Smile:  thats why I asked in this thread   :Shocked: 

It looks like the bluetooth driver is all in the kernel, so do we need to have all that selected in the kernel, as well as installing bluez?

My dongle is not recognised.

scooby

With the likes of alsa, which is included in the kernel, you don't need to load alsa-driver to get it to work ... but here we appear to select bluetooth in the kernel, then load bluez, which is the driver. I must be missing something here ..

----------

## gmichels

Yes, you need the kernel modules and the bluez-* packages. The only package you won't need is bluez-kernel, which are the kernel modules. You don't need them as they are included in the kernel, as alsa.

You'll need the other bluez packages to be able to communicate with other bluetooth devices.

What's the output of your lsmod? In order for your dongle to be recognized, you'll need only 2 modules, the bluetooth and hci-usb ones.

After these modules are loaded, you enter the lsusb command (available in the usbutils package) to gather the bus and device numbers for your dongle. Then you just load the firmware into the dongle with bluefw usb <bus>/<dev>. It should return a message saying the firmware loaded ok. If not, just remove and insert again the dongle, get the new bus and dev numbers and try again.

Then you should be able to hciconfig hci0 up.

Now the communication part is more complex. I managed to do some file transfers, but I am still learning this.

----------

## scoobydu

Ok, thanks, ! have some communication now ...

The PC see's the tungsten, but I'm unable to pair them ...

I'm asked for a pin on my tungsten, but nothing happens on the pc...

Some more digging.

cheers

ps googling for 2,6 BT kernel stuff is amazingly scarce! alot of outdated stuff, back to 2001!

----------

## gmichels

take a look at /etc/bluetooth/pin, there's your magic number

----------

## scoobydu

Thanks, I'd been looking at that one ... but it appeared not to be taking any notice of it.

I entered the number, and the link just timed out ...

Still playing   :Very Happy: 

----------

## scoobydu

Hi all

Is it possible to bring up the bluetooth network on booting of the machine?

Its a pain loading the bluetooth firmware and then 'hciconfig hci0 up' (something like that! on windoze atm!)

Can I add something to the default runlevel, or add something to fstab etc??

Thanks for any tips

scooby

----------

## MyZelF

 *Drago wrote:*   

> Hi all
> 
> I'm trying to get bluetooth working on my box which is currently running 2.6.0-test8-mm1.
> 
> All guides on this forum seem to be useful only for 2.4.x kernels, as they mention patches to those kernels and so on. I haven't found anything related to 2.6.x kernels.
> ...

 

Same problem here, using 2.6.0 final, but I noticed that disconnecting and reconnecting my sitecom usb-bluetooth dongle it starts working... don't ask me why...   :Rolling Eyes: 

```

usb 2-1: USB disconnect, address 2

hub 2-0:1.0: new USB device on port 1, assigned address 4

Bluetooth: HCI USB driver ver 2.4

hci_usb: probe of 2-1:1.1 failed with error -5

hci_usb: probe of 2-1:1.2 failed with error -5

drivers/usb/core/usb.c: registered new driver hci_usb

hci_usb_isoc_rx_submit: hci0 isoc rx submit failed urb d4ac6614 err -22

```

----------

## Nosve

Try to deselect the sco support in the kernel, in the bluetooth devices, not in the sco module

----------

## jonfr

when i start the computer whit the bluethooth, this comes...

```
modprobe: FATAL: Bluethooth module already in the kernel
```

however, my dmesg shows this...

```
Bluetooth: Core ver 2.3

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

```

----------

## BlueBus

Hello.

I am getting this:

```

gloria linux # hciconfig eth0 up

Can't init device hci0. Input/output error(5)

```

my lsusb outputs this:

```

Bus 005 Device 001: ID 0000:0000

Bus 004 Device 001: ID 0000:0000

Bus 003 Device 002: ID 05d8:4002 Ultima Electronics Corp. Artec Ultima 2000 (GT6801 based)/Lifetec LT9385 Scanner

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 008: ID 0a12:0001 Cambridge Silicon Radio, Ltd

Bus 001 Device 007: ID 066f:4200 SigmaTel, Inc. STIr4200 IrDA Bridge

Bus 001 Device 002: ID 05e3:0605 Genesys Logic, Inc.

Bus 001 Device 001: ID 0000:0000

```

and my dmesg says this:

```

usb 1-4.1: new full speed USB device using address 8

ehci_hcd 0000:00:1d.7: qh f70db380 (#0) state 1

Bluetooth: Core ver 2.4

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: HCI USB driver ver 2.5

drivers/usb/core/usb.c: registered new driver hci_usb

hci_usb_intr_rx_submit: hci0 intr rx submit failed urb f55f0394 err -28

hci_usb_intr_rx_submit: hci0 intr rx submit failed urb f62f3694 err -28

Bluetooth: L2CAP ver 2.1

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM ver 1.2

Bluetooth: RFCOMM socket layer initialized

hci_usb_intr_rx_submit: hci0 intr rx submit failed urb f55f0594 err -28

hci_usb_intr_rx_submit: hci0 intr rx submit failed urb eba6a294 err -28

```

Can anybody help me please ?

----------

