1. 19 12月, 2018 1 次提交
  2. 14 10月, 2018 1 次提交
  3. 27 9月, 2018 1 次提交
  4. 10 8月, 2018 1 次提交
  5. 06 8月, 2018 1 次提交
  6. 30 7月, 2018 8 次提交
    • J
      Bluetooth: Handle ADv set terminated event · acf0aeae
      Jaganath Kanakkassery 提交于
      This event comes after connection complete event for incoming
      connections. Since we now have different random address for
      each instance, conn resp address is assigned from this event.
      
      As of now only connection part is handled as we are not
      enabling duration or max num of events while starting ext adv.
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      acf0aeae
    • J
      Bluetooth: Implement Set ADV set random address · a73c046a
      Jaganath Kanakkassery 提交于
      This basically sets the random address for the adv instance
      Random address can be set only if the instance is created which
      is done in Set ext adv param.
      
      Random address and rpa expire timer and flags have been added
      to adv instance which will be used when the respective
      instance is scheduled.
      
      This introduces a hci_get_random_address() which returns the
      own address type and random address (rpa or nrpa) based
      on the instance flags and hdev flags. New function is required
      since own address type should be known before setting adv params
      but address can be set only after setting params.
      
      < HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7
              Advertising handle: 0x00
              Advertising random address: 3C:8E:56:9B:77:84 (OUI 3C-8E-56)
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Advertising Set Random Address (0x08|0x0035) ncmd 1
              Status: Success (0x00)
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a73c046a
    • J
      Bluetooth: Implement disable and removal of adv instance · 45b7749f
      Jaganath Kanakkassery 提交于
      If ext adv is enabled then use ext adv to disable as well.
      Also remove the adv set during LE disable.
      
      < HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 2
              Extended advertising: Disabled (0x00)
              Number of sets: Disable all sets (0x00)
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
              Status: Success (0x00)
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      45b7749f
    • J
      Bluetooth: Use Set ext adv/scan rsp data if controller supports · a0fb3726
      Jaganath Kanakkassery 提交于
      This patch implements Set Ext Adv data and Set Ext Scan rsp data
      if controller support extended advertising.
      
      Currently the operation is set as Complete data and fragment
      preference is set as no fragment
      
      < HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 35
              Handle: 0x00
              Operation: Complete extended advertising data (0x03)
              Fragment preference: Minimize fragmentation (0x01)
              Data length: 0x15
              16-bit Service UUIDs (complete): 2 entries
                Heart Rate (0x180d)
                Battery Service (0x180f)
              Name (complete): Test LE
              Company: Google (224)
                Data: 0102
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Extended Advertising Data (0x08|0x0037) ncmd 1
              Status: Success (0x00)
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a0fb3726
    • J
      Bluetooth: Impmlement extended adv enable · de181e88
      Jaganath Kanakkassery 提交于
      This patch basically replaces legacy adv with extended adv
      based on the controller support. Currently there is no
      design change. ie only one adv set will be enabled at a time.
      
      This also adds tx_power in instance and store whatever returns
      from Set_ext_parameter, use the same in adv data as well.
      For instance 0 tx_power is stored in hdev only.
      
      < HCI Command: LE Set Extended Advertising Parameters (0x08|0x0036) plen 25
              Handle: 0x00
              Properties: 0x0010
                Use legacy advertising PDUs: ADV_NONCONN_IND
              Min advertising interval: 1280.000 msec (0x0800)
              Max advertising interval: 1280.000 msec (0x0800)
              Channel map: 37, 38, 39 (0x07)
              Own address type: Random (0x01)
              Peer address type: Public (0x00)
              Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
              Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
              TX power: 127 dbm (0x7f)
              Primary PHY: LE 1M (0x01)
              Secondary max skip: 0x00
              Secondary PHY: LE 1M (0x01)
              SID: 0x00
              Scan request notifications: Disabled (0x00)
      > HCI Event: Command Complete (0x0e) plen 5
            LE Set Extended Advertising Parameters (0x08|0x0036) ncmd 1
              Status: Success (0x00)
              TX power (selected): 7 dbm (0x07)
      < HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
              Extended advertising: Enabled (0x01)
              Number of sets: 1 (0x01)
              Entry 0
                Handle: 0x00
                Duration: 0 ms (0x00)
                Max ext adv events: 0
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
              Status: Success (0x00)
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      de181e88
    • J
      Bluetooth: Read no of adv sets during init · 6b49bcb4
      Jaganath Kanakkassery 提交于
      This patch reads the number of advertising sets in the controller
      during init and save it in hdev.
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      6b49bcb4
    • J
      Bluetooth: Handle extended ADV PDU types · b2cc9761
      Jaganath Kanakkassery 提交于
      This patch defines the extended ADV types and handle it in ADV report.
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      b2cc9761
    • J
      Bluetooth: Implement Set PHY Confguration command · 0314f286
      Jaganath Kanakkassery 提交于
      This enables user to set phys which will be used in all subsequent
      connections. Also host will use the same in LE scanning as well.
      
      @ MGMT Command: Set PHY Configuration (0x0045) plen 4
              Selected PHYs: 0x7fff
                BR 1M 1SLOT
                BR 1M 3SLOT
                BR 1M 5SLOT
                EDR 2M 1SLOT
                EDR 2M 3SLOT
                EDR 2M 5SLOT
                EDR 3M 1SLOT
                EDR 3M 3SLOT
                EDR 3M 5SLOT
                LE 1M TX
                LE 1M RX
                LE 2M TX
                LE 2M RX
                LE CODED TX
                LE CODED RX
      < HCI Command: LE Set Default PHY (0x08|0x0031) plen 3
              All PHYs preference: 0x00
              TX PHYs preference: 0x07
                LE 1M
                LE 2M
                LE Coded
              RX PHYs preference: 0x07
                LE 1M
                LE 2M
                LE Coded
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Default PHY (0x08|0x0031) ncmd 1
              Status: Success (0x00)
      @ MGMT Event: Command Complete (0x0001) plen 3
            Set PHY Configuration (0x0045) plen 0
              Status: Success (0x00)
      @ MGMT Event: PHY Configuration Changed (0x0026) plen 4
              Selected PHYs: 0x7fff
                BR 1M 1SLOT
                BR 1M 3SLOT
                BR 1M 5SLOT
                EDR 2M 1SLOT
                EDR 2M 3SLOT
                EDR 2M 5SLOT
                EDR 3M 1SLOT
                EDR 3M 3SLOT
                EDR 3M 5SLOT
                LE 1M TX
                LE 1M RX
                LE 2M TX
                LE 2M RX
                LE CODED TX
                LE CODED RX
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0314f286
  7. 07 7月, 2018 5 次提交
    • J
      Bluetooth: Use extended LE Connection if supported · 4d94f95d
      Jaganath Kanakkassery 提交于
      This implements extended LE craete connection and enhanced
      LE conn complete event if the controller supports.
      
      For now it is as good as legacy LE connection and event as
      no new features in the extended connection is handled.
      
      < HCI Command: LE Extended Create Connection (0x08|0x0043) plen 26
              Filter policy: White list is not used (0x00)
              Own address type: Public (0x00)
              Peer address type: Random (0x01)
              Peer address: DB:7E:2E:1D:85:E8 (Static)
              Initiating PHYs: 0x01
              Entry 0: LE 1M
                Scan interval: 60.000 msec (0x0060)
                Scan window: 60.000 msec (0x0060)
                Min connection interval: 50.00 msec (0x0028)
                Max connection interval: 70.00 msec (0x0038)
                Connection latency: 0 (0x0000)
                Supervision timeout: 420 msec (0x002a)
                Min connection length: 0.000 msec (0x0000)
                Max connection length: 0.000 msec (0x0000)
      > HCI Event: Command Status (0x0f) plen 4
            LE Extended Create Connection (0x08|0x0043) ncmd 2
              Status: Success (0x00)
      > HCI Event: LE Meta Event (0x3e) plen 31
            LE Enhanced Connection Complete (0x0a)
              Status: Success (0x00)
              Handle: 3585
              Role: Master (0x00)
              Peer address type: Random (0x01)
              Peer address: DB:7E:2E:1D:85:E8 (Static)
              Local resolvable private address: 00:00:00:00:00:00 (Non-Resolvable)
              Peer resolvable private address: 00:00:00:00:00:00 (Non-Resolvable)
              Connection interval: 67.50 msec (0x0036)
              Connection latency: 0 (0x0000)
              Supervision timeout: 420 msec (0x002a)
              Master clock accuracy: 0x00
      @ MGMT Event: Device Connected (0x000b) plen 40
              LE Address: DB:7E:2E:1D:85:E8 (Static)
              Flags: 0x00000000
              Data length: 27
              Name (complete): Designer Mouse
              Appearance: Mouse (0x03c2)
              Flags: 0x05
                LE Limited Discoverable Mode
                BR/EDR Not Supported
              16-bit Service UUIDs (complete): 1 entry
                Human Interface Device (0x1812)
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      4d94f95d
    • J
      Bluetooth: Introduce helpers for le conn status and complete · d12fb056
      Jaganath Kanakkassery 提交于
      This is done so that the helpers can be used for extended conn
      implementation which will be done in subsequent patch.
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d12fb056
    • J
      Bluetooth: Process extended ADV report event · c215e939
      Jaganath Kanakkassery 提交于
      This patch enables Extended ADV report event if extended scanning
      is supported in the controller and process the same.
      
      The new features are not handled and for now its as good as
      legacy ADV report.
      
      > HCI Event: LE Meta Event (0x3e) plen 53
            LE Extended Advertising Report (0x0d)
              Num reports: 1
              Entry 0
                Event type: 0x0013
                  Props: 0x0013
                    Connectable
                    Scannable
                    Use legacy advertising PDUs
                  Data status: Complete
                Legacy PDU Type: ADV_IND (0x0013)
                Address type: Random (0x01)
                Address: DB:7E:2E:1A:85:E8 (Static)
                Primary PHY: LE 1M
                Secondary PHY: LE 1M
                SID: 0x00
                TX power: 0 dBm
                RSSI: -90 dBm (0xa6)
                Periodic advertising invteral: 0.00 msec (0x0000)
                Direct address type: Public (0x00)
                Direct address: 00:00:00:00:00:00 (OUI 00-00-00)
                Data length: 0x1b
              0f 09 44 65 73 69 67 6e 65 72 20 4d 6f 75 73 65  ..Designer Mouse
              03 19 c2 03 02 01 05 03 03 12 18                 ...........
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c215e939
    • J
      Bluetooth: Use extended scanning if controller supports · a2344b9e
      Jaganath Kanakkassery 提交于
      This implements Set extended scan param and set extended scan enable
      commands and use it for start LE scan based on controller support.
      
      The new features added in these commands are setting of new PHY for
      scanning and setting of scan duration. Both features are disabled
      for now, meaning only 1M PHY is set and scan duration is set to 0
      which means that scanning will be done untill scan disable is called.
      
      < HCI Command: LE Set Extended Scan Parameters (0x08|0x0041) plen 8
              Own address type: Random (0x01)
              Filter policy: Accept all advertisement (0x00)
              PHYs: 0x01
              Entry 0: LE 1M
                Type: Active (0x01)
                Interval: 11.250 msec (0x0012)
                Window: 11.250 msec (0x0012)
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Extended Scan Parameters (0x08|0x0041) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Set Extended Scan Enable (0x08|0x0042) plen 6
              Extended scan: Enabled (0x01)
              Filter duplicates: Enabled (0x01)
              Duration: 0 msec (0x0000)
              Period: 0.00 sec (0x0000)
      > HCI Event: Command Complete (0x0e) plen 4
            LE Set Extended Scan Enable (0x08|0x0042) ncmd 2
              Status: Success (0x00)
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a2344b9e
    • J
      Bluetooth: Introduce helpers for LE set scan start and complete · 3baef810
      Jaganath Kanakkassery 提交于
      Introduce a helper hci_req_start_scan() which starts an LE
      scan and call it from passive_Scan() and active_scan().
      There is not functionality change in this patch.
      
      This is basically done to enable extended scanning if the
      controller supports which will be done in the subsequent
      patch
      Signed-off-by: NJaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      3baef810
  8. 06 7月, 2018 2 次提交
    • A
      Bluetooth: Add HCI command for clear Resolv list · 545f2596
      Ankit Navik 提交于
      Check for Resolv list supported by controller. So check the supported
      commmand first before issuing this command i.e.,HCI_OP_LE_CLEAR_RESOLV_LIST
      
      Before patch:
      < HCI Command: LE Read White List... (0x08|0x000f) plen 0  #55 [hci0] 13.338168
      > HCI Event: Command Complete (0x0e) plen 5                #56 [hci0] 13.338842
            LE Read White List Size (0x08|0x000f) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Clear White List (0x08|0x0010) plen 0    #57 [hci0] 13.339029
      > HCI Event: Command Complete (0x0e) plen 4                #58 [hci0] 13.339939
            LE Clear White List (0x08|0x0010) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0  #59 [hci0] 13.340152
      > HCI Event: Command Complete (0x0e) plen 5                #60 [hci0] 13.340952
            LE Read Resolving List Size (0x08|0x002a) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0  #61 [hci0] 13.341180
      > HCI Event: Command Complete (0x0e) plen 12               #62 [hci0] 13.341898
            LE Read Maximum Data Length (0x08|0x002f) ncmd 1
              Status: Success (0x00)
              Max TX octets: 251
              Max TX time: 17040
              Max RX octets: 251
              Max RX time: 17040
      
      After patch:
      < HCI Command: LE Read White List... (0x08|0x000f) plen 0  #55 [hci0] 28.919131
      > HCI Event: Command Complete (0x0e) plen 5                #56 [hci0] 28.920016
            LE Read White List Size (0x08|0x000f) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Clear White List (0x08|0x0010) plen 0    #57 [hci0] 28.920164
      > HCI Event: Command Complete (0x0e) plen 4                #58 [hci0] 28.920873
            LE Clear White List (0x08|0x0010) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0  #59 [hci0] 28.921109
      > HCI Event: Command Complete (0x0e) plen 5                #60 [hci0] 28.922016
            LE Read Resolving List Size (0x08|0x002a) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Clear Resolving... (0x08|0x0029) plen 0  #61 [hci0] 28.922166
      > HCI Event: Command Complete (0x0e) plen 4                #62 [hci0] 28.922872
            LE Clear Resolving List (0x08|0x0029) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0  #63 [hci0] 28.923117
      > HCI Event: Command Complete (0x0e) plen 12               #64 [hci0] 28.924030
            LE Read Maximum Data Length (0x08|0x002f) ncmd 1
              Status: Success (0x00)
              Max TX octets: 251
              Max TX time: 17040
              Max RX octets: 251
              Max RX time: 17040
      Signed-off-by: NAnkit Navik <ankit.p.navik@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      545f2596
    • A
      Bluetooth: Store Resolv list size · cfdb0c2d
      Ankit Navik 提交于
      When the controller supports the Read LE Resolv List size feature, the
      maximum list size are read and now stored.
      
      Before patch:
      < HCI Command: LE Read White List... (0x08|0x000f) plen 0  #55 [hci0] 17.979791
      > HCI Event: Command Complete (0x0e) plen 5                #56 [hci0] 17.980629
            LE Read White List Size (0x08|0x000f) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Clear White List (0x08|0x0010) plen 0    #57 [hci0] 17.980786
      > HCI Event: Command Complete (0x0e) plen 4                #58 [hci0] 17.981627
            LE Clear White List (0x08|0x0010) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0  #59 [hci0] 17.981786
      > HCI Event: Command Complete (0x0e) plen 12               #60 [hci0] 17.982636
            LE Read Maximum Data Length (0x08|0x002f) ncmd 1
              Status: Success (0x00)
              Max TX octets: 251
              Max TX time: 17040
              Max RX octets: 251
              Max RX time: 17040
      
      After patch:
      < HCI Command: LE Read White List... (0x08|0x000f) plen 0  #55 [hci0] 13.338168
      > HCI Event: Command Complete (0x0e) plen 5                #56 [hci0] 13.338842
            LE Read White List Size (0x08|0x000f) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Clear White List (0x08|0x0010) plen 0    #57 [hci0] 13.339029
      > HCI Event: Command Complete (0x0e) plen 4                #58 [hci0] 13.339939
            LE Clear White List (0x08|0x0010) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Read Resolving L.. (0x08|0x002a) plen 0  #59 [hci0] 13.340152
      > HCI Event: Command Complete (0x0e) plen 5                #60 [hci0] 13.340952
            LE Read Resolving List Size (0x08|0x002a) ncmd 1
              Status: Success (0x00)
              Size: 25
      < HCI Command: LE Read Maximum Dat.. (0x08|0x002f) plen 0  #61 [hci0] 13.341180
      > HCI Event: Command Complete (0x0e) plen 12               #62 [hci0] 13.341898
            LE Read Maximum Data Length (0x08|0x002f) ncmd 1
              Status: Success (0x00)
              Max TX octets: 251
              Max TX time: 17040
              Max RX octets: 251
              Max RX time: 17040
      Signed-off-by: NAnkit Navik <ankit.p.navik@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      cfdb0c2d
  9. 18 5月, 2018 1 次提交
  10. 03 4月, 2018 1 次提交
    • S
      Bluetooth: Fix connection if directed advertising and privacy is used · 082f2300
      Szymon Janc 提交于
      Local random address needs to be updated before creating connection if
      RPA from LE Direct Advertising Report was resolved in host. Otherwise
      remote device might ignore connection request due to address mismatch.
      
      This was affecting following qualification test cases:
      GAP/CONN/SCEP/BV-03-C, GAP/CONN/GCEP/BV-05-C, GAP/CONN/DCEP/BV-05-C
      
      Before patch:
      < HCI Command: LE Set Random Address (0x08|0x0005) plen 6          #11350 [hci0] 84680.231216
              Address: 56:BC:E8:24:11:68 (Resolvable)
                Identity type: Random (0x01)
                Identity: F2:F1:06:3D:9C:42 (Static)
      > HCI Event: Command Complete (0x0e) plen 4                        #11351 [hci0] 84680.246022
            LE Set Random Address (0x08|0x0005) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7         #11352 [hci0] 84680.246417
              Type: Passive (0x00)
              Interval: 60.000 msec (0x0060)
              Window: 30.000 msec (0x0030)
              Own address type: Random (0x01)
              Filter policy: Accept all advertisement, inc. directed unresolved RPA (0x02)
      > HCI Event: Command Complete (0x0e) plen 4                        #11353 [hci0] 84680.248854
            LE Set Scan Parameters (0x08|0x000b) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2             #11354 [hci0] 84680.249466
              Scanning: Enabled (0x01)
              Filter duplicates: Enabled (0x01)
      > HCI Event: Command Complete (0x0e) plen 4                        #11355 [hci0] 84680.253222
            LE Set Scan Enable (0x08|0x000c) ncmd 1
              Status: Success (0x00)
      > HCI Event: LE Meta Event (0x3e) plen 18                          #11356 [hci0] 84680.458387
            LE Direct Advertising Report (0x0b)
              Num reports: 1
              Event type: Connectable directed - ADV_DIRECT_IND (0x01)
              Address type: Random (0x01)
              Address: 53:38:DA:46:8C:45 (Resolvable)
                Identity type: Public (0x00)
                Identity: 11:22:33:44:55:66 (OUI 11-22-33)
              Direct address type: Random (0x01)
              Direct address: 7C:D6:76:8C:DF:82 (Resolvable)
                Identity type: Random (0x01)
                Identity: F2:F1:06:3D:9C:42 (Static)
              RSSI: -74 dBm (0xb6)
      < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2             #11357 [hci0] 84680.458737
              Scanning: Disabled (0x00)
              Filter duplicates: Disabled (0x00)
      > HCI Event: Command Complete (0x0e) plen 4                        #11358 [hci0] 84680.469982
            LE Set Scan Enable (0x08|0x000c) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Create Connection (0x08|0x000d) plen 25          #11359 [hci0] 84680.470444
              Scan interval: 60.000 msec (0x0060)
              Scan window: 60.000 msec (0x0060)
              Filter policy: White list is not used (0x00)
              Peer address type: Random (0x01)
              Peer address: 53:38:DA:46:8C:45 (Resolvable)
                Identity type: Public (0x00)
                Identity: 11:22:33:44:55:66 (OUI 11-22-33)
              Own address type: Random (0x01)
              Min connection interval: 30.00 msec (0x0018)
              Max connection interval: 50.00 msec (0x0028)
              Connection latency: 0 (0x0000)
              Supervision timeout: 420 msec (0x002a)
              Min connection length: 0.000 msec (0x0000)
              Max connection length: 0.000 msec (0x0000)
      > HCI Event: Command Status (0x0f) plen 4                          #11360 [hci0] 84680.474971
            LE Create Connection (0x08|0x000d) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Create Connection Cancel (0x08|0x000e) plen 0    #11361 [hci0] 84682.545385
      > HCI Event: Command Complete (0x0e) plen 4                        #11362 [hci0] 84682.551014
            LE Create Connection Cancel (0x08|0x000e) ncmd 1
              Status: Success (0x00)
      > HCI Event: LE Meta Event (0x3e) plen 19                          #11363 [hci0] 84682.551074
            LE Connection Complete (0x01)
              Status: Unknown Connection Identifier (0x02)
              Handle: 0
              Role: Master (0x00)
              Peer address type: Public (0x00)
              Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
              Connection interval: 0.00 msec (0x0000)
              Connection latency: 0 (0x0000)
              Supervision timeout: 0 msec (0x0000)
              Master clock accuracy: 0x00
      
      After patch:
      < HCI Command: LE Set Scan Parameters (0x08|0x000b) plen 7    #210 [hci0] 667.152459
              Type: Passive (0x00)
              Interval: 60.000 msec (0x0060)
              Window: 30.000 msec (0x0030)
              Own address type: Random (0x01)
              Filter policy: Accept all advertisement, inc. directed unresolved RPA (0x02)
      > HCI Event: Command Complete (0x0e) plen 4                   #211 [hci0] 667.153613
            LE Set Scan Parameters (0x08|0x000b) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2        #212 [hci0] 667.153704
              Scanning: Enabled (0x01)
              Filter duplicates: Enabled (0x01)
      > HCI Event: Command Complete (0x0e) plen 4                   #213 [hci0] 667.154584
            LE Set Scan Enable (0x08|0x000c) ncmd 1
              Status: Success (0x00)
      > HCI Event: LE Meta Event (0x3e) plen 18                     #214 [hci0] 667.182619
            LE Direct Advertising Report (0x0b)
              Num reports: 1
              Event type: Connectable directed - ADV_DIRECT_IND (0x01)
              Address type: Random (0x01)
              Address: 50:52:D9:A6:48:A0 (Resolvable)
                Identity type: Public (0x00)
                Identity: 11:22:33:44:55:66 (OUI 11-22-33)
              Direct address type: Random (0x01)
              Direct address: 7C:C1:57:A5:B7:A8 (Resolvable)
                Identity type: Random (0x01)
                Identity: F4:28:73:5D:38:B0 (Static)
              RSSI: -70 dBm (0xba)
      < HCI Command: LE Set Scan Enable (0x08|0x000c) plen 2       #215 [hci0] 667.182704
              Scanning: Disabled (0x00)
              Filter duplicates: Disabled (0x00)
      > HCI Event: Command Complete (0x0e) plen 4                  #216 [hci0] 667.183599
            LE Set Scan Enable (0x08|0x000c) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Set Random Address (0x08|0x0005) plen 6    #217 [hci0] 667.183645
              Address: 7C:C1:57:A5:B7:A8 (Resolvable)
                Identity type: Random (0x01)
                Identity: F4:28:73:5D:38:B0 (Static)
      > HCI Event: Command Complete (0x0e) plen 4                  #218 [hci0] 667.184590
            LE Set Random Address (0x08|0x0005) ncmd 1
              Status: Success (0x00)
      < HCI Command: LE Create Connection (0x08|0x000d) plen 25    #219 [hci0] 667.184613
              Scan interval: 60.000 msec (0x0060)
              Scan window: 60.000 msec (0x0060)
              Filter policy: White list is not used (0x00)
              Peer address type: Random (0x01)
              Peer address: 50:52:D9:A6:48:A0 (Resolvable)
                Identity type: Public (0x00)
                Identity: 11:22:33:44:55:66 (OUI 11-22-33)
              Own address type: Random (0x01)
              Min connection interval: 30.00 msec (0x0018)
              Max connection interval: 50.00 msec (0x0028)
              Connection latency: 0 (0x0000)
              Supervision timeout: 420 msec (0x002a)
              Min connection length: 0.000 msec (0x0000)
              Max connection length: 0.000 msec (0x0000)
      > HCI Event: Command Status (0x0f) plen 4                    #220 [hci0] 667.186558
            LE Create Connection (0x08|0x000d) ncmd 1
              Status: Success (0x00)
      > HCI Event: LE Meta Event (0x3e) plen 19                    #221 [hci0] 667.485824
            LE Connection Complete (0x01)
              Status: Success (0x00)
              Handle: 0
              Role: Master (0x00)
              Peer address type: Random (0x01)
              Peer address: 50:52:D9:A6:48:A0 (Resolvable)
                Identity type: Public (0x00)
                Identity: 11:22:33:44:55:66 (OUI 11-22-33)
              Connection interval: 50.00 msec (0x0028)
              Connection latency: 0 (0x0000)
              Supervision timeout: 420 msec (0x002a)
              Master clock accuracy: 0x07
      @ MGMT Event: Device Connected (0x000b) plen 13          {0x0002} [hci0] 667.485996
              LE Address: 11:22:33:44:55:66 (OUI 11-22-33)
              Flags: 0x00000000
              Data length: 0
      Signed-off-by: NSzymon Janc <szymon.janc@codecoup.pl>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      082f2300
  11. 30 10月, 2017 1 次提交
  12. 17 2月, 2017 1 次提交
  13. 13 7月, 2016 1 次提交
    • S
      Bluetooth: Add Authentication Failed reason to Disconnected Mgmt event · 160b9251
      Szymon Janc 提交于
      If link is disconnected due to Authentication Failure (PIN or Key
      Missing status) userspace will be notified about this with proper error
      code. Many LE profiles define "PIN or Key Missing" status as indication
      of remote lost bond so this allows userspace to take action on this.
      
      @ Device Connected: 88:63:DF:88:0E:83 (1) flags 0x0000
              02 01 1a 05 03 0a 18 0d 18 0b 09 48 65 61 72 74  ...........Heart
              20 52 61 74 65                                    Rate
      > HCI Event: Command Status (0x0f) plen 4
            LE Read Remote Used Features (0x08|0x0016) ncmd 1
              Status: Success (0x00)
      > ACL Data RX: Handle 3585 flags 0x02 dlen 11
            ATT: Read By Group Type Request (0x10) len 6
              Handle range: 0x0001-0xffff
              Attribute group type: Primary Service (0x2800)
      > HCI Event: LE Meta Event (0x3e) plen 12
            LE Read Remote Used Features (0x04)
              Status: Success (0x00)
              Handle: 3585
              Features: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                LE Encryption
      < HCI Command: LE Start Encryption (0x08|0x0019) plen 28
              Handle: 3585
              Random number: 0x0000000000000000
              Encrypted diversifier: 0x0000
              Long term key: 26201cd479a0921b6f949f0b1fa8dc82
      > HCI Event: Command Status (0x0f) plen 4
            LE Start Encryption (0x08|0x0019) ncmd 1
              Status: Success (0x00)
      > HCI Event: Encryption Change (0x08) plen 4
              Status: PIN or Key Missing (0x06)
              Handle: 3585
              Encryption: Disabled (0x00)
      < HCI Command: Disconnect (0x01|0x0006) plen 3
              Handle: 3585
              Reason: Authentication Failure (0x05)
      > HCI Event: Command Status (0x0f) plen 4
            Disconnect (0x01|0x0006) ncmd 1
              Status: Success (0x00)
      > HCI Event: Disconnect Complete (0x05) plen 4
              Status: Success (0x00)
              Handle: 3585
              Reason: Connection Terminated By Local Host (0x16)
      @ Device Disconnected: 88:63:DF:88:0E:83 (1) reason 4
      
      @ Device Connected: C4:43:8F:A3:4D:83 (0) flags 0x0000
              08 09 4e 65 78 75 73 20 35                       ..Nexus 5
      > HCI Event: Command Status (0x0f) plen 4
            Authentication Requested (0x01|0x0011) ncmd 1
              Status: Success (0x00)
      > HCI Event: Link Key Request (0x17) plen 6
              Address: C4:43:8F:A3:4D:83 (LG Electronics)
      < HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
              Address: C4:43:8F:A3:4D:83 (LG Electronics)
              Link key: 080812e4aa97a863d11826f71f65a933
      > HCI Event: Command Complete (0x0e) plen 10
            Link Key Request Reply (0x01|0x000b) ncmd 1
              Status: Success (0x00)
              Address: C4:43:8F:A3:4D:83 (LG Electronics)
      > HCI Event: Auth Complete (0x06) plen 3
              Status: PIN or Key Missing (0x06)
              Handle: 75
      @ Authentication Failed: C4:43:8F:A3:4D:83 (0) status 0x05
      < HCI Command: Disconnect (0x01|0x0006) plen 3
              Handle: 75
              Reason: Remote User Terminated Connection (0x13)
      > HCI Event: Command Status (0x0f) plen 4
            Disconnect (0x01|0x0006) ncmd 1
              Status: Success (0x00)
      > HCI Event: Disconnect Complete (0x05) plen 4
              Status: Success (0x00)
              Handle: 75
              Reason: Connection Terminated By Local Host (0x16)
      @ Device Disconnected: C4:43:8F:A3:4D:83 (0) reason 4
      Signed-off-by: NSzymon Janc <szymon.janc@codecoup.pl>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      160b9251
  14. 10 7月, 2016 1 次提交
    • M
      Bluetooth: Rename HCI_BREDR into HCI_PRIMARY · ca8bee5d
      Marcel Holtmann 提交于
      The HCI_BREDR naming is confusing since it actually stands for Primary
      Bluetooth Controller. Which is a term that has been used in the latest
      standard. However from a legacy point of view there only really have
      been Basic Rate (BR) and Enhanced Data Rate (EDR). Recent versions of
      Bluetooth introduced Low Energy (LE) and made this terminology a little
      bit confused since Dual Mode Controllers include BR/EDR and LE. To
      simplify this the name HCI_PRIMARY stands for the Primary Controller
      which can be a single mode or dual mode controller.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      ca8bee5d
  15. 09 4月, 2016 1 次提交
  16. 06 1月, 2016 1 次提交
  17. 10 12月, 2015 2 次提交
  18. 26 10月, 2015 1 次提交
  19. 22 10月, 2015 1 次提交
  20. 16 10月, 2015 2 次提交
    • J
      Bluetooth: Fix LE reconnection logic · 49c50922
      Johan Hedberg 提交于
      We can't use hci_explicit_connect_lookup() since that would only cover
      explicit connections, leaving normal reconnections completely
      untouched. Not using it in turn means leaving out entries in
      pend_le_reports.
      
      To fix this and simplify the logic move conn params from the reports
      list to the pend_le_conns list for the duration of an explicit
      connect. Once the connect is complete move the params back to the
      pend_le_reports list. This also means that the explicit connect lookup
      function only needs to look into the pend_le_conns list.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      49c50922
    • J
      Bluetooth: Fix double scan updates · 168b8a25
      Jakub Pawlowski 提交于
      When disable/enable scan command is issued twice, some controllers
      will return an error for the second request, i.e. requests with this
      command will fail on some controllers, and succeed on others.
      
      This patch makes sure that unnecessary scan disable/enable commands
      are not issued.
      
      When adding device to the auto connect whitelist when there is pending
      connect attempt, there is no need to update scan.
      
      hci_connect_le_scan_cleanup is conditionally executing
      hci_conn_params_del, that is calling hci_update_background_scan. Make
      the other case also update scan, and remove reduntand call from
      hci_connect_le_scan_remove.
      
      When stopping interleaved discovery the state should be set to stopped
      only when both LE scanning and discovery has stopped.
      Signed-off-by: NJakub Pawlowski <jpawlowski@google.com>
      Acked-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      168b8a25
  21. 18 9月, 2015 1 次提交
    • S
      Bluetooth: Fix reporting incorrect EIR in device found mgmt event · 6818375e
      Szymon Janc 提交于
      Some remote devices (ie Gigaset G-Tag) misbehave with ADV data length.
      This can lead to incorrect EIR format in device found event when
      ADV_DATA and SCAN_RSP are merged (terminator field before SCAN_RSP
      part).
      
      Fix this by inspecting ADV_DATA and correct its length if terminator
      is found.
      
      > HCI Event: LE Meta Event (0x3e) plen 42              [hci0] 32.172182
            LE Advertising Report (0x02)
              Num reports: 1
              Event type: Connectable undirected - ADV_IND (0x00)
              Address type: Public (0x00)
              Address: 7C:2F:80:94:97:5A (Gigaset Communications GmbH)
              Data length: 30
              Flags: 0x06
                LE General Discoverable Mode
                BR/EDR Not Supported
              Company: Gigaset Communications GmbH (384)
                Data: 021512348094975abbc5
              16-bit Service UUIDs (partial): 1 entry
                Battery Service (0x180f)
              RSSI: -65 dBm (0xbf)
      > HCI Event: LE Meta Event (0x3e) plen 27              [hci0] 32.172191
            LE Advertising Report (0x02)
              Num reports: 1
              Event type: Scan response - SCAN_RSP (0x04)
              Address type: Public (0x00)
              Address: 7C:2F:80:94:97:5A (Gigaset Communications GmbH)
              Data length: 15
              Name (complete): Gigaset G-tag
              RSSI: -59 dBm (0xc5)
      
      Note "Data length: 30" in ADV_DATA which results in 9 extra zero bytes
      after Battery Service UUID. Terminator field present in the middle of
      EIR in Device Found event resulted in userspace stop parsing EIR and
      skipping device name.
      
      @ Device Found: 7C:2F:80:94:97:5A (1) rssi -59 flags 0x0000
            02 01 06 0d ff 80 01 02 15 12 34 80 94 97 5a bb  ..........4...Z.
            c5 03 02 0f 18 00 00 00 00 00 00 00 00 00 0e 09  ................
            47 69 67 61 73 65 74 20 47 2d 74 61 67           Gigaset G-tag
      
      With this fix EIR with merged ADV_DATA and SCAN_RSP in device found
      event is properly formatted:
      
      @ Device Found: 7C:2F:80:94:97:5A (1) rssi -59 flags 0x0000
            02 01 06 0d ff 80 01 02 15 12 34 80 94 97 5a bb  ..........4...Z.
            c5 03 02 0f 18 0e 09 47 69 67 61 73 65 74 20 47  .......Gigaset G
            2d 74 61 67                                      -tag
      Signed-off-by: NSzymon Janc <ext.szymon.janc@tieto.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      6818375e
  22. 29 8月, 2015 1 次提交
    • K
      Bluetooth: Fix SCO link type handling on connection complete · 618353b1
      Kuba Pawlak 提交于
      Synchronous connections are initially created with type eSCO.
      Link manager may reject proposed link parameters, which triggers
      connection setup retry with a different set. Link type embedded
      in responses should be disregarded until Synchronous Connect Complete
      returns Success (0x00). Current code updates link type every time
      which creates an issue when link type changes to SCO and back to eSCO
      on further attepts.
      
      Issue happens with BlackBerry 9100 and 9700 with Intel WilkinsPeak
      on third connection setup attept
      
      2015-05-18 01:27:57.332242 < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
          handle 256 voice setting 0x0060 ptype 0x0380
      2015-05-18 01:27:57.333604 > HCI Event: Command Status (0x0f) plen 4
          Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
      2015-05-18 01:27:57.334614 > HCI Event: Synchronous Connect Complete (0x2c) plen 17
          status 0x1a handle 0 bdaddr 30:7C:30:B3:A8:86 type SCO
          Error: Unsupported Remote Feature / Unsupported LMP Feature
      2015-05-18 01:27:57.334895 < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
          handle 256 voice setting 0x0060 ptype 0x0380
      2015-05-18 01:27:57.335601 > HCI Event: Command Status (0x0f) plen 4
          Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
      2015-05-18 01:27:57.336610 > HCI Event: Synchronous Connect Complete (0x2c) plen 17
          status 0x1a handle 0 bdaddr 30:7C:30:B3:A8:86 type SCO
          Error: Unsupported Remote Feature / Unsupported LMP Feature
      2015-05-18 01:27:57.336685 < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
          handle 256 voice setting 0x0060 ptype 0x03c8
      2015-05-18 01:27:57.337603 > HCI Event: Command Status (0x0f) plen 4
          Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
      2015-05-18 01:27:57.342608 > HCI Event: Max Slots Change (0x1b) plen 3
          handle 256 slots 1
      2015-05-18 01:27:57.377631 > HCI Event: Synchronous Connect Complete (0x2c) plen 17
          status 0x00 handle 257 bdaddr 30:7C:30:B3:A8:86 type eSCO
          Air mode: CVSD
      Signed-off-by: NKuba Pawlak <kubax.t.pawlak@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      618353b1
  23. 11 8月, 2015 2 次提交
  24. 30 7月, 2015 2 次提交