1. 25 12月, 2014 2 次提交
    • J
      Bluetooth: Fix accepting connections when not using mgmt · 6a8fc95c
      Johan Hedberg 提交于
      When connectable mode is enabled (page scan on) through some non-mgmt
      method the HCI_CONNECTABLE flag will not be set. For backwards
      compatibility with user space versions not using mgmt we should not
      require HCI_CONNECTABLE to be set if HCI_MGMT is not set.
      Reported-by: NPali Rohár <pali.rohar@gmail.com>
      Tested-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org # 3.17+
      6a8fc95c
    • M
      Bluetooth: Fix controller configuration with HCI_QUIRK_INVALID_BDADDR · 8bfe8442
      Marcel Holtmann 提交于
      When controllers set the HCI_QUIRK_INVALID_BDADDR flag, it is required
      by userspace to program a valid public Bluetooth device address into
      the controller before it can be used.
      
      After successful address configuration, the internal state changes and
      the controller runs the complete initialization procedure. However one
      small difference is that this is no longer the HCI_SETUP stage. The
      HCI_SETUP stage is only valid during initial controller setup. In this
      case the stack runs the initialization as part of the HCI_CONFIG stage.
      
      The controller version information, default name and supported commands
      are only stored during HCI_SETUP. While these information are static,
      they are not read initially when HCI_QUIRK_INVALID_BDADDR is set. So
      when running in HCI_CONFIG state, these information need to be updated
      as well.
      
      This especially impacts Bluetooth 4.1 and later controllers using
      extended feature pages and second event mask page.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org # 3.17+
      8bfe8442
  2. 21 12月, 2014 1 次提交
  3. 20 12月, 2014 1 次提交
  4. 19 12月, 2014 2 次提交
  5. 11 12月, 2014 1 次提交
  6. 06 12月, 2014 1 次提交
    • M
      Bluetooth: Add support for handling LE Direct Advertising Report events · 2f010b55
      Marcel Holtmann 提交于
      When the controller sends a LE Direct Advertising Report event, the host
      must confirm that the resolvable random address provided matches with
      its own identity resolving key. If it does, then that advertising report
      needs to be processed. If it does not match, the report needs to be
      ignored.
      
      This patch adds full support for handling these new reports and using
      them for device discovery and connection handling. This means when a
      Bluetooth controller supports the Extended Scanner Filter Policies, it
      is possible to use directed advertising with LE privacy.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      2f010b55
  7. 05 12月, 2014 1 次提交
  8. 03 12月, 2014 6 次提交
  9. 19 11月, 2014 2 次提交
  10. 18 11月, 2014 1 次提交
  11. 15 11月, 2014 1 次提交
  12. 11 11月, 2014 1 次提交
  13. 07 11月, 2014 3 次提交
    • J
      Bluetooth: Send mgmt_connected only if state is BT_CONFIG · cb77c3ec
      Jaganath Kanakkassery 提交于
      If a remote name request is initiated while acl connection is going on,
      and if it fails then mgmt_connected will be sent. Evetually after acl
      connection, authentication will not be initiated and userspace will
      never get pairing reply.
      
      < HCI Command: Create Connection (0x01|0x0005) plen 13
          bdaddr AA:BB:CC:DD:EE:FF ptype 0xcc18 rswitch 0x01 clkoffset 0x2306 (valid)
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5
      > HCI Event: Command Status (0x0f) plen 4
          Create Connection (0x01|0x0005) status 0x00 ncmd 1
      > HCI Event: Inquiry Complete (0x01) plen 1
          status 0x00
      < HCI Command: Remote Name Request (0x01|0x0019) plen 10
          bdaddr AA:BB:CC:DD:EE:FF mode 1 clkoffset 0x2306
      > HCI Event: Command Status (0x0f) plen 4
          Remote Name Request (0x01|0x0019) status 0x0c ncmd 1
          Error: Command Disallowed
      > HCI Event: Connect Complete (0x03) plen 11
          status 0x00 handle 50 bdaddr 00:0D:FD:47:53:B2 type ACL encrypt 0x00
      < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
          handle 50
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
      > HCI Event: Max Slots Change (0x1b) plen 3
          handle 50 slots 5
      > HCI Event: Read Remote Supported Features (0x0b) plen 11
          status 0x00 handle 50
          Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x83
      < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
          handle 50 page 1
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
      > HCI Event: Read Remote Extended Features (0x23) plen 13
          status 0x00 handle 50 page 1 max 1
          Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
      
      This patch sends mgmt_connected in remote name command status only if
      conn->state is BT_CONFIG
      Signed-off-by: NJaganath Kanakkassery <jaganath.k@samsung.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      cb77c3ec
    • K
      Bluetooth: Sort switch cases by opcode's numeric value · 9645c76c
      Kuba Pawlak 提交于
      Opcodes in switch/case in hci_cmd_status_evt are not sorted
      by value. This patch restores proper ordering.
      Signed-off-by: NKuba Pawlak <kubax.t.pawlak@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      9645c76c
    • K
      Bluetooth: Clear role switch pending flag · 50fc85f1
      Kuba Pawlak 提交于
      If role switch was rejected by the controller and HCI Event: Command Status
      returned with status "Command Disallowed" (0x0C) the flag
      HCI_CONN_RSWITCH_PEND remains set. No further role switches are
      possible as this flag prevents us from sending any new HCI Switch Role
      requests and the only way to clear it is to receive a valid
      HCI Event Switch Role.
      
      This patch clears the flag if command was rejected.
      
      2013-01-01 00:03:44.209913 < HCI Command: Switch Role (0x02|0x000b) plen 7
          bdaddr BC:C6:DB:C4:6F:79 role 0x00
          Role: Master
      2013-01-01 00:03:44.210867 > HCI Event: Command Status (0x0f) plen 4
          Switch Role (0x02|0x000b) status 0x0c ncmd 1
          Error: Command Disallowed
      Signed-off-by: NKuba Pawlak <kubax.t.pawlak@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      50fc85f1
  14. 02 11月, 2014 2 次提交
  15. 31 10月, 2014 1 次提交
  16. 29 10月, 2014 1 次提交
  17. 25 10月, 2014 2 次提交
  18. 11 9月, 2014 2 次提交
  19. 09 9月, 2014 4 次提交
  20. 21 8月, 2014 1 次提交
    • J
      Bluetooth: Fix hci_conn reference counting for auto-connections · f161dd41
      Johan Hedberg 提交于
      Recently the LE passive scanning and auto-connections feature was
      introduced. It uses the hci_connect_le() API which returns a hci_conn
      along with a reference count to that object. All previous users would
      tie this returned reference to some existing object, such as an L2CAP
      channel, and there'd be no leaked references this way. For
      auto-connections however the reference was returned but not stored
      anywhere, leaving established connections with one higher reference
      count than they should have.
      
      Instead of playing special tricks with hci_conn_hold/drop this patch
      associates the returned reference from hci_connect_le() with the object
      that in practice does own this reference, i.e. the hci_conn_params
      struct that caused us to initiate a connection in the first place. Once
      the connection is established or fails to establish this reference is
      removed appropriately.
      
      One extra thing needed is to call hci_pend_le_actions_clear() before
      calling hci_conn_hash_flush() so that the reference is cleared before
      the hci_conn objects are fully removed.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      f161dd41
  21. 14 8月, 2014 1 次提交
  22. 31 7月, 2014 2 次提交
  23. 28 7月, 2014 1 次提交