1. 26 Jul, 2014 2 commits
    • Marcel Holtmann's avatar
      Bluetooth: Fix white list handling with resolvable private addresses · 66d8e837
      Marcel Holtmann authored
      Devices using resolvable private addresses are required to provide
      an identity resolving key. These devices can not be found using
      the current controller white list support. This means if the kernel
      knows about any devices with an identity resolving key, the white
      list filtering must be disabled.
      
      However so far the kernel kept identity resolving keys around even
      for devices that are not using resolvable private addresses. The
      notification to userspace clearly hints to not store the key and
      so it is best to just remove the key from the kernel as well at
      that point.
      
      With this it easy now to detect when using the white list is
      possible or when kernel side resolving of addresses is required.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      66d8e837
    • Marcel Holtmann's avatar
      Bluetooth: Add support for using controller white list filtering · 8540f6c0
      Marcel Holtmann authored
      The Bluetooth controller can use a white list filter when scanning
      to avoid waking up the host for devices that are of no interest.
      
      Devices marked as reporting, direct connection (incoming) or general
      connection are now added to the controller white list. The update of
      the white list happens just before enabling passive scanning.
      
      In case the white list is full and can not hold all devices, the
      white list is not used and the filter policy set to accept all
      advertisements.
      
      Using the white list for scanning allows for power saving with
      controllers that do not handle the duplicate filtering correctly.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      8540f6c0
  2. 23 Jul, 2014 4 commits
  3. 22 Jul, 2014 1 commit
  4. 21 Jul, 2014 2 commits
    • Marcel Holtmann's avatar
      Bluetooth: Add support for Broadcom device of Asus Z97-DELUXE motherboard · c2aef6e8
      Marcel Holtmann authored
      The Asus Z97-DELUXE motherboard contains a Broadcom based Bluetooth
      controller on the USB bus. However vendor and product ID are listed
      as ASUSTek Computer.
      
      T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0b05 ProdID=17cf Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM20702A0
      S:  SerialNumber=54271E910064
      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)
      Reported-by: default avatarJerome Leclanche <jerome@leclan.ch>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      c2aef6e8
    • Johan Hedberg's avatar
      Bluetooth: Prefer sizeof(*ptr) when allocating memory · 27f70f3e
      Johan Hedberg authored
      It's safer practice to use sizeof(*ptr) instead of sizeof(ptr_type) when
      allocating memory in case the type changes. This also fixes the
      following style of warnings from static analyzers:
      
      CHECK: Prefer kzalloc(sizeof(*ie)...) over kzalloc(sizeof(struct inquiry_entry)...)
      +	ie = kzalloc(sizeof(struct inquiry_entry), GFP_KERNEL);
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      27f70f3e
  5. 20 Jul, 2014 3 commits
    • Marcel Holtmann's avatar
      Bluetooth: Remove unneeded variable assignment in hmac_sha256 · 0a961a44
      Marcel Holtmann authored
      The variable ret does not need to be assigned when declaring it. So
      remove this initial assignment.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      0a961a44
    • Marcel Holtmann's avatar
      Bluetooth: Fix endian and alignment issue with ath3k version handling · 72dd2b2a
      Marcel Holtmann authored
      The ath3k driver is treating the version information badly when it
      comes to loading the right firmware version and comparing that it
      actually matches with the hardware.
      
      Initially this showed up as this:
      
        CHECK   drivers/bluetooth/ath3k.c
      drivers/bluetooth/ath3k.c:373:17: warning: cast to restricted __le32
      drivers/bluetooth/ath3k.c:435:17: warning: cast to restricted __le32
      
      However when fixing this by actually using __packed and __le32 for
      the ath3_version structure, more issues came up:
      
        CHECK   drivers/bluetooth/ath3k.c
      drivers/bluetooth/ath3k.c:381:32: warning: incorrect type in assignment (different base types)
      drivers/bluetooth/ath3k.c:381:32:    expected restricted __le32 [usertype] rom_version
      drivers/bluetooth/ath3k.c:381:32:    got int [signed] <noident>
      drivers/bluetooth/ath3k.c:382:34: warning: incorrect type in assignment (different base types)
      drivers/bluetooth/ath3k.c:382:34:    expected restricted __le32 [usertype] build_version
      drivers/bluetooth/ath3k.c:382:34:    got int [signed] <noident>
      drivers/bluetooth/ath3k.c:386:28: warning: restricted __le32 degrades to integer
      drivers/bluetooth/ath3k.c:386:56: warning: restricted __le32 degrades to integer
      
      This patch fixes every instance of the firmware version handling and
      makes sure it is endian safe and uses proper unaligned access.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      72dd2b2a
    • Johan Hedberg's avatar
      Bluetooth: Disable HCI_CONNECTABLE based passive scanning for now · d1d588c1
      Johan Hedberg authored
      When HCI_CONNECTABLE is set the code has been enabling passive scanning
      in order to be consistent with BR/EDR and accept connections from any
      device doing directed advertising to us. However, some hardware
      (particularly CSR) can get very noisy even when doing duplicates
      filtering, making this feature waste resources.
      
      Considering that the feature is for fairly corner-case use (devices
      who'd use directed advertising would likely be in the whitelist anyway)
      it's better to disable it for now. It may still be brought back later,
      possibly with a better implementation (e.g. through improved scan
      parameters).
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      d1d588c1
  6. 19 Jul, 2014 2 commits
  7. 18 Jul, 2014 1 commit
  8. 17 Jul, 2014 7 commits
  9. 16 Jul, 2014 7 commits
  10. 15 Jul, 2014 3 commits
  11. 14 Jul, 2014 3 commits
  12. 13 Jul, 2014 5 commits