1. 18 10月, 2013 8 次提交
  2. 17 10月, 2013 1 次提交
  3. 16 10月, 2013 2 次提交
    • M
      Bluetooth: Update class of device on discoverable timeout · d1967ff8
      Marcel Holtmann 提交于
      When the discoverable timeout triggers and limited discoverable mode
      was used, then the class of device needs to be updated to remove
      the limited discoverable bit.
      
      To keep the class of device logic in a central place, expose a new
      function mgmt_discoverable_timeout that can be called from the
      timeout callback. In case the class of device value needs updating,
      it will add the HCI command to the transaction.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      d1967ff8
    • M
      Bluetooth: Add support for entering limited discoverable mode · 310a3d48
      Marcel Holtmann 提交于
      The limited discoverable mode should be used when a device is only
      discoverable for a certain amount of time and after that it returns
      back into being non-discoverable.
      
      This adds another option to the set discoverable management command
      to clearly distinguish limited discoverable from general discoverable
      mode.
      
      While the general discoverable mode can be set with a specific
      timeout or as permanent setting, the limited discoverable mode
      requires a timeout. The timeout is flexible and the kernel will
      not enforce any specific limitations. That GAP part of this is
      required by userspace to enforce according to the Bluetooth core
      specification.
      
      Devices in limited discoverable mode can still be found by the
      general discovery procedure. It is mandatory that a device sets
      both GIAC and LIAC when entering limited discoverable mode.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      310a3d48
  4. 15 10月, 2013 4 次提交
  5. 13 10月, 2013 1 次提交
    • M
      Bluetooth: Remove pointless bdaddr_to_le() helper function · 79d95a19
      Marcel Holtmann 提交于
      The bdaddr_to_le() function tries to convert the internal address
      type to one that matches the HCI address type for LE. It does not
      handle any address types not used by LE and in the end just make
      the code a lot harder to read.
      
      So instead of just hiding behind a magic function, just convert
      the internal address type where it needs to be converted. And it
      turns out that these are only two cases anyway. One when creating
      new LE connections and the other when loading the long term keys.
      In both cases this makes it more clear on what it going on.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      79d95a19
  6. 12 10月, 2013 3 次提交
    • M
      Bluetooth: Fix HCI init for 1st generation BlueFRITZ! devices · 4ca048e3
      Marcel Holtmann 提交于
      The 1st generation of BlueFRITZ! devices from AVM Berlin pretend
      to be HCI version 1.2 controllers, but they are not. They are simple
      Bluetooth 1.1 devices.
      
      Since this company never created any newer controllers, it is safe
      to use the manufacturer ID instead of an USB quirk.
      
      < HCI Command: Read Page Scan Activity (0x03|0x001b) plen 0
      > HCI Event: Command Complete (0x0e) plen 8
            Read Page Scan Activity (0x03|0x001b) ncmd 1
              Status: Success (0x00)
              Interval: 1280.000 msec (0x0800)
              Window: 21.250 msec (0x0022)
      < HCI Command: Read Page Scan Type (0x03|0x0046) plen 0
      > HCI Event: Command Status (0x0f) plen 4
            Read Page Scan Type (0x03|0x0046) ncmd 1
              Status: Unknown HCI Command (0x01)
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      4ca048e3
    • M
      Bluetooth: Fix endless loop with HCI_QUIRK_RESET_ON_CLOSE · 3a6afbd2
      Marcel Holtmann 提交于
      Really early versions of the Bluetooth specification were unclear
      with the behavior of HCI Reset for USB devices. They assumed that
      also an USB reset needs to be issued. Later Bluetooth specifications
      cleared this out and it is safe to call HCI Reset without affecting
      the transport.
      
      For old devices that misbehave, the HCI_QUIRK_RESET_ON_CLOSE quirk
      was introduced to postpone the HCI Reset until the device was no
      longer in use.
      
      One of these devices is the Digianswer BPA-105 Bluetooth Protocol
      Analyzer. The only problem now is that with the quirk set, the
      HCI Reset is also executed at the end of the setup phase. So the
      controller gets configured and then it disconnects from the USB
      bus, connects again, gets configured and of course disconnects
      again. This game goes on forever.
      
      For devices that need HCI_QUIRK_RESET_ON_CLOSE it is important
      that the HCI Reset is not executed after the setup phase. In
      specific when HCI_AUTO_OFF is set, do not call HCI Reset when
      closing the device.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      3a6afbd2
    • M
      Bluetooth: Make LE scan interval and window a controller option · bef64738
      Marcel Holtmann 提交于
      The scan interval and window for LE passive scanning and connection
      establishment should be configurable on a per controller basis. So
      introduce a setting that later on will allow modifying it.
      
      This setting does not affect LE active scanning during device
      discovery phase. As long as that phase uses interleaved discovery,
      it will continuously scan.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      bef64738
  7. 11 10月, 2013 6 次提交
  8. 07 10月, 2013 5 次提交
  9. 06 10月, 2013 4 次提交
  10. 05 10月, 2013 1 次提交
  11. 02 10月, 2013 5 次提交
    • J
      Bluetooth: Fix advertising data flags with disabled BR/EDR · 11802b29
      Johan Hedberg 提交于
      We shouldn't include the simultaneous LE & BR/EDR flags in the LE
      advertising data if BR/EDR is disabled on a dual-mode controller. This
      patch fixes this issue and ensures that the create_ad function generates
      the correct flags when BR/EDR is disabled.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      11802b29
    • J
      Bluetooth: Introduce a new HCI_BREDR_ENABLED flag · 56f87901
      Johan Hedberg 提交于
      To allow treating dual-mode (BR/EDR/LE) controllers as single-mode ones
      (LE-only) we want to introduce a new HCI_BREDR_ENABLED flag to track
      whether BR/EDR is enabled or not (previously we simply looked at the
      feature bit with lmp_bredr_enabled).
      
      This patch add the new flag and updates the relevant places to test
      against it instead of using lmp_bredr_enabled. The flag is by default
      enabled when registering an adapter and only cleared if necessary once
      the local features have been read during the HCI init procedure.
      
      We cannot completely block BR/EDR usage in case user space uses raw HCI
      sockets but the patch tries to block this in places where possible, such
      as the various BR/EDR specific ioctls.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      56f87901
    • J
      Bluetooth: Fix workqueue synchronization in hci_dev_open · e1d08f40
      Johan Hedberg 提交于
      When hci_sock.c calls hci_dev_open it needs to ensure that there isn't
      pending work in progress, such as that which is scheduled for the
      initial setup procedure or the one for automatically powering off after
      the setup procedure. This adds the necessary calls to ensure that any
      previously scheduled work is completed before attempting to call
      hci_dev_do_open.
      
      This patch fixes a race with old user space versions where we might
      receive a HCIDEVUP ioctl before the setup procedure has been completed.
      When that happens the setup procedures callback may fail early and leave
      the device in an inconsistent state, causing e.g. the setup callback to
      be (incorrectly) called more than once.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      e1d08f40
    • J
      Bluetooth: Refactor hci_dev_open to a separate hci_dev_do_open function · cbed0ca1
      Johan Hedberg 提交于
      The requirements of an external call to hci_dev_open from hci_sock.c are
      different to that from within hci_core.c. In the former case we want to
      flush any pending work in hdev->req_workqueue whereas in the latter we
      don't (since there we are already calling from within the workqueue
      itself). This patch does the necessary refactoring to a separate
      hci_dev_do_open function (analogous to hci_dev_do_close) but does not
      yet introduce the synchronizations relating to the workqueue usage.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      cbed0ca1
    • M
      Bluetooth: Provide high speed configuration option · 848566b3
      Marcel Holtmann 提交于
      Hiding the Bluetooth high speed support behind a module parameter is
      not really useful. This can be enabled and disabled at runtime via
      the management interface. This also has the advantage that this can
      now be changed per controller and not just global.
      
      This patch removes the module parameter and exposes the high speed
      setting of the management interface to all controllers.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      848566b3