1. 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
  2. 31 7月, 2014 2 次提交
  3. 27 7月, 2014 1 次提交
  4. 24 7月, 2014 3 次提交
  5. 17 7月, 2014 2 次提交
  6. 16 7月, 2014 5 次提交
  7. 14 7月, 2014 1 次提交
  8. 13 7月, 2014 1 次提交
  9. 11 7月, 2014 9 次提交
  10. 10 7月, 2014 3 次提交
  11. 09 7月, 2014 4 次提交
  12. 08 7月, 2014 2 次提交
  13. 07 7月, 2014 2 次提交
  14. 06 7月, 2014 4 次提交
    • J
      Bluetooth: Use lower timeout for LE auto-connections · 09ae260b
      Johan Hedberg 提交于
      When we establish connections as a consequence of receiving an
      advertising report it makes no sense to wait the normal 20 second LE
      connection timeout. This patch modifies the hci_connect_le function to
      take an extra timeout value and uses a lower 2 second timeout for the
      auto-connection case. This timeout is intentionally chosen to be just a
      bit higher than the 1.28 second timeout that High Duty Cycle Advertising
      uses.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      09ae260b
    • M
      Bluetooth: Add support for changing the public device address · 9713c17b
      Marcel Holtmann 提交于
      This adds support for changing the public device address. This feature
      is required by controllers that do not provide a public address and
      have HCI_QUIRK_INVALID_BDADDR set.
      
      Even if a controller has a public device address, this is useful when
      an embedded system wants to use its own value. As long as the driver
      provides the set_bdaddr callback, this allows changing the device
      address before powering on the controller.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      9713c17b
    • M
      Bluetooth: Run controller setup after external configuration · d603b76b
      Marcel Holtmann 提交于
      When the external configuration triggers the switch to a configured
      controller, it means the setup needs to be run. Controllers that start
      out unconfigured have only run limited set of HCI commands. This is
      not enough for complete operation and thus run the setup procedure
      before announcing the new controller index.
      
      This introduces HCI_CONFIG flag as companion to HCI_SETUP flag. The
      HCI_SETUP flag is only used once for the initial setup procedure. And
      during that procedure hdev->setup driver callback is called. With the
      new HCI_CONFIG the switch from unconfigured to configured state is
      triggering the same setup procedure just without hdev->setup. This
      is required since bringing a controller back to unconfigured state
      from configured state is possible.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      d603b76b
    • J
      Bluetooth: Fix sending Device Removed when clearing all parameters · 19de0825
      Johan Hedberg 提交于
      When calling Device Remove with BDADDR_ANY we should in a similar way
      emit Device Removed events as we do when removing a single device. Since
      we have to iterate the list and call device_removed() the dedicated
      hci_conn_params_clear_enabled() is not really useful anymore. This patch
      removes the helper function and does the event emission and list item
      removal in a single loop.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      19de0825