1. 19 6月, 2015 4 次提交
    • F
      Bluetooth: hci_core: remove obsolete adv_instance · d4c5af8f
      Florian Grandel 提交于
      Now that the obsolete adv_instance is no longer being referenced
      anywhere in the code it can be removed without breaking the build.
      Signed-off-by: NFlorian Grandel <fgrandel@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d4c5af8f
    • F
      Bluetooth: mgmt/hci_core: multi-adv for add_advertising*() · fffd38bc
      Florian Grandel 提交于
      The add_advertising() and add_advertising_complete() functions reference
      the now obsolete hdev->adv_instance struct. Both methods are being
      refactored to access the dynamic advertising instance list instead.
      
      This patch also introduces all logic necessary to actually deal with
      multiple instance advertising. Notably the mgmt_adv_inst_expired() and
      schedule_adv_inst() method are being referenced to schedule instances in
      a round robin fashion.
      
      This patch also introduces a "pending" flag into the adv_info struct.
      This is necessary to identify and remove recently added advertising
      instances when the HCI commands return with an error status code.
      Otherwise new advertising instances could be leaked without properly
      informing userspace about their existence.
      Signed-off-by: NFlorian Grandel <fgrandel@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      fffd38bc
    • F
      Bluetooth: hci_core/mgmt: move adv timeout to hdev · 5d900e46
      Florian Grandel 提交于
      Currently the delayed work managing advertising duration and timeout is
      part of the advertising instance structure. This is not correct as only
      a single instance can be advertised at any given time. To implement
      round robin advertising a single delayed work structure is needed.
      
      To fix this the delayed work structure is being moved to the hci_dev
      structure. The instance specific variable is renamed to "remaining_time"
      to make it clear that this is the remaining lifetime of the instance and
      not the current advertising timeout.
      Signed-off-by: NFlorian Grandel <fgrandel@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      5d900e46
    • F
      Bluetooth: hci_core/mgmt: Introduce multi-adv list · d2609b34
      Florian Grandel 提交于
      The current hci dev structure only supports a single advertising
      instance. To support multi-instance advertising it is necessary to
      introduce a linked list of advertising instances so that multiple
      advertising instances can be dynamically added and/or removed.
      
      In a first step, the existing adv_instance member of the hci_dev
      struct is supplemented by a linked list of advertising instances.
      This patch introduces the list and supporting list management
      infrastructure. The list is not being used yet.
      Signed-off-by: NFlorian Grandel <fgrandel@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d2609b34
  2. 09 6月, 2015 1 次提交
  3. 15 5月, 2015 1 次提交
    • F
      Bluetooth: Fix calls to __hci_cmd_sync() · cffd2eed
      Frederic Danis 提交于
      Remove test of command reply status as it is already performed by
      __hci_cmd_sync().
      
      __hci_cmd_sync_ev() function already returns an error if it got a
      non-zero status either through a Command Complete or a Command
      Status event.
      
      For both of these events the status is collected up in the event
      handlers called by hci_event_packet() and then passed as the second
      parameter to req_complete_skb(). The req_complete_skb() callback in
      turn is hci_req_sync_complete() for __hci_cmd_sync_ev() which stores
      the status in hdev->req_result. The hdev->req_result is then further
      converted through bt_to_errno() back in __hci_cmd_sync_ev().
      Signed-off-by: NFrederic Danis <frederic.danis@linux.intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      cffd2eed
  4. 14 5月, 2015 1 次提交
  5. 01 5月, 2015 1 次提交
  6. 08 4月, 2015 2 次提交
  7. 02 4月, 2015 5 次提交
  8. 31 3月, 2015 1 次提交
  9. 24 3月, 2015 1 次提交
  10. 22 3月, 2015 1 次提交
  11. 18 3月, 2015 1 次提交
  12. 14 3月, 2015 2 次提交
  13. 13 3月, 2015 5 次提交
  14. 11 3月, 2015 3 次提交
  15. 02 3月, 2015 2 次提交
  16. 19 2月, 2015 2 次提交
  17. 18 2月, 2015 1 次提交
  18. 15 2月, 2015 1 次提交
  19. 02 2月, 2015 1 次提交
  20. 31 1月, 2015 1 次提交
  21. 29 1月, 2015 3 次提交
    • M
      Bluetooth: Move smp_unregister() into hci_dev_do_close() function · 64dae967
      Marcel Holtmann 提交于
      The smp_unregister() function needs to be called every time the
      controller is powered down. There are multiple entry points when
      this can happen. One is "hciconfig hci0 reset" which will throw
      a WARN_ON when LE support has been enabled.
      
      [   78.564620] WARNING: CPU: 0 PID: 148 at net/bluetooth/smp.c:3075 smp_register+0xf1/0x170()
      [   78.564622] Modules linked in:
      [   78.564628] CPU: 0 PID: 148 Comm: kworker/u3:1 Not tainted 3.19.0-rc4-devel+ #404
      [   78.564629] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
      [   78.564635] Workqueue: hci0 hci_rx_work
      [   78.564638]  ffffffff81b4a7a2 ffff88001cb2fb38 ffffffff8161d881 0000000080000000
      [   78.564642]  0000000000000000 ffff88001cb2fb78 ffffffff8103b870 696e55206e6f6f6d
      [   78.564645]  ffff88001d965000 0000000000000000 0000000000000000 ffff88001d965000
      [   78.564648] Call Trace:
      [   78.564655]  [<ffffffff8161d881>] dump_stack+0x4f/0x7b
      [   78.564662]  [<ffffffff8103b870>] warn_slowpath_common+0x80/0xc0
      [   78.564667]  [<ffffffff81544b00>] ? add_uuid+0x1f0/0x1f0
      [   78.564671]  [<ffffffff8103b955>] warn_slowpath_null+0x15/0x20
      [   78.564674]  [<ffffffff81562d81>] smp_register+0xf1/0x170
      [   78.564680]  [<ffffffff81081236>] ? lock_timer_base.isra.30+0x26/0x50
      [   78.564683]  [<ffffffff81544bf0>] powered_complete+0xf0/0x120
      [   78.564688]  [<ffffffff8152e622>] hci_req_cmd_complete+0x82/0x260
      [   78.564692]  [<ffffffff8153554f>] hci_cmd_complete_evt+0x6cf/0x2e20
      [   78.564697]  [<ffffffff81623e43>] ? _raw_spin_unlock_irqrestore+0x13/0x30
      [   78.564701]  [<ffffffff8106b0af>] ? __wake_up_sync_key+0x4f/0x60
      [   78.564705]  [<ffffffff8153a2ab>] hci_event_packet+0xbcb/0x2e70
      [   78.564709]  [<ffffffff814094d3>] ? skb_release_all+0x23/0x30
      [   78.564711]  [<ffffffff81409529>] ? kfree_skb+0x29/0x40
      [   78.564715]  [<ffffffff815296c8>] hci_rx_work+0x1c8/0x3f0
      [   78.564719]  [<ffffffff8105bd91>] ? get_parent_ip+0x11/0x50
      [   78.564722]  [<ffffffff8105be25>] ? preempt_count_add+0x55/0xb0
      [   78.564727]  [<ffffffff8104f65f>] process_one_work+0x12f/0x360
      [   78.564731]  [<ffffffff8104ff9b>] worker_thread+0x6b/0x4b0
      [   78.564735]  [<ffffffff8104ff30>] ? cancel_delayed_work_sync+0x10/0x10
      [   78.564738]  [<ffffffff810542fa>] kthread+0xea/0x100
      [   78.564742]  [<ffffffff81620000>] ? __schedule+0x3e0/0x980
      [   78.564745]  [<ffffffff81054210>] ? kthread_create_on_node+0x180/0x180
      [   78.564749]  [<ffffffff816246ec>] ret_from_fork+0x7c/0xb0
      [   78.564752]  [<ffffffff81054210>] ? kthread_create_on_node+0x180/0x180
      [   78.564755] ---[ end trace 8b0d943af76d3736 ]---
      
      This warning is not critical and has only been placed in the code to
      actually catch this exact situation. To avoid triggering it move
      the smp_unregister() into hci_dev_do_close() which will now also
      take care of remove the SMP channel. It is safe to call this function
      since it only remove the channel if it has been previously registered.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      64dae967
    • M
      Bluetooth: Perform a power cycle when receiving hardware error event · c7741d16
      Marcel Holtmann 提交于
      When receiving a HCI Hardware Error event, the controller should be
      assumed to be non-functional until issuing a HCI Reset command.
      
      The Bluetooth hardware errors are vendor specific and so add a
      new hdev->hw_error callback that drivers can provide to run extra
      code to handle the hardware error.
      
      After completing the vendor specific error handling perform a full
      reset of the Bluetooth stack by closing and re-opening the transport.
      Based-on-patch-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      c7741d16
    • M
      Bluetooth: Introduce hci_dev_do_reset helper function · 5c912495
      Marcel Holtmann 提交于
      Split the hci_dev_reset ioctl handling into using hci_dev_do_reset
      helper function. Similar to what has been done with hci_dev_do_open
      and hci_dev_do_close.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      5c912495