1. 05 Dec, 2014 25 commits
  2. 04 Dec, 2014 3 commits
  3. 03 Dec, 2014 12 commits
    • Marcel Holtmann's avatar
      Bluetooth: Increment management interface revision · 854bda19
      Marcel Holtmann authored
      This patch increments the management interface revision due to the
      addition of support for LE Secure Connection feature.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      854bda19
    • Marcel Holtmann's avatar
      Bluetooth: Increase minor version of core module · 8ab9731d
      Marcel Holtmann authored
      With the addition of support for Bluetooth Low Energy Secure Connections
      feature, it makes sense to increase the minor version of the Bluetooth
      core module.
      
      The module version is not used anywhere, but it gives a nice extra
      hint for debugging purposes.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      8ab9731d
    • Heinrich Siebmanns's avatar
      Bluetooth: Add support for Broadcom BCM20702A0 variants firmware download · 6029ddc2
      Heinrich Siebmanns authored
      This requires the flag BTUSB_BCM_PATCHRAM to work.
      
      Relevant details from /sys/kernel/debug/usb/devices for my device:
      
      T:  Bus=03 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0489 ProdID=e031 Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM20702A0
      S:  SerialNumber=3859F9CD2AEE
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      
      The firmware was extracted from a Windows 7 32-bit installation
      and converted from 'hex' to 'hcd' for use in Linux.
      
      The firmware is named "BCM20702A0_001.001.024.0156.0204.hex"
      and is located in "%SYSTEMROOT%\system32\drivers\"
      (md5 d126e6c4e0e669d76c38cf9377f76b7f)
      (sha1 145d1850b2785a953233b409e7ff77786927c7d2)
      
      The firmware file is also available as a download at
      http://support.ts.fujitsu.com/Download/
      contained in "FTS_WIDCOMMBluetoothSoftware_6309000_1072149.zip"
      
      Search for the file Win32/bcbtums-win7x86-brcm.inf in the archive,
      look for the vendor and product ID of your adapter, see the section
      'devices' in that file to find out what device name it uses. See
      the device entry in the inf file (in my case it was 'RAMUSBE031')
      to find out which hex file you need to convert to hcd for upload
      
      'hcd' file should be placed at "brcm/BCM20702A0-0489-e031.hcd"
      inside the firmware directory (e.g. "/lib/firmware")
      Signed-off-by: default avatarHeinrich Siebmanns <harv@gmx.de>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      6029ddc2
    • Xinming Hu's avatar
      Bluetooth: btmrvl add firmware dump support · dc759613
      Xinming Hu authored
      This patch adds firmware dump support for marvell
      bluetooth chipset. Currently only SD8897 is supported.
      This is implemented based on dev_coredump, a new mechnism
      introduced in kernel 3.18rc3
      
      Firmware dump can be trigger by
      echo 1 > /sys/kernel/debug/bluetooth/hci*/config/fw_dump
      and when the dump operation is completed, data can be read by
      cat /sys/class/devcoredump/devcd*/data
      
      We have prepared following script to divide fw memory
      dump data into multiple files based on memory type.
      
       [root]# cat btmrvl_split_dump_data.sh
       #!/bin/bash
       # usage: ./btmrvl_split_dump_data.sh dump_data
      
       fw_dump_data=$1
      
       mem_type="ITCM DTCM SQRAM APU CIU ICU MAC EXT7 EXT8 EXT9 EXT10 EXT11 EXT12 EXT13 EXTLAST"
      
       for name in ${mem_type[@]}
       do
               sed -n "/Start dump $name/,/End dump/p" $fw_dump_data  > tmp.$name.log
               if [ ! -s tmp.$name.log ]
                       then
                               rm -rf tmp.$name.log
                       else
                               # Remove the describle info "Start dump" and "End dump"
                               sed '1d' tmp.$name.log | sed '$d' > /data/$name.log
                               if [ -s /data/$name.log ]
                               then
                                       echo "generate /data/$name.log"
                               else
                                       sed '1d' tmp.$name.log | sed '$d' > /var/$name.log
                                       echo "generate /var/$name.log"
                               fi
                               rm -rf tmp.$name.log
               fi
       done
      Signed-off-by: default avatarXinming Hu <huxm@marvell.com>
      Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
      Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
      Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Reviewed-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      dc759613
    • Amitkumar Karwar's avatar
      Bluetooth: btmrvl: remove extra newline character · 7365d475
      Amitkumar Karwar authored
      BT_INFO/BT_DBG etc. already takes care of adding a newline
      An extra newline character inside message is removed in this
      patch.
      Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      7365d475
    • Johan Hedberg's avatar
      Bluetooth: Fix false-positive "uninitialized" compiler warning · 580039e8
      Johan Hedberg authored
      Some gcc versions don't seem to be able to properly track the flow of
      the smp_cmd_pairing_random() function and end up causing the following
      types of (false-positive) warnings:
      
       smp.c:1995:6: warning: ‘nb’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey);
       smp.c:1995:6: warning: ‘na’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey);
             ^
       smp.c:1995:6: warning: ‘pkbx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey);
             ^
       smp.c:1995:6: warning: ‘pkax’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey);
      
      This patch fixes the issue by moving the pkax/pkbx and na/nb
      initialization earlier in the function.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      580039e8
    • Johan Hedberg's avatar
      Bluetooth: Fix minor coding style issue in smp.c · 7f376cd6
      Johan Hedberg authored
      The convention for checking for NULL pointers is !ptr and not
      ptr == NULL. This patch fixes such an occurrence in smp.c.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      7f376cd6
    • Johan Hedberg's avatar
      Bluetooth: Fix SMP debug key handling · 923e2414
      Johan Hedberg authored
      We need to keep debug keys around at least until the point that they are
      used - otherwise e.g. slave role behavior wouldn't work as there'd be no
      key to be looked up. The correct behavior should therefore be to return
      any stored keys but when we clean up the SMP context to remove the key
      from the hdev list if keeping debug keys around hasn't been requestsed.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      923e2414
    • Johan Hedberg's avatar
      Bluetooth: Organize SMP crypto functions to logical sections · 06edf8de
      Johan Hedberg authored
      This patch organizes the various SMP crypto functions so that the LE SC
      functions appear in one section and the legacy SMP functions in a
      separate one.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      06edf8de
    • Johan Hedberg's avatar
      Bluetooth: Fix missing const declarations in SMP functions · cd082797
      Johan Hedberg authored
      Several SMP functions take read-only data. This patch fixes the
      declaration of these parameters to use the const specifier as
      appropriate.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      cd082797
    • Johan Hedberg's avatar
      Bluetooth: Introduce SMP_DBG macro for low-level debuging · c7a3d57d
      Johan Hedberg authored
      The various inputs & outputs of the crypto functions as well as the
      values of the ECDH keys can be considered security sensitive. They
      should therefore not end up in dmesg by mistake. This patch introduces a
      new SMP_DBG macro which requires explicit compilation with -DDEBUG to be
      enabled. All crypto related data logs now use this macro instead of
      BT_DBG.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      c7a3d57d
    • Johan Hedberg's avatar
      Bluetooth: Add basic LE SC OOB support for remote OOB data · a29b0733
      Johan Hedberg authored
      This patch adds basic OOB pairing support when we've received the remote
      OOB data. This includes tracking the remote r value (in smp->rr) as well
      as doing the appropriate f4() call when needed. Previously the OOB rand
      would have been stored in smp->rrnd however these are actually two
      independent values so we need separate variables for them. Na/Nb in the
      spec maps to smp->prnd/rrnd and ra/rb maps to smp->rr with smp->pr to
      come once local OOB data is supported.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      a29b0733