1. 15 10月, 2013 3 次提交
  2. 13 10月, 2013 1 次提交
    • M
      Bluetooth: Remove pointless bdaddr_to_le() helper function · 79d95a19
      Marcel Holtmann 提交于
      The bdaddr_to_le() function tries to convert the internal address
      type to one that matches the HCI address type for LE. It does not
      handle any address types not used by LE and in the end just make
      the code a lot harder to read.
      
      So instead of just hiding behind a magic function, just convert
      the internal address type where it needs to be converted. And it
      turns out that these are only two cases anyway. One when creating
      new LE connections and the other when loading the long term keys.
      In both cases this makes it more clear on what it going on.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      79d95a19
  3. 12 10月, 2013 3 次提交
    • M
      Bluetooth: Fix HCI init for 1st generation BlueFRITZ! devices · 4ca048e3
      Marcel Holtmann 提交于
      The 1st generation of BlueFRITZ! devices from AVM Berlin pretend
      to be HCI version 1.2 controllers, but they are not. They are simple
      Bluetooth 1.1 devices.
      
      Since this company never created any newer controllers, it is safe
      to use the manufacturer ID instead of an USB quirk.
      
      < HCI Command: Read Page Scan Activity (0x03|0x001b) plen 0
      > HCI Event: Command Complete (0x0e) plen 8
            Read Page Scan Activity (0x03|0x001b) ncmd 1
              Status: Success (0x00)
              Interval: 1280.000 msec (0x0800)
              Window: 21.250 msec (0x0022)
      < HCI Command: Read Page Scan Type (0x03|0x0046) plen 0
      > HCI Event: Command Status (0x0f) plen 4
            Read Page Scan Type (0x03|0x0046) ncmd 1
              Status: Unknown HCI Command (0x01)
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      4ca048e3
    • M
      Bluetooth: Fix endless loop with HCI_QUIRK_RESET_ON_CLOSE · 3a6afbd2
      Marcel Holtmann 提交于
      Really early versions of the Bluetooth specification were unclear
      with the behavior of HCI Reset for USB devices. They assumed that
      also an USB reset needs to be issued. Later Bluetooth specifications
      cleared this out and it is safe to call HCI Reset without affecting
      the transport.
      
      For old devices that misbehave, the HCI_QUIRK_RESET_ON_CLOSE quirk
      was introduced to postpone the HCI Reset until the device was no
      longer in use.
      
      One of these devices is the Digianswer BPA-105 Bluetooth Protocol
      Analyzer. The only problem now is that with the quirk set, the
      HCI Reset is also executed at the end of the setup phase. So the
      controller gets configured and then it disconnects from the USB
      bus, connects again, gets configured and of course disconnects
      again. This game goes on forever.
      
      For devices that need HCI_QUIRK_RESET_ON_CLOSE it is important
      that the HCI Reset is not executed after the setup phase. In
      specific when HCI_AUTO_OFF is set, do not call HCI Reset when
      closing the device.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      3a6afbd2
    • M
      Bluetooth: Make LE scan interval and window a controller option · bef64738
      Marcel Holtmann 提交于
      The scan interval and window for LE passive scanning and connection
      establishment should be configurable on a per controller basis. So
      introduce a setting that later on will allow modifying it.
      
      This setting does not affect LE active scanning during device
      discovery phase. As long as that phase uses interleaved discovery,
      it will continuously scan.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      bef64738
  4. 11 10月, 2013 6 次提交
  5. 07 10月, 2013 5 次提交
  6. 06 10月, 2013 4 次提交
  7. 05 10月, 2013 1 次提交
  8. 02 10月, 2013 6 次提交
  9. 19 9月, 2013 4 次提交
  10. 17 9月, 2013 4 次提交
  11. 21 8月, 2013 1 次提交
    • M
      Bluetooth: Set different event mask for LE-only controllers · c7882cbd
      Marcel Holtmann 提交于
      In case of a Low Energy only controller it makes no sense to configure
      the full BR/EDR event mask. It will just enable events that can not be
      send anyway and there is no guarantee that such a controller will accept
      this value.
      
      Use event mask 0x90 0xe8 0x04 0x02 0x00 0x80 0x00 0x20 for LE-only
      controllers which enables the following events:
      
                Disconnection Complete
                Encryption Change
                Read Remote Version Information Complete
                Command Complete
                Command Status
                Hardware Error
                Number of Completed Packets
                Data Buffer Overflow
                Encryption Key Refresh Complete
                LE Meta
      
      This is according to Core Specification, Part E, Section 3.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      c7882cbd
  12. 29 7月, 2013 2 次提交
    • J
      Bluetooth: Fix calling request callback more than once · 53e21fbc
      Johan Hedberg 提交于
      In certain circumstances, such as an HCI driver using __hci_cmd_sync_ev
      with HCI_EV_CMD_COMPLETE as the expected completion event there is the
      chance that hci_event_packet will call hci_req_cmd_complete twice (once
      for the explicitly looked after event and another time in the actual
      handler of cmd_complete).
      
      In the case of __hci_cmd_sync_ev this introduces a race where the first
      call wakes up the blocking __hci_cmd_sync_ev and lets it complete.
      However, by the time that a second __hci_cmd_sync_ev call is already in
      progress the second hci_req_cmd_complete call (from the previous
      operation) will wake up the blocking function prematurely and cause it
      to fail, as witnessed by the following log:
      
      [  639.232195] hci_rx_work: hci0 Event packet
      [  639.232201] hci_req_cmd_complete: opcode 0xfc8e status 0x00
      [  639.232205] hci_sent_cmd_data: hci0 opcode 0xfc8e
      [  639.232210] hci_req_sync_complete: hci0 result 0x00
      [  639.232220] hci_cmd_complete_evt: hci0 opcode 0xfc8e
      [  639.232225] hci_req_cmd_complete: opcode 0xfc8e status 0x00
      [  639.232228] __hci_cmd_sync_ev: hci0 end: err 0
      [  639.232234] __hci_cmd_sync_ev: hci0
      [  639.232238] hci_req_add_ev: hci0 opcode 0xfc8e plen 250
      [  639.232242] hci_prepare_cmd: skb len 253
      [  639.232246] hci_req_run: length 1
      [  639.232250] hci_sent_cmd_data: hci0 opcode 0xfc8e
      [  639.232255] hci_req_sync_complete: hci0 result 0x00
      [  639.232266] hci_cmd_work: hci0 cmd_cnt 1 cmd queued 1
      [  639.232271] __hci_cmd_sync_ev: hci0 end: err 0
      [  639.232276] Bluetooth: hci0 sending Intel patch command (0xfc8e) failed (-61)
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      53e21fbc
    • J
      Bluetooth: Fix HCI init for BlueFRITZ! devices · 3f8e2d75
      Johan Hedberg 提交于
      None of the BlueFRITZ! devices with manufacurer ID 31 (AVM Berlin)
      support HCI_Read_Local_Supported_Commands. It is safe to use the
      manufacturer ID (instead of e.g. a USB ID specific quirk) because the
      company never created any newer controllers.
      
      < HCI Command: Read Local Supported Comm.. (0x04|0x0002) plen 0 [hci0] 0.210014
      > HCI Event: Command Status (0x0f) plen 4 [hci0] 0.217361
            Read Local Supported Commands (0x04|0x0002) ncmd 1
              Status: Unknown HCI Command (0x01)
      Reported-by: NJörg Esser <jackfritt@boh.de>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Tested-by: NJörg Esser <jackfritt@boh.de>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      3f8e2d75