1. 19 2月, 2015 2 次提交
  2. 01 2月, 2015 3 次提交
  3. 29 1月, 2015 6 次提交
    • S
      Bluetooth: Fix sending Read Remote Extended Features command · ac363cf9
      Szymon Janc 提交于
      This command should only be used if remote device reports that it
      supports extended features. Otherwise command will fail and connection
      will be dropped.
      
      Some devices support SSP but don't support extended features so
      current check for SSP support is not enought.
      
      Instead of checking for SSP support just check if both ends support
      Extended Feature.
      
      < HCI Command: Create Connection (0x01|0x0005) plen 13
              Address: D0:9C:30:00:19:6F (Foster Electric Company, Limited)
              Packet type: 0xcc18
                DM1 may be used
                DH1 may be used
                DM3 may be used
                DH3 may be used
                DM5 may be used
                DH5 may be used
              Page scan repetition mode: R1 (0x01)
              Page scan mode: Mandatory (0x00)
              Clock offset: 0x94c8
              Role switch: Allow slave (0x01)
      > HCI Event: Command Status (0x0f) plen 4
            Create Connection (0x01|0x0005) ncmd 1
              Status: Success (0x00)
      > HCI Event: Connect Complete (0x03) plen 11
              Status: Success (0x00)
              Handle: 5
              Address: D0:9C:30:00:19:6F (Foster Electric Company, Limited)
              Link type: ACL (0x01)
              Encryption: Disabled (0x00)
      < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
              Handle: 5
      > HCI Event: Command Status (0x0f) plen 4
            Read Remote Supported Features (0x01|0x001b) ncmd 1
              Status: Success (0x00)
      > HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
              Address: D0:9C:30:00:19:6F (Foster Electric Company, Limited)
              Page scan repetition mode: R1 (0x01)
      > HCI Event: Read Remote Supported Features (0x0b) plen 11
              Status: Success (0x00)
              Handle: 5
              Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x07
                3 slot packets
                5 slot packets
                Encryption
                Slot offset
                Timing accuracy
                Role switch
                Hold mode
                Sniff mode
                Park state
                Power control requests
                Channel quality driven data rate (CQDDR)
                SCO link
                HV2 packets
                HV3 packets
                u-law log synchronous data
                A-law log synchronous data
                CVSD synchronous data
                Paging parameter negotiation
                Power control
                Transparent synchronous data
                Broadcast Encryption
                Enhanced Data Rate ACL 2 Mbps mode
                Enhanced Data Rate ACL 3 Mbps mode
                Enhanced inquiry scan
                Interlaced inquiry scan
                Interlaced page scan
                RSSI with inquiry results
                Extended SCO link (EV3 packets)
                EV4 packets
                EV5 packets
                AFH capable slave
                AFH classification slave
                LE Supported (Controller)
                3-slot Enhanced Data Rate ACL packets
                5-slot Enhanced Data Rate ACL packets
                Sniff subrating
                Pause encryption
                AFH capable master
                AFH classification master
                Enhanced Data Rate eSCO 2 Mbps mode
                Enhanced Data Rate eSCO 3 Mbps mode
                3-slot Enhanced Data Rate eSCO packets
                Extended Inquiry Response
                Simultaneous LE and BR/EDR (Controller)
                Secure Simple Pairing
                Encapsulated PDU
                Non-flushable Packet Boundary Flag
                Link Supervision Timeout Changed Event
                Inquiry TX Power Level
                Enhanced Power Control
      < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
              Handle: 5
              Page: 1
      > HCI Event: Command Status (0x0f) plen 4
            Read Remote Extended Features (0x01|0x001c) ncmd 1
              Status: Command Disallowed (0x0c)
      < HCI Command: Read Clock Offset (0x01|0x001f) plen 2
              Handle: 5
      > HCI Event: Command Status (0x0f) plen 4
            Read Clock Offset (0x01|0x001f) ncmd 1
              Status: Success (0x00)
      < HCI Command: Disconnect (0x01|0x0006) plen 3
              Handle: 5
              Reason: Remote User Terminated Connection (0x13)
      Signed-off-by: NSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      ac363cf9
    • 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
    • J
      Bluetooth: Fix notifying discovery state upon reset · 39c5d970
      Johan Hedberg 提交于
      When HCI_Reset is issued the discovery state is assumed to be stopped.
      The hci_cc_reset() handler was trying to set the state but it was doing
      it without using the hci_discovery_set_state() function. Because of this
      e.g. the mgmt Discovering event could go without being sent. This patch
      fixes the code to use the hci_discovery_set_state() function instead of
      just blindly setting the state value.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      39c5d970
    • M
      Bluetooth: Check for P-256 OOB values in Secure Connections Only mode · aa5b0345
      Marcel Holtmann 提交于
      If Secure Connections Only mode has been enabled, the it is important
      to check that OOB data for P-256 values is provided. In case it is not,
      then tell the remote side that no OOB data is present.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      aa5b0345
    • M
      Bluetooth: Use helper function to determine BR/EDR OOB data present · a83ed81e
      Marcel Holtmann 提交于
      When replying to the IO capability request for Secure Simple Pairing and
      Secure Connections, the OOB data present fields needs to set. Instead of
      making the calculation inline, split this into a separate helper
      function.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      a83ed81e
    • M
      Bluetooth: Clear P-192 values for OOB when in Secure Connections Only mode · 6665d057
      Marcel Holtmann 提交于
      When Secure Connections Only mode has been enabled and remote OOB data
      is requested, then only provide P-256 hash and randomizer vaulues. The
      fields for P-192 hash and randomizer should be set to zero.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      6665d057
  4. 24 1月, 2015 1 次提交
  5. 13 1月, 2015 2 次提交
  6. 25 12月, 2014 2 次提交
    • J
      Bluetooth: Fix accepting connections when not using mgmt · 6a8fc95c
      Johan Hedberg 提交于
      When connectable mode is enabled (page scan on) through some non-mgmt
      method the HCI_CONNECTABLE flag will not be set. For backwards
      compatibility with user space versions not using mgmt we should not
      require HCI_CONNECTABLE to be set if HCI_MGMT is not set.
      Reported-by: NPali Rohár <pali.rohar@gmail.com>
      Tested-by: NPali Rohár <pali.rohar@gmail.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org # 3.17+
      6a8fc95c
    • M
      Bluetooth: Fix controller configuration with HCI_QUIRK_INVALID_BDADDR · 8bfe8442
      Marcel Holtmann 提交于
      When controllers set the HCI_QUIRK_INVALID_BDADDR flag, it is required
      by userspace to program a valid public Bluetooth device address into
      the controller before it can be used.
      
      After successful address configuration, the internal state changes and
      the controller runs the complete initialization procedure. However one
      small difference is that this is no longer the HCI_SETUP stage. The
      HCI_SETUP stage is only valid during initial controller setup. In this
      case the stack runs the initialization as part of the HCI_CONFIG stage.
      
      The controller version information, default name and supported commands
      are only stored during HCI_SETUP. While these information are static,
      they are not read initially when HCI_QUIRK_INVALID_BDADDR is set. So
      when running in HCI_CONFIG state, these information need to be updated
      as well.
      
      This especially impacts Bluetooth 4.1 and later controllers using
      extended feature pages and second event mask page.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org # 3.17+
      8bfe8442
  7. 21 12月, 2014 1 次提交
  8. 20 12月, 2014 1 次提交
  9. 19 12月, 2014 2 次提交
  10. 11 12月, 2014 1 次提交
  11. 06 12月, 2014 1 次提交
    • M
      Bluetooth: Add support for handling LE Direct Advertising Report events · 2f010b55
      Marcel Holtmann 提交于
      When the controller sends a LE Direct Advertising Report event, the host
      must confirm that the resolvable random address provided matches with
      its own identity resolving key. If it does, then that advertising report
      needs to be processed. If it does not match, the report needs to be
      ignored.
      
      This patch adds full support for handling these new reports and using
      them for device discovery and connection handling. This means when a
      Bluetooth controller supports the Extended Scanner Filter Policies, it
      is possible to use directed advertising with LE privacy.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      2f010b55
  12. 05 12月, 2014 1 次提交
  13. 03 12月, 2014 6 次提交
  14. 19 11月, 2014 2 次提交
  15. 18 11月, 2014 1 次提交
  16. 15 11月, 2014 1 次提交
  17. 11 11月, 2014 1 次提交
  18. 07 11月, 2014 3 次提交
    • J
      Bluetooth: Send mgmt_connected only if state is BT_CONFIG · cb77c3ec
      Jaganath Kanakkassery 提交于
      If a remote name request is initiated while acl connection is going on,
      and if it fails then mgmt_connected will be sent. Evetually after acl
      connection, authentication will not be initiated and userspace will
      never get pairing reply.
      
      < HCI Command: Create Connection (0x01|0x0005) plen 13
          bdaddr AA:BB:CC:DD:EE:FF ptype 0xcc18 rswitch 0x01 clkoffset 0x2306 (valid)
          Packet type: DM1 DM3 DM5 DH1 DH3 DH5
      > HCI Event: Command Status (0x0f) plen 4
          Create Connection (0x01|0x0005) status 0x00 ncmd 1
      > HCI Event: Inquiry Complete (0x01) plen 1
          status 0x00
      < HCI Command: Remote Name Request (0x01|0x0019) plen 10
          bdaddr AA:BB:CC:DD:EE:FF mode 1 clkoffset 0x2306
      > HCI Event: Command Status (0x0f) plen 4
          Remote Name Request (0x01|0x0019) status 0x0c ncmd 1
          Error: Command Disallowed
      > HCI Event: Connect Complete (0x03) plen 11
          status 0x00 handle 50 bdaddr 00:0D:FD:47:53:B2 type ACL encrypt 0x00
      < HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
          handle 50
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
      > HCI Event: Max Slots Change (0x1b) plen 3
          handle 50 slots 5
      > HCI Event: Read Remote Supported Features (0x0b) plen 11
          status 0x00 handle 50
          Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x59 0x83
      < HCI Command: Read Remote Extended Features (0x01|0x001c) plen 3
          handle 50 page 1
      > HCI Event: Command Status (0x0f) plen 4
          Read Remote Extended Features (0x01|0x001c) status 0x00 ncmd 1
      > HCI Event: Read Remote Extended Features (0x23) plen 13
          status 0x00 handle 50 page 1 max 1
          Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
      
      This patch sends mgmt_connected in remote name command status only if
      conn->state is BT_CONFIG
      Signed-off-by: NJaganath Kanakkassery <jaganath.k@samsung.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      cb77c3ec
    • K
      Bluetooth: Sort switch cases by opcode's numeric value · 9645c76c
      Kuba Pawlak 提交于
      Opcodes in switch/case in hci_cmd_status_evt are not sorted
      by value. This patch restores proper ordering.
      Signed-off-by: NKuba Pawlak <kubax.t.pawlak@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      9645c76c
    • K
      Bluetooth: Clear role switch pending flag · 50fc85f1
      Kuba Pawlak 提交于
      If role switch was rejected by the controller and HCI Event: Command Status
      returned with status "Command Disallowed" (0x0C) the flag
      HCI_CONN_RSWITCH_PEND remains set. No further role switches are
      possible as this flag prevents us from sending any new HCI Switch Role
      requests and the only way to clear it is to receive a valid
      HCI Event Switch Role.
      
      This patch clears the flag if command was rejected.
      
      2013-01-01 00:03:44.209913 < HCI Command: Switch Role (0x02|0x000b) plen 7
          bdaddr BC:C6:DB:C4:6F:79 role 0x00
          Role: Master
      2013-01-01 00:03:44.210867 > HCI Event: Command Status (0x0f) plen 4
          Switch Role (0x02|0x000b) status 0x0c ncmd 1
          Error: Command Disallowed
      Signed-off-by: NKuba Pawlak <kubax.t.pawlak@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      50fc85f1
  19. 02 11月, 2014 2 次提交
  20. 31 10月, 2014 1 次提交