Bluetooth Treiber

Aus
  • install compiler from ipkg
ipkg install gcc
  • Setup Kernel Sourcen und bauen der bluetooth treiber
Toolchain besorgen: synogpl-2198-x64.tbz
auspacken tar -xpvjf synogpl-2198-x64.tbz
cd source/linux-2.6.32/
cp synoconfigs/x86_64 .config # Kernel Sourcen vorbereiten
make config # Erforderliche bluetooth Treiber auswählen

Natürlich kann man hier jedweden fehlenden Treiber auswählen und bauen, das ganze ist nicht unbedingt auf Bluetooth beschränkt :-)

Wenn make config zu verwirrend ist, kann man auch

make menuconfig

nutzen. Dazu muss man aus dem Toolchain die Dateien:

ncurses_dll.h
unctrl.h

nach

/opt/include 

kopieren. Danach lässt sich make menuconfig ausführen und man kann mit dem schöneren Interface seine zusätzlichen Treiber auswählen.

Meine Config Sektion aus .config des Kernels sieht so aus:

#                
# Bluetooth device drivers
#                     
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIUART=m                   
CONFIG_BT_HCIUART_H4=y  
CONFIG_BT_HCIUART_BCSP=y     
CONFIG_BT_HCIUART_LL=y                    
CONFIG_BT_HCIBCM203X=m          
CONFIG_BT_HCIBPA10X=m          
CONFIG_BT_HCIBFUSB=m            
CONFIG_BT_HCIVHCI=m           
CONFIG_BT_MRVL=m           
# CONFIG_AF_RXRPC is not set  
CONFIG_WIRELESS=y                
# CONFIG_CFG80211 is not set    
CONFIG_CFG80211_DEFAULT_PS_VALUE=0     
CONFIG_WIRELESS_OLD_REGULATORY=y      
CONFIG_WIRELESS_EXT=y           
CONFIG_WIRELESS_EXT_SYSFS=y       
# CONFIG_LIB80211 is not set

Bauen der module:

make modules
  • Konfiguration von modprobe:

Erstellen der Datei: /lib/modules/2.6.32.12/modules.dep

kernel/net/bluetooth/bluetooth.ko:
kernel/net/bluetooth/l2cap.ko: kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/rfcomm/rfcomm.ko: kernel/net/bluetooth/l2cap.ko kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/sco.ko: kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/bnep/bnep.ko: kernel/net/bluetooth/l2cap.ko kernel/net/bluetooth/bluetooth.ko
kernel/net/bluetooth/hidp/hidp.ko: kernel/net/bluetooth/l2cap.ko kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/hci_vhci.ko: kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/hci_uart.ko: kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/bcm203x.ko:
kernel/drivers/bluetooth/bpa10x.ko: kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/bfusb.ko: kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/btusb.ko: kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/btsdio.ko: kernel/drivers/mmc/core/mmc_core.ko kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/ath3k.ko:
kernel/drivers/bluetooth/btmrvl.ko: kernel/net/bluetooth/bluetooth.ko
kernel/drivers/bluetooth/btmrvl_sdio.ko: kernel/drivers/mmc/core/mmc_core.ko kernel/drivers/bluetooth/btmrvl.ko kernel/net/bluetooth/bluetooth.ko

Die Module müssen aus dem Kernel Source Directory an die oben genannten Stellen für die Dependencies kopiert werden. Verzeichnisse sind entsprechend mit mkdir anzulegen.

  • bluez utils mittels ipkg installieren
DiskStation2> ipkg list_installed|grep bluez
bluez-hcidump - 1.42-1 - 
bluez-libs - 3.36-1 - Bluetooth libraries.
bluez-utils - 3.36-3 - 
  • bluetooth kernel modul laden
modprobe bluetooth
modprobe btusb
  • bluetooth stack mittels hcitool testen
hciconfig hci0 up
hcitool scan
  • Startup Script bluetooth /opt/etc/init.d/S30bluetooth
#!/bin/sh

start() {
  /sbin/modprobe btusb
  /opt/sbin/hciconfig hci0 up
  /opt/sbin/hciconfig hci0 reset
}

stop() {
  /opt/sbin/hciconfig hci0 down
  /sbin/rmmod btusb
  /sbin/rmmod bluetooth
}
                     
case "$1" in            
  start)          
       start
       ;;          
  stop)       
       stop        
       ;;             
  restart)       
       stop   
       sleep 1                     
       start                                
       ;;                                           
  *)                                           
       echo "Usage: $0 (start|stop|restart)"
       exit 1
       ;;           
esac      

# End