1. 14 8月, 2014 1 次提交
  2. 31 7月, 2014 6 次提交
    • J
      Bluetooth: Always use non-bonding requirement when not bondable · 82c295b1
      Johan Hedberg 提交于
      When we're not bondable we should never send any other SSP
      authentication requirement besides one of the non-bonding ones.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      82c295b1
    • J
      Bluetooth: Rename pairable mgmt setting to bondable · b2939475
      Johan Hedberg 提交于
      This setting maps to the HCI_BONDABLE flag which tracks whether we're
      bondable or not. Therefore, rename the mgmt setting and respective
      command accordingly.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      b2939475
    • J
      Bluetooth: Rename HCI_PAIRABLE to HCI_BONDABLE · b6ae8457
      Johan Hedberg 提交于
      The HCI_PAIRABLE flag isn't actually controlling whether we're pairable
      but whether we're bondable. Therefore, rename it accordingly.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      b6ae8457
    • M
      Bluetooth: Fix sparse warning from HID new leds handling · bdb94346
      Marcel Holtmann 提交于
      The new leds bit handling produces this spares warning.
      
        CHECK   net/bluetooth/hidp/core.c
      net/bluetooth/hidp/core.c:156:60: warning: dubious: x | !y
      
      Just fix it by doing an explicit x << 0 shift operation.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      bdb94346
    • J
      Bluetooth: Fix check for connected state when pairing · 6f78fd4b
      Johan Hedberg 提交于
      Both BT_CONNECTED and BT_CONFIG state mean that we have a baseband link
      available. We should therefore check for either of these when pairing
      and deciding whether to call hci_conn_security() directly.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      6f78fd4b
    • J
      Bluetooth: Fix SMP context tracking leading to a kernel crash · 616d55be
      Johan Hedberg 提交于
      The HCI_CONN_LE_SMP_PEND flag is supposed to indicate whether we have an
      SMP context or not. If the context creation fails, or some other error
      is indicated between setting the flag and creating the context the flag
      must be cleared first.
      
      This patch ensures that smp_chan_create() clears the flag in case of
      allocation failure as well as reorders code in smp_cmd_security_req()
      that could lead to returning an error between setting the flag and
      creating the context.
      
      Without the patch the following kind of kernel crash could be observed
      (this one because of unacceptable authentication requirements in a
      Security Request):
      
      [  +0.000855] kernel BUG at net/bluetooth/smp.c:606!
      [  +0.000000] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      [  +0.000000] CPU: 0 PID: 58 Comm: kworker/u5:2 Tainted: G        W     3.16.0-rc1+ #785
      [  +0.008391] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      [  +0.000000] Workqueue: hci0 hci_rx_work
      [  +0.000000] task: f4dc8f90 ti: f4ef0000 task.ti: f4ef0000
      [  +0.000000] EIP: 0060:[<c13432b6>] EFLAGS: 00010246 CPU: 0
      [  +0.000000] EIP is at smp_chan_destroy+0x1e/0x145
      [  +0.000709] EAX: f46db870 EBX: 00000000 ECX: 00000000 EDX: 00000005
      [  +0.000000] ESI: f46db870 EDI: f46db870 EBP: f4ef1dc0 ESP: f4ef1db0
      [  +0.000000]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
      [  +0.000000] CR0: 8005003b CR2: b666b0b0 CR3: 00022000 CR4: 00000690
      [  +0.000000] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      [  +0.000000] DR6: fffe0ff0 DR7: 00000400
      [  +0.000000] Stack:
      [  +0.000000]  00000005 f17b7840 f46db870 f4ef1dd4 f4ef1de4 c1343441 c134342e 00000000
      [  +0.000000]  c1343441 00000005 00000002 00000000 f17b7840 f4ef1e38 c134452a 00002aae
      [  +0.000000]  01ef1e00 00002aae f46bd980 f46db870 00000039 ffffffff 00000007 f4ef1e34
      [  +0.000000] Call Trace:
      [  +0.000000]  [<c1343441>] smp_failure+0x64/0x6c
      [  +0.000000]  [<c134342e>] ? smp_failure+0x51/0x6c
      [  +0.000000]  [<c1343441>] ? smp_failure+0x64/0x6c
      [  +0.000000]  [<c134452a>] smp_sig_channel+0xad6/0xafc
      [  +0.000000]  [<c1053b61>] ? vprintk_emit+0x343/0x366
      [  +0.000000]  [<c133f34e>] l2cap_recv_frame+0x1337/0x1ac4
      [  +0.000000]  [<c133f34e>] ? l2cap_recv_frame+0x1337/0x1ac4
      [  +0.000000]  [<c1172307>] ? __dynamic_pr_debug+0x3e/0x40
      [  +0.000000]  [<c11702a1>] ? debug_smp_processor_id+0x12/0x14
      [  +0.000000]  [<c1340bc9>] l2cap_recv_acldata+0xe8/0x239
      [  +0.000000]  [<c1340bc9>] ? l2cap_recv_acldata+0xe8/0x239
      [  +0.000000]  [<c1169931>] ? __const_udelay+0x1a/0x1c
      [  +0.000000]  [<c131f120>] hci_rx_work+0x1a1/0x286
      [  +0.000000]  [<c137244e>] ? mutex_unlock+0x8/0xa
      [  +0.000000]  [<c131f120>] ? hci_rx_work+0x1a1/0x286
      [  +0.000000]  [<c1038fe5>] process_one_work+0x128/0x1df
      [  +0.000000]  [<c1038fe5>] ? process_one_work+0x128/0x1df
      [  +0.000000]  [<c10392df>] worker_thread+0x222/0x2de
      [  +0.000000]  [<c10390bd>] ? process_scheduled_works+0x21/0x21
      [  +0.000000]  [<c103d34c>] kthread+0x82/0x87
      [  +0.000000]  [<c1040000>] ? create_new_namespaces+0x90/0x105
      [  +0.000000]  [<c13738e1>] ret_from_kernel_thread+0x21/0x30
      [  +0.000000]  [<c103d2ca>] ? __kthread_parkme+0x50/0x50
      [  +0.000000] Code: 65 f4 89 f0 5b 5e 5f 5d 8d 67 f8 5f c3 57 8d 7c 24 08 83 e4 f8 ff 77 fc 55 89 e5 57 89 c7 56 53 52 8b 98 e0 00 00 00 85 db 75 02 <0f> 0b 8b b3 80 00 00 00 8b 00 c1 ee 03 83 e6 01 89 f2 e8 ef 09
      [  +0.000000] EIP: [<c13432b6>] smp_chan_destroy+0x1e/0x145 SS:ESP 0068:f4ef1db0
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      616d55be
  3. 29 7月, 2014 1 次提交
  4. 28 7月, 2014 1 次提交
  5. 27 7月, 2014 3 次提交
  6. 26 7月, 2014 2 次提交
    • M
      Bluetooth: Fix white list handling with resolvable private addresses · 66d8e837
      Marcel Holtmann 提交于
      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: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      66d8e837
    • M
      Bluetooth: Add support for using controller white list filtering · 8540f6c0
      Marcel Holtmann 提交于
      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: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      8540f6c0
  7. 24 7月, 2014 4 次提交
  8. 22 7月, 2014 1 次提交
  9. 21 7月, 2014 2 次提交
  10. 20 7月, 2014 1 次提交
    • J
      Bluetooth: Disable HCI_CONNECTABLE based passive scanning for now · d1d588c1
      Johan Hedberg 提交于
      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: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d1d588c1
  11. 18 7月, 2014 1 次提交
  12. 17 7月, 2014 7 次提交
  13. 16 7月, 2014 8 次提交
    • J
      Bluetooth: Fix always checking the blacklist for incoming connections · 46c4c941
      Johan Hedberg 提交于
      We should check the blacklist no matter what, meaning also when we're
      not connectable. This patch fixes the respective logic in the function
      making the decision whether to accept a connection or not.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      46c4c941
    • N
      sched: Remove proliferation of wait_on_bit() action functions · 74316201
      NeilBrown 提交于
      The current "wait_on_bit" interface requires an 'action'
      function to be provided which does the actual waiting.
      There are over 20 such functions, many of them identical.
      Most cases can be satisfied by one of just two functions, one
      which uses io_schedule() and one which just uses schedule().
      
      So:
       Rename wait_on_bit and        wait_on_bit_lock to
              wait_on_bit_action and wait_on_bit_lock_action
       to make it explicit that they need an action function.
      
       Introduce new wait_on_bit{,_lock} and wait_on_bit{,_lock}_io
       which are *not* given an action function but implicitly use
       a standard one.
       The decision to error-out if a signal is pending is now made
       based on the 'mode' argument rather than being encoded in the action
       function.
      
       All instances of the old wait_on_bit and wait_on_bit_lock which
       can use the new version have been changed accordingly and their
       action functions have been discarded.
       wait_on_bit{_lock} does not return any specific error code in the
       event of a signal so the caller must check for non-zero and
       interpolate their own error code as appropriate.
      
      The wait_on_bit() call in __fscache_wait_on_invalidate() was
      ambiguous as it specified TASK_UNINTERRUPTIBLE but used
      fscache_wait_bit_interruptible as an action function.
      David Howells confirms this should be uniformly
      "uninterruptible"
      
      The main remaining user of wait_on_bit{,_lock}_action is NFS
      which needs to use a freezer-aware schedule() call.
      
      A comment in fs/gfs2/glock.c notes that having multiple 'action'
      functions is useful as they display differently in the 'wchan'
      field of 'ps'. (and /proc/$PID/wchan).
      As the new bit_wait{,_io} functions are tagged "__sched", they
      will not show up at all, but something higher in the stack.  So
      the distinction will still be visible, only with different
      function names (gds2_glock_wait versus gfs2_glock_dq_wait in the
      gfs2/glock.c case).
      
      Since first version of this patch (against 3.15) two new action
      functions appeared, on in NFS and one in CIFS.  CIFS also now
      uses an action function that makes the same freezer aware
      schedule call as NFS.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Acked-by: David Howells <dhowells@redhat.com> (fscache, keys)
      Acked-by: Steven Whitehouse <swhiteho@redhat.com> (gfs2)
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Steve French <sfrench@samba.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Link: http://lkml.kernel.org/r/20140707051603.28027.72349.stgit@notabene.brownSigned-off-by: NIngo Molnar <mingo@kernel.org>
      74316201
    • J
      Bluetooth: Fix trying to initiate connections when acting as LE slave · f99353cf
      Johan Hedberg 提交于
      When we have at least one LE slave connection most (probably all)
      controllers will refuse to initiate any new connections. To avoid
      unnecessary failures simply check for this situation up-front and skip
      the connection attempt.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      f99353cf
    • J
      Bluetooth: Add a role parameter to hci_conn_add() · a5c4e309
      Johan Hedberg 提交于
      We need to be able to track slave vs master LE connections in
      hci_conn_hash, and to be able to do that we need to know the role of the
      connection by the time hci_conn_add_has() is called. This means in
      practice the hci_conn_add() call that creates the hci_conn_object.
      
      This patch adds a new role parameter to hci_conn_add() function to give
      the object its initial role value, and updates the callers to pass the
      appropriate role to it. Since the function now takes care of
      initializing both conn->role and conn->out values we can remove some
      other unnecessary assignments.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a5c4e309
    • J
      Bluetooth: Use explicit role instead of a bool in function parameters · e804d25d
      Johan Hedberg 提交于
      To make the code more understandable it makes sense to use the new HCI
      defines for connection role instead of a "bool master" parameter. This
      makes it immediately clear when looking at the function calls what the
      last parameter is describing.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      e804d25d
    • J
      Bluetooth: Convert HCI_CONN_MASTER flag to a conn->role variable · 40bef302
      Johan Hedberg 提交于
      Having a dedicated u8 role variable in the hci_conn struct greatly
      simplifies tracking of the role, since this is the native way that it's
      represented on the HCI level.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      40bef302
    • J
      Bluetooth: Add proper defines for HCI connection role · ba165a90
      Johan Hedberg 提交于
      All HCI commands and events, including LE ones, use 0x00 for master role
      and 0x01 for slave role. It makes therefore sense to add generic defines
      for these instead of the current LE_CONN_ROLE_MASTER. Having clean
      defines will also make it possible to provide simpler internal APIs.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      ba165a90
    • T
      net: set name_assign_type in alloc_netdev() · c835a677
      Tom Gundersen 提交于
      Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
      all users to pass NET_NAME_UNKNOWN.
      
      Coccinelle patch:
      
      @@
      expression sizeof_priv, name, setup, txqs, rxqs, count;
      @@
      
      (
      -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
      +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
      |
      -alloc_netdev_mq(sizeof_priv, name, setup, count)
      +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
      |
      -alloc_netdev(sizeof_priv, name, setup)
      +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
      )
      
      v9: move comments here from the wrong commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c835a677
  14. 15 7月, 2014 2 次提交