1. 12 10月, 2013 5 次提交
    • M
      Bluetooth: Add MGMT_OP_SET_SCAN_PARAMS to supported commands list · 7f72134e
      Marcel Holtmann 提交于
      When adding support for MGMT_OP_SET_SCAN_PARAMS command the addition
      to the supported commands list has been forgotten. This is needed
      for userspace to detect if the command is supported or not.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      7f72134e
    • M
      Bluetooth: Don't advertise high speed support without SSP · a82974c9
      Marcel Holtmann 提交于
      It is not allowed to enable high speed support when Secure Simple
      Pairing is not available or disabled.
      
      However the support for high speed gets advertised on a controller
      that does not even support Secure Simple Pairing. Since there is
      no way to enable high speed support on such a controller, do not
      even advertise its support.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      a82974c9
    • 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: Add management command for setting LE scan parameters · 14b49b9a
      Marcel Holtmann 提交于
      The scan interval and window parameters are used for LE passive
      background scanning and connection establishment. This allows
      userspace to change the values.
      
      These two values should be kept in sync with whatever is used for
      the scan parameters service on remote devices. And it puts the
      controlling daemon (for example bluetoothd) in charge of setting
      the values.
      
      Main use case would be to switch between two sets of values. One
      for foreground applications and one for background applications.
      
      At this moment, the values are only used for manual connection
      establishment, but soon that should be extended to background
      scanning and automatic connection establishment.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      14b49b9a
    • 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
  2. 11 10月, 2013 33 次提交
  3. 10 10月, 2013 2 次提交
    • J
      Bluetooth: Fix potential double-frees of L2CAP skbs · c4e5bafa
      Johan Hedberg 提交于
      The l2cap_recv_frame function is expected to take ownership and
      eventually free the skb passed to it. We need to ensure that the
      conn->rx_skb pointer is no longer reachable when calling
      l2cap_recv_frame so that no other function, such as l2cap_conn_del, may
      think that it can free conn->rx_skb.
      
      An actual situation when this can happen is when smp_sig_channel (called
      from l2cap_recv_frame) fails and l2cap_conn_del gets called as a
      consequence. The l2cap_conn_del function would then try to free
      conn->rx_skb, but as the same skb was just passed to smp_sig_channel and
      freed we get a double-free.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c4e5bafa
    • M
      Bluetooth: Restrict high speed support to SSP enabled controllers · 9ecb3e24
      Marcel Holtmann 提交于
      The support for Bluetooth High Speed can only be enabled on controllers
      where also Secure Simple Pairing has been enabled. Trying to enable
      high speed when SSP is disabled will result into an error. Disabling
      SSP will at the same time disable high speed as well.
      
      It is required to enforce this dependency on SSP since high speed
      support is only defined for authenticated, unauthenticated and
      debug link keys. These link key types require SSP.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      9ecb3e24