1. 14 10月, 2018 1 次提交
  2. 27 9月, 2018 2 次提交
  3. 13 4月, 2017 1 次提交
  4. 29 1月, 2016 1 次提交
  5. 05 11月, 2015 1 次提交
  6. 23 7月, 2015 2 次提交
  7. 19 12月, 2014 1 次提交
  8. 10 12月, 2014 3 次提交
  9. 03 12月, 2014 1 次提交
  10. 02 12月, 2014 1 次提交
    • J
      Bluetooth: Track both local and remote L2CAP fixed channel mask · 0bd49fc7
      Johan Hedberg 提交于
      To pave the way for future fixed channels to be added easily we should
      track both the local and remote mask on a per-L2CAP connection (struct
      l2cap_conn) basis. So far the code has used a global variable in a racy
      way which anyway needs fixing.
      
      This patch renames the existing conn->fixed_chan_mask that tracked
      the remote mask to conn->remote_fixed_chan and adds a new variable
      conn->local_fixed_chan to track the local mask. Since the HS support
      info is now available in the local mask we can remove the
      conn->hs_enabled variable.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0bd49fc7
  11. 13 11月, 2014 1 次提交
    • J
      Bluetooth: Use proper nesting annotation for l2cap_chan lock · abe84903
      Johan Hedberg 提交于
      By default lockdep considers all L2CAP channels equal. This would mean
      that we get warnings if a channel is locked when another one's lock is
      tried to be acquired in the same thread. This kind of inter-channel
      locking dependencies exist in the form of parent-child channels as well
      as any channel wishing to elevate the security by requesting procedures
      on the SMP channel.
      
      To eliminate the chance for these lockdep warnings we introduce a
      nesting level for each channel and use that when acquiring the channel
      lock. For now there exists the earlier mentioned three identified
      categories: SMP, "normal" channels and parent channels (i.e. those in
      BT_LISTEN state). The nesting level is defined as atomic_t since we need
      access to it before the lock is actually acquired.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      abe84903
  12. 09 9月, 2014 4 次提交
    • J
      Bluetooth: Move identity address update behind a workqueue · f3d82d0c
      Johan Hedberg 提交于
      The identity address update of all channels for an l2cap_conn needs to
      take the lock for each channel, i.e. it's safest to do this by a
      separate workqueue callback.
      
      Previously this was partially solved by moving the entire SMP key
      distribution behind a workqueue. However, if we want SMP context locking
      to be correct and safe we should always use the l2cap_chan lock when
      accessing it, meaning even smp_distribute_keys needs to take that lock
      which would once again create a dead lock when updating the identity
      address.
      
      The simplest way to solve this is to have l2cap_conn manage the deferred
      work which is what this patch does. A subsequent patch will remove the
      now unnecessary SMP key distribution work struct.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      f3d82d0c
    • J
      Bluetooth: Remove unused l2cap_conn_shutdown API · b04afa0c
      Johan Hedberg 提交于
      Now that there are no more users of the l2cap_conn_shutdown API (since
      smp.c switched to using hci_disconnect) we can simply remove it along
      with all of it's l2cap_conn variables.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      b04afa0c
    • J
      Bluetooth: Improve *_get() functions to return the object type · 51bb8457
      Johan Hedberg 提交于
      It's natural to have *_get() functions that increment the reference
      count of an object to return the object type itself. This way it's
      simple to make a copy of the object pointer and increase the reference
      count in a single step. This patch updates two such get() functions,
      namely hci_conn_get() and l2cap_conn_get(), and updates the users to
      take advantage of the new API.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      51bb8457
    • J
      Bluetooth: Fix hci_conn reference counting for fixed channels · c16900cf
      Johan Hedberg 提交于
      Now that SMP has been converted to use fixed channels we've got a bit of
      a problem with the hci_conn reference counting. So far the L2CAP code
      has kept a reference for each L2CAP channel that was notified of the
      connection. With SMP however this would mean that the connection is
      never dropped even though there are no other users of it. Furthermore,
      SMP already does its own hci_conn reference counting internally,
      starting from a security or pairing request and ending with the key
      distribution.
      
      This patch makes L2CAP fixed channels default to the L2CAP core not
      keeping a hci_conn reference for them. A new FLAG_HOLD_HCI_CONN flag is
      added so that L2CAP users can declare an exception to this rule and hold
      a reference even for their fixed channels. One such exception is the
      L2CAP socket layer which does want a reference for each socket (e.g. an
      ATT socket which uses a fixed channel).
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c16900cf
  13. 14 8月, 2014 6 次提交
  14. 17 7月, 2014 1 次提交
  15. 14 7月, 2014 1 次提交
  16. 11 7月, 2014 1 次提交
  17. 03 7月, 2014 5 次提交
  18. 19 2月, 2014 1 次提交
  19. 15 2月, 2014 1 次提交
  20. 13 2月, 2014 3 次提交
  21. 12 12月, 2013 1 次提交
  22. 05 12月, 2013 1 次提交
    • J
      Bluetooth: Simplify l2cap_chan initialization for LE CoC · 0ce43ce6
      Johan Hedberg 提交于
      The values in l2cap_chan that are used for actually transmitting data
      only need to be initialized right after we've received an L2CAP Connect
      Request or just before we send one. The only thing that we need to
      initialize though bind() and connect() is the chan->mode value. This way
      all other initializations can be done in the l2cap_le_flowctl_init
      function (which now becomes private to l2cap_core.c) and the
      l2cap_le_flowctl_start function can be completely removed.
      
      Also, since the l2cap_sock_init function initializes the imtu and omtu
      to adequate values these do not need to be part of l2cap_le_flowctl_init.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0ce43ce6